import * as React from 'react';
import { SortOrder } from '../../../AdaptableState/Common/Enums';
import SimpleButton from '../../../components/SimpleButton';
import Input from '../../../components/Input';
import FieldWrap from '../../../components/FieldWrap';
export class ListBoxFilterSortComponent extends React.Component {
    render() {
        return (React.createElement(FieldWrap, { 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, { value: this.props.FilterValue, placeholder: "Search", onChange: (e) => this.handleChangeFilterValue(e), style: { width: 0 } }),
            React.createElement(SimpleButton, { disabled: !this.props.FilterValue, onClick: () => this.clearFilter(), icon: "close", variant: "text" }),
            this.props.SortOrder == SortOrder.Asc ? (React.createElement(SimpleButton, { onClick: () => this.props.sortColumnValues(), icon: "sort-asc", variant: "text" })) : (React.createElement(SimpleButton, { onClick: () => this.props.sortColumnValues(), icon: "sort-desc", variant: "text" }))));
    }
    handleChangeFilterValue(x) {
        let e = x.target;
        this.props.handleChangeFilterValue(e.value);
    }
    clearFilter() {
        this.props.handleChangeFilterValue('');
    }
}
