@aurodesignsystem-dev/auro-formkit 0.0.0-pr1497.0 → 0.0.0-pr1497.2
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/components/bibtemplate/dist/auro-bibtemplate.d.ts +7 -0
- package/components/bibtemplate/dist/index.js +9 -1
- package/components/bibtemplate/dist/registered.js +9 -1
- package/components/checkbox/demo/css-only.html +57 -0
- package/components/checkbox/demo/css-only.md +146 -0
- package/components/checkbox/demo/customize.min.js +1 -1
- package/components/checkbox/demo/getting-started.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/demo/pages.json +1 -1
- package/components/checkbox/demo/styles.min.css +1 -1
- package/components/checkbox/demo/why-checkbox.html +57 -0
- package/components/checkbox/demo/why-checkbox.md +86 -0
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/css-only.html +57 -0
- package/components/combobox/demo/css-only.md +209 -0
- package/components/combobox/demo/customize.min.js +250 -16
- package/components/combobox/demo/getting-started.min.js +250 -16
- package/components/combobox/demo/index.min.js +250 -16
- package/components/combobox/demo/pages.json +1 -1
- package/components/combobox/demo/styles.min.css +1 -1
- package/components/combobox/demo/why-combobox.html +57 -0
- package/components/combobox/demo/why-combobox.md +113 -0
- package/components/combobox/dist/index.js +250 -16
- package/components/combobox/dist/registered.js +250 -16
- package/components/counter/demo/css-only.html +57 -0
- package/components/counter/demo/css-only.md +184 -0
- package/components/counter/demo/customize.min.js +249 -15
- package/components/counter/demo/index.min.js +249 -15
- package/components/counter/demo/keyboard-behavior.md +1 -0
- package/components/counter/demo/pages.json +1 -1
- package/components/counter/demo/styles.min.css +1 -1
- package/components/counter/demo/why-counter.html +57 -0
- package/components/counter/demo/why-counter.md +108 -0
- package/components/counter/dist/index.js +10 -2
- package/components/counter/dist/registered.js +10 -2
- package/components/datepicker/demo/accessibility.md +54 -3
- package/components/datepicker/demo/api.md +63 -53
- package/components/datepicker/demo/css-only.html +57 -0
- package/components/datepicker/demo/css-only.md +151 -0
- package/components/datepicker/demo/customize.html +2 -0
- package/components/datepicker/demo/customize.js +19 -0
- package/components/datepicker/demo/customize.md +56 -0
- package/components/datepicker/demo/customize.min.js +36147 -0
- package/components/datepicker/demo/design.md +3 -1
- package/components/datepicker/demo/index.js +5 -1
- package/components/datepicker/demo/index.md +104 -15
- package/components/datepicker/demo/index.min.js +2485 -261
- package/components/datepicker/demo/keyboard-behavior.md +201 -2
- package/components/datepicker/demo/pages.json +1 -1
- package/components/datepicker/demo/styles.min.css +1 -1
- package/components/datepicker/demo/voiceover.md +21 -12
- package/components/datepicker/demo/why-datepicker.html +57 -0
- package/components/datepicker/demo/why-datepicker.md +133 -0
- package/components/datepicker/dist/index.js +2348 -211
- package/components/datepicker/dist/registered.js +2348 -211
- package/components/datepicker/dist/src/auro-calendar-cell.d.ts +113 -13
- package/components/datepicker/dist/src/auro-calendar-month.d.ts +38 -1
- package/components/datepicker/dist/src/auro-calendar.d.ts +258 -0
- package/components/datepicker/dist/src/auro-datepicker.d.ts +141 -41
- package/components/datepicker/dist/src/datepickerKeyboardStrategy.d.ts +5 -3
- package/components/dropdown/demo/accessibility.md +11 -0
- package/components/dropdown/demo/api.md +1 -0
- package/components/dropdown/demo/css-only.html +57 -0
- package/components/dropdown/demo/css-only.md +219 -0
- package/components/dropdown/demo/customize.md +3 -0
- package/components/dropdown/demo/customize.min.js +239 -13
- package/components/dropdown/demo/getting-started.min.js +239 -13
- package/components/dropdown/demo/index.min.js +239 -13
- package/components/dropdown/demo/keyboard-behavior.md +1 -0
- package/components/dropdown/demo/pages.json +1 -1
- package/components/dropdown/demo/styles.min.css +1 -1
- package/components/dropdown/demo/why-dropdown.html +57 -0
- package/components/dropdown/demo/why-dropdown.md +97 -0
- package/components/dropdown/dist/auro-dropdown.d.ts +34 -1
- package/components/dropdown/dist/index.js +239 -13
- package/components/dropdown/dist/registered.js +239 -13
- package/components/form/demo/css-only.html +57 -0
- package/components/form/demo/css-only.md +156 -0
- package/components/form/demo/customize.min.js +3098 -259
- package/components/form/demo/getting-started.min.js +3098 -259
- package/components/form/demo/index.min.js +3098 -259
- package/components/form/demo/pages.json +1 -1
- package/components/form/demo/registerDemoDeps.min.js +3098 -259
- package/components/form/demo/styles.min.css +1 -1
- package/components/form/demo/why-form.html +57 -0
- package/components/form/demo/why-form.md +101 -0
- package/components/input/demo/css-only.html +57 -0
- package/components/input/demo/css-only.md +199 -0
- package/components/input/demo/customize.min.js +1 -1
- package/components/input/demo/getting-started.min.js +1 -1
- package/components/input/demo/index.min.js +1 -1
- package/components/input/demo/pages.json +1 -1
- package/components/input/demo/styles.min.css +1 -1
- package/components/input/demo/why-input.html +57 -0
- package/components/input/demo/why-input.md +121 -0
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/menu/demo/css-only.html +57 -0
- package/components/menu/demo/css-only.md +166 -0
- package/components/menu/demo/pages.json +1 -1
- package/components/menu/demo/styles.min.css +1 -1
- package/components/menu/demo/why-menu.html +57 -0
- package/components/menu/demo/why-menu.md +104 -0
- package/components/radio/demo/css-only.html +57 -0
- package/components/radio/demo/css-only.md +151 -0
- package/components/radio/demo/customize.min.js +1764 -0
- package/components/radio/demo/demo-support.min.js +55807 -0
- package/components/radio/demo/getting-started.js +1 -1
- package/components/radio/demo/getting-started.md +1 -1
- package/components/radio/demo/getting-started.min.js +1783 -0
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/demo/pages.json +1 -1
- package/components/radio/demo/styles.min.css +1 -1
- package/components/radio/demo/why-radio.html +57 -0
- package/components/radio/demo/why-radio.md +92 -0
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/css-only.html +57 -0
- package/components/select/demo/css-only.md +203 -0
- package/components/select/demo/customize.min.js +249 -15
- package/components/select/demo/getting-started.min.js +249 -15
- package/components/select/demo/index.min.js +249 -15
- package/components/select/demo/keyboard-behavior.md +1 -0
- package/components/select/demo/pages.json +1 -1
- package/components/select/demo/styles.min.css +1 -1
- package/components/select/demo/why-select.html +57 -0
- package/components/select/demo/why-select.md +128 -0
- package/components/select/dist/index.js +249 -15
- package/components/select/dist/registered.js +249 -15
- package/custom-elements.json +1171 -92
- package/package.json +8 -8
|
@@ -6,9 +6,6 @@ export class AuroCalendarCell extends LitElement {
|
|
|
6
6
|
selected: {
|
|
7
7
|
type: BooleanConstructor;
|
|
8
8
|
};
|
|
9
|
-
hovered: {
|
|
10
|
-
type: BooleanConstructor;
|
|
11
|
-
};
|
|
12
9
|
dateTo: {
|
|
13
10
|
type: StringConstructor;
|
|
14
11
|
};
|
|
@@ -31,9 +28,6 @@ export class AuroCalendarCell extends LitElement {
|
|
|
31
28
|
disabledDays: {
|
|
32
29
|
type: ArrayConstructor;
|
|
33
30
|
};
|
|
34
|
-
hoveredDate: {
|
|
35
|
-
type: StringConstructor;
|
|
36
|
-
};
|
|
37
31
|
isCurrentDate: {
|
|
38
32
|
type: BooleanConstructor;
|
|
39
33
|
};
|
|
@@ -46,11 +40,13 @@ export class AuroCalendarCell extends LitElement {
|
|
|
46
40
|
renderForDateSlot: {
|
|
47
41
|
type: BooleanConstructor;
|
|
48
42
|
};
|
|
43
|
+
hasPopoverContent: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
};
|
|
49
46
|
};
|
|
50
47
|
static get styles(): import("lit").CSSResult[];
|
|
51
48
|
day: any;
|
|
52
49
|
selected: boolean;
|
|
53
|
-
hovered: boolean;
|
|
54
50
|
dateTo: any;
|
|
55
51
|
dateFrom: any;
|
|
56
52
|
month: any;
|
|
@@ -58,21 +54,23 @@ export class AuroCalendarCell extends LitElement {
|
|
|
58
54
|
max: any;
|
|
59
55
|
disabled: boolean;
|
|
60
56
|
disabledDays: any[];
|
|
61
|
-
hoveredDate: any;
|
|
62
57
|
isCurrentDate: boolean;
|
|
63
58
|
_locale: any;
|
|
64
59
|
dateStr: string | null;
|
|
65
60
|
renderForDateSlot: boolean;
|
|
61
|
+
active: boolean;
|
|
62
|
+
hasPopoverContent: boolean;
|
|
66
63
|
runtimeUtils: any;
|
|
67
64
|
popoverTag: any;
|
|
68
65
|
set locale(value: any);
|
|
69
66
|
get locale(): any;
|
|
70
67
|
/**
|
|
71
|
-
* Handles selected
|
|
68
|
+
* Handles selected state of the calendar cell when the selection changes.
|
|
69
|
+
* Also clears any imperative range preview classes so classMap is the
|
|
70
|
+
* sole source of truth after a selection update.
|
|
72
71
|
* @private
|
|
73
72
|
* @param {Number} dateFrom - Depart date.
|
|
74
73
|
* @param {Number} dateTo - Return date.
|
|
75
|
-
* @param {Number} hoveredDate - Hovered date.
|
|
76
74
|
* @param {Object} day - An object containing the dateFrom and day of month values.
|
|
77
75
|
* @returns {void}
|
|
78
76
|
*/
|
|
@@ -85,12 +83,43 @@ export class AuroCalendarCell extends LitElement {
|
|
|
85
83
|
private handleTap;
|
|
86
84
|
/**
|
|
87
85
|
* Handles user hover events and dispatches a custom event.
|
|
86
|
+
* Does NOT set any reactive properties — the range preview is handled
|
|
87
|
+
* imperatively by the calendar component to avoid O(N) re-renders.
|
|
88
88
|
* @private
|
|
89
89
|
* @returns {void}
|
|
90
90
|
*/
|
|
91
91
|
private handleHover;
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
93
|
+
* Handles focus events on the cell button.
|
|
94
|
+
* Dispatches a lightweight event for the calendar to handle SR
|
|
95
|
+
* announcements and range preview updates without triggering
|
|
96
|
+
* any Lit lifecycle updates.
|
|
97
|
+
* @private
|
|
98
|
+
* @returns {void}
|
|
99
|
+
*/
|
|
100
|
+
private handleFocus;
|
|
101
|
+
/**
|
|
102
|
+
* Checks if the current date is outside the valid min/max range.
|
|
103
|
+
* Out-of-range cells are not focusable and are hidden from screen readers.
|
|
104
|
+
* @private
|
|
105
|
+
* @param {Object} day - An object containing the dateFrom and day of month values.
|
|
106
|
+
* @param {Number} min - The minimum date value.
|
|
107
|
+
* @param {Number} max - The maximum date value.
|
|
108
|
+
* @returns {Boolean} - True if the date is out of range.
|
|
109
|
+
*/
|
|
110
|
+
private isOutOfRange;
|
|
111
|
+
/**
|
|
112
|
+
* Checks if the current date is a blackout date (in disabledDays but within range).
|
|
113
|
+
* Blackout cells are focusable but not selectable.
|
|
114
|
+
* @private
|
|
115
|
+
* @returns {Boolean} - True if the date is a blackout date.
|
|
116
|
+
*/
|
|
117
|
+
private isBlackout;
|
|
118
|
+
/**
|
|
119
|
+
* Checks if the current date is disabled based on min/max range or the
|
|
120
|
+
* legacy disabledDays timestamp list. Sets the `disabled` attribute on the
|
|
121
|
+
* host when the date falls outside the allowed range or appears in
|
|
122
|
+
* disabledDays. Note: blackout dates are handled separately by `isBlackout()`.
|
|
94
123
|
* @private
|
|
95
124
|
* @param {Object} day - An object containing the dateFrom and day of month values.
|
|
96
125
|
* @param {Number} min - The minimum date value.
|
|
@@ -99,6 +128,25 @@ export class AuroCalendarCell extends LitElement {
|
|
|
99
128
|
* @returns {Boolean} - True if the date is disabled.
|
|
100
129
|
*/
|
|
101
130
|
private isEnabled;
|
|
131
|
+
/**
|
|
132
|
+
* Generates a unique cell ID in the format cell-YYYY-MM-DD.
|
|
133
|
+
* @private
|
|
134
|
+
* @returns {String} The unique cell ID.
|
|
135
|
+
*/
|
|
136
|
+
private getCellId;
|
|
137
|
+
/**
|
|
138
|
+
* Generates a localized aria-label for the cell button using Intl.DateTimeFormat.
|
|
139
|
+
* Includes range position and blackout status.
|
|
140
|
+
* @private
|
|
141
|
+
* @returns {String} The aria-label string.
|
|
142
|
+
*/
|
|
143
|
+
private getAriaLabel;
|
|
144
|
+
/**
|
|
145
|
+
* Determines the range position of this cell relative to the current selection.
|
|
146
|
+
* @private
|
|
147
|
+
* @returns {String|null} Range position label or null if not in range mode.
|
|
148
|
+
*/
|
|
149
|
+
private getRangePosition;
|
|
102
150
|
/**
|
|
103
151
|
* Checks if the current date is the depart date.
|
|
104
152
|
* @private
|
|
@@ -136,9 +184,9 @@ export class AuroCalendarCell extends LitElement {
|
|
|
136
184
|
*/
|
|
137
185
|
private isLastHoveredDate;
|
|
138
186
|
/**
|
|
139
|
-
* Checks if the current date is a
|
|
187
|
+
* Checks if the current date is a referenced date.
|
|
140
188
|
* @param {Object} dateStr - The date string in MM_DD_YYYY format.
|
|
141
|
-
* @returns Boolean - True if the date is a
|
|
189
|
+
* @returns Boolean - True if the date is a referenced date.
|
|
142
190
|
*/
|
|
143
191
|
isReferenceDate(dateStr: Object): boolean;
|
|
144
192
|
/**
|
|
@@ -164,8 +212,60 @@ export class AuroCalendarCell extends LitElement {
|
|
|
164
212
|
private handleSlotContent;
|
|
165
213
|
firstUpdated(): void;
|
|
166
214
|
datepicker: any;
|
|
215
|
+
_slotContentHandler: (() => void) | undefined;
|
|
216
|
+
_cachedButton: Element | null | undefined;
|
|
217
|
+
calendarMonth: any;
|
|
218
|
+
/**
|
|
219
|
+
* Configures the popover instance with the calendar month boundary.
|
|
220
|
+
* Called from firstUpdated and updated because the popover element is only
|
|
221
|
+
* rendered after hasPopoverContent becomes true (set by handleSlotContent).
|
|
222
|
+
* @private
|
|
223
|
+
* @returns {void}
|
|
224
|
+
*/
|
|
225
|
+
private configurePopover;
|
|
167
226
|
auroPopover: any;
|
|
168
227
|
updated(properties: any): void;
|
|
228
|
+
/**
|
|
229
|
+
* Updates ARIA attributes on the host element so that
|
|
230
|
+
* ariaActiveDescendantElement can expose cell info to the SR.
|
|
231
|
+
* @private
|
|
232
|
+
* @returns {void}
|
|
233
|
+
*/
|
|
234
|
+
private updateHostAria;
|
|
235
|
+
/**
|
|
236
|
+
* Programmatically focuses the cell's interactive button element.
|
|
237
|
+
* Uses focusVisible: true so the :focus-visible ring appears even when
|
|
238
|
+
* the bib was opened via mouse click (which sets mouse input modality).
|
|
239
|
+
* @returns {void}
|
|
240
|
+
*/
|
|
241
|
+
focusButton(): void;
|
|
242
|
+
/**
|
|
243
|
+
* Imperatively marks this cell as active without triggering a Lit re-render.
|
|
244
|
+
* Note: buttons stay tabindex="-1" because the grid uses aria-activedescendant.
|
|
245
|
+
* @returns {void}
|
|
246
|
+
*/
|
|
247
|
+
setActive(): void;
|
|
248
|
+
/**
|
|
249
|
+
* Imperatively marks this cell as inactive without triggering a Lit re-render.
|
|
250
|
+
* @returns {void}
|
|
251
|
+
*/
|
|
252
|
+
clearActive(): void;
|
|
253
|
+
/**
|
|
254
|
+
* Updates range preview classes imperatively (no Lit re-render).
|
|
255
|
+
* Called by the calendar component when the hovered date changes
|
|
256
|
+
* during range selection (dateFrom set, dateTo not yet set).
|
|
257
|
+
* @param {Number} hoveredDate - Unix timestamp of the currently hovered/focused date.
|
|
258
|
+
* @param {Number} dateFrom - Unix timestamp of the selected departure date.
|
|
259
|
+
* @returns {void}
|
|
260
|
+
*/
|
|
261
|
+
updateRangePreviewClasses(hoveredDate: number, dateFrom: number): void;
|
|
262
|
+
/**
|
|
263
|
+
* Clears all imperative range preview classes from the cell button.
|
|
264
|
+
* Called when a selection occurs so classMap becomes the sole source of truth.
|
|
265
|
+
* @returns {void}
|
|
266
|
+
*/
|
|
267
|
+
clearRangePreviewClasses(): void;
|
|
268
|
+
renderCellButton(): import("lit-html").TemplateResult;
|
|
169
269
|
render(): import("lit-html").TemplateResult;
|
|
170
270
|
}
|
|
171
271
|
import { LitElement } from "lit";
|
|
@@ -10,7 +10,7 @@ export class AuroCalendarMonth extends RangeDatepickerCalendar {
|
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* BCP 47 locale tag (such as `en-US`) for calendar localization.
|
|
13
|
-
*
|
|
13
|
+
* As wc-range-datepicker expects a `locale` prop, we use `localeCode` to avoid conflicts.
|
|
14
14
|
*/
|
|
15
15
|
localeCode: {
|
|
16
16
|
type: StringConstructor;
|
|
@@ -31,13 +31,50 @@ export class AuroCalendarMonth extends RangeDatepickerCalendar {
|
|
|
31
31
|
private computeCurrentMonthName;
|
|
32
32
|
_cachedMonthNames: string[] | undefined;
|
|
33
33
|
_cachedMonthNamesLocale: any;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the unique heading ID for this month, used by aria-labelledby.
|
|
36
|
+
* @private
|
|
37
|
+
* @returns {String} The heading ID.
|
|
38
|
+
*/
|
|
39
|
+
private getHeadingId;
|
|
34
40
|
/**
|
|
35
41
|
* Determines the current month name based on locale.
|
|
42
|
+
* Also builds parallel arrays of full day names for abbr attributes.
|
|
36
43
|
* This is a rewrite of the function used in the class RangeDatepickerCalendar and should not be removed from here.
|
|
37
44
|
* @private
|
|
38
45
|
* @param {Object} changedProperties - The properties that have changed since the last update.
|
|
39
46
|
* @returns {void}
|
|
40
47
|
*/
|
|
41
48
|
private updated;
|
|
49
|
+
dayFullNames: any[] | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Renders a day-of-week header with abbr attribute for the full day name.
|
|
52
|
+
* @private
|
|
53
|
+
* @param {String} dayOfWeek - The short day name.
|
|
54
|
+
* @param {Number} index - The index in the dayNamesOfTheWeek array.
|
|
55
|
+
* @returns {Object} The header HTML.
|
|
56
|
+
*/
|
|
57
|
+
private renderDayOfWeek;
|
|
58
|
+
/**
|
|
59
|
+
* Returns all focusable cell elements (enabled + blackout, not out-of-range) in this month.
|
|
60
|
+
* @returns {Array} Array of auro-formkit-calendar-cell elements.
|
|
61
|
+
*/
|
|
62
|
+
getFocusableCells(): any[];
|
|
63
|
+
/**
|
|
64
|
+
* Overrides the base class handler to prevent setting `this.hoveredDate`
|
|
65
|
+
* as a reactive property. Instead, just dispatches the event upward so
|
|
66
|
+
* the calendar can handle range preview imperatively.
|
|
67
|
+
* @private
|
|
68
|
+
* @param {CustomEvent} event - The date-is-hovered event from a cell.
|
|
69
|
+
* @returns {void}
|
|
70
|
+
*/
|
|
71
|
+
private handleDateHovered;
|
|
72
|
+
/**
|
|
73
|
+
* Dispatches a bubbling event when the mouse leaves the date grid body
|
|
74
|
+
* so the parent calendar can clear the range hover preview.
|
|
75
|
+
* @private
|
|
76
|
+
* @returns {void}
|
|
77
|
+
*/
|
|
78
|
+
private handleTbodyMouseLeave;
|
|
42
79
|
}
|
|
43
80
|
import { RangeDatepickerCalendar } from './vendor/wc-range-datepicker/range-datepicker-calendar.js';
|
|
@@ -138,6 +138,18 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
138
138
|
visible: boolean;
|
|
139
139
|
largeFullscreenHeadline: boolean;
|
|
140
140
|
isFullscreen: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* The date of the currently active cell (Unix timestamp).
|
|
143
|
+
* Only one cell across the entire calendar has tabindex="0" at a time.
|
|
144
|
+
* @private
|
|
145
|
+
*/
|
|
146
|
+
private activeCellDate;
|
|
147
|
+
/**
|
|
148
|
+
* Whether the #calendarGrid wrapper currently has focus.
|
|
149
|
+
* Used to determine whether the visualFocus ring should be shown.
|
|
150
|
+
* @private
|
|
151
|
+
*/
|
|
152
|
+
private _gridHasFocus;
|
|
141
153
|
/**
|
|
142
154
|
* @private
|
|
143
155
|
*/
|
|
@@ -163,12 +175,50 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
163
175
|
*/
|
|
164
176
|
private buttonTag;
|
|
165
177
|
dropdown: any;
|
|
178
|
+
/**
|
|
179
|
+
* Unique instance ID for the live region element.
|
|
180
|
+
* @private
|
|
181
|
+
*/
|
|
182
|
+
private _calendarInstanceId;
|
|
166
183
|
/** @returns {Date|undefined} */
|
|
167
184
|
get centralDateObject(): Date | undefined;
|
|
168
185
|
/** @returns {Date|undefined} */
|
|
169
186
|
get minDateObject(): Date | undefined;
|
|
170
187
|
/** @returns {Date|undefined} */
|
|
171
188
|
get maxDateObject(): Date | undefined;
|
|
189
|
+
/**
|
|
190
|
+
* Updates the month and year when the user navigates to the previous calendar month.
|
|
191
|
+
* @private
|
|
192
|
+
* @param {Object} [options] - Optional settings.
|
|
193
|
+
* @param {boolean} [options.skipActiveUpdate=false] - When true, skip the active cell
|
|
194
|
+
* recomputation. Used by arrow key handlers that manage the active cell themselves.
|
|
195
|
+
* @returns {void}
|
|
196
|
+
*/
|
|
197
|
+
private handlePrevMonth;
|
|
198
|
+
/**
|
|
199
|
+
* Updates the month and year when the user navigates to the next calendar month.
|
|
200
|
+
* @private
|
|
201
|
+
* @param {Object} [options] - Optional settings.
|
|
202
|
+
* @param {boolean} [options.skipActiveUpdate=false] - When true, skip the active cell
|
|
203
|
+
* recomputation. Used by arrow key handlers that manage the active cell themselves.
|
|
204
|
+
* @returns {void}
|
|
205
|
+
*/
|
|
206
|
+
private handleNextMonth;
|
|
207
|
+
/**
|
|
208
|
+
* Announces the current month and year via the live region after navigation.
|
|
209
|
+
* @private
|
|
210
|
+
* @returns {void}
|
|
211
|
+
*/
|
|
212
|
+
private announceMonthChange;
|
|
213
|
+
_focusAnnounceTimer: any;
|
|
214
|
+
/**
|
|
215
|
+
* Updates the active cell after month navigation (prev/next buttons).
|
|
216
|
+
* Always moves the active cell to the first enabled date in the newly
|
|
217
|
+
* visible months so that tabbing back to the grid lands on an enabled cell.
|
|
218
|
+
* @private
|
|
219
|
+
* @returns {void}
|
|
220
|
+
*/
|
|
221
|
+
private updateActiveCellForVisibleMonth;
|
|
172
222
|
/**
|
|
173
223
|
* Renders all of the auro-calendar-months HTML.
|
|
174
224
|
* @private
|
|
@@ -188,6 +238,214 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
188
238
|
* @returns {void}
|
|
189
239
|
*/
|
|
190
240
|
scrollMonthIntoView(date: string): void;
|
|
241
|
+
/**
|
|
242
|
+
* Gets all rendered month components.
|
|
243
|
+
* @private
|
|
244
|
+
* @returns {Array} Array of auro-formkit-calendar-month elements.
|
|
245
|
+
*/
|
|
246
|
+
private getMonthComponents;
|
|
247
|
+
/**
|
|
248
|
+
* Gets all focusable cells across all rendered months.
|
|
249
|
+
* @private
|
|
250
|
+
* @returns {Array} Array of auro-formkit-calendar-cell elements.
|
|
251
|
+
*/
|
|
252
|
+
private getAllFocusableCells;
|
|
253
|
+
/**
|
|
254
|
+
* Sets the active cell across all months. Only one cell has tabindex="0" at a time.
|
|
255
|
+
* Uses imperative DOM manipulation — no Lit re-render triggered.
|
|
256
|
+
* Also updates ariaActiveDescendantElement on the grid wrapper so
|
|
257
|
+
* screen readers announce the active cell without moving DOM focus.
|
|
258
|
+
* @param {Number} date - Unix timestamp of the cell to activate.
|
|
259
|
+
* @returns {void}
|
|
260
|
+
*/
|
|
261
|
+
setActiveCell(date: number): void;
|
|
262
|
+
/**
|
|
263
|
+
* Focuses the calendar grid wrapper and sets the active cell.
|
|
264
|
+
* DOM focus stays on the grid wrapper; the aria-live region
|
|
265
|
+
* tells the screen reader which cell is "active".
|
|
266
|
+
* @returns {void}
|
|
267
|
+
*/
|
|
268
|
+
focusActiveCell(): void;
|
|
269
|
+
/**
|
|
270
|
+
* Shows the activeCell ring when the grid gains focus.
|
|
271
|
+
* @private
|
|
272
|
+
* @returns {void}
|
|
273
|
+
*/
|
|
274
|
+
private handleGridFocusIn;
|
|
275
|
+
/**
|
|
276
|
+
* Hides the activeCell ring when the grid loses focus.
|
|
277
|
+
* @private
|
|
278
|
+
* @returns {void}
|
|
279
|
+
*/
|
|
280
|
+
private handleGridFocusOut;
|
|
281
|
+
/**
|
|
282
|
+
* Computes the initial active date from data properties alone — no DOM required.
|
|
283
|
+
* Priority:
|
|
284
|
+
* 1. Selected date (dateFrom) if within range
|
|
285
|
+
* 2. Today's date if not disabled (in-range and not blackout)
|
|
286
|
+
* 3. First future non-disabled date (scans day-by-day from today up to 1 year)
|
|
287
|
+
* 4. First previous non-disabled date (scans day-by-day from today up to 1 year)
|
|
288
|
+
* 5. First enabled date in finite [min, max] range
|
|
289
|
+
* 5b. First enabled date scanning forward from finite min (unbounded max)
|
|
290
|
+
* 5c. First enabled date scanning backward from finite max (unbounded min)
|
|
291
|
+
* 6. First in-range date (even if blackout) so focus can land somewhere
|
|
292
|
+
* 7. Undefined — no valid target.
|
|
293
|
+
*
|
|
294
|
+
* @private
|
|
295
|
+
* @param {Object} [options] - Optional settings.
|
|
296
|
+
* @param {boolean} [options.skipDateFrom=false] - When true, skip the selected-date
|
|
297
|
+
* shortcut (step 1). Used after month navigation so the active cell lands in the
|
|
298
|
+
* newly visible month instead of jumping back to the selected date's month.
|
|
299
|
+
* @returns {Number|undefined} Unix timestamp (seconds) of the date to activate, or undefined.
|
|
300
|
+
*/
|
|
301
|
+
private computeActiveDate;
|
|
302
|
+
/**
|
|
303
|
+
* Checks if a target date (unix seconds) is within the configured [min, max] range.
|
|
304
|
+
* Returns false if the date falls outside the range, preventing navigation
|
|
305
|
+
* to months where all dates are disabled.
|
|
306
|
+
* @private
|
|
307
|
+
* @param {Number} targetTs - Unix timestamp in seconds.
|
|
308
|
+
* @returns {Boolean} True if the date is within range.
|
|
309
|
+
*/
|
|
310
|
+
private isDateInRange;
|
|
311
|
+
/**
|
|
312
|
+
* Handles arrow key navigation on the calendar grid wrapper.
|
|
313
|
+
* Focus stays on the grid wrapper; only ariaActiveDescendantElement
|
|
314
|
+
* and the visual active-cell indicator change.
|
|
315
|
+
* @private
|
|
316
|
+
* @param {KeyboardEvent} event - The keyboard event.
|
|
317
|
+
* @returns {void}
|
|
318
|
+
*/
|
|
319
|
+
private handleGridKeyDown;
|
|
320
|
+
/**
|
|
321
|
+
* Handles cross-month boundary navigation events from month components.
|
|
322
|
+
* @private
|
|
323
|
+
* @param {CustomEvent} event - The boundary event with direction and source date info.
|
|
324
|
+
* @returns {void}
|
|
325
|
+
*/
|
|
326
|
+
private handleMonthBoundary;
|
|
327
|
+
/**
|
|
328
|
+
* Handles cell activation events from month components.
|
|
329
|
+
* @private
|
|
330
|
+
* @param {CustomEvent} event - The activation event with target date.
|
|
331
|
+
* @returns {void}
|
|
332
|
+
*/
|
|
333
|
+
private handleCellActivate;
|
|
334
|
+
/**
|
|
335
|
+
* Handles focus events from calendar cells.
|
|
336
|
+
* Updates the live region with an SR announcement and triggers
|
|
337
|
+
* the imperative range preview if applicable.
|
|
338
|
+
* @private
|
|
339
|
+
* @param {CustomEvent} event - The calendar-cell-focused event.
|
|
340
|
+
* @returns {void}
|
|
341
|
+
*/
|
|
342
|
+
private handleCellFocused;
|
|
343
|
+
/**
|
|
344
|
+
* Builds a full SR announcement string for a focused cell date.
|
|
345
|
+
* Includes the localized date, range position, popover content,
|
|
346
|
+
* and blackout status.
|
|
347
|
+
* @private
|
|
348
|
+
* @param {Number} date - Unix timestamp (seconds) of the focused cell.
|
|
349
|
+
* @returns {String} The announcement string.
|
|
350
|
+
*/
|
|
351
|
+
private buildFocusAnnouncement;
|
|
352
|
+
/**
|
|
353
|
+
* Determines the range position label for a given date.
|
|
354
|
+
* @private
|
|
355
|
+
* @param {Number} date - Unix timestamp (seconds).
|
|
356
|
+
* @returns {String|null} The range position label, or null.
|
|
357
|
+
*/
|
|
358
|
+
private getRangePositionLabel;
|
|
359
|
+
/**
|
|
360
|
+
* Checks whether a given date is a blackout date.
|
|
361
|
+
* @private
|
|
362
|
+
* @param {Number} dateTs - Unix timestamp (seconds).
|
|
363
|
+
* @returns {Boolean} True if the date is blacked out.
|
|
364
|
+
*/
|
|
365
|
+
private isDateBlackout;
|
|
366
|
+
/**
|
|
367
|
+
* Updates the range preview classes imperatively across all cells.
|
|
368
|
+
* Only active when in range mode with dateFrom set and dateTo not yet set.
|
|
369
|
+
* @private
|
|
370
|
+
* @param {Number} hoveredDate - Unix timestamp of the hovered/focused date.
|
|
371
|
+
* @returns {void}
|
|
372
|
+
*/
|
|
373
|
+
private updateRangePreview;
|
|
374
|
+
/**
|
|
375
|
+
* Clears range preview classes from all cells.
|
|
376
|
+
* @private
|
|
377
|
+
* @param {Object} [options] - Optional settings.
|
|
378
|
+
* @param {boolean} [options.force=false] - When true, clears classes even
|
|
379
|
+
* when both dateFrom and dateTo are set. Used by month nav handlers
|
|
380
|
+
* since the subsequent re-render re-applies classMap-managed classes,
|
|
381
|
+
* while `lastHoveredDate` (not in classMap) would otherwise persist.
|
|
382
|
+
* @returns {void}
|
|
383
|
+
*/
|
|
384
|
+
private clearRangePreview;
|
|
385
|
+
/**
|
|
386
|
+
* Overrides the base class handler to prevent setting `this.hoveredDate`
|
|
387
|
+
* as a reactive property. Instead, handles the range preview imperatively.
|
|
388
|
+
* @private
|
|
389
|
+
* @param {CustomEvent} event - The hovered-date-changed event from a month.
|
|
390
|
+
* @returns {void}
|
|
391
|
+
*/
|
|
392
|
+
private hoveredDateChanged;
|
|
393
|
+
/**
|
|
394
|
+
* Scrolls the calendar to ensure the month containing the active cell is visible.
|
|
395
|
+
* @private
|
|
396
|
+
* @returns {void}
|
|
397
|
+
*/
|
|
398
|
+
private scrollToActiveCell;
|
|
399
|
+
/**
|
|
400
|
+
* Returns (and lazily creates) an aria-live region inside the dropdown's
|
|
401
|
+
* <dialog> element. This placement is critical for two reasons:
|
|
402
|
+
*
|
|
403
|
+
* 1. Inside the dialog's accessible scope — dialog.showModal() makes
|
|
404
|
+
* everything outside the top-layer dialog inert, and desktop modal
|
|
405
|
+
* mode uses _setPageInert() on document.body siblings. A live region
|
|
406
|
+
* on document.body would be invisible to screen readers in both cases.
|
|
407
|
+
*
|
|
408
|
+
* 2. Not nested in shadow DOM — Chrome inconsistently observes aria-live
|
|
409
|
+
* mutations inside shadow DOM across machines and versions. The dialog
|
|
410
|
+
* element is only one shadow root deep (the dropdown bib's shadow DOM),
|
|
411
|
+
* which Chrome handles reliably. The calendar's own shadow DOM (nested
|
|
412
|
+
* inside the bib via slotting) is two+ levels deep and unreliable.
|
|
413
|
+
*
|
|
414
|
+
* @private
|
|
415
|
+
* @returns {HTMLElement} The live region element.
|
|
416
|
+
*/
|
|
417
|
+
private getOrCreateLiveRegion;
|
|
418
|
+
_liveRegion: any;
|
|
419
|
+
_announceRafId: any;
|
|
420
|
+
/**
|
|
421
|
+
* Announces a date selection or focus change via the live region.
|
|
422
|
+
* Uses requestAnimationFrame to ensure the clear and set happen in
|
|
423
|
+
* separate rendering frames — Chrome may coalesce synchronous or
|
|
424
|
+
* microtask-deferred mutations into a single accessibility tree update.
|
|
425
|
+
* @private
|
|
426
|
+
* @param {String} dateStr - The localized date string to announce.
|
|
427
|
+
* @returns {void}
|
|
428
|
+
*/
|
|
429
|
+
private announceSelection;
|
|
430
|
+
/**
|
|
431
|
+
* Debounced version of announceSelection for focus navigation.
|
|
432
|
+
* Uses the assertive live region with a 150ms debounce so only the
|
|
433
|
+
* final cell after rapid arrow-key traversal is announced. We
|
|
434
|
+
* originally tried aria-live="polite" here, but VoiceOver treats
|
|
435
|
+
* polite as "wait until idle" — which never happens during active
|
|
436
|
+
* keyboard navigation — so the announcements were silently dropped.
|
|
437
|
+
* @private
|
|
438
|
+
* @param {String} dateStr - The localized date string to announce.
|
|
439
|
+
* @returns {void}
|
|
440
|
+
*/
|
|
441
|
+
private announceFocusDebounced;
|
|
442
|
+
/**
|
|
443
|
+
* Formats a Unix timestamp (seconds) as a localized date string for SR announcements.
|
|
444
|
+
* @private
|
|
445
|
+
* @param {String|Number} timestamp - Unix timestamp in seconds.
|
|
446
|
+
* @returns {String} Localized date string.
|
|
447
|
+
*/
|
|
448
|
+
private formatAnnouncementDate;
|
|
191
449
|
injectSlot(slotName: any, nodes: any): void;
|
|
192
450
|
render(): import("lit-html").TemplateResult;
|
|
193
451
|
}
|