office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
54 lines • 2.35 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { ContextualMenuItemType } from 'office-ui-fabric-react/lib/ContextualMenu';
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';
import './ContextualMenuExample.scss';
var ContextualMenuWithCustomMenuItemExample = /** @class */ (function (_super) {
tslib_1.__extends(ContextualMenuWithCustomMenuItemExample, _super);
function ContextualMenuWithCustomMenuItemExample(props) {
var _this = _super.call(this, props) || this;
_this.state = {
showCallout: false
};
return _this;
}
ContextualMenuWithCustomMenuItemExample.prototype.render = function () {
return (React.createElement("div", null,
React.createElement(DefaultButton, { id: "ContextualMenuButton1", text: "Click for ContextualMenu", menuProps: {
shouldFocusOnMount: true,
items: [
{
key: 'newItem',
text: 'New'
},
{
key: 'divider_1',
itemType: ContextualMenuItemType.Divider
},
{
key: 'rename',
text: 'Rename'
},
{
key: 'edit',
text: 'Edit'
},
{
key: 'properties',
text: 'Properties'
},
{
key: 'disabled',
text: 'Disabled item',
disabled: true
}
],
contextualMenuItemAs: function (props) { return React.createElement("div", null,
"Custom rendered ",
props.item.text); }
} })));
};
return ContextualMenuWithCustomMenuItemExample;
}(React.Component));
export { ContextualMenuWithCustomMenuItemExample };
//# sourceMappingURL=ContextualMenu.CustomMenuItem.Example.js.map