@slotted/angular 0.1.0-beta.7 → 0.1.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -116,7 +116,7 @@
116
116
  "part": "previous",
117
117
  "element": "button",
118
118
  "required": true,
119
- "purpose": "One page back, in whichever view is showing: a month in the day view, a year in the month view, twelve years in the year view. Its chevron is the next trigger’s artwork turned, so both follow the document direction from one token."
119
+ "purpose": "One page back, in whichever view is showing: a month in the day view, a year in the month view, twelve years in the year view, and it is named for that step. Its chevron is the next trigger’s artwork turned, so both follow the document direction from one token."
120
120
  },
121
121
  {
122
122
  "part": "next",
@@ -299,6 +299,16 @@ class SlCalendar {
299
299
  ...(ngDevMode ? [{ debugName: "weekdayNarrow" }] : /* istanbul ignore next */ []));
300
300
  monthNames = computed(() => this.format().monthNames('short'), /* @ts-ignore */
301
301
  ...(ngDevMode ? [{ debugName: "monthNames" }] : /* istanbul ignore next */ []));
302
+ /** Each paging button is named for the step it takes in the view showing. */
303
+ pageNames = computed(() => {
304
+ const view = this.currentView();
305
+ if (view === 'day')
306
+ return [this.t('previousMonth'), this.t('nextMonth')];
307
+ if (view === 'month')
308
+ return [this.t('previousYear'), this.t('nextYear')];
309
+ return [this.t('previousYears'), this.t('nextYears')];
310
+ }, /* @ts-ignore */
311
+ ...(ngDevMode ? [{ debugName: "pageNames" }] : /* istanbul ignore next */ []));
302
312
  years = computed(() => yearPage(this.focused().year, YEAR_PAGE), /* @ts-ignore */
303
313
  ...(ngDevMode ? [{ debugName: "years" }] : /* istanbul ignore next */ []));
304
314
  shownMonths = computed(() => visibleMonths(this.page(), this.resolvedMonths()), /* @ts-ignore */
@@ -685,7 +695,7 @@ class SlCalendar {
685
695
  <button
686
696
  data-part="previous"
687
697
  type="button"
688
- [attr.aria-label]="t('previous')"
698
+ [attr.aria-label]="pageNames()[0]"
689
699
  [disabled]="!editable()"
690
700
  (click)="turnPage(-1, $event)"
691
701
  >
@@ -711,7 +721,7 @@ class SlCalendar {
711
721
  <button
712
722
  data-part="next"
713
723
  type="button"
714
- [attr.aria-label]="t('next')"
724
+ [attr.aria-label]="pageNames()[1]"
715
725
  [disabled]="!editable()"
716
726
  (click)="turnPage(1, $event)"
717
727
  >
@@ -856,7 +866,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
856
866
  <button
857
867
  data-part="previous"
858
868
  type="button"
859
- [attr.aria-label]="t('previous')"
869
+ [attr.aria-label]="pageNames()[0]"
860
870
  [disabled]="!editable()"
861
871
  (click)="turnPage(-1, $event)"
862
872
  >
@@ -882,7 +892,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
882
892
  <button
883
893
  data-part="next"
884
894
  type="button"
885
- [attr.aria-label]="t('next')"
895
+ [attr.aria-label]="pageNames()[1]"
886
896
  [disabled]="!editable()"
887
897
  (click)="turnPage(1, $event)"
888
898
  >
@@ -1 +1 @@
1
- {"version":3,"file":"slotted-angular-calendar.mjs","sources":["../../calendar/src/calendar-defaults.ts","../../calendar/src/calendar-selection.ts","../../calendar/src/calendar.ts","../../calendar/src/slotted-angular-calendar.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\nimport type { PlainDate } from '@slotted/core/date';\n\n/** A run of days, either end of which may still be open while it is drawn. */\nexport interface DateRange {\n readonly start: PlainDate | null;\n readonly end: PlainDate | null;\n}\n\n/**\n * What the calendar holds, which depends on what it was asked to collect: one\n * date, a run of them, or a set.\n */\nexport type CalendarValue = PlainDate | DateRange | PlainDate[] | null;\n\n/** How many dates the reader may choose. */\nexport type CalendarSelectionMode = 'single' | 'range' | 'multiple';\n\n/** Which grid the calendar is showing. The heading walks up; Escape walks down. */\nexport type CalendarView = 'day' | 'month' | 'year';\n\n/**\n * The smallest thing the reader chooses. `month` makes the months of a year\n * the grid a choice is made in: the calendar opens there, a month cell is the\n * value, written as the first day of that month, and the day grid is never\n * shown.\n */\nexport type CalendarGranularity = 'day' | 'month';\n\n/** What happens to a day belonging to the month either side. */\nexport type CalendarOutsideDays = 'shown' | 'selectable' | 'hidden';\n\n/**\n * The calendar system the value is written in. One value today, and an axis\n * rather than a silence: a second calendar system is a second arithmetic, and\n * declaring the axis now is what keeps its arrival from being a contract break.\n */\nexport type CalendarCalendar = 'gregory';\n\nexport interface CalendarDefaults {\n calendar: CalendarCalendar;\n firstDayOfWeek: number | undefined;\n fixedWeeks: boolean;\n months: number;\n /**\n * Unset is not `shown`: a calendar showing one month draws the days either\n * side of it, and a calendar showing two would draw the same six days in\n * both grids. See the resolution in `calendar.ts`.\n */\n outsideDays: CalendarOutsideDays | undefined;\n timeZone: string | undefined;\n weekNumbers: boolean;\n}\n\nconst FALLBACK: CalendarDefaults = {\n calendar: 'gregory',\n firstDayOfWeek: undefined,\n fixedWeeks: false,\n months: 1,\n outsideDays: undefined,\n timeZone: undefined,\n weekNumbers: false,\n};\n\nexport const CALENDAR_DEFAULTS = new InjectionToken<CalendarDefaults>('slotted calendar defaults', {\n providedIn: 'root',\n factory: () => FALLBACK,\n});\n\n/**\n * An application decides once which day its weeks start on, which zone answers\n * \"today\" and whether its calendars keep a fixed six-row grid — rather than\n * repeating the same inputs on every instance. Its words and the locale that\n * writes its months come from the language in force (`provideSlotted`).\n *\n * `fixedWeeks` is the one worth setting where calendars live in popovers: a\n * surface that grows a row between one press of \"next\" and the next moves the\n * target the reader was aiming at.\n */\nexport function provideCalendarDefaults(defaults: Partial<CalendarDefaults>) {\n return {\n provide: CALENDAR_DEFAULTS,\n useFactory: (): CalendarDefaults => ({ ...FALLBACK, ...defaults }),\n };\n}\n\n/** What a calendar renders as here, before it states anything of its own. */\nexport function injectCalendarDefaults(): CalendarDefaults {\n return inject(CALENDAR_DEFAULTS);\n}\n","/**\n * What choosing a date does to a value, in the three modes the family ships.\n *\n * It is separate from the component because none of it touches the DOM: a\n * range that is completed, a range that is restarted, and a set that a second\n * press takes a date back out of are all arithmetic over `PlainDate`, and the\n * two bindings must not each decide them.\n */\n\nimport { compareDate, isSameDate } from '@slotted/core/date';\nimport type { PlainDate } from '@slotted/core/date';\n\nimport type { CalendarSelectionMode, CalendarValue, DateRange } from './calendar-defaults';\n\nexport function isRange(value: CalendarValue): value is DateRange {\n return value !== null && !Array.isArray(value) && 'start' in value;\n}\n\nexport function asDates(value: CalendarValue): PlainDate[] {\n if (value === null) return [];\n if (Array.isArray(value)) return value;\n if (isRange(value)) return [value.start, value.end].filter((date) => date !== null);\n return [value];\n}\n\n/**\n * Whether a date is one of the two ends of a run, inside it, or none of the\n * three. A range with one end open has a start and no run, which is what the\n * calendar draws while the reader is choosing the second date.\n */\nexport function rangeStateOf(\n date: PlainDate,\n value: CalendarValue,\n): 'start' | 'end' | 'inside' | null {\n if (!isRange(value)) return null;\n const { start, end } = value;\n if (start !== null && isSameDate(date, start)) return 'start';\n if (end !== null && isSameDate(date, end)) return 'end';\n if (start === null || end === null) return null;\n return compareDate(date, start) > 0 && compareDate(date, end) < 0 ? 'inside' : null;\n}\n\nexport function isSelected(date: PlainDate, value: CalendarValue): boolean {\n if (isRange(value)) {\n const state = rangeStateOf(date, value);\n return state === 'start' || state === 'end';\n }\n return asDates(value).some((candidate) => isSameDate(candidate, date));\n}\n\n/**\n * The value a press produces.\n *\n * A range takes two presses and the second one may come first: a reader who\n * chooses the 11th and then the 7th means the 7th to the 11th, not a range\n * that runs backwards. A third press starts again, because a range that grew\n * on every press could never be narrowed.\n *\n * A set removes a date a second press lands on, which is the only way to take\n * one back out without a second control.\n */\nexport function nextValue(\n date: PlainDate,\n value: CalendarValue,\n mode: CalendarSelectionMode,\n): CalendarValue {\n if (mode === 'single') {\n return isSelected(date, value) ? null : date;\n }\n\n if (mode === 'multiple') {\n const held = asDates(value);\n const without = held.filter((candidate) => !isSameDate(candidate, date));\n if (without.length !== held.length) return without;\n return [...held, date].sort(compareDate);\n }\n\n const run = isRange(value) ? value : { start: null, end: null };\n if (run.start === null || run.end !== null) return { start: date, end: null };\n return compareDate(date, run.start) < 0\n ? { start: date, end: run.start }\n : { start: run.start, end: date };\n}\n\n/**\n * The run the grid draws while the reader is choosing the second end: from\n * the chosen start to the pending end — the day under the pointer, or the\n * focused day — ordered the way the second press will order it. `null` while\n * there is no open run, so a whole range and a single date preview nothing.\n */\nexport function previewRun(value: CalendarValue, pending: PlainDate | null): DateRange | null {\n if (pending === null || !isRange(value) || value.start === null || value.end !== null)\n return null;\n return compareDate(pending, value.start) < 0\n ? { start: pending, end: value.start }\n : { start: value.start, end: pending };\n}\n\n/** Value equality, which `Object.is` cannot give for a run or a set. */\nexport function isSameValue(a: CalendarValue, b: CalendarValue): boolean {\n if (isRange(a) || isRange(b)) {\n if (!isRange(a) || !isRange(b)) return false;\n return isSameDate(a.start, b.start) && isSameDate(a.end, b.end);\n }\n const left = asDates(a);\n const right = asDates(b);\n if (left.length !== right.length) return false;\n return left.every((date, index) => isSameDate(date, right[index] ?? null));\n}\n","import {\n addDays,\n clampDate,\n createDateFormat,\n endOfWeek,\n isDateInRange,\n isSameDate,\n monthGrid,\n plainDate,\n startOfWeek,\n stepMonth,\n stepYear,\n todayIn,\n visibleMonths,\n yearPage,\n} from '@slotted/core/date';\nimport type { CalendarDay, CalendarWeek, PlainDate } from '@slotted/core/date';\nimport { createControllable } from '@slotted/core/state';\nimport type { ChangeReason, ChangeRequest } from '@slotted/core/state';\nimport {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n numberAttribute,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { OnInit } from '@angular/core';\nimport { injectLocale, injectMessages } from '@slotted/angular/i18n';\nimport { SlGlyph, SlIcon } from '@slotted/angular/icon';\nimport { calendarMessages, type CalendarMessages, type PartialMessages } from '@slotted/core/i18n';\n\nimport { injectCalendarDefaults } from './calendar-defaults';\nimport type {\n CalendarCalendar,\n CalendarGranularity,\n CalendarOutsideDays,\n CalendarSelectionMode,\n CalendarValue,\n CalendarView,\n} from './calendar-defaults';\nimport {\n isRange,\n isSameValue,\n isSelected,\n nextValue,\n previewRun,\n rangeStateOf,\n} from './calendar-selection';\n\n/** How many years one page of the year view holds. */\nconst YEAR_PAGE = 12;\n/** The heading needs an identifier every grid can point `aria-labelledby` at. */\nlet sequence = 0;\n\n/**\n * A month grid, and the two pages above it.\n *\n * **It is a real `table` with the `grid` role on it.** The APG's own note is\n * why nothing here writes `row`, `columnheader` or `gridcell`: those are\n * implied by `tr`, `th` and `td`, and writing them again would duplicate\n * semantics the platform already gives.\n *\n * **The date the reader is on and the date the reader has chosen are two\n * values**, and each has a model of its own — a product that pages a calendar\n * from outside it has nowhere else to say so.\n *\n * **A date the predicate refuses stays reachable.** It carries `aria-disabled`\n * rather than being taken out of the grid, so a reader can arrow onto it, hear\n * why it is out, and arrow past it.\n */\n@Component({\n selector: '[slCalendar]',\n standalone: true,\n exportAs: 'slCalendar',\n imports: [SlGlyph, SlIcon],\n template: `<div data-part=\"header\">\n <button\n data-part=\"previous\"\n type=\"button\"\n [attr.aria-label]=\"t('previous')\"\n [disabled]=\"!editable()\"\n (click)=\"turnPage(-1, $event)\"\n >\n <span slIcon directional><svg slGlyph name=\"chevron-right\"></svg></span>\n </button>\n <!--\n The heading is a live region: paging with a key changes nothing that\n focus lands on, so without this nothing announces the new month.\n -->\n <button\n data-part=\"heading\"\n type=\"button\"\n aria-live=\"polite\"\n [attr.id]=\"headingId\"\n [disabled]=\"!editable() || currentView() === 'year'\"\n (click)=\"walkUp()\"\n >\n {{ heading() }}\n @if (currentView() !== 'year') {\n <span slIcon><svg slGlyph name=\"chevron-down\"></svg></span>\n }\n </button>\n <button\n data-part=\"next\"\n type=\"button\"\n [attr.aria-label]=\"t('next')\"\n [disabled]=\"!editable()\"\n (click)=\"turnPage(1, $event)\"\n >\n <span slIcon directional><svg slGlyph name=\"chevron-right\"></svg></span>\n </button>\n </div>\n\n @switch (currentView()) {\n @case ('day') {\n <div data-part=\"grids\">\n @for (month of shownMonths(); track month.year * 12 + month.month) {\n <table data-part=\"grid\" role=\"grid\" [attr.aria-labelledby]=\"headingId\">\n <caption data-part=\"grid-caption\">\n {{\n captionOf(month)\n }}\n </caption>\n <thead>\n <tr data-part=\"week-headers\">\n @if (resolvedWeekNumbers()) {\n <th data-part=\"week-number\" aria-hidden=\"true\"></th>\n }\n @for (name of weekdayNarrow(); track $index) {\n <th data-part=\"week-header\" scope=\"col\" [attr.abbr]=\"weekdayLong()[$index]\">\n {{ name }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (week of weeksOf(month); track week.weekNumber) {\n <tr data-part=\"week\">\n @if (resolvedWeekNumbers()) {\n <th data-part=\"week-number\" scope=\"row\">{{ week.weekNumber }}</th>\n }\n @for (\n day of week.days;\n track day.date.year * 400 + day.date.month * 32 + day.date.day\n ) {\n <!-- A hidden day is an empty cell and nothing else. It\n carried the marks of the date it stood for, so a\n range across a month boundary painted a band with no\n digits under it. -->\n <td\n data-part=\"cell\"\n [attr.data-outside-month]=\"day.outsideMonth ? '' : null\"\n [attr.data-unavailable]=\"\n !drawn(day) ? null : unavailable(day.date) ? '' : null\n \"\n [attr.data-selected]=\"!drawn(day) ? null : chosen(day.date) ? '' : null\"\n [attr.data-range-start]=\"\n drawn(day) && rangeState(day.date) === 'start' ? '' : null\n \"\n [attr.data-range-end]=\"\n drawn(day) && rangeState(day.date) === 'end' ? '' : null\n \"\n [attr.data-in-range]=\"\n drawn(day) && rangeState(day.date) === 'inside' ? '' : null\n \"\n [attr.data-preview]=\"drawn(day) && proposed(day.date) ? '' : null\"\n >\n @if (drawn(day)) {\n <span\n data-part=\"day\"\n role=\"button\"\n [attr.data-today]=\"isToday(day.date) ? '' : null\"\n [attr.aria-selected]=\"chosen(day.date) ? 'true' : null\"\n [attr.aria-disabled]=\"refused(day) ? 'true' : null\"\n [tabindex]=\"tabIndexOf(day.date)\"\n (click)=\"!refused(day) && select(day.date, 'pointer', $event)\"\n (pointerenter)=\"hovered.set(day.date)\"\n (pointerleave)=\"hovered.set(null)\"\n >\n {{ day.date.day }}\n </span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n </div>\n }\n @case ('month') {\n @if (monthly()) {\n <div data-part=\"months\">\n @for (name of monthNames(); track $index) {\n <button\n data-part=\"period\"\n type=\"button\"\n [attr.aria-label]=\"monthLabel($index + 1)\"\n [attr.data-selected]=\"heldMonth($index + 1) ? '' : null\"\n [attr.aria-selected]=\"heldMonth($index + 1) ? 'true' : null\"\n [attr.aria-disabled]=\"monthUnavailable($index + 1) ? 'true' : null\"\n [attr.data-unavailable]=\"monthUnavailable($index + 1) ? '' : null\"\n [attr.data-focused]=\"focused().month === $index + 1 ? '' : null\"\n [tabindex]=\"focused().month === $index + 1 ? 0 : -1\"\n (click)=\"selectMonth(focused().year, $index + 1, 'pointer', $event)\"\n >\n {{ name }}\n </button>\n }\n </div>\n } @else {\n <div data-part=\"months\">\n @for (name of monthNames(); track $index) {\n <button\n data-part=\"period\"\n type=\"button\"\n [attr.data-selected]=\"focused().month === $index + 1 ? '' : null\"\n [attr.aria-selected]=\"focused().month === $index + 1 ? 'true' : null\"\n (click)=\"pickMonth($index + 1, $event)\"\n >\n {{ name }}\n </button>\n }\n </div>\n }\n }\n @default {\n <div data-part=\"years\">\n @for (year of years(); track year) {\n <button\n data-part=\"period\"\n type=\"button\"\n [attr.data-selected]=\"focused().year === year ? '' : null\"\n [attr.aria-selected]=\"focused().year === year ? 'true' : null\"\n (click)=\"pickYear(year, $event)\"\n >\n {{ year }}\n </button>\n }\n </div>\n }\n }`,\n styleUrl: '../../../styles/src/calendar/calendar.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-ui': 'calendar',\n 'data-part': 'root',\n '[attr.data-view]': 'currentView()',\n '[attr.data-calendar]': 'resolvedCalendar()',\n '[attr.data-months]': 'resolvedMonths() > 1 ? resolvedMonths() : null',\n '[attr.data-week-numbers]': \"resolvedWeekNumbers() ? '' : null\",\n '[attr.data-disabled]': \"disabled() === true ? '' : null\",\n '[attr.data-readonly]': \"readOnly() === true ? '' : null\",\n '[attr.data-invalid]': \"invalid() === true ? '' : null\",\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class SlCalendar implements OnInit {\n /** Present means the consumer owns the value. */\n readonly value = input<CalendarValue | undefined>(undefined);\n readonly defaultValue = input<CalendarValue | undefined>(undefined);\n /** The date the reader is on. Present means the consumer owns it. */\n readonly focusedDate = input<PlainDate | undefined>(undefined);\n readonly defaultFocusedDate = input<PlainDate | undefined>(undefined);\n\n readonly min = input<PlainDate | undefined>(undefined);\n readonly max = input<PlainDate | undefined>(undefined);\n readonly isDateUnavailable = input<((date: PlainDate) => boolean) | undefined>(undefined);\n\n readonly selectionMode = input<CalendarSelectionMode>('single');\n readonly months = input<number | undefined, unknown>(undefined, {\n transform: (value) =>\n value === undefined || value === null ? undefined : numberAttribute(value),\n });\n /** Present means the consumer owns which grid is showing. */\n readonly view = input<CalendarView | undefined>(undefined);\n readonly defaultView = input<CalendarView | undefined>(undefined);\n /** What a choice is: a day, or a month of a year. Defaults to `day`. */\n readonly granularity = input<CalendarGranularity | undefined>(undefined);\n\n readonly weekNumbers = input<boolean | undefined, boolean | string | undefined>(undefined, {\n transform: (value) => (value === undefined ? undefined : booleanAttribute(value)),\n });\n readonly fixedWeeks = input<boolean | undefined, boolean | string | undefined>(undefined, {\n transform: (value) => (value === undefined ? undefined : booleanAttribute(value)),\n });\n readonly outsideDays = input<CalendarOutsideDays | undefined>(undefined);\n\n /** The locale that writes months and days. Unset, the language in force decides. */\n readonly locale = input<string | undefined>(undefined);\n readonly timeZone = input<string | undefined>(undefined);\n readonly firstDayOfWeek = input<number | undefined, unknown>(undefined, {\n transform: (value) =>\n value === undefined || value === null ? undefined : numberAttribute(value),\n });\n readonly calendar = input<CalendarCalendar | undefined>(undefined);\n\n readonly disabled = input<boolean | undefined, boolean | string | undefined>(undefined, {\n transform: (value) => (value === undefined ? undefined : booleanAttribute(value)),\n });\n readonly readOnly = input<boolean | undefined, boolean | string | undefined>(undefined, {\n transform: (value) => (value === undefined ? undefined : booleanAttribute(value)),\n });\n readonly invalid = input<boolean | undefined, boolean | string | undefined>(undefined, {\n transform: (value) => (value === undefined ? undefined : booleanAttribute(value)),\n });\n\n /**\n * Words laid over the catalog of the language in force, key by key: the\n * names of the previous and next triggers.\n */\n readonly messages = input<PartialMessages<CalendarMessages> | undefined>(undefined);\n\n readonly valueChange = output<ChangeRequest<CalendarValue>>();\n readonly focusedDateChange = output<ChangeRequest<PlainDate>>();\n readonly viewChange = output<CalendarView>();\n /**\n * The pending end of an open run: the day under the pointer, or the focused\n * day when no pointer is over the grid, and `null` while no run is open. A\n * fact the grid states rather than a value the consumer owns, which is why\n * it is an output and not a model — `date-range-picker` reads it to say how\n * long the run would be.\n */\n readonly previewChange = output<PlainDate | null>();\n\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly injector = inject(Injector);\n private readonly defaults = injectCalendarDefaults();\n private readonly appLocale = injectLocale();\n /** The family's words in the language in force, with this calendar's `messages` laid over them. */\n readonly t = injectMessages(calendarMessages, this.messages);\n\n protected readonly headingId = `sl-calendar-${String((sequence += 1))}`;\n\n private readonly ownValue = signal<CalendarValue>(null);\n private readonly ownFocused = signal<PlainDate>(plainDate(2026, 1, 1));\n private readonly ownView = signal<CalendarView>('day');\n /**\n * The first month on screen, which is **not** the month the reader is on.\n *\n * Drawing two months from the focused date meant that choosing a day in the\n * second one scrolled the pair: a reader looking at June and July who chose\n * 9 June was shown July and August, with half of what they had just chosen\n * off screen. The page moves only when the reader leaves it.\n */\n private readonly page = signal<{ year: number; month: number }>({ year: 2026, month: 1 });\n private readonly today = signal<PlainDate | null>(null);\n /** Focus is only moved into the DOM after a key, never on a render. */\n private restoreFocus = false;\n\n protected readonly held = computed(() => this.value() ?? this.ownValue());\n protected readonly focused = computed(() => this.focusedDate() ?? this.ownFocused());\n /**\n * Under `granularity=\"month\"` the months of a year are where a choice is\n * made: the calendar opens there and never goes below it, so a view asked\n * for as `day` is read as `month`.\n */\n protected readonly monthly = computed(() => this.granularity() === 'month');\n /** Which grid is showing. Public, so a template reaches it through `exportAs`. */\n readonly currentView = computed((): CalendarView => {\n const asked = this.view() ?? this.ownView();\n return this.monthly() && asked === 'day' ? 'month' : asked;\n });\n\n protected readonly resolvedMonths = computed(() =>\n Math.max(1, this.months() ?? this.defaults.months),\n );\n protected readonly resolvedWeekNumbers = computed(\n () => this.weekNumbers() ?? this.defaults.weekNumbers,\n );\n protected readonly resolvedFixedWeeks = computed(\n () => this.fixedWeeks() ?? this.defaults.fixedWeeks,\n );\n /**\n * One month draws the days either side of it, because a week that starts on\n * the 30th of the month before has to say what that cell is. Two months\n * cannot: September's grid ends with the first three days of October and\n * October's begins with the last four of September, so a range across the\n * boundary is painted twice and a reader sees an interval twice as long as\n * the one chosen. Every surveyed multi-month calendar hides them, and so\n * does this one — until the consumer says otherwise, on the instance or on\n * the provider.\n */\n protected readonly resolvedOutsideDays = computed(\n () =>\n this.outsideDays() ??\n this.defaults.outsideDays ??\n (this.resolvedMonths() > 1 ? 'hidden' : 'shown'),\n );\n protected readonly resolvedCalendar = computed(() => this.calendar() ?? this.defaults.calendar);\n protected readonly editable = computed(\n () => this.disabled() !== true && this.readOnly() !== true,\n );\n\n protected readonly format = computed(() =>\n createDateFormat({\n locale: this.locale() ?? this.appLocale(),\n firstDayOfWeek: this.firstDayOfWeek() ?? this.defaults.firstDayOfWeek,\n }),\n );\n\n protected readonly weekdayLong = computed(() => this.format().weekdayNames('long'));\n protected readonly weekdayNarrow = computed(() => this.format().weekdayNames('narrow'));\n protected readonly monthNames = computed(() => this.format().monthNames('short'));\n protected readonly years = computed(() => yearPage(this.focused().year, YEAR_PAGE));\n protected readonly shownMonths = computed(() =>\n visibleMonths(this.page(), this.resolvedMonths()),\n );\n\n protected readonly heading = computed(() => {\n const focused = this.focused();\n const format = this.format();\n if (this.currentView() === 'year') {\n const years = this.years();\n return `${String(years[0] ?? focused.year)} – ${String(years.at(-1) ?? focused.year)}`;\n }\n if (this.currentView() === 'month') return String(focused.year);\n\n const page = this.page();\n const start = plainDate(page.year, page.month, 1);\n if (this.resolvedMonths() === 1) return format.monthYear(start);\n const last = stepMonth(start, this.resolvedMonths() - 1).date;\n return `${format.monthYear(start, 'short')} – ${format.monthYear(last, 'short')}`;\n });\n\n constructor() {\n /**\n * The page follows the reader, and only when the reader has left it.\n * Written as an effect rather than inside the request, so a consumer who\n * owns `focusedDate` and moves it from outside is followed too.\n */\n /* The pending end, reported once per change and never while it is the\n same day: a pointer crossing a cell twice is one fact, not two. */\n let reported: PlainDate | null = null;\n effect(() => {\n const end = this.previewEnd();\n if (isSameDate(reported, end)) return;\n reported = end;\n this.previewChange.emit(end);\n });\n\n effect(() => {\n const focused = this.focused();\n const held = this.page();\n const span = this.resolvedMonths();\n const start = held.year * 12 + (held.month - 1);\n const wanted = focused.year * 12 + (focused.month - 1);\n if (wanted >= start && wanted < start + span) return;\n /* Outside the span: the page moves by whole pages, so a reader stepping\n past the edge lands where the arrows would have taken them. */\n const moved = start + Math.floor((wanted - start) / span) * span;\n this.page.set({ year: Math.floor(moved / 12), month: (moved % 12) + 1 });\n });\n }\n\n ngOnInit() {\n this.ownValue.set(this.defaultValue() ?? null);\n this.ownView.set(this.defaultView() ?? (this.monthly() ? 'month' : 'day'));\n this.today.set(todayIn(this.timeZone() ?? this.defaults.timeZone));\n const start = this.startingDate();\n this.ownFocused.set(start);\n this.page.set({ year: start.year, month: start.month });\n }\n\n /** Puts focus on the cell holding the roving tab stop. */\n focus() {\n this.element\n .querySelector<HTMLElement>(\n '[data-part=\"day\"][tabindex=\"0\"], [data-part=\"period\"][tabindex=\"0\"]',\n )\n ?.focus();\n }\n\n /** Moves the reader to a date, paging the grid to reach it. */\n focusDate(date: PlainDate) {\n this.requestFocused(date, 'programmatic', undefined);\n }\n\n /** The date, the run or the set the calendar holds. */\n readonly selection = computed(() => this.held());\n\n protected captionOf(month: { year: number; month: number }) {\n return this.format().monthYear(plainDate(month.year, month.month, 1));\n }\n\n protected weeksOf(month: { year: number; month: number }): CalendarWeek[] {\n return monthGrid({\n ...month,\n firstDayOfWeek: this.format().firstDayOfWeek,\n fixedWeeks: this.resolvedFixedWeeks(),\n });\n }\n\n protected unavailable(date: PlainDate): boolean {\n if (!isDateInRange(date, this.min(), this.max())) return true;\n return this.isDateUnavailable()?.(date) === true;\n }\n\n /** Unavailable, or an outside day the axis says may not be chosen. */\n /** Whether the cell carries a day at all, or stands empty to fill the row. */\n protected drawn(day: CalendarDay): boolean {\n return !(day.outsideMonth && this.resolvedOutsideDays() === 'hidden');\n }\n\n /**\n * The grid already knows which month a day belongs to, and asking the first\n * shown month instead refused every day of the second one in a pair.\n */\n protected refused(day: CalendarDay): boolean {\n if (this.unavailable(day.date)) return true;\n return day.outsideMonth && this.resolvedOutsideDays() === 'shown';\n }\n\n protected chosen(date: PlainDate): boolean {\n return isSelected(date, this.held());\n }\n\n /**\n * The day under the pointer, held only to name the pending end of an open\n * run. It never moves the roving focus: a pointer crossing the grid is not\n * the reader choosing where they are.\n */\n protected readonly hovered = signal<PlainDate | null>(null);\n\n /** The run as it would close on the pending end; `null` while no run is open. */\n private readonly pending = computed(() =>\n this.selectionMode() === 'range' && this.editable()\n ? previewRun(this.held(), this.hovered() ?? this.focused())\n : null,\n );\n\n private readonly previewEnd = computed(() => {\n const pending = this.pending();\n const held = this.held();\n if (pending === null) return null;\n return isRange(held) && held.start !== null && isSameDate(pending.start, held.start)\n ? pending.end\n : pending.start;\n });\n\n protected rangeState(date: PlainDate) {\n return rangeStateOf(date, this.pending() ?? this.held());\n }\n\n /** Every cell of the pending band is a proposal except the start the reader chose. */\n protected proposed(date: PlainDate): boolean {\n return this.pending() !== null && this.rangeState(date) !== null && !this.chosen(date);\n }\n\n protected isToday(date: PlainDate): boolean {\n const today = this.today();\n return today !== null && isSameDate(date, today);\n }\n\n protected tabIndexOf(date: PlainDate): number {\n return isSameDate(date, this.focused()) && this.editable() ? 0 : -1;\n }\n\n protected select(date: PlainDate, reason: ChangeReason, source: Event | undefined) {\n if (!this.editable() || this.unavailable(date)) return;\n this.requestValue(nextValue(date, this.held(), this.selectionMode()), reason, source);\n this.requestFocused(date, reason, source);\n }\n\n /** A month cell's name: the month and the year, which the cell alone does not say. */\n protected monthLabel(month: number): string {\n return this.format().monthYear(plainDate(this.focused().year, month, 1));\n }\n\n /** Whether the value's month is this cell of the year on screen. */\n protected heldMonth(month: number): boolean {\n const held = this.held();\n if (held === null || Array.isArray(held) || isRange(held)) return false;\n return held.year === this.focused().year && held.month === month;\n }\n\n /**\n * A month the bounds leave no day of. The bounds are days, so a month is\n * refused only when it ends before `min` or starts after `max`.\n */\n protected monthUnavailable(month: number, year = this.focused().year): boolean {\n const at = year * 12 + month;\n const min = this.min();\n const max = this.max();\n return (\n (min !== undefined && at < min.year * 12 + min.month) ||\n (max !== undefined && at > max.year * 12 + max.month)\n );\n }\n\n /** The value of a month cell is the first day of the month. */\n protected selectMonth(\n year: number,\n month: number,\n reason: ChangeReason,\n source: Event | undefined,\n ) {\n if (!this.editable() || this.monthUnavailable(month, year)) return;\n const date = plainDate(year, month, 1);\n this.requestValue(date, reason, source);\n this.requestFocused(date, reason, source);\n }\n\n /** The reader moves with the page rather than staying behind it. */\n protected turnPage(direction: 1 | -1, source: Event) {\n const focused = this.focused();\n if (this.currentView() === 'day') {\n this.requestFocused(\n stepMonth(focused, direction * this.resolvedMonths()).date,\n 'pointer',\n source,\n );\n return;\n }\n const step = this.currentView() === 'month' ? direction : direction * YEAR_PAGE;\n this.requestFocused(stepYear(focused, step).date, 'pointer', source);\n }\n\n protected walkUp() {\n this.setView(this.currentView() === 'day' ? 'month' : 'year');\n }\n\n protected pickMonth(month: number, source: Event) {\n this.requestFocused({ ...this.focused(), month, day: 1 }, 'pointer', source);\n this.setView('day');\n }\n\n protected pickYear(year: number, source: Event) {\n this.requestFocused({ ...this.focused(), year, day: 1 }, 'pointer', source);\n this.setView('month');\n }\n\n protected onKeyDown(event: KeyboardEvent) {\n const rtl = getComputedStyle(this.element).direction === 'rtl';\n const forward = rtl ? 'ArrowLeft' : 'ArrowRight';\n const backward = rtl ? 'ArrowRight' : 'ArrowLeft';\n const focused = this.focused();\n const first = this.format().firstDayOfWeek;\n\n /**\n * A key the grid acted on is the grid's, and nothing above it sees it.\n * An application that binds a bare key guards it with \"is the target an\n * editable element\", and a `td` is not one — so the arrows a reader walks\n * a month with would fire every shortcut on the page.\n */\n const consume = () => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n const move = (next: PlainDate) => {\n consume();\n this.requestFocused(next, 'keyboard', event);\n };\n\n /**\n * The months of a year, as a grid of four columns: the arrows move one\n * month or one row, Home and End reach January and December, the page\n * keys move a year, and Enter or Space chooses. Escape is left alone, so\n * the surface above the calendar may close on it.\n */\n if (this.monthly() && this.currentView() === 'month') {\n const toMonth = (delta: number) => {\n const index = focused.year * 12 + (focused.month - 1) + delta;\n return plainDate(Math.floor(index / 12), (index % 12) + 1, 1);\n };\n switch (event.key) {\n case forward:\n return move(toMonth(1));\n case backward:\n return move(toMonth(-1));\n case 'ArrowUp':\n return move(toMonth(-4));\n case 'ArrowDown':\n return move(toMonth(4));\n case 'Home':\n return move(plainDate(focused.year, 1, 1));\n case 'End':\n return move(plainDate(focused.year, 12, 1));\n case 'PageUp':\n return move(toMonth(-12));\n case 'PageDown':\n return move(toMonth(12));\n case 'Enter':\n case ' ':\n consume();\n this.selectMonth(focused.year, focused.month, 'keyboard', event);\n return;\n default:\n break;\n }\n }\n\n switch (event.key) {\n case forward:\n return move(addDays(focused, 1));\n case backward:\n return move(addDays(focused, -1));\n case 'ArrowUp':\n return move(addDays(focused, -7));\n case 'ArrowDown':\n return move(addDays(focused, 7));\n case 'Home':\n return move(startOfWeek(focused, first));\n case 'End':\n return move(endOfWeek(focused, first));\n case 'PageUp':\n return move(event.shiftKey ? stepYear(focused, -1).date : stepMonth(focused, -1).date);\n case 'PageDown':\n return move(event.shiftKey ? stepYear(focused, 1).date : stepMonth(focused, 1).date);\n case 'Enter':\n case ' ':\n consume();\n this.select(focused, 'keyboard', event);\n return;\n case 'Escape':\n /* The view closes before the surface does, which is the staging\n `dismissable-layer` asks a family to do: the key is simply not\n passed on, and no layer is asked to close. */\n /* In the day view the key is left alone, so a surface above the\n calendar may still close on it. */\n if (this.currentView() === 'day' || (this.monthly() && this.currentView() === 'month')) {\n return;\n }\n consume();\n this.setView(this.currentView() === 'year' ? 'month' : 'day');\n return;\n default:\n return;\n }\n }\n\n /**\n * The first date the reader is put on: what a consumer said, then the value\n * it holds, then today. A calendar that opened on an arbitrary month would\n * make the reader page to now before doing anything at all.\n */\n private startingDate(): PlainDate {\n const stated = this.defaultFocusedDate() ?? this.focusedDate();\n if (stated !== undefined) return stated;\n const held = this.defaultValue() ?? this.value() ?? null;\n if (held !== null) {\n if (Array.isArray(held)) {\n const first = held[0];\n if (first !== undefined) return first;\n } else if ('start' in held) {\n if (held.start !== null) return held.start;\n } else {\n return held;\n }\n }\n return clampDate(this.today() ?? plainDate(2026, 1, 1), this.min(), this.max());\n }\n\n private setView(next: CalendarView) {\n if (this.view() === undefined) this.ownView.set(next);\n this.viewChange.emit(next);\n }\n\n private requestValue(next: CalendarValue, reason: ChangeReason, source: Event | undefined) {\n const state = createControllable<CalendarValue>({\n controlled: this.value(),\n initial: this.held(),\n equals: isSameValue,\n onRequest: (request) => this.valueChange.emit(request),\n });\n if (state.request(next, reason, source)) this.ownValue.set(next);\n }\n\n private requestFocused(next: PlainDate, reason: ChangeReason, source: Event | undefined) {\n const bounded = clampDate(next, this.min(), this.max());\n const state = createControllable<PlainDate>({\n controlled: this.focusedDate(),\n initial: this.focused(),\n equals: (a, b) => isSameDate(a, b),\n onRequest: (request) => this.focusedDateChange.emit(request),\n });\n this.restoreFocus = reason === 'keyboard';\n if (state.request(bounded, reason, source)) this.ownFocused.set(bounded);\n if (this.restoreFocus) this.followFocus();\n }\n\n /**\n * Focus follows a key onto the cell that holds the roving tab stop, once the\n * page holding it is rendered.\n *\n * A key that crosses the month edge lands on the old page's trailing day\n * first, and the page follows one render later. Focused before that, the\n * cell was replaced under the reader and focus fell to the document — which\n * a consumer owning `focusedDate` met on every crossing. Focus is moved only\n * while it is still in the calendar or was lost to the document, so a\n * consumer that refused the move never has focus taken from elsewhere.\n */\n private followFocus() {\n afterNextRender(\n () => {\n if (!this.restoreFocus) return;\n const active = this.element.ownerDocument.activeElement;\n const lost = active === null || active === this.element.ownerDocument.body;\n if (!lost && !this.element.contains(active)) {\n this.restoreFocus = false;\n return;\n }\n const stop = this.element.querySelector<HTMLElement>(\n '[data-part=\"cell\"]:not([data-outside-month]) [data-part=\"day\"][tabindex=\"0\"], [data-part=\"period\"][tabindex=\"0\"]',\n );\n if (stop !== null) {\n this.restoreFocus = false;\n stop.focus();\n return;\n }\n if (this.element.querySelector('[data-part=\"day\"][tabindex=\"0\"]') === null) {\n this.restoreFocus = false;\n return;\n }\n this.followFocus();\n },\n { injector: this.injector },\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAsDA,MAAM,QAAQ,GAAqB;AACjC,IAAA,QAAQ,EAAE,SAAS;AACnB,IAAA,cAAc,EAAE,SAAS;AACzB,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,WAAW,EAAE,SAAS;AACtB,IAAA,QAAQ,EAAE,SAAS;AACnB,IAAA,WAAW,EAAE,KAAK;CACnB;MAEY,iBAAiB,GAAG,IAAI,cAAc,CAAmB,2BAA2B,EAAE;AACjG,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,QAAQ;AACxB,CAAA;AAED;;;;;;;;;AASG;AACG,SAAU,uBAAuB,CAAC,QAAmC,EAAA;IACzE,OAAO;AACL,QAAA,OAAO,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,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAyLd,UAAU,EAAA,UAAA,EAAA,CAAA;kBA7LtB,SAAS;+BACE,cAAc,EAAA,UAAA,EACZ,IAAI,EAAA,QAAA,EACN,YAAY,EAAA,OAAA,EACb,CAAC,OAAO,EAAE,MAAM,CAAC,EAAA,QAAA,EAChB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuKN,KAAA,CAAA,EAAA,eAAA,EAEa,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,SAAS,EAAE,UAAU;AACrB,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,kBAAkB,EAAE,eAAe;AACnC,wBAAA,sBAAsB,EAAE,oBAAoB;AAC5C,wBAAA,oBAAoB,EAAE,gDAAgD;AACtE,wBAAA,0BAA0B,EAAE,mCAAmC;AAC/D,wBAAA,sBAAsB,EAAE,iCAAiC;AACzD,wBAAA,sBAAsB,EAAE,iCAAiC;AACzD,wBAAA,qBAAqB,EAAE,gCAAgC;AACvD,wBAAA,WAAW,EAAE,mBAAmB;AACjC,qBAAA,EAAA,MAAA,EAAA,CAAA,+lcAAA,CAAA,EAAA;;;AC1QH;;AAEG;;"}
1
+ {"version":3,"file":"slotted-angular-calendar.mjs","sources":["../../calendar/src/calendar-defaults.ts","../../calendar/src/calendar-selection.ts","../../calendar/src/calendar.ts","../../calendar/src/slotted-angular-calendar.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\nimport type { PlainDate } from '@slotted/core/date';\n\n/** A run of days, either end of which may still be open while it is drawn. */\nexport interface DateRange {\n readonly start: PlainDate | null;\n readonly end: PlainDate | null;\n}\n\n/**\n * What the calendar holds, which depends on what it was asked to collect: one\n * date, a run of them, or a set.\n */\nexport type CalendarValue = PlainDate | DateRange | PlainDate[] | null;\n\n/** How many dates the reader may choose. */\nexport type CalendarSelectionMode = 'single' | 'range' | 'multiple';\n\n/** Which grid the calendar is showing. The heading walks up; Escape walks down. */\nexport type CalendarView = 'day' | 'month' | 'year';\n\n/**\n * The smallest thing the reader chooses. `month` makes the months of a year\n * the grid a choice is made in: the calendar opens there, a month cell is the\n * value, written as the first day of that month, and the day grid is never\n * shown.\n */\nexport type CalendarGranularity = 'day' | 'month';\n\n/** What happens to a day belonging to the month either side. */\nexport type CalendarOutsideDays = 'shown' | 'selectable' | 'hidden';\n\n/**\n * The calendar system the value is written in. One value today, and an axis\n * rather than a silence: a second calendar system is a second arithmetic, and\n * declaring the axis now is what keeps its arrival from being a contract break.\n */\nexport type CalendarCalendar = 'gregory';\n\nexport interface CalendarDefaults {\n calendar: CalendarCalendar;\n firstDayOfWeek: number | undefined;\n fixedWeeks: boolean;\n months: number;\n /**\n * Unset is not `shown`: a calendar showing one month draws the days either\n * side of it, and a calendar showing two would draw the same six days in\n * both grids. See the resolution in `calendar.ts`.\n */\n outsideDays: CalendarOutsideDays | undefined;\n timeZone: string | undefined;\n weekNumbers: boolean;\n}\n\nconst FALLBACK: CalendarDefaults = {\n calendar: 'gregory',\n firstDayOfWeek: undefined,\n fixedWeeks: false,\n months: 1,\n outsideDays: undefined,\n timeZone: undefined,\n weekNumbers: false,\n};\n\nexport const CALENDAR_DEFAULTS = new InjectionToken<CalendarDefaults>('slotted calendar defaults', {\n providedIn: 'root',\n factory: () => FALLBACK,\n});\n\n/**\n * An application decides once which day its weeks start on, which zone answers\n * \"today\" and whether its calendars keep a fixed six-row grid — rather than\n * repeating the same inputs on every instance. Its words and the locale that\n * writes its months come from the language in force (`provideSlotted`).\n *\n * `fixedWeeks` is the one worth setting where calendars live in popovers: a\n * surface that grows a row between one press of \"next\" and the next moves the\n * target the reader was aiming at.\n */\nexport function provideCalendarDefaults(defaults: Partial<CalendarDefaults>) {\n return {\n provide: CALENDAR_DEFAULTS,\n useFactory: (): CalendarDefaults => ({ ...FALLBACK, ...defaults }),\n };\n}\n\n/** What a calendar renders as here, before it states anything of its own. */\nexport function injectCalendarDefaults(): CalendarDefaults {\n return inject(CALENDAR_DEFAULTS);\n}\n","/**\n * What choosing a date does to a value, in the three modes the family ships.\n *\n * It is separate from the component because none of it touches the DOM: a\n * range that is completed, a range that is restarted, and a set that a second\n * press takes a date back out of are all arithmetic over `PlainDate`, and the\n * two bindings must not each decide them.\n */\n\nimport { compareDate, isSameDate } from '@slotted/core/date';\nimport type { PlainDate } from '@slotted/core/date';\n\nimport type { CalendarSelectionMode, CalendarValue, DateRange } from './calendar-defaults';\n\nexport function isRange(value: CalendarValue): value is DateRange {\n return value !== null && !Array.isArray(value) && 'start' in value;\n}\n\nexport function asDates(value: CalendarValue): PlainDate[] {\n if (value === null) return [];\n if (Array.isArray(value)) return value;\n if (isRange(value)) return [value.start, value.end].filter((date) => date !== null);\n return [value];\n}\n\n/**\n * Whether a date is one of the two ends of a run, inside it, or none of the\n * three. A range with one end open has a start and no run, which is what the\n * calendar draws while the reader is choosing the second date.\n */\nexport function rangeStateOf(\n date: PlainDate,\n value: CalendarValue,\n): 'start' | 'end' | 'inside' | null {\n if (!isRange(value)) return null;\n const { start, end } = value;\n if (start !== null && isSameDate(date, start)) return 'start';\n if (end !== null && isSameDate(date, end)) return 'end';\n if (start === null || end === null) return null;\n return compareDate(date, start) > 0 && compareDate(date, end) < 0 ? 'inside' : null;\n}\n\nexport function isSelected(date: PlainDate, value: CalendarValue): boolean {\n if (isRange(value)) {\n const state = rangeStateOf(date, value);\n return state === 'start' || state === 'end';\n }\n return asDates(value).some((candidate) => isSameDate(candidate, date));\n}\n\n/**\n * The value a press produces.\n *\n * A range takes two presses and the second one may come first: a reader who\n * chooses the 11th and then the 7th means the 7th to the 11th, not a range\n * that runs backwards. A third press starts again, because a range that grew\n * on every press could never be narrowed.\n *\n * A set removes a date a second press lands on, which is the only way to take\n * one back out without a second control.\n */\nexport function nextValue(\n date: PlainDate,\n value: CalendarValue,\n mode: CalendarSelectionMode,\n): CalendarValue {\n if (mode === 'single') {\n return isSelected(date, value) ? null : date;\n }\n\n if (mode === 'multiple') {\n const held = asDates(value);\n const without = held.filter((candidate) => !isSameDate(candidate, date));\n if (without.length !== held.length) return without;\n return [...held, date].sort(compareDate);\n }\n\n const run = isRange(value) ? value : { start: null, end: null };\n if (run.start === null || run.end !== null) return { start: date, end: null };\n return compareDate(date, run.start) < 0\n ? { start: date, end: run.start }\n : { start: run.start, end: date };\n}\n\n/**\n * The run the grid draws while the reader is choosing the second end: from\n * the chosen start to the pending end — the day under the pointer, or the\n * focused day — ordered the way the second press will order it. `null` while\n * there is no open run, so a whole range and a single date preview nothing.\n */\nexport function previewRun(value: CalendarValue, pending: PlainDate | null): DateRange | null {\n if (pending === null || !isRange(value) || value.start === null || value.end !== null)\n return null;\n return compareDate(pending, value.start) < 0\n ? { start: pending, end: value.start }\n : { start: value.start, end: pending };\n}\n\n/** Value equality, which `Object.is` cannot give for a run or a set. */\nexport function isSameValue(a: CalendarValue, b: CalendarValue): boolean {\n if (isRange(a) || isRange(b)) {\n if (!isRange(a) || !isRange(b)) return false;\n return isSameDate(a.start, b.start) && isSameDate(a.end, b.end);\n }\n const left = asDates(a);\n const right = asDates(b);\n if (left.length !== right.length) return false;\n return left.every((date, index) => isSameDate(date, right[index] ?? null));\n}\n","import {\n addDays,\n clampDate,\n createDateFormat,\n endOfWeek,\n isDateInRange,\n isSameDate,\n monthGrid,\n plainDate,\n startOfWeek,\n stepMonth,\n stepYear,\n todayIn,\n visibleMonths,\n yearPage,\n} from '@slotted/core/date';\nimport type { CalendarDay, CalendarWeek, PlainDate } from '@slotted/core/date';\nimport { createControllable } from '@slotted/core/state';\nimport type { ChangeReason, ChangeRequest } from '@slotted/core/state';\nimport {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n numberAttribute,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { OnInit } from '@angular/core';\nimport { injectLocale, injectMessages } from '@slotted/angular/i18n';\nimport { SlGlyph, SlIcon } from '@slotted/angular/icon';\nimport { calendarMessages, type CalendarMessages, type PartialMessages } from '@slotted/core/i18n';\n\nimport { injectCalendarDefaults } from './calendar-defaults';\nimport type {\n CalendarCalendar,\n CalendarGranularity,\n CalendarOutsideDays,\n CalendarSelectionMode,\n CalendarValue,\n CalendarView,\n} from './calendar-defaults';\nimport {\n isRange,\n isSameValue,\n isSelected,\n nextValue,\n previewRun,\n rangeStateOf,\n} from './calendar-selection';\n\n/** How many years one page of the year view holds. */\nconst YEAR_PAGE = 12;\n/** The heading needs an identifier every grid can point `aria-labelledby` at. */\nlet sequence = 0;\n\n/**\n * A month grid, and the two pages above it.\n *\n * **It is a real `table` with the `grid` role on it.** The APG's own note is\n * why nothing here writes `row`, `columnheader` or `gridcell`: those are\n * implied by `tr`, `th` and `td`, and writing them again would duplicate\n * semantics the platform already gives.\n *\n * **The date the reader is on and the date the reader has chosen are two\n * values**, and each has a model of its own — a product that pages a calendar\n * from outside it has nowhere else to say so.\n *\n * **A date the predicate refuses stays reachable.** It carries `aria-disabled`\n * rather than being taken out of the grid, so a reader can arrow onto it, hear\n * why it is out, and arrow past it.\n */\n@Component({\n selector: '[slCalendar]',\n standalone: true,\n exportAs: 'slCalendar',\n imports: [SlGlyph, SlIcon],\n template: `<div data-part=\"header\">\n <button\n data-part=\"previous\"\n type=\"button\"\n [attr.aria-label]=\"pageNames()[0]\"\n [disabled]=\"!editable()\"\n (click)=\"turnPage(-1, $event)\"\n >\n <span slIcon directional><svg slGlyph name=\"chevron-right\"></svg></span>\n </button>\n <!--\n The heading is a live region: paging with a key changes nothing that\n focus lands on, so without this nothing announces the new month.\n -->\n <button\n data-part=\"heading\"\n type=\"button\"\n aria-live=\"polite\"\n [attr.id]=\"headingId\"\n [disabled]=\"!editable() || currentView() === 'year'\"\n (click)=\"walkUp()\"\n >\n {{ heading() }}\n @if (currentView() !== 'year') {\n <span slIcon><svg slGlyph name=\"chevron-down\"></svg></span>\n }\n </button>\n <button\n data-part=\"next\"\n type=\"button\"\n [attr.aria-label]=\"pageNames()[1]\"\n [disabled]=\"!editable()\"\n (click)=\"turnPage(1, $event)\"\n >\n <span slIcon directional><svg slGlyph name=\"chevron-right\"></svg></span>\n </button>\n </div>\n\n @switch (currentView()) {\n @case ('day') {\n <div data-part=\"grids\">\n @for (month of shownMonths(); track month.year * 12 + month.month) {\n <table data-part=\"grid\" role=\"grid\" [attr.aria-labelledby]=\"headingId\">\n <caption data-part=\"grid-caption\">\n {{\n captionOf(month)\n }}\n </caption>\n <thead>\n <tr data-part=\"week-headers\">\n @if (resolvedWeekNumbers()) {\n <th data-part=\"week-number\" aria-hidden=\"true\"></th>\n }\n @for (name of weekdayNarrow(); track $index) {\n <th data-part=\"week-header\" scope=\"col\" [attr.abbr]=\"weekdayLong()[$index]\">\n {{ name }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (week of weeksOf(month); track week.weekNumber) {\n <tr data-part=\"week\">\n @if (resolvedWeekNumbers()) {\n <th data-part=\"week-number\" scope=\"row\">{{ week.weekNumber }}</th>\n }\n @for (\n day of week.days;\n track day.date.year * 400 + day.date.month * 32 + day.date.day\n ) {\n <!-- A hidden day is an empty cell and nothing else. It\n carried the marks of the date it stood for, so a\n range across a month boundary painted a band with no\n digits under it. -->\n <td\n data-part=\"cell\"\n [attr.data-outside-month]=\"day.outsideMonth ? '' : null\"\n [attr.data-unavailable]=\"\n !drawn(day) ? null : unavailable(day.date) ? '' : null\n \"\n [attr.data-selected]=\"!drawn(day) ? null : chosen(day.date) ? '' : null\"\n [attr.data-range-start]=\"\n drawn(day) && rangeState(day.date) === 'start' ? '' : null\n \"\n [attr.data-range-end]=\"\n drawn(day) && rangeState(day.date) === 'end' ? '' : null\n \"\n [attr.data-in-range]=\"\n drawn(day) && rangeState(day.date) === 'inside' ? '' : null\n \"\n [attr.data-preview]=\"drawn(day) && proposed(day.date) ? '' : null\"\n >\n @if (drawn(day)) {\n <span\n data-part=\"day\"\n role=\"button\"\n [attr.data-today]=\"isToday(day.date) ? '' : null\"\n [attr.aria-selected]=\"chosen(day.date) ? 'true' : null\"\n [attr.aria-disabled]=\"refused(day) ? 'true' : null\"\n [tabindex]=\"tabIndexOf(day.date)\"\n (click)=\"!refused(day) && select(day.date, 'pointer', $event)\"\n (pointerenter)=\"hovered.set(day.date)\"\n (pointerleave)=\"hovered.set(null)\"\n >\n {{ day.date.day }}\n </span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n </div>\n }\n @case ('month') {\n @if (monthly()) {\n <div data-part=\"months\">\n @for (name of monthNames(); track $index) {\n <button\n data-part=\"period\"\n type=\"button\"\n [attr.aria-label]=\"monthLabel($index + 1)\"\n [attr.data-selected]=\"heldMonth($index + 1) ? '' : null\"\n [attr.aria-selected]=\"heldMonth($index + 1) ? 'true' : null\"\n [attr.aria-disabled]=\"monthUnavailable($index + 1) ? 'true' : null\"\n [attr.data-unavailable]=\"monthUnavailable($index + 1) ? '' : null\"\n [attr.data-focused]=\"focused().month === $index + 1 ? '' : null\"\n [tabindex]=\"focused().month === $index + 1 ? 0 : -1\"\n (click)=\"selectMonth(focused().year, $index + 1, 'pointer', $event)\"\n >\n {{ name }}\n </button>\n }\n </div>\n } @else {\n <div data-part=\"months\">\n @for (name of monthNames(); track $index) {\n <button\n data-part=\"period\"\n type=\"button\"\n [attr.data-selected]=\"focused().month === $index + 1 ? '' : null\"\n [attr.aria-selected]=\"focused().month === $index + 1 ? 'true' : null\"\n (click)=\"pickMonth($index + 1, $event)\"\n >\n {{ name }}\n </button>\n }\n </div>\n }\n }\n @default {\n <div data-part=\"years\">\n @for (year of years(); track year) {\n <button\n data-part=\"period\"\n type=\"button\"\n [attr.data-selected]=\"focused().year === year ? '' : null\"\n [attr.aria-selected]=\"focused().year === year ? 'true' : null\"\n (click)=\"pickYear(year, $event)\"\n >\n {{ year }}\n </button>\n }\n </div>\n }\n }`,\n styleUrl: '../../../styles/src/calendar/calendar.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-ui': 'calendar',\n 'data-part': 'root',\n '[attr.data-view]': 'currentView()',\n '[attr.data-calendar]': 'resolvedCalendar()',\n '[attr.data-months]': 'resolvedMonths() > 1 ? resolvedMonths() : null',\n '[attr.data-week-numbers]': \"resolvedWeekNumbers() ? '' : null\",\n '[attr.data-disabled]': \"disabled() === true ? '' : null\",\n '[attr.data-readonly]': \"readOnly() === true ? '' : null\",\n '[attr.data-invalid]': \"invalid() === true ? '' : null\",\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class SlCalendar implements OnInit {\n /** Present means the consumer owns the value. */\n readonly value = input<CalendarValue | undefined>(undefined);\n readonly defaultValue = input<CalendarValue | undefined>(undefined);\n /** The date the reader is on. Present means the consumer owns it. */\n readonly focusedDate = input<PlainDate | undefined>(undefined);\n readonly defaultFocusedDate = input<PlainDate | undefined>(undefined);\n\n readonly min = input<PlainDate | undefined>(undefined);\n readonly max = input<PlainDate | undefined>(undefined);\n readonly isDateUnavailable = input<((date: PlainDate) => boolean) | undefined>(undefined);\n\n readonly selectionMode = input<CalendarSelectionMode>('single');\n readonly months = input<number | undefined, unknown>(undefined, {\n transform: (value) =>\n value === undefined || value === null ? undefined : numberAttribute(value),\n });\n /** Present means the consumer owns which grid is showing. */\n readonly view = input<CalendarView | undefined>(undefined);\n readonly defaultView = input<CalendarView | undefined>(undefined);\n /** What a choice is: a day, or a month of a year. Defaults to `day`. */\n readonly granularity = input<CalendarGranularity | undefined>(undefined);\n\n readonly weekNumbers = input<boolean | undefined, boolean | string | undefined>(undefined, {\n transform: (value) => (value === undefined ? undefined : booleanAttribute(value)),\n });\n readonly fixedWeeks = input<boolean | undefined, boolean | string | undefined>(undefined, {\n transform: (value) => (value === undefined ? undefined : booleanAttribute(value)),\n });\n readonly outsideDays = input<CalendarOutsideDays | undefined>(undefined);\n\n /** The locale that writes months and days. Unset, the language in force decides. */\n readonly locale = input<string | undefined>(undefined);\n readonly timeZone = input<string | undefined>(undefined);\n readonly firstDayOfWeek = input<number | undefined, unknown>(undefined, {\n transform: (value) =>\n value === undefined || value === null ? undefined : numberAttribute(value),\n });\n readonly calendar = input<CalendarCalendar | undefined>(undefined);\n\n readonly disabled = input<boolean | undefined, boolean | string | undefined>(undefined, {\n transform: (value) => (value === undefined ? undefined : booleanAttribute(value)),\n });\n readonly readOnly = input<boolean | undefined, boolean | string | undefined>(undefined, {\n transform: (value) => (value === undefined ? undefined : booleanAttribute(value)),\n });\n readonly invalid = input<boolean | undefined, boolean | string | undefined>(undefined, {\n transform: (value) => (value === undefined ? undefined : booleanAttribute(value)),\n });\n\n /**\n * Words laid over the catalog of the language in force, key by key: the\n * names of the previous and next triggers.\n */\n readonly messages = input<PartialMessages<CalendarMessages> | undefined>(undefined);\n\n readonly valueChange = output<ChangeRequest<CalendarValue>>();\n readonly focusedDateChange = output<ChangeRequest<PlainDate>>();\n readonly viewChange = output<CalendarView>();\n /**\n * The pending end of an open run: the day under the pointer, or the focused\n * day when no pointer is over the grid, and `null` while no run is open. A\n * fact the grid states rather than a value the consumer owns, which is why\n * it is an output and not a model — `date-range-picker` reads it to say how\n * long the run would be.\n */\n readonly previewChange = output<PlainDate | null>();\n\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly injector = inject(Injector);\n private readonly defaults = injectCalendarDefaults();\n private readonly appLocale = injectLocale();\n /** The family's words in the language in force, with this calendar's `messages` laid over them. */\n readonly t = injectMessages(calendarMessages, this.messages);\n\n protected readonly headingId = `sl-calendar-${String((sequence += 1))}`;\n\n private readonly ownValue = signal<CalendarValue>(null);\n private readonly ownFocused = signal<PlainDate>(plainDate(2026, 1, 1));\n private readonly ownView = signal<CalendarView>('day');\n /**\n * The first month on screen, which is **not** the month the reader is on.\n *\n * Drawing two months from the focused date meant that choosing a day in the\n * second one scrolled the pair: a reader looking at June and July who chose\n * 9 June was shown July and August, with half of what they had just chosen\n * off screen. The page moves only when the reader leaves it.\n */\n private readonly page = signal<{ year: number; month: number }>({ year: 2026, month: 1 });\n private readonly today = signal<PlainDate | null>(null);\n /** Focus is only moved into the DOM after a key, never on a render. */\n private restoreFocus = false;\n\n protected readonly held = computed(() => this.value() ?? this.ownValue());\n protected readonly focused = computed(() => this.focusedDate() ?? this.ownFocused());\n /**\n * Under `granularity=\"month\"` the months of a year are where a choice is\n * made: the calendar opens there and never goes below it, so a view asked\n * for as `day` is read as `month`.\n */\n protected readonly monthly = computed(() => this.granularity() === 'month');\n /** Which grid is showing. Public, so a template reaches it through `exportAs`. */\n readonly currentView = computed((): CalendarView => {\n const asked = this.view() ?? this.ownView();\n return this.monthly() && asked === 'day' ? 'month' : asked;\n });\n\n protected readonly resolvedMonths = computed(() =>\n Math.max(1, this.months() ?? this.defaults.months),\n );\n protected readonly resolvedWeekNumbers = computed(\n () => this.weekNumbers() ?? this.defaults.weekNumbers,\n );\n protected readonly resolvedFixedWeeks = computed(\n () => this.fixedWeeks() ?? this.defaults.fixedWeeks,\n );\n /**\n * One month draws the days either side of it, because a week that starts on\n * the 30th of the month before has to say what that cell is. Two months\n * cannot: September's grid ends with the first three days of October and\n * October's begins with the last four of September, so a range across the\n * boundary is painted twice and a reader sees an interval twice as long as\n * the one chosen. Every surveyed multi-month calendar hides them, and so\n * does this one — until the consumer says otherwise, on the instance or on\n * the provider.\n */\n protected readonly resolvedOutsideDays = computed(\n () =>\n this.outsideDays() ??\n this.defaults.outsideDays ??\n (this.resolvedMonths() > 1 ? 'hidden' : 'shown'),\n );\n protected readonly resolvedCalendar = computed(() => this.calendar() ?? this.defaults.calendar);\n protected readonly editable = computed(\n () => this.disabled() !== true && this.readOnly() !== true,\n );\n\n protected readonly format = computed(() =>\n createDateFormat({\n locale: this.locale() ?? this.appLocale(),\n firstDayOfWeek: this.firstDayOfWeek() ?? this.defaults.firstDayOfWeek,\n }),\n );\n\n protected readonly weekdayLong = computed(() => this.format().weekdayNames('long'));\n protected readonly weekdayNarrow = computed(() => this.format().weekdayNames('narrow'));\n protected readonly monthNames = computed(() => this.format().monthNames('short'));\n /** Each paging button is named for the step it takes in the view showing. */\n protected readonly pageNames = computed(() => {\n const view = this.currentView();\n if (view === 'day') return [this.t('previousMonth'), this.t('nextMonth')];\n if (view === 'month') return [this.t('previousYear'), this.t('nextYear')];\n return [this.t('previousYears'), this.t('nextYears')];\n });\n protected readonly years = computed(() => yearPage(this.focused().year, YEAR_PAGE));\n protected readonly shownMonths = computed(() =>\n visibleMonths(this.page(), this.resolvedMonths()),\n );\n\n protected readonly heading = computed(() => {\n const focused = this.focused();\n const format = this.format();\n if (this.currentView() === 'year') {\n const years = this.years();\n return `${String(years[0] ?? focused.year)} – ${String(years.at(-1) ?? focused.year)}`;\n }\n if (this.currentView() === 'month') return String(focused.year);\n\n const page = this.page();\n const start = plainDate(page.year, page.month, 1);\n if (this.resolvedMonths() === 1) return format.monthYear(start);\n const last = stepMonth(start, this.resolvedMonths() - 1).date;\n return `${format.monthYear(start, 'short')} – ${format.monthYear(last, 'short')}`;\n });\n\n constructor() {\n /**\n * The page follows the reader, and only when the reader has left it.\n * Written as an effect rather than inside the request, so a consumer who\n * owns `focusedDate` and moves it from outside is followed too.\n */\n /* The pending end, reported once per change and never while it is the\n same day: a pointer crossing a cell twice is one fact, not two. */\n let reported: PlainDate | null = null;\n effect(() => {\n const end = this.previewEnd();\n if (isSameDate(reported, end)) return;\n reported = end;\n this.previewChange.emit(end);\n });\n\n effect(() => {\n const focused = this.focused();\n const held = this.page();\n const span = this.resolvedMonths();\n const start = held.year * 12 + (held.month - 1);\n const wanted = focused.year * 12 + (focused.month - 1);\n if (wanted >= start && wanted < start + span) return;\n /* Outside the span: the page moves by whole pages, so a reader stepping\n past the edge lands where the arrows would have taken them. */\n const moved = start + Math.floor((wanted - start) / span) * span;\n this.page.set({ year: Math.floor(moved / 12), month: (moved % 12) + 1 });\n });\n }\n\n ngOnInit() {\n this.ownValue.set(this.defaultValue() ?? null);\n this.ownView.set(this.defaultView() ?? (this.monthly() ? 'month' : 'day'));\n this.today.set(todayIn(this.timeZone() ?? this.defaults.timeZone));\n const start = this.startingDate();\n this.ownFocused.set(start);\n this.page.set({ year: start.year, month: start.month });\n }\n\n /** Puts focus on the cell holding the roving tab stop. */\n focus() {\n this.element\n .querySelector<HTMLElement>(\n '[data-part=\"day\"][tabindex=\"0\"], [data-part=\"period\"][tabindex=\"0\"]',\n )\n ?.focus();\n }\n\n /** Moves the reader to a date, paging the grid to reach it. */\n focusDate(date: PlainDate) {\n this.requestFocused(date, 'programmatic', undefined);\n }\n\n /** The date, the run or the set the calendar holds. */\n readonly selection = computed(() => this.held());\n\n protected captionOf(month: { year: number; month: number }) {\n return this.format().monthYear(plainDate(month.year, month.month, 1));\n }\n\n protected weeksOf(month: { year: number; month: number }): CalendarWeek[] {\n return monthGrid({\n ...month,\n firstDayOfWeek: this.format().firstDayOfWeek,\n fixedWeeks: this.resolvedFixedWeeks(),\n });\n }\n\n protected unavailable(date: PlainDate): boolean {\n if (!isDateInRange(date, this.min(), this.max())) return true;\n return this.isDateUnavailable()?.(date) === true;\n }\n\n /** Unavailable, or an outside day the axis says may not be chosen. */\n /** Whether the cell carries a day at all, or stands empty to fill the row. */\n protected drawn(day: CalendarDay): boolean {\n return !(day.outsideMonth && this.resolvedOutsideDays() === 'hidden');\n }\n\n /**\n * The grid already knows which month a day belongs to, and asking the first\n * shown month instead refused every day of the second one in a pair.\n */\n protected refused(day: CalendarDay): boolean {\n if (this.unavailable(day.date)) return true;\n return day.outsideMonth && this.resolvedOutsideDays() === 'shown';\n }\n\n protected chosen(date: PlainDate): boolean {\n return isSelected(date, this.held());\n }\n\n /**\n * The day under the pointer, held only to name the pending end of an open\n * run. It never moves the roving focus: a pointer crossing the grid is not\n * the reader choosing where they are.\n */\n protected readonly hovered = signal<PlainDate | null>(null);\n\n /** The run as it would close on the pending end; `null` while no run is open. */\n private readonly pending = computed(() =>\n this.selectionMode() === 'range' && this.editable()\n ? previewRun(this.held(), this.hovered() ?? this.focused())\n : null,\n );\n\n private readonly previewEnd = computed(() => {\n const pending = this.pending();\n const held = this.held();\n if (pending === null) return null;\n return isRange(held) && held.start !== null && isSameDate(pending.start, held.start)\n ? pending.end\n : pending.start;\n });\n\n protected rangeState(date: PlainDate) {\n return rangeStateOf(date, this.pending() ?? this.held());\n }\n\n /** Every cell of the pending band is a proposal except the start the reader chose. */\n protected proposed(date: PlainDate): boolean {\n return this.pending() !== null && this.rangeState(date) !== null && !this.chosen(date);\n }\n\n protected isToday(date: PlainDate): boolean {\n const today = this.today();\n return today !== null && isSameDate(date, today);\n }\n\n protected tabIndexOf(date: PlainDate): number {\n return isSameDate(date, this.focused()) && this.editable() ? 0 : -1;\n }\n\n protected select(date: PlainDate, reason: ChangeReason, source: Event | undefined) {\n if (!this.editable() || this.unavailable(date)) return;\n this.requestValue(nextValue(date, this.held(), this.selectionMode()), reason, source);\n this.requestFocused(date, reason, source);\n }\n\n /** A month cell's name: the month and the year, which the cell alone does not say. */\n protected monthLabel(month: number): string {\n return this.format().monthYear(plainDate(this.focused().year, month, 1));\n }\n\n /** Whether the value's month is this cell of the year on screen. */\n protected heldMonth(month: number): boolean {\n const held = this.held();\n if (held === null || Array.isArray(held) || isRange(held)) return false;\n return held.year === this.focused().year && held.month === month;\n }\n\n /**\n * A month the bounds leave no day of. The bounds are days, so a month is\n * refused only when it ends before `min` or starts after `max`.\n */\n protected monthUnavailable(month: number, year = this.focused().year): boolean {\n const at = year * 12 + month;\n const min = this.min();\n const max = this.max();\n return (\n (min !== undefined && at < min.year * 12 + min.month) ||\n (max !== undefined && at > max.year * 12 + max.month)\n );\n }\n\n /** The value of a month cell is the first day of the month. */\n protected selectMonth(\n year: number,\n month: number,\n reason: ChangeReason,\n source: Event | undefined,\n ) {\n if (!this.editable() || this.monthUnavailable(month, year)) return;\n const date = plainDate(year, month, 1);\n this.requestValue(date, reason, source);\n this.requestFocused(date, reason, source);\n }\n\n /** The reader moves with the page rather than staying behind it. */\n protected turnPage(direction: 1 | -1, source: Event) {\n const focused = this.focused();\n if (this.currentView() === 'day') {\n this.requestFocused(\n stepMonth(focused, direction * this.resolvedMonths()).date,\n 'pointer',\n source,\n );\n return;\n }\n const step = this.currentView() === 'month' ? direction : direction * YEAR_PAGE;\n this.requestFocused(stepYear(focused, step).date, 'pointer', source);\n }\n\n protected walkUp() {\n this.setView(this.currentView() === 'day' ? 'month' : 'year');\n }\n\n protected pickMonth(month: number, source: Event) {\n this.requestFocused({ ...this.focused(), month, day: 1 }, 'pointer', source);\n this.setView('day');\n }\n\n protected pickYear(year: number, source: Event) {\n this.requestFocused({ ...this.focused(), year, day: 1 }, 'pointer', source);\n this.setView('month');\n }\n\n protected onKeyDown(event: KeyboardEvent) {\n const rtl = getComputedStyle(this.element).direction === 'rtl';\n const forward = rtl ? 'ArrowLeft' : 'ArrowRight';\n const backward = rtl ? 'ArrowRight' : 'ArrowLeft';\n const focused = this.focused();\n const first = this.format().firstDayOfWeek;\n\n /**\n * A key the grid acted on is the grid's, and nothing above it sees it.\n * An application that binds a bare key guards it with \"is the target an\n * editable element\", and a `td` is not one — so the arrows a reader walks\n * a month with would fire every shortcut on the page.\n */\n const consume = () => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n const move = (next: PlainDate) => {\n consume();\n this.requestFocused(next, 'keyboard', event);\n };\n\n /**\n * The months of a year, as a grid of four columns: the arrows move one\n * month or one row, Home and End reach January and December, the page\n * keys move a year, and Enter or Space chooses. Escape is left alone, so\n * the surface above the calendar may close on it.\n */\n if (this.monthly() && this.currentView() === 'month') {\n const toMonth = (delta: number) => {\n const index = focused.year * 12 + (focused.month - 1) + delta;\n return plainDate(Math.floor(index / 12), (index % 12) + 1, 1);\n };\n switch (event.key) {\n case forward:\n return move(toMonth(1));\n case backward:\n return move(toMonth(-1));\n case 'ArrowUp':\n return move(toMonth(-4));\n case 'ArrowDown':\n return move(toMonth(4));\n case 'Home':\n return move(plainDate(focused.year, 1, 1));\n case 'End':\n return move(plainDate(focused.year, 12, 1));\n case 'PageUp':\n return move(toMonth(-12));\n case 'PageDown':\n return move(toMonth(12));\n case 'Enter':\n case ' ':\n consume();\n this.selectMonth(focused.year, focused.month, 'keyboard', event);\n return;\n default:\n break;\n }\n }\n\n switch (event.key) {\n case forward:\n return move(addDays(focused, 1));\n case backward:\n return move(addDays(focused, -1));\n case 'ArrowUp':\n return move(addDays(focused, -7));\n case 'ArrowDown':\n return move(addDays(focused, 7));\n case 'Home':\n return move(startOfWeek(focused, first));\n case 'End':\n return move(endOfWeek(focused, first));\n case 'PageUp':\n return move(event.shiftKey ? stepYear(focused, -1).date : stepMonth(focused, -1).date);\n case 'PageDown':\n return move(event.shiftKey ? stepYear(focused, 1).date : stepMonth(focused, 1).date);\n case 'Enter':\n case ' ':\n consume();\n this.select(focused, 'keyboard', event);\n return;\n case 'Escape':\n /* The view closes before the surface does, which is the staging\n `dismissable-layer` asks a family to do: the key is simply not\n passed on, and no layer is asked to close. */\n /* In the day view the key is left alone, so a surface above the\n calendar may still close on it. */\n if (this.currentView() === 'day' || (this.monthly() && this.currentView() === 'month')) {\n return;\n }\n consume();\n this.setView(this.currentView() === 'year' ? 'month' : 'day');\n return;\n default:\n return;\n }\n }\n\n /**\n * The first date the reader is put on: what a consumer said, then the value\n * it holds, then today. A calendar that opened on an arbitrary month would\n * make the reader page to now before doing anything at all.\n */\n private startingDate(): PlainDate {\n const stated = this.defaultFocusedDate() ?? this.focusedDate();\n if (stated !== undefined) return stated;\n const held = this.defaultValue() ?? this.value() ?? null;\n if (held !== null) {\n if (Array.isArray(held)) {\n const first = held[0];\n if (first !== undefined) return first;\n } else if ('start' in held) {\n if (held.start !== null) return held.start;\n } else {\n return held;\n }\n }\n return clampDate(this.today() ?? plainDate(2026, 1, 1), this.min(), this.max());\n }\n\n private setView(next: CalendarView) {\n if (this.view() === undefined) this.ownView.set(next);\n this.viewChange.emit(next);\n }\n\n private requestValue(next: CalendarValue, reason: ChangeReason, source: Event | undefined) {\n const state = createControllable<CalendarValue>({\n controlled: this.value(),\n initial: this.held(),\n equals: isSameValue,\n onRequest: (request) => this.valueChange.emit(request),\n });\n if (state.request(next, reason, source)) this.ownValue.set(next);\n }\n\n private requestFocused(next: PlainDate, reason: ChangeReason, source: Event | undefined) {\n const bounded = clampDate(next, this.min(), this.max());\n const state = createControllable<PlainDate>({\n controlled: this.focusedDate(),\n initial: this.focused(),\n equals: (a, b) => isSameDate(a, b),\n onRequest: (request) => this.focusedDateChange.emit(request),\n });\n this.restoreFocus = reason === 'keyboard';\n if (state.request(bounded, reason, source)) this.ownFocused.set(bounded);\n if (this.restoreFocus) this.followFocus();\n }\n\n /**\n * Focus follows a key onto the cell that holds the roving tab stop, once the\n * page holding it is rendered.\n *\n * A key that crosses the month edge lands on the old page's trailing day\n * first, and the page follows one render later. Focused before that, the\n * cell was replaced under the reader and focus fell to the document — which\n * a consumer owning `focusedDate` met on every crossing. Focus is moved only\n * while it is still in the calendar or was lost to the document, so a\n * consumer that refused the move never has focus taken from elsewhere.\n */\n private followFocus() {\n afterNextRender(\n () => {\n if (!this.restoreFocus) return;\n const active = this.element.ownerDocument.activeElement;\n const lost = active === null || active === this.element.ownerDocument.body;\n if (!lost && !this.element.contains(active)) {\n this.restoreFocus = false;\n return;\n }\n const stop = this.element.querySelector<HTMLElement>(\n '[data-part=\"cell\"]:not([data-outside-month]) [data-part=\"day\"][tabindex=\"0\"], [data-part=\"period\"][tabindex=\"0\"]',\n );\n if (stop !== null) {\n this.restoreFocus = false;\n stop.focus();\n return;\n }\n if (this.element.querySelector('[data-part=\"day\"][tabindex=\"0\"]') === null) {\n this.restoreFocus = false;\n return;\n }\n this.followFocus();\n },\n { injector: this.injector },\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAsDA,MAAM,QAAQ,GAAqB;AACjC,IAAA,QAAQ,EAAE,SAAS;AACnB,IAAA,cAAc,EAAE,SAAS;AACzB,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,WAAW,EAAE,SAAS;AACtB,IAAA,QAAQ,EAAE,SAAS;AACnB,IAAA,WAAW,EAAE,KAAK;CACnB;MAEY,iBAAiB,GAAG,IAAI,cAAc,CAAmB,2BAA2B,EAAE;AACjG,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,QAAQ;AACxB,CAAA;AAED;;;;;;;;;AASG;AACG,SAAU,uBAAuB,CAAC,QAAmC,EAAA;IACzE,OAAO;AACL,QAAA,OAAO,EAAE,iBAAiB;AAC1B,QAAA,UAAU,EAAE,OAAyB,EAAE,GAAG,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAAC;KACnE;AACH;AAEA;SACgB,sBAAsB,GAAA;AACpC,IAAA,OAAO,MAAM,CAAC,iBAAiB,CAAC;AAClC;;ACzFA;;;;;;;AAOG;AAOG,SAAU,OAAO,CAAC,KAAoB,EAAA;AAC1C,IAAA,OAAO,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,IAAI,KAAK;AACpE;AAEM,SAAU,OAAO,CAAC,KAAoB,EAAA;IAC1C,IAAI,KAAK,KAAK,IAAI;AAAE,QAAA,OAAO,EAAE;AAC7B,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AAAE,QAAA,OAAO,KAAK;IACtC,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CA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IAAA,EAAA,CAAA;;2FAyLd,UAAU,EAAA,UAAA,EAAA,CAAA;kBA7LtB,SAAS;+BACE,cAAc,EAAA,UAAA,EACZ,IAAI,EAAA,QAAA,EACN,YAAY,EAAA,OAAA,EACb,CAAC,OAAO,EAAE,MAAM,CAAC,EAAA,QAAA,EAChB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuKN,KAAA,CAAA,EAAA,eAAA,EAEa,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,SAAS,EAAE,UAAU;AACrB,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,kBAAkB,EAAE,eAAe;AACnC,wBAAA,sBAAsB,EAAE,oBAAoB;AAC5C,wBAAA,oBAAoB,EAAE,gDAAgD;AACtE,wBAAA,0BAA0B,EAAE,mCAAmC;AAC/D,wBAAA,sBAAsB,EAAE,iCAAiC;AACzD,wBAAA,sBAAsB,EAAE,iCAAiC;AACzD,wBAAA,qBAAqB,EAAE,gCAAgC;AACvD,wBAAA,WAAW,EAAE,mBAAmB;AACjC,qBAAA,EAAA,MAAA,EAAA,CAAA,+lcAAA,CAAA,EAAA;;;AC1QH;;AAEG;;"}
@@ -297,10 +297,12 @@ class SlCommandPalette {
297
297
  : -1;
298
298
  untracked(() => this.setHighlighted(first === -1 ? null : (ids[first] ?? null), 'programmatic'));
299
299
  });
300
- /* The row the highlight is on scrolls into view; it holds no focus. */
300
+ /* The row the highlight is on scrolls into view; it holds no focus. A row
301
+ the pointer highlighted is already under it, and scrolling it would
302
+ fight a finger or a wheel moving the list. */
301
303
  effect(() => {
302
304
  const id = this.highlightedId();
303
- if (id === null)
305
+ if (id === null || id === this.pointerHighlight)
304
306
  return;
305
307
  const node = this.list()?.nativeElement.querySelector(`#${CSS.escape(this.domId(id))}`);
306
308
  if (typeof node?.scrollIntoView === 'function')
@@ -375,9 +377,12 @@ class SlCommandPalette {
375
377
  if (state.request(next, reason, source))
376
378
  this.query.set(next);
377
379
  }
380
+ /** The row the pointer last highlighted, which never scrolls the list. */
381
+ pointerHighlight = null;
378
382
  setHighlighted(next, reason, source) {
379
383
  if (next === this.highlightedId())
380
384
  return;
385
+ this.pointerHighlight = reason === 'pointer' ? next : null;
381
386
  const state = createControllable({
382
387
  initial: this.highlightedId(),
383
388
  onRequest: (request) => this.highlightedIdChangeRequest.emit(request),
@@ -518,8 +523,20 @@ class SlCommandPalette {
518
523
  returnTo(index, event) {
519
524
  this.setPages(this.pages().slice(0, index + 1), 'pointer', event);
520
525
  }
526
+ /**
527
+ * Focus stays in the input while the palette is open, as in a platform
528
+ * search field: a press anywhere else — a group label, the list's empty
529
+ * space, a row — keeps it there, and on a phone the keyboard stays up. The
530
+ * press's click still runs.
531
+ */
532
+ keepFocus(event) {
533
+ if (event.target !== this.field()?.nativeElement)
534
+ event.preventDefault();
535
+ }
521
536
  hover(item, event) {
522
- if (item.disabled === true)
537
+ /* A finger on the list is a scroll until it ends as a tap: the tap's click
538
+ executes, and a highlight on the way would trail the finger. */
539
+ if (item.disabled === true || event.pointerType === 'touch')
523
540
  return;
524
541
  this.setHighlighted(item.id, 'pointer', event);
525
542
  }
@@ -678,6 +695,7 @@ class SlCommandPalette {
678
695
  [attr.data-disabled]="disabled() ? '' : null"
679
696
  [attr.data-query]="query() === '' ? null : ''"
680
697
  [attr.data-empty]="isEmpty() ? '' : null"
698
+ (mousedown)="keepFocus($event)"
681
699
  >
682
700
  <div data-part="header">
683
701
  @if (loading()) {
@@ -969,6 +987,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
969
987
  [attr.data-disabled]="disabled() ? '' : null"
970
988
  [attr.data-query]="query() === '' ? null : ''"
971
989
  [attr.data-empty]="isEmpty() ? '' : null"
990
+ (mousedown)="keepFocus($event)"
972
991
  >
973
992
  <div data-part="header">
974
993
  @if (loading()) {