UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

36 lines 1.48 kB
import * as tslib_1 from "tslib"; import * as React from 'react'; import { BaseComponent, autobind, css } from '../../Utilities'; import { Link } from '../../Link'; import { GroupSpacer } from './GroupSpacer'; import * as stylesImport from './GroupShowAll.scss'; var styles = stylesImport; var GroupShowAll = /** @class */ (function (_super) { tslib_1.__extends(GroupShowAll, _super); function GroupShowAll() { return _super !== null && _super.apply(this, arguments) || this; } GroupShowAll.prototype.render = function () { var _a = this.props, group = _a.group, groupLevel = _a.groupLevel, showAllLinkText = _a.showAllLinkText; if (group) { return (React.createElement("div", { className: css('ms-groupFooter', styles.root) }, GroupSpacer({ count: groupLevel }), React.createElement(Link, { onClick: this._onSummarizeClick }, showAllLinkText))); } return null; }; GroupShowAll.prototype._onSummarizeClick = function (ev) { this.props.onToggleSummarize(this.props.group); ev.stopPropagation(); ev.preventDefault(); }; GroupShowAll.defaultProps = { showAllLinkText: 'Show All' }; tslib_1.__decorate([ autobind ], GroupShowAll.prototype, "_onSummarizeClick", null); return GroupShowAll; }(BaseComponent)); export { GroupShowAll }; //# sourceMappingURL=GroupShowAll.js.map