import * as React from 'react';
import { GroupedList } from '@fluentui/react/lib/GroupedList';
import { Link } from '@fluentui/react/lib/Link';
import { createListItems, createGroups } from '@fluentui/example-data';
import { getTheme, mergeStyleSets } from '@fluentui/react/lib/Styling';
var theme = getTheme();
var headerAndFooterStyles = {
    minWidth: 300,
    minHeight: 40,
    lineHeight: 40,
    paddingLeft: 16,
};
var classNames = 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
            // 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 = createListItems(20);
var groups = createGroups(4, 0, 0, 5);
export var GroupedListCustomExample = function () { return (React.createElement(GroupedList, { items: items, onRenderCell: onRenderCell, groupProps: groupedListProps, groups: groups })); };
//# sourceMappingURL=GroupedList.Custom.Example.js.map