web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
926 B

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