import { PropertyValues } from 'lit'; import { UElement } from '../UElement.js'; import { DateDisabledFn } from './dates.js'; export interface CalendarDaySelectDetail { /** The chosen day as ISO `YYYY-MM-DD`. */ date: string; } export interface CalendarRangeSelectDetail { /** First day of the chosen range (ISO), never after `end`. */ start: string; /** Last day of the chosen range (ISO), never before `start`. */ end: string; } export type CalendarSelection = 'single' | 'range'; /** * 날짜 피커들이 공유하는 달력 격자 — **내부 요소**다(배럴에서 내보내지 않는다). * * 격자 조립, 키보드 이동(APG grid), `min`/`max` 비활성, 오늘 표시, 여러 달 나란히 보기를 * 소유한다. 값을 «확정»하지는 않는다 — 무엇을 골랐는지만 알리고, 그것을 값으로 삼을지는 * 감싸는 피커가 정한다(피커마다 확정 규칙이 다르다: 단일은 즉시, 범위·일시는 [적용]일 수 있다). * * `selection="range"` 에서는 두 번 고른다 — 첫 날이 «앵커» 가 되고, 포인터나 키보드 초점이 * 머무는 날까지가 미리 표시된다. 두 번째 날을 고르면 둘 중 앞선 날이 시작이 되어 * `range-select` 가 난다(순서는 구성으로 보장된다 — 뒤집힌 범위는 만들어지지 않는다). * 앵커가 있는 동안 Escape 는 앵커만 지운다(그 Escape 는 감싸는 피커로 가지 않는다). * 앵커를 고른 순간은 화면 밖 상태 영역(`role="status"`)이 «시작일 … 종료일을 고르세요» 로 * 알린다 — 화면에서는 띠가 보이지만 보조기술에는 «선택됨» 하나만 들린다. * * 감싸는 피커의 공개 `::part` 를 지키기 위해 파트 이름은 종전 `u-date-picker` 의 것을 * 그대로 쓰고, 피커가 `exportparts` 로 다시 내보낸다. * * @csspart calendar-month - one month block (header + weekdays + grid) * @csspart calendar-header - the month navigation header * @csspart calendar-title - the "Month Year" title * @csspart calendar-weekdays - the weekday header row * @csspart calendar-grid - the date grid * @csspart calendar-week - one week row inside the date grid * @csspart day - a date cell button * * @event day-select - a day cell was activated (click, Enter, Space) in `selection="single"`. * `detail.date` is ISO. Never fires for an out-of-range day. * @event range-select - the second day of a range was activated in `selection="range"`. * `detail.start` ≤ `detail.end`, both ISO; the same day twice gives a one-day range. * * @internal */ export declare class UCalendar extends UElement { /** 목록 밖의 값은 어떤 규칙에도 안 걸려 조용히 기본 모양이 된다 — 개발 모드에서 한 번 알린다(`UElement.enumerated`). */ static enumerated: { selection: readonly CalendarSelection[]; }; static styles: import('lit').CSSResultGroup[]; /** `single` picks one day (`value`); `range` picks two (`start`/`end`). */ selection: CalendarSelection; /** Selected day (ISO `YYYY-MM-DD`) — drawn as `aria-selected`. `selection="single"` only. */ value?: string; /** First day of the selected range (ISO). `selection="range"` only. */ start?: string; /** Last day of the selected range (ISO). `selection="range"` only. */ end?: string; /** Earliest selectable day (ISO), inclusive. */ min?: string; /** Latest selectable day (ISO), inclusive. */ max?: string; /** App rule for days that cannot be chosen (ISO in, `true` = unavailable) — drawn and refused like * a day outside `min`/`max`. */ isDateDisabled?: DateDisabledFn; /** How many consecutive months to show side by side. */ visibleMonths: number; /** First visible month (always the 1st of a month). */ private viewDate; /** The one day cell in the tab order (roving tabindex). */ private focusedDate; /** First day of a range being picked (`selection="range"`), until the second day is chosen. */ private anchor?; /** The day the pointer rests on — previews the range while an anchor is set. */ private hoverDate?; private grabFocusOnUpdate; /** Writes a day-of-month in the active locale's digits — rebuilt every render, so a locale change is picked up. */ private dayNumber; /** 이 렌더에서 쓰는 주의 첫 요일(0 = 일 … 6 = 토) — 머리글 · 격자 앞 빈 칸 · Home/End 가 한 값을 읽는다. */ private weekStart; /** * Shows the month containing `date` (ISO or `Date`) as the first visible month and makes * that day the roving-tabindex target. Does not move DOM focus — call `focusDay()` for that. */ showDate(date: string | Date): void; /** Moves DOM focus to the roving-tabindex day cell once the current render has settled. */ focusDay(): Promise; protected updated(changed: PropertyValues): void; render(): import('lit-html').TemplateResult<1>; private renderMonth; /** The range to draw: the preview while an anchor is set, otherwise the selected range. */ private shownRange; private renderDay; private dayButton; private activate; private handlePointerLeave; private handlePrevMonth; private handleNextMonth; private navigateMonth; private handleDayKeydown; private moveFocus; } declare global { interface HTMLElementTagNameMap { 'u-calendar': UCalendar; } interface HTMLElementEventMap { 'day-select': CustomEvent; 'range-select': CustomEvent; } }