"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var Link_1 = require("office-ui-fabric-react/lib/Link");
var DetailsList_1 = require("office-ui-fabric-react/lib/DetailsList");
var exampleData_1 = require("../../../utilities/exampleData");
require("./DetailsListExample.scss");
var ITEMS_PER_GROUP = 20;
var GROUP_COUNT = 20;
var _items;
var _groups;
var DetailsListCustomGroupHeadersExample = /** @class */ (function (_super) {
    tslib_1.__extends(DetailsListCustomGroupHeadersExample, _super);
    function DetailsListCustomGroupHeadersExample(props) {
        var _this = _super.call(this, props) || this;
        _items = _items || exampleData_1.createListItems(500);
        _groups = _groups || exampleData_1.createGroups(GROUP_COUNT, 1, 0, ITEMS_PER_GROUP);
        return _this;
    }
    DetailsListCustomGroupHeadersExample.prototype.render = function () {
        var _this = this;
        return (React.createElement("div", null,
            React.createElement(DetailsList_1.DetailsList, { items: _items, groups: _groups, groupProps: {
                    onRenderHeader: function (props) { return (React.createElement("div", { className: "DetailsListExample-customHeader" },
                        React.createElement("div", { className: "DetailsListExample-customHeaderTitle" }, "I am a custom header for: " + props.group.name),
                        React.createElement("div", { className: "DetailsListExample-customHeaderLinkSet" },
                            React.createElement(Link_1.Link, { className: "DetailsListExample-customHeaderLink", onClick: _this._onToggleSelectGroup(props) }, props.isSelected ? 'Remove selection' : 'Select group'),
                            React.createElement(Link_1.Link, { className: "DetailsListExample-customHeaderLink", onClick: _this._onToggleCollapse(props) }, props.group.isCollapsed ? 'Expand group' : 'Collapse group')))); },
                    onRenderFooter: function (props) { return (React.createElement("div", { className: "DetailsListExample-customHeader" },
                        React.createElement("div", { className: "DetailsListExample-customHeaderTitle" }, "I'm a custom footer for: " + props.group.name))); }
                } })));
    };
    DetailsListCustomGroupHeadersExample.prototype._onToggleSelectGroup = function (props) {
        return function () {
            props.onToggleSelectGroup(props.group);
        };
    };
    DetailsListCustomGroupHeadersExample.prototype._onToggleCollapse = function (props) {
        return function () {
            props.onToggleCollapse(props.group);
        };
    };
    return DetailsListCustomGroupHeadersExample;
}(React.Component));
exports.DetailsListCustomGroupHeadersExample = DetailsListCustomGroupHeadersExample;
//# sourceMappingURL=DetailsList.CustomGroupHeaders.Example.js.map