office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
56 lines (55 loc) • 2.62 kB
JavaScript
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
define(["require", "exports", 'react', '../../../../index', './Nav.Basic.Example.scss'], function (require, exports, React, index_1) {
"use strict";
var NavBasicExample = (function (_super) {
__extends(NavBasicExample, _super);
function NavBasicExample(props) {
_super.call(this, props);
this._onClickHandler = this._onClickHandler.bind(this);
}
NavBasicExample.prototype.render = function () {
return (React.createElement("div", {className: 'ms-NavExample-LeftPane'},
React.createElement(index_1.Nav, {groups: [
{
links: [
{
name: 'Home',
url: 'http://example.com',
links: [{
name: 'Activity',
url: 'http://msn.com'
},
{
name: 'News',
url: 'http://msn.com'
}],
isExpanded: true
},
{ name: 'Documents', url: 'http://example.com', isExpanded: true },
{ name: 'Pages', url: 'http://msn.com' },
{ name: 'Notebook', url: 'http://msn.com' },
{ name: 'Long Name Test for elipse', url: 'http://msn.com' },
{ name: 'Edit Link', url: 'http://example.com', iconClassName: 'ms-Icon--Edit' },
{
name: 'Edit',
url: '#',
onClick: this._onClickHandler,
icon: 'Edit'
}
]
}
], expandedStateText: 'expanded', collapsedStateText: 'collapsed'})
));
};
NavBasicExample.prototype._onClickHandler = function (e) {
alert('test');
return false;
};
return NavBasicExample;
}(React.Component));
exports.NavBasicExample = NavBasicExample;
});