forty-cdk 0.40.0 → 0.41.0
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.
- package/README.md +1 -1
- package/breadcrumbs/README.md +1 -1
- package/breakpoints/README.md +12 -2
- package/calendar/README.md +2 -2
- package/dialog/README.md +22 -9
- package/drawer/README.md +18 -9
- package/fesm2022/forty-cdk-calendar.mjs +14 -4
- package/fesm2022/forty-cdk-calendar.mjs.map +1 -1
- package/fesm2022/forty-cdk-combobox.mjs +49 -40
- package/fesm2022/forty-cdk-combobox.mjs.map +1 -1
- package/fesm2022/forty-cdk-context-menu.mjs +42 -38
- package/fesm2022/forty-cdk-context-menu.mjs.map +1 -1
- package/fesm2022/forty-cdk-core-anchored.mjs +2076 -0
- package/fesm2022/forty-cdk-core-anchored.mjs.map +1 -0
- package/fesm2022/forty-cdk-core-overlay.mjs +145 -2202
- package/fesm2022/forty-cdk-core-overlay.mjs.map +1 -1
- package/fesm2022/forty-cdk-core.mjs +60 -28
- package/fesm2022/forty-cdk-core.mjs.map +1 -1
- package/fesm2022/forty-cdk-date-picker.mjs +80 -57
- package/fesm2022/forty-cdk-date-picker.mjs.map +1 -1
- package/fesm2022/forty-cdk-defaults.mjs.map +1 -1
- package/fesm2022/forty-cdk-dialog.mjs +2 -1
- package/fesm2022/forty-cdk-dialog.mjs.map +1 -1
- package/fesm2022/forty-cdk-drawer.mjs +2 -1
- package/fesm2022/forty-cdk-drawer.mjs.map +1 -1
- package/fesm2022/forty-cdk-dropdown-menu.mjs +48 -33
- package/fesm2022/forty-cdk-dropdown-menu.mjs.map +1 -1
- package/fesm2022/forty-cdk-hover-card.mjs +52 -35
- package/fesm2022/forty-cdk-hover-card.mjs.map +1 -1
- package/fesm2022/forty-cdk-input.mjs +19 -13
- package/fesm2022/forty-cdk-input.mjs.map +1 -1
- package/fesm2022/forty-cdk-listbox.mjs +56 -43
- package/fesm2022/forty-cdk-listbox.mjs.map +1 -1
- package/fesm2022/forty-cdk-menu.mjs +32 -6
- package/fesm2022/forty-cdk-menu.mjs.map +1 -1
- package/fesm2022/forty-cdk-menubar.mjs +13 -10
- package/fesm2022/forty-cdk-menubar.mjs.map +1 -1
- package/fesm2022/forty-cdk-navigation-menu.mjs +8 -1
- package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -1
- package/fesm2022/forty-cdk-popover.mjs +74 -34
- package/fesm2022/forty-cdk-popover.mjs.map +1 -1
- package/fesm2022/forty-cdk-select.mjs +50 -28
- package/fesm2022/forty-cdk-select.mjs.map +1 -1
- package/fesm2022/forty-cdk-shared.mjs +1 -1
- package/fesm2022/forty-cdk-table-virtualization.mjs +8 -8
- package/fesm2022/forty-cdk-table-virtualization.mjs.map +1 -1
- package/fesm2022/forty-cdk-time-picker.mjs +53 -23
- package/fesm2022/forty-cdk-time-picker.mjs.map +1 -1
- package/fesm2022/forty-cdk-tooltip.mjs +61 -38
- package/fesm2022/forty-cdk-tooltip.mjs.map +1 -1
- package/fesm2022/forty-cdk-virtualization.mjs +14 -12
- package/fesm2022/forty-cdk-virtualization.mjs.map +1 -1
- package/hover-card/README.md +0 -1
- package/listbox/README.md +3 -3
- package/package.json +5 -1
- package/shared/README.md +5 -5
- package/table/README.md +8 -8
- package/table-virtualization/README.md +1 -1
- package/types/forty-cdk-calendar.d.ts +26 -9
- package/types/forty-cdk-combobox.d.ts +12 -13
- package/types/forty-cdk-context-menu.d.ts +11 -13
- package/types/forty-cdk-core-anchored.d.ts +2855 -0
- package/types/forty-cdk-core-overlay.d.ts +222 -2984
- package/types/forty-cdk-core.d.ts +22 -8
- package/types/forty-cdk-date-picker.d.ts +29 -20
- package/types/forty-cdk-defaults.d.ts +2 -1
- package/types/forty-cdk-dialog.d.ts +51 -15
- package/types/forty-cdk-drawer.d.ts +51 -15
- package/types/forty-cdk-dropdown-menu.d.ts +3 -2
- package/types/forty-cdk-hover-card.d.ts +12 -9
- package/types/forty-cdk-listbox.d.ts +15 -14
- package/types/forty-cdk-menu.d.ts +5 -3
- package/types/forty-cdk-menubar.d.ts +2 -3
- package/types/forty-cdk-popover.d.ts +26 -13
- package/types/forty-cdk-select.d.ts +10 -5
- package/types/forty-cdk-shared.d.ts +1 -1
- package/types/forty-cdk-table-virtualization.d.ts +1 -1
- package/types/forty-cdk-time-picker.d.ts +8 -3
- package/types/forty-cdk-tooltip.d.ts +25 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forty-cdk-calendar.mjs","names":["GRID_COLUMNS","FOR_CALENDAR_DEFAULTS"],"sources":["../../../projects/forty-cdk/calendar/src/calendar-bounds.ts","../../../projects/forty-cdk/calendar/src/calendar-context.ts","../../../projects/forty-cdk/calendar/src/build-month-matrix.ts","../../../projects/forty-cdk/calendar/src/calendar-keyboard.ts","../../../projects/forty-cdk/calendar/src/calendar-day-navigator.ts","../../../projects/forty-cdk/calendar/src/calendar-month-navigator.ts","../../../projects/forty-cdk/calendar/src/intended-day-cursor.ts","../../../projects/forty-cdk/calendar/src/calendar-navigation.ts","../../../projects/forty-cdk/calendar/src/calendar-range-selection.ts","../../../projects/forty-cdk/calendar/src/calendar-year-navigator.ts","../../../projects/forty-cdk/calendar/src/calendar.ts","../../../projects/forty-cdk/calendar/src/calendar-grid.ts","../../../projects/forty-cdk/calendar/src/calendar-grid-header.ts","../../../projects/forty-cdk/calendar/src/calendar-cell.ts","../../../projects/forty-cdk/calendar/src/calendar-heading.ts","../../../projects/forty-cdk/calendar/src/calendar-prev-button.ts","../../../projects/forty-cdk/calendar/src/calendar-next-button.ts","../../../projects/forty-cdk/calendar/src/calendar-month-grid.ts","../../../projects/forty-cdk/calendar/src/calendar-month-cell.ts","../../../projects/forty-cdk/calendar/src/calendar-year-grid.ts","../../../projects/forty-cdk/calendar/src/calendar-year-cell.ts","../../../projects/forty-cdk/calendar/src/calendar-view-trigger.ts","../../../projects/forty-cdk/calendar/src/calendar-month-select.ts","../../../projects/forty-cdk/calendar/src/calendar-year-select.ts"],"sourcesContent":["import { computed, type Signal } from '@angular/core';\n\nimport { compareDateOf, clampToBounds } from 'forty-cdk/core';\nimport { type DateAdapter } from 'forty-cdk/date-adapter';\n\n/**\n * The reactive `[min, max]` bounds surface a `ForCalendar` root supplies to its\n * {@link CalendarBounds}.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport interface CalendarBoundsHost<D> {\n /** The active date adapter. */\n readonly adapter: DateAdapter<D>;\n /** Minimum selectable date (inclusive), or `null`. */\n readonly min: Signal<D | null>;\n /** Maximum selectable date (inclusive), or `null`. */\n readonly max: Signal<D | null>;\n /** The visible month (first day), used by the prev / next-month predicates. */\n readonly visibleMonth: () => D;\n /** Per-date consumer predicate marking a date unavailable. */\n readonly isDateUnavailable: Signal<(date: D) => boolean>;\n /** Whether the whole calendar is disabled. */\n readonly disabled: Signal<boolean>;\n}\n\n/**\n * Owns every `[min, max]` bounds question a `ForCalendar` asks: whole-month /\n * whole-year out-of-bounds checks, the prev / next-month disabled predicates,\n * per-date availability, and the navigation clamp. Shared by the root and the\n * day / month / year sub-grids so the bounds math lives in one place.\n *\n * Constructed directly (`new CalendarBounds(host)`); it holds no injection\n * context, mirroring how `SegmentEditor` is lifted out of the date / time\n * fields.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class CalendarBounds<D> {\n readonly #host: CalendarBoundsHost<D>;\n\n /** Whether the previous-month button should be disabled (bounded by `min`). */\n readonly isPreviousMonthDisabled = computed(() => {\n const min = this.#host.min();\n if (min === null) {\n return false;\n }\n const adapter = this.#host.adapter;\n const previousMonthLastDay = adapter.addDays(this.#host.visibleMonth(), -1);\n return compareDateOf(adapter, previousMonthLastDay, min) < 0;\n });\n\n /** Whether the next-month button should be disabled (bounded by `max`). */\n readonly isNextMonthDisabled = computed(() => {\n const max = this.#host.max();\n if (max === null) {\n return false;\n }\n const adapter = this.#host.adapter;\n const nextMonthFirstDay = adapter.addMonths(this.#host.visibleMonth(), 1);\n return compareDateOf(adapter, nextMonthFirstDay, max) > 0;\n });\n\n constructor(host: CalendarBoundsHost<D>) {\n this.#host = host;\n }\n\n /** Whether every day of `month` (**1-12**) in `year` falls outside `[min, max]`. */\n isMonthOutOfBounds(year: number, month: number): boolean {\n const adapter = this.#host.adapter;\n const firstDay = adapter.createDate(year, month, 1);\n const lastDay = adapter.createDate(year, month, adapter.getDaysInMonth(firstDay));\n return this.#outOfBounds(firstDay, lastDay);\n }\n\n /** Whether every day of `year` falls outside `[min, max]`. */\n isYearDisabled(year: number): boolean {\n const adapter = this.#host.adapter;\n return this.#outOfBounds(adapter.createDate(year, 1, 1), adapter.createDate(year, 12, 31));\n }\n\n /** Whether `date` cannot be selected (`disabled`, out of `[min, max]`, or unavailable). */\n isUnavailable(date: D): boolean {\n if (this.#host.disabled()) {\n return true;\n }\n const adapter = this.#host.adapter;\n const min = this.#host.min();\n if (min !== null && compareDateOf(adapter, date, min) < 0) {\n return true;\n }\n const max = this.#host.max();\n if (max !== null && compareDateOf(adapter, date, max) > 0) {\n return true;\n }\n return this.#host.isDateUnavailable()(date);\n }\n\n /** Whether `date` falls within `[min, max]`, ignoring availability and `disabled`. */\n contains(date: D): boolean {\n return !this.#outOfBounds(date, date);\n }\n\n /** Clamp `date` into `[min, max]`, returning the nearer bound when outside. */\n clamp(date: D): D {\n const adapter = this.#host.adapter;\n return clampToBounds(adapter, date, this.#host.min(), this.#host.max(), (a, b) =>\n compareDateOf(adapter, a, b),\n );\n }\n\n #outOfBounds(firstDay: D, lastDay: D): boolean {\n const adapter = this.#host.adapter;\n const min = this.#host.min();\n if (min !== null && compareDateOf(adapter, lastDay, min) < 0) {\n return true;\n }\n const max = this.#host.max();\n if (max !== null && compareDateOf(adapter, firstDay, max) > 0) {\n return true;\n }\n return false;\n }\n}\n","import { inject, InjectionToken, type Signal } from '@angular/core';\n\nimport {\n assertRootContext,\n orphanContextError,\n type Unset,\n type WritingDirection,\n} from 'forty-cdk/core';\nimport { type DateAdapter } from 'forty-cdk/date-adapter';\n\n/** The active display mode of a `ForCalendar`. */\nexport type CalendarView = 'day' | 'month' | 'year';\n\n/** A selectable year in the year picker grid. */\nexport interface CalendarYearOption {\n /** The full year (e.g. `2026`). */\n readonly value: number;\n /** Whether the entire year falls outside `[min, max]`. */\n readonly disabled: boolean;\n}\n\n/** A row of three months in the month picker grid. */\nexport interface CalendarMonthRow {\n /** Stable key for `@for` tracking. */\n readonly key: string;\n /** The (up to three) month options in this row. */\n readonly months: readonly CalendarMonthOption[];\n}\n\n/** A row of three years in the year picker grid. */\nexport interface CalendarYearRow {\n /** Stable key for `@for` tracking. */\n readonly key: string;\n /** The (up to three) year options in this row. */\n readonly years: readonly CalendarYearOption[];\n}\n\n/**\n * Handle a `ForCalendarMonthCell` registers with the root so the root can move\n * DOM focus to the correct cell during keyboard navigation and view switches.\n */\nexport interface ForCalendarMonthCellHandle {\n /** The `role=\"gridcell\"` host element. */\n readonly host: HTMLElement;\n /** The month this cell represents, **1-12**, or {@link Unset} before its binding is written. */\n readonly month: Signal<number | Unset>;\n}\n\n/**\n * Handle a `ForCalendarYearCell` registers with the root so the root can move\n * DOM focus to the correct cell during keyboard navigation and view switches.\n */\nexport interface ForCalendarYearCellHandle {\n /** The `role=\"gridcell\"` host element. */\n readonly host: HTMLElement;\n /** The year this cell represents, or {@link Unset} before its binding is written. */\n readonly year: Signal<number | Unset>;\n}\n\n/** A selectable month in the visible year, for building a month dropdown. */\nexport interface CalendarMonthOption {\n /** Month number, **1-12**. */\n readonly value: number;\n /** Localized month name via the adapter (e.g. `\"June\"`). */\n readonly label: string;\n /** Whether the whole month falls outside `[min, max]`. */\n readonly disabled: boolean;\n}\n\n/** A weekday column header in the calendar grid. */\nexport interface CalendarWeekday {\n /** Stable key for `@for` tracking (the **0-6** weekday index as a string). */\n readonly key: string;\n /** Narrow label, e.g. `\"M\"`. */\n readonly narrow: string;\n /** Short label, e.g. `\"Mon\"`. */\n readonly short: string;\n /** Long label, e.g. `\"Monday\"`. */\n readonly long: string;\n}\n\n/** A single day cell in the calendar grid. */\nexport interface CalendarDayCell<D> {\n /** Stable key for `@for` tracking (`year-month-day`). */\n readonly key: string;\n /** The date this cell represents. Bind to `[date]` on `[forCalendarCell]`. */\n readonly date: D;\n /** Day-of-month label, e.g. `\"1\"`. The cell's visible content. */\n readonly label: string;\n /**\n * Full accessible date string for the cell, host-bound to `aria-label` by\n * `[forCalendarCell]`. Defaults to the localized full date (e.g.\n * `\"Monday, June 15, 2026\"`); outside-month padding days are suffixed so\n * assistive tech can tell them apart from the visible month. Customize the\n * format with `ForCalendar`'s `dateLabel` input.\n */\n readonly dateLabel: string;\n}\n\n/**\n * Formats the full accessible date string a calendar gridcell exposes as its\n * `aria-label`. Supplied to `ForCalendar`'s `dateLabel` input to override the\n * default localized full date.\n *\n * @typeParam D The adapter's date type.\n * @param date The cell's date.\n * @param context Formatting context: the active {@link DateAdapter}, whether the\n * date falls outside the visible month, and the calendar's `locale` input\n * (`null` = the adapter's own locale) to forward to `adapter.format`.\n */\nexport type CalendarDateLabelFormatter<D> = (\n date: D,\n context: {\n readonly adapter: DateAdapter<D>;\n readonly outsideMonth: boolean;\n readonly locale: string | null;\n },\n) => string;\n\n/** A week row in the calendar grid. */\nexport interface CalendarWeek<D> {\n /** Stable key for `@for` tracking (the first day's `year-month-day`). */\n readonly key: string;\n /** The seven day cells of this week, starting at `firstDayOfWeek`. */\n readonly days: readonly CalendarDayCell<D>[];\n}\n\n/**\n * Handle a `ForCalendarCell` registers with the root so it can move DOM focus\n * to the cell matching a target date after the grid re-renders (e.g. when\n * keyboard navigation crosses a month boundary).\n */\nexport interface ForCalendarCellHandle<D> {\n /** The `role=\"gridcell\"` host element. */\n readonly host: HTMLElement;\n /** The date this cell represents, or {@link Unset} before its binding is written. */\n readonly date: Signal<D | Unset>;\n}\n\n/**\n * Coordination contract owned by `ForCalendar` (the root). Grid, header,\n * cells, heading, and the navigation buttons all derive their state from it\n * and route selection / navigation through it.\n *\n * The token is typed over `unknown`; pieces pass their own `D` into the\n * `unknown`-typed methods (always assignable) and never need the concrete `D`\n * back out.\n *\n * @typeParam D The adapter's date type.\n */\nexport interface ForCalendarContext<D> {\n /** The active date adapter. */\n readonly adapter: DateAdapter<D>;\n /** Resolved writing direction (`'ltr'` / `'rtl'`); flips horizontal arrows. */\n readonly dir: Signal<WritingDirection>;\n /** Whether the whole calendar is disabled (no focus, no selection). */\n readonly disabled: Signal<boolean>;\n /** Whether the calendar is read-only (focusable, but selection is blocked). */\n readonly readonly: Signal<boolean>;\n\n /** Stable id of the heading element, used for the grid's `aria-labelledby`. */\n readonly headingId: Signal<string>;\n /** The visible month's accessible label, e.g. `\"June 2026\"`. */\n readonly visibleMonthLabel: Signal<string>;\n /** Weekday column headers for the visible month. */\n readonly weekDays: Signal<readonly CalendarWeekday[]>;\n /** Week rows of the visible month, including outside-month padding days. */\n readonly weeks: Signal<readonly CalendarWeek<D>[]>;\n\n /** Whether the previous-month button should be disabled (bounded by `min`). */\n readonly isPreviousMonthDisabled: Signal<boolean>;\n /** Whether the next-month button should be disabled (bounded by `max`). */\n readonly isNextMonthDisabled: Signal<boolean>;\n\n /** The visible month's full year (e.g. `2026`). */\n readonly visibleYear: Signal<number>;\n /** The visible month, **1-12**. */\n readonly visibleMonthNumber: Signal<number>;\n /** Twelve localized, bounds-aware month options for the visible year. */\n readonly monthOptions: Signal<readonly CalendarMonthOption[]>;\n\n /** Set the visible month to (`year`, `month`) without selecting. `month` is **1-12**. */\n goTo(year: number, month: number): void;\n /** Set the visible month within the current visible year. `month` is **1-12**. */\n goToMonth(month: number): void;\n /** Set the visible year, keeping the current visible month. */\n goToYear(year: number): void;\n /** Whether every day of `month` (**1-12**) in the visible year is out of `[min, max]`. */\n isMonthDisabled(month: number): boolean;\n /** Whether every day of `year` is out of `[min, max]`. */\n isYearDisabled(year: number): boolean;\n\n /** Active calendar view; `'day'` (default), `'month'`, or `'year'`. */\n readonly view: Signal<CalendarView>;\n /** Number of years the year picker shows as an aligned block. Default `12`. */\n readonly yearBlockSize: Signal<number>;\n /** Rows of the month picker grid (3 columns) for the visible year. */\n readonly monthRows: Signal<readonly CalendarMonthRow[]>;\n /** Rows of the year picker grid (3 columns) for the aligned block containing the visible year. */\n readonly yearRows: Signal<readonly CalendarYearRow[]>;\n /**\n * Label of the period the active view shows, on the view trigger and the\n * heading: the month and year in day view, the year in month view, the block\n * of years in year view.\n */\n readonly viewTriggerLabel: Signal<string>;\n /** Whether the prev button should be disabled for the active view. */\n readonly isPreviousDisabled: Signal<boolean>;\n /** Whether the next button should be disabled for the active view. */\n readonly isNextDisabled: Signal<boolean>;\n\n /** Cycle the view one step coarser: `day → month → year`, clamped at `'year'`. */\n cycleView(): void;\n /**\n * Drill into a month (1-12): navigate to it and switch to day view, read-only\n * included. No-op when disabled or out of bounds.\n */\n selectMonth(month: number): void;\n /**\n * Drill into a year: navigate to it and switch to month view, read-only\n * included. No-op when disabled or out of bounds.\n */\n selectYear(year: number): void;\n /** Page backward by one month / year / block depending on the active view. */\n pagePrevious(): void;\n /** Page forward by one month / year / block depending on the active view. */\n pageNext(): void;\n\n /** Whether `month` (1-12) in the visible year is the selected date's month. */\n isMonthSelected(month: number): boolean;\n /** Whether `month` (1-12) is today's month in the visible year. */\n isMonthToday(month: number): boolean;\n /** Whether `month` (1-12) is the roving-tabindex focused month. */\n isMonthFocused(month: number): boolean;\n\n /** Whether `year` is the selected date's year. */\n isYearSelected(year: number): boolean;\n /** Whether `year` is today's year. */\n isYearToday(year: number): boolean;\n /** Whether `year` is the roving-tabindex focused year. */\n isYearFocused(year: number): boolean;\n\n /** Handle a keydown originating on a month cell. */\n handleMonthCellKeydown(event: KeyboardEvent, month: number): void;\n /** Handle a keydown originating on a year cell. */\n handleYearCellKeydown(event: KeyboardEvent, year: number): void;\n\n registerMonthCell(handle: ForCalendarMonthCellHandle): void;\n unregisterMonthCell(handle: ForCalendarMonthCellHandle): void;\n registerYearCell(handle: ForCalendarYearCellHandle): void;\n unregisterYearCell(handle: ForCalendarYearCellHandle): void;\n\n /** Whether `date` is the currently selected value. */\n isSelected(date: D): boolean;\n /** Whether `date` is today. */\n isToday(date: D): boolean;\n /** Whether `date` is the roving-tabindex focused day. */\n isFocused(date: D): boolean;\n /** Whether `date` falls outside the visible month. */\n isOutsideMonth(date: D): boolean;\n /** Whether `date` cannot be selected (`disabled`, out of `min`/`max`, or unavailable). */\n isUnavailable(date: D): boolean;\n /** The full accessible date string for `date`'s gridcell (`aria-label`). */\n getDateLabel(date: D): string;\n\n /**\n * The active selection mode. `'single'` (default) keeps the existing\n * single-date behaviour; `'range'` enables the two-click anchor → commit flow.\n */\n readonly selectionMode: Signal<'single' | 'range'>;\n\n /**\n * Whether `date` is the start of the effective range (committed when idle,\n * preview when a selection is in progress).\n */\n isRangeStart(date: D): boolean;\n\n /**\n * Whether `date` is the end of the effective range (committed when idle,\n * preview when a selection is in progress).\n */\n isRangeEnd(date: D): boolean;\n\n /**\n * Whether `date` falls within the **committed** range, inclusive (idle state\n * only; mutually exclusive with `isRangePreview`).\n */\n isInRange(date: D): boolean;\n\n /**\n * Whether `date` falls within the **preview** band, inclusive (selecting\n * state only; mutually exclusive with `isInRange`).\n */\n isRangePreview(date: D): boolean;\n\n /**\n * Update the pointer-hovered date for the range preview. Ignored in\n * `selectionMode='single'`. Pass `null` on `pointerleave`.\n */\n setHovered(date: D | null): void;\n\n /** Select `date`, unless the calendar is disabled / read-only or the date is unavailable. */\n selectDate(date: D): void;\n /** Page the visible month by `delta` (signed month count). Keeps DOM focus on the caller. */\n pageMonths(delta: number): void;\n /** Resolve and apply a keydown originating on the cell for `fromDate`. */\n handleCellKeydown(event: KeyboardEvent, fromDate: D): void;\n /**\n * Move DOM focus to the roving cell (the gridcell matching the focused date).\n * Returns `false` when no matching cell is currently rendered.\n */\n focusActiveCell(): boolean;\n\n registerCell(handle: ForCalendarCellHandle<D>): void;\n unregisterCell(handle: ForCalendarCellHandle<D>): void;\n /** Adopts a consumer-set static `id` on the heading host into `headingId`. */\n adoptHeadingId(el: HTMLElement): void;\n}\n\n/**\n * The calls only the calendar's own pieces make on the root.\n *\n * @typeParam D The adapter's date type.\n */\nexport interface CalendarPieceContext<D> {\n /**\n * Reported by `[forCalendarCell]` on click. Selects `date`, or, when the\n * selection is refused (read-only, unavailable, a rejected range length),\n * still moves the focused date there so the clicked cell owns the tab stop.\n * A no-op while the calendar is disabled.\n */\n activateDate(date: D): void;\n}\n\n/**\n * The type the calendar's pieces read {@link FOR_CALENDAR_CONTEXT} at: the\n * {@link ForCalendarContext} read surface plus the {@link CalendarPieceContext}\n * calls.\n *\n * Never exported from `public-api.ts`. `ForCalendar` declares those members\n * TS-`private`, which keeps them out of the emitted `.d.ts` while\n * `useExisting` still satisfies this contract at runtime.\n *\n * @typeParam D The adapter's date type.\n */\nexport interface CalendarContext<D> extends ForCalendarContext<D>, CalendarPieceContext<D> {}\n\n/**\n * Injection token for {@link ForCalendarContext}, provided by `ForCalendar`.\n *\n * Publicly typed as the read surface, which is the whole of what the token\n * promises a consumer. The pieces read the same token at an internal type that\n * adds their own calls, so a wrapper re-providing it must alias it to the root:\n * `{ provide: FOR_CALENDAR_CONTEXT, useExisting: MyCalendar }`, where\n * `MyCalendar` extends `ForCalendar`. A value that merely satisfies the\n * declared type resolves too, and is rejected in dev mode by the first piece to\n * resolve it.\n */\nexport const FOR_CALENDAR_CONTEXT = new InjectionToken<ForCalendarContext<unknown>>(\n 'FOR_CALENDAR_CONTEXT',\n);\n\n/**\n * Injects the nearest calendar context, throwing a descriptive error when used\n * outside a `[forCalendar]` element.\n *\n * @param piece Name of the calling directive, used in the error message.\n */\nexport function injectCalendarContext(piece: string): CalendarContext<unknown> {\n const ctx = inject(FOR_CALENDAR_CONTEXT, { optional: true });\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-CALENDAR-001',\n piece,\n root: '[forCalendar]',\n token: 'FOR_CALENDAR_CONTEXT',\n });\n }\n const widened = ctx as CalendarContext<unknown>;\n assertRootContext({\n entryPoint: 'calendar',\n token: 'FOR_CALENDAR_CONTEXT',\n root: '[forCalendar]',\n piece,\n probe: () => widened.activateDate,\n });\n return widened;\n}\n","import { type DateAdapter } from 'forty-cdk/date-adapter';\n\n/**\n * Builds the day grid for the month containing `monthAnchor`.\n *\n * Returns rows of 7 dates each, starting at `firstDayOfWeek`. Leading and\n * trailing days from the adjacent months are included so every row is full;\n * callers mark them with `data-outside-month`. The number of rows is the\n * minimum needed to cover the month (4-6), so there is no empty trailing week.\n *\n * Pure and adapter-driven: the same `(adapter, anchor, firstDayOfWeek)` always\n * yields the same matrix, and two adapters over the same calendar system\n * produce day-identical grids.\n *\n * @param adapter The date adapter to compute with.\n * @param monthAnchor Any date within the target month.\n * @param firstDayOfWeek First column's day of week, **0-6** (`0` = Sunday).\n */\nexport function buildMonthMatrix<D>(\n adapter: DateAdapter<D>,\n monthAnchor: D,\n firstDayOfWeek: number,\n): D[][] {\n const firstOfMonth = adapter.createDate(\n adapter.getYear(monthAnchor),\n adapter.getMonth(monthAnchor),\n 1,\n );\n const daysInMonth = adapter.getDaysInMonth(firstOfMonth);\n const leading = (adapter.getDayOfWeek(firstOfMonth) - firstDayOfWeek + 7) % 7;\n const numWeeks = Math.ceil((leading + daysInMonth) / 7);\n const gridStart = adapter.addDays(firstOfMonth, -leading);\n\n const weeks: D[][] = [];\n for (let week = 0; week < numWeeks; week++) {\n const row: D[] = [];\n for (let day = 0; day < 7; day++) {\n row.push(adapter.addDays(gridStart, week * 7 + day));\n }\n weeks.push(row);\n }\n return weeks;\n}\n","/**\n * The directional intents a calendar grid keyboard move can express. Each\n * sub-grid (day / month / year) maps these onto its own coordinate space —\n * dates for the day grid, a linear month index for the month grid, a year\n * number for the year grid — so the arrow / `Home` / `End` / `PageUp` /\n * `PageDown` dispatch lives in one place instead of three near-identical\n * `switch` statements.\n */\nexport interface CalendarGridMoves<T> {\n /** Move one column horizontally (signed: `-1` left, `1` right) before RTL mirroring. */\n horizontal(step: -1 | 1): T;\n /** Move one row vertically (signed: `-1` up, `1` down). */\n vertical(step: -1 | 1): T;\n /** Move to the first cell of the current line (`Home`). */\n lineStart(): T;\n /** Move to the last cell of the current line (`End`). */\n lineEnd(): T;\n /** Page backward (`PageUp`); `shiftKey` distinguishes the coarser step where it applies. */\n pageBackward(shiftKey: boolean): T;\n /** Page forward (`PageDown`); `shiftKey` distinguishes the coarser step where it applies. */\n pageForward(shiftKey: boolean): T;\n}\n\n/**\n * Resolve a calendar grid keydown into the target the move lands on, or `null`\n * when the key is not a navigation key. `rtl` mirrors the horizontal arrows.\n * Shared by all three sub-grids via their {@link CalendarGridMoves} mapping.\n */\nexport function resolveCalendarGridMove<T>(\n event: KeyboardEvent,\n rtl: boolean,\n moves: CalendarGridMoves<T>,\n): T | null {\n switch (event.key) {\n case 'ArrowLeft':\n return moves.horizontal(rtl ? 1 : -1);\n case 'ArrowRight':\n return moves.horizontal(rtl ? -1 : 1);\n case 'ArrowUp':\n return moves.vertical(-1);\n case 'ArrowDown':\n return moves.vertical(1);\n case 'Home':\n return moves.lineStart();\n case 'End':\n return moves.lineEnd();\n case 'PageUp':\n return moves.pageBackward(event.shiftKey);\n case 'PageDown':\n return moves.pageForward(event.shiftKey);\n default:\n return null;\n }\n}\n\n/**\n * The first and last value of the row holding `position`, in a grid laying the\n * consecutive values `first` to `last` out `columns` per row. A short last row\n * ends at `last`. Feeds the month and year grids' `Home` / `End`.\n */\nexport function calendarGridRowBounds(\n position: number,\n first: number,\n last: number,\n columns: number,\n): { start: number; end: number } {\n const start = position - ((position - first) % columns);\n return { start, end: Math.min(start + columns - 1, last) };\n}\n\n/** Whether a keydown is the activation key (`Enter` / `Space`) every sub-grid selects on. */\nexport function isCalendarActivationKey(event: KeyboardEvent): boolean {\n return event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar';\n}\n","import { computed } from '@angular/core';\n\nimport { Collection, isUnset } from 'forty-cdk/core';\nimport { type DateAdapter } from 'forty-cdk/date-adapter';\nimport { buildMonthMatrix } from './build-month-matrix';\nimport type { CalendarWeek, CalendarWeekday, ForCalendarCellHandle } from './calendar-context';\nimport { isCalendarActivationKey, resolveCalendarGridMove } from './calendar-keyboard';\nimport type { CalendarViewStrategy } from './calendar-sub-grid';\n\n/**\n * The day grid view's state machine (`view=\"day\"`): the 7-column date table.\n * Owns its cell registry, the rendered `weekDays` / `weeks` data, its\n * table-driven keyboard mover (the date-math counterpart to the month / year\n * movers), the start-of-week helper, and the per-view label / disabled / paging\n * / focus the root composes as a {@link CalendarViewStrategy}.\n *\n * Constructed directly by the root (`new CalendarDayNavigator(host)`); it\n * injects nothing of its own, mirroring how `SegmentEditor` is lifted out of the\n * date / time fields, but its cell `Collection` takes the ambient `DestroyRef`,\n * so the root builds it from a field initializer. The intended-day, clamp, and\n * announce machinery stays a single source of truth on the root, reached\n * through {@link CalendarDayNavigatorHost}.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class CalendarDayNavigator<D> implements CalendarViewStrategy {\n readonly #host: CalendarDayNavigatorHost<D>;\n readonly #cells = new Collection<ForCalendarCellHandle<D>>();\n\n readonly #matrix = computed(() =>\n buildMonthMatrix(this.#host.adapter, this.#host.visibleMonth(), this.#host.firstDayOfWeek()),\n );\n\n /** Weekday column headers for the visible month, starting at `firstDayOfWeek`. */\n readonly weekDays = computed<readonly CalendarWeekday[]>(() => {\n const adapter = this.#host.adapter;\n const firstDay = this.#host.firstDayOfWeek();\n const locale = this.#host.locale() ?? undefined;\n return this.#matrix()[0]!.map((date, index) => ({\n key: String((firstDay + index) % 7),\n narrow: adapter.format(date, { weekday: 'narrow' }, locale),\n short: adapter.format(date, { weekday: 'short' }, locale),\n long: adapter.format(date, { weekday: 'long' }, locale),\n }));\n });\n\n /** Week rows of the visible month, including outside-month padding days. */\n readonly weeks = computed<readonly CalendarWeek<D>[]>(() => {\n const adapter = this.#host.adapter;\n return this.#matrix().map((row) => ({\n key: this.#dateKey(row[0]!),\n days: row.map((date) => ({\n key: this.#dateKey(date),\n date,\n label: String(adapter.getDate(date)),\n dateLabel: this.#host.getDateLabel(date),\n })),\n }));\n });\n\n constructor(host: CalendarDayNavigatorHost<D>) {\n this.#host = host;\n }\n\n triggerLabel(): string {\n return this.#host.visibleMonthLabel();\n }\n\n isPreviousDisabled(): boolean {\n return this.#host.isPreviousMonthDisabled();\n }\n\n isNextDisabled(): boolean {\n return this.#host.isNextMonthDisabled();\n }\n\n page(direction: -1 | 1): void {\n this.#host.pageMonths(direction);\n }\n\n focusActive(): boolean {\n return this.focusCell(this.#host.focusedDate());\n }\n\n handleKeydown(event: KeyboardEvent, fromDate: D): void {\n if (isCalendarActivationKey(event)) {\n event.preventDefault();\n this.#host.selectDate(fromDate);\n return;\n }\n const target = this.#resolveMove(event, fromDate);\n if (target === null) {\n return;\n }\n event.preventDefault();\n const isPaging = event.key === 'PageUp' || event.key === 'PageDown';\n this.#host.applyDayKeyMove(target, isPaging);\n }\n\n register(handle: ForCalendarCellHandle<D>): void {\n this.#cells.register(handle);\n }\n\n unregister(handle: ForCalendarCellHandle<D>): void {\n this.#cells.unregister(handle);\n }\n\n focusCell(target: D): boolean {\n const adapter = this.#host.adapter;\n const handle = this.#cells.items().find((cell) => {\n const date = cell.date();\n return !isUnset(date) && adapter.isSameDay(date, target);\n });\n if (!handle) {\n return false;\n }\n handle.host.focus();\n return true;\n }\n\n #resolveMove(event: KeyboardEvent, fromDate: D): D | null {\n const adapter = this.#host.adapter;\n return resolveCalendarGridMove<D>(event, this.#host.dir() === 'rtl', {\n horizontal: (step) => adapter.addDays(fromDate, step),\n vertical: (step) => adapter.addDays(fromDate, step * 7),\n lineStart: () => this.#startOfWeek(fromDate),\n lineEnd: () => adapter.addDays(this.#startOfWeek(fromDate), 6),\n pageBackward: (shiftKey) =>\n shiftKey ? adapter.addYears(fromDate, -1) : adapter.addMonths(fromDate, -1),\n pageForward: (shiftKey) =>\n shiftKey ? adapter.addYears(fromDate, 1) : adapter.addMonths(fromDate, 1),\n });\n }\n\n #startOfWeek(date: D): D {\n const adapter = this.#host.adapter;\n const offset = (adapter.getDayOfWeek(date) - this.#host.firstDayOfWeek() + 7) % 7;\n return adapter.addDays(date, -offset);\n }\n\n #dateKey(date: D): string {\n const adapter = this.#host.adapter;\n return `${adapter.getYear(date)}-${adapter.getMonth(date)}-${adapter.getDate(date)}`;\n }\n}\n\n/**\n * Root surface the {@link CalendarDayNavigator} reads / delegates to: the\n * adapter, direction, visible-month label / bounds, the resolved first day of\n * week, and the navigation primitives (`selectDate`, `pageMonths`, the combined\n * key-move applier) the day grid hands back to the root so the intended-day /\n * clamp / announce logic stays in one place.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport interface CalendarDayNavigatorHost<D> {\n /** The active date adapter. */\n readonly adapter: DateAdapter<D>;\n /** Resolved writing direction; `'rtl'` mirrors the horizontal arrows. */\n readonly dir: () => 'ltr' | 'rtl';\n /** The formatting locale (`null` = runtime default), forwarded to `adapter.format`. */\n readonly locale: () => string | null;\n /** The roving focused date (the day grid's tab stop). */\n readonly focusedDate: () => D;\n /** First day of the visible month, driving the rendered matrix. */\n readonly visibleMonth: () => D;\n /** The visible month's accessible label, e.g. `\"June 2026\"`. */\n readonly visibleMonthLabel: () => string;\n /** Resolved first day of the week (**0-6**). */\n readonly firstDayOfWeek: () => number;\n /** Whether the previous-month button should be disabled. */\n readonly isPreviousMonthDisabled: () => boolean;\n /** Whether the next-month button should be disabled. */\n readonly isNextMonthDisabled: () => boolean;\n /** The full accessible date string for `date`'s gridcell (`aria-label`). */\n getDateLabel(date: D): string;\n /** Select `date`, unless disabled / read-only / unavailable. */\n selectDate(date: D): void;\n /** Page the visible month by `delta`, keeping DOM focus on the caller. */\n pageMonths(delta: number): void;\n /**\n * Apply a resolved day keyboard move: a paging move re-applies the intended\n * day and clamps; a plain move records the new focus origin. Both move focus\n * and announce a month change.\n */\n applyDayKeyMove(target: D, isPaging: boolean): void;\n}\n","import { Collection } from 'forty-cdk/core';\nimport type {\n CalendarMonthOption,\n CalendarMonthRow,\n ForCalendarMonthCellHandle,\n} from './calendar-context';\nimport {\n calendarGridRowBounds,\n isCalendarActivationKey,\n resolveCalendarGridMove,\n} from './calendar-keyboard';\nimport type { CalendarSubGridHost, CalendarViewStrategy } from './calendar-sub-grid';\n\nconst GRID_COLUMNS = 3;\n\n/**\n * The month picker view's state machine (`view=\"month\"`): a 3-column grid of the\n * twelve months of the visible year. Owns its cell registry, its `is*` quartet\n * (selected / today / focused / disabled), its table-driven keyboard mover, and\n * the per-view paging / focus the root composes as a {@link CalendarViewStrategy}.\n *\n * Constructed directly by the root (`new CalendarMonthNavigator(host)`); it\n * injects nothing of its own, mirroring how `SegmentEditor` is lifted out of the\n * date / time fields, but its cell `Collection` takes the ambient `DestroyRef`,\n * so the root builds it from a field initializer.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class CalendarMonthNavigator<D> implements CalendarViewStrategy {\n readonly #host: CalendarMonthNavigatorHost<D>;\n readonly #cells = new Collection<ForCalendarMonthCellHandle>();\n\n constructor(host: CalendarMonthNavigatorHost<D>) {\n this.#host = host;\n }\n\n /** Twelve localized, bounds-aware month options for the visible year. */\n options(): readonly CalendarMonthOption[] {\n const adapter = this.#host.adapter;\n const year = this.#host.visibleYear();\n const locale = this.#host.locale() ?? undefined;\n const options: CalendarMonthOption[] = [];\n for (let month = 1; month <= 12; month++) {\n options.push({\n value: month,\n label: adapter.format(adapter.createDate(year, month, 1), { month: 'long' }, locale),\n disabled: this.#host.isMonthOutOfBounds(year, month),\n });\n }\n return options;\n }\n\n /** Rows of the month picker grid (3 columns) for the visible year. */\n rows(): readonly CalendarMonthRow[] {\n const options = this.options();\n const rows: CalendarMonthRow[] = [];\n for (let i = 0; i < options.length; i += GRID_COLUMNS) {\n rows.push({ key: `m-${i}`, months: options.slice(i, i + GRID_COLUMNS) });\n }\n return rows;\n }\n\n triggerLabel(): string {\n return String(this.#host.visibleYear());\n }\n\n isPreviousDisabled(): boolean {\n return this.#host.isYearDisabled(this.#host.visibleYear() - 1);\n }\n\n isNextDisabled(): boolean {\n return this.#host.isYearDisabled(this.#host.visibleYear() + 1);\n }\n\n page(direction: -1 | 1): void {\n this.#host.pageByYears(direction);\n }\n\n focusActive(): boolean {\n return this.focusCell(this.#host.visibleMonthNumber());\n }\n\n isSelected(month: number): boolean {\n const adapter = this.#host.adapter;\n const value = this.#host.value();\n return (\n value !== null &&\n adapter.getYear(value) === this.#host.visibleYear() &&\n adapter.getMonth(value) === month\n );\n }\n\n isToday(month: number): boolean {\n const adapter = this.#host.adapter;\n const today = this.#host.today();\n return adapter.getYear(today) === this.#host.visibleYear() && adapter.getMonth(today) === month;\n }\n\n isFocused(month: number): boolean {\n return month === this.#host.visibleMonthNumber();\n }\n\n handleKeydown(event: KeyboardEvent, fromMonth: number): void {\n if (isCalendarActivationKey(event)) {\n event.preventDefault();\n this.#host.selectMonth(fromMonth);\n return;\n }\n const target = this.#resolveMove(event, fromMonth);\n if (target === null) {\n return;\n }\n event.preventDefault();\n this.#host.moveFocusedDate(this.#host.dateInMonth(target.year, target.month));\n this.#host.scheduleFocus(() => this.focusCell(this.#host.visibleMonthNumber()));\n }\n\n register(handle: ForCalendarMonthCellHandle): void {\n this.#cells.register(handle);\n }\n\n unregister(handle: ForCalendarMonthCellHandle): void {\n this.#cells.unregister(handle);\n }\n\n focusCell(month: number): boolean {\n const handle = this.#cells.items().find((cell) => cell.month() === month);\n if (!handle) {\n return false;\n }\n handle.host.focus();\n return true;\n }\n\n #resolveMove(event: KeyboardEvent, fromMonth: number): { year: number; month: number } | null {\n const year = this.#host.visibleYear();\n const base = year * 12 + (fromMonth - 1);\n const row = calendarGridRowBounds(base, year * 12, year * 12 + 11, GRID_COLUMNS);\n const index = resolveCalendarGridMove<number>(event, this.#host.dir() === 'rtl', {\n horizontal: (step) => base + step,\n vertical: (step) => base + step * GRID_COLUMNS,\n lineStart: () => row.start,\n lineEnd: () => row.end,\n pageBackward: () => base - 12,\n pageForward: () => base + 12,\n });\n if (index === null) {\n return null;\n }\n return { year: Math.floor(index / 12), month: (index % 12) + 1 };\n }\n}\n\n/**\n * Root surface the {@link CalendarMonthNavigator} reads / delegates to beyond\n * {@link CalendarSubGridHost}: the selected value plus the navigation and focus\n * primitives the grid hands back to the root.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport interface CalendarMonthNavigatorHost<D> extends CalendarSubGridHost<D> {\n /** The selected value, or `null`. */\n readonly value: () => D | null;\n /** Whether every day of `month` (**1-12**) in `year` falls outside `[min, max]`. */\n isMonthOutOfBounds(year: number, month: number): boolean;\n /** Drill into a month (1-12): navigate to it and switch to day view. */\n selectMonth(month: number): void;\n /** Page the visible year by `step`, re-applying the intended day and clamping. */\n pageByYears(step: number): void;\n /**\n * Move the roving focused date to `date`, clamped into `[min, max]`, announcing\n * the new period when the active view's period changes.\n */\n moveFocusedDate(date: D): void;\n /** A date in (`year`, `month`) keeping the focused day clamped to the month length. */\n dateInMonth(year: number, month: number): D;\n /** Schedule `fn` to run after the next render (for post-re-render focus moves). */\n scheduleFocus(fn: () => void): void;\n}\n","import { type DateAdapter } from 'forty-cdk/date-adapter';\n\n/**\n * Tracks the day-of-month the user is conceptually navigating with so paging\n * across months restores the original day when landing on a longer month,\n * instead of cumulatively drifting back through a chain of short months.\n *\n * It also records the focused date each paging operation produced, letting the\n * root detect a focus that moved for any other reason (explicit day move,\n * selection, an external `value` write driving the `focusedDate` linkedSignal)\n * and reset the intended day to the new day — all without an `effect`.\n *\n * Constructed directly (`new IntendedDayCursor(adapter, seed)`); it holds no\n * injection context, mirroring how `SegmentEditor` is lifted out of the date /\n * time fields.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class IntendedDayCursor<D> {\n readonly #adapter: DateAdapter<D>;\n #intendedDay: number;\n #pagedFocus: D | null = null;\n\n constructor(adapter: DateAdapter<D>, seed: D) {\n this.#adapter = adapter;\n this.#intendedDay = adapter.getDate(seed);\n }\n\n /** Record `date` as the focus origin for a non-paging move and reset the intended day. */\n setFocusedDay(date: D): void {\n this.#intendedDay = this.#adapter.getDate(date);\n this.#pagedFocus = null;\n }\n\n /**\n * Re-sync the intended day to `focused`'s actual day unless the focus is still\n * where the last paging operation left it. Anything that moved the focus for\n * another reason resets the intended day so a fresh paging run starts from the\n * day the user can see.\n */\n sync(focused: D): void {\n if (this.#pagedFocus === null || !this.#adapter.isSameDay(this.#pagedFocus, focused)) {\n this.#intendedDay = this.#adapter.getDate(focused);\n }\n }\n\n /**\n * Re-derive `date` so its day-of-month matches the user's intended day,\n * clamped to the target month's length. Restores e.g. the 31st when a paging\n * chain lands back on a 31-day month, instead of carrying forward the day a\n * shorter intermediate month clamped it to.\n */\n apply(date: D): D {\n const adapter = this.#adapter;\n const daysInMonth = adapter.getDaysInMonth(date);\n const day = this.#intendedDay < daysInMonth ? this.#intendedDay : daysInMonth;\n return adapter.createDate(adapter.getYear(date), adapter.getMonth(date), day);\n }\n\n /** Mark `date` as the focused date the last paging operation produced. */\n markPaged(date: D): void {\n this.#pagedFocus = date;\n }\n}\n","import type { Signal, WritableSignal } from '@angular/core';\n\nimport { type DateAdapter } from 'forty-cdk/date-adapter';\nimport type { CalendarBounds } from './calendar-bounds';\nimport type { CalendarRangeSelection } from './calendar-range-selection';\nimport { IntendedDayCursor } from './intended-day-cursor';\n\n/**\n * The reactive root surface the {@link CalendarNavigation} engine reads from and\n * writes back into. The engine owns the focus-origin cursor and every move that\n * re-derives the focused date (selection, paging, direct go-to, keyboard moves);\n * the host supplies the writable focused date / value, the visible-month\n * derivations, the shared bounds / range collaborators, and the imperative\n * effects (announce, schedule a post-render focus move, move DOM focus to a day\n * cell).\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport interface CalendarNavigationHost<D> {\n /** The active date adapter. */\n readonly adapter: DateAdapter<D>;\n /** Whether the whole calendar is disabled. */\n readonly disabled: Signal<boolean>;\n /** Whether the calendar is read-only. */\n readonly readonly: Signal<boolean>;\n /** Whether range selection is active. */\n readonly selectionMode: Signal<'single' | 'range'>;\n /** The roving focused date (read + written). */\n readonly focusedDate: WritableSignal<D>;\n /** The selected value (read + written in single mode). */\n readonly value: WritableSignal<D | null>;\n /**\n * The label of the period the active view shows: the month and year in day\n * view, the year in month view, the block of years in year view.\n */\n readonly periodLabel: () => string;\n /** The visible month's full year. */\n readonly visibleYear: () => number;\n /** The visible month, **1-12**. */\n readonly visibleMonthNumber: () => number;\n /** The `[min, max]` bounds collaborator. */\n readonly bounds: CalendarBounds<D>;\n /** The range-selection collaborator. */\n readonly range: CalendarRangeSelection<D>;\n /** Announce `label` politely (used when a navigation changes the active view's period). */\n announce(label: string): void;\n /** Schedule `fn` to run after the next render. */\n scheduleFocus(fn: () => void): void;\n /** Move DOM focus to the day cell matching `target`, after the next render. */\n focusDayCell(target: D): void;\n}\n\n/**\n * The shared navigation / selection engine for `ForCalendar`: it owns the\n * {@link IntendedDayCursor} and every focused-date move — single / range\n * selection, month / year paging, direct `goTo`, and the resolved day keyboard\n * move — keeping the intended-day, clamp, and announce machinery in one place\n * instead of scattered across the root and the sub-grids. Every move of the\n * focused date also drops a pointer hover from the range preview cursor, so the\n * preview follows the device that moved last.\n *\n * Constructed directly (`new CalendarNavigation(host, seed)`); it holds no\n * injection context, mirroring how `SegmentEditor` is lifted out of the date /\n * time fields.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class CalendarNavigation<D> {\n readonly #host: CalendarNavigationHost<D>;\n readonly #cursor: IntendedDayCursor<D>;\n\n constructor(host: CalendarNavigationHost<D>, seed: D) {\n this.#host = host;\n this.#cursor = new IntendedDayCursor<D>(host.adapter, seed);\n }\n\n /** Select `date`, unless the calendar is disabled / read-only or the date is unavailable. */\n selectDate(date: D): void {\n this.#select(date);\n }\n\n /**\n * Apply a pointer activation of the day cell for `date`: select it, or, when\n * the selection is refused, still move the focused date there so the clicked\n * cell owns the tab stop. A no-op while the calendar is disabled.\n */\n activateDate(date: D): void {\n if (this.#host.disabled() || this.#select(date)) {\n return;\n }\n this.#cursor.setFocusedDay(date);\n this.#setFocusedDate(date);\n this.#host.focusDayCell(date);\n }\n\n /** Page the visible month by `delta` (signed month count). Keeps DOM focus on the caller. */\n pageMonths(delta: number): void {\n if (this.#host.disabled()) {\n return;\n }\n this.#pageTo(this.#host.adapter.addMonths(this.#host.focusedDate(), delta));\n }\n\n /**\n * Page the visible year by `step` (signed) — the shared month / year-view\n * paging path. Reached only from the disabled-guarded `pagePrevious` /\n * `pageNext`, so it carries no guard of its own. Keeps DOM focus on the caller.\n */\n pageByYears(step: number): void {\n this.#pageTo(this.#host.adapter.addYears(this.#host.focusedDate(), step));\n }\n\n /**\n * Set the visible month to (`year`, `month`, **1-12**) without selecting,\n * re-applying the intended day, clamping, and announcing a change of the\n * active view's period. A no-op while disabled.\n */\n goTo(year: number, month: number): void {\n if (this.#host.disabled()) {\n return;\n }\n this.#pageTo(this.#host.adapter.createDate(year, month, 1));\n }\n\n /** Apply a resolved day keyboard move: paging re-applies the intended day; a plain move records the origin. */\n applyDayKeyMove(target: D, isPaging: boolean): void {\n const previousPeriod = this.#host.periodLabel();\n let next: D;\n if (isPaging) {\n this.#cursor.sync(this.#host.focusedDate());\n next = this.#host.bounds.clamp(this.#cursor.apply(target));\n this.#cursor.markPaged(next);\n } else {\n next = this.#host.bounds.clamp(target);\n this.#cursor.setFocusedDay(next);\n }\n this.#setFocusedDate(next);\n this.#host.focusDayCell(next);\n this.#announcePeriodChange(previousPeriod);\n }\n\n /**\n * Apply a resolved month / year grid keyboard move: clamp `target` into\n * bounds, make it the focused date, and announce a change of the active\n * view's period.\n */\n moveFocusedDate(target: D): void {\n const previousPeriod = this.#host.periodLabel();\n this.#setFocusedDate(this.#host.bounds.clamp(target));\n this.#announcePeriodChange(previousPeriod);\n }\n\n /** A date in (`year`, `month`) keeping the focused day clamped to the month length. */\n dateInMonth(year: number, month: number): D {\n const adapter = this.#host.adapter;\n const daysInMonth = adapter.getDaysInMonth(adapter.createDate(year, month, 1));\n const day = Math.min(adapter.getDate(this.#host.focusedDate()), daysInMonth);\n return adapter.createDate(year, month, day);\n }\n\n #select(date: D): boolean {\n if (this.#host.disabled() || this.#host.readonly() || this.#host.bounds.isUnavailable(date)) {\n return false;\n }\n if (this.#host.selectionMode() === 'range') {\n if (!this.#host.range.select(date)) {\n return false;\n }\n this.#cursor.setFocusedDay(date);\n this.#setFocusedDate(date);\n this.#host.focusDayCell(date);\n return true;\n }\n this.#cursor.setFocusedDay(date);\n this.#host.value.set(this.#withPreservedTime(date));\n this.#host.focusDayCell(date);\n return true;\n }\n\n #setFocusedDate(next: D): void {\n this.#host.range.clearHover();\n this.#host.focusedDate.set(next);\n }\n\n #pageTo(target: D): void {\n const previousPeriod = this.#host.periodLabel();\n this.#cursor.sync(this.#host.focusedDate());\n const next = this.#host.bounds.clamp(this.#cursor.apply(target));\n this.#setFocusedDate(next);\n this.#cursor.markPaged(next);\n this.#announcePeriodChange(previousPeriod);\n }\n\n #announcePeriodChange(previousPeriod: string): void {\n const period = this.#host.periodLabel();\n if (period !== previousPeriod) {\n this.#host.announce(period);\n }\n }\n\n #withPreservedTime(date: D): D {\n const adapter = this.#host.adapter;\n const current = this.#host.value();\n if (\n current === null ||\n adapter.supportsTime?.() !== true ||\n !adapter.getHours ||\n !adapter.getMinutes ||\n !adapter.getSeconds ||\n !adapter.setTime\n ) {\n return date;\n }\n return adapter.setTime(\n date,\n adapter.getHours(current),\n adapter.getMinutes(current),\n adapter.getSeconds(current),\n );\n }\n}\n","import { computed, signal, type Signal, type WritableSignal } from '@angular/core';\n\nimport { compareDateOf, type DateRange } from 'forty-cdk/core';\nimport { type DateAdapter } from 'forty-cdk/date-adapter';\n\n/**\n * The reactive surface a `ForCalendar` root supplies to its\n * {@link CalendarRangeSelection}. The range machine owns the anchor / hover /\n * effective-range state and the `isRange*` predicates; the host supplies the\n * adapter, the live focused date (the preview cursor when no pointer hover is\n * active), the committed range model, and the configured bounds.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport interface CalendarRangeHost<D> {\n /** The active date adapter. */\n readonly adapter: DateAdapter<D>;\n /** The roving focused date, used as the preview cursor on keyboard navigation. */\n readonly focusedDate: () => D;\n /** The committed range model (read for idle state, written on commit). */\n readonly range: WritableSignal<DateRange<D> | null>;\n /** Whether range selection is active (`selectionMode === 'range'`). */\n readonly active: Signal<boolean>;\n /** Minimum inclusive day count for a committed range, or `null` for no minimum. */\n readonly minRangeLength: Signal<number | null>;\n /** Maximum inclusive day count for a committed range, or `null` for no maximum. */\n readonly maxRangeLength: Signal<number | null>;\n}\n\n/**\n * Owns the two-click anchor → commit range-selection state machine for\n * `ForCalendar` in `selectionMode=\"range\"`: the pending `anchor`, the pointer\n * `hovered` cursor, the derived `effectiveRange` (committed when idle, preview\n * while selecting), and the `isRangeStart` / `isRangeEnd` / `isInRange` /\n * `isRangePreview` predicates the day cells reflect as `data-*`.\n *\n * Constructed directly (`new CalendarRangeSelection(host)`); it holds no\n * injection context, mirroring how `SegmentEditor` is lifted out of the date /\n * time fields. The root keeps the focus orchestration around a click and only\n * delegates the range bookkeeping here.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class CalendarRangeSelection<D> {\n readonly #host: CalendarRangeHost<D>;\n readonly #anchor = signal<D | null>(null);\n readonly #hovered = signal<D | null>(null);\n\n readonly #effectiveRange = computed<{ start: D; end: D; preview: boolean } | null>(() => {\n const adapter = this.#host.adapter;\n const anchor = this.#anchor();\n if (anchor !== null) {\n const cursor = this.#hovered() ?? this.#host.focusedDate();\n const cmp = compareDateOf(adapter, cursor, anchor);\n const [start, end] = cmp < 0 ? [cursor, anchor] : [anchor, cursor];\n return { start, end, preview: true };\n }\n const committed = this.#host.range();\n return committed === null\n ? null\n : { start: committed.start, end: committed.end, preview: false };\n });\n\n constructor(host: CalendarRangeHost<D>) {\n this.#host = host;\n }\n\n isRangeStart(date: D): boolean {\n const er = this.#effectiveRange();\n return er !== null && this.#host.adapter.isSameDay(date, er.start);\n }\n\n isRangeEnd(date: D): boolean {\n const er = this.#effectiveRange();\n return er !== null && this.#host.adapter.isSameDay(date, er.end);\n }\n\n isInRange(date: D): boolean {\n const er = this.#effectiveRange();\n return er !== null && !er.preview && this.#withinInclusive(date, er);\n }\n\n isRangePreview(date: D): boolean {\n const er = this.#effectiveRange();\n return er !== null && er.preview && this.#withinInclusive(date, er);\n }\n\n /** Whether `date` is within the effective range, used by the day cell's `isSelected`. */\n contains(date: D): boolean {\n const er = this.#effectiveRange();\n return er !== null && !er.preview && this.#withinInclusive(date, er);\n }\n\n setHovered(date: D | null): void {\n if (!this.#host.active()) {\n return;\n }\n this.#hovered.set(date);\n }\n\n /** Drop the pointer's claim on the preview cursor, so it follows the focused date again. */\n clearHover(): void {\n this.#hovered.set(null);\n }\n\n /**\n * Apply a click on `date` to the anchor → commit flow. The first click sets\n * the anchor and leaves the committed range untouched until the second click\n * replaces it; the second commits the range in **either direction** — clicking\n * before the anchor commits the inverted band `[date, anchor]` (honouring the\n * hover preview) rather than starting over. Returns `true` when the click moved\n * the selection (so the root should move focus to `date`), `false` when it was\n * rejected by the min / max length guard (anchor preserved, no focus move).\n */\n select(date: D): boolean {\n const adapter = this.#host.adapter;\n const anchor = this.#anchor();\n if (anchor === null) {\n this.#anchor.set(date);\n return true;\n }\n const [start, end] = compareDateOf(adapter, date, anchor) < 0 ? [date, anchor] : [anchor, date];\n if (!this.#rangeLengthSatisfied(start, end)) {\n return false;\n }\n this.#host.range.set({ start, end });\n this.#anchor.set(null);\n return true;\n }\n\n #rangeLengthSatisfied(start: D, end: D): boolean {\n const adapter = this.#host.adapter;\n const minLen = this.#host.minRangeLength();\n const maxLen = this.#host.maxRangeLength();\n if (minLen === null && maxLen === null) {\n return true;\n }\n let len = 1;\n let cursor = start;\n while (compareDateOf(adapter, cursor, end) < 0) {\n cursor = adapter.addDays(cursor, 1);\n len++;\n if (maxLen !== null && len > maxLen) {\n return false;\n }\n }\n if (minLen !== null && len < minLen) {\n return false;\n }\n return true;\n }\n\n #withinInclusive(date: D, range: { start: D; end: D }): boolean {\n const adapter = this.#host.adapter;\n return (\n compareDateOf(adapter, date, range.start) >= 0 && compareDateOf(adapter, date, range.end) <= 0\n );\n }\n}\n","import { Collection } from 'forty-cdk/core';\nimport type {\n CalendarYearOption,\n CalendarYearRow,\n ForCalendarYearCellHandle,\n} from './calendar-context';\nimport {\n calendarGridRowBounds,\n isCalendarActivationKey,\n resolveCalendarGridMove,\n} from './calendar-keyboard';\nimport type { CalendarSubGridHost, CalendarViewStrategy } from './calendar-sub-grid';\n\nconst GRID_COLUMNS = 3;\n\n/**\n * The year picker view's state machine (`view=\"year\"`): a 3-column grid of an\n * aligned block of `yearBlockSize` years. Owns its cell registry, its `is*`\n * quartet (selected / today / focused / disabled), its table-driven keyboard\n * mover, and the per-view paging / focus the root composes as a\n * {@link CalendarViewStrategy}.\n *\n * Constructed directly by the root (`new CalendarYearNavigator(host)`); it\n * injects nothing of its own, mirroring how `SegmentEditor` is lifted out of the\n * date / time fields, but its cell `Collection` takes the ambient `DestroyRef`,\n * so the root builds it from a field initializer.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class CalendarYearNavigator<D> implements CalendarViewStrategy {\n readonly #host: CalendarYearNavigatorHost<D>;\n readonly #cells = new Collection<ForCalendarYearCellHandle>();\n\n constructor(host: CalendarYearNavigatorHost<D>) {\n this.#host = host;\n }\n\n /** Rows of the year picker grid (3 columns) for the aligned block containing the visible year. */\n rows(): readonly CalendarYearRow[] {\n const start = this.#host.yearBlockStart();\n const size = this.#host.yearBlockSize();\n const years: CalendarYearOption[] = [];\n for (let i = 0; i < size; i++) {\n const value = start + i;\n years.push({ value, disabled: this.#host.isYearDisabled(value) });\n }\n const rows: CalendarYearRow[] = [];\n for (let i = 0; i < years.length; i += GRID_COLUMNS) {\n rows.push({ key: `y-${i}`, years: years.slice(i, i + GRID_COLUMNS) });\n }\n return rows;\n }\n\n triggerLabel(): string {\n const start = this.#host.yearBlockStart();\n return `${start} – ${start + this.#host.yearBlockSize() - 1}`;\n }\n\n isPreviousDisabled(): boolean {\n return this.#host.isYearDisabled(this.#host.yearBlockStart() - 1);\n }\n\n isNextDisabled(): boolean {\n return this.#host.isYearDisabled(this.#host.yearBlockStart() + this.#host.yearBlockSize());\n }\n\n page(direction: -1 | 1): void {\n this.#host.pageByYears(direction * this.#host.yearBlockSize());\n }\n\n focusActive(): boolean {\n return this.focusCell(this.#host.visibleYear());\n }\n\n isSelected(year: number): boolean {\n const value = this.#host.value();\n return value !== null && this.#host.adapter.getYear(value) === year;\n }\n\n isToday(year: number): boolean {\n return this.#host.adapter.getYear(this.#host.today()) === year;\n }\n\n isFocused(year: number): boolean {\n return year === this.#host.visibleYear();\n }\n\n handleKeydown(event: KeyboardEvent, fromYear: number): void {\n if (isCalendarActivationKey(event)) {\n event.preventDefault();\n this.#host.selectYear(fromYear);\n return;\n }\n const target = this.#resolveMove(event, fromYear);\n if (target === null) {\n return;\n }\n event.preventDefault();\n this.#host.moveFocusedDate(this.#host.dateInMonth(target, this.#host.visibleMonthNumber()));\n this.#host.scheduleFocus(() => this.focusCell(this.#host.visibleYear()));\n }\n\n register(handle: ForCalendarYearCellHandle): void {\n this.#cells.register(handle);\n }\n\n unregister(handle: ForCalendarYearCellHandle): void {\n this.#cells.unregister(handle);\n }\n\n focusCell(year: number): boolean {\n const handle = this.#cells.items().find((cell) => cell.year() === year);\n if (!handle) {\n return false;\n }\n handle.host.focus();\n return true;\n }\n\n #resolveMove(event: KeyboardEvent, fromYear: number): number | null {\n const size = this.#host.yearBlockSize();\n const start = this.#host.yearBlockStart();\n const row = calendarGridRowBounds(fromYear, start, start + size - 1, GRID_COLUMNS);\n return resolveCalendarGridMove<number>(event, this.#host.dir() === 'rtl', {\n horizontal: (step) => fromYear + step,\n vertical: (step) => fromYear + step * GRID_COLUMNS,\n lineStart: () => row.start,\n lineEnd: () => row.end,\n pageBackward: () => fromYear - size,\n pageForward: () => fromYear + size,\n });\n }\n}\n\n/**\n * Root surface the {@link CalendarYearNavigator} reads / delegates to beyond\n * {@link CalendarSubGridHost}: the selected value plus the navigation and focus\n * primitives the grid hands back to the root.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport interface CalendarYearNavigatorHost<D> extends CalendarSubGridHost<D> {\n /** The selected value, or `null`. */\n readonly value: () => D | null;\n /** Drill into a year: navigate to it and switch to month view. */\n selectYear(year: number): void;\n /** Page the visible year by `step`, re-applying the intended day and clamping. */\n pageByYears(step: number): void;\n /**\n * Move the roving focused date to `date`, clamped into `[min, max]`, announcing\n * the new period when the active view's period changes.\n */\n moveFocusedDate(date: D): void;\n /** A date in (`year`, `month`) keeping the focused day clamped to the month length. */\n dateInMonth(year: number, month: number): D;\n /** Schedule `fn` to run after the next render (for post-re-render focus moves). */\n scheduleFocus(fn: () => void): void;\n}\n","import {\n afterNextRender,\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n Injector,\n input,\n linkedSignal,\n model,\n numberAttribute,\n signal,\n type WritableSignal,\n} from '@angular/core';\n\nimport {\n type DateRange,\n injectDateAdapter,\n adoptHostId,\n FOR_PICKER_SOURCE_HOST,\n IdGenerator,\n LiveAnnouncer,\n type WritingDirection,\n injectTextDirection,\n} from 'forty-cdk/core';\nimport { type DateAdapter } from 'forty-cdk/date-adapter';\nimport { CalendarBounds } from './calendar-bounds';\nimport {\n type CalendarDateLabelFormatter,\n type CalendarMonthOption,\n type CalendarMonthRow,\n type CalendarView,\n type CalendarYearRow,\n FOR_CALENDAR_CONTEXT,\n type ForCalendarCellHandle,\n type ForCalendarContext,\n type ForCalendarMonthCellHandle,\n type ForCalendarYearCellHandle,\n} from './calendar-context';\nimport { CalendarDayNavigator } from './calendar-day-navigator';\nimport { FOR_CALENDAR_DEFAULTS } from 'forty-cdk/defaults';\nimport { CalendarMonthNavigator } from './calendar-month-navigator';\nimport { CalendarNavigation } from './calendar-navigation';\nimport { CalendarRangeSelection } from './calendar-range-selection';\nimport type { CalendarSubGridHost, CalendarViewStrategy } from './calendar-sub-grid';\nimport { CalendarYearNavigator } from './calendar-year-navigator';\n\ninterface FocusedDateSource<D> {\n readonly value: D | null;\n readonly range: DateRange<D> | null;\n readonly min: D | null;\n readonly max: D | null;\n}\n\n/**\n * Headless implementation of a single-date calendar grid following the\n * [WAI-ARIA Grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/), the\n * date table at the heart of the APG\n * [Date Picker Dialog](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/)\n * example.\n *\n * `ForCalendar` is the root: it owns the selected value, the focused date, and\n * the visible month, and exposes them to the grid / header / cell / heading /\n * navigation pieces through `FOR_CALENDAR_CONTEXT`. All date math goes through\n * a pluggable {@link DateAdapter} (`provideInternationalizedDateAdapter()` or\n * `provideNativeDateAdapter()`), so the library hard-depends on no date\n * library.\n *\n * The grid uses roving tabindex: exactly one cell (the focused date) carries\n * `tabindex=\"0\"`. Arrow / `Home` / `End` / `PageUp` / `PageDown` /\n * `Shift+PageUp` / `Shift+PageDown` move the focused date, re-paging the grid\n * when crossing a month boundary; `Enter` / `Space` select.\n *\n * The day / month / year views are each backed by a sub-grid collaborator\n * ({@link CalendarDayNavigator} / {@link CalendarMonthNavigator} /\n * {@link CalendarYearNavigator}), and range selection by\n * {@link CalendarRangeSelection}; the root wires them together and exposes the\n * `[(value)]` / `[(view)]` / `[(range)]` models.\n *\n * `ForCalendar` is the grid widget, not a form value — it exposes `[(value)]`\n * as a `model<D | null>` in `selectionMode=\"single\"` (default), and\n * `[(range)]` as a `model<DateRange<D> | null>` in\n * `selectionMode=\"range\"`. The `FormValueControl<D>` contract arrives with the\n * follow-up `ForDatePicker` / `ForDateField`. See the primitive's README for a\n * complete styleless usage example.\n *\n * @typeParam D The adapter's immutable date type.\n */\n@Directive({\n selector: '[forCalendar]',\n exportAs: 'forCalendar',\n host: {\n '[attr.dir]': 'dir()',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-readonly]': 'readonly() ? \"\" : null',\n '[attr.data-view]': 'view()',\n },\n providers: [{ provide: FOR_CALENDAR_CONTEXT, useExisting: ForCalendar }],\n})\nexport class ForCalendar<D> implements ForCalendarContext<D> {\n readonly #defaults = inject(FOR_CALENDAR_DEFAULTS);\n readonly #idGen = inject(IdGenerator);\n readonly #injector = inject(Injector);\n readonly #announcer = inject(LiveAnnouncer);\n readonly #pickerHost = inject(FOR_PICKER_SOURCE_HOST, { optional: true });\n\n /** The active date adapter, resolved from `FOR_DATE_ADAPTER`. */\n readonly adapter: DateAdapter<D> = injectDateAdapter<D>('ForCalendar', { scope: 'calendar' });\n\n /**\n * Two-way bindable selected date, or `null`. The `model()` change emitter\n * (`(valueChange)`) fires only when the calendar itself updates the value\n * (cell activation), never on consumer writes via `[(value)]`.\n */\n readonly value = model<D | null>(null);\n\n /** Minimum selectable date (inclusive). Dates before it are unavailable. */\n readonly min = input<D | null>(null);\n\n /** Maximum selectable date (inclusive). Dates after it are unavailable. */\n readonly max = input<D | null>(null);\n\n /**\n * Per-date predicate marking a date as unavailable (present in the grid but\n * not selectable, reflected as `aria-disabled` / `data-disabled`).\n */\n readonly isDateUnavailable = input<(date: D) => boolean>(() => false);\n\n /**\n * Formats the full accessible date string each gridcell exposes as its\n * `aria-label` (the visible content stays the bare day number). Defaults to\n * the localized full date (e.g. `\"Monday, June 15, 2026\"`), with\n * outside-month padding days passed through the scope's `outsideMonthLabel`\n * (`\"<date> (outside month)\"` unless localized via `provideForCalendarDefaults`)\n * so assistive tech can tell them apart from the visible month. Override to\n * change the format entirely.\n */\n readonly dateLabel = input<CalendarDateLabelFormatter<D>>(\n (date, { adapter, outsideMonth, locale }) => {\n const formatted = adapter.format(\n date,\n { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' },\n locale ?? undefined,\n );\n return outsideMonth ? this.#defaults.outsideMonthLabel(formatted) : formatted;\n },\n );\n\n /**\n * Disables the whole calendar: no focus movement, no selection. Bound as\n * `[disabled]`; {@link disabled} is the effective state.\n */\n readonly disabledInput = input(false, { transform: booleanAttribute, alias: 'disabled' });\n\n /**\n * Makes the calendar read-only: dates stay focusable but selection is blocked.\n * Bound as `[readonly]`; {@link readonly} is the effective state.\n */\n readonly readonlyInput = input(false, { transform: booleanAttribute, alias: 'readonly' });\n\n /**\n * Effective disabled: the calendar's own `[disabled]` OR'd with the disabled\n * state of a `[forDatePicker]` / `[forDateRangePicker]` it is projected into.\n */\n readonly disabled = computed(\n () => this.disabledInput() || (this.#pickerHost?.effectiveDisabled() ?? false),\n );\n\n /**\n * Effective read-only: the calendar's own `[readonly]` OR'd with the read-only\n * state of a `[forDatePicker]` / `[forDateRangePicker]` it is projected into.\n */\n readonly readonly = computed(\n () => this.readonlyInput() || (this.#pickerHost?.readonly() ?? false),\n );\n\n /**\n * Selection mode. `'single'` (default) keeps the single-date `[(value)]`\n * behaviour unchanged. `'range'` switches to the two-click anchor → commit\n * flow and exposes the result through `[(range)]`.\n */\n readonly selectionMode = input<'single' | 'range'>('single');\n\n /**\n * Active calendar view. `'day'` (default) shows the date grid; `'month'` and\n * `'year'` show the month / year picker grids. Two-way bindable; the `model()`\n * change emitter (`(viewChange)`) fires only when the calendar itself cycles\n * or drills the view, never on consumer writes via `[(view)]`.\n */\n readonly view = model<CalendarView>('day');\n\n /**\n * Number of years the year view shows, as an aligned block containing the\n * visible year. Default `12`.\n */\n readonly yearBlockSize = input(12, { transform: numberAttribute });\n\n /**\n * Two-way bindable committed date range, or `null`. Only used when\n * `selectionMode=\"range\"`. The `model()` change emitter (`(rangeChange)`)\n * fires only when the calendar internally commits a range, never\n * on consumer writes via `[(range)]`.\n */\n readonly range = model<DateRange<D> | null>(null);\n\n /**\n * Minimum inclusive day count for a range selection. A click that would\n * commit a range shorter than this is a no-op (anchor is preserved).\n * `null` (default) means no minimum. Only honoured in `selectionMode=\"range\"`.\n */\n readonly minRangeLength = input<number | null>(null);\n\n /**\n * Maximum inclusive day count for a range selection. A click that would\n * commit a range longer than this is a no-op (anchor is preserved).\n * `null` (default) means no maximum. Only honoured in `selectionMode=\"range\"`.\n */\n readonly maxRangeLength = input<number | null>(null);\n\n /**\n * First day of the week as a **0-6** index (`0` = Sunday). When `null`\n * (default, overridable via `provideForCalendarDefaults`), the adapter's\n * `getFirstDayOfWeek()` is used.\n */\n readonly firstDayOfWeek = input<number | null>(this.#defaults.firstDayOfWeek);\n\n /**\n * Writing direction. When unset (default `null`), the inherited ambient\n * direction is resolved from the nearest ancestor carrying a `dir` attribute\n * (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins.\n * The resolved value is reflected to the host `dir` attribute and swaps the\n * `ArrowLeft` / `ArrowRight` semantics in RTL.\n */\n readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n readonly dir = injectTextDirection(this._dirInput);\n\n /**\n * BCP 47 locale tag governing the formatted month / weekday / cell-label names\n * (heading, weekday headers, month-picker options, gridcell `aria-label`).\n * When `null` (default), the adapter formats in its own `locale()`, then the\n * runtime's default locale. Does not change the calendar system, which stays\n * Gregorian.\n */\n readonly locale = input<string | null>(null);\n\n readonly #initialToday = this.adapter.today();\n\n /**\n * Internal focused date (the roving entry point), seeded from\n * `value ?? range.start ?? today`, with today clamped into `[min, max]`. It is\n * re-seeded when `value` or `range` changes; a change of `min` / `max` keeps\n * it while it stays within the new bounds.\n */\n readonly focusedDate: WritableSignal<D> = linkedSignal<FocusedDateSource<D>, D>({\n source: () => ({\n value: this.value(),\n range: this.range(),\n min: this.min(),\n max: this.max(),\n }),\n computation: (source, previous) => {\n if (\n previous !== undefined &&\n source.value === previous.source.value &&\n source.range === previous.source.range &&\n this.#bounds.contains(previous.value)\n ) {\n return previous.value;\n }\n return this.#seedDate();\n },\n });\n\n readonly #bounds = new CalendarBounds<D>({\n adapter: this.adapter,\n min: this.min,\n max: this.max,\n visibleMonth: () => this.visibleMonth(),\n isDateUnavailable: this.isDateUnavailable,\n disabled: this.disabled,\n });\n\n readonly #range = new CalendarRangeSelection<D>({\n adapter: this.adapter,\n focusedDate: this.focusedDate,\n range: this.range,\n active: computed(() => this.selectionMode() === 'range'),\n minRangeLength: this.minRangeLength,\n maxRangeLength: this.maxRangeLength,\n });\n\n readonly #nav = new CalendarNavigation<D>(\n {\n adapter: this.adapter,\n disabled: this.disabled,\n readonly: this.readonly,\n selectionMode: this.selectionMode,\n focusedDate: this.focusedDate,\n value: this.value,\n periodLabel: () => this.viewTriggerLabel(),\n visibleYear: () => this.visibleYear(),\n visibleMonthNumber: () => this.visibleMonthNumber(),\n bounds: this.#bounds,\n range: this.#range,\n announce: (label) => this.#announcer.announce(label, 'polite'),\n scheduleFocus: (fn) => this.#scheduleFocus(fn),\n focusDayCell: (target) => this.#focusDayCell(target),\n },\n this.#seedDate(),\n );\n\n readonly #dayNav = new CalendarDayNavigator<D>({\n ...this.#subGridHost(),\n visibleMonth: () => this.visibleMonth(),\n firstDayOfWeek: () => this.#resolvedFirstDayOfWeek(),\n getDateLabel: (date) => this.getDateLabel(date),\n selectDate: (date) => this.#nav.selectDate(date),\n pageMonths: (delta) => this.#nav.pageMonths(delta),\n applyDayKeyMove: (target, isPaging) => this.#nav.applyDayKeyMove(target, isPaging),\n });\n\n readonly #monthNav = new CalendarMonthNavigator<D>({\n ...this.#subGridHost(),\n ...this.#pickerViewHost(),\n isMonthOutOfBounds: (year, month) => this.#bounds.isMonthOutOfBounds(year, month),\n selectMonth: (month) => this.selectMonth(month),\n });\n\n readonly #yearNav = new CalendarYearNavigator<D>({\n ...this.#subGridHost(),\n ...this.#pickerViewHost(),\n selectYear: (year) => this.selectYear(year),\n });\n\n readonly #strategies: Record<CalendarView, CalendarViewStrategy> = {\n day: this.#dayNav,\n month: this.#monthNav,\n year: this.#yearNav,\n };\n\n #seedDate(): D {\n return this.value() ?? this.range()?.start ?? this.#bounds.clamp(this.#initialToday);\n }\n\n #strategyFor(view: CalendarView): CalendarViewStrategy {\n return this.#strategies[view];\n }\n\n /** The reactive root surface shared by all three sub-grid navigators. */\n #subGridHost(): CalendarSubGridHost<D> {\n return {\n adapter: this.adapter,\n dir: this.dir,\n locale: () => this.locale(),\n yearBlockSize: () => this.yearBlockSize(),\n yearBlockStart: () => this.#yearBlockStart(),\n visibleMonthLabel: () => this.visibleMonthLabel(),\n visibleYear: () => this.visibleYear(),\n visibleMonthNumber: () => this.visibleMonthNumber(),\n focusedDate: this.focusedDate,\n isPreviousMonthDisabled: this.#bounds.isPreviousMonthDisabled,\n isNextMonthDisabled: this.#bounds.isNextMonthDisabled,\n isYearDisabled: (year) => this.#bounds.isYearDisabled(year),\n today: () => this.adapter.today(),\n };\n }\n\n /** The navigation / focus surface shared by the month and year picker navigators. */\n #pickerViewHost() {\n return {\n value: () => this.value(),\n pageByYears: (step: number) => this.#nav.pageByYears(step),\n moveFocusedDate: (date: D) => this.#nav.moveFocusedDate(date),\n dateInMonth: (year: number, month: number) => this.#nav.dateInMonth(year, month),\n scheduleFocus: (fn: () => void) => this.#scheduleFocus(fn),\n };\n }\n\n #viewSwitched = false;\n readonly #viewFocusEffect = effect(() => {\n const view = this.view();\n if (!this.#viewSwitched) {\n this.#viewSwitched = true;\n return;\n }\n afterNextRender(() => this.#strategyFor(view).focusActive(), { injector: this.#injector });\n });\n\n readonly #resolvedFirstDayOfWeek = computed(\n () => this.firstDayOfWeek() ?? this.adapter.getFirstDayOfWeek(),\n );\n\n /** First day of the visible month, derived from {@link focusedDate}. */\n readonly visibleMonth = computed(() => {\n const focused = this.focusedDate();\n return this.adapter.createDate(\n this.adapter.getYear(focused),\n this.adapter.getMonth(focused),\n 1,\n );\n });\n\n readonly #headingId = signal(this.#idGen.next('for-calendar-heading'));\n readonly headingId = this.#headingId.asReadonly();\n\n /**\n * Adopts a consumer-set static `id` on the `[forCalendarHeading]` host into\n * `headingId` (the grid's `aria-labelledby` resolves to it) instead of\n * letting the `[id]` host binding clobber it.\n */\n adoptHeadingId(el: HTMLElement): void {\n adoptHostId(el, this.#headingId);\n }\n\n readonly visibleMonthLabel = computed(() =>\n this.adapter.format(\n this.visibleMonth(),\n { month: 'long', year: 'numeric' },\n this.locale() ?? undefined,\n ),\n );\n\n /** The visible month's full year (e.g. `2026`). */\n readonly visibleYear = computed(() => this.adapter.getYear(this.visibleMonth()));\n\n /** The visible month, **1-12**. */\n readonly visibleMonthNumber = computed(() => this.adapter.getMonth(this.visibleMonth()));\n\n /**\n * Twelve entries for the visible year — each a localized month name plus\n * whether the whole month falls outside `[min, max]`. Tracks {@link visibleYear}.\n * Build native `<select>` month dropdowns from it.\n */\n readonly monthOptions = computed<readonly CalendarMonthOption[]>(() => this.#monthNav.options());\n\n readonly #yearBlockStart = computed(() => {\n const size = this.yearBlockSize();\n return Math.floor(this.visibleYear() / size) * size;\n });\n\n /** Rows of the month picker grid (3 columns) for the visible year. */\n readonly monthRows = computed<readonly CalendarMonthRow[]>(() => this.#monthNav.rows());\n\n /** Rows of the year picker grid (3 columns) for the aligned block containing the visible year. */\n readonly yearRows = computed<readonly CalendarYearRow[]>(() => this.#yearNav.rows());\n\n /**\n * Label of the period the active view shows, for the view trigger and the\n * heading: the month and year in day view, the year in month view, the block\n * of years in year view.\n */\n readonly viewTriggerLabel = computed(() => this.#strategyFor(this.view()).triggerLabel());\n\n readonly isPreviousDisabled = computed(() => this.#strategyFor(this.view()).isPreviousDisabled());\n\n readonly isNextDisabled = computed(() => this.#strategyFor(this.view()).isNextDisabled());\n\n /** Weekday column headers for the visible month, starting at `firstDayOfWeek`. */\n readonly weekDays = this.#dayNav.weekDays;\n\n /** Week rows of the visible month, including outside-month padding days. */\n readonly weeks = this.#dayNav.weeks;\n\n /** Whether the previous-month button should be disabled (bounded by `min`). */\n readonly isPreviousMonthDisabled = this.#bounds.isPreviousMonthDisabled;\n\n /** Whether the next-month button should be disabled (bounded by `max`). */\n readonly isNextMonthDisabled = this.#bounds.isNextMonthDisabled;\n\n /**\n * Whether every day of `month` (**1-12**) in the visible year falls outside\n * `[min, max]`. Use it to disable a month in a custom dropdown.\n */\n isMonthDisabled(month: number): boolean {\n return this.#bounds.isMonthOutOfBounds(this.visibleYear(), month);\n }\n\n /**\n * Whether every day of `year` falls outside `[min, max]`. Use it to disable a\n * year in a custom dropdown.\n */\n isYearDisabled(year: number): boolean {\n return this.#bounds.isYearDisabled(year);\n }\n\n isMonthSelected(month: number): boolean {\n return this.#monthNav.isSelected(month);\n }\n\n isMonthToday(month: number): boolean {\n return this.#monthNav.isToday(month);\n }\n\n isMonthFocused(month: number): boolean {\n return this.#monthNav.isFocused(month);\n }\n\n isYearSelected(year: number): boolean {\n return this.#yearNav.isSelected(year);\n }\n\n isYearToday(year: number): boolean {\n return this.#yearNav.isToday(year);\n }\n\n isYearFocused(year: number): boolean {\n return this.#yearNav.isFocused(year);\n }\n\n isSelected(date: D): boolean {\n if (this.selectionMode() === 'range') {\n return this.#range.contains(date);\n }\n const value = this.value();\n return value !== null && this.adapter.isSameDay(date, value);\n }\n\n isRangeStart(date: D): boolean {\n return this.#range.isRangeStart(date);\n }\n\n isRangeEnd(date: D): boolean {\n return this.#range.isRangeEnd(date);\n }\n\n isInRange(date: D): boolean {\n return this.#range.isInRange(date);\n }\n\n isRangePreview(date: D): boolean {\n return this.#range.isRangePreview(date);\n }\n\n setHovered(date: D | null): void {\n this.#range.setHovered(date);\n }\n\n isToday(date: D): boolean {\n return this.adapter.isSameDay(date, this.adapter.today());\n }\n\n isFocused(date: D): boolean {\n return this.adapter.isSameDay(date, this.focusedDate());\n }\n\n isOutsideMonth(date: D): boolean {\n const visible = this.visibleMonth();\n return (\n this.adapter.getMonth(date) !== this.adapter.getMonth(visible) ||\n this.adapter.getYear(date) !== this.adapter.getYear(visible)\n );\n }\n\n isUnavailable(date: D): boolean {\n return this.#bounds.isUnavailable(date);\n }\n\n getDateLabel(date: D): string {\n return this.dateLabel()(date, {\n adapter: this.adapter,\n outsideMonth: this.isOutsideMonth(date),\n locale: this.locale(),\n });\n }\n\n selectDate(date: D): void {\n this.#nav.selectDate(date);\n }\n\n private activateDate(date: D): void {\n this.#nav.activateDate(date);\n }\n\n pageMonths(delta: number): void {\n this.#nav.pageMonths(delta);\n }\n\n /**\n * Set the visible month to (`year`, `month`) without selecting a date.\n * `month` is **1-12**. Re-applies the user's intended day-of-month (clamped to\n * the target month's length), clamps the result into `[min, max]`, and\n * announces the new period politely when the active view's period changes\n * (the month in day view, the year in month view, the block in year view). Keeps DOM\n * focus on the caller — it does not move focus into the grid. A no-op while the\n * calendar is disabled.\n */\n goTo(year: number, month: number): void {\n this.#nav.goTo(year, month);\n }\n\n /** Set the visible month within the current visible year. `month` is **1-12**. */\n goToMonth(month: number): void {\n this.goTo(this.visibleYear(), month);\n }\n\n /** Set the visible year, keeping the current visible month. */\n goToYear(year: number): void {\n this.goTo(year, this.visibleMonthNumber());\n }\n\n handleCellKeydown(event: KeyboardEvent, fromDate: D): void {\n if (this.disabled()) {\n return;\n }\n this.#dayNav.handleKeydown(event, fromDate);\n }\n\n /**\n * Cycle the view one step coarser: `day → month → year`, clamped at `'year'`.\n * No-op when the whole calendar is disabled.\n */\n cycleView(): void {\n if (this.disabled()) {\n return;\n }\n const order: readonly CalendarView[] = ['day', 'month', 'year'];\n const next = order[order.indexOf(this.view()) + 1];\n if (next) {\n this.view.set(next);\n }\n }\n\n /**\n * Select a whole month (1-12): navigate to it within the current visible year\n * and switch the view to `'day'`. It changes no value, so a read-only calendar\n * drills down too. No-op when the calendar is disabled or the month is out of\n * `[min, max]`.\n */\n selectMonth(month: number): void {\n if (this.disabled() || this.isMonthDisabled(month)) {\n return;\n }\n this.goToMonth(month);\n this.view.set('day');\n }\n\n /**\n * Select a whole year: navigate to it and switch the view to `'month'`. It\n * changes no value, so a read-only calendar drills down too. No-op when the\n * calendar is disabled or the year is out of `[min, max]`.\n */\n selectYear(year: number): void {\n if (this.disabled() || this.isYearDisabled(year)) {\n return;\n }\n this.goToYear(year);\n this.view.set('month');\n }\n\n /** Page backward by one month / year / block depending on the active view. */\n pagePrevious(): void {\n this.#page(-1);\n }\n\n /** Page forward by one month / year / block depending on the active view. */\n pageNext(): void {\n this.#page(1);\n }\n\n #page(direction: -1 | 1): void {\n if (this.disabled()) {\n return;\n }\n this.#strategyFor(this.view()).page(direction);\n }\n\n /**\n * Move DOM focus to the roving cell — the gridcell carrying the tab stop,\n * i.e. the one matching {@link focusedDate} (day view) or the highlighted\n * month / year cell (month / year view). Returns `false` when no matching\n * cell is currently rendered, so an overlay host wrapping the calendar can\n * fall back to its own focus logic.\n */\n focusActiveCell(): boolean {\n return this.#strategyFor(this.view()).focusActive();\n }\n\n registerCell(handle: ForCalendarCellHandle<D>): void {\n this.#dayNav.register(handle);\n }\n\n unregisterCell(handle: ForCalendarCellHandle<D>): void {\n this.#dayNav.unregister(handle);\n }\n\n handleMonthCellKeydown(event: KeyboardEvent, fromMonth: number): void {\n if (this.disabled()) {\n return;\n }\n this.#monthNav.handleKeydown(event, fromMonth);\n }\n\n handleYearCellKeydown(event: KeyboardEvent, fromYear: number): void {\n if (this.disabled()) {\n return;\n }\n this.#yearNav.handleKeydown(event, fromYear);\n }\n\n registerMonthCell(handle: ForCalendarMonthCellHandle): void {\n this.#monthNav.register(handle);\n }\n\n unregisterMonthCell(handle: ForCalendarMonthCellHandle): void {\n this.#monthNav.unregister(handle);\n }\n\n registerYearCell(handle: ForCalendarYearCellHandle): void {\n this.#yearNav.register(handle);\n }\n\n unregisterYearCell(handle: ForCalendarYearCellHandle): void {\n this.#yearNav.unregister(handle);\n }\n\n #scheduleFocus(fn: () => void): void {\n afterNextRender(fn, { injector: this.#injector });\n }\n\n #focusDayCell(target: D): void {\n afterNextRender(() => this.#dayNav.focusCell(target), { injector: this.#injector });\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { hostLabelledBy } from 'forty-cdk/core';\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * The calendar's date table (`role=\"grid\"`). Apply on a `<table>`. Labelled by\n * the `[forCalendarHeading]` via `aria-labelledby`, and reflects `aria-disabled`\n * / `aria-readonly` from the root. In `selectionMode=\"range\"` it carries\n * `aria-multiselectable=\"true\"`, since a committed range selects several cells.\n *\n * Exposes the month's `weekDays()` (column headers) and `weeks()` (day rows)\n * for the consumer to iterate — bind `cell.date` to each `[forCalendarCell]`.\n */\n@Directive({\n selector: '[forCalendarGrid]',\n exportAs: 'forCalendarGrid',\n host: {\n role: 'grid',\n '[attr.aria-disabled]': 'ctx.disabled() ? \"true\" : null',\n '[attr.aria-readonly]': 'ctx.readonly() ? \"true\" : null',\n '[attr.aria-multiselectable]': 'ctx.selectionMode() === \"range\" ? \"true\" : null',\n },\n})\nexport class ForCalendarGrid {\n private readonly ctx = injectCalendarContext('ForCalendarGrid');\n\n private readonly labelledBy = hostLabelledBy(() => this.ctx.headingId());\n\n /** Weekday column headers for the visible month, starting at `firstDayOfWeek`. */\n readonly weekDays = this.ctx.weekDays;\n\n /** Week rows of the visible month, including outside-month padding days. */\n readonly weeks = this.ctx.weeks;\n}\n","import { Directive } from '@angular/core';\n\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * Marks the calendar grid's header rowgroup. Apply on a `<thead>` holding a\n * single row of `<th scope=\"col\">` weekday headers.\n *\n * Reflects `role=\"rowgroup\"` so the weekday header is exposed as a distinct\n * rowgroup inside the `role=\"grid\"` table — assistive tech announces the\n * column headers as their own group rather than folding them into the day\n * rows. (A bare `<thead>` carries the implicit role, but the grid's explicit\n * `role=\"grid\"` suppresses the table's native row/rowgroup semantics, so the\n * header must restate it.)\n *\n * Also exposes `weekDays()` so the header row can be iterated from this piece,\n * as an alternative to reading it off `[forCalendarGrid]`.\n */\n@Directive({\n selector: '[forCalendarGridHeader]',\n exportAs: 'forCalendarGridHeader',\n host: {\n role: 'rowgroup',\n },\n})\nexport class ForCalendarGridHeader {\n private readonly ctx = injectCalendarContext('ForCalendarGridHeader');\n\n /** Weekday column headers for the visible month, starting at `firstDayOfWeek`. */\n readonly weekDays = this.ctx.weekDays;\n}\n","import { computed, Directive, ElementRef, inject, input, type InputSignal } from '@angular/core';\n\nimport { assertInputBound, isUnset, registerHandle, unsetInput, type Unset } from 'forty-cdk/core';\nimport { type ForCalendarCellHandle, injectCalendarContext } from './calendar-context';\n\n/**\n * A single day cell (`role=\"gridcell\"`). Apply on the `<td>` for each day in\n * the grid and bind `[date]` to the cell's date from `weeks()`.\n *\n * Carries the roving tab stop (`tabindex=\"0\"` only on the focused date), the\n * full accessible date as `aria-label` (the bare day number stays the visible\n * content), `aria-selected` (always emitted), `aria-current=\"date\"` on today,\n * `aria-disabled` on unavailable dates, and the boolean `data-*` styling hooks\n * (`data-selected`, `data-today`, `data-highlighted`, `data-disabled`,\n * `data-outside-month`). In `selectionMode=\"range\"`, also emits\n * `data-range-start`, `data-range-end`, `data-in-range`, and\n * `data-range-preview` (all boolean present/absent). Click and `Enter` /\n * `Space` select; arrow / paging keys move the focused date.\n *\n * @typeParam D The adapter's date type (inferred from the bound `[date]`).\n */\n@Directive({\n selector: '[forCalendarCell]',\n exportAs: 'forCalendarCell',\n host: {\n role: 'gridcell',\n '[attr.tabindex]': 'focused() ? 0 : -1',\n '[attr.aria-label]': 'dateLabel()',\n '[attr.aria-selected]': 'selected() ? \"true\" : \"false\"',\n '[attr.aria-current]': 'isToday() ? \"date\" : null',\n '[attr.aria-disabled]': 'unavailable() ? \"true\" : null',\n '[attr.data-selected]': 'selected() ? \"\" : null',\n '[attr.data-today]': 'isToday() ? \"\" : null',\n '[attr.data-highlighted]': 'focused() ? \"\" : null',\n '[attr.data-disabled]': 'unavailable() ? \"\" : null',\n '[attr.data-outside-month]': 'outsideMonth() ? \"\" : null',\n '[attr.data-range-start]': 'rangeStart() ? \"\" : null',\n '[attr.data-range-end]': 'rangeEnd() ? \"\" : null',\n '[attr.data-in-range]': 'inRange() ? \"\" : null',\n '[attr.data-range-preview]': 'rangePreview() ? \"\" : null',\n '(click)': 'onClick()',\n '(keydown)': 'onKeyDown($event)',\n '(pointerenter)': 'onPointerEnter()',\n '(pointerleave)': 'ctx.setHovered(null)',\n },\n})\nexport class ForCalendarCell<D> {\n private readonly ctx = injectCalendarContext('ForCalendarCell');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** The date this cell represents. Mandatory — a cell with no binding throws in dev mode. */\n readonly date: InputSignal<D | Unset> = input(unsetInput<D>());\n\n private readonly selected = computed(() => this.#bound((d) => this.ctx.isSelected(d), false));\n private readonly isToday = computed(() => this.#bound((d) => this.ctx.isToday(d), false));\n private readonly focused = computed(() => this.#bound((d) => this.ctx.isFocused(d), false));\n private readonly unavailable = computed(() =>\n this.#bound((d) => this.ctx.isUnavailable(d), false),\n );\n private readonly outsideMonth = computed(() =>\n this.#bound((d) => this.ctx.isOutsideMonth(d), false),\n );\n private readonly dateLabel = computed(() =>\n this.#bound<string | null>((d) => this.ctx.getDateLabel(d), null),\n );\n private readonly rangeStart = computed(() => this.#bound((d) => this.ctx.isRangeStart(d), false));\n private readonly rangeEnd = computed(() => this.#bound((d) => this.ctx.isRangeEnd(d), false));\n private readonly inRange = computed(() => this.#bound((d) => this.ctx.isInRange(d), false));\n private readonly rangePreview = computed(() =>\n this.#bound((d) => this.ctx.isRangePreview(d), false),\n );\n\n constructor() {\n assertInputBound(this.date, 'calendar', '[forCalendarCell]', 'date');\n const handle: ForCalendarCellHandle<unknown> = {\n host: this.#host.nativeElement,\n date: this.date,\n };\n registerHandle(\n handle,\n (h) => this.ctx.registerCell(h),\n (h) => this.ctx.unregisterCell(h),\n );\n }\n\n #bound<R>(read: (date: D) => R, fallback: R): R {\n const date = this.date();\n return isUnset(date) ? fallback : read(date);\n }\n\n private onClick(): void {\n const date = this.date();\n if (!isUnset(date)) {\n this.ctx.activateDate(date);\n }\n }\n\n private onKeyDown(event: KeyboardEvent): void {\n const date = this.date();\n if (!isUnset(date)) {\n this.ctx.handleCellKeydown(event, date);\n }\n }\n\n private onPointerEnter(): void {\n const date = this.date();\n if (!isUnset(date)) {\n this.ctx.setHovered(date);\n }\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * The period heading. Apply on a heading element (e.g. `<h2>`) and render\n * its `label()` as the content: `<h2 forCalendarHeading #h=\"forCalendarHeading\">{{ h.label() }}</h2>`.\n * The day, month and year grids are `aria-labelledby` this element, so it names\n * the period the active view shows.\n *\n * It is **not** an `aria-live` region: paging announces the new\n * period through a dedicated off-screen live region owned by `[forCalendar]`,\n * so the grid's accessible name is re-read on demand without the heading\n * itself double-announcing on every render.\n */\n@Directive({\n selector: '[forCalendarHeading]',\n exportAs: 'forCalendarHeading',\n host: {\n '[id]': 'ctx.headingId()',\n },\n})\nexport class ForCalendarHeading {\n private readonly ctx = injectCalendarContext('ForCalendarHeading');\n\n /**\n * The label of the period the active view shows: the month and year in day\n * view (`\"June 2026\"`), the year in month view (`\"2026\"`), the block of years\n * in year view (`\"2016 – 2027\"`).\n */\n readonly label = this.ctx.viewTriggerLabel;\n\n constructor() {\n this.ctx.adoptHeadingId(inject<ElementRef<HTMLElement>>(ElementRef).nativeElement);\n }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { hostButtonType, hostAriaLabel } from 'forty-cdk/core';\n\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * Pages the calendar backward. In `day` view pages by one month; in `month` view\n * pages by one year; in `year` view pages by one block. Apply on a `<button>`.\n * Keeps DOM focus on itself while paging; the calendar announces the new period\n * through its off-screen live region. Auto-disabled at the view's bound, or when\n * the whole calendar is disabled.\n *\n * Reflects the disabled state through `aria-disabled` + `data-disabled` only —\n * never the native `disabled` attribute — so a button that auto-disables at the\n * bound while focused keeps DOM focus instead of being ejected from the focus\n * order. Activation is a no-op while disabled.\n *\n * Provide an accessible name via the `[ariaLabel]` input (e.g.\n * `[ariaLabel]=\"'Previous'\"`).\n */\n@Directive({\n selector: '[forCalendarPrevButton]',\n exportAs: 'forCalendarPrevButton',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.aria-label]': 'resolvedAriaLabel()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '(click)': 'page()',\n },\n})\nexport class ForCalendarPrevButton {\n private readonly buttonType = hostButtonType();\n\n private readonly ctx = injectCalendarContext('ForCalendarPrevButton');\n\n /** Accessible name for the button. A `null` (default) or empty value emits no attribute. */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n private readonly disabled = computed(() => this.ctx.disabled() || this.ctx.isPreviousDisabled());\n\n private page(): void {\n if (this.disabled()) {\n return;\n }\n this.ctx.pagePrevious();\n }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { hostButtonType, hostAriaLabel } from 'forty-cdk/core';\n\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * Pages the calendar forward. In `day` view pages by one month; in `month` view\n * pages by one year; in `year` view pages by one block. Apply on a `<button>`.\n * Keeps DOM focus on itself while paging; the calendar announces the new period\n * through its off-screen live region. Auto-disabled at the view's bound, or when\n * the whole calendar is disabled.\n *\n * Reflects the disabled state through `aria-disabled` + `data-disabled` only —\n * never the native `disabled` attribute — so a button that auto-disables at the\n * bound while focused keeps DOM focus instead of being ejected from the focus\n * order. Activation is a no-op while disabled.\n *\n * Provide an accessible name via the `[ariaLabel]` input (e.g.\n * `[ariaLabel]=\"'Next'\"`).\n */\n@Directive({\n selector: '[forCalendarNextButton]',\n exportAs: 'forCalendarNextButton',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.aria-label]': 'resolvedAriaLabel()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '(click)': 'page()',\n },\n})\nexport class ForCalendarNextButton {\n private readonly buttonType = hostButtonType();\n\n private readonly ctx = injectCalendarContext('ForCalendarNextButton');\n\n /** Accessible name for the button. A `null` (default) or empty value emits no attribute. */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n private readonly disabled = computed(() => this.ctx.disabled() || this.ctx.isNextDisabled());\n\n private page(): void {\n if (this.disabled()) {\n return;\n }\n this.ctx.pageNext();\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { hostLabelledBy } from 'forty-cdk/core';\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * The month picker grid (`role=\"grid\"`). Apply on a `<table>`. Labelled by the\n * `[forCalendarHeading]` via `aria-labelledby`. Exposes `rows()` — iterate\n * rows then cells, binding each cell's `month` to `[forCalendarMonthCell]`.\n *\n * Shows the 12 months of the visible year in 3-column rows. Used when\n * `view === 'month'`.\n */\n@Directive({\n selector: '[forCalendarMonthGrid]',\n exportAs: 'forCalendarMonthGrid',\n host: {\n role: 'grid',\n '[attr.aria-disabled]': 'ctx.disabled() ? \"true\" : null',\n '[attr.aria-readonly]': 'ctx.readonly() ? \"true\" : null',\n '[attr.data-view]': '\"month\"',\n },\n})\nexport class ForCalendarMonthGrid {\n private readonly ctx = injectCalendarContext('ForCalendarMonthGrid');\n\n private readonly labelledBy = hostLabelledBy(() => this.ctx.headingId());\n\n /** Rows of the month picker grid (3 columns) for the visible year. */\n readonly rows = this.ctx.monthRows;\n}\n","import { computed, Directive, ElementRef, inject, input, type InputSignal } from '@angular/core';\n\nimport { assertInputBound, isUnset, registerHandle, unsetInput, type Unset } from 'forty-cdk/core';\nimport { type ForCalendarMonthCellHandle, injectCalendarContext } from './calendar-context';\n\n/**\n * A single month cell (`role=\"gridcell\"`) in the month picker grid. Apply on\n * the `<td>` for each month and bind `[month]` to the month number (1-12) from\n * `rows()`.\n *\n * Carries the roving tab stop (`tabindex=\"0\"` on the focused month), reflects\n * `aria-selected` (always emitted), `data-today`, `data-selected`,\n * `data-highlighted`, `data-disabled`. Click and `Enter` / `Space` drill down\n * to the day view for that month; arrow / paging keys move the roving cell.\n */\n@Directive({\n selector: '[forCalendarMonthCell]',\n exportAs: 'forCalendarMonthCell',\n host: {\n role: 'gridcell',\n '[attr.tabindex]': 'focused() ? 0 : -1',\n '[attr.aria-selected]': 'selected() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.data-selected]': 'selected() ? \"\" : null',\n '[attr.data-today]': 'today() ? \"\" : null',\n '[attr.data-highlighted]': 'focused() ? \"\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '(click)': 'onClick()',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForCalendarMonthCell {\n private readonly ctx = injectCalendarContext('ForCalendarMonthCell');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The month this cell represents, **1-12**. Mandatory — a cell with no binding throws in dev\n * mode.\n */\n readonly month: InputSignal<number | Unset> = input(unsetInput<number>());\n\n private readonly selected = computed(() => this.#bound((v) => this.ctx.isMonthSelected(v)));\n private readonly today = computed(() => this.#bound((v) => this.ctx.isMonthToday(v)));\n private readonly focused = computed(() => this.#bound((v) => this.ctx.isMonthFocused(v)));\n private readonly disabled = computed(\n () => this.ctx.disabled() || this.#bound((v) => this.ctx.isMonthDisabled(v)),\n );\n\n constructor() {\n assertInputBound(this.month, 'calendar', '[forCalendarMonthCell]', 'month');\n const handle: ForCalendarMonthCellHandle = {\n host: this.#host.nativeElement,\n month: this.month,\n };\n registerHandle(\n handle,\n (h) => this.ctx.registerMonthCell(h),\n (h) => this.ctx.unregisterMonthCell(h),\n );\n }\n\n #bound(read: (month: number) => boolean): boolean {\n const month = this.month();\n return isUnset(month) ? false : read(month);\n }\n\n private onClick(): void {\n const month = this.month();\n if (!isUnset(month)) {\n this.ctx.selectMonth(month);\n }\n }\n\n private onKeyDown(event: KeyboardEvent): void {\n const month = this.month();\n if (!isUnset(month)) {\n this.ctx.handleMonthCellKeydown(event, month);\n }\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { hostLabelledBy } from 'forty-cdk/core';\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * The year picker grid (`role=\"grid\"`). Apply on a `<table>`. Labelled by the\n * `[forCalendarHeading]` via `aria-labelledby`. Exposes `rows()` — iterate\n * rows then cells, binding each cell's `year` to `[forCalendarYearCell]`.\n *\n * Shows an aligned block of `yearBlockSize` years in 3-column rows. Used when\n * `view === 'year'`.\n */\n@Directive({\n selector: '[forCalendarYearGrid]',\n exportAs: 'forCalendarYearGrid',\n host: {\n role: 'grid',\n '[attr.aria-disabled]': 'ctx.disabled() ? \"true\" : null',\n '[attr.aria-readonly]': 'ctx.readonly() ? \"true\" : null',\n '[attr.data-view]': '\"year\"',\n },\n})\nexport class ForCalendarYearGrid {\n private readonly ctx = injectCalendarContext('ForCalendarYearGrid');\n\n private readonly labelledBy = hostLabelledBy(() => this.ctx.headingId());\n\n /** Rows of the year picker grid (3 columns) for the aligned block containing the visible year. */\n readonly rows = this.ctx.yearRows;\n}\n","import { computed, Directive, ElementRef, inject, input, type InputSignal } from '@angular/core';\n\nimport { assertInputBound, isUnset, registerHandle, unsetInput, type Unset } from 'forty-cdk/core';\nimport { type ForCalendarYearCellHandle, injectCalendarContext } from './calendar-context';\n\n/**\n * A single year cell (`role=\"gridcell\"`) in the year picker grid. Apply on the\n * `<td>` for each year and bind `[year]` to the year number from `rows()`.\n *\n * Carries the roving tab stop (`tabindex=\"0\"` on the focused year), reflects\n * `aria-selected` (always emitted), `data-today`, `data-selected`,\n * `data-highlighted`, `data-disabled`. Click and `Enter` / `Space` drill down\n * to the month view for that year; arrow / paging keys move the roving cell.\n */\n@Directive({\n selector: '[forCalendarYearCell]',\n exportAs: 'forCalendarYearCell',\n host: {\n role: 'gridcell',\n '[attr.tabindex]': 'focused() ? 0 : -1',\n '[attr.aria-selected]': 'selected() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.data-selected]': 'selected() ? \"\" : null',\n '[attr.data-today]': 'today() ? \"\" : null',\n '[attr.data-highlighted]': 'focused() ? \"\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '(click)': 'onClick()',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForCalendarYearCell {\n private readonly ctx = injectCalendarContext('ForCalendarYearCell');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** The year this cell represents. Mandatory — a cell with no binding throws in dev mode. */\n readonly year: InputSignal<number | Unset> = input(unsetInput<number>());\n\n private readonly selected = computed(() => this.#bound((v) => this.ctx.isYearSelected(v)));\n private readonly today = computed(() => this.#bound((v) => this.ctx.isYearToday(v)));\n private readonly focused = computed(() => this.#bound((v) => this.ctx.isYearFocused(v)));\n private readonly disabled = computed(\n () => this.ctx.disabled() || this.#bound((v) => this.ctx.isYearDisabled(v)),\n );\n\n constructor() {\n assertInputBound(this.year, 'calendar', '[forCalendarYearCell]', 'year');\n const handle: ForCalendarYearCellHandle = {\n host: this.#host.nativeElement,\n year: this.year,\n };\n registerHandle(\n handle,\n (h) => this.ctx.registerYearCell(h),\n (h) => this.ctx.unregisterYearCell(h),\n );\n }\n\n #bound(read: (year: number) => boolean): boolean {\n const year = this.year();\n return isUnset(year) ? false : read(year);\n }\n\n private onClick(): void {\n const year = this.year();\n if (!isUnset(year)) {\n this.ctx.selectYear(year);\n }\n }\n\n private onKeyDown(event: KeyboardEvent): void {\n const year = this.year();\n if (!isUnset(year)) {\n this.ctx.handleYearCellKeydown(event, year);\n }\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { hostButtonType } from 'forty-cdk/core';\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * The view-cycle button in the calendar header. Apply on a `<button>`. Each\n * click advances the view one step coarser (`day → month → year`), clamped at\n * `'year'`. Reflects `data-view` so consumers can style it per view. Disabled\n * when the whole calendar is disabled.\n *\n * Reflects the disabled state through `aria-disabled` + `data-disabled` only —\n * never the native `disabled` attribute — so a focused trigger keeps DOM focus\n * instead of being ejected from the focus order. Cycling is a no-op while\n * disabled (guarded by `ctx.cycleView()`).\n *\n * Bind the `label` signal to the button text to show the active view label\n * (e.g. `\"June 2026\"` in day view, `\"2026\"` in month view, `\"2024 – 2035\"` in\n * year view).\n */\n@Directive({\n selector: '[forCalendarViewTrigger]',\n exportAs: 'forCalendarViewTrigger',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.data-view]': 'ctx.view()',\n '[attr.aria-disabled]': 'ctx.disabled() ? \"true\" : null',\n '[attr.data-disabled]': 'ctx.disabled() ? \"\" : null',\n '(click)': 'ctx.cycleView()',\n },\n})\nexport class ForCalendarViewTrigger {\n private readonly buttonType = hostButtonType();\n\n private readonly ctx = injectCalendarContext('ForCalendarViewTrigger');\n\n /** Label for the active view, e.g. `\"June 2026\"` / `\"2026\"` / `\"2016 – 2027\"`. */\n readonly label = this.ctx.viewTriggerLabel;\n}\n","import { Directive } from '@angular/core';\n\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * Wires a native `<select>` to a `ForCalendar`'s month navigation. Apply on a\n * `<select>` element inside `[forCalendar]`: the directive keeps the select\n * showing the visible month and navigates the calendar when the user picks a\n * different one, without mutating the selected date.\n *\n * Render the `<option>` elements yourself from {@link options} so you keep full\n * control over their markup, labels, and any placeholder:\n *\n * ```html\n * <select forCalendarMonthSelect #m=\"forCalendarMonthSelect\" aria-label=\"Month\">\n * @for (opt of m.options(); track opt.value) {\n * <option [value]=\"opt.value\" [disabled]=\"opt.disabled\">{{ opt.label }}</option>\n * }\n * </select>\n * ```\n */\n@Directive({\n selector: 'select[forCalendarMonthSelect]',\n exportAs: 'forCalendarMonthSelect',\n host: {\n '[value]': 'ctx.visibleMonthNumber()',\n '[disabled]': 'ctx.disabled()',\n '(change)': 'onChange($event)',\n },\n})\nexport class ForCalendarMonthSelect {\n private readonly ctx = injectCalendarContext('ForCalendarMonthSelect');\n\n /** The twelve localized, bounds-aware month options for the visible year. */\n readonly options = this.ctx.monthOptions;\n\n private onChange(event: Event): void {\n this.ctx.goToMonth(Number((event.target as HTMLSelectElement).value));\n }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { type CalendarYearOption, injectCalendarContext } from './calendar-context';\n\n/**\n * Wires a native `<select>` to a `ForCalendar`'s year navigation. Apply on a\n * `<select>` element inside `[forCalendar]`: the directive keeps the select\n * showing the visible year and navigates the calendar when the user picks a\n * different one, without mutating the selected date.\n *\n * Render the `<option>` elements yourself from {@link years} so you keep full\n * control over their markup:\n *\n * ```html\n * <select\n * forCalendarYearSelect\n * #y=\"forCalendarYearSelect\"\n * aria-label=\"Year\"\n * [minYear]=\"1900\"\n * [maxYear]=\"2100\"\n * >\n * @for (opt of y.years(); track opt.value) {\n * <option [value]=\"opt.value\" [disabled]=\"opt.disabled\">{{ opt.value }}</option>\n * }\n * </select>\n * ```\n */\n@Directive({\n selector: 'select[forCalendarYearSelect]',\n exportAs: 'forCalendarYearSelect',\n host: {\n '[value]': 'ctx.visibleYear()',\n '[disabled]': 'ctx.disabled()',\n '(change)': 'onChange($event)',\n },\n})\nexport class ForCalendarYearSelect {\n private readonly ctx = injectCalendarContext('ForCalendarYearSelect');\n\n /**\n * Lowest year listed in {@link years}. Defaults to 100 years before the\n * current year when `null`.\n */\n readonly minYear = input<number | null>(null);\n\n /**\n * Highest year listed in {@link years}. Defaults to 10 years after the\n * current year when `null`.\n */\n readonly maxYear = input<number | null>(null);\n\n /**\n * The selectable years, from {@link minYear} to {@link maxYear} inclusive.\n * Each entry is `disabled` when the whole year falls outside the calendar's\n * `[min, max]`. The default window is anchored to the current year (not the\n * visible year), so navigating far away never drops the current year off the\n * list.\n */\n readonly years = computed<readonly CalendarYearOption[]>(() => {\n const currentYear = this.ctx.adapter.getYear(this.ctx.adapter.today());\n const min = this.minYear() ?? currentYear - 100;\n const max = this.maxYear() ?? currentYear + 10;\n const out: CalendarYearOption[] = [];\n for (let year = min; year <= max; year++) {\n out.push({ value: year, disabled: this.ctx.isYearDisabled(year) });\n }\n return out;\n });\n\n private onChange(event: Event): void {\n this.ctx.goToYear(Number((event.target as HTMLSelectElement).value));\n }\n}\n"],"mappings":";;;;;AAsCA,IAAa,iBAAb,MAA2B;CAChB;CAGA,0BAA0B,eAAc;EAC/C,MAAM,MAAM,KAAK,MAAM,IAAG;EAC1B,IAAI,QAAQ,MACV,OAAO;EAET,MAAM,UAAU,KAAK,MAAM;EAC3B,M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AAA;CAAA,MAAA;CAAqB,YAAA,CAAA;EATjC,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,MAAM;IACJ,WAAW;IACX,cAAc;IACd,YAAY;GACb;EACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"forty-cdk-calendar.mjs","names":["GRID_COLUMNS","FOR_CALENDAR_DEFAULTS"],"sources":["../../../projects/forty-cdk/calendar/src/calendar-bounds.ts","../../../projects/forty-cdk/calendar/src/calendar-context.ts","../../../projects/forty-cdk/calendar/src/build-month-matrix.ts","../../../projects/forty-cdk/calendar/src/calendar-keyboard.ts","../../../projects/forty-cdk/calendar/src/calendar-day-navigator.ts","../../../projects/forty-cdk/calendar/src/calendar-month-navigator.ts","../../../projects/forty-cdk/calendar/src/intended-day-cursor.ts","../../../projects/forty-cdk/calendar/src/calendar-navigation.ts","../../../projects/forty-cdk/calendar/src/calendar-range-selection.ts","../../../projects/forty-cdk/calendar/src/calendar-year-navigator.ts","../../../projects/forty-cdk/calendar/src/calendar.ts","../../../projects/forty-cdk/calendar/src/calendar-grid.ts","../../../projects/forty-cdk/calendar/src/calendar-grid-header.ts","../../../projects/forty-cdk/calendar/src/calendar-cell.ts","../../../projects/forty-cdk/calendar/src/calendar-heading.ts","../../../projects/forty-cdk/calendar/src/calendar-prev-button.ts","../../../projects/forty-cdk/calendar/src/calendar-next-button.ts","../../../projects/forty-cdk/calendar/src/calendar-month-grid.ts","../../../projects/forty-cdk/calendar/src/calendar-month-cell.ts","../../../projects/forty-cdk/calendar/src/calendar-year-grid.ts","../../../projects/forty-cdk/calendar/src/calendar-year-cell.ts","../../../projects/forty-cdk/calendar/src/calendar-view-trigger.ts","../../../projects/forty-cdk/calendar/src/calendar-month-select.ts","../../../projects/forty-cdk/calendar/src/calendar-year-select.ts"],"sourcesContent":["import { computed, type Signal } from '@angular/core';\n\nimport { compareDateOf, clampToBounds } from 'forty-cdk/core';\nimport { type DateAdapter } from 'forty-cdk/date-adapter';\n\n/**\n * The reactive `[min, max]` bounds surface a `ForCalendar` root supplies to its\n * {@link CalendarBounds}.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport interface CalendarBoundsHost<D> {\n /** The active date adapter. */\n readonly adapter: DateAdapter<D>;\n /** Minimum selectable date (inclusive), or `null`. */\n readonly min: Signal<D | null>;\n /** Maximum selectable date (inclusive), or `null`. */\n readonly max: Signal<D | null>;\n /** The visible month (first day), used by the prev / next-month predicates. */\n readonly visibleMonth: () => D;\n /** Per-date consumer predicate marking a date unavailable. */\n readonly isDateUnavailable: Signal<(date: D) => boolean>;\n /** Whether the whole calendar is disabled. */\n readonly disabled: Signal<boolean>;\n}\n\n/**\n * Owns every `[min, max]` bounds question a `ForCalendar` asks: whole-month /\n * whole-year out-of-bounds checks, the prev / next-month disabled predicates,\n * per-date availability, and the navigation clamp. Shared by the root and the\n * day / month / year sub-grids so the bounds math lives in one place.\n *\n * Constructed directly (`new CalendarBounds(host)`); it holds no injection\n * context, mirroring how `SegmentEditor` is lifted out of the date / time\n * fields.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class CalendarBounds<D> {\n readonly #host: CalendarBoundsHost<D>;\n\n /** Whether the previous-month button should be disabled (bounded by `min`). */\n readonly isPreviousMonthDisabled = computed(() => {\n const min = this.#host.min();\n if (min === null) {\n return false;\n }\n const adapter = this.#host.adapter;\n const previousMonthLastDay = adapter.addDays(this.#host.visibleMonth(), -1);\n return compareDateOf(adapter, previousMonthLastDay, min) < 0;\n });\n\n /** Whether the next-month button should be disabled (bounded by `max`). */\n readonly isNextMonthDisabled = computed(() => {\n const max = this.#host.max();\n if (max === null) {\n return false;\n }\n const adapter = this.#host.adapter;\n const nextMonthFirstDay = adapter.addMonths(this.#host.visibleMonth(), 1);\n return compareDateOf(adapter, nextMonthFirstDay, max) > 0;\n });\n\n constructor(host: CalendarBoundsHost<D>) {\n this.#host = host;\n }\n\n /** Whether every day of `month` (**1-12**) in `year` falls outside `[min, max]`. */\n isMonthOutOfBounds(year: number, month: number): boolean {\n const adapter = this.#host.adapter;\n const firstDay = adapter.createDate(year, month, 1);\n const lastDay = adapter.createDate(year, month, adapter.getDaysInMonth(firstDay));\n return this.#outOfBounds(firstDay, lastDay);\n }\n\n /** Whether every day of `year` falls outside `[min, max]`. */\n isYearDisabled(year: number): boolean {\n const adapter = this.#host.adapter;\n return this.#outOfBounds(adapter.createDate(year, 1, 1), adapter.createDate(year, 12, 31));\n }\n\n /** Whether `date` cannot be selected (`disabled`, out of `[min, max]`, or unavailable). */\n isUnavailable(date: D): boolean {\n if (this.#host.disabled()) {\n return true;\n }\n const adapter = this.#host.adapter;\n const min = this.#host.min();\n if (min !== null && compareDateOf(adapter, date, min) < 0) {\n return true;\n }\n const max = this.#host.max();\n if (max !== null && compareDateOf(adapter, date, max) > 0) {\n return true;\n }\n return this.#host.isDateUnavailable()(date);\n }\n\n /** Whether `date` falls within `[min, max]`, ignoring availability and `disabled`. */\n contains(date: D): boolean {\n return !this.#outOfBounds(date, date);\n }\n\n /** Clamp `date` into `[min, max]`, returning the nearer bound when outside. */\n clamp(date: D): D {\n const adapter = this.#host.adapter;\n return clampToBounds(adapter, date, this.#host.min(), this.#host.max(), (a, b) =>\n compareDateOf(adapter, a, b),\n );\n }\n\n #outOfBounds(firstDay: D, lastDay: D): boolean {\n const adapter = this.#host.adapter;\n const min = this.#host.min();\n if (min !== null && compareDateOf(adapter, lastDay, min) < 0) {\n return true;\n }\n const max = this.#host.max();\n if (max !== null && compareDateOf(adapter, firstDay, max) > 0) {\n return true;\n }\n return false;\n }\n}\n","import { inject, InjectionToken, type Signal } from '@angular/core';\n\nimport {\n assertRootContext,\n orphanContextError,\n type Unset,\n type WritingDirection,\n} from 'forty-cdk/core';\nimport { type DateAdapter } from 'forty-cdk/date-adapter';\n\n/** The active display mode of a `ForCalendar`. */\nexport type CalendarView = 'day' | 'month' | 'year';\n\n/** A selectable year in the year picker grid. */\nexport interface CalendarYearOption {\n /** The full year (e.g. `2026`). */\n readonly value: number;\n /** Whether the entire year falls outside `[min, max]`. */\n readonly disabled: boolean;\n}\n\n/** A row of three months in the month picker grid. */\nexport interface CalendarMonthRow {\n /** Stable key for `@for` tracking. */\n readonly key: string;\n /** The (up to three) month options in this row. */\n readonly months: readonly CalendarMonthOption[];\n}\n\n/** A row of three years in the year picker grid. */\nexport interface CalendarYearRow {\n /** Stable key for `@for` tracking. */\n readonly key: string;\n /** The (up to three) year options in this row. */\n readonly years: readonly CalendarYearOption[];\n}\n\n/**\n * Handle a `ForCalendarMonthCell` registers with the root so the root can move\n * DOM focus to the correct cell during keyboard navigation and view switches.\n */\nexport interface ForCalendarMonthCellHandle {\n /** The `role=\"gridcell\"` host element. */\n readonly host: HTMLElement;\n /** The month this cell represents, **1-12**, or {@link Unset} before its binding is written. */\n readonly month: Signal<number | Unset>;\n}\n\n/**\n * Handle a `ForCalendarYearCell` registers with the root so the root can move\n * DOM focus to the correct cell during keyboard navigation and view switches.\n */\nexport interface ForCalendarYearCellHandle {\n /** The `role=\"gridcell\"` host element. */\n readonly host: HTMLElement;\n /** The year this cell represents, or {@link Unset} before its binding is written. */\n readonly year: Signal<number | Unset>;\n}\n\n/** A selectable month in the visible year, for building a month dropdown. */\nexport interface CalendarMonthOption {\n /** Month number, **1-12**. */\n readonly value: number;\n /** Localized month name via the adapter (e.g. `\"June\"`). */\n readonly label: string;\n /** Whether the whole month falls outside `[min, max]`. */\n readonly disabled: boolean;\n}\n\n/** A weekday column header in the calendar grid. */\nexport interface CalendarWeekday {\n /** Stable key for `@for` tracking (the **0-6** weekday index as a string). */\n readonly key: string;\n /** Narrow label, e.g. `\"M\"`. */\n readonly narrow: string;\n /** Short label, e.g. `\"Mon\"`. */\n readonly short: string;\n /** Long label, e.g. `\"Monday\"`. */\n readonly long: string;\n}\n\n/** A single day cell in the calendar grid. */\nexport interface CalendarDayCell<D> {\n /** Stable key for `@for` tracking (`year-month-day`). */\n readonly key: string;\n /** The date this cell represents. Bind to `[date]` on `[forCalendarCell]`. */\n readonly date: D;\n /** Day-of-month label, e.g. `\"1\"`. The cell's visible content. */\n readonly label: string;\n /**\n * Full accessible date string for the cell, host-bound to `aria-label` by\n * `[forCalendarCell]`. Defaults to the localized full date (e.g.\n * `\"Monday, June 15, 2026\"`); outside-month padding days are suffixed so\n * assistive tech can tell them apart from the visible month. Customize the\n * format with `ForCalendar`'s `dateLabel` input.\n */\n readonly dateLabel: string;\n}\n\n/**\n * Formats the full accessible date string a calendar gridcell exposes as its\n * `aria-label`. Supplied to `ForCalendar`'s `dateLabel` input to override the\n * default localized full date.\n *\n * @typeParam D The adapter's date type.\n * @param date The cell's date.\n * @param context Formatting context: the active {@link DateAdapter}, whether the\n * date falls outside the visible month, and the calendar's `locale` input\n * (`null` = the adapter's own locale) to forward to `adapter.format`.\n */\nexport type CalendarDateLabelFormatter<D> = (\n date: D,\n context: {\n readonly adapter: DateAdapter<D>;\n readonly outsideMonth: boolean;\n readonly locale: string | null;\n },\n) => string;\n\n/** A week row in the calendar grid. */\nexport interface CalendarWeek<D> {\n /** Stable key for `@for` tracking (the first day's `year-month-day`). */\n readonly key: string;\n /** The seven day cells of this week, starting at `firstDayOfWeek`. */\n readonly days: readonly CalendarDayCell<D>[];\n}\n\n/**\n * Handle a `ForCalendarCell` registers with the root so it can move DOM focus\n * to the cell matching a target date after the grid re-renders (e.g. when\n * keyboard navigation crosses a month boundary).\n */\nexport interface ForCalendarCellHandle<D> {\n /** The `role=\"gridcell\"` host element. */\n readonly host: HTMLElement;\n /** The date this cell represents, or {@link Unset} before its binding is written. */\n readonly date: Signal<D | Unset>;\n}\n\n/**\n * Coordination contract owned by `ForCalendar` (the root). Grid, header,\n * cells, heading, and the navigation buttons all derive their state from it\n * and route selection / navigation through it.\n *\n * The token is typed over `unknown`; pieces pass their own `D` into the\n * `unknown`-typed methods (always assignable) and never need the concrete `D`\n * back out.\n *\n * @typeParam D The adapter's date type.\n */\nexport interface ForCalendarContext<D> {\n /** The active date adapter. */\n readonly adapter: DateAdapter<D>;\n /** Resolved writing direction (`'ltr'` / `'rtl'`); flips horizontal arrows. */\n readonly dir: Signal<WritingDirection>;\n /** Whether the whole calendar is disabled (no focus, no selection). */\n readonly disabled: Signal<boolean>;\n /** Whether the calendar is read-only (focusable, but selection is blocked). */\n readonly readonly: Signal<boolean>;\n\n /**\n * Stable id of the heading element, used for the grid's `aria-labelledby`\n * while a `[forCalendarHeading]` is mounted.\n */\n readonly headingId: Signal<string>;\n /** The visible month's accessible label, e.g. `\"June 2026\"`. */\n readonly visibleMonthLabel: Signal<string>;\n /** Weekday column headers for the visible month. */\n readonly weekDays: Signal<readonly CalendarWeekday[]>;\n /** Week rows of the visible month, including outside-month padding days. */\n readonly weeks: Signal<readonly CalendarWeek<D>[]>;\n\n /** Whether the previous-month button should be disabled (bounded by `min`). */\n readonly isPreviousMonthDisabled: Signal<boolean>;\n /** Whether the next-month button should be disabled (bounded by `max`). */\n readonly isNextMonthDisabled: Signal<boolean>;\n\n /** The visible month's full year (e.g. `2026`). */\n readonly visibleYear: Signal<number>;\n /** The visible month, **1-12**. */\n readonly visibleMonthNumber: Signal<number>;\n /** Twelve localized, bounds-aware month options for the visible year. */\n readonly monthOptions: Signal<readonly CalendarMonthOption[]>;\n\n /** Set the visible month to (`year`, `month`) without selecting. `month` is **1-12**. */\n goTo(year: number, month: number): void;\n /** Set the visible month within the current visible year. `month` is **1-12**. */\n goToMonth(month: number): void;\n /** Set the visible year, keeping the current visible month. */\n goToYear(year: number): void;\n /** Whether every day of `month` (**1-12**) in the visible year is out of `[min, max]`. */\n isMonthDisabled(month: number): boolean;\n /** Whether every day of `year` is out of `[min, max]`. */\n isYearDisabled(year: number): boolean;\n\n /** Active calendar view; `'day'` (default), `'month'`, or `'year'`. */\n readonly view: Signal<CalendarView>;\n /** Number of years the year picker shows as an aligned block. Default `12`. */\n readonly yearBlockSize: Signal<number>;\n /** Rows of the month picker grid (3 columns) for the visible year. */\n readonly monthRows: Signal<readonly CalendarMonthRow[]>;\n /** Rows of the year picker grid (3 columns) for the aligned block containing the visible year. */\n readonly yearRows: Signal<readonly CalendarYearRow[]>;\n /**\n * Label of the period the active view shows, on the view trigger and the\n * heading: the month and year in day view, the year in month view, the block\n * of years in year view.\n */\n readonly viewTriggerLabel: Signal<string>;\n /** Whether the prev button should be disabled for the active view. */\n readonly isPreviousDisabled: Signal<boolean>;\n /** Whether the next button should be disabled for the active view. */\n readonly isNextDisabled: Signal<boolean>;\n\n /** Cycle the view one step coarser: `day → month → year`, clamped at `'year'`. */\n cycleView(): void;\n /**\n * Drill into a month (1-12): navigate to it and switch to day view, read-only\n * included. No-op when disabled or out of bounds.\n */\n selectMonth(month: number): void;\n /**\n * Drill into a year: navigate to it and switch to month view, read-only\n * included. No-op when disabled or out of bounds.\n */\n selectYear(year: number): void;\n /** Page backward by one month / year / block depending on the active view. */\n pagePrevious(): void;\n /** Page forward by one month / year / block depending on the active view. */\n pageNext(): void;\n\n /** Whether `month` (1-12) in the visible year is the selected date's month. */\n isMonthSelected(month: number): boolean;\n /** Whether `month` (1-12) is today's month in the visible year. */\n isMonthToday(month: number): boolean;\n /** Whether `month` (1-12) is the roving-tabindex focused month. */\n isMonthFocused(month: number): boolean;\n\n /** Whether `year` is the selected date's year. */\n isYearSelected(year: number): boolean;\n /** Whether `year` is today's year. */\n isYearToday(year: number): boolean;\n /** Whether `year` is the roving-tabindex focused year. */\n isYearFocused(year: number): boolean;\n\n /** Handle a keydown originating on a month cell. */\n handleMonthCellKeydown(event: KeyboardEvent, month: number): void;\n /** Handle a keydown originating on a year cell. */\n handleYearCellKeydown(event: KeyboardEvent, year: number): void;\n\n registerMonthCell(handle: ForCalendarMonthCellHandle): void;\n unregisterMonthCell(handle: ForCalendarMonthCellHandle): void;\n registerYearCell(handle: ForCalendarYearCellHandle): void;\n unregisterYearCell(handle: ForCalendarYearCellHandle): void;\n\n /** Whether `date` is the currently selected value. */\n isSelected(date: D): boolean;\n /** Whether `date` is today. */\n isToday(date: D): boolean;\n /** Whether `date` is the roving-tabindex focused day. */\n isFocused(date: D): boolean;\n /** Whether `date` falls outside the visible month. */\n isOutsideMonth(date: D): boolean;\n /** Whether `date` cannot be selected (`disabled`, out of `min`/`max`, or unavailable). */\n isUnavailable(date: D): boolean;\n /** The full accessible date string for `date`'s gridcell (`aria-label`). */\n getDateLabel(date: D): string;\n\n /**\n * The active selection mode. `'single'` (default) keeps the existing\n * single-date behaviour; `'range'` enables the two-click anchor → commit flow.\n */\n readonly selectionMode: Signal<'single' | 'range'>;\n\n /**\n * Whether `date` is the start of the effective range (committed when idle,\n * preview when a selection is in progress).\n */\n isRangeStart(date: D): boolean;\n\n /**\n * Whether `date` is the end of the effective range (committed when idle,\n * preview when a selection is in progress).\n */\n isRangeEnd(date: D): boolean;\n\n /**\n * Whether `date` falls within the **committed** range, inclusive (idle state\n * only; mutually exclusive with `isRangePreview`).\n */\n isInRange(date: D): boolean;\n\n /**\n * Whether `date` falls within the **preview** band, inclusive (selecting\n * state only; mutually exclusive with `isInRange`).\n */\n isRangePreview(date: D): boolean;\n\n /**\n * Update the pointer-hovered date for the range preview. Ignored in\n * `selectionMode='single'`. Pass `null` on `pointerleave`.\n */\n setHovered(date: D | null): void;\n\n /** Select `date`, unless the calendar is disabled / read-only or the date is unavailable. */\n selectDate(date: D): void;\n /** Page the visible month by `delta` (signed month count). Keeps DOM focus on the caller. */\n pageMonths(delta: number): void;\n /** Resolve and apply a keydown originating on the cell for `fromDate`. */\n handleCellKeydown(event: KeyboardEvent, fromDate: D): void;\n /**\n * Move DOM focus to the roving cell (the gridcell matching the focused date).\n * Returns `false` when no matching cell is currently rendered.\n */\n focusActiveCell(): boolean;\n\n registerCell(handle: ForCalendarCellHandle<D>): void;\n unregisterCell(handle: ForCalendarCellHandle<D>): void;\n /** Adopts a consumer-set static `id` on the heading host into `headingId`. */\n adoptHeadingId(el: HTMLElement): void;\n}\n\n/**\n * The calls only the calendar's own pieces make on the root.\n *\n * @typeParam D The adapter's date type.\n */\nexport interface CalendarPieceContext<D> {\n /**\n * Reported by `[forCalendarCell]` on click. Selects `date`, or, when the\n * selection is refused (read-only, unavailable, a rejected range length),\n * still moves the focused date there so the clicked cell owns the tab stop.\n * A no-op while the calendar is disabled.\n */\n activateDate(date: D): void;\n /**\n * Whether a `[forCalendarHeading]` is mounted. The grids reference\n * {@link ForCalendarContext.headingId} through `aria-labelledby` only while it\n * is, so a calendar without a heading ships no dangling id reference.\n */\n readonly hasHeading: Signal<boolean>;\n /** Reported by `[forCalendarHeading]` at construction. */\n registerHeading(): void;\n /** Reported by `[forCalendarHeading]` when it is destroyed. */\n unregisterHeading(): void;\n}\n\n/**\n * The type the calendar's pieces read {@link FOR_CALENDAR_CONTEXT} at: the\n * {@link ForCalendarContext} read surface plus the {@link CalendarPieceContext}\n * calls.\n *\n * Never exported from `public-api.ts`. `ForCalendar` declares those members\n * TS-`private`, which keeps them out of the emitted `.d.ts` while\n * `useExisting` still satisfies this contract at runtime.\n *\n * @typeParam D The adapter's date type.\n */\nexport interface CalendarContext<D> extends ForCalendarContext<D>, CalendarPieceContext<D> {}\n\n/**\n * Injection token for {@link ForCalendarContext}, provided by `ForCalendar`.\n *\n * Publicly typed as the read surface, which is the whole of what the token\n * promises a consumer. The pieces read the same token at an internal type that\n * adds their own calls, so a wrapper re-providing it must alias it to the root:\n * `{ provide: FOR_CALENDAR_CONTEXT, useExisting: MyCalendar }`, where\n * `MyCalendar` extends `ForCalendar`. A value that merely satisfies the\n * declared type resolves too, and is rejected in dev mode by the first piece to\n * resolve it.\n */\nexport const FOR_CALENDAR_CONTEXT = new InjectionToken<ForCalendarContext<unknown>>(\n 'FOR_CALENDAR_CONTEXT',\n);\n\n/**\n * Injects the nearest calendar context, throwing a descriptive error when used\n * outside a `[forCalendar]` element.\n *\n * @param piece Name of the calling directive, used in the error message.\n */\nexport function injectCalendarContext(piece: string): CalendarContext<unknown> {\n const ctx = inject(FOR_CALENDAR_CONTEXT, { optional: true });\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-CALENDAR-001',\n piece,\n root: '[forCalendar]',\n token: 'FOR_CALENDAR_CONTEXT',\n });\n }\n const widened = ctx as CalendarContext<unknown>;\n assertRootContext({\n entryPoint: 'calendar',\n token: 'FOR_CALENDAR_CONTEXT',\n root: '[forCalendar]',\n piece,\n probe: () => widened.activateDate,\n });\n return widened;\n}\n","import { type DateAdapter } from 'forty-cdk/date-adapter';\n\n/**\n * Builds the day grid for the month containing `monthAnchor`.\n *\n * Returns rows of 7 dates each, starting at `firstDayOfWeek`. Leading and\n * trailing days from the adjacent months are included so every row is full;\n * callers mark them with `data-outside-month`. The number of rows is the\n * minimum needed to cover the month (4-6), so there is no empty trailing week.\n *\n * Pure and adapter-driven: the same `(adapter, anchor, firstDayOfWeek)` always\n * yields the same matrix, and two adapters over the same calendar system\n * produce day-identical grids.\n *\n * @param adapter The date adapter to compute with.\n * @param monthAnchor Any date within the target month.\n * @param firstDayOfWeek First column's day of week, **0-6** (`0` = Sunday).\n */\nexport function buildMonthMatrix<D>(\n adapter: DateAdapter<D>,\n monthAnchor: D,\n firstDayOfWeek: number,\n): D[][] {\n const firstOfMonth = adapter.createDate(\n adapter.getYear(monthAnchor),\n adapter.getMonth(monthAnchor),\n 1,\n );\n const daysInMonth = adapter.getDaysInMonth(firstOfMonth);\n const leading = (adapter.getDayOfWeek(firstOfMonth) - firstDayOfWeek + 7) % 7;\n const numWeeks = Math.ceil((leading + daysInMonth) / 7);\n const gridStart = adapter.addDays(firstOfMonth, -leading);\n\n const weeks: D[][] = [];\n for (let week = 0; week < numWeeks; week++) {\n const row: D[] = [];\n for (let day = 0; day < 7; day++) {\n row.push(adapter.addDays(gridStart, week * 7 + day));\n }\n weeks.push(row);\n }\n return weeks;\n}\n","/**\n * The directional intents a calendar grid keyboard move can express. Each\n * sub-grid (day / month / year) maps these onto its own coordinate space —\n * dates for the day grid, a linear month index for the month grid, a year\n * number for the year grid — so the arrow / `Home` / `End` / `PageUp` /\n * `PageDown` dispatch lives in one place instead of three near-identical\n * `switch` statements.\n */\nexport interface CalendarGridMoves<T> {\n /** Move one column horizontally (signed: `-1` left, `1` right) before RTL mirroring. */\n horizontal(step: -1 | 1): T;\n /** Move one row vertically (signed: `-1` up, `1` down). */\n vertical(step: -1 | 1): T;\n /** Move to the first cell of the current line (`Home`). */\n lineStart(): T;\n /** Move to the last cell of the current line (`End`). */\n lineEnd(): T;\n /** Page backward (`PageUp`); `shiftKey` distinguishes the coarser step where it applies. */\n pageBackward(shiftKey: boolean): T;\n /** Page forward (`PageDown`); `shiftKey` distinguishes the coarser step where it applies. */\n pageForward(shiftKey: boolean): T;\n}\n\n/**\n * Resolve a calendar grid keydown into the target the move lands on, or `null`\n * when the key is not a navigation key. `rtl` mirrors the horizontal arrows.\n * Shared by all three sub-grids via their {@link CalendarGridMoves} mapping.\n */\nexport function resolveCalendarGridMove<T>(\n event: KeyboardEvent,\n rtl: boolean,\n moves: CalendarGridMoves<T>,\n): T | null {\n switch (event.key) {\n case 'ArrowLeft':\n return moves.horizontal(rtl ? 1 : -1);\n case 'ArrowRight':\n return moves.horizontal(rtl ? -1 : 1);\n case 'ArrowUp':\n return moves.vertical(-1);\n case 'ArrowDown':\n return moves.vertical(1);\n case 'Home':\n return moves.lineStart();\n case 'End':\n return moves.lineEnd();\n case 'PageUp':\n return moves.pageBackward(event.shiftKey);\n case 'PageDown':\n return moves.pageForward(event.shiftKey);\n default:\n return null;\n }\n}\n\n/**\n * The first and last value of the row holding `position`, in a grid laying the\n * consecutive values `first` to `last` out `columns` per row. A short last row\n * ends at `last`. Feeds the month and year grids' `Home` / `End`.\n */\nexport function calendarGridRowBounds(\n position: number,\n first: number,\n last: number,\n columns: number,\n): { start: number; end: number } {\n const start = position - ((position - first) % columns);\n return { start, end: Math.min(start + columns - 1, last) };\n}\n\n/** Whether a keydown is the activation key (`Enter` / `Space`) every sub-grid selects on. */\nexport function isCalendarActivationKey(event: KeyboardEvent): boolean {\n return event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar';\n}\n","import { computed } from '@angular/core';\n\nimport { Collection, isUnset } from 'forty-cdk/core';\nimport { type DateAdapter } from 'forty-cdk/date-adapter';\nimport { buildMonthMatrix } from './build-month-matrix';\nimport type { CalendarWeek, CalendarWeekday, ForCalendarCellHandle } from './calendar-context';\nimport { isCalendarActivationKey, resolveCalendarGridMove } from './calendar-keyboard';\nimport type { CalendarViewStrategy } from './calendar-sub-grid';\n\n/**\n * The day grid view's state machine (`view=\"day\"`): the 7-column date table.\n * Owns its cell registry, the rendered `weekDays` / `weeks` data, its\n * table-driven keyboard mover (the date-math counterpart to the month / year\n * movers), the start-of-week helper, and the per-view label / disabled / paging\n * / focus the root composes as a {@link CalendarViewStrategy}.\n *\n * Constructed directly by the root (`new CalendarDayNavigator(host)`); it\n * injects nothing of its own, mirroring how `SegmentEditor` is lifted out of the\n * date / time fields, but its cell `Collection` takes the ambient `DestroyRef`,\n * so the root builds it from a field initializer. The intended-day, clamp, and\n * announce machinery stays a single source of truth on the root, reached\n * through {@link CalendarDayNavigatorHost}.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class CalendarDayNavigator<D> implements CalendarViewStrategy {\n readonly #host: CalendarDayNavigatorHost<D>;\n readonly #cells = new Collection<ForCalendarCellHandle<D>>();\n\n readonly #matrix = computed(() =>\n buildMonthMatrix(this.#host.adapter, this.#host.visibleMonth(), this.#host.firstDayOfWeek()),\n );\n\n /** Weekday column headers for the visible month, starting at `firstDayOfWeek`. */\n readonly weekDays = computed<readonly CalendarWeekday[]>(() => {\n const adapter = this.#host.adapter;\n const firstDay = this.#host.firstDayOfWeek();\n const locale = this.#host.locale() ?? undefined;\n return this.#matrix()[0]!.map((date, index) => ({\n key: String((firstDay + index) % 7),\n narrow: adapter.format(date, { weekday: 'narrow' }, locale),\n short: adapter.format(date, { weekday: 'short' }, locale),\n long: adapter.format(date, { weekday: 'long' }, locale),\n }));\n });\n\n /** Week rows of the visible month, including outside-month padding days. */\n readonly weeks = computed<readonly CalendarWeek<D>[]>(() => {\n const adapter = this.#host.adapter;\n return this.#matrix().map((row) => ({\n key: this.#dateKey(row[0]!),\n days: row.map((date) => ({\n key: this.#dateKey(date),\n date,\n label: String(adapter.getDate(date)),\n dateLabel: this.#host.getDateLabel(date),\n })),\n }));\n });\n\n constructor(host: CalendarDayNavigatorHost<D>) {\n this.#host = host;\n }\n\n triggerLabel(): string {\n return this.#host.visibleMonthLabel();\n }\n\n isPreviousDisabled(): boolean {\n return this.#host.isPreviousMonthDisabled();\n }\n\n isNextDisabled(): boolean {\n return this.#host.isNextMonthDisabled();\n }\n\n page(direction: -1 | 1): void {\n this.#host.pageMonths(direction);\n }\n\n focusActive(): boolean {\n return this.focusCell(this.#host.focusedDate());\n }\n\n handleKeydown(event: KeyboardEvent, fromDate: D): void {\n if (isCalendarActivationKey(event)) {\n event.preventDefault();\n this.#host.selectDate(fromDate);\n return;\n }\n const target = this.#resolveMove(event, fromDate);\n if (target === null) {\n return;\n }\n event.preventDefault();\n const isPaging = event.key === 'PageUp' || event.key === 'PageDown';\n this.#host.applyDayKeyMove(target, isPaging);\n }\n\n register(handle: ForCalendarCellHandle<D>): void {\n this.#cells.register(handle);\n }\n\n unregister(handle: ForCalendarCellHandle<D>): void {\n this.#cells.unregister(handle);\n }\n\n focusCell(target: D): boolean {\n const adapter = this.#host.adapter;\n const handle = this.#cells.items().find((cell) => {\n const date = cell.date();\n return !isUnset(date) && adapter.isSameDay(date, target);\n });\n if (!handle) {\n return false;\n }\n handle.host.focus();\n return true;\n }\n\n #resolveMove(event: KeyboardEvent, fromDate: D): D | null {\n const adapter = this.#host.adapter;\n return resolveCalendarGridMove<D>(event, this.#host.dir() === 'rtl', {\n horizontal: (step) => adapter.addDays(fromDate, step),\n vertical: (step) => adapter.addDays(fromDate, step * 7),\n lineStart: () => this.#startOfWeek(fromDate),\n lineEnd: () => adapter.addDays(this.#startOfWeek(fromDate), 6),\n pageBackward: (shiftKey) =>\n shiftKey ? adapter.addYears(fromDate, -1) : adapter.addMonths(fromDate, -1),\n pageForward: (shiftKey) =>\n shiftKey ? adapter.addYears(fromDate, 1) : adapter.addMonths(fromDate, 1),\n });\n }\n\n #startOfWeek(date: D): D {\n const adapter = this.#host.adapter;\n const offset = (adapter.getDayOfWeek(date) - this.#host.firstDayOfWeek() + 7) % 7;\n return adapter.addDays(date, -offset);\n }\n\n #dateKey(date: D): string {\n const adapter = this.#host.adapter;\n return `${adapter.getYear(date)}-${adapter.getMonth(date)}-${adapter.getDate(date)}`;\n }\n}\n\n/**\n * Root surface the {@link CalendarDayNavigator} reads / delegates to: the\n * adapter, direction, visible-month label / bounds, the resolved first day of\n * week, and the navigation primitives (`selectDate`, `pageMonths`, the combined\n * key-move applier) the day grid hands back to the root so the intended-day /\n * clamp / announce logic stays in one place.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport interface CalendarDayNavigatorHost<D> {\n /** The active date adapter. */\n readonly adapter: DateAdapter<D>;\n /** Resolved writing direction; `'rtl'` mirrors the horizontal arrows. */\n readonly dir: () => 'ltr' | 'rtl';\n /** The formatting locale (`null` = runtime default), forwarded to `adapter.format`. */\n readonly locale: () => string | null;\n /** The roving focused date (the day grid's tab stop). */\n readonly focusedDate: () => D;\n /** First day of the visible month, driving the rendered matrix. */\n readonly visibleMonth: () => D;\n /** The visible month's accessible label, e.g. `\"June 2026\"`. */\n readonly visibleMonthLabel: () => string;\n /** Resolved first day of the week (**0-6**). */\n readonly firstDayOfWeek: () => number;\n /** Whether the previous-month button should be disabled. */\n readonly isPreviousMonthDisabled: () => boolean;\n /** Whether the next-month button should be disabled. */\n readonly isNextMonthDisabled: () => boolean;\n /** The full accessible date string for `date`'s gridcell (`aria-label`). */\n getDateLabel(date: D): string;\n /** Select `date`, unless disabled / read-only / unavailable. */\n selectDate(date: D): void;\n /** Page the visible month by `delta`, keeping DOM focus on the caller. */\n pageMonths(delta: number): void;\n /**\n * Apply a resolved day keyboard move: a paging move re-applies the intended\n * day and clamps; a plain move records the new focus origin. Both move focus\n * and announce a month change.\n */\n applyDayKeyMove(target: D, isPaging: boolean): void;\n}\n","import { Collection } from 'forty-cdk/core';\nimport type {\n CalendarMonthOption,\n CalendarMonthRow,\n ForCalendarMonthCellHandle,\n} from './calendar-context';\nimport {\n calendarGridRowBounds,\n isCalendarActivationKey,\n resolveCalendarGridMove,\n} from './calendar-keyboard';\nimport type { CalendarSubGridHost, CalendarViewStrategy } from './calendar-sub-grid';\n\nconst GRID_COLUMNS = 3;\n\n/**\n * The month picker view's state machine (`view=\"month\"`): a 3-column grid of the\n * twelve months of the visible year. Owns its cell registry, its `is*` quartet\n * (selected / today / focused / disabled), its table-driven keyboard mover, and\n * the per-view paging / focus the root composes as a {@link CalendarViewStrategy}.\n *\n * Constructed directly by the root (`new CalendarMonthNavigator(host)`); it\n * injects nothing of its own, mirroring how `SegmentEditor` is lifted out of the\n * date / time fields, but its cell `Collection` takes the ambient `DestroyRef`,\n * so the root builds it from a field initializer.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class CalendarMonthNavigator<D> implements CalendarViewStrategy {\n readonly #host: CalendarMonthNavigatorHost<D>;\n readonly #cells = new Collection<ForCalendarMonthCellHandle>();\n\n constructor(host: CalendarMonthNavigatorHost<D>) {\n this.#host = host;\n }\n\n /** Twelve localized, bounds-aware month options for the visible year. */\n options(): readonly CalendarMonthOption[] {\n const adapter = this.#host.adapter;\n const year = this.#host.visibleYear();\n const locale = this.#host.locale() ?? undefined;\n const options: CalendarMonthOption[] = [];\n for (let month = 1; month <= 12; month++) {\n options.push({\n value: month,\n label: adapter.format(adapter.createDate(year, month, 1), { month: 'long' }, locale),\n disabled: this.#host.isMonthOutOfBounds(year, month),\n });\n }\n return options;\n }\n\n /** Rows of the month picker grid (3 columns) for the visible year. */\n rows(): readonly CalendarMonthRow[] {\n const options = this.options();\n const rows: CalendarMonthRow[] = [];\n for (let i = 0; i < options.length; i += GRID_COLUMNS) {\n rows.push({ key: `m-${i}`, months: options.slice(i, i + GRID_COLUMNS) });\n }\n return rows;\n }\n\n triggerLabel(): string {\n return String(this.#host.visibleYear());\n }\n\n isPreviousDisabled(): boolean {\n return this.#host.isYearDisabled(this.#host.visibleYear() - 1);\n }\n\n isNextDisabled(): boolean {\n return this.#host.isYearDisabled(this.#host.visibleYear() + 1);\n }\n\n page(direction: -1 | 1): void {\n this.#host.pageByYears(direction);\n }\n\n focusActive(): boolean {\n return this.focusCell(this.#host.visibleMonthNumber());\n }\n\n isSelected(month: number): boolean {\n const adapter = this.#host.adapter;\n const value = this.#host.value();\n return (\n value !== null &&\n adapter.getYear(value) === this.#host.visibleYear() &&\n adapter.getMonth(value) === month\n );\n }\n\n isToday(month: number): boolean {\n const adapter = this.#host.adapter;\n const today = this.#host.today();\n return adapter.getYear(today) === this.#host.visibleYear() && adapter.getMonth(today) === month;\n }\n\n isFocused(month: number): boolean {\n return month === this.#host.visibleMonthNumber();\n }\n\n handleKeydown(event: KeyboardEvent, fromMonth: number): void {\n if (isCalendarActivationKey(event)) {\n event.preventDefault();\n this.#host.selectMonth(fromMonth);\n return;\n }\n const target = this.#resolveMove(event, fromMonth);\n if (target === null) {\n return;\n }\n event.preventDefault();\n this.#host.moveFocusedDate(this.#host.dateInMonth(target.year, target.month));\n this.#host.scheduleFocus(() => this.focusCell(this.#host.visibleMonthNumber()));\n }\n\n register(handle: ForCalendarMonthCellHandle): void {\n this.#cells.register(handle);\n }\n\n unregister(handle: ForCalendarMonthCellHandle): void {\n this.#cells.unregister(handle);\n }\n\n focusCell(month: number): boolean {\n const handle = this.#cells.items().find((cell) => cell.month() === month);\n if (!handle) {\n return false;\n }\n handle.host.focus();\n return true;\n }\n\n #resolveMove(event: KeyboardEvent, fromMonth: number): { year: number; month: number } | null {\n const year = this.#host.visibleYear();\n const base = year * 12 + (fromMonth - 1);\n const row = calendarGridRowBounds(base, year * 12, year * 12 + 11, GRID_COLUMNS);\n const index = resolveCalendarGridMove<number>(event, this.#host.dir() === 'rtl', {\n horizontal: (step) => base + step,\n vertical: (step) => base + step * GRID_COLUMNS,\n lineStart: () => row.start,\n lineEnd: () => row.end,\n pageBackward: () => base - 12,\n pageForward: () => base + 12,\n });\n if (index === null) {\n return null;\n }\n return { year: Math.floor(index / 12), month: (index % 12) + 1 };\n }\n}\n\n/**\n * Root surface the {@link CalendarMonthNavigator} reads / delegates to beyond\n * {@link CalendarSubGridHost}: the selected value plus the navigation and focus\n * primitives the grid hands back to the root.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport interface CalendarMonthNavigatorHost<D> extends CalendarSubGridHost<D> {\n /** The selected value, or `null`. */\n readonly value: () => D | null;\n /** Whether every day of `month` (**1-12**) in `year` falls outside `[min, max]`. */\n isMonthOutOfBounds(year: number, month: number): boolean;\n /** Drill into a month (1-12): navigate to it and switch to day view. */\n selectMonth(month: number): void;\n /** Page the visible year by `step`, re-applying the intended day and clamping. */\n pageByYears(step: number): void;\n /**\n * Move the roving focused date to `date`, clamped into `[min, max]`, announcing\n * the new period when the active view's period changes.\n */\n moveFocusedDate(date: D): void;\n /** A date in (`year`, `month`) keeping the focused day clamped to the month length. */\n dateInMonth(year: number, month: number): D;\n /** Schedule `fn` to run after the next render (for post-re-render focus moves). */\n scheduleFocus(fn: () => void): void;\n}\n","import { type DateAdapter } from 'forty-cdk/date-adapter';\n\n/**\n * Tracks the day-of-month the user is conceptually navigating with so paging\n * across months restores the original day when landing on a longer month,\n * instead of cumulatively drifting back through a chain of short months.\n *\n * It also records the focused date each paging operation produced, letting the\n * root detect a focus that moved for any other reason (explicit day move,\n * selection, an external `value` write driving the `focusedDate` linkedSignal)\n * and reset the intended day to the new day — all without an `effect`.\n *\n * Constructed directly (`new IntendedDayCursor(adapter, seed)`); it holds no\n * injection context, mirroring how `SegmentEditor` is lifted out of the date /\n * time fields.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class IntendedDayCursor<D> {\n readonly #adapter: DateAdapter<D>;\n #intendedDay: number;\n #pagedFocus: D | null = null;\n\n constructor(adapter: DateAdapter<D>, seed: D) {\n this.#adapter = adapter;\n this.#intendedDay = adapter.getDate(seed);\n }\n\n /** Record `date` as the focus origin for a non-paging move and reset the intended day. */\n setFocusedDay(date: D): void {\n this.#intendedDay = this.#adapter.getDate(date);\n this.#pagedFocus = null;\n }\n\n /**\n * Re-sync the intended day to `focused`'s actual day unless the focus is still\n * where the last paging operation left it. Anything that moved the focus for\n * another reason resets the intended day so a fresh paging run starts from the\n * day the user can see.\n */\n sync(focused: D): void {\n if (this.#pagedFocus === null || !this.#adapter.isSameDay(this.#pagedFocus, focused)) {\n this.#intendedDay = this.#adapter.getDate(focused);\n }\n }\n\n /**\n * Re-derive `date` so its day-of-month matches the user's intended day,\n * clamped to the target month's length. Restores e.g. the 31st when a paging\n * chain lands back on a 31-day month, instead of carrying forward the day a\n * shorter intermediate month clamped it to.\n */\n apply(date: D): D {\n const adapter = this.#adapter;\n const daysInMonth = adapter.getDaysInMonth(date);\n const day = this.#intendedDay < daysInMonth ? this.#intendedDay : daysInMonth;\n return adapter.createDate(adapter.getYear(date), adapter.getMonth(date), day);\n }\n\n /** Mark `date` as the focused date the last paging operation produced. */\n markPaged(date: D): void {\n this.#pagedFocus = date;\n }\n}\n","import type { Signal, WritableSignal } from '@angular/core';\n\nimport { type DateAdapter } from 'forty-cdk/date-adapter';\nimport type { CalendarBounds } from './calendar-bounds';\nimport type { CalendarRangeSelection } from './calendar-range-selection';\nimport { IntendedDayCursor } from './intended-day-cursor';\n\n/**\n * The reactive root surface the {@link CalendarNavigation} engine reads from and\n * writes back into. The engine owns the focus-origin cursor and every move that\n * re-derives the focused date (selection, paging, direct go-to, keyboard moves);\n * the host supplies the writable focused date / value, the visible-month\n * derivations, the shared bounds / range collaborators, and the imperative\n * effects (announce, schedule a post-render focus move, move DOM focus to a day\n * cell).\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport interface CalendarNavigationHost<D> {\n /** The active date adapter. */\n readonly adapter: DateAdapter<D>;\n /** Whether the whole calendar is disabled. */\n readonly disabled: Signal<boolean>;\n /** Whether the calendar is read-only. */\n readonly readonly: Signal<boolean>;\n /** Whether range selection is active. */\n readonly selectionMode: Signal<'single' | 'range'>;\n /** The roving focused date (read + written). */\n readonly focusedDate: WritableSignal<D>;\n /** The selected value (read + written in single mode). */\n readonly value: WritableSignal<D | null>;\n /**\n * The label of the period the active view shows: the month and year in day\n * view, the year in month view, the block of years in year view.\n */\n readonly periodLabel: () => string;\n /** The visible month's full year. */\n readonly visibleYear: () => number;\n /** The visible month, **1-12**. */\n readonly visibleMonthNumber: () => number;\n /** The `[min, max]` bounds collaborator. */\n readonly bounds: CalendarBounds<D>;\n /** The range-selection collaborator. */\n readonly range: CalendarRangeSelection<D>;\n /** Announce `label` politely (used when a navigation changes the active view's period). */\n announce(label: string): void;\n /** Schedule `fn` to run after the next render. */\n scheduleFocus(fn: () => void): void;\n /** Move DOM focus to the day cell matching `target`, after the next render. */\n focusDayCell(target: D): void;\n}\n\n/**\n * The shared navigation / selection engine for `ForCalendar`: it owns the\n * {@link IntendedDayCursor} and every focused-date move — single / range\n * selection, month / year paging, direct `goTo`, and the resolved day keyboard\n * move — keeping the intended-day, clamp, and announce machinery in one place\n * instead of scattered across the root and the sub-grids. Every move of the\n * focused date also drops a pointer hover from the range preview cursor, so the\n * preview follows the device that moved last.\n *\n * Constructed directly (`new CalendarNavigation(host, seed)`); it holds no\n * injection context, mirroring how `SegmentEditor` is lifted out of the date /\n * time fields.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class CalendarNavigation<D> {\n readonly #host: CalendarNavigationHost<D>;\n readonly #cursor: IntendedDayCursor<D>;\n\n constructor(host: CalendarNavigationHost<D>, seed: D) {\n this.#host = host;\n this.#cursor = new IntendedDayCursor<D>(host.adapter, seed);\n }\n\n /** Select `date`, unless the calendar is disabled / read-only or the date is unavailable. */\n selectDate(date: D): void {\n this.#select(date);\n }\n\n /**\n * Apply a pointer activation of the day cell for `date`: select it, or, when\n * the selection is refused, still move the focused date there so the clicked\n * cell owns the tab stop. A no-op while the calendar is disabled.\n */\n activateDate(date: D): void {\n if (this.#host.disabled() || this.#select(date)) {\n return;\n }\n this.#cursor.setFocusedDay(date);\n this.#setFocusedDate(date);\n this.#host.focusDayCell(date);\n }\n\n /** Page the visible month by `delta` (signed month count). Keeps DOM focus on the caller. */\n pageMonths(delta: number): void {\n if (this.#host.disabled()) {\n return;\n }\n this.#pageTo(this.#host.adapter.addMonths(this.#host.focusedDate(), delta));\n }\n\n /**\n * Page the visible year by `step` (signed) — the shared month / year-view\n * paging path. Reached only from the disabled-guarded `pagePrevious` /\n * `pageNext`, so it carries no guard of its own. Keeps DOM focus on the caller.\n */\n pageByYears(step: number): void {\n this.#pageTo(this.#host.adapter.addYears(this.#host.focusedDate(), step));\n }\n\n /**\n * Set the visible month to (`year`, `month`, **1-12**) without selecting,\n * re-applying the intended day, clamping, and announcing a change of the\n * active view's period. A no-op while disabled.\n */\n goTo(year: number, month: number): void {\n if (this.#host.disabled()) {\n return;\n }\n this.#pageTo(this.#host.adapter.createDate(year, month, 1));\n }\n\n /** Apply a resolved day keyboard move: paging re-applies the intended day; a plain move records the origin. */\n applyDayKeyMove(target: D, isPaging: boolean): void {\n const previousPeriod = this.#host.periodLabel();\n let next: D;\n if (isPaging) {\n this.#cursor.sync(this.#host.focusedDate());\n next = this.#host.bounds.clamp(this.#cursor.apply(target));\n this.#cursor.markPaged(next);\n } else {\n next = this.#host.bounds.clamp(target);\n this.#cursor.setFocusedDay(next);\n }\n this.#setFocusedDate(next);\n this.#host.focusDayCell(next);\n this.#announcePeriodChange(previousPeriod);\n }\n\n /**\n * Apply a resolved month / year grid keyboard move: clamp `target` into\n * bounds, make it the focused date, and announce a change of the active\n * view's period.\n */\n moveFocusedDate(target: D): void {\n const previousPeriod = this.#host.periodLabel();\n this.#setFocusedDate(this.#host.bounds.clamp(target));\n this.#announcePeriodChange(previousPeriod);\n }\n\n /** A date in (`year`, `month`) keeping the focused day clamped to the month length. */\n dateInMonth(year: number, month: number): D {\n const adapter = this.#host.adapter;\n const daysInMonth = adapter.getDaysInMonth(adapter.createDate(year, month, 1));\n const day = Math.min(adapter.getDate(this.#host.focusedDate()), daysInMonth);\n return adapter.createDate(year, month, day);\n }\n\n #select(date: D): boolean {\n if (this.#host.disabled() || this.#host.readonly() || this.#host.bounds.isUnavailable(date)) {\n return false;\n }\n if (this.#host.selectionMode() === 'range') {\n if (!this.#host.range.select(date)) {\n return false;\n }\n this.#cursor.setFocusedDay(date);\n this.#setFocusedDate(date);\n this.#host.focusDayCell(date);\n return true;\n }\n this.#cursor.setFocusedDay(date);\n this.#host.value.set(this.#withPreservedTime(date));\n this.#host.focusDayCell(date);\n return true;\n }\n\n #setFocusedDate(next: D): void {\n this.#host.range.clearHover();\n this.#host.focusedDate.set(next);\n }\n\n #pageTo(target: D): void {\n const previousPeriod = this.#host.periodLabel();\n this.#cursor.sync(this.#host.focusedDate());\n const next = this.#host.bounds.clamp(this.#cursor.apply(target));\n this.#setFocusedDate(next);\n this.#cursor.markPaged(next);\n this.#announcePeriodChange(previousPeriod);\n }\n\n #announcePeriodChange(previousPeriod: string): void {\n const period = this.#host.periodLabel();\n if (period !== previousPeriod) {\n this.#host.announce(period);\n }\n }\n\n #withPreservedTime(date: D): D {\n const adapter = this.#host.adapter;\n const current = this.#host.value();\n if (\n current === null ||\n adapter.supportsTime?.() !== true ||\n !adapter.getHours ||\n !adapter.getMinutes ||\n !adapter.getSeconds ||\n !adapter.setTime\n ) {\n return date;\n }\n return adapter.setTime(\n date,\n adapter.getHours(current),\n adapter.getMinutes(current),\n adapter.getSeconds(current),\n );\n }\n}\n","import { computed, signal, type Signal, type WritableSignal } from '@angular/core';\n\nimport { compareDateOf, type DateRange } from 'forty-cdk/core';\nimport { type DateAdapter } from 'forty-cdk/date-adapter';\n\n/**\n * The reactive surface a `ForCalendar` root supplies to its\n * {@link CalendarRangeSelection}. The range machine owns the anchor / hover /\n * effective-range state and the `isRange*` predicates; the host supplies the\n * adapter, the live focused date (the preview cursor when no pointer hover is\n * active), the committed range model, and the configured bounds.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport interface CalendarRangeHost<D> {\n /** The active date adapter. */\n readonly adapter: DateAdapter<D>;\n /** The roving focused date, used as the preview cursor on keyboard navigation. */\n readonly focusedDate: () => D;\n /** The committed range model (read for idle state, written on commit). */\n readonly range: WritableSignal<DateRange<D> | null>;\n /** Whether range selection is active (`selectionMode === 'range'`). */\n readonly active: Signal<boolean>;\n /** Minimum inclusive day count for a committed range, or `null` for no minimum. */\n readonly minRangeLength: Signal<number | null>;\n /** Maximum inclusive day count for a committed range, or `null` for no maximum. */\n readonly maxRangeLength: Signal<number | null>;\n}\n\n/**\n * Owns the two-click anchor → commit range-selection state machine for\n * `ForCalendar` in `selectionMode=\"range\"`: the pending `anchor`, the pointer\n * `hovered` cursor, the derived `effectiveRange` (committed when idle, preview\n * while selecting), and the `isRangeStart` / `isRangeEnd` / `isInRange` /\n * `isRangePreview` predicates the day cells reflect as `data-*`.\n *\n * Constructed directly (`new CalendarRangeSelection(host)`); it holds no\n * injection context, mirroring how `SegmentEditor` is lifted out of the date /\n * time fields. The root keeps the focus orchestration around a click and only\n * delegates the range bookkeeping here.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class CalendarRangeSelection<D> {\n readonly #host: CalendarRangeHost<D>;\n readonly #anchor = signal<D | null>(null);\n readonly #hovered = signal<D | null>(null);\n\n readonly #effectiveRange = computed<{ start: D; end: D; preview: boolean } | null>(() => {\n const adapter = this.#host.adapter;\n const anchor = this.#anchor();\n if (anchor !== null) {\n const cursor = this.#hovered() ?? this.#host.focusedDate();\n const cmp = compareDateOf(adapter, cursor, anchor);\n const [start, end] = cmp < 0 ? [cursor, anchor] : [anchor, cursor];\n return { start, end, preview: true };\n }\n const committed = this.#host.range();\n return committed === null\n ? null\n : { start: committed.start, end: committed.end, preview: false };\n });\n\n constructor(host: CalendarRangeHost<D>) {\n this.#host = host;\n }\n\n isRangeStart(date: D): boolean {\n const er = this.#effectiveRange();\n return er !== null && this.#host.adapter.isSameDay(date, er.start);\n }\n\n isRangeEnd(date: D): boolean {\n const er = this.#effectiveRange();\n return er !== null && this.#host.adapter.isSameDay(date, er.end);\n }\n\n isInRange(date: D): boolean {\n const er = this.#effectiveRange();\n return er !== null && !er.preview && this.#withinInclusive(date, er);\n }\n\n isRangePreview(date: D): boolean {\n const er = this.#effectiveRange();\n return er !== null && er.preview && this.#withinInclusive(date, er);\n }\n\n /** Whether `date` is within the effective range, used by the day cell's `isSelected`. */\n contains(date: D): boolean {\n const er = this.#effectiveRange();\n return er !== null && !er.preview && this.#withinInclusive(date, er);\n }\n\n setHovered(date: D | null): void {\n if (!this.#host.active()) {\n return;\n }\n this.#hovered.set(date);\n }\n\n /** Drop the pointer's claim on the preview cursor, so it follows the focused date again. */\n clearHover(): void {\n this.#hovered.set(null);\n }\n\n /**\n * Apply a click on `date` to the anchor → commit flow. The first click sets\n * the anchor and leaves the committed range untouched until the second click\n * replaces it; the second commits the range in **either direction** — clicking\n * before the anchor commits the inverted band `[date, anchor]` (honouring the\n * hover preview) rather than starting over. Returns `true` when the click moved\n * the selection (so the root should move focus to `date`), `false` when it was\n * rejected by the min / max length guard (anchor preserved, no focus move).\n */\n select(date: D): boolean {\n const adapter = this.#host.adapter;\n const anchor = this.#anchor();\n if (anchor === null) {\n this.#anchor.set(date);\n return true;\n }\n const [start, end] = compareDateOf(adapter, date, anchor) < 0 ? [date, anchor] : [anchor, date];\n if (!this.#rangeLengthSatisfied(start, end)) {\n return false;\n }\n this.#host.range.set({ start, end });\n this.#anchor.set(null);\n return true;\n }\n\n #rangeLengthSatisfied(start: D, end: D): boolean {\n const adapter = this.#host.adapter;\n const minLen = this.#host.minRangeLength();\n const maxLen = this.#host.maxRangeLength();\n if (minLen === null && maxLen === null) {\n return true;\n }\n let len = 1;\n let cursor = start;\n while (compareDateOf(adapter, cursor, end) < 0) {\n cursor = adapter.addDays(cursor, 1);\n len++;\n if (maxLen !== null && len > maxLen) {\n return false;\n }\n }\n if (minLen !== null && len < minLen) {\n return false;\n }\n return true;\n }\n\n #withinInclusive(date: D, range: { start: D; end: D }): boolean {\n const adapter = this.#host.adapter;\n return (\n compareDateOf(adapter, date, range.start) >= 0 && compareDateOf(adapter, date, range.end) <= 0\n );\n }\n}\n","import { Collection } from 'forty-cdk/core';\nimport type {\n CalendarYearOption,\n CalendarYearRow,\n ForCalendarYearCellHandle,\n} from './calendar-context';\nimport {\n calendarGridRowBounds,\n isCalendarActivationKey,\n resolveCalendarGridMove,\n} from './calendar-keyboard';\nimport type { CalendarSubGridHost, CalendarViewStrategy } from './calendar-sub-grid';\n\nconst GRID_COLUMNS = 3;\n\n/**\n * The year picker view's state machine (`view=\"year\"`): a 3-column grid of an\n * aligned block of `yearBlockSize` years. Owns its cell registry, its `is*`\n * quartet (selected / today / focused / disabled), its table-driven keyboard\n * mover, and the per-view paging / focus the root composes as a\n * {@link CalendarViewStrategy}.\n *\n * Constructed directly by the root (`new CalendarYearNavigator(host)`); it\n * injects nothing of its own, mirroring how `SegmentEditor` is lifted out of the\n * date / time fields, but its cell `Collection` takes the ambient `DestroyRef`,\n * so the root builds it from a field initializer.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport class CalendarYearNavigator<D> implements CalendarViewStrategy {\n readonly #host: CalendarYearNavigatorHost<D>;\n readonly #cells = new Collection<ForCalendarYearCellHandle>();\n\n constructor(host: CalendarYearNavigatorHost<D>) {\n this.#host = host;\n }\n\n /** Rows of the year picker grid (3 columns) for the aligned block containing the visible year. */\n rows(): readonly CalendarYearRow[] {\n const start = this.#host.yearBlockStart();\n const size = this.#host.yearBlockSize();\n const years: CalendarYearOption[] = [];\n for (let i = 0; i < size; i++) {\n const value = start + i;\n years.push({ value, disabled: this.#host.isYearDisabled(value) });\n }\n const rows: CalendarYearRow[] = [];\n for (let i = 0; i < years.length; i += GRID_COLUMNS) {\n rows.push({ key: `y-${i}`, years: years.slice(i, i + GRID_COLUMNS) });\n }\n return rows;\n }\n\n triggerLabel(): string {\n const start = this.#host.yearBlockStart();\n return `${start} – ${start + this.#host.yearBlockSize() - 1}`;\n }\n\n isPreviousDisabled(): boolean {\n return this.#host.isYearDisabled(this.#host.yearBlockStart() - 1);\n }\n\n isNextDisabled(): boolean {\n return this.#host.isYearDisabled(this.#host.yearBlockStart() + this.#host.yearBlockSize());\n }\n\n page(direction: -1 | 1): void {\n this.#host.pageByYears(direction * this.#host.yearBlockSize());\n }\n\n focusActive(): boolean {\n return this.focusCell(this.#host.visibleYear());\n }\n\n isSelected(year: number): boolean {\n const value = this.#host.value();\n return value !== null && this.#host.adapter.getYear(value) === year;\n }\n\n isToday(year: number): boolean {\n return this.#host.adapter.getYear(this.#host.today()) === year;\n }\n\n isFocused(year: number): boolean {\n return year === this.#host.visibleYear();\n }\n\n handleKeydown(event: KeyboardEvent, fromYear: number): void {\n if (isCalendarActivationKey(event)) {\n event.preventDefault();\n this.#host.selectYear(fromYear);\n return;\n }\n const target = this.#resolveMove(event, fromYear);\n if (target === null) {\n return;\n }\n event.preventDefault();\n this.#host.moveFocusedDate(this.#host.dateInMonth(target, this.#host.visibleMonthNumber()));\n this.#host.scheduleFocus(() => this.focusCell(this.#host.visibleYear()));\n }\n\n register(handle: ForCalendarYearCellHandle): void {\n this.#cells.register(handle);\n }\n\n unregister(handle: ForCalendarYearCellHandle): void {\n this.#cells.unregister(handle);\n }\n\n focusCell(year: number): boolean {\n const handle = this.#cells.items().find((cell) => cell.year() === year);\n if (!handle) {\n return false;\n }\n handle.host.focus();\n return true;\n }\n\n #resolveMove(event: KeyboardEvent, fromYear: number): number | null {\n const size = this.#host.yearBlockSize();\n const start = this.#host.yearBlockStart();\n const row = calendarGridRowBounds(fromYear, start, start + size - 1, GRID_COLUMNS);\n return resolveCalendarGridMove<number>(event, this.#host.dir() === 'rtl', {\n horizontal: (step) => fromYear + step,\n vertical: (step) => fromYear + step * GRID_COLUMNS,\n lineStart: () => row.start,\n lineEnd: () => row.end,\n pageBackward: () => fromYear - size,\n pageForward: () => fromYear + size,\n });\n }\n}\n\n/**\n * Root surface the {@link CalendarYearNavigator} reads / delegates to beyond\n * {@link CalendarSubGridHost}: the selected value plus the navigation and focus\n * primitives the grid hands back to the root.\n *\n * @typeParam D The adapter's immutable date type.\n */\nexport interface CalendarYearNavigatorHost<D> extends CalendarSubGridHost<D> {\n /** The selected value, or `null`. */\n readonly value: () => D | null;\n /** Drill into a year: navigate to it and switch to month view. */\n selectYear(year: number): void;\n /** Page the visible year by `step`, re-applying the intended day and clamping. */\n pageByYears(step: number): void;\n /**\n * Move the roving focused date to `date`, clamped into `[min, max]`, announcing\n * the new period when the active view's period changes.\n */\n moveFocusedDate(date: D): void;\n /** A date in (`year`, `month`) keeping the focused day clamped to the month length. */\n dateInMonth(year: number, month: number): D;\n /** Schedule `fn` to run after the next render (for post-re-render focus moves). */\n scheduleFocus(fn: () => void): void;\n}\n","import {\n afterNextRender,\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n Injector,\n input,\n linkedSignal,\n model,\n numberAttribute,\n signal,\n type WritableSignal,\n} from '@angular/core';\n\nimport {\n type DateRange,\n injectDateAdapter,\n adoptHostId,\n FOR_PICKER_SOURCE_HOST,\n IdGenerator,\n LiveAnnouncer,\n type WritingDirection,\n injectTextDirection,\n} from 'forty-cdk/core';\nimport { type DateAdapter } from 'forty-cdk/date-adapter';\nimport { CalendarBounds } from './calendar-bounds';\nimport {\n type CalendarDateLabelFormatter,\n type CalendarMonthOption,\n type CalendarMonthRow,\n type CalendarView,\n type CalendarYearRow,\n FOR_CALENDAR_CONTEXT,\n type ForCalendarCellHandle,\n type ForCalendarContext,\n type ForCalendarMonthCellHandle,\n type ForCalendarYearCellHandle,\n} from './calendar-context';\nimport { CalendarDayNavigator } from './calendar-day-navigator';\nimport { FOR_CALENDAR_DEFAULTS } from 'forty-cdk/defaults';\nimport { CalendarMonthNavigator } from './calendar-month-navigator';\nimport { CalendarNavigation } from './calendar-navigation';\nimport { CalendarRangeSelection } from './calendar-range-selection';\nimport type { CalendarSubGridHost, CalendarViewStrategy } from './calendar-sub-grid';\nimport { CalendarYearNavigator } from './calendar-year-navigator';\n\ninterface FocusedDateSource<D> {\n readonly value: D | null;\n readonly range: DateRange<D> | null;\n readonly min: D | null;\n readonly max: D | null;\n}\n\n/**\n * Headless implementation of a single-date calendar grid following the\n * [WAI-ARIA Grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/), the\n * date table at the heart of the APG\n * [Date Picker Dialog](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/)\n * example.\n *\n * `ForCalendar` is the root: it owns the selected value, the focused date, and\n * the visible month, and exposes them to the grid / header / cell / heading /\n * navigation pieces through `FOR_CALENDAR_CONTEXT`. All date math goes through\n * a pluggable {@link DateAdapter} (`provideInternationalizedDateAdapter()` or\n * `provideNativeDateAdapter()`), so the library hard-depends on no date\n * library.\n *\n * The grid uses roving tabindex: exactly one cell (the focused date) carries\n * `tabindex=\"0\"`. Arrow / `Home` / `End` / `PageUp` / `PageDown` /\n * `Shift+PageUp` / `Shift+PageDown` move the focused date, re-paging the grid\n * when crossing a month boundary; `Enter` / `Space` select.\n *\n * The day / month / year views are each backed by a sub-grid collaborator\n * ({@link CalendarDayNavigator} / {@link CalendarMonthNavigator} /\n * {@link CalendarYearNavigator}), and range selection by\n * {@link CalendarRangeSelection}; the root wires them together and exposes the\n * `[(value)]` / `[(view)]` / `[(range)]` models.\n *\n * `ForCalendar` is the grid widget, not a form value — it exposes `[(value)]`\n * as a `model<D | null>` in `selectionMode=\"single\"` (default), and\n * `[(range)]` as a `model<DateRange<D> | null>` in\n * `selectionMode=\"range\"`. The `FormValueControl<D>` contract arrives with the\n * follow-up `ForDatePicker` / `ForDateField`. See the primitive's README for a\n * complete styleless usage example.\n *\n * @typeParam D The adapter's immutable date type.\n */\n@Directive({\n selector: '[forCalendar]',\n exportAs: 'forCalendar',\n host: {\n '[attr.dir]': 'dir()',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-readonly]': 'readonly() ? \"\" : null',\n '[attr.data-view]': 'view()',\n },\n providers: [{ provide: FOR_CALENDAR_CONTEXT, useExisting: ForCalendar }],\n})\nexport class ForCalendar<D> implements ForCalendarContext<D> {\n readonly #defaults = inject(FOR_CALENDAR_DEFAULTS);\n readonly #idGen = inject(IdGenerator);\n readonly #injector = inject(Injector);\n readonly #announcer = inject(LiveAnnouncer);\n readonly #pickerHost = inject(FOR_PICKER_SOURCE_HOST, { optional: true });\n\n /** The active date adapter, resolved from `FOR_DATE_ADAPTER`. */\n readonly adapter: DateAdapter<D> = injectDateAdapter<D>('ForCalendar', { scope: 'calendar' });\n\n /**\n * Two-way bindable selected date, or `null`. The `model()` change emitter\n * (`(valueChange)`) fires only when the calendar itself updates the value\n * (cell activation), never on consumer writes via `[(value)]`.\n */\n readonly value = model<D | null>(null);\n\n /** Minimum selectable date (inclusive). Dates before it are unavailable. */\n readonly min = input<D | null>(null);\n\n /** Maximum selectable date (inclusive). Dates after it are unavailable. */\n readonly max = input<D | null>(null);\n\n /**\n * Per-date predicate marking a date as unavailable (present in the grid but\n * not selectable, reflected as `aria-disabled` / `data-disabled`).\n */\n readonly isDateUnavailable = input<(date: D) => boolean>(() => false);\n\n /**\n * Formats the full accessible date string each gridcell exposes as its\n * `aria-label` (the visible content stays the bare day number). Defaults to\n * the localized full date (e.g. `\"Monday, June 15, 2026\"`), with\n * outside-month padding days passed through the scope's `outsideMonthLabel`\n * (`\"<date> (outside month)\"` unless localized via `provideForCalendarDefaults`)\n * so assistive tech can tell them apart from the visible month. Override to\n * change the format entirely.\n */\n readonly dateLabel = input<CalendarDateLabelFormatter<D>>(\n (date, { adapter, outsideMonth, locale }) => {\n const formatted = adapter.format(\n date,\n { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' },\n locale ?? undefined,\n );\n return outsideMonth ? this.#defaults.outsideMonthLabel(formatted) : formatted;\n },\n );\n\n /**\n * Disables the whole calendar: no focus movement, no selection. Bound as\n * `[disabled]`; {@link disabled} is the effective state.\n */\n readonly disabledInput = input(false, { transform: booleanAttribute, alias: 'disabled' });\n\n /**\n * Makes the calendar read-only: dates stay focusable but selection is blocked.\n * Bound as `[readonly]`; {@link readonly} is the effective state.\n */\n readonly readonlyInput = input(false, { transform: booleanAttribute, alias: 'readonly' });\n\n /**\n * Effective disabled: the calendar's own `[disabled]` OR'd with the disabled\n * state of a `[forDatePicker]` / `[forDateRangePicker]` it is projected into.\n */\n readonly disabled = computed(\n () => this.disabledInput() || (this.#pickerHost?.effectiveDisabled() ?? false),\n );\n\n /**\n * Effective read-only: the calendar's own `[readonly]` OR'd with the read-only\n * state of a `[forDatePicker]` / `[forDateRangePicker]` it is projected into.\n */\n readonly readonly = computed(\n () => this.readonlyInput() || (this.#pickerHost?.readonly() ?? false),\n );\n\n /**\n * Selection mode. `'single'` (default) keeps the single-date `[(value)]`\n * behaviour unchanged. `'range'` switches to the two-click anchor → commit\n * flow and exposes the result through `[(range)]`.\n */\n readonly selectionMode = input<'single' | 'range'>('single');\n\n /**\n * Active calendar view. `'day'` (default) shows the date grid; `'month'` and\n * `'year'` show the month / year picker grids. Two-way bindable; the `model()`\n * change emitter (`(viewChange)`) fires only when the calendar itself cycles\n * or drills the view, never on consumer writes via `[(view)]`.\n */\n readonly view = model<CalendarView>('day');\n\n /**\n * Number of years the year view shows, as an aligned block containing the\n * visible year. Default `12`.\n */\n readonly yearBlockSize = input(12, { transform: numberAttribute });\n\n /**\n * Two-way bindable committed date range, or `null`. Only used when\n * `selectionMode=\"range\"`. The `model()` change emitter (`(rangeChange)`)\n * fires only when the calendar internally commits a range, never\n * on consumer writes via `[(range)]`.\n */\n readonly range = model<DateRange<D> | null>(null);\n\n /**\n * Minimum inclusive day count for a range selection. A click that would\n * commit a range shorter than this is a no-op (anchor is preserved).\n * `null` (default) means no minimum. Only honoured in `selectionMode=\"range\"`.\n */\n readonly minRangeLength = input<number | null>(null);\n\n /**\n * Maximum inclusive day count for a range selection. A click that would\n * commit a range longer than this is a no-op (anchor is preserved).\n * `null` (default) means no maximum. Only honoured in `selectionMode=\"range\"`.\n */\n readonly maxRangeLength = input<number | null>(null);\n\n /**\n * First day of the week as a **0-6** index (`0` = Sunday). When `null`\n * (default, overridable via `provideForCalendarDefaults`), the adapter's\n * `getFirstDayOfWeek()` is used.\n */\n readonly firstDayOfWeek = input<number | null>(this.#defaults.firstDayOfWeek);\n\n /**\n * Writing direction. When unset (default `null`), the inherited ambient\n * direction is resolved from the nearest ancestor carrying a `dir` attribute\n * (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins.\n * The resolved value is reflected to the host `dir` attribute and swaps the\n * `ArrowLeft` / `ArrowRight` semantics in RTL.\n */\n readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n readonly dir = injectTextDirection(this._dirInput);\n\n /**\n * BCP 47 locale tag governing the formatted month / weekday / cell-label names\n * (heading, weekday headers, month-picker options, gridcell `aria-label`).\n * When `null` (default), the adapter formats in its own `locale()`, then the\n * runtime's default locale. Does not change the calendar system, which stays\n * Gregorian.\n */\n readonly locale = input<string | null>(null);\n\n readonly #initialToday = this.adapter.today();\n\n /**\n * Internal focused date (the roving entry point), seeded from\n * `value ?? range.start ?? today`, with today clamped into `[min, max]`. It is\n * re-seeded when `value` or `range` changes; a change of `min` / `max` keeps\n * it while it stays within the new bounds.\n */\n readonly focusedDate: WritableSignal<D> = linkedSignal<FocusedDateSource<D>, D>({\n source: () => ({\n value: this.value(),\n range: this.range(),\n min: this.min(),\n max: this.max(),\n }),\n computation: (source, previous) => {\n if (\n previous !== undefined &&\n source.value === previous.source.value &&\n source.range === previous.source.range &&\n this.#bounds.contains(previous.value)\n ) {\n return previous.value;\n }\n return this.#seedDate();\n },\n });\n\n readonly #bounds = new CalendarBounds<D>({\n adapter: this.adapter,\n min: this.min,\n max: this.max,\n visibleMonth: () => this.visibleMonth(),\n isDateUnavailable: this.isDateUnavailable,\n disabled: this.disabled,\n });\n\n readonly #range = new CalendarRangeSelection<D>({\n adapter: this.adapter,\n focusedDate: this.focusedDate,\n range: this.range,\n active: computed(() => this.selectionMode() === 'range'),\n minRangeLength: this.minRangeLength,\n maxRangeLength: this.maxRangeLength,\n });\n\n readonly #nav = new CalendarNavigation<D>(\n {\n adapter: this.adapter,\n disabled: this.disabled,\n readonly: this.readonly,\n selectionMode: this.selectionMode,\n focusedDate: this.focusedDate,\n value: this.value,\n periodLabel: () => this.viewTriggerLabel(),\n visibleYear: () => this.visibleYear(),\n visibleMonthNumber: () => this.visibleMonthNumber(),\n bounds: this.#bounds,\n range: this.#range,\n announce: (label) => this.#announcer.announce(label, 'polite'),\n scheduleFocus: (fn) => this.#scheduleFocus(fn),\n focusDayCell: (target) => this.#focusDayCell(target),\n },\n this.#seedDate(),\n );\n\n readonly #dayNav = new CalendarDayNavigator<D>({\n ...this.#subGridHost(),\n visibleMonth: () => this.visibleMonth(),\n firstDayOfWeek: () => this.#resolvedFirstDayOfWeek(),\n getDateLabel: (date) => this.getDateLabel(date),\n selectDate: (date) => this.#nav.selectDate(date),\n pageMonths: (delta) => this.#nav.pageMonths(delta),\n applyDayKeyMove: (target, isPaging) => this.#nav.applyDayKeyMove(target, isPaging),\n });\n\n readonly #monthNav = new CalendarMonthNavigator<D>({\n ...this.#subGridHost(),\n ...this.#pickerViewHost(),\n isMonthOutOfBounds: (year, month) => this.#bounds.isMonthOutOfBounds(year, month),\n selectMonth: (month) => this.selectMonth(month),\n });\n\n readonly #yearNav = new CalendarYearNavigator<D>({\n ...this.#subGridHost(),\n ...this.#pickerViewHost(),\n selectYear: (year) => this.selectYear(year),\n });\n\n readonly #strategies: Record<CalendarView, CalendarViewStrategy> = {\n day: this.#dayNav,\n month: this.#monthNav,\n year: this.#yearNav,\n };\n\n #seedDate(): D {\n return this.value() ?? this.range()?.start ?? this.#bounds.clamp(this.#initialToday);\n }\n\n #strategyFor(view: CalendarView): CalendarViewStrategy {\n return this.#strategies[view];\n }\n\n /** The reactive root surface shared by all three sub-grid navigators. */\n #subGridHost(): CalendarSubGridHost<D> {\n return {\n adapter: this.adapter,\n dir: this.dir,\n locale: () => this.locale(),\n yearBlockSize: () => this.yearBlockSize(),\n yearBlockStart: () => this.#yearBlockStart(),\n visibleMonthLabel: () => this.visibleMonthLabel(),\n visibleYear: () => this.visibleYear(),\n visibleMonthNumber: () => this.visibleMonthNumber(),\n focusedDate: this.focusedDate,\n isPreviousMonthDisabled: this.#bounds.isPreviousMonthDisabled,\n isNextMonthDisabled: this.#bounds.isNextMonthDisabled,\n isYearDisabled: (year) => this.#bounds.isYearDisabled(year),\n today: () => this.adapter.today(),\n };\n }\n\n /** The navigation / focus surface shared by the month and year picker navigators. */\n #pickerViewHost() {\n return {\n value: () => this.value(),\n pageByYears: (step: number) => this.#nav.pageByYears(step),\n moveFocusedDate: (date: D) => this.#nav.moveFocusedDate(date),\n dateInMonth: (year: number, month: number) => this.#nav.dateInMonth(year, month),\n scheduleFocus: (fn: () => void) => this.#scheduleFocus(fn),\n };\n }\n\n #viewSwitched = false;\n readonly #viewFocusEffect = effect(() => {\n const view = this.view();\n if (!this.#viewSwitched) {\n this.#viewSwitched = true;\n return;\n }\n afterNextRender(() => this.#strategyFor(view).focusActive(), { injector: this.#injector });\n });\n\n readonly #resolvedFirstDayOfWeek = computed(\n () => this.firstDayOfWeek() ?? this.adapter.getFirstDayOfWeek(),\n );\n\n /** First day of the visible month, derived from {@link focusedDate}. */\n readonly visibleMonth = computed(() => {\n const focused = this.focusedDate();\n return this.adapter.createDate(\n this.adapter.getYear(focused),\n this.adapter.getMonth(focused),\n 1,\n );\n });\n\n readonly #headingId = signal(this.#idGen.next('for-calendar-heading'));\n readonly headingId = this.#headingId.asReadonly();\n\n readonly #headingCount = signal(0);\n private readonly hasHeading = computed(() => this.#headingCount() > 0);\n\n private registerHeading(): void {\n this.#headingCount.update((count) => count + 1);\n }\n\n private unregisterHeading(): void {\n this.#headingCount.update((count) => count - 1);\n }\n\n /**\n * Adopts a consumer-set static `id` on the `[forCalendarHeading]` host into\n * `headingId` (the grid's `aria-labelledby` resolves to it) instead of\n * letting the `[id]` host binding clobber it.\n */\n adoptHeadingId(el: HTMLElement): void {\n adoptHostId(el, this.#headingId);\n }\n\n readonly visibleMonthLabel = computed(() =>\n this.adapter.format(\n this.visibleMonth(),\n { month: 'long', year: 'numeric' },\n this.locale() ?? undefined,\n ),\n );\n\n /** The visible month's full year (e.g. `2026`). */\n readonly visibleYear = computed(() => this.adapter.getYear(this.visibleMonth()));\n\n /** The visible month, **1-12**. */\n readonly visibleMonthNumber = computed(() => this.adapter.getMonth(this.visibleMonth()));\n\n /**\n * Twelve entries for the visible year — each a localized month name plus\n * whether the whole month falls outside `[min, max]`. Tracks {@link visibleYear}.\n * Build native `<select>` month dropdowns from it.\n */\n readonly monthOptions = computed<readonly CalendarMonthOption[]>(() => this.#monthNav.options());\n\n readonly #yearBlockStart = computed(() => {\n const size = this.yearBlockSize();\n return Math.floor(this.visibleYear() / size) * size;\n });\n\n /** Rows of the month picker grid (3 columns) for the visible year. */\n readonly monthRows = computed<readonly CalendarMonthRow[]>(() => this.#monthNav.rows());\n\n /** Rows of the year picker grid (3 columns) for the aligned block containing the visible year. */\n readonly yearRows = computed<readonly CalendarYearRow[]>(() => this.#yearNav.rows());\n\n /**\n * Label of the period the active view shows, for the view trigger and the\n * heading: the month and year in day view, the year in month view, the block\n * of years in year view.\n */\n readonly viewTriggerLabel = computed(() => this.#strategyFor(this.view()).triggerLabel());\n\n readonly isPreviousDisabled = computed(() => this.#strategyFor(this.view()).isPreviousDisabled());\n\n readonly isNextDisabled = computed(() => this.#strategyFor(this.view()).isNextDisabled());\n\n /** Weekday column headers for the visible month, starting at `firstDayOfWeek`. */\n readonly weekDays = this.#dayNav.weekDays;\n\n /** Week rows of the visible month, including outside-month padding days. */\n readonly weeks = this.#dayNav.weeks;\n\n /** Whether the previous-month button should be disabled (bounded by `min`). */\n readonly isPreviousMonthDisabled = this.#bounds.isPreviousMonthDisabled;\n\n /** Whether the next-month button should be disabled (bounded by `max`). */\n readonly isNextMonthDisabled = this.#bounds.isNextMonthDisabled;\n\n /**\n * Whether every day of `month` (**1-12**) in the visible year falls outside\n * `[min, max]`. Use it to disable a month in a custom dropdown.\n */\n isMonthDisabled(month: number): boolean {\n return this.#bounds.isMonthOutOfBounds(this.visibleYear(), month);\n }\n\n /**\n * Whether every day of `year` falls outside `[min, max]`. Use it to disable a\n * year in a custom dropdown.\n */\n isYearDisabled(year: number): boolean {\n return this.#bounds.isYearDisabled(year);\n }\n\n isMonthSelected(month: number): boolean {\n return this.#monthNav.isSelected(month);\n }\n\n isMonthToday(month: number): boolean {\n return this.#monthNav.isToday(month);\n }\n\n isMonthFocused(month: number): boolean {\n return this.#monthNav.isFocused(month);\n }\n\n isYearSelected(year: number): boolean {\n return this.#yearNav.isSelected(year);\n }\n\n isYearToday(year: number): boolean {\n return this.#yearNav.isToday(year);\n }\n\n isYearFocused(year: number): boolean {\n return this.#yearNav.isFocused(year);\n }\n\n isSelected(date: D): boolean {\n if (this.selectionMode() === 'range') {\n return this.#range.contains(date);\n }\n const value = this.value();\n return value !== null && this.adapter.isSameDay(date, value);\n }\n\n isRangeStart(date: D): boolean {\n return this.#range.isRangeStart(date);\n }\n\n isRangeEnd(date: D): boolean {\n return this.#range.isRangeEnd(date);\n }\n\n isInRange(date: D): boolean {\n return this.#range.isInRange(date);\n }\n\n isRangePreview(date: D): boolean {\n return this.#range.isRangePreview(date);\n }\n\n setHovered(date: D | null): void {\n this.#range.setHovered(date);\n }\n\n isToday(date: D): boolean {\n return this.adapter.isSameDay(date, this.adapter.today());\n }\n\n isFocused(date: D): boolean {\n return this.adapter.isSameDay(date, this.focusedDate());\n }\n\n isOutsideMonth(date: D): boolean {\n const visible = this.visibleMonth();\n return (\n this.adapter.getMonth(date) !== this.adapter.getMonth(visible) ||\n this.adapter.getYear(date) !== this.adapter.getYear(visible)\n );\n }\n\n isUnavailable(date: D): boolean {\n return this.#bounds.isUnavailable(date);\n }\n\n getDateLabel(date: D): string {\n return this.dateLabel()(date, {\n adapter: this.adapter,\n outsideMonth: this.isOutsideMonth(date),\n locale: this.locale(),\n });\n }\n\n selectDate(date: D): void {\n this.#nav.selectDate(date);\n }\n\n private activateDate(date: D): void {\n this.#nav.activateDate(date);\n }\n\n pageMonths(delta: number): void {\n this.#nav.pageMonths(delta);\n }\n\n /**\n * Set the visible month to (`year`, `month`) without selecting a date.\n * `month` is **1-12**. Re-applies the user's intended day-of-month (clamped to\n * the target month's length), clamps the result into `[min, max]`, and\n * announces the new period politely when the active view's period changes\n * (the month in day view, the year in month view, the block in year view). Keeps DOM\n * focus on the caller — it does not move focus into the grid. A no-op while the\n * calendar is disabled.\n */\n goTo(year: number, month: number): void {\n this.#nav.goTo(year, month);\n }\n\n /** Set the visible month within the current visible year. `month` is **1-12**. */\n goToMonth(month: number): void {\n this.goTo(this.visibleYear(), month);\n }\n\n /** Set the visible year, keeping the current visible month. */\n goToYear(year: number): void {\n this.goTo(year, this.visibleMonthNumber());\n }\n\n handleCellKeydown(event: KeyboardEvent, fromDate: D): void {\n if (this.disabled()) {\n return;\n }\n this.#dayNav.handleKeydown(event, fromDate);\n }\n\n /**\n * Cycle the view one step coarser: `day → month → year`, clamped at `'year'`.\n * No-op when the whole calendar is disabled.\n */\n cycleView(): void {\n if (this.disabled()) {\n return;\n }\n const order: readonly CalendarView[] = ['day', 'month', 'year'];\n const next = order[order.indexOf(this.view()) + 1];\n if (next) {\n this.view.set(next);\n }\n }\n\n /**\n * Select a whole month (1-12): navigate to it within the current visible year\n * and switch the view to `'day'`. It changes no value, so a read-only calendar\n * drills down too. No-op when the calendar is disabled or the month is out of\n * `[min, max]`.\n */\n selectMonth(month: number): void {\n if (this.disabled() || this.isMonthDisabled(month)) {\n return;\n }\n this.goToMonth(month);\n this.view.set('day');\n }\n\n /**\n * Select a whole year: navigate to it and switch the view to `'month'`. It\n * changes no value, so a read-only calendar drills down too. No-op when the\n * calendar is disabled or the year is out of `[min, max]`.\n */\n selectYear(year: number): void {\n if (this.disabled() || this.isYearDisabled(year)) {\n return;\n }\n this.goToYear(year);\n this.view.set('month');\n }\n\n /** Page backward by one month / year / block depending on the active view. */\n pagePrevious(): void {\n this.#page(-1);\n }\n\n /** Page forward by one month / year / block depending on the active view. */\n pageNext(): void {\n this.#page(1);\n }\n\n #page(direction: -1 | 1): void {\n if (this.disabled()) {\n return;\n }\n this.#strategyFor(this.view()).page(direction);\n }\n\n /**\n * Move DOM focus to the roving cell — the gridcell carrying the tab stop,\n * i.e. the one matching {@link focusedDate} (day view) or the highlighted\n * month / year cell (month / year view). Returns `false` when no matching\n * cell is currently rendered, so an overlay host wrapping the calendar can\n * fall back to its own focus logic.\n */\n focusActiveCell(): boolean {\n return this.#strategyFor(this.view()).focusActive();\n }\n\n registerCell(handle: ForCalendarCellHandle<D>): void {\n this.#dayNav.register(handle);\n }\n\n unregisterCell(handle: ForCalendarCellHandle<D>): void {\n this.#dayNav.unregister(handle);\n }\n\n handleMonthCellKeydown(event: KeyboardEvent, fromMonth: number): void {\n if (this.disabled()) {\n return;\n }\n this.#monthNav.handleKeydown(event, fromMonth);\n }\n\n handleYearCellKeydown(event: KeyboardEvent, fromYear: number): void {\n if (this.disabled()) {\n return;\n }\n this.#yearNav.handleKeydown(event, fromYear);\n }\n\n registerMonthCell(handle: ForCalendarMonthCellHandle): void {\n this.#monthNav.register(handle);\n }\n\n unregisterMonthCell(handle: ForCalendarMonthCellHandle): void {\n this.#monthNav.unregister(handle);\n }\n\n registerYearCell(handle: ForCalendarYearCellHandle): void {\n this.#yearNav.register(handle);\n }\n\n unregisterYearCell(handle: ForCalendarYearCellHandle): void {\n this.#yearNav.unregister(handle);\n }\n\n #scheduleFocus(fn: () => void): void {\n afterNextRender(fn, { injector: this.#injector });\n }\n\n #focusDayCell(target: D): void {\n afterNextRender(() => this.#dayNav.focusCell(target), { injector: this.#injector });\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { hostLabelledBy } from 'forty-cdk/core';\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * The calendar's date table (`role=\"grid\"`). Apply on a `<table>`. Labelled by\n * the `[forCalendarHeading]` via `aria-labelledby` while one is mounted, and\n * reflects `aria-disabled` / `aria-readonly` from the root. In `selectionMode=\"range\"` it carries\n * `aria-multiselectable=\"true\"`, since a committed range selects several cells.\n *\n * Exposes the month's `weekDays()` (column headers) and `weeks()` (day rows)\n * for the consumer to iterate — bind `cell.date` to each `[forCalendarCell]`.\n */\n@Directive({\n selector: '[forCalendarGrid]',\n exportAs: 'forCalendarGrid',\n host: {\n role: 'grid',\n '[attr.aria-disabled]': 'ctx.disabled() ? \"true\" : null',\n '[attr.aria-readonly]': 'ctx.readonly() ? \"true\" : null',\n '[attr.aria-multiselectable]': 'ctx.selectionMode() === \"range\" ? \"true\" : null',\n },\n})\nexport class ForCalendarGrid {\n private readonly ctx = injectCalendarContext('ForCalendarGrid');\n\n private readonly labelledBy = hostLabelledBy(() =>\n this.ctx.hasHeading() ? this.ctx.headingId() : null,\n );\n\n /** Weekday column headers for the visible month, starting at `firstDayOfWeek`. */\n readonly weekDays = this.ctx.weekDays;\n\n /** Week rows of the visible month, including outside-month padding days. */\n readonly weeks = this.ctx.weeks;\n}\n","import { Directive } from '@angular/core';\n\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * Marks the calendar grid's header rowgroup. Apply on a `<thead>` holding a\n * single row of `<th scope=\"col\">` weekday headers.\n *\n * Reflects `role=\"rowgroup\"` so the weekday header is exposed as a distinct\n * rowgroup inside the `role=\"grid\"` table — assistive tech announces the\n * column headers as their own group rather than folding them into the day\n * rows. (A bare `<thead>` carries the implicit role, but the grid's explicit\n * `role=\"grid\"` suppresses the table's native row/rowgroup semantics, so the\n * header must restate it.)\n *\n * Also exposes `weekDays()` so the header row can be iterated from this piece,\n * as an alternative to reading it off `[forCalendarGrid]`.\n */\n@Directive({\n selector: '[forCalendarGridHeader]',\n exportAs: 'forCalendarGridHeader',\n host: {\n role: 'rowgroup',\n },\n})\nexport class ForCalendarGridHeader {\n private readonly ctx = injectCalendarContext('ForCalendarGridHeader');\n\n /** Weekday column headers for the visible month, starting at `firstDayOfWeek`. */\n readonly weekDays = this.ctx.weekDays;\n}\n","import { computed, Directive, ElementRef, inject, input, type InputSignal } from '@angular/core';\n\nimport { assertInputBound, isUnset, registerHandle, unsetInput, type Unset } from 'forty-cdk/core';\nimport { type ForCalendarCellHandle, injectCalendarContext } from './calendar-context';\n\n/**\n * A single day cell (`role=\"gridcell\"`). Apply on the `<td>` for each day in\n * the grid and bind `[date]` to the cell's date from `weeks()`.\n *\n * Carries the roving tab stop (`tabindex=\"0\"` only on the focused date), the\n * full accessible date as `aria-label` (the bare day number stays the visible\n * content), `aria-selected` (always emitted), `aria-current=\"date\"` on today,\n * `aria-disabled` on unavailable dates, and the boolean `data-*` styling hooks\n * (`data-selected`, `data-today`, `data-highlighted`, `data-disabled`,\n * `data-outside-month`). In `selectionMode=\"range\"`, also emits\n * `data-range-start`, `data-range-end`, `data-in-range`, and\n * `data-range-preview` (all boolean present/absent). Click and `Enter` /\n * `Space` select; arrow / paging keys move the focused date.\n *\n * @typeParam D The adapter's date type (inferred from the bound `[date]`).\n */\n@Directive({\n selector: '[forCalendarCell]',\n exportAs: 'forCalendarCell',\n host: {\n role: 'gridcell',\n '[attr.tabindex]': 'focused() ? 0 : -1',\n '[attr.aria-label]': 'dateLabel()',\n '[attr.aria-selected]': 'selected() ? \"true\" : \"false\"',\n '[attr.aria-current]': 'isToday() ? \"date\" : null',\n '[attr.aria-disabled]': 'unavailable() ? \"true\" : null',\n '[attr.data-selected]': 'selected() ? \"\" : null',\n '[attr.data-today]': 'isToday() ? \"\" : null',\n '[attr.data-highlighted]': 'focused() ? \"\" : null',\n '[attr.data-disabled]': 'unavailable() ? \"\" : null',\n '[attr.data-outside-month]': 'outsideMonth() ? \"\" : null',\n '[attr.data-range-start]': 'rangeStart() ? \"\" : null',\n '[attr.data-range-end]': 'rangeEnd() ? \"\" : null',\n '[attr.data-in-range]': 'inRange() ? \"\" : null',\n '[attr.data-range-preview]': 'rangePreview() ? \"\" : null',\n '(click)': 'onClick()',\n '(keydown)': 'onKeyDown($event)',\n '(pointerenter)': 'onPointerEnter()',\n '(pointerleave)': 'ctx.setHovered(null)',\n },\n})\nexport class ForCalendarCell<D> {\n private readonly ctx = injectCalendarContext('ForCalendarCell');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** The date this cell represents. Mandatory — a cell with no binding throws in dev mode. */\n readonly date: InputSignal<D | Unset> = input(unsetInput<D>());\n\n private readonly selected = computed(() => this.#bound((d) => this.ctx.isSelected(d), false));\n private readonly isToday = computed(() => this.#bound((d) => this.ctx.isToday(d), false));\n private readonly focused = computed(() => this.#bound((d) => this.ctx.isFocused(d), false));\n private readonly unavailable = computed(() =>\n this.#bound((d) => this.ctx.isUnavailable(d), false),\n );\n private readonly outsideMonth = computed(() =>\n this.#bound((d) => this.ctx.isOutsideMonth(d), false),\n );\n private readonly dateLabel = computed(() =>\n this.#bound<string | null>((d) => this.ctx.getDateLabel(d), null),\n );\n private readonly rangeStart = computed(() => this.#bound((d) => this.ctx.isRangeStart(d), false));\n private readonly rangeEnd = computed(() => this.#bound((d) => this.ctx.isRangeEnd(d), false));\n private readonly inRange = computed(() => this.#bound((d) => this.ctx.isInRange(d), false));\n private readonly rangePreview = computed(() =>\n this.#bound((d) => this.ctx.isRangePreview(d), false),\n );\n\n constructor() {\n assertInputBound(this.date, 'calendar', '[forCalendarCell]', 'date');\n const handle: ForCalendarCellHandle<unknown> = {\n host: this.#host.nativeElement,\n date: this.date,\n };\n registerHandle(\n handle,\n (h) => this.ctx.registerCell(h),\n (h) => this.ctx.unregisterCell(h),\n );\n }\n\n #bound<R>(read: (date: D) => R, fallback: R): R {\n const date = this.date();\n return isUnset(date) ? fallback : read(date);\n }\n\n private onClick(): void {\n const date = this.date();\n if (!isUnset(date)) {\n this.ctx.activateDate(date);\n }\n }\n\n private onKeyDown(event: KeyboardEvent): void {\n const date = this.date();\n if (!isUnset(date)) {\n this.ctx.handleCellKeydown(event, date);\n }\n }\n\n private onPointerEnter(): void {\n const date = this.date();\n if (!isUnset(date)) {\n this.ctx.setHovered(date);\n }\n }\n}\n","import { DestroyRef, Directive, ElementRef, inject } from '@angular/core';\n\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * The period heading. Apply on a heading element (e.g. `<h2>`) and render\n * its `label()` as the content: `<h2 forCalendarHeading #h=\"forCalendarHeading\">{{ h.label() }}</h2>`.\n * While it is mounted, the day, month and year grids are `aria-labelledby` this\n * element, so it names the period the active view shows. Without it the grids\n * emit no `aria-labelledby` of their own.\n *\n * It is **not** an `aria-live` region: paging announces the new\n * period through a dedicated off-screen live region owned by `[forCalendar]`,\n * so the grid's accessible name is re-read on demand without the heading\n * itself double-announcing on every render.\n */\n@Directive({\n selector: '[forCalendarHeading]',\n exportAs: 'forCalendarHeading',\n host: {\n '[id]': 'ctx.headingId()',\n },\n})\nexport class ForCalendarHeading {\n private readonly ctx = injectCalendarContext('ForCalendarHeading');\n\n /**\n * The label of the period the active view shows: the month and year in day\n * view (`\"June 2026\"`), the year in month view (`\"2026\"`), the block of years\n * in year view (`\"2016 – 2027\"`).\n */\n readonly label = this.ctx.viewTriggerLabel;\n\n constructor() {\n this.ctx.adoptHeadingId(inject<ElementRef<HTMLElement>>(ElementRef).nativeElement);\n this.ctx.registerHeading();\n inject(DestroyRef).onDestroy(() => this.ctx.unregisterHeading());\n }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { hostButtonType, hostAriaLabel } from 'forty-cdk/core';\n\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * Pages the calendar backward. In `day` view pages by one month; in `month` view\n * pages by one year; in `year` view pages by one block. Apply on a `<button>`.\n * Keeps DOM focus on itself while paging; the calendar announces the new period\n * through its off-screen live region. Auto-disabled at the view's bound, or when\n * the whole calendar is disabled.\n *\n * Reflects the disabled state through `aria-disabled` + `data-disabled` only —\n * never the native `disabled` attribute — so a button that auto-disables at the\n * bound while focused keeps DOM focus instead of being ejected from the focus\n * order. Activation is a no-op while disabled.\n *\n * Provide an accessible name via the `[ariaLabel]` input (e.g.\n * `[ariaLabel]=\"'Previous'\"`).\n */\n@Directive({\n selector: '[forCalendarPrevButton]',\n exportAs: 'forCalendarPrevButton',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.aria-label]': 'resolvedAriaLabel()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '(click)': 'page()',\n },\n})\nexport class ForCalendarPrevButton {\n private readonly buttonType = hostButtonType();\n\n private readonly ctx = injectCalendarContext('ForCalendarPrevButton');\n\n /** Accessible name for the button. A `null` (default) or empty value emits no attribute. */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n private readonly disabled = computed(() => this.ctx.disabled() || this.ctx.isPreviousDisabled());\n\n private page(): void {\n if (this.disabled()) {\n return;\n }\n this.ctx.pagePrevious();\n }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { hostButtonType, hostAriaLabel } from 'forty-cdk/core';\n\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * Pages the calendar forward. In `day` view pages by one month; in `month` view\n * pages by one year; in `year` view pages by one block. Apply on a `<button>`.\n * Keeps DOM focus on itself while paging; the calendar announces the new period\n * through its off-screen live region. Auto-disabled at the view's bound, or when\n * the whole calendar is disabled.\n *\n * Reflects the disabled state through `aria-disabled` + `data-disabled` only —\n * never the native `disabled` attribute — so a button that auto-disables at the\n * bound while focused keeps DOM focus instead of being ejected from the focus\n * order. Activation is a no-op while disabled.\n *\n * Provide an accessible name via the `[ariaLabel]` input (e.g.\n * `[ariaLabel]=\"'Next'\"`).\n */\n@Directive({\n selector: '[forCalendarNextButton]',\n exportAs: 'forCalendarNextButton',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.aria-label]': 'resolvedAriaLabel()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '(click)': 'page()',\n },\n})\nexport class ForCalendarNextButton {\n private readonly buttonType = hostButtonType();\n\n private readonly ctx = injectCalendarContext('ForCalendarNextButton');\n\n /** Accessible name for the button. A `null` (default) or empty value emits no attribute. */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n private readonly disabled = computed(() => this.ctx.disabled() || this.ctx.isNextDisabled());\n\n private page(): void {\n if (this.disabled()) {\n return;\n }\n this.ctx.pageNext();\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { hostLabelledBy } from 'forty-cdk/core';\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * The month picker grid (`role=\"grid\"`). Apply on a `<table>`. Labelled by the\n * `[forCalendarHeading]` via `aria-labelledby` while one is mounted. Exposes\n * `rows()` — iterate rows then cells, binding each cell's `month` to `[forCalendarMonthCell]`.\n *\n * Shows the 12 months of the visible year in 3-column rows. Used when\n * `view === 'month'`.\n */\n@Directive({\n selector: '[forCalendarMonthGrid]',\n exportAs: 'forCalendarMonthGrid',\n host: {\n role: 'grid',\n '[attr.aria-disabled]': 'ctx.disabled() ? \"true\" : null',\n '[attr.aria-readonly]': 'ctx.readonly() ? \"true\" : null',\n '[attr.data-view]': '\"month\"',\n },\n})\nexport class ForCalendarMonthGrid {\n private readonly ctx = injectCalendarContext('ForCalendarMonthGrid');\n\n private readonly labelledBy = hostLabelledBy(() =>\n this.ctx.hasHeading() ? this.ctx.headingId() : null,\n );\n\n /** Rows of the month picker grid (3 columns) for the visible year. */\n readonly rows = this.ctx.monthRows;\n}\n","import { computed, Directive, ElementRef, inject, input, type InputSignal } from '@angular/core';\n\nimport { assertInputBound, isUnset, registerHandle, unsetInput, type Unset } from 'forty-cdk/core';\nimport { type ForCalendarMonthCellHandle, injectCalendarContext } from './calendar-context';\n\n/**\n * A single month cell (`role=\"gridcell\"`) in the month picker grid. Apply on\n * the `<td>` for each month and bind `[month]` to the month number (1-12) from\n * `rows()`.\n *\n * Carries the roving tab stop (`tabindex=\"0\"` on the focused month), reflects\n * `aria-selected` (always emitted), `data-today`, `data-selected`,\n * `data-highlighted`, `data-disabled`. Click and `Enter` / `Space` drill down\n * to the day view for that month; arrow / paging keys move the roving cell.\n */\n@Directive({\n selector: '[forCalendarMonthCell]',\n exportAs: 'forCalendarMonthCell',\n host: {\n role: 'gridcell',\n '[attr.tabindex]': 'focused() ? 0 : -1',\n '[attr.aria-selected]': 'selected() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.data-selected]': 'selected() ? \"\" : null',\n '[attr.data-today]': 'today() ? \"\" : null',\n '[attr.data-highlighted]': 'focused() ? \"\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '(click)': 'onClick()',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForCalendarMonthCell {\n private readonly ctx = injectCalendarContext('ForCalendarMonthCell');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The month this cell represents, **1-12**. Mandatory — a cell with no binding throws in dev\n * mode.\n */\n readonly month: InputSignal<number | Unset> = input(unsetInput<number>());\n\n private readonly selected = computed(() => this.#bound((v) => this.ctx.isMonthSelected(v)));\n private readonly today = computed(() => this.#bound((v) => this.ctx.isMonthToday(v)));\n private readonly focused = computed(() => this.#bound((v) => this.ctx.isMonthFocused(v)));\n private readonly disabled = computed(\n () => this.ctx.disabled() || this.#bound((v) => this.ctx.isMonthDisabled(v)),\n );\n\n constructor() {\n assertInputBound(this.month, 'calendar', '[forCalendarMonthCell]', 'month');\n const handle: ForCalendarMonthCellHandle = {\n host: this.#host.nativeElement,\n month: this.month,\n };\n registerHandle(\n handle,\n (h) => this.ctx.registerMonthCell(h),\n (h) => this.ctx.unregisterMonthCell(h),\n );\n }\n\n #bound(read: (month: number) => boolean): boolean {\n const month = this.month();\n return isUnset(month) ? false : read(month);\n }\n\n private onClick(): void {\n const month = this.month();\n if (!isUnset(month)) {\n this.ctx.selectMonth(month);\n }\n }\n\n private onKeyDown(event: KeyboardEvent): void {\n const month = this.month();\n if (!isUnset(month)) {\n this.ctx.handleMonthCellKeydown(event, month);\n }\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { hostLabelledBy } from 'forty-cdk/core';\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * The year picker grid (`role=\"grid\"`). Apply on a `<table>`. Labelled by the\n * `[forCalendarHeading]` via `aria-labelledby` while one is mounted. Exposes\n * `rows()` — iterate rows then cells, binding each cell's `year` to `[forCalendarYearCell]`.\n *\n * Shows an aligned block of `yearBlockSize` years in 3-column rows. Used when\n * `view === 'year'`.\n */\n@Directive({\n selector: '[forCalendarYearGrid]',\n exportAs: 'forCalendarYearGrid',\n host: {\n role: 'grid',\n '[attr.aria-disabled]': 'ctx.disabled() ? \"true\" : null',\n '[attr.aria-readonly]': 'ctx.readonly() ? \"true\" : null',\n '[attr.data-view]': '\"year\"',\n },\n})\nexport class ForCalendarYearGrid {\n private readonly ctx = injectCalendarContext('ForCalendarYearGrid');\n\n private readonly labelledBy = hostLabelledBy(() =>\n this.ctx.hasHeading() ? this.ctx.headingId() : null,\n );\n\n /** Rows of the year picker grid (3 columns) for the aligned block containing the visible year. */\n readonly rows = this.ctx.yearRows;\n}\n","import { computed, Directive, ElementRef, inject, input, type InputSignal } from '@angular/core';\n\nimport { assertInputBound, isUnset, registerHandle, unsetInput, type Unset } from 'forty-cdk/core';\nimport { type ForCalendarYearCellHandle, injectCalendarContext } from './calendar-context';\n\n/**\n * A single year cell (`role=\"gridcell\"`) in the year picker grid. Apply on the\n * `<td>` for each year and bind `[year]` to the year number from `rows()`.\n *\n * Carries the roving tab stop (`tabindex=\"0\"` on the focused year), reflects\n * `aria-selected` (always emitted), `data-today`, `data-selected`,\n * `data-highlighted`, `data-disabled`. Click and `Enter` / `Space` drill down\n * to the month view for that year; arrow / paging keys move the roving cell.\n */\n@Directive({\n selector: '[forCalendarYearCell]',\n exportAs: 'forCalendarYearCell',\n host: {\n role: 'gridcell',\n '[attr.tabindex]': 'focused() ? 0 : -1',\n '[attr.aria-selected]': 'selected() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.data-selected]': 'selected() ? \"\" : null',\n '[attr.data-today]': 'today() ? \"\" : null',\n '[attr.data-highlighted]': 'focused() ? \"\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '(click)': 'onClick()',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForCalendarYearCell {\n private readonly ctx = injectCalendarContext('ForCalendarYearCell');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** The year this cell represents. Mandatory — a cell with no binding throws in dev mode. */\n readonly year: InputSignal<number | Unset> = input(unsetInput<number>());\n\n private readonly selected = computed(() => this.#bound((v) => this.ctx.isYearSelected(v)));\n private readonly today = computed(() => this.#bound((v) => this.ctx.isYearToday(v)));\n private readonly focused = computed(() => this.#bound((v) => this.ctx.isYearFocused(v)));\n private readonly disabled = computed(\n () => this.ctx.disabled() || this.#bound((v) => this.ctx.isYearDisabled(v)),\n );\n\n constructor() {\n assertInputBound(this.year, 'calendar', '[forCalendarYearCell]', 'year');\n const handle: ForCalendarYearCellHandle = {\n host: this.#host.nativeElement,\n year: this.year,\n };\n registerHandle(\n handle,\n (h) => this.ctx.registerYearCell(h),\n (h) => this.ctx.unregisterYearCell(h),\n );\n }\n\n #bound(read: (year: number) => boolean): boolean {\n const year = this.year();\n return isUnset(year) ? false : read(year);\n }\n\n private onClick(): void {\n const year = this.year();\n if (!isUnset(year)) {\n this.ctx.selectYear(year);\n }\n }\n\n private onKeyDown(event: KeyboardEvent): void {\n const year = this.year();\n if (!isUnset(year)) {\n this.ctx.handleYearCellKeydown(event, year);\n }\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { hostButtonType } from 'forty-cdk/core';\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * The view-cycle button in the calendar header. Apply on a `<button>`. Each\n * click advances the view one step coarser (`day → month → year`), clamped at\n * `'year'`. Reflects `data-view` so consumers can style it per view. Disabled\n * when the whole calendar is disabled.\n *\n * Reflects the disabled state through `aria-disabled` + `data-disabled` only —\n * never the native `disabled` attribute — so a focused trigger keeps DOM focus\n * instead of being ejected from the focus order. Cycling is a no-op while\n * disabled (guarded by `ctx.cycleView()`).\n *\n * Bind the `label` signal to the button text to show the active view label\n * (e.g. `\"June 2026\"` in day view, `\"2026\"` in month view, `\"2024 – 2035\"` in\n * year view).\n */\n@Directive({\n selector: '[forCalendarViewTrigger]',\n exportAs: 'forCalendarViewTrigger',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.data-view]': 'ctx.view()',\n '[attr.aria-disabled]': 'ctx.disabled() ? \"true\" : null',\n '[attr.data-disabled]': 'ctx.disabled() ? \"\" : null',\n '(click)': 'ctx.cycleView()',\n },\n})\nexport class ForCalendarViewTrigger {\n private readonly buttonType = hostButtonType();\n\n private readonly ctx = injectCalendarContext('ForCalendarViewTrigger');\n\n /** Label for the active view, e.g. `\"June 2026\"` / `\"2026\"` / `\"2016 – 2027\"`. */\n readonly label = this.ctx.viewTriggerLabel;\n}\n","import { Directive } from '@angular/core';\n\nimport { injectCalendarContext } from './calendar-context';\n\n/**\n * Wires a native `<select>` to a `ForCalendar`'s month navigation. Apply on a\n * `<select>` element inside `[forCalendar]`: the directive keeps the select\n * showing the visible month and navigates the calendar when the user picks a\n * different one, without mutating the selected date.\n *\n * Render the `<option>` elements yourself from {@link options} so you keep full\n * control over their markup, labels, and any placeholder:\n *\n * ```html\n * <select forCalendarMonthSelect #m=\"forCalendarMonthSelect\" aria-label=\"Month\">\n * @for (opt of m.options(); track opt.value) {\n * <option [value]=\"opt.value\" [disabled]=\"opt.disabled\">{{ opt.label }}</option>\n * }\n * </select>\n * ```\n */\n@Directive({\n selector: 'select[forCalendarMonthSelect]',\n exportAs: 'forCalendarMonthSelect',\n host: {\n '[value]': 'ctx.visibleMonthNumber()',\n '[disabled]': 'ctx.disabled()',\n '(change)': 'onChange($event)',\n },\n})\nexport class ForCalendarMonthSelect {\n private readonly ctx = injectCalendarContext('ForCalendarMonthSelect');\n\n /** The twelve localized, bounds-aware month options for the visible year. */\n readonly options = this.ctx.monthOptions;\n\n private onChange(event: Event): void {\n this.ctx.goToMonth(Number((event.target as HTMLSelectElement).value));\n }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { type CalendarYearOption, injectCalendarContext } from './calendar-context';\n\n/**\n * Wires a native `<select>` to a `ForCalendar`'s year navigation. Apply on a\n * `<select>` element inside `[forCalendar]`: the directive keeps the select\n * showing the visible year and navigates the calendar when the user picks a\n * different one, without mutating the selected date.\n *\n * Render the `<option>` elements yourself from {@link years} so you keep full\n * control over their markup:\n *\n * ```html\n * <select\n * forCalendarYearSelect\n * #y=\"forCalendarYearSelect\"\n * aria-label=\"Year\"\n * [minYear]=\"1900\"\n * [maxYear]=\"2100\"\n * >\n * @for (opt of y.years(); track opt.value) {\n * <option [value]=\"opt.value\" [disabled]=\"opt.disabled\">{{ opt.value }}</option>\n * }\n * </select>\n * ```\n */\n@Directive({\n selector: 'select[forCalendarYearSelect]',\n exportAs: 'forCalendarYearSelect',\n host: {\n '[value]': 'ctx.visibleYear()',\n '[disabled]': 'ctx.disabled()',\n '(change)': 'onChange($event)',\n },\n})\nexport class ForCalendarYearSelect {\n private readonly ctx = injectCalendarContext('ForCalendarYearSelect');\n\n /**\n * Lowest year listed in {@link years}. Defaults to 100 years before the\n * current year when `null`.\n */\n readonly minYear = input<number | null>(null);\n\n /**\n * Highest year listed in {@link years}. Defaults to 10 years after the\n * current year when `null`.\n */\n readonly maxYear = input<number | null>(null);\n\n /**\n * The selectable years, from {@link minYear} to {@link maxYear} inclusive.\n * Each entry is `disabled` when the whole year falls outside the calendar's\n * `[min, max]`. The default window is anchored to the current year (not the\n * visible year), so navigating far away never drops the current year off the\n * list.\n */\n readonly years = computed<readonly CalendarYearOption[]>(() => {\n const currentYear = this.ctx.adapter.getYear(this.ctx.adapter.today());\n const min = this.minYear() ?? currentYear - 100;\n const max = this.maxYear() ?? currentYear + 10;\n const out: CalendarYearOption[] = [];\n for (let year = min; year <= max; year++) {\n out.push({ value: year, disabled: this.ctx.isYearDisabled(year) });\n }\n return out;\n });\n\n private onChange(event: Event): void {\n this.ctx.goToYear(Number((event.target as HTMLSelectElement).value));\n }\n}\n"],"mappings":";;;;;AAsCA,IAAa,iBAAb,MAA2B;CAChB;CAGA,0BAA0B,eAAc;EAC/C,MAAM,MAAM,KAAK,MAAM,IAAG;EAC1B,IAAI,QAAQ,MACV,OAAO;EAET,MAAM,UAAU,KAAK,MAAM;EAC3B,MAAM,uBAAuB,QAAQ,QAAQ,KAAK,MAAM,aAAY,GAAI,EAAE;EAC1E,OAAO,cAAc,SAAS,sBAAsB,GAAG,IAAI;CAC7D,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,0BAAA,CAAA,+BAAA,CAAA,CAAA;CAGO,sBAAsB,eAAc;EAC3C,MAAM,MAAM,KAAK,MAAM,IAAG;EAC1B,IAAI,QAAQ,MACV,OAAO;EAET,MAAM,UAAU,KAAK,MAAM;EAC3B,MAAM,oBAAoB,QAAQ,UAAU,KAAK,MAAM,aAAY,GAAI,CAAC;EACxE,OAAO,cAAc,SAAS,mBAAmB,GAAG,IAAI;CAC1D,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,sBAAA,CAAA,+BAAA,CAAA,CAAA;CAEF,YAAY,MAA2B;EACrC,KAAK,QAAQ;CACf;CAGA,mBAAmB,MAAc,OAAa;EAC5C,MAAM,UAAU,KAAK,MAAM;EAC3B,MAAM,WAAW,QAAQ,WAAW,MAAM,OAAO,CAAC;EAClD,MAAM,UAAU,QAAQ,WAAW,MAAM,OAAO,QAAQ,eAAe,QAAQ,CAAC;EAChF,OAAO,KA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