the-forest/client/node_modules/dom-accessibility-api/dist/accessible-name-and-description.mjs.map

1 line
38 KiB
Plaintext
Raw Normal View History

2024-09-17 20:35:18 -04:00
{"version":3,"file":"accessible-name-and-description.mjs","names":["ArrayFrom","SetLike","hasAnyConcreteRoles","isElement","isHTMLTableCaptionElement","isHTMLInputElement","isHTMLSelectElement","isHTMLTextAreaElement","safeWindow","isHTMLFieldSetElement","isHTMLLegendElement","isHTMLOptGroupElement","isHTMLTableElement","isHTMLSlotElement","isSVGSVGElement","isSVGTitleElement","queryIdRefs","getLocalName","asFlatString","s","trim","replace","isHidden","node","getComputedStyleImplementation","hasAttribute","getAttribute","style","getPropertyValue","isControl","hasAbstractRole","role","TypeError","querySelectorAllSubtree","element","selectors","elements","querySelectorAll","forEach","root","push","apply","querySelectedOptions","listbox","selectedOptions","isMarkedPresentational","isNativeHostLanguageTextAlternativeElement","allowsNameFromContent","isDescendantOfNativeHostLanguageTextAlternativeElement","getValueOfTextbox","value","textContent","getTextualContent","declaration","content","test","slice","isLabelableElement","localName","findLabelableElement","labelableElement","childNodes","childNode","descendantLabelableElement","getControlOfLabel","label","control","undefined","htmlFor","ownerDocument","getElementById","getLabels","labelsProperty","labels","document","filter","getSlotContents","slot","assignedNodes","length","computeTextAlternative","options","consultedNodes","window","compute","computedStyleSupportsPseudoElements","getComputedStyle","bind","hidden","computeMiscTextAlternative","context","accumulatedText","pseudoBefore","beforeContent","concat","child","result","isEmbeddedInLabel","isReferenced","recursion","display","separator","pseudoAfter","afterContent","useAttribute","attributeName","attribute","getAttributeNode","has","add","computeTooltipAttributeValue","computeElementTextAlternative","children","i","nameFromAlt","nameFromLabel","type","nameFromValue","map","join","nameFromTitle","nameFromSubTree","current","labelAttributeNode","labelElements","skipToStep2E","ariaLabel","elementTextAlternative","selectedOption","accumulatedText2F","nodeType","TEXT_NODE","tooltipAttributeValue"],"sources":["../sources/accessible-name-and-description.ts"],"sourcesContent":["/**\n * implements https://w3c.github.io/accname/\n */\nimport ArrayFrom from \"./polyfills/array.from\";\nimport SetLike from \"./polyfills/SetLike\";\nimport {\n\thasAnyConcreteRoles,\n\tisElement,\n\tisHTMLTableCaptionElement,\n\tisHTMLInputElement,\n\tisHTMLSelectElement,\n\tisHTMLTextAreaElement,\n\tsafeWindow,\n\tisHTMLFieldSetElement,\n\tisHTMLLegendElement,\n\tisHTMLOptGroupElement,\n\tisHTMLTableElement,\n\tisHTMLSlotElement,\n\tisSVGSVGElement,\n\tisSVGTitleElement,\n\tqueryIdRefs,\n\tgetLocalName,\n} from \"./util\";\n\n/**\n * A string of characters where all carriage returns, newlines, tabs, and form-feeds are replaced with a single space, and multiple spaces are reduced to a single space. The string contains only character data; it does not contain any markup.\n */\ntype FlatString = string & {\n\t__flat: true;\n};\n\n/**\n * interface for an options-bag where `window.getComputedStyle` can be mocked\n */\nexport interface ComputeTextAlternativeOptions {\n\tcompute?: \"description\" | \"name\";\n\t/**\n\t * Set to true if window.computedStyle supports the second argument.\n\t * This should be false in JSDOM. Otherwise JSDOM will log console errors.\n\t */\n\tcomputedStyleSupportsPseudoElements?: boolean;\n\t/**\n\t * mock window.getComputedStyle. Needs `content`, `display` and `visibility`\n\t */\n\tgetComputedStyle?: typeof window.getComputedStyle;\n\t/**\n\t * Set to `true` if you want to include hidden elements in the accessible name and description computation.\n\t * Skips 2A in https://w3c.github.io/accname/#computation-steps.\n\t * @default false\n\t */\n\thidden?: boolean;\n}\n\n/**\n *\n * @param {string} string -\n * @returns {FlatString} -\n */\nfunction asFlatString(s: string): FlatString {\n\treturn s.trim().replace(/\\s\\s+/g, \" \") as FlatString;\n}\n\n/**\n *\n * @param node -\n * @param options - These are not option