import { EventEmitter } from '../../stencil-public-runtime'; import { InputSizeType } from "../../type/input"; import { CalendarRangeEndType } from "../mds-calendar/meta/types"; export interface EventDate { caller: HTMLMdsInputDateRangePreselectionElement; start: string; end?: string; } /** * @slot calendar-preselection - Add `HTML elements` or `components` to this slot. * @slot start - Add `HTML elements` or `components` to this slot. * @slot end - Add `HTML elements` or `components` to this slot. * @category forms */ export declare class MdsInputDateRange { host: HTMLMdsInputDateRangeElement; internals: ElementInternals; calendarKey: number; internalStartDate: string; internalEndDate: string; visibleCalendarDate: string; dropdownRef?: HTMLMdsDropdownElement; hasPreselection: boolean; /** * The end of the range the calendar picks: the one of the field last focused or clicked, or of * the voice of the header clicked; after a pick in the calendar, the end. With no start it is * the start whatever this says, see effectiveActiveEnd(). */ activeEnd: CalendarRangeEndType; private formDisabled; private t; /** * The accessible name of the range: each of the two fields is named after it and after the * end of the range it covers, the visible "from" and "to" labels living in this shadow root, * where no IDREF of the slotted fields could reach them. */ readonly accessibleName?: string; /** * Specifies the start date of the range * @description It's in ISO format (YYYY-MM-DD). * @example '2025-06-01' */ startDate: string; /** * Specifies the end date of the range * @description It's in ISO format (YYYY-MM-DD). * @example '2025-06-30' */ endDate: string; /** * Specifies the min date of the range, user cannot set dates before this date * @description It's in ISO format (YYYY-MM-DD). * @example '2025-01-01' */ min: string | null; /** * Specifies the max date of the range, user cannot set dates after this date * @description It's in ISO format (YYYY-MM-DD). * @example '2025-12-31' */ max: string | null; /** * Specifies the delay in milliseconds before closing the calendar dropdown after the click that * picks the end of the range, if the value is 0 the dropdown will not close; a click that picks * the start leaves it open for the end * @description Default is 500 */ readonly delay: number; /** * Specifies the height of the field, the same as `mds-button`: `sm` 28px, `md` 36px, `lg` 48px */ readonly size?: InputSizeType; /** * Hides the highlight on today's date in the calendar. */ readonly hideToday: boolean; /** * Enables the linked dual-calendar range picker behavior. */ readonly dualCalendar: boolean; /** * Is needed to reference the form data after the form is submitted */ readonly name?: string; /** * Disables the range, like a disabled native input: the dates cannot be changed, from the fields * or from the calendar, and are left out of the form. It disables the two slotted fields too. A * disabled `
` around the component does the same. */ readonly disabled?: boolean; private togglePreselection; private lastEmittedStartDate; private lastEmittedEndDate; private initialStartDate; private initialEndDate; private hoveredCalendarDate; private syncingInputSlots; private getCalendars; private resolveVisibleCalendarDate; private getCalendarViewDate; private setVisibleCalendarDate; private closeDropdownAfterSelection; /** Before the user names one, the calendar picks the end the range lacks, else the start. */ private firstMissingEnd; /** A range is picked from its start: with no start, the calendar picks the start. */ private effectiveActiveEnd; private syncCalendarsHoverAttributes; private clearHoverPreview; /** * Emitted when the selected start or end date changes. */ valueChanged: EventEmitter<{ startDate: string; endDate: string; }>; /** A date inside `min` and `max`, the bounds that are set. */ private isWithinRange; private getEmittableDateRangeDetail; private emitValueChanged; handleStartDateChange(newValue: string): void; handleEndDateChange(newValue: string): void; handleRangeChange(): void; handleDisabledChange(): void; /** * Bounds both fields, as the range promises: min and max reach the slotted dates, which flag a * date typed outside them and report it to the form. At load a bound the range does not set * leaves the one written on the field alone; a bound changed later always reaches the fields. */ private forwardRange; /** * Disables both fields with the range. At load a range that is not disabled leaves a field * disabled on its own alone; a disabled changed later always reaches the fields. A disabled * fieldset needs no forwarding: the fields are inside it and follow it themselves. */ private forwardDisabled; private slottedField; componentWillLoad(): void; disconnectedCallback(): void; /** * Applies the given preselection range to the input. * @param event the preselection range to apply */ preselect(event: EventDate): Promise; private handleFocusOut; /** The end of the range a slotted field covers, for an event coming from inside it. */ private endOfField; private handleFocusIn; private focusInput; private handleHostClick; private focusStartDateInput; private focusEndDateInput; private readonly nameSlottedFields; componentDidLoad(): void; formDisabledCallback(disabled: boolean): void; private isDisabled; formResetCallback(): void; private syncExternalDate; private updateInputValue; private updateInputListeners; private createFocusoutListener; private validateDateRange; private checkPreselections; private handleCalendarHover; /** * A pick in the calendar. Whatever end it picked, the end is the one picked next: picked the * start, the user goes on to the end; picked the end, a second click corrects it. The panel * closes `delay` ms after a click that completes the range by picking its end, never after one * that picks its start, which leaves the end to pick or to keep (#341). */ private handleCalendarChange; private readonly handleEndTabChange; private readonly keepPanelOpen; /** The voice of an end in the header: its name and its date, or the invitation to pick one. */ private endVoice; /** * The header of the panel: the two ends of the range, each with its date, the one the calendar * picks selected. A strip of mds-tab, as Magma has no segmented control and mds-button-group * groups actions with no selected state. The end has nothing to pick until the start is set. */ private renderEnds; private handleCalendarNavigate; private readonly handleCalendarPreselect; private readonly handleOpenCalendarClick; private renderCalendarPreselectionPanel; private renderSingleCalendar; private renderDualCalendars; render(): any; private syncFormValue; }