|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
945 bytes
|
| Line | |
|---|
| 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports["default"] = void 0;
|
|---|
| 7 | var _jsxAstUtils = require("jsx-ast-utils");
|
|---|
| 8 | /**
|
|---|
| 9 | * Returns boolean indicating that the aria-hidden prop
|
|---|
| 10 | * is present or the value is true. Will also return true if
|
|---|
| 11 | * there is an input with type='hidden'.
|
|---|
| 12 | *
|
|---|
| 13 | * <div aria-hidden /> is equivalent to the DOM as <div aria-hidden=true />.
|
|---|
| 14 | */
|
|---|
| 15 | var isHiddenFromScreenReader = function isHiddenFromScreenReader(type, attributes) {
|
|---|
| 16 | if (type.toUpperCase() === 'INPUT') {
|
|---|
| 17 | var hidden = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'type'));
|
|---|
| 18 | if (hidden && hidden.toUpperCase() === 'HIDDEN') {
|
|---|
| 19 | return true;
|
|---|
| 20 | }
|
|---|
| 21 | }
|
|---|
| 22 | var ariaHidden = (0, _jsxAstUtils.getPropValue)((0, _jsxAstUtils.getProp)(attributes, 'aria-hidden'));
|
|---|
| 23 | return ariaHidden === true;
|
|---|
| 24 | };
|
|---|
| 25 | var _default = exports["default"] = isHiddenFromScreenReader;
|
|---|
| 26 | module.exports = exports.default; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.