import { type PropertyValues } from 'lit'; import { type Era } from '../../core/date.js'; import { UiElement } from '../shared/element.js'; /** What a heading select shows, given by its ``: the day it moves from (the first month's), the limits and the language. */ export interface CalendarHeadingView { /** The focused day; with several months, that day in the first month. */ focus: Date; min: string; max: string; locale: string; era: Era; /** The select's name for assistive tech (the calendar's translation: Month / Year). */ label: string; } /** Detail of `ui-focus-day`: the day the calendar should move its focus to. */ export interface CalendarFocusDayDetail { date: Date; } interface Choice { value: number; label: string; disabled: boolean; } /** * A native select in ``'s heading (Cally `calendar-select-month` / `calendar-select-year`): the calendar * gives it `view`; a choice asks the calendar, with `ui-focus-day`, to move its focus. */ declare abstract class CalendarSelect extends UiElement { static readonly shadowRootOptions: ShadowRootInit; static readonly styles: import("lit").CSSResult[]; /** Set by the enclosing `` (its own heading, or the elements slotted into its `heading` slot). */ view?: CalendarHeadingView; private readonly select; protected abstract choices(view: CalendarHeadingView): { options: Choice[]; selected: number; }; /** The day a choice of `value` moves to. */ protected abstract dayFor(view: CalendarHeadingView, value: number): Date; protected updated(changed: PropertyValues): void; private onChange; render(): import("lit-html").TemplateResult<1>; } /** * The month select of ``'s heading (Cally `calendar-select-month`): the months of the year shown, those * wholly outside `min` / `max` off. `` shows one by default; put your own in its `heading` slot. * * @csspart label - The visually hidden label * @csspart select - The native select * @slot label - Replaces the label (default: the calendar's "Month") * @fires ui-focus-day - Detail `{ date }`, a month was chosen: the enclosing calendar moves its focus there */ export declare class UiCalendarSelectMonth extends CalendarSelect { /** Month names `long` (October) or `short` (Oct), as Cally's `format-month`. */ formatMonth: 'long' | 'short'; protected choices(view: CalendarHeadingView): { options: { value: number; label: string; disabled: boolean; }[]; selected: number; }; protected dayFor(view: CalendarHeadingView, month: number): Date; } /** * The year select of ``'s heading (Cally `calendar-select-year`): `max-years` years around the year shown, * cut to those `min` / `max` allow, in the calendar's era (พ.ศ. in Thai). `` shows one by default; put * your own in its `heading` slot. * * @csspart label - The visually hidden label * @csspart select - The native select * @slot label - Replaces the label (default: the calendar's "Year") * @fires ui-focus-day - Detail `{ date }`, a year was chosen: the enclosing calendar moves its focus there */ export declare class UiCalendarSelectYear extends CalendarSelect { /** How many years to offer, around the year shown (Cally's `max-years`, default 20). */ maxYears: number; protected choices(view: CalendarHeadingView): { options: { value: number; label: string; disabled: boolean; }[]; selected: number; }; protected dayFor(view: CalendarHeadingView, year: number): Date; } declare global { interface HTMLElementTagNameMap { 'ui-calendar-select-month': UiCalendarSelectMonth; 'ui-calendar-select-year': UiCalendarSelectYear; } } export {};