AccessibilityRowValue.js (1457B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 const { 8 Component, 9 createFactory, 10 } = require("resource://devtools/client/shared/vendor/react.mjs"); 11 const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.mjs"); 12 const { 13 span, 14 } = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); 15 16 const Badges = createFactory( 17 require("resource://devtools/client/accessibility/components/Badges.js") 18 ); 19 const AuditController = createFactory( 20 require("resource://devtools/client/accessibility/components/AuditController.js") 21 ); 22 23 const { REPS } = ChromeUtils.importESModule( 24 "resource://devtools/client/shared/components/reps/index.mjs" 25 ); 26 const { Grip } = REPS; 27 const Rep = createFactory(REPS.Rep); 28 29 class AccessibilityRowValue extends Component { 30 static get propTypes() { 31 return { 32 member: PropTypes.shape({ 33 object: PropTypes.object, 34 }).isRequired, 35 }; 36 } 37 38 render() { 39 return span( 40 { 41 role: "presentation", 42 }, 43 Rep({ 44 ...this.props, 45 defaultRep: Grip, 46 cropLimit: 50, 47 }), 48 AuditController( 49 { 50 accessibleFront: this.props.member.object, 51 }, 52 Badges() 53 ) 54 ); 55 } 56 } 57 58 module.exports = AccessibilityRowValue;