"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var Utilities_1 = require("office-ui-fabric-react/lib/Utilities");
var Button_1 = require("office-ui-fabric-react/lib/Button");
var ResizeGroup_1 = require("office-ui-fabric-react/lib/ResizeGroup");
var OverflowSet_1 = require("../../OverflowSet");
var stylesImport = require("./ResizeGroup.Example.scss");
var styles = stylesImport;
var data_1 = require("./data");
var ResizeGroupOverflowSetExample = (function (_super) {
    tslib_1.__extends(ResizeGroupOverflowSetExample, _super);
    function ResizeGroupOverflowSetExample(props) {
        var _this = _super.call(this, props) || this;
        _this.state = {
            short: false
        };
        return _this;
    }
    ResizeGroupOverflowSetExample.prototype.render = function () {
        return (React.createElement("div", { className: this.state.short ? styles.resizeIsShort : 'notResized' },
            React.createElement(ResizeGroup_1.ResizeGroup, { data: data_1.data, onReduceData: function (currentdata) {
                    if (currentdata.primary.length === 0) {
                        return undefined;
                    }
                    var overflow = currentdata.overflow.concat(currentdata.primary.slice(-1));
                    var primary = currentdata.primary.slice(0, -1);
                    return { primary: primary, overflow: overflow };
                }, onRenderData: function (data) {
                    return (React.createElement(OverflowSet_1.OverflowSet, { items: data.primary, overflowItems: data.overflow.length ? data.overflow : null, onRenderItem: function (item) {
                            return (React.createElement(Button_1.DefaultButton, { text: item.name, iconProps: { iconName: item.icon }, onClick: item.onClick }));
                        }, onRenderOverflowButton: function (overflowItems) {
                            return (React.createElement(Button_1.DefaultButton, { menuProps: { items: overflowItems } }));
                        } }));
                } })));
    };
    return ResizeGroupOverflowSetExample;
}(Utilities_1.BaseComponent));
exports.ResizeGroupOverflowSetExample = ResizeGroupOverflowSetExample;

//# sourceMappingURL=ResizeGroup.OverflowSet.Example.js.map
