forty-cdk 0.2.0 → 0.3.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/accordion/README.md +122 -0
- package/aspect-ratio/README.md +76 -0
- package/avatar/README.md +100 -0
- package/breadcrumbs/README.md +49 -0
- package/breakpoints/README.md +81 -0
- package/button/README.md +49 -0
- package/calendar/README.md +458 -0
- package/carousel/README.md +358 -0
- package/checkbox/README.md +146 -0
- package/combobox/README.md +535 -0
- package/context-menu/README.md +139 -0
- package/date-field/README.md +184 -0
- package/date-picker/README.md +338 -0
- package/dialog/README.md +388 -0
- package/disclosure/README.md +114 -0
- package/drag-drop/README.md +359 -0
- package/drawer/README.md +560 -0
- package/dropdown-menu/README.md +176 -0
- package/fesm2022/forty-cdk-accordion.mjs +348 -0
- package/fesm2022/forty-cdk-accordion.mjs.map +1 -0
- package/fesm2022/forty-cdk-aspect-ratio.mjs +74 -0
- package/fesm2022/forty-cdk-aspect-ratio.mjs.map +1 -0
- package/fesm2022/forty-cdk-avatar.mjs +308 -0
- package/fesm2022/forty-cdk-avatar.mjs.map +1 -0
- package/fesm2022/forty-cdk-breadcrumbs.mjs +125 -0
- package/fesm2022/forty-cdk-breadcrumbs.mjs.map +1 -0
- package/fesm2022/forty-cdk-breakpoints.mjs +117 -0
- package/fesm2022/forty-cdk-breakpoints.mjs.map +1 -0
- package/fesm2022/forty-cdk-button.mjs +134 -0
- package/fesm2022/forty-cdk-button.mjs.map +1 -0
- package/fesm2022/forty-cdk-calendar.mjs +2034 -0
- package/fesm2022/forty-cdk-calendar.mjs.map +1 -0
- package/fesm2022/forty-cdk-carousel.mjs +968 -0
- package/fesm2022/forty-cdk-carousel.mjs.map +1 -0
- package/fesm2022/forty-cdk-checkbox.mjs +226 -0
- package/fesm2022/forty-cdk-checkbox.mjs.map +1 -0
- package/fesm2022/forty-cdk-combobox.mjs +2596 -0
- package/fesm2022/forty-cdk-combobox.mjs.map +1 -0
- package/fesm2022/forty-cdk-context-menu.mjs +413 -0
- package/fesm2022/forty-cdk-context-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-core.mjs +9022 -0
- package/fesm2022/forty-cdk-core.mjs.map +1 -0
- package/fesm2022/forty-cdk-date-field.mjs +744 -0
- package/fesm2022/forty-cdk-date-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-date-picker.mjs +1011 -0
- package/fesm2022/forty-cdk-date-picker.mjs.map +1 -0
- package/fesm2022/forty-cdk-dialog.mjs +707 -0
- package/fesm2022/forty-cdk-dialog.mjs.map +1 -0
- package/fesm2022/forty-cdk-disclosure.mjs +190 -0
- package/fesm2022/forty-cdk-disclosure.mjs.map +1 -0
- package/fesm2022/forty-cdk-drag-drop.mjs +1180 -0
- package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -0
- package/fesm2022/forty-cdk-drawer.mjs +1641 -0
- package/fesm2022/forty-cdk-drawer.mjs.map +1 -0
- package/fesm2022/forty-cdk-dropdown-menu.mjs +350 -0
- package/fesm2022/forty-cdk-dropdown-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-field.mjs +425 -0
- package/fesm2022/forty-cdk-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-fieldset.mjs +164 -0
- package/fesm2022/forty-cdk-fieldset.mjs.map +1 -0
- package/fesm2022/forty-cdk-file-upload.mjs +221 -0
- package/fesm2022/forty-cdk-file-upload.mjs.map +1 -0
- package/fesm2022/forty-cdk-hover-card.mjs +496 -0
- package/fesm2022/forty-cdk-hover-card.mjs.map +1 -0
- package/fesm2022/forty-cdk-input.mjs +274 -0
- package/fesm2022/forty-cdk-input.mjs.map +1 -0
- package/fesm2022/forty-cdk-internationalized-date.mjs +1 -1
- package/fesm2022/forty-cdk-internationalized-date.mjs.map +1 -1
- package/fesm2022/forty-cdk-listbox.mjs +1279 -0
- package/fesm2022/forty-cdk-listbox.mjs.map +1 -0
- package/fesm2022/forty-cdk-menu.mjs +1439 -0
- package/fesm2022/forty-cdk-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-menubar.mjs +787 -0
- package/fesm2022/forty-cdk-menubar.mjs.map +1 -0
- package/fesm2022/forty-cdk-meter.mjs +211 -0
- package/fesm2022/forty-cdk-meter.mjs.map +1 -0
- package/fesm2022/forty-cdk-navigation-menu.mjs +1145 -0
- package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-number-input.mjs +559 -0
- package/fesm2022/forty-cdk-number-input.mjs.map +1 -0
- package/fesm2022/forty-cdk-otp-input.mjs +527 -0
- package/fesm2022/forty-cdk-otp-input.mjs.map +1 -0
- package/fesm2022/forty-cdk-pagination.mjs +323 -0
- package/fesm2022/forty-cdk-pagination.mjs.map +1 -0
- package/fesm2022/forty-cdk-pane-resizer.mjs +297 -0
- package/fesm2022/forty-cdk-pane-resizer.mjs.map +1 -0
- package/fesm2022/forty-cdk-popover.mjs +698 -0
- package/fesm2022/forty-cdk-popover.mjs.map +1 -0
- package/fesm2022/forty-cdk-progress.mjs +226 -0
- package/fesm2022/forty-cdk-progress.mjs.map +1 -0
- package/fesm2022/forty-cdk-radio-group.mjs +378 -0
- package/fesm2022/forty-cdk-radio-group.mjs.map +1 -0
- package/fesm2022/forty-cdk-scroll-area.mjs +640 -0
- package/fesm2022/forty-cdk-scroll-area.mjs.map +1 -0
- package/fesm2022/forty-cdk-search.mjs +205 -0
- package/fesm2022/forty-cdk-search.mjs.map +1 -0
- package/fesm2022/forty-cdk-select.mjs +1661 -0
- package/fesm2022/forty-cdk-select.mjs.map +1 -0
- package/fesm2022/forty-cdk-separator.mjs +82 -0
- package/fesm2022/forty-cdk-separator.mjs.map +1 -0
- package/fesm2022/forty-cdk-signal-forms.mjs +97 -0
- package/fesm2022/forty-cdk-signal-forms.mjs.map +1 -0
- package/fesm2022/forty-cdk-slider.mjs +803 -0
- package/fesm2022/forty-cdk-slider.mjs.map +1 -0
- package/fesm2022/forty-cdk-stepper.mjs +886 -0
- package/fesm2022/forty-cdk-stepper.mjs.map +1 -0
- package/fesm2022/forty-cdk-switch.mjs +137 -0
- package/fesm2022/forty-cdk-switch.mjs.map +1 -0
- package/fesm2022/forty-cdk-table.mjs +1518 -0
- package/fesm2022/forty-cdk-table.mjs.map +1 -0
- package/fesm2022/forty-cdk-tabs.mjs +400 -0
- package/fesm2022/forty-cdk-tabs.mjs.map +1 -0
- package/fesm2022/forty-cdk-time-field.mjs +593 -0
- package/fesm2022/forty-cdk-time-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-time-picker.mjs +1013 -0
- package/fesm2022/forty-cdk-time-picker.mjs.map +1 -0
- package/fesm2022/forty-cdk-toast.mjs +1153 -0
- package/fesm2022/forty-cdk-toast.mjs.map +1 -0
- package/fesm2022/forty-cdk-toggle.mjs +516 -0
- package/fesm2022/forty-cdk-toggle.mjs.map +1 -0
- package/fesm2022/forty-cdk-toolbar.mjs +374 -0
- package/fesm2022/forty-cdk-toolbar.mjs.map +1 -0
- package/fesm2022/forty-cdk-tooltip.mjs +672 -0
- package/fesm2022/forty-cdk-tooltip.mjs.map +1 -0
- package/fesm2022/forty-cdk-tree.mjs +2007 -0
- package/fesm2022/forty-cdk-tree.mjs.map +1 -0
- package/fesm2022/forty-cdk-virtualization.mjs +1 -1
- package/fesm2022/forty-cdk-virtualization.mjs.map +1 -1
- package/fesm2022/forty-cdk.mjs +0 -43310
- package/fesm2022/forty-cdk.mjs.map +1 -1
- package/field/README.md +97 -0
- package/fieldset/README.md +86 -0
- package/file-upload/README.md +73 -0
- package/hover-card/README.md +171 -0
- package/input/README.md +156 -0
- package/listbox/README.md +424 -0
- package/menu/README.md +181 -0
- package/menubar/README.md +140 -0
- package/meter/README.md +128 -0
- package/navigation-menu/README.md +253 -0
- package/number-input/README.md +171 -0
- package/otp-input/README.md +198 -0
- package/package.json +213 -1
- package/pagination/README.md +61 -0
- package/pane-resizer/README.md +136 -0
- package/popover/README.md +262 -0
- package/progress/README.md +115 -0
- package/radio-group/README.md +129 -0
- package/scroll-area/README.md +184 -0
- package/search/README.md +42 -0
- package/select/README.md +488 -0
- package/separator/README.md +84 -0
- package/signal-forms/README.md +72 -0
- package/slider/README.md +152 -0
- package/stepper/README.md +292 -0
- package/switch/README.md +116 -0
- package/table/README.md +769 -0
- package/tabs/README.md +130 -0
- package/time-field/README.md +157 -0
- package/time-picker/README.md +172 -0
- package/toast/README.md +398 -0
- package/toggle/README.md +224 -0
- package/toolbar/README.md +109 -0
- package/tooltip/README.md +274 -0
- package/tree/README.md +708 -0
- package/types/forty-cdk-accordion.d.ts +242 -0
- package/types/forty-cdk-aspect-ratio.d.ts +59 -0
- package/types/forty-cdk-avatar.d.ts +133 -0
- package/types/forty-cdk-breadcrumbs.d.ts +92 -0
- package/types/forty-cdk-breakpoints.d.ts +141 -0
- package/types/forty-cdk-button.d.ts +80 -0
- package/types/forty-cdk-calendar.d.ts +914 -0
- package/types/forty-cdk-carousel.d.ts +530 -0
- package/types/forty-cdk-checkbox.d.ts +141 -0
- package/types/forty-cdk-combobox.d.ts +1259 -0
- package/types/forty-cdk-context-menu.d.ts +313 -0
- package/types/forty-cdk-core.d.ts +5774 -0
- package/types/forty-cdk-date-field.d.ts +307 -0
- package/types/forty-cdk-date-picker.d.ts +622 -0
- package/types/forty-cdk-dialog.d.ts +546 -0
- package/types/forty-cdk-disclosure.d.ts +127 -0
- package/types/forty-cdk-drag-drop.d.ts +456 -0
- package/types/forty-cdk-drawer.d.ts +871 -0
- package/types/forty-cdk-dropdown-menu.d.ts +242 -0
- package/types/forty-cdk-field.d.ts +236 -0
- package/types/forty-cdk-fieldset.d.ts +119 -0
- package/types/forty-cdk-file-upload.d.ts +124 -0
- package/types/forty-cdk-hover-card.d.ts +320 -0
- package/types/forty-cdk-input.d.ts +169 -0
- package/types/forty-cdk-internationalized-date.d.ts +1 -1
- package/types/forty-cdk-listbox.d.ts +513 -0
- package/types/forty-cdk-menu.d.ts +629 -0
- package/types/forty-cdk-menubar.d.ts +451 -0
- package/types/forty-cdk-meter.d.ts +122 -0
- package/types/forty-cdk-navigation-menu.d.ts +514 -0
- package/types/forty-cdk-number-input.d.ts +319 -0
- package/types/forty-cdk-otp-input.d.ts +248 -0
- package/types/forty-cdk-pagination.d.ts +214 -0
- package/types/forty-cdk-pane-resizer.d.ts +145 -0
- package/types/forty-cdk-popover.d.ts +509 -0
- package/types/forty-cdk-progress.d.ts +143 -0
- package/types/forty-cdk-radio-group.d.ts +222 -0
- package/types/forty-cdk-scroll-area.d.ts +258 -0
- package/types/forty-cdk-search.d.ts +142 -0
- package/types/forty-cdk-select.d.ts +899 -0
- package/types/forty-cdk-separator.d.ts +59 -0
- package/types/forty-cdk-signal-forms.d.ts +58 -0
- package/types/forty-cdk-slider.d.ts +379 -0
- package/types/forty-cdk-stepper.d.ts +650 -0
- package/types/forty-cdk-switch.d.ts +87 -0
- package/types/forty-cdk-table.d.ts +723 -0
- package/types/forty-cdk-tabs.d.ts +235 -0
- package/types/forty-cdk-time-field.d.ts +307 -0
- package/types/forty-cdk-time-picker.d.ts +578 -0
- package/types/forty-cdk-toast.d.ts +598 -0
- package/types/forty-cdk-toggle.d.ts +310 -0
- package/types/forty-cdk-toolbar.d.ts +217 -0
- package/types/forty-cdk-tooltip.d.ts +436 -0
- package/types/forty-cdk-tree.d.ts +688 -0
- package/types/forty-cdk.d.ts +1 -19743
|
@@ -0,0 +1,914 @@
|
|
|
1
|
+
import * as forty_cdk_calendar from 'forty-cdk/calendar';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
import { InjectionToken, Signal, Provider } from '@angular/core';
|
|
4
|
+
import { DateAdapter, WritingDirection } from 'forty-cdk/core';
|
|
5
|
+
export { DateAdapter, FOR_DATE_ADAPTER, TimeCapableDateAdapter, assertTimeCapable, injectDateAdapter } from 'forty-cdk/core';
|
|
6
|
+
|
|
7
|
+
/** The active display mode of a `ForCalendar`. */
|
|
8
|
+
type CalendarView = 'day' | 'month' | 'year';
|
|
9
|
+
/**
|
|
10
|
+
* An inclusive date range where `start <= end` (day-granular). Used by
|
|
11
|
+
* `ForCalendar` and `ForDatePicker` in `selectionMode="range"`.
|
|
12
|
+
*
|
|
13
|
+
* @typeParam D The adapter's date type.
|
|
14
|
+
*/
|
|
15
|
+
interface CalendarDateRange<D> {
|
|
16
|
+
/** Inclusive start of the range. */
|
|
17
|
+
readonly start: D;
|
|
18
|
+
/** Inclusive end of the range (`>= start`). */
|
|
19
|
+
readonly end: D;
|
|
20
|
+
}
|
|
21
|
+
/** A selectable year in the year picker grid. */
|
|
22
|
+
interface CalendarYearOption {
|
|
23
|
+
/** The full year (e.g. `2026`). */
|
|
24
|
+
readonly value: number;
|
|
25
|
+
/** Whether the entire year falls outside `[min, max]`. */
|
|
26
|
+
readonly disabled: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** A row of three months in the month picker grid. */
|
|
29
|
+
interface CalendarMonthRow {
|
|
30
|
+
/** Stable key for `@for` tracking. */
|
|
31
|
+
readonly key: string;
|
|
32
|
+
/** The (up to three) month options in this row. */
|
|
33
|
+
readonly months: readonly CalendarMonthOption[];
|
|
34
|
+
}
|
|
35
|
+
/** A row of three years in the year picker grid. */
|
|
36
|
+
interface CalendarYearRow {
|
|
37
|
+
/** Stable key for `@for` tracking. */
|
|
38
|
+
readonly key: string;
|
|
39
|
+
/** The (up to three) year options in this row. */
|
|
40
|
+
readonly years: readonly CalendarYearOption[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Handle a `ForCalendarMonthCell` registers with the root so the root can move
|
|
44
|
+
* DOM focus to the correct cell during keyboard navigation and view switches.
|
|
45
|
+
*/
|
|
46
|
+
interface ForCalendarMonthCellHandle {
|
|
47
|
+
/** The `role="gridcell"` host element. */
|
|
48
|
+
readonly host: HTMLElement;
|
|
49
|
+
/** The month this cell represents, **1-12**. */
|
|
50
|
+
readonly month: Signal<number>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Handle a `ForCalendarYearCell` registers with the root so the root can move
|
|
54
|
+
* DOM focus to the correct cell during keyboard navigation and view switches.
|
|
55
|
+
*/
|
|
56
|
+
interface ForCalendarYearCellHandle {
|
|
57
|
+
/** The `role="gridcell"` host element. */
|
|
58
|
+
readonly host: HTMLElement;
|
|
59
|
+
/** The year this cell represents. */
|
|
60
|
+
readonly year: Signal<number>;
|
|
61
|
+
}
|
|
62
|
+
/** A selectable month in the visible year, for building a month dropdown. */
|
|
63
|
+
interface CalendarMonthOption {
|
|
64
|
+
/** Month number, **1-12**. */
|
|
65
|
+
readonly value: number;
|
|
66
|
+
/** Localized month name via the adapter (e.g. `"June"`). */
|
|
67
|
+
readonly label: string;
|
|
68
|
+
/** Whether the whole month falls outside `[min, max]`. */
|
|
69
|
+
readonly disabled: boolean;
|
|
70
|
+
}
|
|
71
|
+
/** A weekday column header in the calendar grid. */
|
|
72
|
+
interface CalendarWeekday {
|
|
73
|
+
/** Stable key for `@for` tracking (the **0-6** weekday index as a string). */
|
|
74
|
+
readonly key: string;
|
|
75
|
+
/** Narrow label, e.g. `"M"`. */
|
|
76
|
+
readonly narrow: string;
|
|
77
|
+
/** Short label, e.g. `"Mon"`. */
|
|
78
|
+
readonly short: string;
|
|
79
|
+
/** Long label, e.g. `"Monday"`. */
|
|
80
|
+
readonly long: string;
|
|
81
|
+
}
|
|
82
|
+
/** A single day cell in the calendar grid. */
|
|
83
|
+
interface CalendarDayCell<D> {
|
|
84
|
+
/** Stable key for `@for` tracking (`year-month-day`). */
|
|
85
|
+
readonly key: string;
|
|
86
|
+
/** The date this cell represents. Bind to `[date]` on `[forCalendarCell]`. */
|
|
87
|
+
readonly date: D;
|
|
88
|
+
/** Day-of-month label, e.g. `"1"`. The cell's visible content. */
|
|
89
|
+
readonly label: string;
|
|
90
|
+
/**
|
|
91
|
+
* Full accessible date string for the cell, host-bound to `aria-label` by
|
|
92
|
+
* `[forCalendarCell]`. Defaults to the localized full date (e.g.
|
|
93
|
+
* `"Monday, June 15, 2026"`); outside-month padding days are suffixed so
|
|
94
|
+
* assistive tech can tell them apart from the visible month. Customize the
|
|
95
|
+
* format with `ForCalendar`'s `dateLabel` input.
|
|
96
|
+
*/
|
|
97
|
+
readonly dateLabel: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Formats the full accessible date string a calendar gridcell exposes as its
|
|
101
|
+
* `aria-label`. Supplied to `ForCalendar`'s `dateLabel` input to override the
|
|
102
|
+
* default localized full date.
|
|
103
|
+
*
|
|
104
|
+
* @typeParam D The adapter's date type.
|
|
105
|
+
* @param date The cell's date.
|
|
106
|
+
* @param context Formatting context: the active {@link DateAdapter} and whether
|
|
107
|
+
* the date falls outside the visible month.
|
|
108
|
+
*/
|
|
109
|
+
type CalendarDateLabelFormatter<D> = (date: D, context: {
|
|
110
|
+
readonly adapter: DateAdapter<D>;
|
|
111
|
+
readonly outsideMonth: boolean;
|
|
112
|
+
}) => string;
|
|
113
|
+
/** A week row in the calendar grid. */
|
|
114
|
+
interface CalendarWeek<D> {
|
|
115
|
+
/** Stable key for `@for` tracking (the first day's `year-month-day`). */
|
|
116
|
+
readonly key: string;
|
|
117
|
+
/** The seven day cells of this week, starting at `firstDayOfWeek`. */
|
|
118
|
+
readonly days: readonly CalendarDayCell<D>[];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Handle a `ForCalendarCell` registers with the root so it can move DOM focus
|
|
122
|
+
* to the cell matching a target date after the grid re-renders (e.g. when
|
|
123
|
+
* keyboard navigation crosses a month boundary).
|
|
124
|
+
*/
|
|
125
|
+
interface ForCalendarCellHandle<D> {
|
|
126
|
+
/** The `role="gridcell"` host element. */
|
|
127
|
+
readonly host: HTMLElement;
|
|
128
|
+
/** The date this cell represents. */
|
|
129
|
+
readonly date: Signal<D>;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Coordination contract owned by `ForCalendar` (the root). Grid, header,
|
|
133
|
+
* cells, heading, and the navigation buttons all derive their state from it
|
|
134
|
+
* and route selection / navigation through it.
|
|
135
|
+
*
|
|
136
|
+
* The token is typed over `unknown`; pieces pass their own `D` into the
|
|
137
|
+
* `unknown`-typed methods (always assignable) and never need the concrete `D`
|
|
138
|
+
* back out.
|
|
139
|
+
*
|
|
140
|
+
* @typeParam D The adapter's date type.
|
|
141
|
+
*/
|
|
142
|
+
interface ForCalendarContext<D> {
|
|
143
|
+
/** The active date adapter. */
|
|
144
|
+
readonly adapter: DateAdapter<D>;
|
|
145
|
+
/** Resolved writing direction (`'ltr'` / `'rtl'`); flips horizontal arrows. */
|
|
146
|
+
readonly dir: Signal<WritingDirection>;
|
|
147
|
+
/** Whether the whole calendar is disabled (no focus, no selection). */
|
|
148
|
+
readonly disabled: Signal<boolean>;
|
|
149
|
+
/** Whether the calendar is read-only (focusable, but selection is blocked). */
|
|
150
|
+
readonly readonly: Signal<boolean>;
|
|
151
|
+
/** Stable id of the heading element, used for the grid's `aria-labelledby`. */
|
|
152
|
+
readonly headingId: Signal<string>;
|
|
153
|
+
/** The visible month's accessible label, e.g. `"June 2026"`. */
|
|
154
|
+
readonly visibleMonthLabel: Signal<string>;
|
|
155
|
+
/** Weekday column headers for the visible month. */
|
|
156
|
+
readonly weekDays: Signal<readonly CalendarWeekday[]>;
|
|
157
|
+
/** Week rows of the visible month, including outside-month padding days. */
|
|
158
|
+
readonly weeks: Signal<readonly CalendarWeek<D>[]>;
|
|
159
|
+
/** Whether the previous-month button should be disabled (bounded by `min`). */
|
|
160
|
+
readonly isPreviousMonthDisabled: Signal<boolean>;
|
|
161
|
+
/** Whether the next-month button should be disabled (bounded by `max`). */
|
|
162
|
+
readonly isNextMonthDisabled: Signal<boolean>;
|
|
163
|
+
/** The visible month's full year (e.g. `2026`). */
|
|
164
|
+
readonly visibleYear: Signal<number>;
|
|
165
|
+
/** The visible month, **1-12**. */
|
|
166
|
+
readonly visibleMonthNumber: Signal<number>;
|
|
167
|
+
/** Twelve localized, bounds-aware month options for the visible year. */
|
|
168
|
+
readonly monthOptions: Signal<readonly CalendarMonthOption[]>;
|
|
169
|
+
/** Set the visible month to (`year`, `month`) without selecting. `month` is **1-12**. */
|
|
170
|
+
goTo(year: number, month: number): void;
|
|
171
|
+
/** Set the visible month within the current visible year. `month` is **1-12**. */
|
|
172
|
+
goToMonth(month: number): void;
|
|
173
|
+
/** Set the visible year, keeping the current visible month. */
|
|
174
|
+
goToYear(year: number): void;
|
|
175
|
+
/** Whether every day of `month` (**1-12**) in the visible year is out of `[min, max]`. */
|
|
176
|
+
isMonthDisabled(month: number): boolean;
|
|
177
|
+
/** Whether every day of `year` is out of `[min, max]`. */
|
|
178
|
+
isYearDisabled(year: number): boolean;
|
|
179
|
+
/** Active calendar view; `'day'` (default), `'month'`, or `'year'`. */
|
|
180
|
+
readonly view: Signal<CalendarView>;
|
|
181
|
+
/** Number of years the year picker shows as an aligned block. Default `12`. */
|
|
182
|
+
readonly yearBlockSize: Signal<number>;
|
|
183
|
+
/** Rows of the month picker grid (3 columns) for the visible year. */
|
|
184
|
+
readonly monthRows: Signal<readonly CalendarMonthRow[]>;
|
|
185
|
+
/** Rows of the year picker grid (3 columns) for the aligned block containing the visible year. */
|
|
186
|
+
readonly yearRows: Signal<readonly CalendarYearRow[]>;
|
|
187
|
+
/** Label for the active view shown on the view-trigger button. */
|
|
188
|
+
readonly viewTriggerLabel: Signal<string>;
|
|
189
|
+
/** Whether the prev button should be disabled for the active view. */
|
|
190
|
+
readonly isPreviousDisabled: Signal<boolean>;
|
|
191
|
+
/** Whether the next button should be disabled for the active view. */
|
|
192
|
+
readonly isNextDisabled: Signal<boolean>;
|
|
193
|
+
/** Cycle the view one step coarser: `day → month → year`, clamped at `'year'`. */
|
|
194
|
+
cycleView(): void;
|
|
195
|
+
/** Drill into a month (1-12): navigate to it and switch to day view. No-op when disabled/read-only/out of bounds. */
|
|
196
|
+
selectMonth(month: number): void;
|
|
197
|
+
/** Drill into a year: navigate to it and switch to month view. No-op when disabled/read-only/out of bounds. */
|
|
198
|
+
selectYear(year: number): void;
|
|
199
|
+
/** Page backward by one month / year / block depending on the active view. */
|
|
200
|
+
pagePrevious(): void;
|
|
201
|
+
/** Page forward by one month / year / block depending on the active view. */
|
|
202
|
+
pageNext(): void;
|
|
203
|
+
/** Whether `month` (1-12) in the visible year is the selected date's month. */
|
|
204
|
+
isMonthSelected(month: number): boolean;
|
|
205
|
+
/** Whether `month` (1-12) is today's month in the visible year. */
|
|
206
|
+
isMonthToday(month: number): boolean;
|
|
207
|
+
/** Whether `month` (1-12) is the roving-tabindex focused month. */
|
|
208
|
+
isMonthFocused(month: number): boolean;
|
|
209
|
+
/** Whether `year` is the selected date's year. */
|
|
210
|
+
isYearSelected(year: number): boolean;
|
|
211
|
+
/** Whether `year` is today's year. */
|
|
212
|
+
isYearToday(year: number): boolean;
|
|
213
|
+
/** Whether `year` is the roving-tabindex focused year. */
|
|
214
|
+
isYearFocused(year: number): boolean;
|
|
215
|
+
/** Handle a keydown originating on a month cell. */
|
|
216
|
+
handleMonthCellKeydown(event: KeyboardEvent, month: number): void;
|
|
217
|
+
/** Handle a keydown originating on a year cell. */
|
|
218
|
+
handleYearCellKeydown(event: KeyboardEvent, year: number): void;
|
|
219
|
+
registerMonthCell(handle: ForCalendarMonthCellHandle): void;
|
|
220
|
+
unregisterMonthCell(handle: ForCalendarMonthCellHandle): void;
|
|
221
|
+
registerYearCell(handle: ForCalendarYearCellHandle): void;
|
|
222
|
+
unregisterYearCell(handle: ForCalendarYearCellHandle): void;
|
|
223
|
+
/** Whether `date` is the currently selected value. */
|
|
224
|
+
isSelected(date: D): boolean;
|
|
225
|
+
/** Whether `date` is today. */
|
|
226
|
+
isToday(date: D): boolean;
|
|
227
|
+
/** Whether `date` is the roving-tabindex focused day. */
|
|
228
|
+
isFocused(date: D): boolean;
|
|
229
|
+
/** Whether `date` falls outside the visible month. */
|
|
230
|
+
isOutsideMonth(date: D): boolean;
|
|
231
|
+
/** Whether `date` cannot be selected (`disabled`, out of `min`/`max`, or unavailable). */
|
|
232
|
+
isUnavailable(date: D): boolean;
|
|
233
|
+
/** The full accessible date string for `date`'s gridcell (`aria-label`). */
|
|
234
|
+
getDateLabel(date: D): string;
|
|
235
|
+
/**
|
|
236
|
+
* The active selection mode. `'single'` (default) keeps the existing
|
|
237
|
+
* single-date behaviour; `'range'` enables the two-click anchor → commit flow.
|
|
238
|
+
*/
|
|
239
|
+
readonly selectionMode: Signal<'single' | 'range'>;
|
|
240
|
+
/**
|
|
241
|
+
* Whether `date` is the start of the effective range (committed when idle,
|
|
242
|
+
* preview when a selection is in progress).
|
|
243
|
+
*/
|
|
244
|
+
isRangeStart(date: D): boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Whether `date` is the end of the effective range (committed when idle,
|
|
247
|
+
* preview when a selection is in progress).
|
|
248
|
+
*/
|
|
249
|
+
isRangeEnd(date: D): boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Whether `date` falls within the **committed** range, inclusive (idle state
|
|
252
|
+
* only; mutually exclusive with `isRangePreview`).
|
|
253
|
+
*/
|
|
254
|
+
isInRange(date: D): boolean;
|
|
255
|
+
/**
|
|
256
|
+
* Whether `date` falls within the **preview** band, inclusive (selecting
|
|
257
|
+
* state only; mutually exclusive with `isInRange`).
|
|
258
|
+
*/
|
|
259
|
+
isRangePreview(date: D): boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Update the pointer-hovered date for the range preview. Ignored in
|
|
262
|
+
* `selectionMode='single'`. Pass `null` on `pointerleave`.
|
|
263
|
+
*/
|
|
264
|
+
setHovered(date: D | null): void;
|
|
265
|
+
/** Select `date`, unless the calendar is disabled / read-only or the date is unavailable. */
|
|
266
|
+
selectDate(date: D): void;
|
|
267
|
+
/** Page the visible month by `delta` (signed month count). Keeps DOM focus on the caller. */
|
|
268
|
+
pageMonths(delta: number): void;
|
|
269
|
+
/** Resolve and apply a keydown originating on the cell for `fromDate`. */
|
|
270
|
+
handleCellKeydown(event: KeyboardEvent, fromDate: D): void;
|
|
271
|
+
/**
|
|
272
|
+
* Move DOM focus to the roving cell (the gridcell matching the focused date).
|
|
273
|
+
* Returns `false` when no matching cell is currently rendered.
|
|
274
|
+
*/
|
|
275
|
+
focusActiveCell(): boolean;
|
|
276
|
+
registerCell(handle: ForCalendarCellHandle<D>): void;
|
|
277
|
+
unregisterCell(handle: ForCalendarCellHandle<D>): void;
|
|
278
|
+
/** Adopts a consumer-set static `id` on the heading host into `headingId`. */
|
|
279
|
+
adoptHeadingId(el: HTMLElement): void;
|
|
280
|
+
}
|
|
281
|
+
/** Injection token for {@link ForCalendarContext}, provided by `ForCalendar`. */
|
|
282
|
+
declare const FOR_CALENDAR_CONTEXT: InjectionToken<ForCalendarContext<unknown>>;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Headless implementation of a single-date calendar grid following the
|
|
286
|
+
* [WAI-ARIA Grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/), the
|
|
287
|
+
* date table at the heart of the APG
|
|
288
|
+
* [Date Picker Dialog](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/)
|
|
289
|
+
* example.
|
|
290
|
+
*
|
|
291
|
+
* `ForCalendar` is the root: it owns the selected value, the focused date, and
|
|
292
|
+
* the visible month, and exposes them to the grid / header / cell / heading /
|
|
293
|
+
* navigation pieces through `FOR_CALENDAR_CONTEXT`. All date math goes through
|
|
294
|
+
* a pluggable {@link DateAdapter} (`provideInternationalizedDateAdapter()` or
|
|
295
|
+
* `provideNativeDateAdapter()`), so the library hard-depends on no date
|
|
296
|
+
* library.
|
|
297
|
+
*
|
|
298
|
+
* The grid uses roving tabindex: exactly one cell (the focused date) carries
|
|
299
|
+
* `tabindex="0"`. Arrow / `Home` / `End` / `PageUp` / `PageDown` /
|
|
300
|
+
* `Shift+PageUp` / `Shift+PageDown` move the focused date, re-paging the grid
|
|
301
|
+
* when crossing a month boundary; `Enter` / `Space` select.
|
|
302
|
+
*
|
|
303
|
+
* The day / month / year views are each backed by a sub-grid collaborator
|
|
304
|
+
* ({@link CalendarDayNavigator} / {@link CalendarMonthNavigator} /
|
|
305
|
+
* {@link CalendarYearNavigator}), and range selection by
|
|
306
|
+
* {@link CalendarRangeSelection}; the root wires them together and exposes the
|
|
307
|
+
* `[(value)]` / `[(view)]` / `[(range)]` models.
|
|
308
|
+
*
|
|
309
|
+
* `ForCalendar` is the grid widget, not a form value — it exposes `[(value)]`
|
|
310
|
+
* as a `model<D | null>` in `selectionMode="single"` (default), and
|
|
311
|
+
* `[(range)]` as a `model<CalendarDateRange<D> | null>` in
|
|
312
|
+
* `selectionMode="range"`. The `FormValueControl<D>` contract arrives with the
|
|
313
|
+
* follow-up `ForDatePicker` / `ForDateField`. See the primitive's README for a
|
|
314
|
+
* complete styleless usage example.
|
|
315
|
+
*
|
|
316
|
+
* @typeParam D The adapter's immutable date type.
|
|
317
|
+
*/
|
|
318
|
+
declare class ForCalendar<D> implements ForCalendarContext<D> {
|
|
319
|
+
#private;
|
|
320
|
+
/** The active date adapter, resolved from `FOR_DATE_ADAPTER`. */
|
|
321
|
+
readonly adapter: DateAdapter<D>;
|
|
322
|
+
/**
|
|
323
|
+
* Two-way bindable selected date, or `null`. The `model()` change emitter
|
|
324
|
+
* (`(valueChange)`) fires only when the calendar itself updates the value
|
|
325
|
+
* (cell activation), never on consumer writes via `[(value)]`.
|
|
326
|
+
*/
|
|
327
|
+
readonly value: _angular_core.ModelSignal<D | null>;
|
|
328
|
+
/** Minimum selectable date (inclusive). Dates before it are unavailable. */
|
|
329
|
+
readonly min: _angular_core.InputSignal<D | null>;
|
|
330
|
+
/** Maximum selectable date (inclusive). Dates after it are unavailable. */
|
|
331
|
+
readonly max: _angular_core.InputSignal<D | null>;
|
|
332
|
+
/**
|
|
333
|
+
* Per-date predicate marking a date as unavailable (present in the grid but
|
|
334
|
+
* not selectable, reflected as `aria-disabled` / `data-disabled`).
|
|
335
|
+
*/
|
|
336
|
+
readonly isDateUnavailable: _angular_core.InputSignal<(date: D) => boolean>;
|
|
337
|
+
/**
|
|
338
|
+
* Formats the full accessible date string each gridcell exposes as its
|
|
339
|
+
* `aria-label` (the visible content stays the bare day number). Defaults to
|
|
340
|
+
* the localized full date (e.g. `"Monday, June 15, 2026"`), with
|
|
341
|
+
* outside-month padding days suffixed (`" (outside month)"`) so assistive
|
|
342
|
+
* tech can tell them apart from the visible month. Override to localize that
|
|
343
|
+
* suffix or change the format entirely.
|
|
344
|
+
*/
|
|
345
|
+
readonly dateLabel: _angular_core.InputSignal<CalendarDateLabelFormatter<D>>;
|
|
346
|
+
/** Disables the whole calendar: no focus movement, no selection. */
|
|
347
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
348
|
+
/** Makes the calendar read-only: dates stay focusable but selection is blocked. */
|
|
349
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
350
|
+
/**
|
|
351
|
+
* Selection mode. `'single'` (default) keeps the single-date `[(value)]`
|
|
352
|
+
* behaviour unchanged. `'range'` switches to the two-click anchor → commit
|
|
353
|
+
* flow and exposes the result through `[(range)]`.
|
|
354
|
+
*/
|
|
355
|
+
readonly selectionMode: _angular_core.InputSignal<"single" | "range">;
|
|
356
|
+
/**
|
|
357
|
+
* Active calendar view. `'day'` (default) shows the date grid; `'month'` and
|
|
358
|
+
* `'year'` show the month / year picker grids. Two-way bindable; the `model()`
|
|
359
|
+
* change emitter (`(viewChange)`) fires only when the calendar itself cycles
|
|
360
|
+
* or drills the view, never on consumer writes via `[(view)]`.
|
|
361
|
+
*/
|
|
362
|
+
readonly view: _angular_core.ModelSignal<CalendarView>;
|
|
363
|
+
/**
|
|
364
|
+
* Number of years the year view shows, as an aligned block containing the
|
|
365
|
+
* visible year. Default `12`.
|
|
366
|
+
*/
|
|
367
|
+
readonly yearBlockSize: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
368
|
+
/**
|
|
369
|
+
* Two-way bindable committed date range, or `null`. Only used when
|
|
370
|
+
* `selectionMode="range"`. The `model()` change emitter (`(rangeChange)`)
|
|
371
|
+
* fires only when the calendar internally commits or clears a range, never
|
|
372
|
+
* on consumer writes via `[(range)]`.
|
|
373
|
+
*/
|
|
374
|
+
readonly range: _angular_core.ModelSignal<CalendarDateRange<D> | null>;
|
|
375
|
+
/**
|
|
376
|
+
* Minimum inclusive day count for a range selection. A click that would
|
|
377
|
+
* commit a range shorter than this is a no-op (anchor is preserved).
|
|
378
|
+
* `null` (default) means no minimum. Only honoured in `selectionMode="range"`.
|
|
379
|
+
*/
|
|
380
|
+
readonly minRangeLength: _angular_core.InputSignal<number | null>;
|
|
381
|
+
/**
|
|
382
|
+
* Maximum inclusive day count for a range selection. A click that would
|
|
383
|
+
* commit a range longer than this is a no-op (anchor is preserved).
|
|
384
|
+
* `null` (default) means no maximum. Only honoured in `selectionMode="range"`.
|
|
385
|
+
*/
|
|
386
|
+
readonly maxRangeLength: _angular_core.InputSignal<number | null>;
|
|
387
|
+
/**
|
|
388
|
+
* First day of the week as a **0-6** index (`0` = Sunday). When `null`
|
|
389
|
+
* (default, overridable via `provideForCalendarDefaults`), the adapter's
|
|
390
|
+
* `getFirstDayOfWeek()` is used.
|
|
391
|
+
*/
|
|
392
|
+
readonly firstDayOfWeek: _angular_core.InputSignal<number | null>;
|
|
393
|
+
/**
|
|
394
|
+
* Writing direction. When unset (default `null`), the inherited ambient
|
|
395
|
+
* direction is resolved from the nearest ancestor carrying a `dir` attribute
|
|
396
|
+
* (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins.
|
|
397
|
+
* The resolved value is reflected to the host `dir` attribute and swaps the
|
|
398
|
+
* `ArrowLeft` / `ArrowRight` semantics in RTL.
|
|
399
|
+
*/
|
|
400
|
+
readonly _dirInput: _angular_core.InputSignal<WritingDirection | null>;
|
|
401
|
+
readonly dir: _angular_core.Signal<WritingDirection>;
|
|
402
|
+
/** Internal focused date (the roving entry point), seeded from `value ?? range.start ?? today`. */
|
|
403
|
+
readonly focusedDate: _angular_core.WritableSignal<D>;
|
|
404
|
+
/** First day of the visible month, derived from {@link focusedDate}. */
|
|
405
|
+
readonly visibleMonth: _angular_core.Signal<D>;
|
|
406
|
+
readonly headingId: _angular_core.Signal<string>;
|
|
407
|
+
/**
|
|
408
|
+
* Adopts a consumer-set static `id` on the `[forCalendarHeading]` host into
|
|
409
|
+
* `headingId` (the grid's `aria-labelledby` resolves to it) instead of
|
|
410
|
+
* letting the `[id]` host binding clobber it.
|
|
411
|
+
*/
|
|
412
|
+
adoptHeadingId(el: HTMLElement): void;
|
|
413
|
+
readonly visibleMonthLabel: _angular_core.Signal<string>;
|
|
414
|
+
/** The visible month's full year (e.g. `2026`). */
|
|
415
|
+
readonly visibleYear: _angular_core.Signal<number>;
|
|
416
|
+
/** The visible month, **1-12**. */
|
|
417
|
+
readonly visibleMonthNumber: _angular_core.Signal<number>;
|
|
418
|
+
/**
|
|
419
|
+
* Twelve entries for the visible year — each a localized month name plus
|
|
420
|
+
* whether the whole month falls outside `[min, max]`. Tracks {@link visibleYear}.
|
|
421
|
+
* Build native `<select>` month dropdowns from it.
|
|
422
|
+
*/
|
|
423
|
+
readonly monthOptions: _angular_core.Signal<readonly CalendarMonthOption[]>;
|
|
424
|
+
/** Rows of the month picker grid (3 columns) for the visible year. */
|
|
425
|
+
readonly monthRows: _angular_core.Signal<readonly CalendarMonthRow[]>;
|
|
426
|
+
/** Rows of the year picker grid (3 columns) for the aligned block containing the visible year. */
|
|
427
|
+
readonly yearRows: _angular_core.Signal<readonly CalendarYearRow[]>;
|
|
428
|
+
/** Label for the view trigger / heading, reflecting the active view. */
|
|
429
|
+
readonly viewTriggerLabel: _angular_core.Signal<string>;
|
|
430
|
+
readonly isPreviousDisabled: _angular_core.Signal<boolean>;
|
|
431
|
+
readonly isNextDisabled: _angular_core.Signal<boolean>;
|
|
432
|
+
/** Weekday column headers for the visible month, starting at `firstDayOfWeek`. */
|
|
433
|
+
readonly weekDays: _angular_core.Signal<readonly forty_cdk_calendar.CalendarWeekday[]>;
|
|
434
|
+
/** Week rows of the visible month, including outside-month padding days. */
|
|
435
|
+
readonly weeks: _angular_core.Signal<readonly forty_cdk_calendar.CalendarWeek<D>[]>;
|
|
436
|
+
/** Whether the previous-month button should be disabled (bounded by `min`). */
|
|
437
|
+
readonly isPreviousMonthDisabled: _angular_core.Signal<boolean>;
|
|
438
|
+
/** Whether the next-month button should be disabled (bounded by `max`). */
|
|
439
|
+
readonly isNextMonthDisabled: _angular_core.Signal<boolean>;
|
|
440
|
+
/**
|
|
441
|
+
* Whether every day of `month` (**1-12**) in the visible year falls outside
|
|
442
|
+
* `[min, max]`. Use it to disable a month in a custom dropdown.
|
|
443
|
+
*/
|
|
444
|
+
isMonthDisabled(month: number): boolean;
|
|
445
|
+
/**
|
|
446
|
+
* Whether every day of `year` falls outside `[min, max]`. Use it to disable a
|
|
447
|
+
* year in a custom dropdown.
|
|
448
|
+
*/
|
|
449
|
+
isYearDisabled(year: number): boolean;
|
|
450
|
+
isMonthSelected(month: number): boolean;
|
|
451
|
+
isMonthToday(month: number): boolean;
|
|
452
|
+
isMonthFocused(month: number): boolean;
|
|
453
|
+
isYearSelected(year: number): boolean;
|
|
454
|
+
isYearToday(year: number): boolean;
|
|
455
|
+
isYearFocused(year: number): boolean;
|
|
456
|
+
isSelected(date: D): boolean;
|
|
457
|
+
isRangeStart(date: D): boolean;
|
|
458
|
+
isRangeEnd(date: D): boolean;
|
|
459
|
+
isInRange(date: D): boolean;
|
|
460
|
+
isRangePreview(date: D): boolean;
|
|
461
|
+
setHovered(date: D | null): void;
|
|
462
|
+
isToday(date: D): boolean;
|
|
463
|
+
isFocused(date: D): boolean;
|
|
464
|
+
isOutsideMonth(date: D): boolean;
|
|
465
|
+
isUnavailable(date: D): boolean;
|
|
466
|
+
getDateLabel(date: D): string;
|
|
467
|
+
selectDate(date: D): void;
|
|
468
|
+
pageMonths(delta: number): void;
|
|
469
|
+
/**
|
|
470
|
+
* Set the visible month to (`year`, `month`) without selecting a date.
|
|
471
|
+
* `month` is **1-12**. Re-applies the user's intended day-of-month (clamped to
|
|
472
|
+
* the target month's length), clamps the result into `[min, max]`, and
|
|
473
|
+
* announces the new period politely when the visible month changes. Keeps DOM
|
|
474
|
+
* focus on the caller — it does not move focus into the grid. A no-op while the
|
|
475
|
+
* calendar is disabled.
|
|
476
|
+
*/
|
|
477
|
+
goTo(year: number, month: number): void;
|
|
478
|
+
/** Set the visible month within the current visible year. `month` is **1-12**. */
|
|
479
|
+
goToMonth(month: number): void;
|
|
480
|
+
/** Set the visible year, keeping the current visible month. */
|
|
481
|
+
goToYear(year: number): void;
|
|
482
|
+
handleCellKeydown(event: KeyboardEvent, fromDate: D): void;
|
|
483
|
+
/**
|
|
484
|
+
* Cycle the view one step coarser: `day → month → year`, clamped at `'year'`.
|
|
485
|
+
* No-op when the whole calendar is disabled.
|
|
486
|
+
*/
|
|
487
|
+
cycleView(): void;
|
|
488
|
+
/**
|
|
489
|
+
* Select a whole month (1-12): navigate to it within the current visible year
|
|
490
|
+
* and switch the view to `'day'`. No-op when the calendar is disabled /
|
|
491
|
+
* read-only or the month is out of `[min, max]`.
|
|
492
|
+
*/
|
|
493
|
+
selectMonth(month: number): void;
|
|
494
|
+
/**
|
|
495
|
+
* Select a whole year: navigate to it and switch the view to `'month'`. No-op
|
|
496
|
+
* when the calendar is disabled / read-only or the year is out of `[min, max]`.
|
|
497
|
+
*/
|
|
498
|
+
selectYear(year: number): void;
|
|
499
|
+
/** Page backward by one month / year / block depending on the active view. */
|
|
500
|
+
pagePrevious(): void;
|
|
501
|
+
/** Page forward by one month / year / block depending on the active view. */
|
|
502
|
+
pageNext(): void;
|
|
503
|
+
/**
|
|
504
|
+
* Move DOM focus to the roving cell — the gridcell carrying the tab stop,
|
|
505
|
+
* i.e. the one matching {@link focusedDate} (day view) or the highlighted
|
|
506
|
+
* month / year cell (month / year view). Returns `false` when no matching
|
|
507
|
+
* cell is currently rendered, so an overlay host wrapping the calendar can
|
|
508
|
+
* fall back to its own focus logic.
|
|
509
|
+
*/
|
|
510
|
+
focusActiveCell(): boolean;
|
|
511
|
+
registerCell(handle: ForCalendarCellHandle<D>): void;
|
|
512
|
+
unregisterCell(handle: ForCalendarCellHandle<D>): void;
|
|
513
|
+
handleMonthCellKeydown(event: KeyboardEvent, fromMonth: number): void;
|
|
514
|
+
handleYearCellKeydown(event: KeyboardEvent, fromYear: number): void;
|
|
515
|
+
registerMonthCell(handle: ForCalendarMonthCellHandle): void;
|
|
516
|
+
unregisterMonthCell(handle: ForCalendarMonthCellHandle): void;
|
|
517
|
+
registerYearCell(handle: ForCalendarYearCellHandle): void;
|
|
518
|
+
unregisterYearCell(handle: ForCalendarYearCellHandle): void;
|
|
519
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendar<any>, never>;
|
|
520
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendar<any>, "[forCalendar]", ["forCalendar"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "isDateUnavailable": { "alias": "isDateUnavailable"; "required": false; "isSignal": true; }; "dateLabel": { "alias": "dateLabel"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "yearBlockSize": { "alias": "yearBlockSize"; "required": false; "isSignal": true; }; "range": { "alias": "range"; "required": false; "isSignal": true; }; "minRangeLength": { "alias": "minRangeLength"; "required": false; "isSignal": true; }; "maxRangeLength": { "alias": "maxRangeLength"; "required": false; "isSignal": true; }; "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; "isSignal": true; }; "_dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "view": "viewChange"; "range": "rangeChange"; }, never, never, true, never>;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* The calendar's date table (`role="grid"`). Apply on a `<table>`. Labelled by
|
|
525
|
+
* the `[forCalendarHeading]` via `aria-labelledby`, and reflects `aria-disabled`
|
|
526
|
+
* / `aria-readonly` from the root.
|
|
527
|
+
*
|
|
528
|
+
* Exposes the month's `weekDays()` (column headers) and `weeks()` (day rows)
|
|
529
|
+
* for the consumer to iterate — bind `cell.date` to each `[forCalendarCell]`.
|
|
530
|
+
*/
|
|
531
|
+
declare class ForCalendarGrid {
|
|
532
|
+
protected readonly ctx: forty_cdk_calendar.ForCalendarContext<unknown>;
|
|
533
|
+
/** Weekday column headers for the visible month, starting at `firstDayOfWeek`. */
|
|
534
|
+
readonly weekDays: _angular_core.Signal<readonly forty_cdk_calendar.CalendarWeekday[]>;
|
|
535
|
+
/** Week rows of the visible month, including outside-month padding days. */
|
|
536
|
+
readonly weeks: _angular_core.Signal<readonly forty_cdk_calendar.CalendarWeek<unknown>[]>;
|
|
537
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendarGrid, never>;
|
|
538
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendarGrid, "[forCalendarGrid]", ["forCalendarGrid"], {}, {}, never, never, true, never>;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Marks the calendar grid's header rowgroup. Apply on a `<thead>` holding a
|
|
543
|
+
* single row of `<th scope="col">` weekday headers.
|
|
544
|
+
*
|
|
545
|
+
* Reflects `role="rowgroup"` so the weekday header is exposed as a distinct
|
|
546
|
+
* rowgroup inside the `role="grid"` table — assistive tech announces the
|
|
547
|
+
* column headers as their own group rather than folding them into the day
|
|
548
|
+
* rows. (A bare `<thead>` carries the implicit role, but the grid's explicit
|
|
549
|
+
* `role="grid"` suppresses the table's native row/rowgroup semantics, so the
|
|
550
|
+
* header must restate it.)
|
|
551
|
+
*
|
|
552
|
+
* Also exposes `weekDays()` so the header row can be iterated from this piece,
|
|
553
|
+
* as an alternative to reading it off `[forCalendarGrid]`.
|
|
554
|
+
*/
|
|
555
|
+
declare class ForCalendarGridHeader {
|
|
556
|
+
protected readonly ctx: forty_cdk_calendar.ForCalendarContext<unknown>;
|
|
557
|
+
/** Weekday column headers for the visible month, starting at `firstDayOfWeek`. */
|
|
558
|
+
readonly weekDays: _angular_core.Signal<readonly forty_cdk_calendar.CalendarWeekday[]>;
|
|
559
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendarGridHeader, never>;
|
|
560
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendarGridHeader, "[forCalendarGridHeader]", ["forCalendarGridHeader"], {}, {}, never, never, true, never>;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* A single day cell (`role="gridcell"`). Apply on the `<td>` for each day in
|
|
565
|
+
* the grid and bind `[date]` to the cell's date from `weeks()`.
|
|
566
|
+
*
|
|
567
|
+
* Carries the roving tab stop (`tabindex="0"` only on the focused date), the
|
|
568
|
+
* full accessible date as `aria-label` (the bare day number stays the visible
|
|
569
|
+
* content), `aria-selected` (always emitted), `aria-current="date"` on today,
|
|
570
|
+
* `aria-disabled` on unavailable dates, and the boolean `data-*` styling hooks
|
|
571
|
+
* (`data-selected`, `data-today`, `data-highlighted`, `data-disabled`,
|
|
572
|
+
* `data-outside-month`). In `selectionMode="range"`, also emits
|
|
573
|
+
* `data-range-start`, `data-range-end`, `data-in-range`, and
|
|
574
|
+
* `data-range-preview` (all boolean present/absent). Click and `Enter` /
|
|
575
|
+
* `Space` select; arrow / paging keys move the focused date.
|
|
576
|
+
*
|
|
577
|
+
* @typeParam D The adapter's date type (inferred from the bound `[date]`).
|
|
578
|
+
*/
|
|
579
|
+
declare class ForCalendarCell<D> {
|
|
580
|
+
#private;
|
|
581
|
+
protected readonly ctx: forty_cdk_calendar.ForCalendarContext<unknown>;
|
|
582
|
+
/** The date this cell represents. */
|
|
583
|
+
readonly date: _angular_core.InputSignal<D>;
|
|
584
|
+
protected readonly selected: _angular_core.Signal<boolean>;
|
|
585
|
+
protected readonly isToday: _angular_core.Signal<boolean>;
|
|
586
|
+
protected readonly focused: _angular_core.Signal<boolean>;
|
|
587
|
+
protected readonly unavailable: _angular_core.Signal<boolean>;
|
|
588
|
+
protected readonly outsideMonth: _angular_core.Signal<boolean>;
|
|
589
|
+
protected readonly dateLabel: _angular_core.Signal<string>;
|
|
590
|
+
protected readonly rangeStart: _angular_core.Signal<boolean>;
|
|
591
|
+
protected readonly rangeEnd: _angular_core.Signal<boolean>;
|
|
592
|
+
protected readonly inRange: _angular_core.Signal<boolean>;
|
|
593
|
+
protected readonly rangePreview: _angular_core.Signal<boolean>;
|
|
594
|
+
constructor();
|
|
595
|
+
protected onClick(): void;
|
|
596
|
+
protected onKeyDown(event: KeyboardEvent): void;
|
|
597
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendarCell<any>, never>;
|
|
598
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendarCell<any>, "[forCalendarCell]", ["forCalendarCell"], { "date": { "alias": "date"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* The month/year heading. Apply on a heading element (e.g. `<h2>`) and render
|
|
603
|
+
* its `label()` as the content: `<h2 forCalendarHeading #h="forCalendarHeading">{{ h.label() }}</h2>`.
|
|
604
|
+
* The grid is `aria-labelledby` this element, so it names the visible period.
|
|
605
|
+
*
|
|
606
|
+
* It is **not** an `aria-live` region: paging the month announces the new
|
|
607
|
+
* period through a dedicated off-screen live region owned by `[forCalendar]`,
|
|
608
|
+
* so the grid's accessible name is re-read on demand without the heading
|
|
609
|
+
* itself double-announcing on every render.
|
|
610
|
+
*/
|
|
611
|
+
declare class ForCalendarHeading {
|
|
612
|
+
protected readonly ctx: forty_cdk_calendar.ForCalendarContext<unknown>;
|
|
613
|
+
/** The visible month's accessible label, e.g. `"June 2026"`. */
|
|
614
|
+
readonly label: _angular_core.Signal<string>;
|
|
615
|
+
constructor();
|
|
616
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendarHeading, never>;
|
|
617
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendarHeading, "[forCalendarHeading]", ["forCalendarHeading"], {}, {}, never, never, true, never>;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Pages the calendar backward. In `day` view pages by one month; in `month` view
|
|
622
|
+
* pages by one year; in `year` view pages by one block. Apply on a `<button>`.
|
|
623
|
+
* Keeps DOM focus on itself while paging; the `aria-live` heading announces the
|
|
624
|
+
* new period. Auto-disabled at the view's bound, or when the whole calendar is
|
|
625
|
+
* disabled.
|
|
626
|
+
*
|
|
627
|
+
* Provide an accessible name via the `[ariaLabel]` input (e.g.
|
|
628
|
+
* `[ariaLabel]="'Previous'"`).
|
|
629
|
+
*/
|
|
630
|
+
declare class ForCalendarPrevButton {
|
|
631
|
+
protected readonly ctx: forty_cdk_calendar.ForCalendarContext<unknown>;
|
|
632
|
+
/** Accessible name for the button. A `null` (default) or empty value emits no attribute. */
|
|
633
|
+
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
634
|
+
protected readonly disabled: _angular_core.Signal<boolean>;
|
|
635
|
+
constructor();
|
|
636
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendarPrevButton, never>;
|
|
637
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendarPrevButton, "[forCalendarPrevButton]", ["forCalendarPrevButton"], { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Pages the calendar forward. In `day` view pages by one month; in `month` view
|
|
642
|
+
* pages by one year; in `year` view pages by one block. Apply on a `<button>`.
|
|
643
|
+
* Keeps DOM focus on itself while paging; the `aria-live` heading announces the
|
|
644
|
+
* new period. Auto-disabled at the view's bound, or when the whole calendar is
|
|
645
|
+
* disabled.
|
|
646
|
+
*
|
|
647
|
+
* Provide an accessible name via the `[ariaLabel]` input (e.g.
|
|
648
|
+
* `[ariaLabel]="'Next'"`).
|
|
649
|
+
*/
|
|
650
|
+
declare class ForCalendarNextButton {
|
|
651
|
+
protected readonly ctx: forty_cdk_calendar.ForCalendarContext<unknown>;
|
|
652
|
+
/** Accessible name for the button. A `null` (default) or empty value emits no attribute. */
|
|
653
|
+
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
654
|
+
protected readonly disabled: _angular_core.Signal<boolean>;
|
|
655
|
+
constructor();
|
|
656
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendarNextButton, never>;
|
|
657
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendarNextButton, "[forCalendarNextButton]", ["forCalendarNextButton"], { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* The month picker grid (`role="grid"`). Apply on a `<table>`. Labelled by the
|
|
662
|
+
* `[forCalendarHeading]` via `aria-labelledby`. Exposes `rows()` — iterate
|
|
663
|
+
* rows then cells, binding each cell's `month` to `[forCalendarMonthCell]`.
|
|
664
|
+
*
|
|
665
|
+
* Shows the 12 months of the visible year in 3-column rows. Used when
|
|
666
|
+
* `view === 'month'`.
|
|
667
|
+
*/
|
|
668
|
+
declare class ForCalendarMonthGrid {
|
|
669
|
+
protected readonly ctx: forty_cdk_calendar.ForCalendarContext<unknown>;
|
|
670
|
+
/** Rows of the month picker grid (3 columns) for the visible year. */
|
|
671
|
+
readonly rows: _angular_core.Signal<readonly forty_cdk_calendar.CalendarMonthRow[]>;
|
|
672
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendarMonthGrid, never>;
|
|
673
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendarMonthGrid, "[forCalendarMonthGrid]", ["forCalendarMonthGrid"], {}, {}, never, never, true, never>;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* A single month cell (`role="gridcell"`) in the month picker grid. Apply on
|
|
678
|
+
* the `<td>` for each month and bind `[month]` to the month number (1-12) from
|
|
679
|
+
* `rows()`.
|
|
680
|
+
*
|
|
681
|
+
* Carries the roving tab stop (`tabindex="0"` on the focused month), reflects
|
|
682
|
+
* `aria-selected` (always emitted), `data-today`, `data-selected`,
|
|
683
|
+
* `data-highlighted`, `data-disabled`. Click and `Enter` / `Space` drill down
|
|
684
|
+
* to the day view for that month; arrow / paging keys move the roving cell.
|
|
685
|
+
*/
|
|
686
|
+
declare class ForCalendarMonthCell {
|
|
687
|
+
#private;
|
|
688
|
+
protected readonly ctx: forty_cdk_calendar.ForCalendarContext<unknown>;
|
|
689
|
+
/** The month this cell represents, **1-12**. */
|
|
690
|
+
readonly month: _angular_core.InputSignal<number>;
|
|
691
|
+
protected readonly selected: _angular_core.Signal<boolean>;
|
|
692
|
+
protected readonly today: _angular_core.Signal<boolean>;
|
|
693
|
+
protected readonly focused: _angular_core.Signal<boolean>;
|
|
694
|
+
protected readonly disabled: _angular_core.Signal<boolean>;
|
|
695
|
+
constructor();
|
|
696
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendarMonthCell, never>;
|
|
697
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendarMonthCell, "[forCalendarMonthCell]", ["forCalendarMonthCell"], { "month": { "alias": "month"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* The year picker grid (`role="grid"`). Apply on a `<table>`. Labelled by the
|
|
702
|
+
* `[forCalendarHeading]` via `aria-labelledby`. Exposes `rows()` — iterate
|
|
703
|
+
* rows then cells, binding each cell's `year` to `[forCalendarYearCell]`.
|
|
704
|
+
*
|
|
705
|
+
* Shows an aligned block of `yearBlockSize` years in 3-column rows. Used when
|
|
706
|
+
* `view === 'year'`.
|
|
707
|
+
*/
|
|
708
|
+
declare class ForCalendarYearGrid {
|
|
709
|
+
protected readonly ctx: forty_cdk_calendar.ForCalendarContext<unknown>;
|
|
710
|
+
/** Rows of the year picker grid (3 columns) for the aligned block containing the visible year. */
|
|
711
|
+
readonly rows: _angular_core.Signal<readonly forty_cdk_calendar.CalendarYearRow[]>;
|
|
712
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendarYearGrid, never>;
|
|
713
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendarYearGrid, "[forCalendarYearGrid]", ["forCalendarYearGrid"], {}, {}, never, never, true, never>;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* A single year cell (`role="gridcell"`) in the year picker grid. Apply on the
|
|
718
|
+
* `<td>` for each year and bind `[year]` to the year number from `rows()`.
|
|
719
|
+
*
|
|
720
|
+
* Carries the roving tab stop (`tabindex="0"` on the focused year), reflects
|
|
721
|
+
* `aria-selected` (always emitted), `data-today`, `data-selected`,
|
|
722
|
+
* `data-highlighted`, `data-disabled`. Click and `Enter` / `Space` drill down
|
|
723
|
+
* to the month view for that year; arrow / paging keys move the roving cell.
|
|
724
|
+
*/
|
|
725
|
+
declare class ForCalendarYearCell {
|
|
726
|
+
#private;
|
|
727
|
+
protected readonly ctx: forty_cdk_calendar.ForCalendarContext<unknown>;
|
|
728
|
+
/** The year this cell represents. */
|
|
729
|
+
readonly year: _angular_core.InputSignal<number>;
|
|
730
|
+
protected readonly selected: _angular_core.Signal<boolean>;
|
|
731
|
+
protected readonly today: _angular_core.Signal<boolean>;
|
|
732
|
+
protected readonly focused: _angular_core.Signal<boolean>;
|
|
733
|
+
protected readonly disabled: _angular_core.Signal<boolean>;
|
|
734
|
+
constructor();
|
|
735
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendarYearCell, never>;
|
|
736
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendarYearCell, "[forCalendarYearCell]", ["forCalendarYearCell"], { "year": { "alias": "year"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* The view-cycle button in the calendar header. Apply on a `<button>`. Each
|
|
741
|
+
* click advances the view one step coarser (`day → month → year`), clamped at
|
|
742
|
+
* `'year'`. Reflects `data-view` so consumers can style it per view. Disabled
|
|
743
|
+
* when the whole calendar is disabled.
|
|
744
|
+
*
|
|
745
|
+
* Bind the `label` signal to the button text to show the active view label
|
|
746
|
+
* (e.g. `"June 2026"` in day view, `"2026"` in month view, `"2024 – 2035"` in
|
|
747
|
+
* year view).
|
|
748
|
+
*/
|
|
749
|
+
declare class ForCalendarViewTrigger {
|
|
750
|
+
protected readonly ctx: forty_cdk_calendar.ForCalendarContext<unknown>;
|
|
751
|
+
/** Label for the active view, e.g. `"June 2026"` / `"2026"` / `"2016 – 2027"`. */
|
|
752
|
+
readonly label: _angular_core.Signal<string>;
|
|
753
|
+
constructor();
|
|
754
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendarViewTrigger, never>;
|
|
755
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendarViewTrigger, "[forCalendarViewTrigger]", ["forCalendarViewTrigger"], {}, {}, never, never, true, never>;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Wires a native `<select>` to a `ForCalendar`'s month navigation. Apply on a
|
|
760
|
+
* `<select>` element inside `[forCalendar]`: the directive keeps the select
|
|
761
|
+
* showing the visible month and navigates the calendar when the user picks a
|
|
762
|
+
* different one, without mutating the selected date.
|
|
763
|
+
*
|
|
764
|
+
* Render the `<option>` elements yourself from {@link options} so you keep full
|
|
765
|
+
* control over their markup, labels, and any placeholder:
|
|
766
|
+
*
|
|
767
|
+
* ```html
|
|
768
|
+
* <select forCalendarMonthSelect #m="forCalendarMonthSelect">
|
|
769
|
+
* @for (opt of m.options(); track opt.value) {
|
|
770
|
+
* <option [value]="opt.value" [disabled]="opt.disabled">{{ opt.label }}</option>
|
|
771
|
+
* }
|
|
772
|
+
* </select>
|
|
773
|
+
* ```
|
|
774
|
+
*/
|
|
775
|
+
declare class ForCalendarMonthSelect {
|
|
776
|
+
protected readonly ctx: forty_cdk_calendar.ForCalendarContext<unknown>;
|
|
777
|
+
/** The twelve localized, bounds-aware month options for the visible year. */
|
|
778
|
+
readonly options: _angular_core.Signal<readonly forty_cdk_calendar.CalendarMonthOption[]>;
|
|
779
|
+
protected onChange(event: Event): void;
|
|
780
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendarMonthSelect, never>;
|
|
781
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendarMonthSelect, "select[forCalendarMonthSelect]", ["forCalendarMonthSelect"], {}, {}, never, never, true, never>;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Wires a native `<select>` to a `ForCalendar`'s year navigation. Apply on a
|
|
786
|
+
* `<select>` element inside `[forCalendar]`: the directive keeps the select
|
|
787
|
+
* showing the visible year and navigates the calendar when the user picks a
|
|
788
|
+
* different one, without mutating the selected date.
|
|
789
|
+
*
|
|
790
|
+
* Render the `<option>` elements yourself from {@link years} so you keep full
|
|
791
|
+
* control over their markup:
|
|
792
|
+
*
|
|
793
|
+
* ```html
|
|
794
|
+
* <select forCalendarYearSelect #y="forCalendarYearSelect" [minYear]="1900" [maxYear]="2100">
|
|
795
|
+
* @for (opt of y.years(); track opt.value) {
|
|
796
|
+
* <option [value]="opt.value" [disabled]="opt.disabled">{{ opt.value }}</option>
|
|
797
|
+
* }
|
|
798
|
+
* </select>
|
|
799
|
+
* ```
|
|
800
|
+
*/
|
|
801
|
+
declare class ForCalendarYearSelect {
|
|
802
|
+
protected readonly ctx: forty_cdk_calendar.ForCalendarContext<unknown>;
|
|
803
|
+
/**
|
|
804
|
+
* Lowest year listed in {@link years}. Defaults to 100 years before the
|
|
805
|
+
* current year when `null`.
|
|
806
|
+
*/
|
|
807
|
+
readonly minYear: _angular_core.InputSignal<number | null>;
|
|
808
|
+
/**
|
|
809
|
+
* Highest year listed in {@link years}. Defaults to 10 years after the
|
|
810
|
+
* current year when `null`.
|
|
811
|
+
*/
|
|
812
|
+
readonly maxYear: _angular_core.InputSignal<number | null>;
|
|
813
|
+
/**
|
|
814
|
+
* The selectable years, from {@link minYear} to {@link maxYear} inclusive.
|
|
815
|
+
* Each entry is `disabled` when the whole year falls outside the calendar's
|
|
816
|
+
* `[min, max]`. The default window is anchored to the current year (not the
|
|
817
|
+
* visible year), so navigating far away never drops the current year off the
|
|
818
|
+
* list.
|
|
819
|
+
*/
|
|
820
|
+
readonly years: _angular_core.Signal<readonly CalendarYearOption[]>;
|
|
821
|
+
protected onChange(event: Event): void;
|
|
822
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForCalendarYearSelect, never>;
|
|
823
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForCalendarYearSelect, "select[forCalendarYearSelect]", ["forCalendarYearSelect"], { "minYear": { "alias": "minYear"; "required": false; "isSignal": true; }; "maxYear": { "alias": "maxYear"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Defaults inherited by descendant calendars in the surrounding injector
|
|
828
|
+
* scope. Configure with `provideForCalendarDefaults` at the application root
|
|
829
|
+
* or in any component's `providers`; partial overrides merge with the parent
|
|
830
|
+
* scope.
|
|
831
|
+
*/
|
|
832
|
+
interface ForCalendarDefaults {
|
|
833
|
+
/**
|
|
834
|
+
* First day of the week as a **0-6** index (`0` = Sunday, `1` = Monday, …).
|
|
835
|
+
* When `null` (default), each calendar falls back to its adapter's
|
|
836
|
+
* `getFirstDayOfWeek()`. A `ForCalendar`'s own `firstDayOfWeek` input always
|
|
837
|
+
* wins over this scope default.
|
|
838
|
+
*/
|
|
839
|
+
firstDayOfWeek: number | null;
|
|
840
|
+
}
|
|
841
|
+
/** Token holding the resolved calendar defaults for the current scope. */
|
|
842
|
+
declare const FOR_CALENDAR_DEFAULTS: _angular_core.InjectionToken<ForCalendarDefaults>;
|
|
843
|
+
/**
|
|
844
|
+
* Configures forty-cdk calendar defaults for this injector scope. Partial
|
|
845
|
+
* overrides inherit unspecified keys from the parent scope (or library
|
|
846
|
+
* defaults at the root).
|
|
847
|
+
*/
|
|
848
|
+
declare function provideForCalendarDefaults(defaults?: Partial<ForCalendarDefaults>): Provider[];
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* Zero-dependency {@link DateAdapter} over the built-in `Date`. `today` and
|
|
852
|
+
* `createDate` produce days at local midnight, and the calendar grid stays
|
|
853
|
+
* day-granular. It is also **time-capable** — `Date` natively carries a
|
|
854
|
+
* wall-clock time, so the optional `getHours` / `getMinutes` / `getSeconds` /
|
|
855
|
+
* `setTime` accessors are implemented, letting `ForTimeField` use this adapter
|
|
856
|
+
* directly. Consistently with that, `compare` orders by the full instant
|
|
857
|
+
* (day *and* time), matching `InternationalizedDateTimeAdapter`, so a date-time
|
|
858
|
+
* `minDate`/`maxDate` clamps identically on both.
|
|
859
|
+
*
|
|
860
|
+
* This is the fallback adapter. Prefer `provideInternationalizedDateAdapter()`
|
|
861
|
+
* for correct date-math and locale-aware formatting (or
|
|
862
|
+
* `provideInternationalizedDateTimeAdapter()` for a time-capable one); reach
|
|
863
|
+
* for this one when adding a date library to the bundle is not worthwhile. Both
|
|
864
|
+
* `Date` and the `@internationalized/date` adapters operate on the Gregorian
|
|
865
|
+
* calendar today; non-Gregorian calendar systems are deferred to #354.
|
|
866
|
+
*/
|
|
867
|
+
declare class NativeDateAdapter implements DateAdapter<Date> {
|
|
868
|
+
/**
|
|
869
|
+
* Today at local midnight in the runtime time zone. Subject to the
|
|
870
|
+
* SSR/hydration caveat on {@link DateAdapter.today}.
|
|
871
|
+
*/
|
|
872
|
+
today(): Date;
|
|
873
|
+
createDate(year: number, month: number, day: number): Date;
|
|
874
|
+
getYear(date: Date): number;
|
|
875
|
+
getMonth(date: Date): number;
|
|
876
|
+
getDate(date: Date): number;
|
|
877
|
+
getDayOfWeek(date: Date): number;
|
|
878
|
+
getDaysInMonth(date: Date): number;
|
|
879
|
+
getFirstDayOfWeek(): number;
|
|
880
|
+
addDays(date: Date, n: number): Date;
|
|
881
|
+
addMonths(date: Date, n: number): Date;
|
|
882
|
+
addYears(date: Date, n: number): Date;
|
|
883
|
+
compare(a: Date, b: Date): number;
|
|
884
|
+
isSameDay(a: Date, b: Date): boolean;
|
|
885
|
+
isValid(date: Date): boolean;
|
|
886
|
+
/**
|
|
887
|
+
* Formats through the runtime's default locale. Subject to the SSR/hydration
|
|
888
|
+
* caveat on {@link DateAdapter.format}.
|
|
889
|
+
*/
|
|
890
|
+
format(date: Date, options: Intl.DateTimeFormatOptions): string;
|
|
891
|
+
supportsTime(): boolean;
|
|
892
|
+
getHours(date: Date): number;
|
|
893
|
+
getMinutes(date: Date): number;
|
|
894
|
+
getSeconds(date: Date): number;
|
|
895
|
+
setTime(date: Date, hours: number, minutes: number, seconds: number): Date;
|
|
896
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NativeDateAdapter, never>;
|
|
897
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NativeDateAdapter>;
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Provides the zero-dependency {@link NativeDateAdapter} as the active
|
|
901
|
+
* {@link DateAdapter}. Add to your application or component providers when
|
|
902
|
+
* `ForCalendar` should operate on native `Date` values.
|
|
903
|
+
*
|
|
904
|
+
* @example
|
|
905
|
+
* ```ts
|
|
906
|
+
* bootstrapApplication(App, {
|
|
907
|
+
* providers: [provideNativeDateAdapter()],
|
|
908
|
+
* });
|
|
909
|
+
* ```
|
|
910
|
+
*/
|
|
911
|
+
declare function provideNativeDateAdapter(): Provider[];
|
|
912
|
+
|
|
913
|
+
export { FOR_CALENDAR_CONTEXT, FOR_CALENDAR_DEFAULTS, ForCalendar, ForCalendarCell, ForCalendarGrid, ForCalendarGridHeader, ForCalendarHeading, ForCalendarMonthCell, ForCalendarMonthGrid, ForCalendarMonthSelect, ForCalendarNextButton, ForCalendarPrevButton, ForCalendarViewTrigger, ForCalendarYearCell, ForCalendarYearGrid, ForCalendarYearSelect, NativeDateAdapter, provideForCalendarDefaults, provideNativeDateAdapter };
|
|
914
|
+
export type { CalendarDateLabelFormatter, CalendarDateRange, CalendarDayCell, CalendarMonthOption, CalendarMonthRow, CalendarView, CalendarWeek, CalendarWeekday, CalendarYearOption, CalendarYearRow, ForCalendarCellHandle, ForCalendarContext, ForCalendarDefaults, ForCalendarMonthCellHandle, ForCalendarYearCellHandle };
|