UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

36 lines 1.52 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var React = require("react"); var Utilities_1 = require("../../Utilities"); var Link_1 = require("../../Link"); var GroupSpacer_1 = require("./GroupSpacer"); var stylesImport = require("./GroupShowAll.scss"); var styles = stylesImport; var GroupShowAll = /** @class */ (function (_super) { tslib_1.__extends(GroupShowAll, _super); function GroupShowAll() { var _this = _super !== null && _super.apply(this, arguments) || this; _this._onSummarizeClick = function (ev) { _this.props.onToggleSummarize(_this.props.group); ev.stopPropagation(); ev.preventDefault(); }; return _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: Utilities_1.css('ms-groupFooter', styles.root) }, GroupSpacer_1.GroupSpacer({ count: groupLevel }), React.createElement(Link_1.Link, { onClick: this._onSummarizeClick }, showAllLinkText))); } return null; }; GroupShowAll.defaultProps = { showAllLinkText: 'Show All' }; return GroupShowAll; }(Utilities_1.BaseComponent)); exports.GroupShowAll = GroupShowAll; //# sourceMappingURL=GroupShowAll.js.map