|
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:
769 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports["default"] = getImplicitRole;
|
|---|
| 7 | var _ariaQuery = require("aria-query");
|
|---|
| 8 | var _implicitRoles = _interopRequireDefault(require("./implicitRoles"));
|
|---|
| 9 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|---|
| 10 | /**
|
|---|
| 11 | * Returns an element's implicit role given its attributes and type.
|
|---|
| 12 | * Some elements only have an implicit role when certain props are defined.
|
|---|
| 13 | */
|
|---|
| 14 | function getImplicitRole(type, attributes) {
|
|---|
| 15 | var implicitRole;
|
|---|
| 16 | if (_implicitRoles["default"][type]) {
|
|---|
| 17 | implicitRole = _implicitRoles["default"][type](attributes);
|
|---|
| 18 | }
|
|---|
| 19 | if (_ariaQuery.roles.has(implicitRole)) {
|
|---|
| 20 | return implicitRole;
|
|---|
| 21 | }
|
|---|
| 22 | return null;
|
|---|
| 23 | }
|
|---|
| 24 | module.exports = exports.default; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.