Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

29 строки
869 B

  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _jsxAstUtils = require('jsx-ast-utils');
  6. /**
  7. * Returns boolean indicating that the aria-hidden prop
  8. * is present or the value is true. Will also return true if
  9. * there is an input with type='hidden'.
  10. *
  11. * <div aria-hidden /> is equivalent to the DOM as <div aria-hidden=true />.
  12. */
  13. var isHiddenFromScreenReader = function isHiddenFromScreenReader(type, attributes) {
  14. if (type.toUpperCase() === 'INPUT') {
  15. var hidden = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'type'));
  16. if (hidden && hidden.toUpperCase() === 'HIDDEN') {
  17. return true;
  18. }
  19. }
  20. var ariaHidden = (0, _jsxAstUtils.getPropValue)((0, _jsxAstUtils.getProp)(attributes, 'aria-hidden'));
  21. return ariaHidden === true;
  22. };
  23. exports.default = isHiddenFromScreenReader;