@m3e/core 1.0.0-rc.2 → 1.0.0-rc.3
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/dist/css-custom-data.json +20 -0
- package/dist/custom-elements.json +681 -471
- package/dist/html-custom-data.json +22 -0
- package/dist/index.js +220 -5
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +43 -32
- package/dist/index.min.js.map +1 -1
- package/dist/src/a11y/AriaDescriber.d.ts +31 -0
- package/dist/src/a11y/AriaDescriber.d.ts.map +1 -0
- package/dist/src/a11y/FocusTrapElement.d.ts +25 -0
- package/dist/src/a11y/FocusTrapElement.d.ts.map +1 -0
- package/dist/src/a11y/InteractivityChecker.d.ts +22 -0
- package/dist/src/a11y/InteractivityChecker.d.ts.map +1 -0
- package/dist/src/a11y/LiveAnnouncer.d.ts +56 -0
- package/dist/src/a11y/LiveAnnouncer.d.ts.map +1 -0
- package/dist/src/a11y/aria-reference.d.ts +30 -0
- package/dist/src/a11y/aria-reference.d.ts.map +1 -0
- package/dist/src/a11y/index.d.ts +8 -0
- package/dist/src/a11y/index.d.ts.map +1 -0
- package/dist/src/a11y/keycodes/KeyCode.d.ts +118 -0
- package/dist/src/a11y/keycodes/KeyCode.d.ts.map +1 -0
- package/dist/src/a11y/keycodes/ModifierKeys.d.ts +5 -0
- package/dist/src/a11y/keycodes/ModifierKeys.d.ts.map +1 -0
- package/dist/src/a11y/keycodes/getKeyCode.d.ts +7 -0
- package/dist/src/a11y/keycodes/getKeyCode.d.ts.map +1 -0
- package/dist/src/a11y/keycodes/hasModifierKey.d.ts +9 -0
- package/dist/src/a11y/keycodes/hasModifierKey.d.ts.map +1 -0
- package/dist/src/a11y/keycodes/index.d.ts +6 -0
- package/dist/src/a11y/keycodes/index.d.ts.map +1 -0
- package/dist/src/a11y/keycodes/isModifierAllowed.d.ts +9 -0
- package/dist/src/a11y/keycodes/isModifierAllowed.d.ts.map +1 -0
- package/dist/src/a11y/list-key/FocusKeyManager.d.ts +17 -0
- package/dist/src/a11y/list-key/FocusKeyManager.d.ts.map +1 -0
- package/dist/src/a11y/list-key/ListKeyManager.d.ts +114 -0
- package/dist/src/a11y/list-key/ListKeyManager.d.ts.map +1 -0
- package/dist/src/a11y/list-key/ListManager.d.ts +37 -0
- package/dist/src/a11y/list-key/ListManager.d.ts.map +1 -0
- package/dist/src/a11y/list-key/RadioKeyManager.d.ts +20 -0
- package/dist/src/a11y/list-key/RadioKeyManager.d.ts.map +1 -0
- package/dist/src/a11y/list-key/RovingTabIndexManager.d.ts +22 -0
- package/dist/src/a11y/list-key/RovingTabIndexManager.d.ts.map +1 -0
- package/dist/src/a11y/list-key/SelectionManager.d.ts +46 -0
- package/dist/src/a11y/list-key/SelectionManager.d.ts.map +1 -0
- package/dist/src/a11y/list-key/Typeahead.d.ts +64 -0
- package/dist/src/a11y/list-key/Typeahead.d.ts.map +1 -0
- package/dist/src/a11y/list-key/index.d.ts +8 -0
- package/dist/src/a11y/list-key/index.d.ts.map +1 -0
- package/dist/src/a11y/visuallyHide.d.ts +6 -0
- package/dist/src/a11y/visuallyHide.d.ts.map +1 -0
- package/dist/src/anchoring/AnchorOptions.d.ts +15 -0
- package/dist/src/anchoring/AnchorOptions.d.ts.map +1 -0
- package/dist/src/anchoring/AnchorPosition.d.ts +3 -0
- package/dist/src/anchoring/AnchorPosition.d.ts.map +1 -0
- package/dist/src/anchoring/index.d.ts +4 -0
- package/dist/src/anchoring/index.d.ts.map +1 -0
- package/dist/src/anchoring/positionAnchor.d.ts +12 -0
- package/dist/src/anchoring/positionAnchor.d.ts.map +1 -0
- package/dist/src/bidi/Directionality.d.ts +27 -0
- package/dist/src/bidi/Directionality.d.ts.map +1 -0
- package/dist/src/bidi/index.d.ts +2 -0
- package/dist/src/bidi/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/layout/Breakpoint.d.ts +26 -0
- package/dist/src/layout/Breakpoint.d.ts.map +1 -0
- package/dist/src/layout/BreakpointObserver.d.ts +18 -0
- package/dist/src/layout/BreakpointObserver.d.ts.map +1 -0
- package/dist/src/layout/index.d.ts +3 -0
- package/dist/src/layout/index.d.ts.map +1 -0
- package/dist/src/platform/Platform.d.ts +34 -0
- package/dist/src/platform/Platform.d.ts.map +1 -0
- package/dist/src/platform/index.d.ts +2 -0
- package/dist/src/platform/index.d.ts.map +1 -0
- package/dist/src/shared/controllers/FocusController.d.ts +30 -0
- package/dist/src/shared/controllers/FocusController.d.ts.map +1 -0
- package/dist/src/shared/controllers/HoverController.d.ts +40 -0
- package/dist/src/shared/controllers/HoverController.d.ts.map +1 -0
- package/dist/src/shared/controllers/IntersectionController.d.ts +40 -0
- package/dist/src/shared/controllers/IntersectionController.d.ts.map +1 -0
- package/dist/src/shared/controllers/LongPressController.d.ts +32 -0
- package/dist/src/shared/controllers/LongPressController.d.ts.map +1 -0
- package/dist/src/shared/controllers/MonitorControllerBase.d.ts +62 -0
- package/dist/src/shared/controllers/MonitorControllerBase.d.ts.map +1 -0
- package/dist/src/shared/controllers/MutationController.d.ts +37 -0
- package/dist/src/shared/controllers/MutationController.d.ts.map +1 -0
- package/dist/src/shared/controllers/PressedController.d.ts +47 -0
- package/dist/src/shared/controllers/PressedController.d.ts.map +1 -0
- package/dist/src/shared/controllers/ResizeController.d.ts +40 -0
- package/dist/src/shared/controllers/ResizeController.d.ts.map +1 -0
- package/dist/src/shared/controllers/ScrollController.d.ts +34 -0
- package/dist/src/shared/controllers/ScrollController.d.ts.map +1 -0
- package/dist/src/shared/controllers/index.d.ts +9 -0
- package/dist/src/shared/controllers/index.d.ts.map +1 -0
- package/dist/src/shared/decorators/debounce.d.ts +7 -0
- package/dist/src/shared/decorators/debounce.d.ts.map +1 -0
- package/dist/src/shared/decorators/index.d.ts +2 -0
- package/dist/src/shared/decorators/index.d.ts.map +1 -0
- package/dist/src/shared/directives/index.d.ts +2 -0
- package/dist/src/shared/directives/index.d.ts.map +1 -0
- package/dist/src/shared/directives/safeStyleMap.d.ts +44 -0
- package/dist/src/shared/directives/safeStyleMap.d.ts.map +1 -0
- package/dist/src/shared/index.d.ts +8 -0
- package/dist/src/shared/index.d.ts.map +1 -0
- package/dist/src/shared/mixins/AttachInternals.d.ts +24 -0
- package/dist/src/shared/mixins/AttachInternals.d.ts.map +1 -0
- package/dist/src/shared/mixins/Checked.d.ts +24 -0
- package/dist/src/shared/mixins/Checked.d.ts.map +1 -0
- package/dist/src/shared/mixins/CheckedIndeterminate.d.ts +25 -0
- package/dist/src/shared/mixins/CheckedIndeterminate.d.ts.map +1 -0
- package/dist/src/shared/mixins/CheckedOrSelected.d.ts +23 -0
- package/dist/src/shared/mixins/CheckedOrSelected.d.ts.map +1 -0
- package/dist/src/shared/mixins/ConstraintValidation.d.ts +48 -0
- package/dist/src/shared/mixins/ConstraintValidation.d.ts.map +1 -0
- package/dist/src/shared/mixins/Constructor.d.ts +3 -0
- package/dist/src/shared/mixins/Constructor.d.ts.map +1 -0
- package/dist/src/shared/mixins/Dirty.d.ts +27 -0
- package/dist/src/shared/mixins/Dirty.d.ts.map +1 -0
- package/dist/src/shared/mixins/Disabled.d.ts +25 -0
- package/dist/src/shared/mixins/Disabled.d.ts.map +1 -0
- package/dist/src/shared/mixins/DisabledInteractive.d.ts +25 -0
- package/dist/src/shared/mixins/DisabledInteractive.d.ts.map +1 -0
- package/dist/src/shared/mixins/EventAttribute.d.ts +11 -0
- package/dist/src/shared/mixins/EventAttribute.d.ts.map +1 -0
- package/dist/src/shared/mixins/Focusable.d.ts +11 -0
- package/dist/src/shared/mixins/Focusable.d.ts.map +1 -0
- package/dist/src/shared/mixins/FormAssociated.d.ts +34 -0
- package/dist/src/shared/mixins/FormAssociated.d.ts.map +1 -0
- package/dist/src/shared/mixins/FormSubmitter.d.ts +34 -0
- package/dist/src/shared/mixins/FormSubmitter.d.ts.map +1 -0
- package/dist/src/shared/mixins/HtmlFor.d.ts +30 -0
- package/dist/src/shared/mixins/HtmlFor.d.ts.map +1 -0
- package/dist/src/shared/mixins/KeyboardClick.d.ts +11 -0
- package/dist/src/shared/mixins/KeyboardClick.d.ts.map +1 -0
- package/dist/src/shared/mixins/Labelled.d.ts +22 -0
- package/dist/src/shared/mixins/Labelled.d.ts.map +1 -0
- package/dist/src/shared/mixins/LinkButton.d.ts +46 -0
- package/dist/src/shared/mixins/LinkButton.d.ts.map +1 -0
- package/dist/src/shared/mixins/ReadOnly.d.ts +25 -0
- package/dist/src/shared/mixins/ReadOnly.d.ts.map +1 -0
- package/dist/src/shared/mixins/Required.d.ts +26 -0
- package/dist/src/shared/mixins/Required.d.ts.map +1 -0
- package/dist/src/shared/mixins/RequiredConstraintValidation.d.ts +21 -0
- package/dist/src/shared/mixins/RequiredConstraintValidation.d.ts.map +1 -0
- package/dist/src/shared/mixins/Role.d.ts +13 -0
- package/dist/src/shared/mixins/Role.d.ts.map +1 -0
- package/dist/src/shared/mixins/Selected.d.ts +24 -0
- package/dist/src/shared/mixins/Selected.d.ts.map +1 -0
- package/dist/src/shared/mixins/Touched.d.ts +27 -0
- package/dist/src/shared/mixins/Touched.d.ts.map +1 -0
- package/dist/src/shared/mixins/Vertical.d.ts +24 -0
- package/dist/src/shared/mixins/Vertical.d.ts.map +1 -0
- package/dist/src/shared/mixins/hasKeys.d.ts +9 -0
- package/dist/src/shared/mixins/hasKeys.d.ts.map +1 -0
- package/dist/src/shared/mixins/index.d.ts +25 -0
- package/dist/src/shared/mixins/index.d.ts.map +1 -0
- package/dist/src/shared/primitives/CollapsibleElement.d.ts +58 -0
- package/dist/src/shared/primitives/CollapsibleElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/ElevationElement.d.ts +87 -0
- package/dist/src/shared/primitives/ElevationElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/ElevationLevel.d.ts +3 -0
- package/dist/src/shared/primitives/ElevationLevel.d.ts.map +1 -0
- package/dist/src/shared/primitives/ElevationToken.d.ts +15 -0
- package/dist/src/shared/primitives/ElevationToken.d.ts.map +1 -0
- package/dist/src/shared/primitives/FocusRingElement.d.ts +77 -0
- package/dist/src/shared/primitives/FocusRingElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/FocusRingToken.d.ts +17 -0
- package/dist/src/shared/primitives/FocusRingToken.d.ts.map +1 -0
- package/dist/src/shared/primitives/PseudoCheckboxElement.d.ts +49 -0
- package/dist/src/shared/primitives/PseudoCheckboxElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/PseudoRadioElement.d.ts +40 -0
- package/dist/src/shared/primitives/PseudoRadioElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/RippleElement.d.ts +109 -0
- package/dist/src/shared/primitives/RippleElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/RippleToken.d.ts +12 -0
- package/dist/src/shared/primitives/RippleToken.d.ts.map +1 -0
- package/dist/src/shared/primitives/ScrollContainerElement.d.ts +61 -0
- package/dist/src/shared/primitives/ScrollContainerElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/ScrollDividers.d.ts +3 -0
- package/dist/src/shared/primitives/ScrollDividers.d.ts.map +1 -0
- package/dist/src/shared/primitives/SlideElement.d.ts +46 -0
- package/dist/src/shared/primitives/SlideElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/StateLayerElement.d.ts +76 -0
- package/dist/src/shared/primitives/StateLayerElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/StateLayerToken.d.ts +13 -0
- package/dist/src/shared/primitives/StateLayerToken.d.ts.map +1 -0
- package/dist/src/shared/primitives/TextHighlightElement.d.ts +81 -0
- package/dist/src/shared/primitives/TextHighlightElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/TextOverflowElement.d.ts +38 -0
- package/dist/src/shared/primitives/TextOverflowElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/index.d.ts +14 -0
- package/dist/src/shared/primitives/index.d.ts.map +1 -0
- package/dist/src/shared/tokens/ColorToken.d.ts +96 -0
- package/dist/src/shared/tokens/ColorToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/DensityToken.d.ts +15 -0
- package/dist/src/shared/tokens/DensityToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/DesignToken.d.ts +366 -0
- package/dist/src/shared/tokens/DesignToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/ElevationToken.d.ts +16 -0
- package/dist/src/shared/tokens/ElevationToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/MotionToken.d.ts +69 -0
- package/dist/src/shared/tokens/MotionToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/ScrollbarToken.d.ts +10 -0
- package/dist/src/shared/tokens/ScrollbarToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/ShapeToken.d.ts +79 -0
- package/dist/src/shared/tokens/ShapeToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/StateToken.d.ts +10 -0
- package/dist/src/shared/tokens/StateToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/TypescaleToken.d.ts +220 -0
- package/dist/src/shared/tokens/TypescaleToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/index.d.ts +2 -0
- package/dist/src/shared/tokens/index.d.ts.map +1 -0
- package/dist/src/shared/utils/getTextContent.d.ts +8 -0
- package/dist/src/shared/utils/getTextContent.d.ts.map +1 -0
- package/dist/src/shared/utils/guid.d.ts +6 -0
- package/dist/src/shared/utils/guid.d.ts.map +1 -0
- package/dist/src/shared/utils/hasAssignedNodes.d.ts +7 -0
- package/dist/src/shared/utils/hasAssignedNodes.d.ts.map +1 -0
- package/dist/src/shared/utils/index.d.ts +6 -0
- package/dist/src/shared/utils/index.d.ts.map +1 -0
- package/dist/src/shared/utils/prefersReducedMotion.d.ts +6 -0
- package/dist/src/shared/utils/prefersReducedMotion.d.ts.map +1 -0
- package/dist/src/shared/utils/scrollIntoViewIfNeeded.d.ts +8 -0
- package/dist/src/shared/utils/scrollIntoViewIfNeeded.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapted from Angular Material CDK ARIA Describer
|
|
3
|
+
* Source: https://github.com/angular/components/blob/main/src/cdk/a11y/aria-describer/aria-describer.ts
|
|
4
|
+
*
|
|
5
|
+
* @license MIT
|
|
6
|
+
* Copyright (c) 2025 Google LLC
|
|
7
|
+
* See LICENSE file in the project root for full license text.
|
|
8
|
+
*/
|
|
9
|
+
/** Utility for generating visually hidden elements that convey descriptive messages using `aria-describedby`. */
|
|
10
|
+
export declare class M3eAriaDescriber {
|
|
11
|
+
#private;
|
|
12
|
+
/**
|
|
13
|
+
* Adds an `aria-describedby` reference to a hidden element that contains the message.
|
|
14
|
+
* @param {Element} element The element for which to provide a visually hidden description.
|
|
15
|
+
* @param {string} message The message used to describe `element`.
|
|
16
|
+
* @param {string} [role="tooltip"] The ARIA role of the message.
|
|
17
|
+
*/
|
|
18
|
+
static describe(element: Element, message: string, role?: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Removes an `aria-describedby` reference to a hidden element that contains the message.
|
|
21
|
+
* @param {Element} element The element from which to remove a visually hidden description.
|
|
22
|
+
* @param {string} message The message used to describe `element`.
|
|
23
|
+
* @param {string} [role="tooltip"] The ARIA role of the message.
|
|
24
|
+
*/
|
|
25
|
+
static removeDescription(element: Element, message: string, role?: string): void;
|
|
26
|
+
}
|
|
27
|
+
declare global {
|
|
28
|
+
/** Utility for generating visually hidden elements that convey descriptive messages using `aria-describedby`. */
|
|
29
|
+
var M3eAriaDescriber: M3eAriaDescriber;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=AriaDescriber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AriaDescriber.d.ts","sourceRoot":"","sources":["../../../src/a11y/AriaDescriber.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,iHAAiH;AACjH,qBAAa,gBAAgB;;IAU3B;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG,IAAI;IAmClF;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG,IAAI;CAkD5F;AAED,OAAO,CAAC,MAAM,CAAC;IACb,iHAAiH;IACjH,IAAI,gBAAgB,EAAE,gBAAgB,CAAC;CACxC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement } from "lit";
|
|
2
|
+
declare const M3eFocusTrapElement_base: import("../shared/mixins/Constructor").Constructor<import("..").DisabledMixin> & typeof LitElement;
|
|
3
|
+
/**
|
|
4
|
+
* A non-visual element used to trap focus within nested content.
|
|
5
|
+
* @tag m3e-focus-trap
|
|
6
|
+
*
|
|
7
|
+
* @slot - Renders content for which to trap focus.
|
|
8
|
+
*
|
|
9
|
+
* @attr disabled - Disables the focus trap.
|
|
10
|
+
*/
|
|
11
|
+
export declare class M3eFocusTrapElement extends M3eFocusTrapElement_base {
|
|
12
|
+
#private;
|
|
13
|
+
/** The styles of the element. */
|
|
14
|
+
static styles: CSSResultGroup;
|
|
15
|
+
/** @private */ private readonly _firstTrap;
|
|
16
|
+
/** @inheritdoc */
|
|
17
|
+
protected render(): unknown;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
"m3e-focus-trap": M3eFocusTrapElement;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=FocusTrapElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusTrapElement.d.ts","sourceRoot":"","sources":["../../../src/a11y/FocusTrapElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;;AAO5D;;;;;;;GAOG;AACH,qBACa,mBAAoB,SAAQ,wBAAoB;;IAC3D,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAOpC;IAEF,eAAe,CAAiB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IAEjF,kBAAkB;cACC,MAAM,IAAI,OAAO;CAkGrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,mBAAmB,CAAC;KACvC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Utility for checking the interactivity of an element, such as whether it is focusable. */
|
|
2
|
+
export declare class M3eInteractivityChecker {
|
|
3
|
+
#private;
|
|
4
|
+
/**
|
|
5
|
+
* Determines whether a given element can receive focus.
|
|
6
|
+
* @param {Element} element The element to test.
|
|
7
|
+
* @param {readonly Element[]} [parents = undefined] The known parent elements to test. The default value is `undefined`.
|
|
8
|
+
* @returns {boolean} Whether `element` can receive focus.
|
|
9
|
+
*/
|
|
10
|
+
static isFocusable(element: Element, parents?: readonly Element[]): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Finds interactive elements that descend from the specified element.
|
|
13
|
+
* @param {HTMLElement} element The `HTMLElement` to search.
|
|
14
|
+
* @returns {HTMLElement[]} The interactive elements that descend from `element`.
|
|
15
|
+
*/
|
|
16
|
+
static findInteractiveElements(element: HTMLElement): HTMLElement[];
|
|
17
|
+
}
|
|
18
|
+
declare global {
|
|
19
|
+
/** Utility for checking the interactivity of an element, such as whether it is focusable. */
|
|
20
|
+
var M3eInteractivityChecker: M3eInteractivityChecker;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=InteractivityChecker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractivityChecker.d.ts","sourceRoot":"","sources":["../../../src/a11y/InteractivityChecker.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,qBAAa,uBAAuB;;IAClC;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO;IA4B3E;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAAC,OAAO,EAAE,WAAW,GAAG,WAAW,EAAE;CAapE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,6FAA6F;IAC7F,IAAI,uBAAuB,EAAE,uBAAuB,CAAC;CACtD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapted from Angular Material CDK Live Announcer
|
|
3
|
+
* Source: https://github.com/angular/components/blob/main/src/cdk/a11y/live-announcer/live-announcer.ts
|
|
4
|
+
*
|
|
5
|
+
* @license MIT
|
|
6
|
+
* Copyright (c) 2025 Google LLC
|
|
7
|
+
* See LICENSE file in the project root for full license text.
|
|
8
|
+
*/
|
|
9
|
+
/** Specifies the possible politeness levels in which to announce messages. */
|
|
10
|
+
export type ARIALivePoliteness = "off" | "polite" | "assertive";
|
|
11
|
+
/** Utility for announcing messages to screen readers. */
|
|
12
|
+
export declare class M3eLiveAnnouncer {
|
|
13
|
+
#private;
|
|
14
|
+
/**
|
|
15
|
+
* Announces the specified message to screen readers.
|
|
16
|
+
* @param {string} message The message to announce.
|
|
17
|
+
* @returns {Promise<void>} A `Promise` that resolves when `message` is added to the DOM.
|
|
18
|
+
*/
|
|
19
|
+
static announce(message: string): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Announces the specified message to screen readers.
|
|
22
|
+
* @param {string} message The message to announce.
|
|
23
|
+
* @param {ARIALivePoliteness | undefined} politeness The politeness in which to announce `message`.
|
|
24
|
+
* @returns {Promise<void>} A `Promise` that resolves when `message` is added to the DOM.
|
|
25
|
+
*/
|
|
26
|
+
static announce(message: string, politeness?: ARIALivePoliteness): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Announces the specified message to screen readers.
|
|
29
|
+
* @param {string} message The message to announce.
|
|
30
|
+
* @param {number | undefined} duration The duration, in milliseconds, after which to clear the announcement. Note
|
|
31
|
+
* that this takes effect after the message has been added to the DOM, which can be up to
|
|
32
|
+
* 100ms after `announce` has been called.
|
|
33
|
+
* @returns {Promise<void>} A `Promise` that resolves when `message` is added to the DOM.
|
|
34
|
+
*/
|
|
35
|
+
static announce(message: string, duration?: number): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Announces the specified message to screen readers.
|
|
38
|
+
* @param {string} message The message to announce.
|
|
39
|
+
* @param {ARIALivePoliteness | undefined} politeness The politeness in which to announce `message`.
|
|
40
|
+
* @param {number | undefined} duration The duration, in milliseconds, after which to clear the announcement. Note
|
|
41
|
+
* that this takes effect after the message has been added to the DOM, which can be up to 100ms after `announce` has been called.
|
|
42
|
+
* @returns {Promise<void>} A `Promise` that resolves when `message` is added to the DOM.
|
|
43
|
+
*/
|
|
44
|
+
static announce(message: string, politeness?: ARIALivePoliteness, duration?: number): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Clears the current text from the announcer element. Can be used to prevent
|
|
47
|
+
* screen readers from reading the text out again while the user is going
|
|
48
|
+
* through page landmarks.
|
|
49
|
+
*/
|
|
50
|
+
static clear(): void;
|
|
51
|
+
}
|
|
52
|
+
declare global {
|
|
53
|
+
/** Utility for announcing messages to screen readers. */
|
|
54
|
+
var M3eLiveAnnouncer: M3eLiveAnnouncer;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=LiveAnnouncer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveAnnouncer.d.ts","sourceRoot":"","sources":["../../../src/a11y/LiveAnnouncer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,8EAA8E;AAC9E,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEhE,yDAAyD;AACzD,qBAAa,gBAAgB;;IAO3B;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAE/C;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAEhF;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAElE;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,kBAAkB,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA+CnG;;;;OAIG;IACH,MAAM,CAAC,KAAK;CAyBb;AAED,OAAO,CAAC,MAAM,CAAC;IACb,yDAAyD;IACzD,IAAI,gBAAgB,EAAE,gBAAgB,CAAC;CACxC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapted from Angular Material CDK AriaDescriber
|
|
3
|
+
* Source: https://github.com/angular/components/blob/main/src/cdk/a11y/aria-describer/aria-reference.ts
|
|
4
|
+
*
|
|
5
|
+
* @license MIT
|
|
6
|
+
* Copyright (c) 2025 Google LLC
|
|
7
|
+
* See LICENSE file in the project root for full license text.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Gets a list of IDs referenced by an element for the specified ARIA attribute.
|
|
11
|
+
* @param {Element} element The element from which to get referenced IDs.
|
|
12
|
+
* @param {`aria-${string}`} attribute The ARIA attribute from which to get referenced IDs.
|
|
13
|
+
* @returns {string[]} a list of IDs referenced by `element` for `attribute`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getAriaReferenceIds(element: Element, attribute: `aria-${string}`): string[];
|
|
16
|
+
/**
|
|
17
|
+
* Adds an ID to the list of IDs referenced by an element for a given ARIA attribute.
|
|
18
|
+
* @param {Element} element The element to which to add a referenced ID.
|
|
19
|
+
* @param {`aria-${string}`} attribute The ARIA attribute to which to add an ID.
|
|
20
|
+
* @param {string} id The ID to add.
|
|
21
|
+
*/
|
|
22
|
+
export declare function addAriaReferencedId(element: Element, attribute: `aria-${string}`, id: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Removes an ID from a list of IDs referenced by an element for the specified ARIA attribute.
|
|
25
|
+
* @param {Element} element The element from which to remove an ID.
|
|
26
|
+
* @param {`aria-${string}`} attribute The ARIA attribute from which to remove an ID.
|
|
27
|
+
* @param {string} id The ID to remove.
|
|
28
|
+
*/
|
|
29
|
+
export declare function removeAriaReferencedId(element: Element, attribute: `aria-${string}`, id: string): void;
|
|
30
|
+
//# sourceMappingURL=aria-reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aria-reference.d.ts","sourceRoot":"","sources":["../../../src/a11y/aria-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,EAAE,CAE3F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAQnG;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAStG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./list-key";
|
|
2
|
+
export * from "./keycodes";
|
|
3
|
+
export * from "./aria-reference";
|
|
4
|
+
export * from "./AriaDescriber";
|
|
5
|
+
export * from "./FocusTrapElement";
|
|
6
|
+
export * from "./InteractivityChecker";
|
|
7
|
+
export * from "./LiveAnnouncer";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/a11y/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAE3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/** Specifies known key code values. */
|
|
2
|
+
export declare enum KeyCode {
|
|
3
|
+
Backspace = 8,
|
|
4
|
+
Tab = 9,
|
|
5
|
+
Enter = 13,
|
|
6
|
+
Shift = 16,
|
|
7
|
+
Ctrl = 17,
|
|
8
|
+
Alt = 18,
|
|
9
|
+
PauseBreak = 19,
|
|
10
|
+
CapsLock = 20,
|
|
11
|
+
Escape = 27,
|
|
12
|
+
Space = 32,
|
|
13
|
+
PageUp = 33,
|
|
14
|
+
PageDown = 34,
|
|
15
|
+
End = 35,
|
|
16
|
+
Home = 36,
|
|
17
|
+
LeftArrow = 37,
|
|
18
|
+
UpArrow = 38,
|
|
19
|
+
RightArrow = 39,
|
|
20
|
+
DownArrow = 40,
|
|
21
|
+
Insert = 45,
|
|
22
|
+
Delete = 46,
|
|
23
|
+
Zero = 48,
|
|
24
|
+
ClosedParen = 48,
|
|
25
|
+
One = 49,
|
|
26
|
+
ExclamationMark = 49,
|
|
27
|
+
Two = 50,
|
|
28
|
+
AtSign = 50,
|
|
29
|
+
Three = 51,
|
|
30
|
+
PoundSign = 51,
|
|
31
|
+
Hash = 51,
|
|
32
|
+
Four = 52,
|
|
33
|
+
DollarSign = 52,
|
|
34
|
+
Five = 53,
|
|
35
|
+
PercentSign = 53,
|
|
36
|
+
Six = 54,
|
|
37
|
+
Caret = 54,
|
|
38
|
+
Hat = 54,
|
|
39
|
+
Seven = 55,
|
|
40
|
+
Ampersand = 55,
|
|
41
|
+
Eight = 56,
|
|
42
|
+
Star = 56,
|
|
43
|
+
Asterik = 56,
|
|
44
|
+
Nine = 57,
|
|
45
|
+
OpenParen = 57,
|
|
46
|
+
A = 65,
|
|
47
|
+
B = 66,
|
|
48
|
+
C = 67,
|
|
49
|
+
D = 68,
|
|
50
|
+
E = 69,
|
|
51
|
+
F = 70,
|
|
52
|
+
G = 71,
|
|
53
|
+
H = 72,
|
|
54
|
+
I = 73,
|
|
55
|
+
J = 74,
|
|
56
|
+
K = 75,
|
|
57
|
+
L = 76,
|
|
58
|
+
M = 77,
|
|
59
|
+
N = 78,
|
|
60
|
+
O = 79,
|
|
61
|
+
P = 80,
|
|
62
|
+
Q = 81,
|
|
63
|
+
R = 82,
|
|
64
|
+
S = 83,
|
|
65
|
+
T = 84,
|
|
66
|
+
U = 85,
|
|
67
|
+
V = 86,
|
|
68
|
+
W = 87,
|
|
69
|
+
X = 88,
|
|
70
|
+
Y = 89,
|
|
71
|
+
Z = 90,
|
|
72
|
+
LeftWindowKey = 91,
|
|
73
|
+
RightWindowKey = 92,
|
|
74
|
+
SelectKey = 93,
|
|
75
|
+
Numpad0 = 96,
|
|
76
|
+
Numpad1 = 97,
|
|
77
|
+
Numpad2 = 98,
|
|
78
|
+
Numpad3 = 99,
|
|
79
|
+
Numpad4 = 100,
|
|
80
|
+
Numpad5 = 101,
|
|
81
|
+
Numpad6 = 102,
|
|
82
|
+
Numpad7 = 103,
|
|
83
|
+
Numpad8 = 104,
|
|
84
|
+
Numpad9 = 105,
|
|
85
|
+
Multiply = 106,
|
|
86
|
+
Add = 107,
|
|
87
|
+
Subtract = 109,
|
|
88
|
+
DecimalPoint = 110,
|
|
89
|
+
Divide = 111,
|
|
90
|
+
F1 = 112,
|
|
91
|
+
F2 = 113,
|
|
92
|
+
F3 = 114,
|
|
93
|
+
F4 = 115,
|
|
94
|
+
F5 = 116,
|
|
95
|
+
F6 = 117,
|
|
96
|
+
F7 = 118,
|
|
97
|
+
F8 = 119,
|
|
98
|
+
F9 = 120,
|
|
99
|
+
F10 = 121,
|
|
100
|
+
F11 = 122,
|
|
101
|
+
F12 = 123,
|
|
102
|
+
NumLock = 144,
|
|
103
|
+
ScrollLock = 145,
|
|
104
|
+
SemiColon = 186,
|
|
105
|
+
Equals = 187,
|
|
106
|
+
Comma = 188,
|
|
107
|
+
Dash = 189,
|
|
108
|
+
Period = 190,
|
|
109
|
+
UnderScore = 189,
|
|
110
|
+
PlusSign = 187,
|
|
111
|
+
ForwardSlash = 191,
|
|
112
|
+
Tilde = 192,
|
|
113
|
+
GraveAccent = 192,
|
|
114
|
+
OpenBracket = 219,
|
|
115
|
+
ClosedBracket = 221,
|
|
116
|
+
Quote = 222
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=KeyCode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyCode.d.ts","sourceRoot":"","sources":["../../../../src/a11y/keycodes/KeyCode.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,oBAAY,OAAO;IACjB,SAAS,IAAI;IACb,GAAG,IAAI;IACP,KAAK,KAAK;IACV,KAAK,KAAK;IACV,IAAI,KAAK;IACT,GAAG,KAAK;IACR,UAAU,KAAK;IACf,QAAQ,KAAK;IACb,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,KAAK;IACX,QAAQ,KAAK;IACb,GAAG,KAAK;IACR,IAAI,KAAK;IAET,SAAS,KAAK;IACd,OAAO,KAAK;IACZ,UAAU,KAAK;IACf,SAAS,KAAK;IAEd,MAAM,KAAK;IACX,MAAM,KAAK;IAEX,IAAI,KAAK;IACT,WAAW,KAAO;IAClB,GAAG,KAAK;IACR,eAAe,KAAM;IACrB,GAAG,KAAK;IACR,MAAM,KAAM;IACZ,KAAK,KAAK;IACV,SAAS,KAAQ;IACjB,IAAI,KAAY;IAChB,IAAI,KAAK;IACT,UAAU,KAAO;IACjB,IAAI,KAAK;IACT,WAAW,KAAO;IAClB,GAAG,KAAK;IACR,KAAK,KAAM;IACX,GAAG,KAAQ;IACX,KAAK,KAAK;IACV,SAAS,KAAQ;IACjB,KAAK,KAAK;IACV,IAAI,KAAQ;IACZ,OAAO,KAAO;IACd,IAAI,KAAK;IACT,SAAS,KAAO;IAEhB,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IAEN,aAAa,KAAK;IAClB,cAAc,KAAK;IACnB,SAAS,KAAK;IAEd,OAAO,KAAK;IACZ,OAAO,KAAK;IACZ,OAAO,KAAK;IACZ,OAAO,KAAK;IACZ,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,MAAM;IAEb,QAAQ,MAAM;IACd,GAAG,MAAM;IACT,QAAQ,MAAM;IACd,YAAY,MAAM;IAClB,MAAM,MAAM;IAEZ,EAAE,MAAM;IACR,EAAE,MAAM;IACR,EAAE,MAAM;IACR,EAAE,MAAM;IACR,EAAE,MAAM;IACR,EAAE,MAAM;IACR,EAAE,MAAM;IACR,EAAE,MAAM;IACR,EAAE,MAAM;IACR,GAAG,MAAM;IACT,GAAG,MAAM;IACT,GAAG,MAAM;IAET,OAAO,MAAM;IACb,UAAU,MAAM;IAEhB,SAAS,MAAM;IACf,MAAM,MAAM;IACZ,KAAK,MAAM;IACX,IAAI,MAAM;IACV,MAAM,MAAM;IACZ,UAAU,MAAO;IACjB,QAAQ,MAAS;IACjB,YAAY,MAAM;IAClB,KAAK,MAAM;IACX,WAAW,MAAQ;IAEnB,WAAW,MAAM;IACjB,aAAa,MAAM;IACnB,KAAK,MAAM;CACZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModifierKeys.d.ts","sourceRoot":"","sources":["../../../../src/a11y/keycodes/ModifierKeys.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5D,yBAAyB;AACzB,eAAO,MAAM,YAAY,EAAE,SAAS,WAAW,EAAqC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves the key code for the specified `KeyboardEvent`.
|
|
3
|
+
* @param {KeyboardEvent} e The `KeyboardEvent` for which to resolve the key code.
|
|
4
|
+
* @returns {number} The key code for `e`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getKeyCode(e: KeyboardEvent): number;
|
|
7
|
+
//# sourceMappingURL=getKeyCode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getKeyCode.d.ts","sourceRoot":"","sources":["../../../../src/a11y/keycodes/getKeyCode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,aAAa,GAAG,MAAM,CAEnD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ModifierKey } from "./ModifierKeys";
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether a modifier key is pressed.
|
|
4
|
+
* @param {KeyboardEvent} e The `KeyboardEvent` to test.
|
|
5
|
+
* @param {ModifierKey[]} modifiers The modifier keys to test.
|
|
6
|
+
* @returns {boolean} A value indicating whether a modifier key is pressed.
|
|
7
|
+
*/
|
|
8
|
+
export declare function hasModifierKey(e: KeyboardEvent, ...modifiers: ModifierKey[]): boolean;
|
|
9
|
+
//# sourceMappingURL=hasModifierKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasModifierKey.d.ts","sourceRoot":"","sources":["../../../../src/a11y/keycodes/hasModifierKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE,GAAG,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,CAErF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/a11y/keycodes/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ModifierKey } from "./ModifierKeys";
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether the specified modifier keys are allowed.
|
|
4
|
+
* @param {KeyboardEvent} e The `KeyboardEvent` to test.
|
|
5
|
+
* @param {ModifierKey[]} modifiers The allowed modifier keys.
|
|
6
|
+
* @returns {boolean} A value indicating whether `modifiers` are allowed.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isModifierAllowed(e: KeyboardEvent, ...modifiers: ModifierKey[]): boolean;
|
|
9
|
+
//# sourceMappingURL=isModifierAllowed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isModifierAllowed.d.ts","sourceRoot":"","sources":["../../../../src/a11y/keycodes/isModifierAllowed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,aAAa,EAAE,GAAG,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,CAExF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ListKeyManager } from "./ListKeyManager";
|
|
2
|
+
/**
|
|
3
|
+
* Utility for managing keyboard events for selectable lists whose items directly receive focus.
|
|
4
|
+
* @template T The type of managed item.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FocusKeyManager<T extends HTMLElement> extends ListKeyManager<T> {
|
|
7
|
+
#private;
|
|
8
|
+
/** @inheritdoc */
|
|
9
|
+
setActiveItem(item: T | null | undefined): void;
|
|
10
|
+
/**
|
|
11
|
+
* Configures the key manager with options used to focus items.
|
|
12
|
+
* @param {FocusOptions} options Options used to focus items.
|
|
13
|
+
* @returns {FocusKeyManager<T>} The configured key manager.
|
|
14
|
+
*/
|
|
15
|
+
withOptions(options: FocusOptions): this;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=FocusKeyManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusKeyManager.d.ts","sourceRoot":"","sources":["../../../../src/a11y/list-key/FocusKeyManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,qBAAa,eAAe,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;;IAG3E,kBAAkB;IACT,aAAa,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;IAKxD;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;CAIzC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapted from Angular Material CDK KeyManager
|
|
3
|
+
* Source: https://github.com/angular/components/blob/main/src/cdk/a11y/key-manager/list-key-manager.ts
|
|
4
|
+
*
|
|
5
|
+
* @license MIT
|
|
6
|
+
* Copyright (c) 2025 Google LLC
|
|
7
|
+
* See LICENSE file in the project root for full license text.
|
|
8
|
+
*/
|
|
9
|
+
import { ModifierKey } from "../keycodes";
|
|
10
|
+
import { ListManager } from "./ListManager";
|
|
11
|
+
import { TypeaheadItem } from "./Typeahead";
|
|
12
|
+
/**
|
|
13
|
+
* Utility for managing keyboard events for selectable lists.
|
|
14
|
+
* @template T The type of managed item.
|
|
15
|
+
*/
|
|
16
|
+
export declare class ListKeyManager<T extends HTMLElement & TypeaheadItem> extends ListManager<T> {
|
|
17
|
+
#private;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the active item will wrap to the other end of
|
|
20
|
+
* list when there are no more items in the given direction.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
wrap: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to activate the first and last items respectively when
|
|
26
|
+
* the `HOME` or `END` key is pressed.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
homeAndEnd: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to activate every 10th (or configured) first/last item
|
|
32
|
+
* in the up/down direction when the `PAGEUP` or `PAGEDOWN` key is pressed.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
pageUpAndDown: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The number of items to skip when the `PAGEUP` or `PAGEDOWN` key is pressed.
|
|
38
|
+
* @default 10
|
|
39
|
+
*/
|
|
40
|
+
pageDelta: number;
|
|
41
|
+
/**
|
|
42
|
+
* Whether to the list is oriented vertically.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
vertical: boolean;
|
|
46
|
+
/** The allowed modifier keys.
|
|
47
|
+
* @default []
|
|
48
|
+
*/
|
|
49
|
+
allowedModifiers: ModifierKey[];
|
|
50
|
+
/**
|
|
51
|
+
* A function used to skip items.
|
|
52
|
+
* @param {T} item The item to test.
|
|
53
|
+
* @returns {boolean} Whether `item` should be skipped.
|
|
54
|
+
*/
|
|
55
|
+
skipPredicate: (item: T) => boolean;
|
|
56
|
+
/** @inheritdoc */
|
|
57
|
+
setItems(items: T[]): {
|
|
58
|
+
added: readonly T[];
|
|
59
|
+
removed: readonly T[];
|
|
60
|
+
};
|
|
61
|
+
/** @inheritdoc */
|
|
62
|
+
updateActiveItem(item: T | null | undefined): void;
|
|
63
|
+
/**
|
|
64
|
+
* Configures the key manager to activate the first and last items respectively when the `HOME` or `END` key is pressed.
|
|
65
|
+
* @param {boolean} [enabled = true] Whether to activate the first and last items respectively when
|
|
66
|
+
* the `HOME` or `END` key is pressed.
|
|
67
|
+
* @returns {ListKeyManager<T>} The configured key manager.
|
|
68
|
+
*/
|
|
69
|
+
withHomeAndEnd(enabled?: boolean): this;
|
|
70
|
+
/**
|
|
71
|
+
* Configures the key manager to page up and down when the `PAGEUP` or `PAGEDOWN` key is pressed.
|
|
72
|
+
* @param {boolean} [enabled = true] Whether to activate page up and down when the `PAGEUP` or `PAGEDOWN` key is pressed.
|
|
73
|
+
* @param {number} [pageDelta=10] The number of items to skip when the `PAGEUP` or `PAGEDOWN` key is pressed.
|
|
74
|
+
* @returns {ListKeyManager<T>} The configured key manager.
|
|
75
|
+
*/
|
|
76
|
+
withPageUpAndDown(enabled?: boolean, pageDelta?: number): this;
|
|
77
|
+
/**
|
|
78
|
+
* Configures wrapping mode, which determines whether the active item will wrap to the other end of list when there are no more items in the given direction.
|
|
79
|
+
* @param {boolean} [enabled = true] Whether the active item will wrap to the other end of
|
|
80
|
+
* list when there are no more items in the given direction.
|
|
81
|
+
* @returns {ListKeyManager<T>} The configured key manager.
|
|
82
|
+
*/
|
|
83
|
+
withWrap(enabled?: boolean): this;
|
|
84
|
+
/**
|
|
85
|
+
* Configures whether to move the selection vertically.
|
|
86
|
+
* @param {boolean} [enabled = true] Whether to move selection vertically.
|
|
87
|
+
* @returns {ListKeyManager<T>} The configured key manager.
|
|
88
|
+
*/
|
|
89
|
+
withVerticalOrientation(enabled?: boolean): this;
|
|
90
|
+
/**
|
|
91
|
+
* Configured allowed modifier keys.
|
|
92
|
+
* @param {ModifierKey[]} modifiers The allowed modifier keys.
|
|
93
|
+
* @returns {ListKeyManager<T>} The configured key manager.
|
|
94
|
+
*/
|
|
95
|
+
withAllowedModifiers(...modifiers: ModifierKey[]): this;
|
|
96
|
+
/**
|
|
97
|
+
* Configures whether typeahead is enabled.
|
|
98
|
+
* @param {boolean} [enabled = true] Whether typeahead is enabled.
|
|
99
|
+
* @returns {ListKeyManager<T>} The configured key manager.
|
|
100
|
+
*/
|
|
101
|
+
withTypeahead(enabled?: boolean): this;
|
|
102
|
+
/**
|
|
103
|
+
* Configures a function used to test whether an item should be skipped.
|
|
104
|
+
* @param skipPredicate A function used to determine whether an item should be skipped.
|
|
105
|
+
* @returns {ListKeyManager<T>} The configured key manager.
|
|
106
|
+
*/
|
|
107
|
+
withSkipPredicate(skipPredicate: (item: T) => boolean): this;
|
|
108
|
+
/**
|
|
109
|
+
* Sets the active item depending on the key event passed in.
|
|
110
|
+
* @param {KeyboardEvent} e The keyboard event to be used for determining which element should be active.
|
|
111
|
+
*/
|
|
112
|
+
onKeyDown(e: KeyboardEvent): void;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=ListKeyManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListKeyManager.d.ts","sourceRoot":"","sources":["../../../../src/a11y/list-key/ListKeyManager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAqC,WAAW,EAAE,MAAM,aAAa,CAAC;AAG7E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAa,aAAa,EAAE,MAAM,aAAa,CAAC;AAEvD;;;GAGG;AACH,qBAAa,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,aAAa,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;;IAGvF;;;;OAIG;IACI,IAAI,UAAS;IAEpB;;;;OAIG;IACI,UAAU,UAAS;IAE1B;;;;OAIG;IACI,aAAa,UAAS;IAE7B;;;OAGG;IACI,SAAS,SAAM;IAEtB;;;OAGG;IACI,QAAQ,UAAS;IAExB;;OAEG;IACI,gBAAgB,EAAE,WAAW,EAAE,CAAM;IAE5C;;;;OAIG;IACI,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAoD;IAE9F,kBAAkB;IACT,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG;QAAE,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;QAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAA;KAAE;IAK7E,kBAAkB;IACT,gBAAgB,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;IAO3D;;;;;OAKG;IACH,cAAc,CAAC,OAAO,GAAE,OAAc,GAAG,IAAI;IAK7C;;;;;OAKG;IACH,iBAAiB,CAAC,OAAO,GAAE,OAAc,EAAE,SAAS,GAAE,MAAW,GAAG,IAAI;IAMxE;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,GAAE,OAAc,GAAG,IAAI;IAKvC;;;;OAIG;IACH,uBAAuB,CAAC,OAAO,GAAE,OAAc,GAAG,IAAI;IAKtD;;;;OAIG;IACH,oBAAoB,CAAC,GAAG,SAAS,EAAE,WAAW,EAAE,GAAG,IAAI;IAKvD;;;;OAIG;IACH,aAAa,CAAC,OAAO,GAAE,OAAc,GAAG,IAAI;IAS5C;;;;OAIG;IACH,iBAAiB,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAAG,IAAI;IAK5D;;;OAGG;IACH,SAAS,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI;CA0LlC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility for managing a list of items which supports activation.
|
|
3
|
+
* @template T The type of managed item.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ListManager<T> {
|
|
6
|
+
#private;
|
|
7
|
+
/** The items being managed. */
|
|
8
|
+
get items(): ReadonlyArray<T>;
|
|
9
|
+
/** The active item. */
|
|
10
|
+
get activeItem(): T | null;
|
|
11
|
+
/**
|
|
12
|
+
* Sets the items to manage.
|
|
13
|
+
* @param {Array<T>} items The new items.
|
|
14
|
+
* @returns {{ added: ReadonlyArray<T>; removed: ReadonlyArray<T> }} An object specifying added and removed items.
|
|
15
|
+
*/
|
|
16
|
+
setItems(items: Array<T>): {
|
|
17
|
+
added: ReadonlyArray<T>;
|
|
18
|
+
removed: ReadonlyArray<T>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Sets the active item.
|
|
22
|
+
* @param {T | null | undefined} item The new active item.
|
|
23
|
+
*/
|
|
24
|
+
setActiveItem(item: T | null | undefined): void;
|
|
25
|
+
/**
|
|
26
|
+
* Updates the active item.
|
|
27
|
+
* @param {T | null | undefined} item The active item.
|
|
28
|
+
*/
|
|
29
|
+
updateActiveItem(item: T | null | undefined): void;
|
|
30
|
+
/**
|
|
31
|
+
* Configures the list manager with a callback invoked when an item is activated.
|
|
32
|
+
* @param {() => void} callback The callback invoked when an item is activated.
|
|
33
|
+
* @returns {ListManager<T>} The configured list manager.
|
|
34
|
+
*/
|
|
35
|
+
onActiveItemChange(callback: () => void): this;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=ListManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListManager.d.ts","sourceRoot":"","sources":["../../../../src/a11y/list-key/ListManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,WAAW,CAAC,CAAC;;IAKxB,+BAA+B;IAC/B,IAAI,KAAK,IAAI,aAAa,CAAC,CAAC,CAAC,CAE5B;IAED,uBAAuB;IACvB,IAAI,UAAU,IAAI,CAAC,GAAG,IAAI,CAEzB;IAED;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG;QAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;KAAE;IAajF;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;IAO/C;;;OAGG;IACH,gBAAgB,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;IAIlD;;;;OAIG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;CAI/C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import { CheckedOrSelectedMixin } from "../../shared/mixins/CheckedOrSelected";
|
|
3
|
+
import { DisabledMixin } from "../../shared/mixins/Disabled";
|
|
4
|
+
import { RovingTabIndexManager } from "./RovingTabIndexManager";
|
|
5
|
+
/**
|
|
6
|
+
* Utility for managing keyboard events for selectable lists whose items behave like a radio.
|
|
7
|
+
* @template T The type of managed item.
|
|
8
|
+
*/
|
|
9
|
+
export declare class RadioKeyManager<T extends LitElement & DisabledMixin & CheckedOrSelectedMixin> extends RovingTabIndexManager<T> {
|
|
10
|
+
#private;
|
|
11
|
+
/** A value indicating whether managed items are disabled. */
|
|
12
|
+
get disabled(): boolean;
|
|
13
|
+
set disabled(value: boolean);
|
|
14
|
+
/** @inheritdoc */
|
|
15
|
+
setItems(items: T[]): {
|
|
16
|
+
added: readonly T[];
|
|
17
|
+
removed: readonly T[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=RadioKeyManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioKeyManager.d.ts","sourceRoot":"","sources":["../../../../src/a11y/list-key/RadioKeyManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC,OAAO,EAAE,sBAAsB,EAAuB,MAAM,uCAAuC,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;GAGG;AACH,qBAAa,eAAe,CAC1B,CAAC,SAAS,UAAU,GAAG,aAAa,GAAG,sBAAsB,CAC7D,SAAQ,qBAAqB,CAAC,CAAC,CAAC;;IAGhC,6DAA6D;IAC7D,IAAI,QAAQ,IAAI,OAAO,CAEtB;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAG1B;IAED,kBAAkB;IACT,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG;QAAE,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;QAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAA;KAAE;CAsB9E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FocusKeyManager } from "./FocusKeyManager";
|
|
2
|
+
/**
|
|
3
|
+
* Utility for managing keyboard events and a roving tab index for selectable lists whose items directly receive focus.
|
|
4
|
+
* @template T The type of managed item.
|
|
5
|
+
*/
|
|
6
|
+
export declare class RovingTabIndexManager<T extends HTMLElement> extends FocusKeyManager<T> {
|
|
7
|
+
#private;
|
|
8
|
+
/** @inheritdoc */
|
|
9
|
+
updateActiveItem(item: T | null | undefined): void;
|
|
10
|
+
/** @inheritdoc */
|
|
11
|
+
setItems(items: T[]): {
|
|
12
|
+
added: readonly T[];
|
|
13
|
+
removed: readonly T[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Configures whether roving tab index is disabled.
|
|
17
|
+
* @param {boolean} [disabled=true] Whether the roving tab index is disabled.
|
|
18
|
+
* @returns {RovingTabIndexManager<T>} The configured roving tab index manager.
|
|
19
|
+
*/
|
|
20
|
+
disableRovingTabIndex(disabled?: boolean): this;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=RovingTabIndexManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RovingTabIndexManager.d.ts","sourceRoot":"","sources":["../../../../src/a11y/list-key/RovingTabIndexManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;GAGG;AACH,qBAAa,qBAAqB,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;;IAGlF,kBAAkB;IACT,gBAAgB,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;IAa3D,kBAAkB;IACT,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG;QAAE,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;QAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAA;KAAE;IAc7E;;;;OAIG;IACH,qBAAqB,CAAC,QAAQ,GAAE,OAAc,GAAG,IAAI;CAYtD"}
|