aria-query
Advanced tools
Comparing version 5.1.2 to 5.1.3
@@ -7,21 +7,11 @@ "use strict"; | ||
exports.default = void 0; | ||
var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
var properties = [['aria-activedescendant', { | ||
@@ -143,12 +133,9 @@ 'type': 'id' | ||
var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
var _iterator = _createForOfIteratorHelper(properties), | ||
_step; | ||
_step; | ||
try { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var _step$value = _slicedToArray(_step.value, 2), | ||
key = _step$value[0], | ||
values = _step$value[1]; | ||
key = _step$value[0], | ||
values = _step$value[1]; | ||
fn.call(thisArg, values, key, properties); | ||
@@ -169,3 +156,3 @@ } | ||
has: function has(key) { | ||
return !!this.get(key); | ||
return !!ariaPropsMap.get(key); | ||
}, | ||
@@ -175,4 +162,3 @@ keys: function keys() { | ||
var _ref2 = _slicedToArray(_ref, 1), | ||
key = _ref2[0]; | ||
key = _ref2[0]; | ||
return key; | ||
@@ -184,4 +170,3 @@ }); | ||
var _ref4 = _slicedToArray(_ref3, 2), | ||
values = _ref4[1]; | ||
values = _ref4[1]; | ||
return values; | ||
@@ -191,5 +176,3 @@ }); | ||
}; | ||
var _default = (0, _iterationDecorator.default)(ariaPropsMap, ariaPropsMap.entries()); | ||
exports.default = _default; |
@@ -7,21 +7,11 @@ "use strict"; | ||
exports.default = void 0; | ||
var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
var dom = [['a', { | ||
@@ -292,12 +282,9 @@ reserved: false | ||
var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
var _iterator = _createForOfIteratorHelper(dom), | ||
_step; | ||
_step; | ||
try { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var _step$value = _slicedToArray(_step.value, 2), | ||
key = _step$value[0], | ||
values = _step$value[1]; | ||
key = _step$value[0], | ||
values = _step$value[1]; | ||
fn.call(thisArg, values, key, dom); | ||
@@ -318,3 +305,3 @@ } | ||
has: function has(key) { | ||
return !!this.get(key); | ||
return !!domMap.get(key); | ||
}, | ||
@@ -324,4 +311,3 @@ keys: function keys() { | ||
var _ref2 = _slicedToArray(_ref, 1), | ||
key = _ref2[0]; | ||
key = _ref2[0]; | ||
return key; | ||
@@ -333,4 +319,3 @@ }); | ||
var _ref4 = _slicedToArray(_ref3, 2), | ||
values = _ref4[1]; | ||
values = _ref4[1]; | ||
return values; | ||
@@ -340,5 +325,3 @@ }); | ||
}; | ||
var _default = (0, _iterationDecorator.default)(domMap, domMap.entries()); | ||
exports.default = _default; |
@@ -7,43 +7,24 @@ "use strict"; | ||
exports.default = void 0; | ||
var _deepEqual = _interopRequireDefault(require("deep-equal")); | ||
var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator")); | ||
var _rolesMap = _interopRequireDefault(require("./rolesMap")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
var elementRoles = []; | ||
var keys = _rolesMap.default.keys(); | ||
for (var i = 0; i < keys.length; i++) { | ||
var key = keys[i]; | ||
var role = _rolesMap.default.get(key); | ||
if (role) { | ||
var concepts = [].concat(role.baseConcepts, role.relatedConcepts); | ||
for (var k = 0; k < concepts.length; k++) { | ||
var relation = concepts[k]; | ||
if (relation.module === 'HTML') { | ||
var concept = relation.concept; | ||
if (concept) { | ||
@@ -56,3 +37,2 @@ (function () { | ||
var roles = void 0; | ||
if (elementRoleRelation) { | ||
@@ -63,5 +43,3 @@ roles = elementRoleRelation[1]; | ||
} | ||
var isUnique = true; | ||
for (var _i = 0; _i < roles.length; _i++) { | ||
@@ -73,7 +51,5 @@ if (roles[_i] === key) { | ||
} | ||
if (isUnique) { | ||
roles.push(key); | ||
} | ||
elementRoles.push([concept, roles]); | ||
@@ -86,3 +62,2 @@ })(); | ||
} | ||
var elementRoleMap = { | ||
@@ -94,12 +69,9 @@ entries: function entries() { | ||
var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
var _iterator = _createForOfIteratorHelper(elementRoles), | ||
_step; | ||
_step; | ||
try { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var _step$value = _slicedToArray(_step.value, 2), | ||
_key = _step$value[0], | ||
values = _step$value[1]; | ||
_key = _step$value[0], | ||
values = _step$value[1]; | ||
fn.call(thisArg, values, _key, elementRoles); | ||
@@ -120,3 +92,3 @@ } | ||
has: function has(key) { | ||
return !!this.get(key); | ||
return !!elementRoleMap.get(key); | ||
}, | ||
@@ -126,4 +98,3 @@ keys: function keys() { | ||
var _ref2 = _slicedToArray(_ref, 1), | ||
key = _ref2[0]; | ||
key = _ref2[0]; | ||
return key; | ||
@@ -135,4 +106,3 @@ }); | ||
var _ref4 = _slicedToArray(_ref3, 2), | ||
values = _ref4[1]; | ||
values = _ref4[1]; | ||
return values; | ||
@@ -142,5 +112,3 @@ }); | ||
}; | ||
var _default = (0, _iterationDecorator.default)(elementRoleMap, elementRoleMap.entries()); | ||
exports.default = _default; |
@@ -7,27 +7,14 @@ "use strict"; | ||
exports.default = void 0; | ||
var _commandRole = _interopRequireDefault(require("./abstract/commandRole")); | ||
var _compositeRole = _interopRequireDefault(require("./abstract/compositeRole")); | ||
var _inputRole = _interopRequireDefault(require("./abstract/inputRole")); | ||
var _landmarkRole = _interopRequireDefault(require("./abstract/landmarkRole")); | ||
var _rangeRole = _interopRequireDefault(require("./abstract/rangeRole")); | ||
var _roletypeRole = _interopRequireDefault(require("./abstract/roletypeRole")); | ||
var _sectionRole = _interopRequireDefault(require("./abstract/sectionRole")); | ||
var _sectionheadRole = _interopRequireDefault(require("./abstract/sectionheadRole")); | ||
var _selectRole = _interopRequireDefault(require("./abstract/selectRole")); | ||
var _structureRole = _interopRequireDefault(require("./abstract/structureRole")); | ||
var _widgetRole = _interopRequireDefault(require("./abstract/widgetRole")); | ||
var _windowRole = _interopRequireDefault(require("./abstract/windowRole")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -34,0 +21,0 @@ |
@@ -7,81 +7,41 @@ "use strict"; | ||
exports.default = void 0; | ||
var _docAbstractRole = _interopRequireDefault(require("./dpub/docAbstractRole")); | ||
var _docAcknowledgmentsRole = _interopRequireDefault(require("./dpub/docAcknowledgmentsRole")); | ||
var _docAfterwordRole = _interopRequireDefault(require("./dpub/docAfterwordRole")); | ||
var _docAppendixRole = _interopRequireDefault(require("./dpub/docAppendixRole")); | ||
var _docBacklinkRole = _interopRequireDefault(require("./dpub/docBacklinkRole")); | ||
var _docBiblioentryRole = _interopRequireDefault(require("./dpub/docBiblioentryRole")); | ||
var _docBibliographyRole = _interopRequireDefault(require("./dpub/docBibliographyRole")); | ||
var _docBibliorefRole = _interopRequireDefault(require("./dpub/docBibliorefRole")); | ||
var _docChapterRole = _interopRequireDefault(require("./dpub/docChapterRole")); | ||
var _docColophonRole = _interopRequireDefault(require("./dpub/docColophonRole")); | ||
var _docConclusionRole = _interopRequireDefault(require("./dpub/docConclusionRole")); | ||
var _docCoverRole = _interopRequireDefault(require("./dpub/docCoverRole")); | ||
var _docCreditRole = _interopRequireDefault(require("./dpub/docCreditRole")); | ||
var _docCreditsRole = _interopRequireDefault(require("./dpub/docCreditsRole")); | ||
var _docDedicationRole = _interopRequireDefault(require("./dpub/docDedicationRole")); | ||
var _docEndnoteRole = _interopRequireDefault(require("./dpub/docEndnoteRole")); | ||
var _docEndnotesRole = _interopRequireDefault(require("./dpub/docEndnotesRole")); | ||
var _docEpigraphRole = _interopRequireDefault(require("./dpub/docEpigraphRole")); | ||
var _docEpilogueRole = _interopRequireDefault(require("./dpub/docEpilogueRole")); | ||
var _docErrataRole = _interopRequireDefault(require("./dpub/docErrataRole")); | ||
var _docExampleRole = _interopRequireDefault(require("./dpub/docExampleRole")); | ||
var _docFootnoteRole = _interopRequireDefault(require("./dpub/docFootnoteRole")); | ||
var _docForewordRole = _interopRequireDefault(require("./dpub/docForewordRole")); | ||
var _docGlossaryRole = _interopRequireDefault(require("./dpub/docGlossaryRole")); | ||
var _docGlossrefRole = _interopRequireDefault(require("./dpub/docGlossrefRole")); | ||
var _docIndexRole = _interopRequireDefault(require("./dpub/docIndexRole")); | ||
var _docIntroductionRole = _interopRequireDefault(require("./dpub/docIntroductionRole")); | ||
var _docNoterefRole = _interopRequireDefault(require("./dpub/docNoterefRole")); | ||
var _docNoticeRole = _interopRequireDefault(require("./dpub/docNoticeRole")); | ||
var _docPagebreakRole = _interopRequireDefault(require("./dpub/docPagebreakRole")); | ||
var _docPagelistRole = _interopRequireDefault(require("./dpub/docPagelistRole")); | ||
var _docPartRole = _interopRequireDefault(require("./dpub/docPartRole")); | ||
var _docPrefaceRole = _interopRequireDefault(require("./dpub/docPrefaceRole")); | ||
var _docPrologueRole = _interopRequireDefault(require("./dpub/docPrologueRole")); | ||
var _docPullquoteRole = _interopRequireDefault(require("./dpub/docPullquoteRole")); | ||
var _docQnaRole = _interopRequireDefault(require("./dpub/docQnaRole")); | ||
var _docSubtitleRole = _interopRequireDefault(require("./dpub/docSubtitleRole")); | ||
var _docTipRole = _interopRequireDefault(require("./dpub/docTipRole")); | ||
var _docTocRole = _interopRequireDefault(require("./dpub/docTocRole")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -88,0 +48,0 @@ |
@@ -7,9 +7,5 @@ "use strict"; | ||
exports.default = void 0; | ||
var _graphicsDocumentRole = _interopRequireDefault(require("./graphics/graphicsDocumentRole")); | ||
var _graphicsObjectRole = _interopRequireDefault(require("./graphics/graphicsObjectRole")); | ||
var _graphicsSymbolRole = _interopRequireDefault(require("./graphics/graphicsSymbolRole")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -16,0 +12,0 @@ |
@@ -7,167 +7,84 @@ "use strict"; | ||
exports.default = void 0; | ||
var _alertRole = _interopRequireDefault(require("./literal/alertRole")); | ||
var _alertdialogRole = _interopRequireDefault(require("./literal/alertdialogRole")); | ||
var _applicationRole = _interopRequireDefault(require("./literal/applicationRole")); | ||
var _articleRole = _interopRequireDefault(require("./literal/articleRole")); | ||
var _bannerRole = _interopRequireDefault(require("./literal/bannerRole")); | ||
var _blockquoteRole = _interopRequireDefault(require("./literal/blockquoteRole")); | ||
var _buttonRole = _interopRequireDefault(require("./literal/buttonRole")); | ||
var _captionRole = _interopRequireDefault(require("./literal/captionRole")); | ||
var _cellRole = _interopRequireDefault(require("./literal/cellRole")); | ||
var _checkboxRole = _interopRequireDefault(require("./literal/checkboxRole")); | ||
var _codeRole = _interopRequireDefault(require("./literal/codeRole")); | ||
var _columnheaderRole = _interopRequireDefault(require("./literal/columnheaderRole")); | ||
var _comboboxRole = _interopRequireDefault(require("./literal/comboboxRole")); | ||
var _complementaryRole = _interopRequireDefault(require("./literal/complementaryRole")); | ||
var _contentinfoRole = _interopRequireDefault(require("./literal/contentinfoRole")); | ||
var _definitionRole = _interopRequireDefault(require("./literal/definitionRole")); | ||
var _deletionRole = _interopRequireDefault(require("./literal/deletionRole")); | ||
var _dialogRole = _interopRequireDefault(require("./literal/dialogRole")); | ||
var _directoryRole = _interopRequireDefault(require("./literal/directoryRole")); | ||
var _documentRole = _interopRequireDefault(require("./literal/documentRole")); | ||
var _emphasisRole = _interopRequireDefault(require("./literal/emphasisRole")); | ||
var _feedRole = _interopRequireDefault(require("./literal/feedRole")); | ||
var _figureRole = _interopRequireDefault(require("./literal/figureRole")); | ||
var _formRole = _interopRequireDefault(require("./literal/formRole")); | ||
var _genericRole = _interopRequireDefault(require("./literal/genericRole")); | ||
var _gridRole = _interopRequireDefault(require("./literal/gridRole")); | ||
var _gridcellRole = _interopRequireDefault(require("./literal/gridcellRole")); | ||
var _groupRole = _interopRequireDefault(require("./literal/groupRole")); | ||
var _headingRole = _interopRequireDefault(require("./literal/headingRole")); | ||
var _imgRole = _interopRequireDefault(require("./literal/imgRole")); | ||
var _insertionRole = _interopRequireDefault(require("./literal/insertionRole")); | ||
var _linkRole = _interopRequireDefault(require("./literal/linkRole")); | ||
var _listRole = _interopRequireDefault(require("./literal/listRole")); | ||
var _listboxRole = _interopRequireDefault(require("./literal/listboxRole")); | ||
var _listitemRole = _interopRequireDefault(require("./literal/listitemRole")); | ||
var _logRole = _interopRequireDefault(require("./literal/logRole")); | ||
var _mainRole = _interopRequireDefault(require("./literal/mainRole")); | ||
var _marqueeRole = _interopRequireDefault(require("./literal/marqueeRole")); | ||
var _mathRole = _interopRequireDefault(require("./literal/mathRole")); | ||
var _menuRole = _interopRequireDefault(require("./literal/menuRole")); | ||
var _menubarRole = _interopRequireDefault(require("./literal/menubarRole")); | ||
var _menuitemRole = _interopRequireDefault(require("./literal/menuitemRole")); | ||
var _menuitemcheckboxRole = _interopRequireDefault(require("./literal/menuitemcheckboxRole")); | ||
var _menuitemradioRole = _interopRequireDefault(require("./literal/menuitemradioRole")); | ||
var _meterRole = _interopRequireDefault(require("./literal/meterRole")); | ||
var _navigationRole = _interopRequireDefault(require("./literal/navigationRole")); | ||
var _noneRole = _interopRequireDefault(require("./literal/noneRole")); | ||
var _noteRole = _interopRequireDefault(require("./literal/noteRole")); | ||
var _optionRole = _interopRequireDefault(require("./literal/optionRole")); | ||
var _paragraphRole = _interopRequireDefault(require("./literal/paragraphRole")); | ||
var _presentationRole = _interopRequireDefault(require("./literal/presentationRole")); | ||
var _progressbarRole = _interopRequireDefault(require("./literal/progressbarRole")); | ||
var _radioRole = _interopRequireDefault(require("./literal/radioRole")); | ||
var _radiogroupRole = _interopRequireDefault(require("./literal/radiogroupRole")); | ||
var _regionRole = _interopRequireDefault(require("./literal/regionRole")); | ||
var _rowRole = _interopRequireDefault(require("./literal/rowRole")); | ||
var _rowgroupRole = _interopRequireDefault(require("./literal/rowgroupRole")); | ||
var _rowheaderRole = _interopRequireDefault(require("./literal/rowheaderRole")); | ||
var _scrollbarRole = _interopRequireDefault(require("./literal/scrollbarRole")); | ||
var _searchRole = _interopRequireDefault(require("./literal/searchRole")); | ||
var _searchboxRole = _interopRequireDefault(require("./literal/searchboxRole")); | ||
var _separatorRole = _interopRequireDefault(require("./literal/separatorRole")); | ||
var _sliderRole = _interopRequireDefault(require("./literal/sliderRole")); | ||
var _spinbuttonRole = _interopRequireDefault(require("./literal/spinbuttonRole")); | ||
var _statusRole = _interopRequireDefault(require("./literal/statusRole")); | ||
var _strongRole = _interopRequireDefault(require("./literal/strongRole")); | ||
var _subscriptRole = _interopRequireDefault(require("./literal/subscriptRole")); | ||
var _superscriptRole = _interopRequireDefault(require("./literal/superscriptRole")); | ||
var _switchRole = _interopRequireDefault(require("./literal/switchRole")); | ||
var _tabRole = _interopRequireDefault(require("./literal/tabRole")); | ||
var _tableRole = _interopRequireDefault(require("./literal/tableRole")); | ||
var _tablistRole = _interopRequireDefault(require("./literal/tablistRole")); | ||
var _tabpanelRole = _interopRequireDefault(require("./literal/tabpanelRole")); | ||
var _termRole = _interopRequireDefault(require("./literal/termRole")); | ||
var _textboxRole = _interopRequireDefault(require("./literal/textboxRole")); | ||
var _timeRole = _interopRequireDefault(require("./literal/timeRole")); | ||
var _timerRole = _interopRequireDefault(require("./literal/timerRole")); | ||
var _toolbarRole = _interopRequireDefault(require("./literal/toolbarRole")); | ||
var _tooltipRole = _interopRequireDefault(require("./literal/tooltipRole")); | ||
var _treeRole = _interopRequireDefault(require("./literal/treeRole")); | ||
var _treegridRole = _interopRequireDefault(require("./literal/treegridRole")); | ||
var _treeitemRole = _interopRequireDefault(require("./literal/treeitemRole")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -174,0 +91,0 @@ |
@@ -7,13 +7,7 @@ "use strict"; | ||
exports.roles = exports.roleElements = exports.elementRoles = exports.dom = exports.aria = void 0; | ||
var _ariaPropsMap = _interopRequireDefault(require("./ariaPropsMap")); | ||
var _domMap = _interopRequireDefault(require("./domMap")); | ||
var _rolesMap = _interopRequireDefault(require("./rolesMap")); | ||
var _elementRoleMap = _interopRequireDefault(require("./elementRoleMap")); | ||
var _roleElementMap = _interopRequireDefault(require("./roleElementMap")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -20,0 +14,0 @@ |
@@ -7,41 +7,23 @@ "use strict"; | ||
exports.default = void 0; | ||
var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator")); | ||
var _rolesMap = _interopRequireDefault(require("./rolesMap")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
var roleElement = []; | ||
var keys = _rolesMap.default.keys(); | ||
var _loop = function _loop(i) { | ||
var key = keys[i]; | ||
var role = _rolesMap.default.get(key); | ||
if (role) { | ||
var concepts = [].concat(role.baseConcepts, role.relatedConcepts); | ||
for (var k = 0; k < concepts.length; k++) { | ||
var relation = concepts[k]; | ||
if (relation.module === 'HTML') { | ||
var concept = relation.concept; | ||
if (concept) { | ||
@@ -52,3 +34,2 @@ var roleElementRelation = roleElement.find(function (item) { | ||
var relationConcepts = void 0; | ||
if (roleElementRelation) { | ||
@@ -59,3 +40,2 @@ relationConcepts = roleElementRelation[1]; | ||
} | ||
relationConcepts.push(concept); | ||
@@ -68,7 +48,5 @@ roleElement.push([key, relationConcepts]); | ||
}; | ||
for (var i = 0; i < keys.length; i++) { | ||
_loop(i); | ||
} | ||
var roleElementMap = { | ||
@@ -80,12 +58,9 @@ entries: function entries() { | ||
var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
var _iterator = _createForOfIteratorHelper(roleElement), | ||
_step; | ||
_step; | ||
try { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var _step$value = _slicedToArray(_step.value, 2), | ||
key = _step$value[0], | ||
values = _step$value[1]; | ||
key = _step$value[0], | ||
values = _step$value[1]; | ||
fn.call(thisArg, values, key, roleElement); | ||
@@ -106,3 +81,3 @@ } | ||
has: function has(key) { | ||
return !!this.get(key); | ||
return !!roleElementMap.get(key); | ||
}, | ||
@@ -112,4 +87,3 @@ keys: function keys() { | ||
var _ref2 = _slicedToArray(_ref, 1), | ||
key = _ref2[0]; | ||
key = _ref2[0]; | ||
return key; | ||
@@ -121,4 +95,3 @@ }); | ||
var _ref4 = _slicedToArray(_ref3, 2), | ||
values = _ref4[1]; | ||
values = _ref4[1]; | ||
return values; | ||
@@ -128,5 +101,3 @@ }); | ||
}; | ||
var _default = (0, _iterationDecorator.default)(roleElementMap, roleElementMap.entries()); | ||
exports.default = _default; |
@@ -7,45 +7,28 @@ "use strict"; | ||
exports.default = void 0; | ||
var _ariaAbstractRoles = _interopRequireDefault(require("./etc/roles/ariaAbstractRoles")); | ||
var _ariaLiteralRoles = _interopRequireDefault(require("./etc/roles/ariaLiteralRoles")); | ||
var _ariaDpubRoles = _interopRequireDefault(require("./etc/roles/ariaDpubRoles")); | ||
var _ariaGraphicsRoles = _interopRequireDefault(require("./etc/roles/ariaGraphicsRoles")); | ||
var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
var roles = [].concat(_ariaAbstractRoles.default, _ariaLiteralRoles.default, _ariaDpubRoles.default); | ||
var roles = [].concat(_ariaAbstractRoles.default, _ariaLiteralRoles.default, _ariaDpubRoles.default, _ariaGraphicsRoles.default); | ||
roles.forEach(function (_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
roleDefinition = _ref2[1]; | ||
roleDefinition = _ref2[1]; | ||
// Conglomerate the properties | ||
var _iterator = _createForOfIteratorHelper(roleDefinition.superClass), | ||
_step; | ||
_step; | ||
try { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var superClassIter = _step.value; | ||
var _iterator2 = _createForOfIteratorHelper(superClassIter), | ||
_step2; | ||
_step2; | ||
try { | ||
@@ -56,14 +39,11 @@ var _loop = function _loop() { | ||
var _ref4 = _slicedToArray(_ref3, 1), | ||
name = _ref4[0]; | ||
name = _ref4[0]; | ||
return name === superClassName; | ||
}); | ||
if (superClassRoleTuple) { | ||
var superClassDefinition = superClassRoleTuple[1]; | ||
for (var _i2 = 0, _Object$keys = Object.keys(superClassDefinition.props); _i2 < _Object$keys.length; _i2++) { | ||
var prop = _Object$keys[_i2]; | ||
if ( // $FlowIssue Accessing the hasOwnProperty on the Object prototype is fine. | ||
if ( | ||
// $FlowIssue Accessing the hasOwnProperty on the Object prototype is fine. | ||
!Object.prototype.hasOwnProperty.call(roleDefinition.props, prop)) { | ||
@@ -75,3 +55,2 @@ Object.assign(roleDefinition.props, _defineProperty({}, prop, superClassDefinition.props[prop])); | ||
}; | ||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { | ||
@@ -98,12 +77,9 @@ _loop(); | ||
var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
var _iterator3 = _createForOfIteratorHelper(roles), | ||
_step3; | ||
_step3; | ||
try { | ||
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { | ||
var _step3$value = _slicedToArray(_step3.value, 2), | ||
key = _step3$value[0], | ||
values = _step3$value[1]; | ||
key = _step3$value[0], | ||
values = _step3$value[1]; | ||
fn.call(thisArg, values, key, roles); | ||
@@ -124,3 +100,3 @@ } | ||
has: function has(key) { | ||
return !!this.get(key); | ||
return !!rolesMap.get(key); | ||
}, | ||
@@ -130,4 +106,3 @@ keys: function keys() { | ||
var _ref6 = _slicedToArray(_ref5, 1), | ||
key = _ref6[0]; | ||
key = _ref6[0]; | ||
return key; | ||
@@ -139,4 +114,3 @@ }); | ||
var _ref8 = _slicedToArray(_ref7, 2), | ||
values = _ref8[1]; | ||
values = _ref8[1]; | ||
return values; | ||
@@ -146,5 +120,3 @@ }); | ||
}; | ||
var _default = (0, _iterationDecorator.default)(rolesMap, rolesMap.entries()); | ||
exports.default = _default; |
@@ -7,9 +7,5 @@ "use strict"; | ||
exports.default = iterationDecorator; | ||
var _iteratorProxy = _interopRequireDefault(require("./iteratorProxy")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
function iterationDecorator(collection, entries) { | ||
@@ -21,4 +17,3 @@ if (typeof Symbol === 'function' && _typeof(Symbol.iterator) === 'symbol') { | ||
} | ||
return collection; | ||
} |
@@ -8,2 +8,3 @@ "use strict"; | ||
// eslint-disable-next-line no-unused-vars | ||
function iteratorProxy() { | ||
@@ -33,4 +34,3 @@ var values = this; | ||
} | ||
var _default = iteratorProxy; | ||
exports.default = _default; |
{ | ||
"name": "aria-query", | ||
"version": "5.1.2", | ||
"version": "5.1.3", | ||
"description": "Programmatic access to the ARIA specification", | ||
@@ -48,3 +48,3 @@ "main": "lib/index.js", | ||
"expect": "^29.2.1", | ||
"flow-bin": "^0.190.1", | ||
"flow-bin": "^0.191.0", | ||
"jest": "^29.2.1", | ||
@@ -51,0 +51,0 @@ "minimist": "^1.2.7", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5579
176330