UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

22 lines 1.59 kB
define(["require", "exports", "tslib", "react", "office-ui-fabric-react/lib/CommandBar", "office-ui-fabric-react/lib/Button"], function (require, exports, tslib_1, React, CommandBar_1, Button_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 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