define(["require", "exports", "tslib", "react", "../../Utilities", "../../FocusZone", "./OverflowSet.scss"], function (require, exports, tslib_1, React, Utilities_1, FocusZone_1, stylesImport) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var styles = stylesImport;
    var OverflowSet = /** @class */ (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, className = _a.className, focusZoneProps = _a.focusZoneProps, _b = _a.role, role = _b === void 0 ? 'menubar' : _b;
            return (React.createElement(FocusZone_1.FocusZone, tslib_1.__assign({}, focusZoneProps, { componentRef: this._resolveRef('_focusZone'), className: Utilities_1.css('ms-OverflowSet', styles.root, className), direction: FocusZone_1.FocusZoneDirection.horizontal, role: role }),
                items && this._onRenderItems(items),
                overflowItems && overflowItems.length > 0 && onRenderOverflowButton(overflowItems)));
        };
        OverflowSet.prototype.focus = function () {
            if (this._focusZone) {
                this._focusZone.focus();
            }
        };
        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)));
            });
        };
        tslib_1.__decorate([
            Utilities_1.autobind
        ], OverflowSet.prototype, "_onRenderItems", null);
        return OverflowSet;
    }(Utilities_1.BaseComponent));
    exports.OverflowSet = OverflowSet;
});
//# sourceMappingURL=OverflowSet.js.map