"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var index_1 = require("office-ui-fabric-react/lib/components/GroupedList/index");
var Utilities_1 = require("office-ui-fabric-react/lib/Utilities");
var Link_1 = require("office-ui-fabric-react/lib/Link");
var example_app_base_1 = require("@uifabric/example-app-base");
var Styling_1 = require("../../../Styling");
require("./GroupedList.Custom.Example.scss");
var _items;
var _groups;
var GroupedListCustomExample = (function (_super) {
    tslib_1.__extends(GroupedListCustomExample, _super);
    function GroupedListCustomExample() {
        var _this = _super.call(this) || this;
        _items = _items || example_app_base_1.createListItems(20);
        _groups = example_app_base_1.createGroups(4, 0, 0, 5);
        return _this;
    }
    GroupedListCustomExample.prototype.render = function () {
        return (React.createElement(index_1.GroupedList, { ref: 'groupedList', items: _items, onRenderCell: this._onRenderCell, groupProps: {
                onRenderHeader: this._onRenderHeader,
                onRenderFooter: this._onRenderFooter
            }, groups: _groups }));
    };
    GroupedListCustomExample.prototype._onRenderCell = function (nestingDepth, item, itemIndex) {
        return (React.createElement("div", { "data-selection-index": itemIndex },
            React.createElement("span", { className: 'ms-GroupedListExample-name' }, item.name)));
    };
    GroupedListCustomExample.prototype._onRenderHeader = function (props) {
        var toggleCollapse = function () {
            props.onToggleCollapse(props.group);
        };
        return (React.createElement("div", { className: Utilities_1.css('ms-GroupedListExample-header', Styling_1.FontClassNames.xLarge) },
            "This is a custom header for ",
            props.group.name,
            "\u00A0 (",
            React.createElement(Link_1.Link, { onClick: toggleCollapse }, props.group.isCollapsed ? 'Expand' : 'Collapse'),
            ")"));
    };
    GroupedListCustomExample.prototype._onRenderFooter = function (props) {
        return (React.createElement("div", { className: Utilities_1.css('ms-GroupedListExample-footer', Styling_1.FontClassNames.large) },
            "This is a custom footer for ",
            props.group.name));
    };
    return GroupedListCustomExample;
}(React.Component));
exports.GroupedListCustomExample = GroupedListCustomExample;
//# sourceMappingURL=GroupedList.Custom.Example.js.map