"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var Utilities_1 = require("../../Utilities");
var FocusZone_1 = require("../../FocusZone");
var stylesImport = require("./OverflowSet.scss");
var styles = stylesImport;
var OverflowSet = (function (_super) {
    tslib_1.__extends(OverflowSet, _super);
    function OverflowSet() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    OverflowSet.prototype.render = function () {
        var _a = this.props, items = _a.items, overflowItems = _a.overflowItems, onRenderOverflowButton = _a.onRenderOverflowButton;
        return (React.createElement(FocusZone_1.FocusZone, { className: Utilities_1.css('ms-OverflowSet', styles.root), direction: FocusZone_1.FocusZoneDirection.horizontal, role: 'menubar' },
            items && this._onRenderItems(items),
            overflowItems && overflowItems.length > 0 && onRenderOverflowButton(overflowItems)));
    };
    OverflowSet.prototype._onRenderItems = function (items) {
        var _this = this;
        return items.map(function (item, i) {
            var wrapperDivProps = { className: Utilities_1.css('ms-OverflowSet-item', styles.item) };
            if (item.key) {
                wrapperDivProps.key = item.key;
            }
            return (React.createElement("div", tslib_1.__assign({}, wrapperDivProps), _this.props.onRenderItem(item)));
        });
    };
    return OverflowSet;
}(Utilities_1.BaseComponent));
tslib_1.__decorate([
    Utilities_1.autobind
], OverflowSet.prototype, "_onRenderItems", null);
exports.OverflowSet = OverflowSet;

//# sourceMappingURL=OverflowSet.js.map
