office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
41 lines • 3.42 kB
JavaScript
define(["require", "exports", "tslib", "react", "office-ui-fabric-react/lib/Breadcrumb", "../../../Utilities", "office-ui-fabric-react/lib/Label", "../../../common/_exampleStyles.scss"], function (require, exports, tslib_1, React, Breadcrumb_1, Utilities_1, Label_1, exampleStylesImport) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var exampleStyles = exampleStylesImport;
var BreadcrumbBasicExample = /** @class */ (function (_super) {
tslib_1.__extends(BreadcrumbBasicExample, _super);
function BreadcrumbBasicExample(props) {
return _super.call(this, props) || this;
}
BreadcrumbBasicExample.prototype.render = function () {
return (React.createElement("div", null,
React.createElement(Label_1.Label, { className: exampleStyles.exampleLabel }, "With no maxDisplayedItems"),
React.createElement(Breadcrumb_1.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 }
], ariaLabel: 'Website breadcrumb' }),
React.createElement(Label_1.Label, { className: exampleStyles.exampleLabel, style: { marginTop: '24px' } }, "With maxDisplayedItems set to three"),
React.createElement(Breadcrumb_1.Breadcrumb, { items: [
{ text: 'Files', 'key': 'Files', href: '#/examples/breadcrumb', onClick: this._onBreadcrumbItemClicked },
{ text: 'This is link 1', 'key': 'l1', href: '#/examples/breadcrumb', onClick: this._onBreadcrumbItemClicked },
{ text: 'This is link 2', 'key': 'l2', href: '#/examples/breadcrumb', onClick: this._onBreadcrumbItemClicked },
{ text: 'This is link 3 with a long name', 'key': 'l3', href: '#/examples/breadcrumb', onClick: this._onBreadcrumbItemClicked },
{ text: 'This is link 4', 'key': 'l4', href: '#/examples/breadcrumb', onClick: this._onBreadcrumbItemClicked },
{ text: 'This is link 5', 'key': 'l5', href: '#/examples/breadcrumb', onClick: this._onBreadcrumbItemClicked, isCurrentItem: true }
], maxDisplayedItems: 3, ariaLabel: 'Website breadcrumb' })));
};
BreadcrumbBasicExample.prototype._onBreadcrumbItemClicked = function (ev, item) {
console.log("Breadcrumb item with key \"" + item.key + "\" has been clicked.");
};
tslib_1.__decorate([
Utilities_1.autobind
], BreadcrumbBasicExample.prototype, "_onBreadcrumbItemClicked", null);
return BreadcrumbBasicExample;
}(React.Component));
exports.BreadcrumbBasicExample = BreadcrumbBasicExample;
});
//# sourceMappingURL=Breadcrumb.Basic.Example.js.map