@aurodesignsystem-dev/auro-formkit 0.0.0-pr1628.0 → 0.0.0-pr1628.10
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 +1 -1
- package/components/bibtemplate/dist/index.js +1 -1
- package/components/bibtemplate/dist/registered.js +1 -1
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/accessibility.md +2 -2
- package/components/checkbox/demo/api.md +17 -17
- package/components/checkbox/demo/customize.md +16 -16
- package/components/checkbox/demo/customize.min.js +3 -3
- package/components/checkbox/demo/design.md +24 -24
- package/components/checkbox/demo/getting-started.md +33 -27
- package/components/checkbox/demo/getting-started.min.js +3 -3
- package/components/checkbox/demo/index.md +17 -17
- package/components/checkbox/demo/index.min.js +3 -3
- package/components/checkbox/demo/readme.md +1 -1
- package/components/checkbox/dist/auro-checkbox-group.d.ts +2 -2
- package/components/checkbox/dist/index.js +3 -3
- package/components/checkbox/dist/registered.js +3 -3
- package/components/combobox/demo/accessibility.md +1 -1
- package/components/combobox/demo/api.md +3 -3
- package/components/combobox/demo/css-only.md +3 -3
- package/components/combobox/demo/customize.md +13 -12
- package/components/combobox/demo/customize.min.js +79 -59
- package/components/combobox/demo/getting-started.md +4 -4
- package/components/combobox/demo/getting-started.min.js +79 -59
- package/components/combobox/demo/index.md +2 -2
- package/components/combobox/demo/index.min.js +79 -59
- package/components/combobox/demo/voiceover.md +1 -1
- package/components/combobox/dist/auro-combobox.d.ts +35 -31
- package/components/combobox/dist/index.js +68 -49
- package/components/combobox/dist/registered.js +68 -49
- package/components/counter/demo/accessibility.md +1 -1
- package/components/counter/demo/api.md +18 -18
- package/components/counter/demo/css-only.md +1 -1
- package/components/counter/demo/customize.md +2 -2
- package/components/counter/demo/customize.min.js +28 -28
- package/components/counter/demo/design.md +1 -1
- package/components/counter/demo/getting-started.md +29 -2
- package/components/counter/demo/getting-started.min.js +28 -28
- package/components/counter/demo/index.min.js +28 -28
- package/components/counter/demo/why-counter.md +3 -3
- package/components/counter/dist/auro-counter-group.d.ts +13 -14
- package/components/counter/dist/auro-counter.d.ts +1 -1
- package/components/counter/dist/index.js +28 -28
- package/components/counter/dist/registered.js +28 -28
- package/components/datepicker/README.md +1 -1
- package/components/datepicker/demo/accessibility.md +5 -5
- package/components/datepicker/demo/api.md +3 -3
- package/components/datepicker/demo/css-only.md +4 -4
- package/components/datepicker/demo/customize.md +12 -12
- package/components/datepicker/demo/customize.min.js +186 -132
- package/components/datepicker/demo/design.md +11 -11
- package/components/datepicker/demo/getting-started.md +4 -4
- package/components/datepicker/demo/getting-started.min.js +186 -132
- package/components/datepicker/demo/index.md +5 -5
- package/components/datepicker/demo/index.min.js +186 -132
- package/components/datepicker/demo/keyboard-behavior.md +1 -1
- package/components/datepicker/demo/readme.md +1 -1
- package/components/datepicker/demo/voiceover.md +4 -4
- package/components/datepicker/demo/why-datepicker.md +3 -3
- package/components/datepicker/dist/auro-calendar-cell.d.ts +32 -33
- package/components/datepicker/dist/auro-calendar-month.d.ts +8 -8
- package/components/datepicker/dist/auro-calendar.d.ts +44 -43
- package/components/datepicker/dist/auro-datepicker.d.ts +12 -10
- package/components/datepicker/dist/datepickerKeyboardStrategy.d.ts +3 -0
- package/components/datepicker/dist/index.js +186 -132
- package/components/datepicker/dist/registered.js +186 -132
- package/components/datepicker/dist/utilities.d.ts +4 -1
- package/components/datepicker/dist/utilitiesCalendar.d.ts +12 -4
- package/components/datepicker/dist/utilitiesCalendarRender.d.ts +12 -6
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-calendar.d.ts +4 -4
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker.d.ts +7 -7
- package/components/dropdown/demo/api.md +7 -7
- package/components/dropdown/demo/css-only.md +2 -2
- package/components/dropdown/demo/customize.md +1 -1
- package/components/dropdown/demo/customize.min.js +10 -9
- package/components/dropdown/demo/design.md +4 -4
- package/components/dropdown/demo/getting-started.min.js +31 -16
- package/components/dropdown/demo/index.min.js +10 -9
- package/components/dropdown/demo/voiceover.md +1 -1
- package/components/dropdown/demo/why-dropdown.md +1 -1
- package/components/dropdown/dist/auro-dropdown.d.ts +9 -8
- package/components/dropdown/dist/index.js +10 -9
- package/components/dropdown/dist/registered.js +10 -9
- package/components/form/README.md +1 -1
- package/components/form/demo/api.md +7 -7
- package/components/form/demo/css-only.md +1 -1
- package/components/form/demo/customize.md +2 -0
- package/components/form/demo/customize.min.js +345 -257
- package/components/form/demo/getting-started.md +2 -0
- package/components/form/demo/getting-started.min.js +345 -257
- package/components/form/demo/index.md +2 -2
- package/components/form/demo/index.min.js +345 -257
- package/components/form/demo/keyboard-behavior.md +1 -1
- package/components/form/demo/readme.md +1 -1
- package/components/form/demo/registerDemoDeps.min.js +343 -255
- package/components/form/demo/voiceover.md +3 -3
- package/components/form/demo/why-form.md +1 -1
- package/components/form/dist/auro-form.d.ts +2 -2
- package/components/form/dist/index.js +2 -2
- package/components/form/dist/registered.js +2 -2
- package/components/input/demo/api.md +58 -58
- package/components/input/demo/css-only.md +4 -4
- package/components/input/demo/customize.md +11 -11
- package/components/input/demo/customize.min.js +21 -7
- package/components/input/demo/design.md +2 -2
- package/components/input/demo/getting-started.md +5 -5
- package/components/input/demo/getting-started.min.js +21 -7
- package/components/input/demo/index.md +1 -1
- package/components/input/demo/index.min.js +21 -7
- package/components/input/demo/why-input.md +3 -3
- package/components/input/dist/auro-input.d.ts +1 -1
- package/components/input/dist/base-input.d.ts +6 -5
- package/components/input/dist/index.js +21 -7
- package/components/input/dist/registered.js +21 -7
- package/components/input/dist/utilities.d.ts +11 -0
- package/components/menu/demo/accessibility.md +1 -1
- package/components/menu/demo/api.md +1 -1
- package/components/menu/demo/css-only.md +4 -4
- package/components/menu/demo/customize.md +1 -1
- package/components/menu/demo/design.md +1 -1
- package/components/menu/demo/getting-started.md +3 -3
- package/components/menu/demo/index.min.js +11 -10
- package/components/menu/demo/keyboard-behavior.md +1 -1
- package/components/menu/demo/voiceover.md +1 -1
- package/components/menu/demo/why-menu.md +3 -3
- package/components/menu/dist/auro-menu.d.ts +10 -9
- package/components/menu/dist/auro-menuoption.d.ts +1 -1
- package/components/menu/dist/index.js +11 -10
- package/components/menu/dist/registered.js +11 -10
- package/components/radio/demo/accessibility.md +1 -1
- package/components/radio/demo/api.md +10 -10
- package/components/radio/demo/customize.md +15 -5
- package/components/radio/demo/customize.min.js +10 -12
- package/components/radio/demo/design.md +1 -1
- package/components/radio/demo/getting-started.md +6 -6
- package/components/radio/demo/getting-started.min.js +10 -12
- package/components/radio/demo/index.md +1 -1
- package/components/radio/demo/index.min.js +10 -12
- package/components/radio/demo/keyboard-behavior.md +1 -1
- package/components/radio/demo/voiceover.md +1 -1
- package/components/radio/demo/why-radio.md +1 -1
- package/components/radio/dist/auro-radio-group.d.ts +6 -8
- package/components/radio/dist/auro-radio.d.ts +3 -3
- package/components/radio/dist/index.js +10 -12
- package/components/radio/dist/registered.js +10 -12
- package/components/select/demo/api.md +1 -1
- package/components/select/demo/css-only.md +1 -1
- package/components/select/demo/customize.md +1 -1
- package/components/select/demo/customize.min.js +27 -24
- package/components/select/demo/getting-started.min.js +27 -24
- package/components/select/demo/index.md +1 -1
- package/components/select/demo/index.min.js +27 -24
- package/components/select/demo/voiceover.md +1 -1
- package/components/select/dist/auro-select.d.ts +4 -3
- package/components/select/dist/index.js +16 -14
- package/components/select/dist/registered.js +16 -14
- package/custom-elements.json +159 -143
- package/package.json +1 -1
|
@@ -37,5 +37,5 @@ Use the <code><auro-datepicker></code> element when people need to:
|
|
|
37
37
|
|
|
38
38
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeGettingStarted.md) -->
|
|
39
39
|
<!-- The below content is automatically added from ./docs/partials/readmeGettingStarted.md -->
|
|
40
|
-
For
|
|
40
|
+
For getting started instructions, visit the [`auro-datepicker` getting started page](https://auro.alaskaair.com/components/auro/datepicker/getting-started).
|
|
41
41
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<auro-header level="1" id="overview">Datepicker
|
|
1
|
+
<auro-header level="1" id="overview">Datepicker: VoiceOver behavior</auro-header>
|
|
2
2
|
<p>This page documents the VoiceOver experience when using the <code><auro-datepicker></code> component. It covers announcements, gestures, and workflows for both large and small viewports.</p>
|
|
3
3
|
<auro-header level="2" id="voiceOverInteractiveAnnouncements">Interactive announcements</auro-header>
|
|
4
4
|
<auro-header level="3" id="voiceOverFocusAnnouncement">Focus</auro-header>
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
<li><strong>Focus:</strong> Tab to the datepicker input.</li>
|
|
72
72
|
<li><strong>Type a date:</strong> Enter a date value directly, or press Enter/Space to open the calendar.</li>
|
|
73
73
|
<li><strong>Calendar opens:</strong> Focus moves to the calendar grid wrapper. The initial active cell is marked imperatively, and the <code>aria-live</code> region announces its full localized label so VoiceOver reads the active date. Navigate dates with VoiceOver gestures (swipe) or arrow keys.</li>
|
|
74
|
-
<li><strong>Select a date:</strong> Activate a calendar cell (double-tap with VoiceOver, or Enter/Space with keyboard) to select the date. The selected date is announced via a live region and
|
|
74
|
+
<li><strong>Select a date:</strong> Activate a calendar cell (double-tap with VoiceOver, or Enter/Space with keyboard) to select the date. The selected date is announced via a live region and appears in the input. The calendar remains open; close it by pressing Escape or activating the Done button.</li>
|
|
75
75
|
</ol>
|
|
76
76
|
<auro-header level="2" id="voiceOverSmallVPAnnouncements">Small viewport workflow</auro-header>
|
|
77
77
|
<p>Examples: mobile phone, very small desktop browser window</p>
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
</li>
|
|
83
83
|
<li><strong>Navigate dates:</strong> Swipe through calendar cells or use arrow keys.</li>
|
|
84
84
|
<li>
|
|
85
|
-
<strong>Select a date:</strong> The selected date is announced via a live region and
|
|
85
|
+
<strong>Select a date:</strong> The selected date is announced via a live region and appears in the input. The fullscreen modal remains open so additional dates can be reviewed.
|
|
86
86
|
<p>~OR~</p>
|
|
87
87
|
<strong>Close:</strong> Activate the close button, press Escape, or use the VoiceOver scrub gesture to close the fullscreen modal dialog.
|
|
88
88
|
</li>
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
<li>The element is removed from the Tab order, but the VoiceOver cursor can still reach it.</li>
|
|
97
97
|
<li>The user can't interact with it: the calendar can't be opened, and no date can be entered.</li>
|
|
98
98
|
</ul>
|
|
99
|
-
<p>Key distinction from <code>aria-hidden</code>: A disabled element is <em>reachable but not operable</em>.
|
|
99
|
+
<p>Key distinction from <code>aria-hidden</code>: A disabled element is <em>reachable but not operable</em>. <code>tabindex="-1"</code> removes it only from the Tab order. To make VoiceOver skip it entirely, you'd need <code>aria-hidden="true"</code>, but that's generally not recommended for disabled controls: users benefit from knowing the field exists and why it may be unavailable.</p>
|
|
100
100
|
<p>This is consistent across NVDA and JAWS as well, though the announcement wording differs. For example, NVDA says <em>"unavailable"</em>.</p>
|
|
101
101
|
<auro-header level="3" id="voiceOverStateInvalid">Invalid</auro-header>
|
|
102
102
|
<p>When an <code><auro-datepicker></code> is invalid the following occurs:</p>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<ul>
|
|
27
27
|
<li>Visually styled as unavailable</li>
|
|
28
28
|
<li>Announced as unavailable (with a customizable label, such as "sold out") to screen readers</li>
|
|
29
|
-
<li>
|
|
29
|
+
<li>Reachable with the arrow keys, but not selectable by click or keyboard</li>
|
|
30
30
|
<li>Validated on typed input: entering a blackout date triggers a <code>customError</code> validity state</li>
|
|
31
31
|
</ul>
|
|
32
32
|
<auro-header level="2" id="validation">Validation</auro-header>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<li>Custom error messages for each validity state (<code>setCustomValidityValueMissing</code>, <code>setCustomValidityRangeOverflow</code>, <code>setCustomValidityRangeUnderflow</code>, <code>setCustomValidityCustomError</code>)</li>
|
|
38
38
|
<li>Validation runs when focus leaves the datepicker, when the end date of a range changes, and when <code>blackoutDates</code> changes</li>
|
|
39
39
|
<li>Dispatches <code>auroFormElement-validated</code> events so parent forms can react</li>
|
|
40
|
-
<li>
|
|
40
|
+
<li>Shows the error message below the datepicker, in place of the help text</li>
|
|
41
41
|
</ul>
|
|
42
42
|
<auro-header level="2" id="responsiveLayout">Responsive layout</auro-header>
|
|
43
43
|
<p>Native date inputs render a small, browser-controlled popup that can't be styled or repositioned.</p>
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
<tr>
|
|
123
123
|
<td>Localization</td>
|
|
124
124
|
<td>Browser locale only</td>
|
|
125
|
-
<td>
|
|
125
|
+
<td>Most labels and names, except the Done button and the word "selected"</td>
|
|
126
126
|
</tr>
|
|
127
127
|
<tr>
|
|
128
128
|
<td>Theming</td>
|
|
@@ -136,35 +136,35 @@ export class AuroCalendarCell extends LitElement {
|
|
|
136
136
|
*/
|
|
137
137
|
private dateChanged;
|
|
138
138
|
/**
|
|
139
|
-
*
|
|
139
|
+
* Called when someone clicks the cell's button, or presses Enter or Space while it's the active cell.
|
|
140
|
+
* Selects the cell's date unless the cell is turned off or the date is a blackout date, and fires
|
|
141
|
+
* `calendar-cell-activate` so the calendar makes the cell the active cell.
|
|
140
142
|
* @private
|
|
141
143
|
* @returns {void}
|
|
142
144
|
*/
|
|
143
145
|
private handleTap;
|
|
144
146
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
147
|
+
* Called when the pointer moves over the cell's button. Fires `date-is-hovered` with the cell's date.
|
|
148
|
+
* Doesn't set any reactive properties, because the calendar updates the range preview
|
|
149
|
+
* directly to avoid re-rendering every cell.
|
|
148
150
|
* @private
|
|
149
151
|
* @returns {void}
|
|
150
152
|
*/
|
|
151
153
|
private handleHover;
|
|
152
154
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* announcements and range preview updates without triggering
|
|
156
|
-
* any Lit lifecycle updates.
|
|
155
|
+
* Called when the cell's button gets focus. Fires `calendar-cell-focused` so the calendar can
|
|
156
|
+
* announce the date to screen readers and update the range preview without re-rendering the cell.
|
|
157
157
|
* @private
|
|
158
158
|
* @returns {void}
|
|
159
159
|
*/
|
|
160
160
|
private handleFocus;
|
|
161
161
|
/**
|
|
162
|
-
* Checks
|
|
163
|
-
* Out-of-range cells
|
|
162
|
+
* Checks whether the cell's date is earlier than `min` or later than `max`.
|
|
163
|
+
* Out-of-range cells aren't focusable and are hidden from screen readers.
|
|
164
164
|
* @private
|
|
165
|
-
* @param {Object} day -
|
|
166
|
-
* @param {Number} min - The
|
|
167
|
-
* @param {Number} max - The
|
|
165
|
+
* @param {Object} day - The day this cell shows: an object with `date`, a Unix timestamp in seconds, and `title`, the day of the month.
|
|
166
|
+
* @param {Number} min - The earliest date people can choose, as a Unix timestamp in seconds.
|
|
167
|
+
* @param {Number} max - The latest date people can choose, as a Unix timestamp in seconds.
|
|
168
168
|
* @returns {Boolean} True if the date is out of range; false otherwise.
|
|
169
169
|
*/
|
|
170
170
|
private isOutOfRange;
|
|
@@ -176,29 +176,28 @@ export class AuroCalendarCell extends LitElement {
|
|
|
176
176
|
*/
|
|
177
177
|
private isBlackout;
|
|
178
178
|
/**
|
|
179
|
-
* Checks
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* disabledDays. Note: blackout dates are handled separately by `isBlackout()`.
|
|
179
|
+
* Checks whether the cell's date is turned off because it's outside `min` and `max` or in the
|
|
180
|
+
* deprecated `disabledDays`, and sets the host's `disabled` attribute to match. Despite its name,
|
|
181
|
+
* it returns true for a turned-off date. Blackout dates are handled separately by `isBlackout()`.
|
|
183
182
|
* @private
|
|
184
|
-
* @param {Object} day -
|
|
185
|
-
* @param {Number} min - The
|
|
186
|
-
* @param {Number} max - The
|
|
187
|
-
* @param {Array} disabledDays -
|
|
188
|
-
* @returns {Boolean} True if the date is
|
|
183
|
+
* @param {Object} day - The day this cell shows: an object with `date`, a Unix timestamp in seconds, and `title`, the day of the month.
|
|
184
|
+
* @param {Number} min - The earliest date people can choose, as a Unix timestamp in seconds.
|
|
185
|
+
* @param {Number} max - The latest date people can choose, as a Unix timestamp in seconds.
|
|
186
|
+
* @param {Array} disabledDays - The deprecated array of dates people can't select, as Unix timestamps in seconds.
|
|
187
|
+
* @returns {Boolean} True if the date is turned off; false otherwise.
|
|
189
188
|
*/
|
|
190
189
|
private isEnabled;
|
|
191
190
|
/**
|
|
192
|
-
* Generates a unique cell ID in the format cell-YYYY-MM-DD
|
|
191
|
+
* Generates a unique cell ID in the format `cell-YYYY-MM-DD`.
|
|
193
192
|
* @private
|
|
194
|
-
* @returns {String} The unique cell ID.
|
|
193
|
+
* @returns {String} The unique cell ID, or an empty string when the cell has no date.
|
|
195
194
|
*/
|
|
196
195
|
private getCellId;
|
|
197
196
|
/**
|
|
198
|
-
* Generates
|
|
199
|
-
*
|
|
197
|
+
* Generates the cell's localized `aria-label` with `Intl.DateTimeFormat`.
|
|
198
|
+
* Adds the date slot and popover content, the range position, and the blackout label.
|
|
200
199
|
* @private
|
|
201
|
-
* @returns {String} The aria-label string.
|
|
200
|
+
* @returns {String} The `aria-label` text, or an empty string when the cell has no date.
|
|
202
201
|
*/
|
|
203
202
|
private getAriaLabel;
|
|
204
203
|
/**
|
|
@@ -250,10 +249,10 @@ export class AuroCalendarCell extends LitElement {
|
|
|
250
249
|
*/
|
|
251
250
|
isReferenceDate(dateStr: string): boolean;
|
|
252
251
|
/**
|
|
253
|
-
*
|
|
252
|
+
* Formats a date as a full date in the cell's `locale`, such as "Monday, April 21, 2025" for `en-US`.
|
|
254
253
|
* @private
|
|
255
|
-
* @param {Number} date - The date
|
|
256
|
-
* @returns {String} The
|
|
254
|
+
* @param {Number} date - The date, as a Unix timestamp in seconds.
|
|
255
|
+
* @returns {String} The formatted date, or an empty string when `date` is undefined.
|
|
257
256
|
*/
|
|
258
257
|
private getTitle;
|
|
259
258
|
_titleFormatter: Intl.DateTimeFormat | undefined;
|
|
@@ -265,7 +264,7 @@ export class AuroCalendarCell extends LitElement {
|
|
|
265
264
|
*/
|
|
266
265
|
private setDateSlotName;
|
|
267
266
|
/**
|
|
268
|
-
*
|
|
267
|
+
* Removes the cell's copied slot content, then copies in the `date_YYYY_MM_DD` and `popover_YYYY_MM_DD` content for the cell's date from `auro-datepicker`.
|
|
269
268
|
* @private
|
|
270
269
|
* @returns {void}
|
|
271
270
|
*/
|
|
@@ -298,8 +297,8 @@ export class AuroCalendarCell extends LitElement {
|
|
|
298
297
|
auroPopover: any;
|
|
299
298
|
updated(properties: any): void;
|
|
300
299
|
/**
|
|
301
|
-
* Sets
|
|
302
|
-
* and blackout
|
|
300
|
+
* Sets ARIA attributes on the cell so screen reader users browsing the month grid hear its date,
|
|
301
|
+
* whether it's selected, and whether it's a blackout date. Removes them for a date outside `min` and `max`.
|
|
303
302
|
* @private
|
|
304
303
|
* @returns {void}
|
|
305
304
|
*/
|
|
@@ -52,10 +52,10 @@ export class AuroCalendarMonth extends RangeDatepickerCalendar {
|
|
|
52
52
|
private updated;
|
|
53
53
|
dayFullNames: any[] | undefined;
|
|
54
54
|
/**
|
|
55
|
-
* Renders a day-of-week column header that shows the
|
|
55
|
+
* Renders a day-of-week column header that shows the narrow day name, such as "S" for Sunday in `en-US`, and gives screen readers the full name with `aria-label`.
|
|
56
56
|
* @private
|
|
57
|
-
* @param {String} dayOfWeek - The
|
|
58
|
-
* @param {Number} index - The index in
|
|
57
|
+
* @param {String} dayOfWeek - The narrow day name, such as "S".
|
|
58
|
+
* @param {Number} index - The column's index in `dayNamesOfTheWeek`, from 0 for Sunday.
|
|
59
59
|
* @returns {Object} The header HTML.
|
|
60
60
|
*/
|
|
61
61
|
private renderDayOfWeek;
|
|
@@ -65,17 +65,17 @@ export class AuroCalendarMonth extends RangeDatepickerCalendar {
|
|
|
65
65
|
*/
|
|
66
66
|
getFocusableCells(): any[];
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* the
|
|
68
|
+
* Called when a cell fires `date-is-hovered`. Fires `hovered-date-changed` with the date
|
|
69
|
+
* instead of setting the base class's reactive `hoveredDate`, so the calendar can update
|
|
70
|
+
* the range preview without re-rendering.
|
|
71
71
|
* @private
|
|
72
72
|
* @param {CustomEvent} event - The date-is-hovered event from a cell.
|
|
73
73
|
* @returns {void}
|
|
74
74
|
*/
|
|
75
75
|
private handleDateHovered;
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
78
|
-
* so the
|
|
77
|
+
* Called when the pointer leaves the month's date grid. Fires a bubbling
|
|
78
|
+
* `calendar-month-mouseleave` event so the calendar can clear the range preview.
|
|
79
79
|
* @private
|
|
80
80
|
* @returns {void}
|
|
81
81
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @event auroCalendar-dateSelected - Notifies that someone selected a date in the calendar.
|
|
4
4
|
* @event auroCalendar-centralDateChanged - Notifies that the month shown has changed. Doesn't bubble; `event.detail.date` is the new `centralDate`.
|
|
5
5
|
* @event auroCalendar-dismissRequest - Notifies that someone selected the close or Done button, so the datepicker closes the dropdown.
|
|
6
|
-
* @event narrow-changedProperties - Notifies
|
|
6
|
+
* @event narrow-changedProperties - Notifies once, after the calendar first renders, with `event.detail.value` set to `false`. The calendar doesn't currently track whether the screen is narrow, so the event doesn't fire again.
|
|
7
7
|
*/
|
|
8
8
|
export class AuroCalendar extends RangeDatepicker {
|
|
9
9
|
static get styles(): import("lit").CSSResult[];
|
|
@@ -85,7 +85,7 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
85
85
|
reflect: boolean;
|
|
86
86
|
};
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
88
|
+
* Sets the window width, in pixels, below which `scrollMonthIntoView()` scrolls to a month. The datepicker doesn't currently set it.
|
|
89
89
|
* @private
|
|
90
90
|
*/
|
|
91
91
|
mobileBreakpoint: {
|
|
@@ -190,14 +190,9 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
190
190
|
*/
|
|
191
191
|
private calendarRangeMonths;
|
|
192
192
|
/**
|
|
193
|
-
*
|
|
194
|
-
* `
|
|
195
|
-
*
|
|
196
|
-
* one-time `console.debug` the first time a non-empty value is observed.
|
|
197
|
-
* Support will be removed in a future major release.
|
|
198
|
-
* @private
|
|
199
|
-
*/
|
|
200
|
-
/**
|
|
193
|
+
* Deprecated: Use `blackoutDates` on `auro-datepicker` instead.
|
|
194
|
+
* Holds the dates set with the deprecated `disabledDays`, as Unix timestamps in seconds. The calendar still honors them, and the first non-empty value logs a one-time console message.
|
|
195
|
+
* @deprecated Use `blackoutDates` on `auro-datepicker` instead.
|
|
201
196
|
* @private
|
|
202
197
|
* @type {number[]}
|
|
203
198
|
*/
|
|
@@ -303,9 +298,10 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
303
298
|
*/
|
|
304
299
|
private _afterMonthRender;
|
|
305
300
|
/**
|
|
306
|
-
* Renders
|
|
301
|
+
* Renders the calendar's `auro-formkit-calendar-month` elements, one for each month shown.
|
|
302
|
+
* Renders nothing until `visible` is set.
|
|
307
303
|
* @private
|
|
308
|
-
* @returns {Object} The
|
|
304
|
+
* @returns {Object|undefined} The months' template, or undefined when `visible` isn't set.
|
|
309
305
|
*/
|
|
310
306
|
private renderAllCalendars;
|
|
311
307
|
firstRenderedMonth: any;
|
|
@@ -358,14 +354,16 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
358
354
|
*/
|
|
359
355
|
focusActiveCell(): void;
|
|
360
356
|
/**
|
|
361
|
-
* Shows the
|
|
357
|
+
* Called when focus moves into the calendar grid. Shows the focus ring on the active cell
|
|
358
|
+
* when the grid itself gets focus, not a cell inside it.
|
|
362
359
|
* @private
|
|
363
360
|
* @param {FocusEvent} [event] - The focusin event.
|
|
364
361
|
* @returns {void}
|
|
365
362
|
*/
|
|
366
363
|
private handleGridFocusIn;
|
|
367
364
|
/**
|
|
368
|
-
*
|
|
365
|
+
* Called when the calendar grid or an element in it loses focus. Removes the focus ring from
|
|
366
|
+
* every cell, and clears the range preview while the range doesn't have both dates.
|
|
369
367
|
* @private
|
|
370
368
|
* @returns {void}
|
|
371
369
|
*/
|
|
@@ -406,15 +404,17 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
406
404
|
/**
|
|
407
405
|
* Computes the initial active date from data properties alone, without the DOM.
|
|
408
406
|
* Priority:
|
|
409
|
-
* 1.
|
|
410
|
-
* 2.
|
|
411
|
-
* 3.
|
|
412
|
-
* 4.
|
|
413
|
-
* 5.
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
*
|
|
407
|
+
* 1. The selected date (`dateFrom`), if it's within range.
|
|
408
|
+
* 2. When `centralDate` is in a different month than today, the first enabled date in that month, or else its first in-range date.
|
|
409
|
+
* 3. Today's date, if it's enabled (in range and not a blackout date).
|
|
410
|
+
* 4. The first enabled date in the visible months, or else their first in-range date.
|
|
411
|
+
* 5. The first enabled date after today, scanning day by day for up to a year.
|
|
412
|
+
* 6. The first enabled date before today, scanning day by day for up to a year.
|
|
413
|
+
* 7. The first enabled date in a finite [min, max] range.
|
|
414
|
+
* 7b. The first enabled date scanning forward from a finite min (unbounded max).
|
|
415
|
+
* 7c. The first enabled date scanning backward from a finite max (unbounded min).
|
|
416
|
+
* 8. An in-range date, even if it's a blackout date, so focus can land somewhere: min when it's finite, or else today.
|
|
417
|
+
* 9. Undefined: no valid target.
|
|
418
418
|
*
|
|
419
419
|
* @private
|
|
420
420
|
* @param {Object} [options] - The optional settings.
|
|
@@ -434,32 +434,34 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
434
434
|
*/
|
|
435
435
|
private isDateInRange;
|
|
436
436
|
/**
|
|
437
|
-
*
|
|
438
|
-
*
|
|
439
|
-
*
|
|
437
|
+
* Called when a key is pressed while the calendar grid has focus. The arrow keys move the
|
|
438
|
+
* active cell, into another month when needed, and Enter or Space selects the active date
|
|
439
|
+
* unless it's a blackout date. Focus stays on the grid, and the live region announces the new active cell.
|
|
440
440
|
* @private
|
|
441
441
|
* @param {KeyboardEvent} event - The keyboard event.
|
|
442
442
|
* @returns {void}
|
|
443
443
|
*/
|
|
444
444
|
private handleGridKeyDown;
|
|
445
445
|
/**
|
|
446
|
-
*
|
|
446
|
+
* Called when the calendar receives a `calendar-month-boundary` event. Moves the active cell
|
|
447
|
+
* across a month boundary for the arrow key in `event.detail.key`. Nothing in the datepicker
|
|
448
|
+
* currently fires this event.
|
|
447
449
|
* @private
|
|
448
450
|
* @param {CustomEvent} event - The boundary event with direction and source date info.
|
|
449
451
|
* @returns {void}
|
|
450
452
|
*/
|
|
451
453
|
private handleMonthBoundary;
|
|
452
454
|
/**
|
|
453
|
-
*
|
|
455
|
+
* Called when a cell fires `calendar-cell-activate` after someone selects it. Makes that cell
|
|
456
|
+
* the active cell without moving focus to the grid.
|
|
454
457
|
* @private
|
|
455
458
|
* @param {CustomEvent} event - The activation event with target date.
|
|
456
459
|
* @returns {void}
|
|
457
460
|
*/
|
|
458
461
|
private handleCellActivate;
|
|
459
462
|
/**
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
* the imperative range preview if applicable.
|
|
463
|
+
* Called when a cell's button gets focus, and after the arrow keys move the active cell.
|
|
464
|
+
* Announces the date to screen readers through the live region and updates the range preview.
|
|
463
465
|
* @private
|
|
464
466
|
* @param {CustomEvent} event - The calendar-cell-focused event.
|
|
465
467
|
* @returns {void}
|
|
@@ -531,7 +533,7 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
531
533
|
*
|
|
532
534
|
* The cell's `applyCommittedRangeClasses` reuses the same
|
|
533
535
|
* `isInRange`/`isDepartDate`/`isReturnDate` helpers `renderCellButton`
|
|
534
|
-
* uses, so
|
|
536
|
+
* uses, so this method doesn't parse `dateFrom` or `dateTo`; the helpers already
|
|
535
537
|
* normalize their inputs (midnight-truncation, string→int) internally.
|
|
536
538
|
* @private
|
|
537
539
|
* @returns {void}
|
|
@@ -551,8 +553,8 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
551
553
|
*/
|
|
552
554
|
private scheduleCommittedRangeClassRefresh;
|
|
553
555
|
/**
|
|
554
|
-
*
|
|
555
|
-
*
|
|
556
|
+
* Called when a month fires `hovered-date-changed`. Updates the range preview directly
|
|
557
|
+
* instead of setting the base class's reactive `hoveredDate`, so the cells don't re-render.
|
|
556
558
|
* @private
|
|
557
559
|
* @param {CustomEvent} event - The hovered-date-changed event from a month.
|
|
558
560
|
* @returns {void}
|
|
@@ -564,7 +566,7 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
564
566
|
* Walks the flat tree (rendered, slot-aware) outward from the active
|
|
565
567
|
* cell's button and calls `scrollBy` on every vertically-scrollable
|
|
566
568
|
* ancestor by whatever delta still separates the cell from that
|
|
567
|
-
* ancestor's viewport. Native `scrollIntoView`
|
|
569
|
+
* ancestor's viewport. Native `scrollIntoView` isn't used because the
|
|
568
570
|
* cell sits inside multiple nested scroll containers (the dropdown bib's
|
|
569
571
|
* `<dialog>`, the bibtemplate's `#bodyContainer`) and the algorithm only
|
|
570
572
|
* scrolls one of them on its own, leaving the cell short of the
|
|
@@ -574,7 +576,7 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
574
576
|
* value) so each `scrollBy` resolves synchronously and the next
|
|
575
577
|
* iteration's `getBoundingClientRect` reads post-scroll positions
|
|
576
578
|
* accurately. This also satisfies `prefers-reduced-motion` users: the
|
|
577
|
-
* scroll containers
|
|
579
|
+
* scroll containers don't set CSS `scroll-behavior: smooth`, so `auto`
|
|
578
580
|
* is effectively instant.
|
|
579
581
|
*
|
|
580
582
|
* The active cell is looked up from the cache populated by
|
|
@@ -630,16 +632,15 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
630
632
|
*/
|
|
631
633
|
private _deliverAnnouncement;
|
|
632
634
|
/**
|
|
633
|
-
*
|
|
634
|
-
*
|
|
635
|
-
*
|
|
636
|
-
*
|
|
637
|
-
*
|
|
638
|
-
* keyboard navigation, so the announcements were silently dropped.
|
|
635
|
+
* Announces a date to screen readers after a 150 ms pause, so only the
|
|
636
|
+
* last cell reached with the arrow keys is announced.
|
|
637
|
+
* Uses the assertive live region, because VoiceOver waits for the page to
|
|
638
|
+
* be idle before it reads a polite one, which never happens during
|
|
639
|
+
* arrow-key navigation, so polite announcements were dropped.
|
|
639
640
|
*
|
|
640
641
|
* This is a documented deviation from WCAG 2.1 SC 4.1.3, which
|
|
641
642
|
* prefers `polite` for status messages. See the "Documented
|
|
642
|
-
*
|
|
643
|
+
* deviation" section in `components/datepicker/docs/pages/accessibility.md`.
|
|
643
644
|
* @private
|
|
644
645
|
* @param {String} dateStr - The localized date string to announce.
|
|
645
646
|
* @returns {void}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - **Limits and unavailable dates**: `minDate` and `maxDate` turn off dates outside a range, and `blackoutDates` marks single dates people can't select.
|
|
7
7
|
* - **Validation**: `required` shows an error when no date is chosen, and the `setCustomValidity` attributes replace the built-in error messages.
|
|
8
8
|
* - **Content on dates**: The `date_YYYY_MM_DD` and `popover_YYYY_MM_DD` slots add content to a date in the calendar, such as a price.
|
|
9
|
-
* - **Localization**: `locale` sets the date format and the month and weekday names, and attributes and slots let you translate
|
|
9
|
+
* - **Localization**: `locale` sets the date format and the month and weekday names, and attributes and slots let you translate most other text, except the calendar's Done button and the word "selected" in screen reader announcements.
|
|
10
10
|
* - **Fullscreen on small screens**: `fullscreenBreakpoint` sets the screen size at or below which the calendar opens fullscreen.
|
|
11
11
|
*
|
|
12
12
|
* **Example**
|
|
@@ -237,14 +237,14 @@ export class AuroDatePicker extends AuroElement {
|
|
|
237
237
|
*/
|
|
238
238
|
layout: "classic" | "snowflake";
|
|
239
239
|
/**
|
|
240
|
-
* Sets the shape of the
|
|
240
|
+
* Sets the shape of the date field. Use `classic` (the default) with the `classic` layout, and `snowflake` with the `snowflake` layout.
|
|
241
241
|
* @type {'box' | 'classic' | 'pill' | 'pill-left' | 'pill-right' | 'rounded' | 'snowflake'}
|
|
242
242
|
* @default 'classic'
|
|
243
243
|
* @category ui
|
|
244
244
|
*/
|
|
245
245
|
shape: "box" | "classic" | "pill" | "pill-left" | "pill-right" | "rounded" | "snowflake";
|
|
246
246
|
/**
|
|
247
|
-
* Sets the
|
|
247
|
+
* Sets the height of the date field, from `xs`, the shortest, to `xl`, the tallest. The `classic` and `snowflake` shapes have a fixed height, so `size` doesn't change them. The `rounded` shape supports only `lg`, and the `pill`, `pill-left`, and `pill-right` shapes support only `md` and `xl`.
|
|
248
248
|
* @type {'xs' | 'sm' | 'md' | 'lg' | 'xl'}
|
|
249
249
|
* @default 'lg'
|
|
250
250
|
* @category ui
|
|
@@ -516,7 +516,7 @@ export class AuroDatePicker extends AuroElement {
|
|
|
516
516
|
reflect: boolean;
|
|
517
517
|
};
|
|
518
518
|
/**
|
|
519
|
-
*
|
|
519
|
+
* Marks the datepicker as used once it gets focus, so validation can report a missing required date. `reset()` clears it.
|
|
520
520
|
* @private
|
|
521
521
|
*/
|
|
522
522
|
touched: {
|
|
@@ -563,7 +563,7 @@ export class AuroDatePicker extends AuroElement {
|
|
|
563
563
|
* Per-class dedup set used by `_warnInvalidLocale`. Static so the dedup
|
|
564
564
|
* spans every datepicker instance on the page; lives on the class (not
|
|
565
565
|
* at module scope) so it stays an encapsulated implementation detail of
|
|
566
|
-
* this component and
|
|
566
|
+
* this component and doesn't interfere with WCA's class-JSDoc
|
|
567
567
|
* attachment.
|
|
568
568
|
* @private
|
|
569
569
|
*/
|
|
@@ -673,7 +673,8 @@ export class AuroDatePicker extends AuroElement {
|
|
|
673
673
|
*/
|
|
674
674
|
private helpTextTag;
|
|
675
675
|
/**
|
|
676
|
-
*
|
|
676
|
+
* Called when someone clicks the datepicker. Stops a click on the inert trigger from closing the open calendar,
|
|
677
|
+
* and in the `snowflake` layout, moves focus to the start date input when the click isn't on an input or the calendar and no input has focus.
|
|
677
678
|
* @param {PointerEvent} event - The pointer event object.
|
|
678
679
|
* @private
|
|
679
680
|
* @returns {void}
|
|
@@ -695,7 +696,7 @@ export class AuroDatePicker extends AuroElement {
|
|
|
695
696
|
*/
|
|
696
697
|
private _listenerAbortController;
|
|
697
698
|
/**
|
|
698
|
-
*
|
|
699
|
+
* Called when someone selects the clear button. Clears the chosen dates and moves focus to the start date input.
|
|
699
700
|
* @private
|
|
700
701
|
* @param {MouseEvent} event - The mouse event from the clear button click.
|
|
701
702
|
* @returns {void}
|
|
@@ -740,7 +741,7 @@ export class AuroDatePicker extends AuroElement {
|
|
|
740
741
|
*/
|
|
741
742
|
private get commonDisplayValueWrapperClasses();
|
|
742
743
|
/**
|
|
743
|
-
*
|
|
744
|
+
* Called when the `displayValue` slot's content changes. Records whether the slot has content to show.
|
|
744
745
|
* @private
|
|
745
746
|
* @returns {void}
|
|
746
747
|
*/
|
|
@@ -972,7 +973,7 @@ export class AuroDatePicker extends AuroElement {
|
|
|
972
973
|
get hasError(): boolean;
|
|
973
974
|
/**
|
|
974
975
|
* Logs a one-time `console.debug` when an unsupported locale falls back to
|
|
975
|
-
* en-US
|
|
976
|
+
* `en-US`. Deduped by the offending tag so noisy re-renders that resurface
|
|
976
977
|
* the same bad value stay quiet, but each new bad value still signals so
|
|
977
978
|
* consumers can spot the typo or missing tag.
|
|
978
979
|
* @private
|
|
@@ -992,7 +993,8 @@ export class AuroDatePicker extends AuroElement {
|
|
|
992
993
|
previousTabIndex: string | null | undefined;
|
|
993
994
|
wasCellClick: boolean | undefined;
|
|
994
995
|
/**
|
|
995
|
-
*
|
|
996
|
+
* Called when a slot the datepicker passes to the calendar changes, such as `bib.fullscreen.headline`.
|
|
997
|
+
* Copies the slot's content into the calendar.
|
|
996
998
|
*
|
|
997
999
|
* @private
|
|
998
1000
|
* @method handleSlotToSlot
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Holds the datepicker's keyboard handlers, one function each for `Escape`, `Enter`, and the space bar. Escape closes the open calendar without closing a dialog or drawer around it, and Enter or Space opens the closed calendar unless the clear button has focus.
|
|
3
|
+
*/
|
|
1
4
|
export const datepickerKeyboardStrategy: {
|
|
2
5
|
Escape(component: any, evt: any, ctx: any): void;
|
|
3
6
|
Enter(component: any, evt: any, ctx: any): void;
|