"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ListBoxFilterSortComponent = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const Enums_1 = require("../../../AdaptableState/Common/Enums");
const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
const FieldWrap_1 = tslib_1.__importDefault(require("../../../components/FieldWrap"));
class ListBoxFilterSortComponent extends React.Component {
    render() {
        return (React.createElement(FieldWrap_1.default, { className: "ab-SingleListBoxFilter", style: {
                borderTop: 0,
                borderRight: 0,
                borderLeft: 0,
                borderRadius: 0,
                padding: 2 /* here just for the focus box-shadow to be visible*/,
            } },
            React.createElement(Input_1.default, { value: this.props.FilterValue, placeholder: "Search", onChange: (e) => this.handleChangeFilterValue(e), style: { width: 0 } }),
            React.createElement(SimpleButton_1.default, { disabled: !this.props.FilterValue, onClick: () => this.clearFilter(), icon: "close", variant: "text" }),
            this.props.SortOrder == Enums_1.SortOrder.Asc ? (React.createElement(SimpleButton_1.default, { onClick: () => this.props.sortColumnValues(), icon: "sort-asc", variant: "text" })) : (React.createElement(SimpleButton_1.default, { onClick: () => this.props.sortColumnValues(), icon: "sort-desc", variant: "text" }))));
    }
    handleChangeFilterValue(x) {
        let e = x.target;
        this.props.handleChangeFilterValue(e.value);
    }
    clearFilter() {
        this.props.handleChangeFilterValue('');
    }
}
exports.ListBoxFilterSortComponent = ListBoxFilterSortComponent;
