"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupedListCustomExample = void 0;
var React = require("react");
var GroupedList_1 = require("@fluentui/react/lib-commonjs/GroupedList");
var Link_1 = require("@fluentui/react/lib-commonjs/Link");
var example_data_1 = require("@fluentui/example-data");
var Styling_1 = require("@fluentui/react/lib-commonjs/Styling");
var theme = Styling_1.getTheme();
var headerAndFooterStyles = {
    minWidth: 300,
    minHeight: 40,
    lineHeight: 40,
    paddingLeft: 16,
};
var classNames = Styling_1.mergeStyleSets({
    header: [headerAndFooterStyles, theme.fonts.xLarge],
    footer: [headerAndFooterStyles, theme.fonts.large],
    name: {
        display: 'inline-block',
        overflow: 'hidden',
        height: 24,
        cursor: 'default',
        padding: 8,
        boxSizing: 'border-box',
        verticalAlign: 'top',
        background: 'none',
        backgroundColor: 'transparent',
        border: 'none',
        paddingLeft: 32,
    },
});
var onRenderHeader = function (props) {
    if (props) {
        var toggleCollapse = function () {
            props.onToggleCollapse(props.group);
        };
        return (React.createElement("div", { className: classNames.header },
            "This is a custom header for ",
            props.group.name,
            "\u00A0 (",
            React.createElement(Link_1.Link
            // eslint-disable-next-line react/jsx-no-bind
            , { 
                // eslint-disable-next-line react/jsx-no-bind
                onClick: toggleCollapse }, props.group.isCollapsed ? 'Expand' : 'Collapse'),
            ")"));
    }
    return null;
};
var onRenderCell = function (nestingDepth, item, itemIndex) {
    return item ? (React.createElement("div", { role: "row", "data-selection-index": itemIndex },
        React.createElement("span", { role: "cell", className: classNames.name }, item.name))) : null;
};
var onRenderFooter = function (props) {
    return props ? React.createElement("div", { className: classNames.footer },
        "This is a custom footer for ",
        props.group.name) : null;
};
var groupedListProps = {
    onRenderHeader: onRenderHeader,
    onRenderFooter: onRenderFooter,
};
var items = example_data_1.createListItems(20);
var groups = example_data_1.createGroups(4, 0, 0, 5);
var GroupedListCustomExample = function () { return (React.createElement(GroupedList_1.GroupedList, { items: items, onRenderCell: onRenderCell, groupProps: groupedListProps, groups: groups })); };
exports.GroupedListCustomExample = GroupedListCustomExample;
//# sourceMappingURL=GroupedList.Custom.Example.js.map