content: /* eslint max-len: 0 */
  /* eslint no-unused-vars: 0 */
  /* eslint no-alert: 0 */
  import React from 'react';
  import ReactDOM from 'react-dom';
  import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
  
  
  const products = [];
  
  function addProducts(quantity) {
    const startId = products.length;
    for (let i = 0; i < quantity; i++) {
      const id = startId + i;
      products.push({
        id: id,
        name: 'Item name ' + id,
        price: 2100 + i
      });
    }
  }
  
  addProducts(5);
  
  class MySearchField extends React.Component {
    // It's necessary to implement getValue
    getValue() {
      return ReactDOM.findDOMNode(this).value;
    }
  
    // It's necessary to implement setValue
    setValue(value) {
      ReactDOM.findDOMNode(this).value = value;
    }
  
    render() {
      return (
        <input
          className={ `form-control` }
          type='text'
          defaultValue={ this.props.defaultValue }
          placeholder={ this.props.placeholder }
          onKeyUp={ this.props.search }/>
      );
    }
  }
  
  
  export default class FullyCustomSearchFieldTable extends React.Component {
  
    render() {
      const options = {
        clearSearch: true,
        searchField: (props) => (<MySearchField { ...props }/>)
      };
      return (
        <BootstrapTable data={ products } options={ options } search>
          <TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn>
          <TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
          <TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
        </BootstrapTable>
      );
    }
  }
  