"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var Utilities_1 = require("../../Utilities");
var ComboBox_1 = require("./ComboBox");
var List_1 = require("../../List");
var VirtualizedComboBox = /** @class */ (function (_super) {
    tslib_1.__extends(VirtualizedComboBox, _super);
    function VirtualizedComboBox() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    VirtualizedComboBox.prototype.render = function () {
        return (React.createElement(ComboBox_1.ComboBox, tslib_1.__assign({}, this.props, { onRenderList: this._onRenderList, onScrollToItem: this._onScrollToItem })));
    };
    VirtualizedComboBox.prototype._onRenderList = function (props) {
        var onRenderItem = props.onRenderItem;
        // Render virtualized list
        return (React.createElement(List_1.List, { componentRef: this._resolveRef('_list'), role: 'listbox', items: props.options, onRenderCell: onRenderItem ? function (item) { return onRenderItem(item); } : function () { return null; } }));
    };
    VirtualizedComboBox.prototype._onScrollToItem = function (itemIndex) {
        // We are using the List component, call scrollToIndex
        this._list.scrollToIndex(itemIndex);
    };
    tslib_1.__decorate([
        Utilities_1.autobind
    ], VirtualizedComboBox.prototype, "_onRenderList", null);
    return VirtualizedComboBox;
}(Utilities_1.BaseComponent));
exports.VirtualizedComboBox = VirtualizedComboBox;
//# sourceMappingURL=VirtualizedComboBox.js.map