office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
88 lines • 4.11 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { DefaultButton, IconButton } from 'office-ui-fabric-react/lib/Button';
import { Panel, PanelType } from 'office-ui-fabric-react/lib/Panel';
import { getTheme, IconFontSizes } from 'office-ui-fabric-react/lib/Styling';
import { SearchBox } from 'office-ui-fabric-react/lib/SearchBox';
var PanelNavigationExample = /** @class */ (function (_super) {
tslib_1.__extends(PanelNavigationExample, _super);
function PanelNavigationExample(props) {
var _this = _super.call(this, props) || this;
_this._onClosePanel = function () {
_this.setState({ showPanel: false });
};
_this._onRenderNavigationContent = function (props, defaultRender) {
var theme = getTheme();
return (React.createElement(React.Fragment, null,
React.createElement(SearchBox, { placeholder: "Search here...", styles: {
root: {
margin: '5px',
height: 'auto',
width: '100%'
}
} }),
React.createElement(IconButton, { styles: {
root: {
height: 'auto',
width: '44px',
color: theme.palette.neutralSecondary,
fontSize: IconFontSizes.large
},
menuIcon: {
display: 'none'
},
rootHovered: {
color: theme.palette.neutralPrimary
}
}, menuProps: {
items: [
{
key: 'home',
text: 'Home',
iconProps: {
iconName: 'Home'
}
},
{
key: 'refresh',
text: 'Refresh',
iconProps: {
iconName: 'Refresh'
}
},
{
key: 'back',
text: 'Back',
iconProps: {
iconName: 'Back'
}
},
{
key: 'forward',
text: 'Forward',
iconProps: {
iconName: 'Forward'
}
}
]
}, "data-is-visible": true, iconProps: {
iconName: 'MoreVertical'
} }),
defaultRender(props)));
};
_this._onShowPanel = function () {
_this.setState({ showPanel: true });
};
_this.state = { showPanel: false };
return _this;
}
PanelNavigationExample.prototype.render = function () {
return (React.createElement("div", null,
React.createElement(DefaultButton, { secondaryText: "Opens the Sample Panel", onClick: this._onShowPanel, text: "Open Panel" }),
React.createElement(Panel, { isOpen: this.state.showPanel, type: PanelType.smallFixedFar, onDismiss: this._onClosePanel, isFooterAtBottom: true, headerText: "Panel with custom navigation content", closeButtonAriaLabel: "Close", onRenderNavigationContent: this._onRenderNavigationContent },
React.createElement("span", null, "Content goes here."))));
};
return PanelNavigationExample;
}(React.Component));
export { PanelNavigationExample };
//# sourceMappingURL=Panel.Navigation.Example.js.map