1 line
181 KiB
Plaintext
1 line
181 KiB
Plaintext
|
{"version":3,"file":"a11y.mjs","sources":["../../../../../../src/cdk/a11y/aria-describer/aria-reference.ts","../../../../../../src/cdk/a11y/aria-describer/aria-describer.ts","../../../../../../src/cdk/a11y/key-manager/list-key-manager.ts","../../../../../../src/cdk/a11y/key-manager/activedescendant-key-manager.ts","../../../../../../src/cdk/a11y/key-manager/focus-key-manager.ts","../../../../../../src/cdk/a11y/interactivity-checker/interactivity-checker.ts","../../../../../../src/cdk/a11y/focus-trap/focus-trap.ts","../../../../../../src/cdk/a11y/focus-trap/configurable-focus-trap.ts","../../../../../../src/cdk/a11y/focus-trap/focus-trap-inert-strategy.ts","../../../../../../src/cdk/a11y/focus-trap/event-listener-inert-strategy.ts","../../../../../../src/cdk/a11y/focus-trap/focus-trap-manager.ts","../../../../../../src/cdk/a11y/focus-trap/configurable-focus-trap-factory.ts","../../../../../../src/cdk/a11y/fake-event-detection.ts","../../../../../../src/cdk/a11y/input-modality/input-modality-detector.ts","../../../../../../src/cdk/a11y/live-announcer/live-announcer-tokens.ts","../../../../../../src/cdk/a11y/live-announcer/live-announcer.ts","../../../../../../src/cdk/a11y/focus-monitor/focus-monitor.ts","../../../../../../src/cdk/a11y/high-contrast-mode/high-contrast-mode-detector.ts","../../../../../../src/cdk/a11y/a11y-module.ts","../../../../../../src/cdk/a11y/a11y_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** IDs are delimited by an empty space, as per the spec. */\nconst ID_DELIMITER = ' ';\n\n/**\n * Adds the given ID to the specified ARIA attribute on an element.\n * Used for attributes such as aria-labelledby, aria-owns, etc.\n */\nexport function addAriaReferencedId(el: Element, attr: `aria-${string}`, id: string) {\n const ids = getAriaReferenceIds(el, attr);\n if (ids.some(existingId => existingId.trim() == id.trim())) {\n return;\n }\n ids.push(id.trim());\n\n el.setAttribute(attr, ids.join(ID_DELIMITER));\n}\n\n/**\n * Removes the given ID from the specified ARIA attribute on an element.\n * Used for attributes such as aria-labelledby, aria-owns, etc.\n */\nexport function removeAriaReferencedId(el: Element, attr: `aria-${string}`, id: string) {\n const ids = getAriaReferenceIds(el, attr);\n const filteredIds = ids.filter(val => val != id.trim());\n\n if (filteredIds.length) {\n el.setAttribute(attr, filteredIds.join(ID_DELIMITER));\n } else {\n el.removeAttribute(attr);\n }\n}\n\n/**\n * Gets the list of IDs referenced by the given ARIA attribute on an element.\n * Used for attributes such as aria-labelledby, aria-owns, etc.\n */\nexport function getAriaReferenceIds(el: Element, attr: string): string[] {\n // Get string array of all individual ids (whitespace delimited) in the attribute value\n return (el.getAttribute(attr) || '').match(/\\S+/g) || [];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable, OnDestroy, APP_ID, inject} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\nimport {addAriaReferencedId, getAriaReferenceIds, removeAriaReferencedId} from './aria-reference';\n\n/**\n * Interface used to register message elements and keep a count of how many registrations have\n * the same message and the reference to the message element used for the `aria-describedby`.\n */\nexport interface RegisteredMessage {\n /** The element containing the message. */\n messageElement: Element;\n\n /** The number of elements that reference this message element via `aria-describedby`. */\n referenceCount: number;\n}\n\n/**\n * ID used for the body container where all messages are appended.\n * @deprecated No longer being used. To be removed
|