|
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 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports["default"] = getImplicitRoleForMenuitem;
|
|---|
| 7 | var _jsxAstUtils = require("jsx-ast-utils");
|
|---|
| 8 | /**
|
|---|
| 9 | * Returns the implicit role for a menuitem tag.
|
|---|
| 10 | */
|
|---|
| 11 | function 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 | }
|
|---|
| 28 | module.exports = exports.default; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.