"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SearchBar = void 0;
var React = require("react");
var SearchBar = /** @class */ (function (_super) {
    __extends(SearchBar, _super);
    function SearchBar(props) {
        var _this = _super.call(this, props) || this;
        _this.setRef = function (element) {
            if (_this.props.resolveFocus) {
                _this.props.resolveFocus(element || undefined);
            }
        };
        _this.handleFilterTextChange = _this.handleFilterTextChange.bind(_this);
        return _this;
    }
    SearchBar.prototype.render = function () {
        return React.createElement("input", { ref: this.setRef, className: "theia-input " + SearchBar.Styles.SEARCH_BAR_CLASS, type: 'text', placeholder: 'Filter your search...', size: 1, value: this.props.filterText, onChange: this.handleFilterTextChange });
    };
    SearchBar.prototype.handleFilterTextChange = function (event) {
        this.props.onFilterTextChanged(event.target.value);
    };
    return SearchBar;
}(React.Component));
exports.SearchBar = SearchBar;
(function (SearchBar) {
    var Styles;
    (function (Styles) {
        Styles.SEARCH_BAR_CLASS = 'search-bar';
    })(Styles = SearchBar.Styles || (SearchBar.Styles = {}));
})(SearchBar = exports.SearchBar || (exports.SearchBar = {}));
exports.SearchBar = SearchBar;
//# sourceMappingURL=search-bar.js.map