UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

33 lines 1.91 kB
import * as tslib_1 from "tslib"; // @codepen import * as React from 'react'; import { Breadcrumb } from 'office-ui-fabric-react/lib/Breadcrumb'; var BreadcrumbStaticExample = /** @class */ (function (_super) { tslib_1.__extends(BreadcrumbStaticExample, _super); function BreadcrumbStaticExample() { var _this = _super !== null && _super.apply(this, arguments) || this; _this._onBreadcrumbItemClicked = function (ev, item) { console.log("Breadcrumb item with key \"" + item.key + "\" has been clicked."); }; return _this; } BreadcrumbStaticExample.prototype.render = function () { return (React.createElement("div", { style: { display: 'inline-block' } }, React.createElement(Breadcrumb, { items: [ { text: 'Files', key: 'Files', onClick: this._onBreadcrumbItemClicked }, { text: 'This is folder 1', key: 'f1', onClick: this._onBreadcrumbItemClicked }, { text: 'This is folder 2', key: 'f2', onClick: this._onBreadcrumbItemClicked }, { text: 'This is folder 3', key: 'f3', onClick: this._onBreadcrumbItemClicked }, { text: 'This is folder 4', key: 'f4', onClick: this._onBreadcrumbItemClicked }, { text: 'This is folder 5', key: 'f5', onClick: this._onBreadcrumbItemClicked, isCurrentItem: true } ], // Returning undefined to OnReduceData tells the breadcrumb not to shrink onReduceData: this._returnUndefined, maxDisplayedItems: 3, ariaLabel: 'Website breadcrumb' }))); }; BreadcrumbStaticExample.prototype._returnUndefined = function () { return undefined; }; return BreadcrumbStaticExample; }(React.Component)); export { BreadcrumbStaticExample }; //# sourceMappingURL=Breadcrumb.Static.Example.js.map