UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

24 lines 1.51 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var React = require("react"); var CommandBar_1 = require("office-ui-fabric-react/lib/CommandBar"); var Button_1 = require("office-ui-fabric-react/lib/Button"); var CommandBarButtonAsExample = /** @class */ (function (_super) { tslib_1.__extends(CommandBarButtonAsExample, _super); function CommandBarButtonAsExample(props) { return _super.call(this, props) || this; } CommandBarButtonAsExample.prototype.render = function () { var customButton = function (props) { var buttonOnMouseEnter = function () { return console.log(props.text + " hovered"); }; return (React.createElement(Button_1.CommandBarButton, tslib_1.__assign({ onMouseEnter: buttonOnMouseEnter }, props, { styles: tslib_1.__assign({}, props.styles, { icon: { color: 'red' } }) }))); }; var _a = this.props, items = _a.items, overflowItems = _a.overflowItems, farItems = _a.farItems; return (React.createElement("div", null, React.createElement(CommandBar_1.CommandBar, { buttonAs: customButton, items: items, overflowItems: overflowItems, farItems: farItems, ariaLabel: 'Use left and right arrow keys to navigate between commands' }))); }; return CommandBarButtonAsExample; }(React.Component)); exports.CommandBarButtonAsExample = CommandBarButtonAsExample; //# sourceMappingURL=CommandBar.ButtonAs.Example.js.map