import { EventEmitter } from '../../stencil-public-runtime'; import { CalendarRangeEndType } from './meta/types'; /** * @slot preselection - Add `HTML elements` or `components` shown in the calendar preselection area. * @category forms */ export declare class MdsCalendar { private t; private host; hasPreselection: boolean; private currentDate; private weekDaysinMonth; weekdays: string[]; currentView: 'calendar' | 'years' | 'months'; selectedYear: number; /** * If set, the component selects a single date instead of a date range (start and end date). */ readonly singlePicker: boolean; /** * If set, the component hides the previous navigation button in the calendar header. */ readonly hidePreviousButton: boolean; /** * If set, the component hides the next navigation button in the calendar header. */ readonly hideNextButton: boolean; /** * Disables switching to month or year selection views from the calendar header. */ readonly disableMonthYearSelection: boolean; /** * If set, the component hides the preselection area above the calendar view even when the * `preselection` slot has content. */ readonly hidePreselection: boolean; /** * Hides the highlight on today's date in the calendar view. */ readonly hideToday: boolean; /** * Specifies the date used to determine the visible month without changing the selection. * @description It's in ISO format (YYYY-MM-DD). * @example '2023-10-01' */ readonly viewDate: string | null; /** * Specifies the date used to preview the range selection across multiple visible calendars. * @description It's in ISO format (YYYY-MM-DD). * @example '2023-10-15' */ readonly hoverDate: string | null; /** * Specifies the start date of the selection * @description It's in ISO format (YYYY-MM-DD). * @example '2023-10-01' */ readonly startDate: string | null; /** * Specifies the end date of the selection * @description It's in ISO format (YYYY-MM-DD). * @example '2023-10-01' */ readonly endDate: string | null; /** * Specifies the end of the range the next click picks, `start` or `end`, for a parent that * lets the user choose it, as `mds-input-date-range` does from its fields and from the header * of its panel. A click never puts the range backwards: a day after the end, picked as the * start, becomes the new start and empties the end; a day before the start, picked as the end, * becomes the new start and leaves the end to pick. With no start, a click picks the start. * Left unset, the calendar picks the start, then the end, and a click on a complete range * starts a new one. */ readonly activeEnd?: CalendarRangeEndType; /** * Specifies the minimum date of the selection * @description It's in ISO format (YYYY-MM-DD). * @example '2023-10-01' */ readonly min: string | null; /** * Specifies the minimum date of the selection * @description It's in ISO format (YYYY-MM-DD). * @example '2023-10-01' */ readonly max: string | null; internalStartDate: string | null; internalEndDate: string | null; /** * Emitted when the selected date or date range changes. */ datesEmitter: EventEmitter<{ startDate: string; endDate?: string; }>; /** * Emitted when the user navigates to a different month or year. */ navigationEmitter: EventEmitter<{ currentDate: string; delta: number; }>; /** * Emitted when the user hovers over a day, used to preview a range selection. */ hoverEmitter: EventEmitter<{ hoverDate: string | null; }>; /** * Emitted when the calendar's preselection options need to be re-evaluated. */ checkPreselectionsEmitter: EventEmitter; handleStartDate(): void; handleEndDate(): void; handleViewDate(newValue: string | null): void; handleHoverDate(): void; /** The ends whose prop changed since the range was last read from the props. */ private pendingRangeProps; /** * A parent sets `start-date` and `end-date` one after the other: the range is read once both * have arrived, in a microtask. Read at the first of the two, a start moved past the old end * looked like a range given backwards, and the calendar swapped the new start with the old end * and warned (the second calendar of `mds-input-date-range`, #341). */ private queueRangeProps; private readonly applyRangeProps; /** * A range given backwards, a start after its end, is put in order. The warning always said * the values were swapped, but the calendar kept the dates it was given and drew nothing new, * and at load the order was not checked at all. */ private orderRange; /** * Normalizes a date prop to an ISO 8601 date, treating an empty or invalid value as unset * (`null`). An invalid value is reported with a warning instead of breaking the component * lifecycle. */ private parseDateProp; /** The day under the pointer in this calendar, while a range waits for its end. */ private internalHoverDate; currentMonth: string; private currentMonthNumber; currentYear: string; componentWillLoad(): void; private readonly updatePreselection; componentDidLoad(): void; disconnectedCallback(): void; /** * Sets the calendar's current date and re-renders the calendar accordingly. * @param date the date to display, in ISO format (YYYY-MM-DD) */ updateCurrentDate(date: string): Promise; /** A range with its start and still without its end, the one a pointer previews. */ private waitsForEnd; private readonly handleMouseOver; private readonly handleMouseLeave; /** * The date previewed on hover: a `hover-date` set by a parent wins over the cell hovered in * this calendar, so that the parent can spread the preview across several visible calendars. */ private resolveHoverDate; /** * The end the next click picks: the one the parent names in `active-end`, the start while the * range has none, and otherwise the end, then a new range, as two clicks alternate. */ private resolveActiveEnd; /** * The range a click on `day` leaves. Criterion (#341, decided with vittorio on 2026-11-11): a * click changes the end being picked and never puts the range backwards, nor swaps its ends. * Picking the end, a day before the start becomes the new start and the end is still to pick. * Picking the start, a day after the end becomes the new start and the end is emptied, the * symmetric case: the day clicked is the one the user wants, and it can only be a start. */ private nextRange; private updateDates; private updateCalendar; /** * Draws the selection on the day cells. A chosen day, either end of a range or the day of a * single picker, is `start`, `end` or `single` with no `preview`; the days between the ends are * `middle`. While a range waits for its end, the day under the pointer is previewed: when a * click there would pick the end, the band from the start to that day is drawn as a `preview`, * the start still drawn as chosen; when it would pick a new start, that day alone is a * `single` `preview` and the start keeps its mark. */ private setDates; private readonly singleMark; private rangeMark; private changeMonth; private readonly handleMonthActionClick; private readonly handleYearActionClick; private calculateWeekDaysInMonth; /** * Picks an end of the range with a click on `day`, as `nextRange` decides, and redraws it: a * standalone calendar has no parent echoing the range through start-date / end-date, so * nothing else would mark the two ends. The preview left by the pointer is dropped with the * old range: it starts again from the next day the pointer reaches. */ private handleRange; private handleSingleSelection; private handlePrev; private handleNext; private isDateDisabled; private readonly handleCellClick; private readonly handleMonthSelect; private readonly handleYearSelect; render(): any; }