Save current BZZZ config-ui state before CHORUS branding update
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
34
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/attributesComparator.js
generated
vendored
Normal file
34
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/attributesComparator.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
/**
|
||||
* Returns true if all items in baseAttributes are found in attributes. Always
|
||||
* returns true if baseAttributes is empty.
|
||||
*/
|
||||
function attributesComparator() {
|
||||
var baseAttributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
||||
return baseAttributes.every(function (baseAttr) {
|
||||
return attributes.some(function (attribute) {
|
||||
// Guard against non-JSXAttribute nodes like JSXSpreadAttribute
|
||||
if (attribute.type !== 'JSXAttribute') {
|
||||
return false;
|
||||
}
|
||||
// Attribute matches.
|
||||
if (baseAttr.name !== (0, _jsxAstUtils.propName)(attribute)) {
|
||||
return false;
|
||||
}
|
||||
// Value exists and does not match.
|
||||
if (baseAttr.value && baseAttr.value !== (0, _jsxAstUtils.getLiteralPropValue)(attribute)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
});
|
||||
}
|
||||
var _default = exports["default"] = attributesComparator;
|
||||
module.exports = exports.default;
|
||||
55
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getAccessibleChildText.js
generated
vendored
Normal file
55
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getAccessibleChildText.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getAccessibleChildText;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
var _isHiddenFromScreenReader = _interopRequireDefault(require("./isHiddenFromScreenReader"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
/**
|
||||
* Returns a new "standardized" string: all whitespace is collapsed to one space,
|
||||
* and the string is lowercase
|
||||
* @param {string} input
|
||||
* @returns lowercase, single-spaced, punctuation-stripped, trimmed string
|
||||
*/
|
||||
function standardizeSpaceAndCase(input) {
|
||||
return input.trim().replace(/[,.?¿!‽¡;:]/g, '') // strip punctuation
|
||||
.replace(/\s\s+/g, ' ') // collapse spaces
|
||||
.toLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the (recursively-defined) accessible child text of a node, which (in-order) is:
|
||||
* 1. The element's aria-label
|
||||
* 2. If the element is a direct literal, the literal value
|
||||
* 3. Otherwise, merge all of its children
|
||||
* @param {JSXElement} node - node to traverse
|
||||
* @returns child text as a string
|
||||
*/
|
||||
function getAccessibleChildText(node, elementType) {
|
||||
var ariaLabel = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(node.openingElement.attributes, 'aria-label'));
|
||||
// early escape-hatch when aria-label is applied
|
||||
if (ariaLabel) return standardizeSpaceAndCase(ariaLabel);
|
||||
|
||||
// early-return if alt prop exists and is an image
|
||||
var altTag = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(node.openingElement.attributes, 'alt'));
|
||||
if (elementType(node.openingElement) === 'img' && altTag) return standardizeSpaceAndCase(altTag);
|
||||
|
||||
// skip if aria-hidden is true
|
||||
if ((0, _isHiddenFromScreenReader["default"])(elementType(node.openingElement), node.openingElement.attributes)) {
|
||||
return '';
|
||||
}
|
||||
var rawChildText = node.children.map(function (currentNode) {
|
||||
// $FlowFixMe JSXText is missing in ast-types-flow
|
||||
if (currentNode.type === 'Literal' || currentNode.type === 'JSXText') {
|
||||
return String(currentNode.value);
|
||||
}
|
||||
if (currentNode.type === 'JSXElement') {
|
||||
return getAccessibleChildText(currentNode, elementType);
|
||||
}
|
||||
return '';
|
||||
}).join(' ');
|
||||
return standardizeSpaceAndCase(rawChildText);
|
||||
}
|
||||
module.exports = exports.default;
|
||||
19
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getComputedRole.js
generated
vendored
Normal file
19
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getComputedRole.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getComputedRole;
|
||||
var _getExplicitRole = _interopRequireDefault(require("./getExplicitRole"));
|
||||
var _getImplicitRole = _interopRequireDefault(require("./getImplicitRole"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
/**
|
||||
* Returns an element's computed role, which is
|
||||
*
|
||||
* 1. The valid value of its explicit role attribute; or
|
||||
* 2. The implicit value of its tag.
|
||||
*/
|
||||
function getComputedRole(tag, attributes) {
|
||||
return (0, _getExplicitRole["default"])(tag, attributes) || (0, _getImplicitRole["default"])(tag, attributes);
|
||||
}
|
||||
module.exports = exports.default;
|
||||
30
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getElementType.js
generated
vendored
Normal file
30
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getElementType.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _hasown = _interopRequireDefault(require("hasown"));
|
||||
var _arrayIncludes = _interopRequireDefault(require("array-includes"));
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
var getElementType = function getElementType(context) {
|
||||
var _settings$jsxA11y, _settings$jsxA11y2, _settings$jsxA11y3;
|
||||
var settings = context.settings;
|
||||
var polymorphicPropName = (_settings$jsxA11y = settings['jsx-a11y']) === null || _settings$jsxA11y === void 0 ? void 0 : _settings$jsxA11y.polymorphicPropName;
|
||||
var polymorphicAllowList = (_settings$jsxA11y2 = settings['jsx-a11y']) === null || _settings$jsxA11y2 === void 0 ? void 0 : _settings$jsxA11y2.polymorphicAllowList;
|
||||
var componentMap = (_settings$jsxA11y3 = settings['jsx-a11y']) === null || _settings$jsxA11y3 === void 0 ? void 0 : _settings$jsxA11y3.components;
|
||||
return function (node) {
|
||||
var polymorphicProp = polymorphicPropName ? (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(node.attributes, polymorphicPropName)) : undefined;
|
||||
var rawType = (0, _jsxAstUtils.elementType)(node);
|
||||
if (polymorphicProp && (!polymorphicAllowList || (0, _arrayIncludes["default"])(polymorphicAllowList, rawType))) {
|
||||
rawType = polymorphicProp;
|
||||
}
|
||||
if (!componentMap) {
|
||||
return rawType;
|
||||
}
|
||||
return (0, _hasown["default"])(componentMap, rawType) ? componentMap[rawType] : rawType;
|
||||
};
|
||||
};
|
||||
var _default = exports["default"] = getElementType;
|
||||
module.exports = exports.default;
|
||||
27
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getExplicitRole.js
generated
vendored
Normal file
27
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getExplicitRole.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getExplicitRole;
|
||||
var _ariaQuery = require("aria-query");
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
/**
|
||||
* Returns an element's computed role, which is
|
||||
*
|
||||
* 1. The valid value of its explicit role attribute; or
|
||||
* 2. The implicit value of its tag.
|
||||
*/
|
||||
function getExplicitRole(tag, attributes) {
|
||||
var explicitRole = function toLowerCase(role) {
|
||||
if (typeof role === 'string') {
|
||||
return role.toLowerCase();
|
||||
}
|
||||
return null;
|
||||
}((0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'role')));
|
||||
if (_ariaQuery.roles.has(explicitRole)) {
|
||||
return explicitRole;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
module.exports = exports.default;
|
||||
24
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getImplicitRole.js
generated
vendored
Normal file
24
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getImplicitRole.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRole;
|
||||
var _ariaQuery = require("aria-query");
|
||||
var _implicitRoles = _interopRequireDefault(require("./implicitRoles"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
/**
|
||||
* Returns an element's implicit role given its attributes and type.
|
||||
* Some elements only have an implicit role when certain props are defined.
|
||||
*/
|
||||
function getImplicitRole(type, attributes) {
|
||||
var implicitRole;
|
||||
if (_implicitRoles["default"][type]) {
|
||||
implicitRole = _implicitRoles["default"][type](attributes);
|
||||
}
|
||||
if (_ariaQuery.roles.has(implicitRole)) {
|
||||
return implicitRole;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
module.exports = exports.default;
|
||||
32
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getSuggestion.js
generated
vendored
Normal file
32
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getSuggestion.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getSuggestion;
|
||||
var _damerauLevenshtein = _interopRequireDefault(require("damerau-levenshtein"));
|
||||
var _object = _interopRequireDefault(require("object.fromentries"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
// Minimum edit distance to be considered a good suggestion.
|
||||
var THRESHOLD = 2;
|
||||
|
||||
/**
|
||||
* Returns an array of suggestions given a word and a dictionary and limit of suggestions
|
||||
* to return.
|
||||
*/
|
||||
function getSuggestion(word) {
|
||||
var dictionary = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
||||
var limit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
|
||||
var distances = (0, _object["default"])(dictionary.map(function (dictionaryWord) {
|
||||
var distance = (0, _damerauLevenshtein["default"])(word.toUpperCase(), dictionaryWord.toUpperCase());
|
||||
var steps = distance.steps;
|
||||
return [dictionaryWord, steps];
|
||||
}));
|
||||
return Object.keys(distances).filter(function (suggestion) {
|
||||
return distances[suggestion] <= THRESHOLD;
|
||||
}).sort(function (a, b) {
|
||||
return distances[a] - distances[b];
|
||||
}) // Sort by distance
|
||||
.slice(0, limit);
|
||||
}
|
||||
module.exports = exports.default;
|
||||
33
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getTabIndex.js
generated
vendored
Normal file
33
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/getTabIndex.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getTabIndex;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
/**
|
||||
* Returns the tabIndex value.
|
||||
*/
|
||||
function getTabIndex(tabIndex) {
|
||||
var literalValue = (0, _jsxAstUtils.getLiteralPropValue)(tabIndex);
|
||||
|
||||
// String and number values.
|
||||
if (['string', 'number'].indexOf(typeof literalValue) > -1) {
|
||||
// Empty string will convert to zero, so check for it explicity.
|
||||
if (typeof literalValue === 'string' && literalValue.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
var value = Number(literalValue);
|
||||
if (Number.isNaN(value)) {
|
||||
return undefined;
|
||||
}
|
||||
return Number.isInteger(value) ? value : undefined;
|
||||
}
|
||||
|
||||
// Booleans are not valid values, return undefined.
|
||||
if (literalValue === true || literalValue === false) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _jsxAstUtils.getPropValue)(tabIndex);
|
||||
}
|
||||
module.exports = exports.default;
|
||||
30
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/hasAccessibleChild.js
generated
vendored
Normal file
30
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/hasAccessibleChild.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = hasAccessibleChild;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
var _isHiddenFromScreenReader = _interopRequireDefault(require("./isHiddenFromScreenReader"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
function hasAccessibleChild(node, elementType) {
|
||||
return node.children.some(function (child) {
|
||||
switch (child.type) {
|
||||
case 'Literal':
|
||||
return !!child.value;
|
||||
// $FlowFixMe JSXText is missing in ast-types-flow
|
||||
case 'JSXText':
|
||||
return !!child.value;
|
||||
case 'JSXElement':
|
||||
return !(0, _isHiddenFromScreenReader["default"])(elementType(child.openingElement), child.openingElement.attributes);
|
||||
case 'JSXExpressionContainer':
|
||||
if (child.expression.type === 'Identifier') {
|
||||
return child.expression.name !== 'undefined';
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}) || (0, _jsxAstUtils.hasAnyProp)(node.openingElement.attributes, ['dangerouslySetInnerHTML', 'children']);
|
||||
}
|
||||
module.exports = exports.default;
|
||||
17
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/a.js
generated
vendored
Normal file
17
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/a.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForAnchor;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
/**
|
||||
* Returns the implicit role for an anchor tag.
|
||||
*/
|
||||
function getImplicitRoleForAnchor(attributes) {
|
||||
if ((0, _jsxAstUtils.getProp)(attributes, 'href')) {
|
||||
return 'link';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
17
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/area.js
generated
vendored
Normal file
17
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/area.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForArea;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
/**
|
||||
* Returns the implicit role for an area tag.
|
||||
*/
|
||||
function getImplicitRoleForArea(attributes) {
|
||||
if ((0, _jsxAstUtils.getProp)(attributes, 'href')) {
|
||||
return 'link';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/article.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/article.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForArticle;
|
||||
/**
|
||||
* Returns the implicit role for an article tag.
|
||||
*/
|
||||
function getImplicitRoleForArticle() {
|
||||
return 'article';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/aside.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/aside.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForAside;
|
||||
/**
|
||||
* Returns the implicit role for an aside tag.
|
||||
*/
|
||||
function getImplicitRoleForAside() {
|
||||
return 'complementary';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/body.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/body.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForBody;
|
||||
/**
|
||||
* Returns the implicit role for a body tag.
|
||||
*/
|
||||
function getImplicitRoleForBody() {
|
||||
return 'document';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/button.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/button.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForButton;
|
||||
/**
|
||||
* Returns the implicit role for a button tag.
|
||||
*/
|
||||
function getImplicitRoleForButton() {
|
||||
return 'button';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/datalist.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/datalist.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForDatalist;
|
||||
/**
|
||||
* Returns the implicit role for a datalist tag.
|
||||
*/
|
||||
function getImplicitRoleForDatalist() {
|
||||
return 'listbox';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/details.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/details.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForDetails;
|
||||
/**
|
||||
* Returns the implicit role for a details tag.
|
||||
*/
|
||||
function getImplicitRoleForDetails() {
|
||||
return 'group';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/dialog.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/dialog.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForDialog;
|
||||
/**
|
||||
* Returns the implicit role for a dialog tag.
|
||||
*/
|
||||
function getImplicitRoleForDialog() {
|
||||
return 'dialog';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/form.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/form.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForForm;
|
||||
/**
|
||||
* Returns the implicit role for a form tag.
|
||||
*/
|
||||
function getImplicitRoleForForm() {
|
||||
return 'form';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h1.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h1.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForH1;
|
||||
/**
|
||||
* Returns the implicit role for an h1 tag.
|
||||
*/
|
||||
function getImplicitRoleForH1() {
|
||||
return 'heading';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h2.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h2.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForH2;
|
||||
/**
|
||||
* Returns the implicit role for an h2 tag.
|
||||
*/
|
||||
function getImplicitRoleForH2() {
|
||||
return 'heading';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h3.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h3.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForH3;
|
||||
/**
|
||||
* Returns the implicit role for an h3 tag.
|
||||
*/
|
||||
function getImplicitRoleForH3() {
|
||||
return 'heading';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h4.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h4.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForH4;
|
||||
/**
|
||||
* Returns the implicit role for an h4 tag.
|
||||
*/
|
||||
function getImplicitRoleForH4() {
|
||||
return 'heading';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h5.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h5.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForH5;
|
||||
/**
|
||||
* Returns the implicit role for an h5 tag.
|
||||
*/
|
||||
function getImplicitRoleForH5() {
|
||||
return 'heading';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h6.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h6.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForH6;
|
||||
/**
|
||||
* Returns the implicit role for an h6tag.
|
||||
*/
|
||||
function getImplicitRoleForH6() {
|
||||
return 'heading';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/hr.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/hr.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForHr;
|
||||
/**
|
||||
* Returns the implicit role for an hr tag.
|
||||
*/
|
||||
function getImplicitRoleForHr() {
|
||||
return 'separator';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
31
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/img.js
generated
vendored
Normal file
31
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/img.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForImg;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
/**
|
||||
* Returns the implicit role for an img tag.
|
||||
*/
|
||||
function getImplicitRoleForImg(attributes) {
|
||||
var _getLiteralPropValue;
|
||||
var alt = (0, _jsxAstUtils.getProp)(attributes, 'alt');
|
||||
if (alt && (0, _jsxAstUtils.getLiteralPropValue)(alt) === '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* If the src attribute can be determined to be an svg, allow the role to be set to 'img'
|
||||
* so that VoiceOver on Safari can be better supported.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#identifying_svg_as_an_image
|
||||
* @see https://bugs.webkit.org/show_bug.cgi?id=216364
|
||||
*/
|
||||
var src = (0, _jsxAstUtils.getProp)(attributes, 'src');
|
||||
if (src && (_getLiteralPropValue = (0, _jsxAstUtils.getLiteralPropValue)(src)) !== null && _getLiteralPropValue !== void 0 && _getLiteralPropValue.includes('.svg')) {
|
||||
return '';
|
||||
}
|
||||
return 'img';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
82
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/index.js
generated
vendored
Normal file
82
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/index.js
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _a = _interopRequireDefault(require("./a"));
|
||||
var _area = _interopRequireDefault(require("./area"));
|
||||
var _article = _interopRequireDefault(require("./article"));
|
||||
var _aside = _interopRequireDefault(require("./aside"));
|
||||
var _body = _interopRequireDefault(require("./body"));
|
||||
var _button = _interopRequireDefault(require("./button"));
|
||||
var _datalist = _interopRequireDefault(require("./datalist"));
|
||||
var _details = _interopRequireDefault(require("./details"));
|
||||
var _dialog = _interopRequireDefault(require("./dialog"));
|
||||
var _form = _interopRequireDefault(require("./form"));
|
||||
var _h = _interopRequireDefault(require("./h1"));
|
||||
var _h2 = _interopRequireDefault(require("./h2"));
|
||||
var _h3 = _interopRequireDefault(require("./h3"));
|
||||
var _h4 = _interopRequireDefault(require("./h4"));
|
||||
var _h5 = _interopRequireDefault(require("./h5"));
|
||||
var _h6 = _interopRequireDefault(require("./h6"));
|
||||
var _hr = _interopRequireDefault(require("./hr"));
|
||||
var _img = _interopRequireDefault(require("./img"));
|
||||
var _input = _interopRequireDefault(require("./input"));
|
||||
var _li = _interopRequireDefault(require("./li"));
|
||||
var _link = _interopRequireDefault(require("./link"));
|
||||
var _menu = _interopRequireDefault(require("./menu"));
|
||||
var _menuitem = _interopRequireDefault(require("./menuitem"));
|
||||
var _meter = _interopRequireDefault(require("./meter"));
|
||||
var _nav = _interopRequireDefault(require("./nav"));
|
||||
var _ol = _interopRequireDefault(require("./ol"));
|
||||
var _option = _interopRequireDefault(require("./option"));
|
||||
var _output = _interopRequireDefault(require("./output"));
|
||||
var _progress = _interopRequireDefault(require("./progress"));
|
||||
var _section = _interopRequireDefault(require("./section"));
|
||||
var _select = _interopRequireDefault(require("./select"));
|
||||
var _tbody = _interopRequireDefault(require("./tbody"));
|
||||
var _textarea = _interopRequireDefault(require("./textarea"));
|
||||
var _tfoot = _interopRequireDefault(require("./tfoot"));
|
||||
var _thead = _interopRequireDefault(require("./thead"));
|
||||
var _ul = _interopRequireDefault(require("./ul"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
var _default = exports["default"] = {
|
||||
a: _a["default"],
|
||||
area: _area["default"],
|
||||
article: _article["default"],
|
||||
aside: _aside["default"],
|
||||
body: _body["default"],
|
||||
button: _button["default"],
|
||||
datalist: _datalist["default"],
|
||||
details: _details["default"],
|
||||
dialog: _dialog["default"],
|
||||
form: _form["default"],
|
||||
h1: _h["default"],
|
||||
h2: _h2["default"],
|
||||
h3: _h3["default"],
|
||||
h4: _h4["default"],
|
||||
h5: _h5["default"],
|
||||
h6: _h6["default"],
|
||||
hr: _hr["default"],
|
||||
img: _img["default"],
|
||||
input: _input["default"],
|
||||
li: _li["default"],
|
||||
link: _link["default"],
|
||||
menu: _menu["default"],
|
||||
menuitem: _menuitem["default"],
|
||||
meter: _meter["default"],
|
||||
nav: _nav["default"],
|
||||
ol: _ol["default"],
|
||||
option: _option["default"],
|
||||
output: _output["default"],
|
||||
progress: _progress["default"],
|
||||
section: _section["default"],
|
||||
select: _select["default"],
|
||||
tbody: _tbody["default"],
|
||||
textarea: _textarea["default"],
|
||||
tfoot: _tfoot["default"],
|
||||
thead: _thead["default"],
|
||||
ul: _ul["default"]
|
||||
};
|
||||
module.exports = exports.default;
|
||||
38
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/input.js
generated
vendored
Normal file
38
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/input.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForInput;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
/**
|
||||
* Returns the implicit role for an input tag.
|
||||
*/
|
||||
function getImplicitRoleForInput(attributes) {
|
||||
var type = (0, _jsxAstUtils.getProp)(attributes, 'type');
|
||||
if (type) {
|
||||
var value = (0, _jsxAstUtils.getLiteralPropValue)(type) || '';
|
||||
switch (typeof value === 'string' && value.toUpperCase()) {
|
||||
case 'BUTTON':
|
||||
case 'IMAGE':
|
||||
case 'RESET':
|
||||
case 'SUBMIT':
|
||||
return 'button';
|
||||
case 'CHECKBOX':
|
||||
return 'checkbox';
|
||||
case 'RADIO':
|
||||
return 'radio';
|
||||
case 'RANGE':
|
||||
return 'slider';
|
||||
case 'EMAIL':
|
||||
case 'PASSWORD':
|
||||
case 'SEARCH': // with [list] selector it's combobox
|
||||
case 'TEL': // with [list] selector it's combobox
|
||||
case 'URL': // with [list] selector it's combobox
|
||||
default:
|
||||
return 'textbox';
|
||||
}
|
||||
}
|
||||
return 'textbox';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/li.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/li.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForLi;
|
||||
/**
|
||||
* Returns the implicit role for an li tag.
|
||||
*/
|
||||
function getImplicitRoleForLi() {
|
||||
return 'listitem';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
17
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/link.js
generated
vendored
Normal file
17
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/link.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForLink;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
/**
|
||||
* Returns the implicit role for a link tag.
|
||||
*/
|
||||
function getImplicitRoleForLink(attributes) {
|
||||
if ((0, _jsxAstUtils.getProp)(attributes, 'href')) {
|
||||
return 'link';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
19
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/menu.js
generated
vendored
Normal file
19
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/menu.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForMenu;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
/**
|
||||
* Returns the implicit role for a menu tag.
|
||||
*/
|
||||
function getImplicitRoleForMenu(attributes) {
|
||||
var type = (0, _jsxAstUtils.getProp)(attributes, 'type');
|
||||
if (type) {
|
||||
var value = (0, _jsxAstUtils.getLiteralPropValue)(type);
|
||||
return value && value.toUpperCase() === 'TOOLBAR' ? 'toolbar' : '';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
28
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem.js
generated
vendored
Normal file
28
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForMenuitem;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
/**
|
||||
* Returns the implicit role for a menuitem tag.
|
||||
*/
|
||||
function getImplicitRoleForMenuitem(attributes) {
|
||||
var type = (0, _jsxAstUtils.getProp)(attributes, 'type');
|
||||
if (type) {
|
||||
var value = (0, _jsxAstUtils.getLiteralPropValue)(type) || '';
|
||||
switch (typeof value === 'string' && value.toUpperCase()) {
|
||||
case 'COMMAND':
|
||||
return 'menuitem';
|
||||
case 'CHECKBOX':
|
||||
return 'menuitemcheckbox';
|
||||
case 'RADIO':
|
||||
return 'menuitemradio';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/meter.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/meter.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForMeter;
|
||||
/**
|
||||
* Returns the implicit role for a meter tag.
|
||||
*/
|
||||
function getImplicitRoleForMeter() {
|
||||
return 'progressbar';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/nav.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/nav.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForNav;
|
||||
/**
|
||||
* Returns the implicit role for a nav tag.
|
||||
*/
|
||||
function getImplicitRoleForNav() {
|
||||
return 'navigation';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/ol.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/ol.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForOl;
|
||||
/**
|
||||
* Returns the implicit role for an ol tag.
|
||||
*/
|
||||
function getImplicitRoleForOl() {
|
||||
return 'list';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/option.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/option.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForOption;
|
||||
/**
|
||||
* Returns the implicit role for an option tag.
|
||||
*/
|
||||
function getImplicitRoleForOption() {
|
||||
return 'option';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/output.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/output.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForOutput;
|
||||
/**
|
||||
* Returns the implicit role for an output tag.
|
||||
*/
|
||||
function getImplicitRoleForOutput() {
|
||||
return 'status';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/progress.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/progress.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForProgress;
|
||||
/**
|
||||
* Returns the implicit role for a progress tag.
|
||||
*/
|
||||
function getImplicitRoleForProgress() {
|
||||
return 'progressbar';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/section.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/section.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForSection;
|
||||
/**
|
||||
* Returns the implicit role for a section tag.
|
||||
*/
|
||||
function getImplicitRoleForSection() {
|
||||
return 'region';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/select.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/select.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForSelect;
|
||||
/**
|
||||
* Returns the implicit role for a select tag.
|
||||
*/
|
||||
function getImplicitRoleForSelect() {
|
||||
return 'listbox';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/tbody.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/tbody.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForTbody;
|
||||
/**
|
||||
* Returns the implicit role for a tbody tag.
|
||||
*/
|
||||
function getImplicitRoleForTbody() {
|
||||
return 'rowgroup';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/textarea.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/textarea.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForTextarea;
|
||||
/**
|
||||
* Returns the implicit role for a textarea tag.
|
||||
*/
|
||||
function getImplicitRoleForTextarea() {
|
||||
return 'textbox';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/tfoot.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/tfoot.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForTfoot;
|
||||
/**
|
||||
* Returns the implicit role for a tfoot tag.
|
||||
*/
|
||||
function getImplicitRoleForTfoot() {
|
||||
return 'rowgroup';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/thead.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/thead.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForThead;
|
||||
/**
|
||||
* Returns the implicit role for a thead tag.
|
||||
*/
|
||||
function getImplicitRoleForThead() {
|
||||
return 'rowgroup';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForUl;
|
||||
/**
|
||||
* Returns the implicit role for a ul tag.
|
||||
*/
|
||||
function getImplicitRoleForUl() {
|
||||
return 'list';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
23
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isAbstractRole.js
generated
vendored
Normal file
23
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isAbstractRole.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _ariaQuery = require("aria-query");
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
var abstractRoles = new Set(_ariaQuery.roles.keys().filter(function (role) {
|
||||
return _ariaQuery.roles.get(role)["abstract"];
|
||||
}));
|
||||
var DOMElements = new Set(_ariaQuery.dom.keys());
|
||||
var isAbstractRole = function isAbstractRole(tagName, attributes) {
|
||||
// Do not test higher level JSX components, as we do not know what
|
||||
// low-level DOM element this maps to.
|
||||
if (!DOMElements.has(tagName)) {
|
||||
return false;
|
||||
}
|
||||
var role = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'role'));
|
||||
return abstractRoles.has(role);
|
||||
};
|
||||
var _default = exports["default"] = isAbstractRole;
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isContentEditable.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isContentEditable.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = isContentEditable;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
function isContentEditable(tagName, attributes) {
|
||||
var _prop$value;
|
||||
var prop = (0, _jsxAstUtils.getProp)(attributes, 'contentEditable');
|
||||
return (prop === null || prop === void 0 ? void 0 : (_prop$value = prop.value) === null || _prop$value === void 0 ? void 0 : _prop$value.raw) === '"true"';
|
||||
}
|
||||
module.exports = exports.default;
|
||||
15
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isDOMElement.js
generated
vendored
Normal file
15
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isDOMElement.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _ariaQuery = require("aria-query");
|
||||
/**
|
||||
* Returns boolean indicating whether the given element is a DOM element.
|
||||
*/
|
||||
var isDOMElement = function isDOMElement(tagName) {
|
||||
return _ariaQuery.dom.has(tagName);
|
||||
};
|
||||
var _default = exports["default"] = isDOMElement;
|
||||
module.exports = exports.default;
|
||||
23
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isDisabledElement.js
generated
vendored
Normal file
23
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isDisabledElement.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
var isDisabledElement = function isDisabledElement(attributes) {
|
||||
var disabledAttr = (0, _jsxAstUtils.getProp)(attributes, 'disabled');
|
||||
var disabledAttrValue = (0, _jsxAstUtils.getPropValue)(disabledAttr);
|
||||
var isHTML5Disabled = disabledAttr && disabledAttrValue !== undefined;
|
||||
if (isHTML5Disabled) {
|
||||
return true;
|
||||
}
|
||||
var ariaDisabledAttr = (0, _jsxAstUtils.getProp)(attributes, 'aria-disabled');
|
||||
var ariaDisabledAttrValue = (0, _jsxAstUtils.getLiteralPropValue)(ariaDisabledAttr);
|
||||
if (ariaDisabledAttr && ariaDisabledAttrValue !== undefined && ariaDisabledAttrValue === true) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
var _default = exports["default"] = isDisabledElement;
|
||||
module.exports = exports.default;
|
||||
23
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isFocusable.js
generated
vendored
Normal file
23
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isFocusable.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
var _getTabIndex = _interopRequireDefault(require("./getTabIndex"));
|
||||
var _isInteractiveElement = _interopRequireDefault(require("./isInteractiveElement"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
/**
|
||||
* Returns boolean indicating whether an element appears in tab focus.
|
||||
* Identifies an element as focusable if it is an interactive element, or an element with a tabIndex greater than or equal to 0.
|
||||
*/
|
||||
function isFocusable(type, attributes) {
|
||||
var tabIndex = (0, _getTabIndex["default"])((0, _jsxAstUtils.getProp)(attributes, 'tabIndex'));
|
||||
if ((0, _isInteractiveElement["default"])(type, attributes)) {
|
||||
return tabIndex === undefined || tabIndex >= 0;
|
||||
}
|
||||
return tabIndex >= 0;
|
||||
}
|
||||
var _default = exports["default"] = isFocusable;
|
||||
module.exports = exports.default;
|
||||
26
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader.js
generated
vendored
Normal file
26
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
/**
|
||||
* Returns boolean indicating that the aria-hidden prop
|
||||
* is present or the value is true. Will also return true if
|
||||
* there is an input with type='hidden'.
|
||||
*
|
||||
* <div aria-hidden /> is equivalent to the DOM as <div aria-hidden=true />.
|
||||
*/
|
||||
var isHiddenFromScreenReader = function isHiddenFromScreenReader(type, attributes) {
|
||||
if (type.toUpperCase() === 'INPUT') {
|
||||
var hidden = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'type'));
|
||||
if (hidden && hidden.toUpperCase() === 'HIDDEN') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
var ariaHidden = (0, _jsxAstUtils.getPropValue)((0, _jsxAstUtils.getProp)(attributes, 'aria-hidden'));
|
||||
return ariaHidden === true;
|
||||
};
|
||||
var _default = exports["default"] = isHiddenFromScreenReader;
|
||||
module.exports = exports.default;
|
||||
116
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isInteractiveElement.js
generated
vendored
Normal file
116
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isInteractiveElement.js
generated
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _ariaQuery = require("aria-query");
|
||||
var _axobjectQuery = require("axobject-query");
|
||||
var _arrayIncludes = _interopRequireDefault(require("array-includes"));
|
||||
var _arrayPrototype = _interopRequireDefault(require("array.prototype.flatmap"));
|
||||
var _attributesComparator = _interopRequireDefault(require("./attributesComparator"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
||||
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
||||
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
||||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
||||
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
||||
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
||||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
||||
var roleKeys = _ariaQuery.roles.keys();
|
||||
var elementRoleEntries = _toConsumableArray(_ariaQuery.elementRoles);
|
||||
var nonInteractiveRoles = new Set(roleKeys.filter(function (name) {
|
||||
var role = _ariaQuery.roles.get(name);
|
||||
return !role["abstract"]
|
||||
// 'toolbar' does not descend from widget, but it does support
|
||||
// aria-activedescendant, thus in practice we treat it as a widget.
|
||||
&& name !== 'toolbar' && !role.superClass.some(function (classes) {
|
||||
return (0, _arrayIncludes["default"])(classes, 'widget');
|
||||
});
|
||||
}).concat(
|
||||
// The `progressbar` is descended from `widget`, but in practice, its
|
||||
// value is always `readonly`, so we treat it as a non-interactive role.
|
||||
'progressbar'));
|
||||
var interactiveRoles = new Set(roleKeys.filter(function (name) {
|
||||
var role = _ariaQuery.roles.get(name);
|
||||
return !role["abstract"]
|
||||
// The `progressbar` is descended from `widget`, but in practice, its
|
||||
// value is always `readonly`, so we treat it as a non-interactive role.
|
||||
&& name !== 'progressbar' && role.superClass.some(function (classes) {
|
||||
return (0, _arrayIncludes["default"])(classes, 'widget');
|
||||
});
|
||||
}).concat(
|
||||
// 'toolbar' does not descend from widget, but it does support
|
||||
// aria-activedescendant, thus in practice we treat it as a widget.
|
||||
'toolbar'));
|
||||
var interactiveElementRoleSchemas = (0, _arrayPrototype["default"])(elementRoleEntries, function (_ref) {
|
||||
var _ref2 = _slicedToArray(_ref, 2),
|
||||
elementSchema = _ref2[0],
|
||||
rolesArr = _ref2[1];
|
||||
return rolesArr.some(function (role) {
|
||||
return interactiveRoles.has(role);
|
||||
}) ? [elementSchema] : [];
|
||||
});
|
||||
var nonInteractiveElementRoleSchemas = (0, _arrayPrototype["default"])(elementRoleEntries, function (_ref3) {
|
||||
var _ref4 = _slicedToArray(_ref3, 2),
|
||||
elementSchema = _ref4[0],
|
||||
rolesArr = _ref4[1];
|
||||
return rolesArr.every(function (role) {
|
||||
return nonInteractiveRoles.has(role);
|
||||
}) ? [elementSchema] : [];
|
||||
});
|
||||
var interactiveAXObjects = new Set(_axobjectQuery.AXObjects.keys().filter(function (name) {
|
||||
return _axobjectQuery.AXObjects.get(name).type === 'widget';
|
||||
}));
|
||||
var interactiveElementAXObjectSchemas = (0, _arrayPrototype["default"])(_toConsumableArray(_axobjectQuery.elementAXObjects), function (_ref5) {
|
||||
var _ref6 = _slicedToArray(_ref5, 2),
|
||||
elementSchema = _ref6[0],
|
||||
AXObjectsArr = _ref6[1];
|
||||
return AXObjectsArr.every(function (role) {
|
||||
return interactiveAXObjects.has(role);
|
||||
}) ? [elementSchema] : [];
|
||||
});
|
||||
function checkIsInteractiveElement(tagName, attributes) {
|
||||
function elementSchemaMatcher(elementSchema) {
|
||||
return tagName === elementSchema.name && (0, _attributesComparator["default"])(elementSchema.attributes, attributes);
|
||||
}
|
||||
|
||||
// Check in elementRoles for inherent interactive role associations for
|
||||
// this element.
|
||||
var isInherentInteractiveElement = interactiveElementRoleSchemas.some(elementSchemaMatcher);
|
||||
if (isInherentInteractiveElement) {
|
||||
return true;
|
||||
}
|
||||
// Check in elementRoles for inherent non-interactive role associations for
|
||||
// this element.
|
||||
var isInherentNonInteractiveElement = nonInteractiveElementRoleSchemas.some(elementSchemaMatcher);
|
||||
if (isInherentNonInteractiveElement) {
|
||||
return false;
|
||||
}
|
||||
// Check in elementAXObjects for AX Tree associations for this element.
|
||||
var isInteractiveAXElement = interactiveElementAXObjectSchemas.some(elementSchemaMatcher);
|
||||
if (isInteractiveAXElement) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns boolean indicating whether the given element is
|
||||
* interactive on the DOM or not. Usually used when an element
|
||||
* has a dynamic handler on it and we need to discern whether or not
|
||||
* it's intention is to be interacted with on the DOM.
|
||||
*/
|
||||
var isInteractiveElement = function isInteractiveElement(tagName, attributes) {
|
||||
// Do not test higher level JSX components, as we do not know what
|
||||
// low-level DOM element this maps to.
|
||||
if (!_ariaQuery.dom.has(tagName)) {
|
||||
return false;
|
||||
}
|
||||
return checkIsInteractiveElement(tagName, attributes);
|
||||
};
|
||||
var _default = exports["default"] = isInteractiveElement;
|
||||
module.exports = exports.default;
|
||||
54
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isInteractiveRole.js
generated
vendored
Normal file
54
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isInteractiveRole.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _ariaQuery = require("aria-query");
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
var _arrayIncludes = _interopRequireDefault(require("array-includes"));
|
||||
var _arrayPrototype = _interopRequireDefault(require("array.prototype.flatmap"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
var roles = _ariaQuery.roles.keys();
|
||||
var interactiveRoles = roles.filter(function (name) {
|
||||
return !_ariaQuery.roles.get(name)["abstract"] && _ariaQuery.roles.get(name).superClass.some(function (klasses) {
|
||||
return (0, _arrayIncludes["default"])(klasses, 'widget');
|
||||
});
|
||||
});
|
||||
|
||||
// 'toolbar' does not descend from widget, but it does support
|
||||
// aria-activedescendant, thus in practice we treat it as a widget.
|
||||
interactiveRoles.push('toolbar');
|
||||
/**
|
||||
* Returns boolean indicating whether the given element has a role
|
||||
* that is associated with an interactive component. Used when an element
|
||||
* has a dynamic handler on it and we need to discern whether or not
|
||||
* its intention is to be interacted with in the DOM.
|
||||
*
|
||||
* isInteractiveRole is a Logical Disjunction:
|
||||
* https://en.wikipedia.org/wiki/Logical_disjunction
|
||||
* The JSX element does not have a tagName or it has a tagName and a role
|
||||
* attribute with a value in the set of non-interactive roles.
|
||||
*/
|
||||
var isInteractiveRole = function isInteractiveRole(tagName, attributes) {
|
||||
var value = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'role'));
|
||||
|
||||
// If value is undefined, then the role attribute will be dropped in the DOM.
|
||||
// If value is null, then getLiteralAttributeValue is telling us that the
|
||||
// value isn't in the form of a literal
|
||||
if (value === undefined || value === null) {
|
||||
return false;
|
||||
}
|
||||
var isInteractive = false;
|
||||
var normalizedValues = String(value).toLowerCase().split(' ');
|
||||
var validRoles = (0, _arrayPrototype["default"])(normalizedValues, function (name) {
|
||||
return (0, _arrayIncludes["default"])(roles, name) ? [name] : [];
|
||||
});
|
||||
if (validRoles.length > 0) {
|
||||
// The first role value is a series takes precedence.
|
||||
isInteractive = (0, _arrayIncludes["default"])(interactiveRoles, validRoles[0]);
|
||||
}
|
||||
return isInteractive;
|
||||
};
|
||||
var _default = exports["default"] = isInteractiveRole;
|
||||
module.exports = exports.default;
|
||||
131
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement.js
generated
vendored
Normal file
131
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement.js
generated
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _ariaQuery = require("aria-query");
|
||||
var _axobjectQuery = require("axobject-query");
|
||||
var _arrayIncludes = _interopRequireDefault(require("array-includes"));
|
||||
var _arrayPrototype = _interopRequireDefault(require("array.prototype.flatmap"));
|
||||
var _attributesComparator = _interopRequireDefault(require("./attributesComparator"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
||||
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
||||
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
||||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
||||
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
||||
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
||||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
||||
var roleKeys = _ariaQuery.roles.keys();
|
||||
var elementRoleEntries = _toConsumableArray(_ariaQuery.elementRoles);
|
||||
var nonInteractiveRoles = new Set(roleKeys.filter(function (name) {
|
||||
var role = _ariaQuery.roles.get(name);
|
||||
return !role["abstract"]
|
||||
// 'toolbar' does not descend from widget, but it does support
|
||||
// aria-activedescendant, thus in practice we treat it as a widget.
|
||||
&& name !== 'toolbar'
|
||||
// This role is meant to have no semantic value.
|
||||
// @see https://www.w3.org/TR/wai-aria-1.2/#generic
|
||||
&& name !== 'generic' && !role.superClass.some(function (classes) {
|
||||
return (0, _arrayIncludes["default"])(classes, 'widget');
|
||||
});
|
||||
}).concat(
|
||||
// The `progressbar` is descended from `widget`, but in practice, its
|
||||
// value is always `readonly`, so we treat it as a non-interactive role.
|
||||
'progressbar'));
|
||||
var interactiveRoles = new Set(roleKeys.filter(function (name) {
|
||||
var role = _ariaQuery.roles.get(name);
|
||||
return !role["abstract"]
|
||||
// The `progressbar` is descended from `widget`, but in practice, its
|
||||
// value is always `readonly`, so we treat it as a non-interactive role.
|
||||
&& name !== 'progressbar'
|
||||
// This role is meant to have no semantic value.
|
||||
// @see https://www.w3.org/TR/wai-aria-1.2/#generic
|
||||
&& name !== 'generic' && role.superClass.some(function (classes) {
|
||||
return (0, _arrayIncludes["default"])(classes, 'widget');
|
||||
});
|
||||
}).concat(
|
||||
// 'toolbar' does not descend from widget, but it does support
|
||||
// aria-activedescendant, thus in practice we treat it as a widget.
|
||||
'toolbar'));
|
||||
var interactiveElementRoleSchemas = (0, _arrayPrototype["default"])(elementRoleEntries, function (_ref) {
|
||||
var _ref2 = _slicedToArray(_ref, 2),
|
||||
elementSchema = _ref2[0],
|
||||
rolesArr = _ref2[1];
|
||||
return rolesArr.some(function (role) {
|
||||
return interactiveRoles.has(role);
|
||||
}) ? [elementSchema] : [];
|
||||
});
|
||||
var nonInteractiveElementRoleSchemas = (0, _arrayPrototype["default"])(elementRoleEntries, function (_ref3) {
|
||||
var _ref4 = _slicedToArray(_ref3, 2),
|
||||
elementSchema = _ref4[0],
|
||||
rolesArr = _ref4[1];
|
||||
return rolesArr.every(function (role) {
|
||||
return nonInteractiveRoles.has(role);
|
||||
}) ? [elementSchema] : [];
|
||||
});
|
||||
var nonInteractiveAXObjects = new Set(_axobjectQuery.AXObjects.keys().filter(function (name) {
|
||||
return (0, _arrayIncludes["default"])(['window', 'structure'], _axobjectQuery.AXObjects.get(name).type);
|
||||
}));
|
||||
var nonInteractiveElementAXObjectSchemas = (0, _arrayPrototype["default"])(_toConsumableArray(_axobjectQuery.elementAXObjects), function (_ref5) {
|
||||
var _ref6 = _slicedToArray(_ref5, 2),
|
||||
elementSchema = _ref6[0],
|
||||
AXObjectsArr = _ref6[1];
|
||||
return AXObjectsArr.every(function (role) {
|
||||
return nonInteractiveAXObjects.has(role);
|
||||
}) ? [elementSchema] : [];
|
||||
});
|
||||
function checkIsNonInteractiveElement(tagName, attributes) {
|
||||
function elementSchemaMatcher(elementSchema) {
|
||||
return tagName === elementSchema.name && tagName !== 'td' // TODO: investigate why this is needed
|
||||
&& (0, _attributesComparator["default"])(elementSchema.attributes, attributes);
|
||||
}
|
||||
// Check in elementRoles for inherent non-interactive role associations for
|
||||
// this element.
|
||||
var isInherentNonInteractiveElement = nonInteractiveElementRoleSchemas.some(elementSchemaMatcher);
|
||||
if (isInherentNonInteractiveElement) {
|
||||
return true;
|
||||
}
|
||||
// Check in elementRoles for inherent interactive role associations for
|
||||
// this element.
|
||||
var isInherentInteractiveElement = interactiveElementRoleSchemas.some(elementSchemaMatcher);
|
||||
if (isInherentInteractiveElement) {
|
||||
return false;
|
||||
}
|
||||
// Check in elementAXObjects for AX Tree associations for this element.
|
||||
var isNonInteractiveAXElement = nonInteractiveElementAXObjectSchemas.some(elementSchemaMatcher);
|
||||
if (isNonInteractiveAXElement) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns boolean indicating whether the given element is a non-interactive
|
||||
* element. If the element has either a non-interactive role assigned or it
|
||||
* is an element with an inherently non-interactive role, then this utility
|
||||
* returns true. Elements that lack either an explicitly assigned role or
|
||||
* an inherent role are not considered. For those, this utility returns false
|
||||
* because a positive determination of interactiveness cannot be determined.
|
||||
*/
|
||||
var isNonInteractiveElement = function isNonInteractiveElement(tagName, attributes) {
|
||||
// Do not test higher level JSX components, as we do not know what
|
||||
// low-level DOM element this maps to.
|
||||
if (!_ariaQuery.dom.has(tagName)) {
|
||||
return false;
|
||||
}
|
||||
// <header> elements do not technically have semantics, unless the
|
||||
// element is a direct descendant of <body>, and this plugin cannot
|
||||
// reliably test that.
|
||||
// @see https://www.w3.org/TR/wai-aria-practices/examples/landmarks/banner.html
|
||||
if (tagName === 'header') {
|
||||
return false;
|
||||
}
|
||||
return checkIsNonInteractiveElement(tagName, attributes);
|
||||
};
|
||||
var _default = exports["default"] = isNonInteractiveElement;
|
||||
module.exports = exports.default;
|
||||
55
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole.js
generated
vendored
Normal file
55
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _ariaQuery = require("aria-query");
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
var _arrayIncludes = _interopRequireDefault(require("array-includes"));
|
||||
var _arrayPrototype = _interopRequireDefault(require("array.prototype.flatmap"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
var nonInteractiveRoles = _ariaQuery.roles.keys().filter(function (name) {
|
||||
return !_ariaQuery.roles.get(name)["abstract"] && !_ariaQuery.roles.get(name).superClass.some(function (klasses) {
|
||||
return (0, _arrayIncludes["default"])(klasses, 'widget');
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns boolean indicating whether the given element has a role
|
||||
* that is associated with a non-interactive component. Non-interactive roles
|
||||
* include `listitem`, `article`, or `dialog`. These are roles that indicate
|
||||
* for the most part containers.
|
||||
*
|
||||
* Elements with these roles should not respond or handle user interactions.
|
||||
* For example, an `onClick` handler should not be assigned to an element with
|
||||
* the role `listitem`. An element inside the `listitem`, like a button or a
|
||||
* link, should handle the click.
|
||||
*
|
||||
* This utility returns true for elements that are assigned a non-interactive
|
||||
* role. It will return false for elements that do not have a role. So whereas
|
||||
* a `div` might be considered non-interactive, for the purpose of this utility,
|
||||
* it is considered neither interactive nor non-interactive -- a determination
|
||||
* cannot be made in this case and false is returned.
|
||||
*/
|
||||
|
||||
var isNonInteractiveRole = function isNonInteractiveRole(tagName, attributes) {
|
||||
// Do not test higher level JSX components, as we do not know what
|
||||
// low-level DOM element this maps to.
|
||||
if (!_ariaQuery.dom.has(tagName)) {
|
||||
return false;
|
||||
}
|
||||
var role = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'role'));
|
||||
var isNonInteractive = false;
|
||||
var normalizedValues = String(role).toLowerCase().split(' ');
|
||||
var validRoles = (0, _arrayPrototype["default"])(normalizedValues, function (name) {
|
||||
return _ariaQuery.roles.has(name) ? [name] : [];
|
||||
});
|
||||
if (validRoles.length > 0) {
|
||||
// The first role value is a series takes precedence.
|
||||
isNonInteractive = (0, _arrayIncludes["default"])(nonInteractiveRoles, validRoles[0]);
|
||||
}
|
||||
return isNonInteractive;
|
||||
};
|
||||
var _default = exports["default"] = isNonInteractiveRole;
|
||||
module.exports = exports.default;
|
||||
29
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isNonLiteralProperty.js
generated
vendored
Normal file
29
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isNonLiteralProperty.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
/**
|
||||
* Returns boolean indicating whether the given element has been specified with
|
||||
* an AST node with a non-literal type.
|
||||
*
|
||||
* Returns true if the elements has a role and its value is not of a type Literal.
|
||||
* Otherwise returns false.
|
||||
*/
|
||||
var isNonLiteralProperty = function isNonLiteralProperty(attributes, propName) {
|
||||
var prop = (0, _jsxAstUtils.getProp)(attributes, propName);
|
||||
if (!prop) return false;
|
||||
var propValue = prop.value;
|
||||
if (!propValue) return false;
|
||||
if (propValue.type === 'Literal') return false;
|
||||
if (propValue.type === 'JSXExpressionContainer') {
|
||||
var expression = propValue.expression;
|
||||
if (expression.type === 'Identifier' && expression.name === 'undefined') return false;
|
||||
if (expression.type === 'JSXText') return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
var _default = exports["default"] = isNonLiteralProperty;
|
||||
module.exports = exports.default;
|
||||
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isPresentationRole.js
generated
vendored
Normal file
13
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isPresentationRole.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
var presentationRoles = new Set(['presentation', 'none']);
|
||||
var isPresentationRole = function isPresentationRole(tagName, attributes) {
|
||||
return presentationRoles.has((0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'role')));
|
||||
};
|
||||
var _default = exports["default"] = isPresentationRole;
|
||||
module.exports = exports.default;
|
||||
54
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isSemanticRoleElement.js
generated
vendored
Normal file
54
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/isSemanticRoleElement.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var _axobjectQuery = require("axobject-query");
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
var isSemanticRoleElement = function isSemanticRoleElement(elementType, attributes) {
|
||||
var roleAttr = (0, _jsxAstUtils.getProp)(attributes, 'role');
|
||||
var res = false;
|
||||
var roleAttrValue = (0, _jsxAstUtils.getLiteralPropValue)(roleAttr);
|
||||
_axobjectQuery.elementAXObjects.forEach(function (axObjects, concept) {
|
||||
if (res) {
|
||||
return;
|
||||
}
|
||||
if (concept.name === elementType && (concept.attributes || []).every(function (cAttr) {
|
||||
return attributes.some(function (attr) {
|
||||
if (!attr.type || attr.type !== 'JSXAttribute') {
|
||||
return false;
|
||||
}
|
||||
var namesMatch = cAttr.name === (0, _jsxAstUtils.propName)(attr);
|
||||
var valuesMatch;
|
||||
if (cAttr.value !== undefined) {
|
||||
valuesMatch = cAttr.value === (0, _jsxAstUtils.getLiteralPropValue)(attr);
|
||||
}
|
||||
if (!namesMatch) {
|
||||
return false;
|
||||
}
|
||||
return namesMatch && valuesMatch !== undefined ? valuesMatch : true;
|
||||
});
|
||||
})) {
|
||||
axObjects.forEach(function (name) {
|
||||
if (res) {
|
||||
return;
|
||||
}
|
||||
var roles = _axobjectQuery.AXObjectRoles.get(name);
|
||||
if (roles) {
|
||||
roles.forEach(function (role) {
|
||||
if (res === true) {
|
||||
return;
|
||||
}
|
||||
if (role.name === roleAttrValue) {
|
||||
res = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return res;
|
||||
};
|
||||
var _default = exports["default"] = isSemanticRoleElement;
|
||||
module.exports = exports.default;
|
||||
50
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/mayContainChildComponent.js
generated
vendored
Normal file
50
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/mayContainChildComponent.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = mayContainChildComponent;
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
var _minimatch = _interopRequireDefault(require("minimatch"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
/**
|
||||
* Returns true if it can positively determine that the element lacks an
|
||||
* accessible label. If no determination is possible, it returns false. Treat
|
||||
* false as an unknown value. The element might still have an accessible label,
|
||||
* but this module cannot determine it positively.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
function mayContainChildComponent(root, componentName) {
|
||||
var maxDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
||||
var elementType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _jsxAstUtils.elementType;
|
||||
function traverseChildren(node, depth) {
|
||||
// Bail when maxDepth is exceeded.
|
||||
if (depth > maxDepth) {
|
||||
return false;
|
||||
}
|
||||
if (node.children) {
|
||||
/* $FlowFixMe */
|
||||
for (var i = 0; i < node.children.length; i += 1) {
|
||||
/* $FlowFixMe */
|
||||
var childNode = node.children[i];
|
||||
// Assume an expression container renders a label. It is the best we can
|
||||
// do in this case.
|
||||
if (childNode.type === 'JSXExpressionContainer') {
|
||||
return true;
|
||||
}
|
||||
// Check for components with the provided name.
|
||||
if (childNode.type === 'JSXElement' && childNode.openingElement && (0, _minimatch["default"])(elementType(childNode.openingElement), componentName)) {
|
||||
return true;
|
||||
}
|
||||
if (traverseChildren(childNode, depth + 1)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return traverseChildren(root, 1);
|
||||
}
|
||||
module.exports = exports.default;
|
||||
95
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/mayHaveAccessibleLabel.js
generated
vendored
Normal file
95
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/mayHaveAccessibleLabel.js
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = mayHaveAccessibleLabel;
|
||||
var _arrayIncludes = _interopRequireDefault(require("array-includes"));
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
var _minimatch = _interopRequireDefault(require("minimatch"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
||||
/**
|
||||
* Returns true if a labelling element is found or if it cannot determine if
|
||||
* a label is present because of expression containers or spread attributes.
|
||||
* A false return value means that the node definitely does not have a label,
|
||||
* but a true return return value means that the node may or may not have a
|
||||
* label.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
function tryTrim(value) {
|
||||
return typeof value === 'string' ? value.trim() : value;
|
||||
}
|
||||
function hasLabellingProp(openingElement) {
|
||||
var additionalLabellingProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
||||
var labellingProps = [].concat('alt',
|
||||
// Assume alt is used correctly on an image
|
||||
'aria-label', 'aria-labelledby', additionalLabellingProps);
|
||||
return openingElement.attributes.some(function (attribute) {
|
||||
// We must assume that a spread value contains a labelling prop.
|
||||
if (attribute.type !== 'JSXAttribute') {
|
||||
return true;
|
||||
}
|
||||
// Attribute matches.
|
||||
if ((0, _arrayIncludes["default"])(labellingProps, (0, _jsxAstUtils.propName)(attribute)) && !!tryTrim((0, _jsxAstUtils.getPropValue)(attribute))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
function mayHaveAccessibleLabel(root) {
|
||||
var maxDepth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
||||
var additionalLabellingProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
||||
var getElementType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _jsxAstUtils.elementType;
|
||||
var controlComponents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
||||
function checkElement(node, depth) {
|
||||
// Bail when maxDepth is exceeded.
|
||||
if (depth > maxDepth) {
|
||||
return false;
|
||||
}
|
||||
// Check for literal text.
|
||||
if (node.type === 'Literal' && !!tryTrim(node.value)) {
|
||||
return true;
|
||||
}
|
||||
// Assume an expression container renders a label. It is the best we can
|
||||
// do in this case.
|
||||
if (node.type === 'JSXExpressionContainer') {
|
||||
return true;
|
||||
}
|
||||
// Check for JSXText.
|
||||
// $FlowFixMe Remove after updating ast-types-flow
|
||||
if (node.type === 'JSXText' && !!tryTrim(node.value)) {
|
||||
return true;
|
||||
}
|
||||
// Check for labelling props.
|
||||
if (node.openingElement
|
||||
/* $FlowFixMe */ && hasLabellingProp(node.openingElement, additionalLabellingProps)) {
|
||||
return true;
|
||||
}
|
||||
if (node.type === 'JSXElement' && node.children.length === 0 && node.openingElement) {
|
||||
// $FlowFixMe `node.openingElement` has `unknown` type
|
||||
var name = getElementType(node.openingElement);
|
||||
var isReactComponent = name.length > 0 && name[0] === name[0].toUpperCase();
|
||||
if (isReactComponent && !controlComponents.some(function (control) {
|
||||
return (0, _minimatch["default"])(name, control);
|
||||
})) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Recurse into the child element nodes.
|
||||
if (node.children) {
|
||||
/* $FlowFixMe */
|
||||
for (var i = 0; i < node.children.length; i += 1) {
|
||||
/* $FlowFixMe */
|
||||
if (checkElement(node.children[i], depth + 1)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return checkElement(root, 0);
|
||||
}
|
||||
module.exports = exports.default;
|
||||
51
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/schemas.js
generated
vendored
Normal file
51
install/config-ui/node_modules/eslint-plugin-jsx-a11y/lib/util/schemas.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.generateObjSchema = exports.enumArraySchema = exports.arraySchema = void 0;
|
||||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
||||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
||||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
/**
|
||||
* JSON schema to accept an array of unique strings
|
||||
*/
|
||||
var arraySchema = exports.arraySchema = {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string'
|
||||
},
|
||||
uniqueItems: true,
|
||||
additionalItems: false
|
||||
};
|
||||
|
||||
/**
|
||||
* JSON schema to accept an array of unique strings from an enumerated list.
|
||||
*/
|
||||
var enumArraySchema = exports.enumArraySchema = function enumArraySchema() {
|
||||
var enumeratedList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
var minItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
||||
return _objectSpread(_objectSpread({}, arraySchema), {}, {
|
||||
items: {
|
||||
type: 'string',
|
||||
"enum": enumeratedList
|
||||
},
|
||||
minItems
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Factory function to generate an object schema
|
||||
* with specified properties object
|
||||
*/
|
||||
var generateObjSchema = exports.generateObjSchema = function generateObjSchema() {
|
||||
var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
var required = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
||||
return {
|
||||
type: 'object',
|
||||
properties,
|
||||
required
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user