/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
class MenuItem extends PureComponent { static get propTypes() { return { // An optional keyboard shortcut to display next to the item. // (This does not actually register the event listener for the key.)
accelerator: PropTypes.string,
// A tri-state value that may be true/false if item should be checkable, // and undefined otherwise.
checked: PropTypes.bool,
// Any additional classes to assign to the button specified as // a space-separated string.
className: PropTypes.string,
// A disabled state of the menu item.
disabled: PropTypes.bool,
// URL of the icon to associate with the MenuItem. (Optional) // // e.g. chrome://devtools/skim/image/foo.svg // // This may also be set in CSS using the --menuitem-icon-image variable. // Note that in this case, the variable should specify the CSS <image> to // use, not simply the URL (e.g. // "url(chrome://devtools/skim/image/foo.svg)").
icon: PropTypes.string,
// An optional ID to be assigned to the item.
id: PropTypes.string,
// The item label for use with legacy localization systems.
label: PropTypes.string,
// The Fluent ID for localizing the label.
l10nID: PropTypes.string,
// An optional callback to be invoked when the item is selected.
onClick: PropTypes.func,
// Optional menu item role override. Use this property with a value // "menuitemradio" if the menu item is a radio.
role: PropTypes.string,
// An optional text for the item tooltip.
tooltip: PropTypes.string,
};
}
/** * Use this as a fallback `icon` prop if your MenuList contains MenuItems * with or without icon in order to keep all MenuItems aligned.
*/ static get DUMMY_ICON() { return `data:image/svg+xml,${encodeURIComponent( '<svg height="16" width="16"></svg>'
)}`;
}
if (this.props.l10nID && this.props.label) {
console.warn( "<MenuItem> should only take either an l10nID or a label, not both"
);
} if (!this.props.l10nID && !this.props.label) {
console.warn("<MenuItem> requires either an l10nID, or a label prop.");
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.12Bemerkung:
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-05-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.