@aurodesignsystem-dev/auro-formkit 0.0.0-pr1508.0 → 0.0.0-pr1508.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/index.js +1 -1
- package/components/bibtemplate/dist/registered.js +1 -1
- package/components/checkbox/demo/customize.min.js +8 -6
- package/components/checkbox/demo/getting-started.min.js +8 -6
- package/components/checkbox/demo/index.min.js +8 -6
- package/components/checkbox/dist/index.js +8 -6
- package/components/checkbox/dist/registered.js +8 -6
- package/components/combobox/README.md +1 -1
- package/components/combobox/demo/customize.md +2 -10
- package/components/combobox/demo/customize.min.js +386 -305
- package/components/combobox/demo/getting-started.min.js +386 -301
- package/components/combobox/demo/index.md +1 -1
- package/components/combobox/demo/index.min.js +386 -301
- package/components/combobox/demo/keyboard-behavior.md +2 -142
- package/components/combobox/demo/readme.md +1 -1
- package/components/combobox/demo/why-combobox.md +2 -2
- package/components/combobox/dist/auro-combobox.d.ts +23 -16
- package/components/combobox/dist/index.js +385 -300
- package/components/combobox/dist/registered.js +385 -300
- package/components/counter/demo/customize.min.js +18 -8
- package/components/counter/demo/index.min.js +18 -8
- package/components/counter/dist/index.js +18 -8
- package/components/counter/dist/registered.js +18 -8
- package/components/datepicker/demo/accessibility.md +2 -1
- package/components/datepicker/demo/api.md +63 -62
- package/components/datepicker/demo/customize.md +12 -1
- package/components/datepicker/demo/customize.min.js +932 -335
- package/components/datepicker/demo/index.min.js +932 -335
- package/components/datepicker/dist/{src/auro-calendar-cell.d.ts → auro-calendar-cell.d.ts} +20 -3
- package/components/datepicker/dist/{src/auro-calendar.d.ts → auro-calendar.d.ts} +121 -7
- package/components/datepicker/dist/{src/auro-datepicker.d.ts → auro-datepicker.d.ts} +78 -5
- package/components/datepicker/dist/blackoutUtils.d.ts +43 -0
- package/components/datepicker/dist/index.js +932 -335
- package/components/datepicker/dist/registered.js +932 -335
- package/components/dropdown/demo/customize.min.js +2 -1
- package/components/dropdown/demo/getting-started.min.js +2 -1
- package/components/dropdown/demo/index.min.js +2 -1
- package/components/dropdown/dist/index.js +2 -1
- package/components/dropdown/dist/registered.js +2 -1
- package/components/form/demo/customize.min.js +1690 -826
- package/components/form/demo/getting-started.min.js +1690 -826
- package/components/form/demo/index.min.js +1690 -826
- package/components/form/demo/registerDemoDeps.min.js +1690 -826
- package/components/input/demo/api.md +5 -5
- package/components/input/demo/customize.md +8 -8
- package/components/input/demo/customize.min.js +137 -95
- package/components/input/demo/getting-started.min.js +137 -95
- package/components/input/demo/index.min.js +137 -95
- package/components/input/dist/base-input.d.ts +33 -44
- package/components/input/dist/index.js +150 -96
- package/components/input/dist/registered.js +137 -95
- package/components/radio/demo/customize.min.js +8 -6
- package/components/radio/demo/getting-started.min.js +8 -6
- package/components/radio/demo/index.min.js +8 -6
- package/components/radio/dist/index.js +8 -6
- package/components/radio/dist/registered.js +8 -6
- package/components/select/demo/customize.md +86 -0
- package/components/select/demo/customize.min.js +194 -68
- package/components/select/demo/getting-started.min.js +196 -115
- package/components/select/demo/index.min.js +194 -68
- package/components/select/demo/keyboard-behavior.md +18 -4
- package/components/select/dist/auro-select.d.ts +20 -8
- package/components/select/dist/index.js +194 -68
- package/components/select/dist/registered.js +194 -68
- package/custom-elements.json +2365 -1819
- package/package.json +6 -2
- package/components/checkbox/demo/customize.js +0 -22
- package/components/checkbox/demo/demo-support.js +0 -1
- package/components/checkbox/demo/getting-started.js +0 -22
- package/components/checkbox/demo/index.js +0 -8
- package/components/checkbox/demo/styles.scss +0 -1
- package/components/combobox/demo/customize.js +0 -24
- package/components/combobox/demo/demo-support.js +0 -1
- package/components/combobox/demo/getting-started.js +0 -21
- package/components/combobox/demo/index.js +0 -23
- package/components/combobox/demo/styles.scss +0 -1
- package/components/counter/demo/customize.js +0 -21
- package/components/counter/demo/demo-support.js +0 -1
- package/components/counter/demo/index.js +0 -21
- package/components/counter/demo/styles.scss +0 -1
- package/components/datepicker/demo/customize.js +0 -17
- package/components/datepicker/demo/demo-support.js +0 -1
- package/components/datepicker/demo/index.js +0 -23
- package/components/datepicker/demo/styles.scss +0 -1
- package/components/dropdown/demo/customize.js +0 -9
- package/components/dropdown/demo/demo-support.js +0 -1
- package/components/dropdown/demo/getting-started.js +0 -9
- package/components/dropdown/demo/index.js +0 -16
- package/components/dropdown/demo/styles.scss +0 -1
- package/components/form/demo/customize.js +0 -28
- package/components/form/demo/demo-support.js +0 -1
- package/components/form/demo/getting-started.js +0 -9
- package/components/form/demo/index.js +0 -5
- package/components/form/demo/registerDemoDeps.js +0 -23
- package/components/form/demo/styles.scss +0 -1
- package/components/input/demo/customize.js +0 -25
- package/components/input/demo/demo-support.js +0 -1
- package/components/input/demo/getting-started.js +0 -8
- package/components/input/demo/index.js +0 -8
- package/components/input/demo/styles.css +0 -974
- package/components/input/demo/styles.scss +0 -1
- package/components/menu/demo/demo-support.js +0 -1
- package/components/menu/demo/index.js +0 -25
- package/components/menu/demo/styles.scss +0 -1
- package/components/radio/demo/customize.js +0 -22
- package/components/radio/demo/demo-support.js +0 -1
- package/components/radio/demo/getting-started.js +0 -24
- package/components/radio/demo/index.js +0 -8
- package/components/radio/demo/styles.scss +0 -1
- package/components/select/demo/customize.js +0 -11
- package/components/select/demo/demo-support.js +0 -1
- package/components/select/demo/getting-started.js +0 -26
- package/components/select/demo/index.js +0 -11
- package/components/select/demo/styles.scss +0 -1
- /package/components/datepicker/dist/{src/auro-calendar-month.d.ts → auro-calendar-month.d.ts} +0 -0
- /package/components/datepicker/dist/{src/buttonVersion.d.ts → buttonVersion.d.ts} +0 -0
- /package/components/datepicker/dist/{src/datepickerKeyboardStrategy.d.ts → datepickerKeyboardStrategy.d.ts} +0 -0
- /package/components/datepicker/dist/{src/iconVersion.d.ts → iconVersion.d.ts} +0 -0
- /package/components/datepicker/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/components/datepicker/dist/{src/popoverVersion.d.ts → popoverVersion.d.ts} +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/classic/color-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/classic/style-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/color-calendar-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/color-cell-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/color-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/color-month-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/shapeSize-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/snowflake/color-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/snowflake/style-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/style-auro-calendar-cell-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/style-auro-calendar-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/style-auro-calendar-month-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/style-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/tokens-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/utilities.d.ts → utilities.d.ts} +0 -0
- /package/components/datepicker/dist/{src/utilitiesCalendar.d.ts → utilitiesCalendar.d.ts} +0 -0
- /package/components/datepicker/dist/{src/utilitiesCalendarRender.d.ts → utilitiesCalendarRender.d.ts} +0 -0
- /package/components/datepicker/dist/{src/vendor → vendor}/wc-range-datepicker/day.d.ts +0 -0
- /package/components/datepicker/dist/{src/vendor → vendor}/wc-range-datepicker/range-datepicker-calendar.d.ts +0 -0
- /package/components/datepicker/dist/{src/vendor → vendor}/wc-range-datepicker/range-datepicker-cell.d.ts +0 -0
- /package/components/datepicker/dist/{src/vendor → vendor}/wc-range-datepicker/range-datepicker.d.ts +0 -0
|
@@ -25,6 +25,14 @@ export class AuroCalendarCell extends LitElement {
|
|
|
25
25
|
type: BooleanConstructor;
|
|
26
26
|
reflect: boolean;
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Propagated from the legacy `auro-calendar.disabledDays`
|
|
30
|
+
* Unix-timestamp array. The cell honors it for backward compatibility
|
|
31
|
+
* (see the divergence-check fallback inside `isBlackout`), but
|
|
32
|
+
* consumers should migrate to `auro-datepicker.blackoutDates`
|
|
33
|
+
* (YYYY-MM-DD ISO strings). The calendar emits a one-time
|
|
34
|
+
* deprecation warning the first time a non-empty value is observed.
|
|
35
|
+
*/
|
|
28
36
|
disabledDays: {
|
|
29
37
|
type: ArrayConstructor;
|
|
30
38
|
};
|
|
@@ -211,6 +219,7 @@ export class AuroCalendarCell extends LitElement {
|
|
|
211
219
|
*/
|
|
212
220
|
private handleSlotContent;
|
|
213
221
|
firstUpdated(): void;
|
|
222
|
+
calendar: any;
|
|
214
223
|
datepicker: any;
|
|
215
224
|
_slotContentHandler: (() => void) | undefined;
|
|
216
225
|
_cachedButton: Element | null | undefined;
|
|
@@ -226,8 +235,8 @@ export class AuroCalendarCell extends LitElement {
|
|
|
226
235
|
auroPopover: any;
|
|
227
236
|
updated(properties: any): void;
|
|
228
237
|
/**
|
|
229
|
-
*
|
|
230
|
-
*
|
|
238
|
+
* Sets host-level ARIA so each cell exposes its date, selection state,
|
|
239
|
+
* and blackout status to assistive tech browsing the month grid.
|
|
231
240
|
* @private
|
|
232
241
|
* @returns {void}
|
|
233
242
|
*/
|
|
@@ -241,7 +250,15 @@ export class AuroCalendarCell extends LitElement {
|
|
|
241
250
|
focusButton(): void;
|
|
242
251
|
/**
|
|
243
252
|
* Imperatively marks this cell as active without triggering a Lit re-render.
|
|
244
|
-
*
|
|
253
|
+
* Buttons stay tabindex="-1" because DOM focus stays on the grid wrapper —
|
|
254
|
+
* arrow keys move the active cell imperatively and the live region carries
|
|
255
|
+
* the SR announcement.
|
|
256
|
+
*
|
|
257
|
+
* Refuses to activate out-of-range cells: those are aria-hidden, have no
|
|
258
|
+
* click/focus handlers, and are filtered out of `getFocusableCells`. The
|
|
259
|
+
* active class showing on a disabled cell would be visually misleading,
|
|
260
|
+
* so this guard is the single source of truth across every code path
|
|
261
|
+
* that might call setActive (keyboard nav, focus restore, cell click).
|
|
245
262
|
* @returns {void}
|
|
246
263
|
*/
|
|
247
264
|
setActive(): void;
|
|
@@ -118,6 +118,13 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
118
118
|
type: ArrayConstructor;
|
|
119
119
|
};
|
|
120
120
|
};
|
|
121
|
+
/**
|
|
122
|
+
* Per-class flag that gates the `disabledDays` deprecation warning so it
|
|
123
|
+
* fires exactly once per page no matter how many calendars or rebuild
|
|
124
|
+
* cycles encounter the legacy array.
|
|
125
|
+
* @private
|
|
126
|
+
*/
|
|
127
|
+
private static _warnedDisabledDaysDeprecation;
|
|
121
128
|
/**
|
|
122
129
|
* @private
|
|
123
130
|
*/
|
|
@@ -144,6 +151,14 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
144
151
|
* @private
|
|
145
152
|
*/
|
|
146
153
|
private activeCellDate;
|
|
154
|
+
/**
|
|
155
|
+
* Cached reference to the active cell host. Set by setActiveCell and
|
|
156
|
+
* refreshed by scrollToActiveCell when its cache check misses (stale
|
|
157
|
+
* or missing). Lets scrollToActiveCell skip a full cell scan on each
|
|
158
|
+
* arrow key.
|
|
159
|
+
* @private
|
|
160
|
+
*/
|
|
161
|
+
private _activeCell;
|
|
147
162
|
/**
|
|
148
163
|
* Whether the #calendarGrid wrapper currently has focus.
|
|
149
164
|
* Used to determine whether the visualFocus ring should be shown.
|
|
@@ -219,6 +234,32 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
219
234
|
* @returns {void}
|
|
220
235
|
*/
|
|
221
236
|
private updateActiveCellForVisibleMonth;
|
|
237
|
+
/**
|
|
238
|
+
* Schedules `callback` two animation frames out, giving the child
|
|
239
|
+
* `auro-formkit-calendar-month` and `auro-formkit-calendar-cell` elements
|
|
240
|
+
* a full render-and-paint cycle to settle before the callback reads or
|
|
241
|
+
* mutates DOM.
|
|
242
|
+
*
|
|
243
|
+
* Why two frames, not one:
|
|
244
|
+
* 1. Lit batches property updates and renders in a microtask, so frame N
|
|
245
|
+
* schedules the render but the new DOM may not be painted yet.
|
|
246
|
+
* 2. Cells re-cache `_cachedButton` inside their own `updateComplete.then`,
|
|
247
|
+
* which also lands a tick later. Reading buttons from frame N+1
|
|
248
|
+
* (after both renders + cache refresh have flushed) reliably hits the
|
|
249
|
+
* new month's cells.
|
|
250
|
+
*
|
|
251
|
+
* Used by every code path that calls `handleNextMonth`/`handlePrevMonth`
|
|
252
|
+
* and then needs to inspect the freshly-rendered cells (cross-month
|
|
253
|
+
* keyboard nav, boundary events, `updateActiveCellForVisibleMonth`).
|
|
254
|
+
* Do NOT collapse to a single rAF — it intermittently lands before
|
|
255
|
+
* `_cachedButton` is refreshed, which silently breaks focus restoration
|
|
256
|
+
* and `setActiveCell` lookups.
|
|
257
|
+
* @private
|
|
258
|
+
* @param {() => void} callback - Runs once after the month re-render and
|
|
259
|
+
* the cells' button caches have refreshed.
|
|
260
|
+
* @returns {void}
|
|
261
|
+
*/
|
|
262
|
+
private _afterMonthRender;
|
|
222
263
|
/**
|
|
223
264
|
* Renders all of the auro-calendar-months HTML.
|
|
224
265
|
* @private
|
|
@@ -244,6 +285,20 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
244
285
|
* @returns {Array} Array of auro-formkit-calendar-month elements.
|
|
245
286
|
*/
|
|
246
287
|
private getMonthComponents;
|
|
288
|
+
/**
|
|
289
|
+
* Picks the focusable cell whose date is closest to targetTs. Used as a
|
|
290
|
+
* fallback after a month-boundary nav when the exact target date isn't
|
|
291
|
+
* focusable — typically because the month re-render lagged or the date
|
|
292
|
+
* was filtered out by isOutOfRange. When two cells are equidistant, the
|
|
293
|
+
* navigation direction breaks the tie so the user moves the way they
|
|
294
|
+
* pressed (forward → later cell, backward → earlier cell).
|
|
295
|
+
* @private
|
|
296
|
+
* @param {Array} cells - Focusable cells from getAllFocusableCells.
|
|
297
|
+
* @param {Number} targetTs - Desired Unix timestamp (seconds).
|
|
298
|
+
* @param {'next'|'prev'} direction - Navigation direction.
|
|
299
|
+
* @returns {Object|null} The nearest cell, or null when cells is empty.
|
|
300
|
+
*/
|
|
301
|
+
private pickNearestCell;
|
|
247
302
|
/**
|
|
248
303
|
* Gets all focusable cells across all rendered months.
|
|
249
304
|
* @private
|
|
@@ -252,9 +307,9 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
252
307
|
private getAllFocusableCells;
|
|
253
308
|
/**
|
|
254
309
|
* 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
|
-
*
|
|
257
|
-
*
|
|
310
|
+
* Uses imperative DOM manipulation — no Lit re-render triggered. DOM focus
|
|
311
|
+
* stays on the grid wrapper; the live region (see getOrCreateLiveRegion)
|
|
312
|
+
* is what announces the active cell to assistive tech.
|
|
258
313
|
* @param {Number} date - Unix timestamp of the cell to activate.
|
|
259
314
|
* @returns {void}
|
|
260
315
|
*/
|
|
@@ -269,6 +324,7 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
269
324
|
/**
|
|
270
325
|
* Shows the activeCell ring when the grid gains focus.
|
|
271
326
|
* @private
|
|
327
|
+
* @param {FocusEvent} [event] - The focusin event.
|
|
272
328
|
* @returns {void}
|
|
273
329
|
*/
|
|
274
330
|
private handleGridFocusIn;
|
|
@@ -278,6 +334,28 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
278
334
|
* @returns {void}
|
|
279
335
|
*/
|
|
280
336
|
private handleGridFocusOut;
|
|
337
|
+
/**
|
|
338
|
+
* Returns a memoized Set of blackout timestamps (seconds) drawn from both
|
|
339
|
+
* the legacy `disabledDays` array and the datepicker's ISO `blackoutDates`.
|
|
340
|
+
* The cache invalidates when either source array's reference changes, which
|
|
341
|
+
* matches Lit's own reactive identity semantics for array properties.
|
|
342
|
+
* @private
|
|
343
|
+
* @returns {Set<Number>}
|
|
344
|
+
*/
|
|
345
|
+
private _getBlackoutSet;
|
|
346
|
+
_blackoutSet: Set<number> | undefined;
|
|
347
|
+
_cachedBlackoutDisabledDays: any;
|
|
348
|
+
_cachedBlackoutDates: any;
|
|
349
|
+
/**
|
|
350
|
+
* One-time `console.debug` directing consumers from the legacy
|
|
351
|
+
* `disabledDays` Unix-timestamp API to the ISO `blackoutDates` API. Fires
|
|
352
|
+
* the first time `_getBlackoutSet` rebuilds from a non-empty
|
|
353
|
+
* `disabledDays`; subsequent calls (on this or any other AuroCalendar
|
|
354
|
+
* instance on the page) are silent.
|
|
355
|
+
* @private
|
|
356
|
+
* @returns {void}
|
|
357
|
+
*/
|
|
358
|
+
private _warnDisabledDaysDeprecated;
|
|
281
359
|
/**
|
|
282
360
|
* Computes the initial active date from data properties alone — no DOM required.
|
|
283
361
|
* Priority:
|
|
@@ -310,8 +388,8 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
310
388
|
private isDateInRange;
|
|
311
389
|
/**
|
|
312
390
|
* Handles arrow key navigation on the calendar grid wrapper.
|
|
313
|
-
* Focus stays on the grid wrapper; only
|
|
314
|
-
*
|
|
391
|
+
* Focus stays on the grid wrapper; only the visual active-cell indicator
|
|
392
|
+
* changes. The live region announces the new active cell.
|
|
315
393
|
* @private
|
|
316
394
|
* @param {KeyboardEvent} event - The keyboard event.
|
|
317
395
|
* @returns {void}
|
|
@@ -357,7 +435,9 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
357
435
|
*/
|
|
358
436
|
private getRangePositionLabel;
|
|
359
437
|
/**
|
|
360
|
-
* Checks whether a given date is a blackout date.
|
|
438
|
+
* Checks whether a given date is a blackout date. Delegates to the
|
|
439
|
+
* memoized `_getBlackoutSet` so the YYYY-MM-DD parsing and the
|
|
440
|
+
* legacy/ISO merge rules live in exactly one place (see `blackoutUtils.js`).
|
|
361
441
|
* @private
|
|
362
442
|
* @param {Number} dateTs - Unix timestamp (seconds).
|
|
363
443
|
* @returns {Boolean} True if the date is blacked out.
|
|
@@ -391,7 +471,28 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
391
471
|
*/
|
|
392
472
|
private hoveredDateChanged;
|
|
393
473
|
/**
|
|
394
|
-
* Scrolls the calendar
|
|
474
|
+
* Scrolls the calendar so the active cell is visible.
|
|
475
|
+
*
|
|
476
|
+
* Walks the flat tree (rendered, slot-aware) outward from the active
|
|
477
|
+
* cell's button and calls `scrollBy` on every vertically-scrollable
|
|
478
|
+
* ancestor by whatever delta still separates the cell from that
|
|
479
|
+
* ancestor's viewport. Native `scrollIntoView` is not used because the
|
|
480
|
+
* cell sits inside multiple nested scroll containers (the dropdown bib's
|
|
481
|
+
* `<dialog>`, the bibtemplate's `#bodyContainer`) and the algorithm only
|
|
482
|
+
* scrolls one of them on its own, leaving the cell short of the
|
|
483
|
+
* viewport in mobile fullscreen.
|
|
484
|
+
*
|
|
485
|
+
* Uses `behavior: 'auto'` (the spec's universally-supported non-animated
|
|
486
|
+
* value) so each `scrollBy` resolves synchronously and the next
|
|
487
|
+
* iteration's `getBoundingClientRect` reads post-scroll positions
|
|
488
|
+
* accurately. This also satisfies `prefers-reduced-motion` users — the
|
|
489
|
+
* scroll containers do not set CSS `scroll-behavior: smooth`, so `auto`
|
|
490
|
+
* is effectively instant.
|
|
491
|
+
*
|
|
492
|
+
* The active cell is looked up from the cache populated by
|
|
493
|
+
* `setActiveCell`. On a cache miss (stale or absent) the cache is
|
|
494
|
+
* refreshed from a single full scan so subsequent calls stay on the
|
|
495
|
+
* fast path.
|
|
395
496
|
* @private
|
|
396
497
|
* @returns {void}
|
|
397
498
|
*/
|
|
@@ -427,6 +528,19 @@ export class AuroCalendar extends RangeDatepicker {
|
|
|
427
528
|
* @returns {void}
|
|
428
529
|
*/
|
|
429
530
|
private announceSelection;
|
|
531
|
+
/**
|
|
532
|
+
* Writes `dateStr` to the live region. If the dropdown's dialog hasn't
|
|
533
|
+
* mounted yet (so getOrCreateLiveRegion can't attach), retries on the
|
|
534
|
+
* next animation frame up to MAX_LIVE_REGION_RETRIES instead of silently
|
|
535
|
+
* dropping the announcement. The retry uses the same `_announceRafId`
|
|
536
|
+
* the double-rAF below uses, so a newer announceSelection call (or
|
|
537
|
+
* disconnectedCallback) cancels any in-flight retry.
|
|
538
|
+
* @private
|
|
539
|
+
* @param {String} dateStr - The localized date string to announce.
|
|
540
|
+
* @param {Number} attempts - Number of prior retry attempts.
|
|
541
|
+
* @returns {void}
|
|
542
|
+
*/
|
|
543
|
+
private _deliverAnnouncement;
|
|
430
544
|
/**
|
|
431
545
|
* Debounced version of announceSelection for focus navigation.
|
|
432
546
|
* Uses the assertive live region with a 150ms debounce so only the
|
|
@@ -61,6 +61,7 @@ export class AuroDatePicker extends AuroElement {
|
|
|
61
61
|
};
|
|
62
62
|
/**
|
|
63
63
|
* Label announced for blackout (disabled but in-range) date cells.
|
|
64
|
+
* @default 'unavailable'
|
|
64
65
|
*/
|
|
65
66
|
blackoutLabel: {
|
|
66
67
|
type: StringConstructor;
|
|
@@ -75,6 +76,7 @@ export class AuroDatePicker extends AuroElement {
|
|
|
75
76
|
};
|
|
76
77
|
/**
|
|
77
78
|
* Accessible label for the calendar grid containing the days of the month.
|
|
79
|
+
* @default 'Calendar days of the month'
|
|
78
80
|
*/
|
|
79
81
|
calendarGridLabel: {
|
|
80
82
|
type: StringConstructor;
|
|
@@ -211,6 +213,7 @@ export class AuroDatePicker extends AuroElement {
|
|
|
211
213
|
};
|
|
212
214
|
/**
|
|
213
215
|
* Accessible label for the next month navigation button.
|
|
216
|
+
* @default 'Next month'
|
|
214
217
|
*/
|
|
215
218
|
navLabelNextMonth: {
|
|
216
219
|
type: StringConstructor;
|
|
@@ -218,6 +221,7 @@ export class AuroDatePicker extends AuroElement {
|
|
|
218
221
|
};
|
|
219
222
|
/**
|
|
220
223
|
* Accessible label for the previous month navigation button.
|
|
224
|
+
* @default 'Previous month'
|
|
221
225
|
*/
|
|
222
226
|
navLabelPrevMonth: {
|
|
223
227
|
type: StringConstructor;
|
|
@@ -283,7 +287,11 @@ export class AuroDatePicker extends AuroElement {
|
|
|
283
287
|
reflect: boolean;
|
|
284
288
|
};
|
|
285
289
|
/**
|
|
286
|
-
* Label announced for cells after
|
|
290
|
+
* Label announced for cells after a fully selected range (both
|
|
291
|
+
* `dateFrom` and `dateTo` are set). While a range is still being
|
|
292
|
+
* picked (`dateFrom` set, `dateTo` unset), focused cells past the
|
|
293
|
+
* start use `rangeLabelEndPreview` instead.
|
|
294
|
+
* @default 'after range'
|
|
287
295
|
*/
|
|
288
296
|
rangeLabelAfterRange: {
|
|
289
297
|
type: StringConstructor;
|
|
@@ -291,6 +299,7 @@ export class AuroDatePicker extends AuroElement {
|
|
|
291
299
|
};
|
|
292
300
|
/**
|
|
293
301
|
* Label announced for cells before the range start.
|
|
302
|
+
* @default 'before range'
|
|
294
303
|
*/
|
|
295
304
|
rangeLabelBeforeRange: {
|
|
296
305
|
type: StringConstructor;
|
|
@@ -298,13 +307,25 @@ export class AuroDatePicker extends AuroElement {
|
|
|
298
307
|
};
|
|
299
308
|
/**
|
|
300
309
|
* Label announced for the range end date cell.
|
|
310
|
+
* @default 'range end'
|
|
301
311
|
*/
|
|
302
312
|
rangeLabelEnd: {
|
|
303
313
|
type: StringConstructor;
|
|
304
314
|
reflect: boolean;
|
|
305
315
|
};
|
|
316
|
+
/**
|
|
317
|
+
* Label announced for the focused cell while previewing a range end
|
|
318
|
+
* (dateFrom set, dateTo not yet selected). Tells AT users that
|
|
319
|
+
* pressing Enter would commit this cell as the range end.
|
|
320
|
+
* @default 'previewing range end'
|
|
321
|
+
*/
|
|
322
|
+
rangeLabelEndPreview: {
|
|
323
|
+
type: StringConstructor;
|
|
324
|
+
reflect: boolean;
|
|
325
|
+
};
|
|
306
326
|
/**
|
|
307
327
|
* Label announced for cells within the selected range.
|
|
328
|
+
* @default 'in range'
|
|
308
329
|
*/
|
|
309
330
|
rangeLabelInRange: {
|
|
310
331
|
type: StringConstructor;
|
|
@@ -312,13 +333,14 @@ export class AuroDatePicker extends AuroElement {
|
|
|
312
333
|
};
|
|
313
334
|
/**
|
|
314
335
|
* Label announced for the range start date cell.
|
|
336
|
+
* @default 'range start'
|
|
315
337
|
*/
|
|
316
338
|
rangeLabelStart: {
|
|
317
339
|
type: StringConstructor;
|
|
318
340
|
reflect: boolean;
|
|
319
341
|
};
|
|
320
342
|
/**
|
|
321
|
-
* Dates that the user should have for reference as part of their decision
|
|
343
|
+
* Dates that the user should have for reference as part of their decision-making when selecting a date.
|
|
322
344
|
* This should be a JSON string array of ISO date strings (`YYYY-MM-DD`).
|
|
323
345
|
*/
|
|
324
346
|
referenceDates: {
|
|
@@ -416,6 +438,15 @@ export class AuroDatePicker extends AuroElement {
|
|
|
416
438
|
*
|
|
417
439
|
*/
|
|
418
440
|
static register(name?: string): void;
|
|
441
|
+
/**
|
|
442
|
+
* Per-class dedup set used by `_warnInvalidLocale`. Static so the dedup
|
|
443
|
+
* spans every datepicker instance on the page; lives on the class (not
|
|
444
|
+
* at module scope) so it stays an encapsulated implementation detail of
|
|
445
|
+
* this component and does not interfere with WCA's class-JSDoc
|
|
446
|
+
* attachment.
|
|
447
|
+
* @private
|
|
448
|
+
*/
|
|
449
|
+
private static _warnedInvalidLocales;
|
|
419
450
|
/**
|
|
420
451
|
* @private
|
|
421
452
|
*/
|
|
@@ -440,6 +471,7 @@ export class AuroDatePicker extends AuroElement {
|
|
|
440
471
|
rangeLabelBeforeRange: string;
|
|
441
472
|
rangeLabelInRange: string;
|
|
442
473
|
rangeLabelAfterRange: string;
|
|
474
|
+
rangeLabelEndPreview: string;
|
|
443
475
|
blackoutDates: any[];
|
|
444
476
|
blackoutLabel: string;
|
|
445
477
|
navLabelPrevMonth: string;
|
|
@@ -520,6 +552,21 @@ export class AuroDatePicker extends AuroElement {
|
|
|
520
552
|
* @returns {void}
|
|
521
553
|
*/
|
|
522
554
|
private handleClick;
|
|
555
|
+
/**
|
|
556
|
+
* Single AbortController shared by every listener registered in the
|
|
557
|
+
* configure* methods. Lets disconnectedCallback tear all of them down
|
|
558
|
+
* with one abort() call.
|
|
559
|
+
*
|
|
560
|
+
* The genuine leak risk is the listeners attached to children that can
|
|
561
|
+
* outlive the host if they get reparented — `this.dropdown`,
|
|
562
|
+
* `this.calendar`, and the inputs inside the dropdown's slot.
|
|
563
|
+
* Listeners attached to `this` (e.g. focusin/focusout on the host)
|
|
564
|
+
* form a self-contained reference graph that the GC can collect with
|
|
565
|
+
* the host anyway, but they share the same signal so the cleanup
|
|
566
|
+
* pattern stays uniform across all configure* sites.
|
|
567
|
+
* @private
|
|
568
|
+
*/
|
|
569
|
+
private _listenerAbortController;
|
|
523
570
|
/**
|
|
524
571
|
* Handles click on the clear button.
|
|
525
572
|
* @private
|
|
@@ -637,10 +684,26 @@ export class AuroDatePicker extends AuroElement {
|
|
|
637
684
|
*/
|
|
638
685
|
get calendarFocusDateObject(): Date | undefined;
|
|
639
686
|
/**
|
|
640
|
-
* Converts a Unix timestamp (seconds) from the
|
|
687
|
+
* Converts a Unix timestamp (seconds) from the vendored range-datepicker
|
|
688
|
+
* (`src/vendor/wc-range-datepicker/day.js`) to an ISO date string.
|
|
689
|
+
*
|
|
690
|
+
* Timezone contract:
|
|
691
|
+
* - INPUT: `time` is assumed to be the seconds-since-epoch of **local
|
|
692
|
+
* midnight** for the intended calendar day. The vendor's Day constructor
|
|
693
|
+
* builds it via `date-fns format(date, 't')` from a locally-constructed
|
|
694
|
+
* Date, so this assumption currently holds end-to-end.
|
|
695
|
+
* - OUTPUT: `dateFormatter.toISOFormatString` reads the Date's local
|
|
696
|
+
* getFullYear/getMonth/getDate components, so the returned YYYY-MM-DD
|
|
697
|
+
* string matches the local calendar day.
|
|
698
|
+
*
|
|
699
|
+
* If the vendor ever switches to emitting UTC-midnight timestamps, this
|
|
700
|
+
* conversion will silently shift the returned date by one day in zones
|
|
701
|
+
* west of UTC. Any vendor swap should re-verify this contract; the TZ
|
|
702
|
+
* regression suite (`npm run test:hst`, UTC-10) will catch the symptom.
|
|
703
|
+
*
|
|
641
704
|
* @private
|
|
642
|
-
* @param {number} time - Unix timestamp
|
|
643
|
-
* @returns {string} ISO date string (yyyy-mm-dd).
|
|
705
|
+
* @param {number} time - Unix timestamp (seconds), local midnight of the day.
|
|
706
|
+
* @returns {string} ISO date string (yyyy-mm-dd) reflecting the local calendar day.
|
|
644
707
|
*/
|
|
645
708
|
private convertWcTimeToDate;
|
|
646
709
|
/**
|
|
@@ -772,6 +835,16 @@ export class AuroDatePicker extends AuroElement {
|
|
|
772
835
|
* @returns {boolean}
|
|
773
836
|
*/
|
|
774
837
|
get hasError(): boolean;
|
|
838
|
+
/**
|
|
839
|
+
* Logs a one-time `console.debug` when an unsupported locale falls back to
|
|
840
|
+
* en-US. Deduped by the offending tag so noisy re-renders that resurface
|
|
841
|
+
* the same bad value stay quiet, but each new bad value still signals so
|
|
842
|
+
* consumers can spot the typo or missing tag.
|
|
843
|
+
* @private
|
|
844
|
+
* @param {string|undefined} badLocale - The locale value that failed.
|
|
845
|
+
* @returns {void}
|
|
846
|
+
*/
|
|
847
|
+
private _warnInvalidLocale;
|
|
775
848
|
/**
|
|
776
849
|
* Lifecycle method to check if the locale is valid.
|
|
777
850
|
* @ignore
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for parsing and matching blackout dates across the
|
|
3
|
+
* datepicker. Both `auro-calendar` (memoized Set + `isDateBlackout`) and the
|
|
4
|
+
* pre-`firstUpdated` fallback inside `auro-calendar-cell` route through these
|
|
5
|
+
* helpers so the YYYY-MM-DD → seconds conversion and the merge-with-legacy
|
|
6
|
+
* `disabledDays` rules are defined exactly once.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Converts a `YYYY-MM-DD` ISO date string to a Unix timestamp (seconds)
|
|
10
|
+
* representing local midnight on that calendar day. Returns `null` for
|
|
11
|
+
* inputs that don't parse to a finite timestamp.
|
|
12
|
+
*
|
|
13
|
+
* Uses the `new Date(year, monthIndex, day)` constructor (NOT
|
|
14
|
+
* `new Date(isoStr)`) so the result is local-midnight rather than UTC
|
|
15
|
+
* midnight — required to keep the calendar grid aligned with the user's
|
|
16
|
+
* local calendar day in negative-offset timezones.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} isoStr - Date string in `YYYY-MM-DD` format.
|
|
19
|
+
* @returns {number|null} Local-midnight Unix timestamp (seconds), or null.
|
|
20
|
+
*/
|
|
21
|
+
export function parseIsoToTimestamp(isoStr: string): number | null;
|
|
22
|
+
/**
|
|
23
|
+
* Builds a `Set<number>` of seconds-since-epoch timestamps covering both the
|
|
24
|
+
* legacy `disabledDays` (already-numeric) array and the ISO `blackoutDates`
|
|
25
|
+
* array. Use this for O(1) membership checks in hot paths.
|
|
26
|
+
*
|
|
27
|
+
* @param {Array<string|number>|undefined} disabledDays - Legacy timestamp array.
|
|
28
|
+
* @param {Array<string>|undefined} blackoutDates - ISO `YYYY-MM-DD` array.
|
|
29
|
+
* @returns {Set<number>}
|
|
30
|
+
*/
|
|
31
|
+
export function buildBlackoutSet(disabledDays: Array<string | number> | undefined, blackoutDates: Array<string> | undefined): Set<number>;
|
|
32
|
+
/**
|
|
33
|
+
* One-shot membership test for a single timestamp against both blackout
|
|
34
|
+
* sources. Allocates a Set on each call; only use this in cold paths
|
|
35
|
+
* (e.g. the pre-`firstUpdated` cell fallback). Hot paths should hold the
|
|
36
|
+
* Set returned from `buildBlackoutSet` and `.has(ts)` directly.
|
|
37
|
+
*
|
|
38
|
+
* @param {number} dateTs - Unix timestamp (seconds) to test.
|
|
39
|
+
* @param {Array<string|number>|undefined} disabledDays - Legacy timestamp array.
|
|
40
|
+
* @param {Array<string>|undefined} blackoutDates - ISO `YYYY-MM-DD` array.
|
|
41
|
+
* @returns {boolean}
|
|
42
|
+
*/
|
|
43
|
+
export function isBlackoutTimestamp(dateTs: number, disabledDays: Array<string | number> | undefined, blackoutDates: Array<string> | undefined): boolean;
|