/** * TyCalendar Web Component — orchestrates ty-calendar-navigation + * ty-calendar-month: owns selection state, distributes properties to the * children, and participates in forms via ElementInternals. */ import './calendar-month.js'; import './calendar-navigation.js'; import type { DayContentFn, CalendarSize } from './calendar-month.js'; import { type DayContext } from '../utils/calendar-utils.js'; /** * Calendar change event detail (day selection) */ export interface CalendarChangeDetail { year: number; month: number; day: number; action: 'select'; source: 'day-click'; dayContext: DayContext; } /** * Calendar navigate event detail (month/year change) */ export interface CalendarNavigateDetail { month: number; year: number; action: 'navigate'; source: 'navigation'; } /** * TyCalendar Web Component */ export declare class TyCalendar extends HTMLElement { private _state; private _hideNavigation; private _stateless; private _size; private _width?; private _dayContentFn?; private _customCSS?; private _min?; private _max?; private _flavor; private _navigation?; private _monthDisplay?; private _container?; private _view; private _monthGrid?; private _dayGridHeight; private _internals?; private _validity?; private _initialValue; private _initialized; private _valueSets; private _pressing; private _localeObserver?; static formAssociated: boolean; static get observedAttributes(): string[]; constructor(); connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; get min(): string | undefined; set min(value: string | undefined); get max(): string | undefined; set max(value: string | undefined); get flavor(): string; set flavor(value: string); get required(): boolean; set required(value: boolean); get year(): number | undefined; set year(value: number | undefined); get month(): number | undefined; set month(value: number | undefined); get day(): number | undefined; set day(value: number | undefined); get locale(): string; set locale(value: string); get hideNavigation(): boolean; set hideNavigation(value: boolean); get stateless(): boolean; set stateless(value: boolean); get size(): CalendarSize; set size(value: CalendarSize); get width(): string | undefined; set width(value: string | undefined); get dayContentFn(): DayContentFn | undefined; set dayContentFn(fn: DayContentFn | undefined); get customCSS(): CSSStyleSheet | undefined; set customCSS(sheet: CSSStyleSheet | undefined); get value(): string; /** * Reads what ty-date-picker reads: 'YYYY-MM-DD', 'YYYY-MM-DDTHH:mm[:ss]' * (that day), an ISO instant with Z/offset or epoch ms / a Date (its local * day). The value stays 'YYYY-MM-DD'; anything else is no value. */ set value(isoDate: string | number | Date | null | undefined); /** * Initialize state from HTML attributes on first load */ private initializeFromAttributes; formResetCallback(): void; private syncStateFromAttributes; private syncChildComponents; private updateFormValue; /** * required with no selection => valueMissing; a selection outside * [min, max] => rangeUnderflow/rangeOverflow (UI can't pick one, days are * disabled, but programmatic values can). With a native date input's * message. The grid's tab stop is the anchor, so a submit focuses it and * the browser shows its bubble there; the cells are rebuilt on every grid * render, so each one runs this again. */ private updateValidity; get form(): HTMLFormElement | null; get validity(): ValidityState | undefined; get validationMessage(): string; get willValidate(): boolean; checkValidity(): boolean; reportValidity(): boolean; setCustomValidity(message: string): void; private handleNavigationChange; /** Show a month (and emit navigate). Shared by the arrows, the month grid and Page Up / Page Down. */ private goTo; private handleDayClick; /** * Force re-render of the calendar * Useful after updating dayContentFn or other dynamic properties */ refresh(): void; private createNavigation; private createMonthDisplay; private render; private setView; /** Put the day grid or a freshly built month grid under the navigation. */ private showBody; private static monthIndex; /** min/max as month indices (null when unset) */ private boundIndices; private buildMonthGrid; private pickMonth; private handleKeydown; private focusNavTitle; /** * The grid's tab stop: the focused day, or month in the month view. When * every day shown is disabled (a value outside min/max) there is none: then * the selected day, or the first one; disabled cells still take focus. * Disabled month cells don't (buttons): with every month of the year * disabled, the navigation title (back to the days) stands in. */ private gridCell; /** Focus the grid's tab stop (see gridCell). */ focus(options?: FocusOptions): void; private focusDayGrid; }