import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Const from './Const'; import classSet from 'classnames'; class TableFilter extends Component { constructor(props) { super(props); this.filterObj = {}; } handleKeyUp = e => { const { value, name } = e.currentTarget; if (value.trim() === '') { delete this.filterObj[name]; } else { this.filterObj[name] = value; } this.props.onFilter(this.filterObj); } render() { const { striped, condensed, rowSelectType, columns } = this.props; const tableClasses = classSet('table', { 'table-striped': striped, 'table-condensed': condensed }); let selectRowHeader = null; if (rowSelectType === Const.ROW_SELECT_SINGLE || rowSelectType === Const.ROW_SELECT_MULTI) { const style = { width: 35, paddingLeft: 0, paddingRight: 0 }; selectRowHeader = (