source: frontend/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago

Fix frontend appearance

  • Property mode set to 100644
File size: 737 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports["default"] = getImplicitRoleForMenuitem;
7var _jsxAstUtils = require("jsx-ast-utils");
8/**
9 * Returns the implicit role for a menuitem tag.
10 */
11function getImplicitRoleForMenuitem(attributes) {
12 var type = (0, _jsxAstUtils.getProp)(attributes, 'type');
13 if (type) {
14 var value = (0, _jsxAstUtils.getLiteralPropValue)(type) || '';
15 switch (typeof value === 'string' && value.toUpperCase()) {
16 case 'COMMAND':
17 return 'menuitem';
18 case 'CHECKBOX':
19 return 'menuitemcheckbox';
20 case 'RADIO':
21 return 'menuitemradio';
22 default:
23 return '';
24 }
25 }
26 return '';
27}
28module.exports = exports.default;
Note: See TracBrowser for help on using the repository browser.