dist/components/MTableFilterRow/index.js
/**
 * MTableFilterRow is the row that is shown when `MaterialTable.options.filtering` is true.
 * This component allows you to provide a custom filtering algo or allow/disallow filtering for a column.
 *
 * THIS MUST BE EXPORTED (on top of the 'default' export)
 */
MTableFilterRow is the row that is shown when `MaterialTable.options.filtering` is true.
This component allows you to provide a custom filtering algo or allow/disallow filtering for a column.

THIS MUST BE EXPORTED (on top of the 'default' export)
MTableFilterRow is the row that is shown when ` MaterialTable . options . filtering ` is true . This component allows you to provide a custom filtering algo or allow / disallow filtering for a column . THIS MUST BE EXPORTED ( on top of the ' default ' export )
function MTableFilterRow(props) {
  function getComponentForColumn(columnDef) {
    if (columnDef.filtering === false) {
      return null;
    }
    if (columnDef.field || columnDef.customFilterAndSearch) {
      if (columnDef.filterComponent) {
        return  _react['default'].createElement(
          _Filter['default'],
          (0, _extends2['default'])(
            {
              columnDef: columnDef
            },
            props
          )
        );
      } else if (columnDef.lookup) {
        return  _react['default'].createElement(
          _LookupFilter['default'],
          (0, _extends2['default'])(
            {
              columnDef: columnDef
            },
            props
          )
        );
      } else if (columnDef.type === 'boolean') {
        return  _react['default'].createElement(
          _BooleanFilter['default'],
          (0, _extends2['default'])(
            {
              columnDef: columnDef
            },
            props
          )
        );
      } else if (['date', 'datetime', 'time'].includes(columnDef.type)) {
        return  _react['default'].createElement(
          _DateFilter['default'],
          (0, _extends2['default'])(
            {
              columnDef: columnDef
            },
            props
          )
        );
      } else {
        return  _react['default'].createElement(
          _DefaultFilter['default'],
          (0, _extends2['default'])(
            {
              columnDef: columnDef
            },
            props
          )
        );
      }
    }
  }
  function render() {
    var columns = props.columns
      .filter(function (columnDef) {
        return !columnDef.hidden && !(columnDef.tableData.groupOrder > -1);
      })
      .sort(function (a, b) {
        return a.tableData.columnOrder - b.tableData.columnOrder;
      })
      .map(function (columnDef) {
        return  _react['default'].createElement(
          _core.TableCell,
          {
            key: columnDef.tableData.id,
            style: _objectSpread(
              _objectSpread({}, props.filterCellStyle),
              columnDef.filterCellStyle
            )
          },
          getComponentForColumn(columnDef)
        );
      });
    if (props.selection) {
      columns.splice(
        0,
        0,
         _react['default'].createElement(_core.TableCell, {
          padding: 'none',
          key: 'key-selection-column'
        })
      );
    }
    if (props.hasActions) {
      if (props.actionsColumnIndex === -1) {
        columns.push(
           _react['default'].createElement(_core.TableCell, {
            key: 'key-action-column'
          })
        );
      } else {
        var endPos = 0;
        if (props.selection) {
          endPos = 1;
        }
        columns.splice(
          props.actionsColumnIndex + endPos,
          0,
           _react['default'].createElement(_core.TableCell, {
            key: 'key-action-column'
          })
        );
      }
    }
    if (props.hasDetailPanel) {
      var alignment = props.detailPanelColumnAlignment;
      var index = alignment === 'left' ? 0 : columns.length;
      columns.splice(
        index,
        0,
         _react['default'].createElement(_core.TableCell, {
          padding: 'none',
          key: 'key-detail-panel-column'
        })
      );
    }
    if (props.isTreeData > 0) {
      columns.splice(
        0,
        0,
         _react['default'].createElement(_core.TableCell, {
          padding: 'none',
          key: 'key-tree-data-filter'
        })
      );
    }
    props.columns
      .filter(function (columnDef) {
        return columnDef.tableData.groupOrder > -1;
      })
      .forEach(function (columnDef) {
        columns.splice(
          0,
          0,
           _react['default'].createElement(_core.TableCell, {
            padding: 'checkbox',
            key: 'key-group-filter' + columnDef.tableData.id
          })
        );
      });
    return  _react['default'].createElement(
      _core.TableRow,
      {
        id: 'm--table--filter--row',
        ref: props.forwardedRef,
        style: _objectSpread(
          {
            height: 10
          },
          props.filterRowStyle
        )
      },
      columns
    );
  }
  return render();
}
function MTableFilterRow ( props ) { function getComponentForColumn ( columnDef ) { if ( columnDef . filtering === false ) { return null ; } if ( columnDef . field || columnDef . customFilterAndSearch ) { if ( columnDef . filterComponent ) { return _react [ 'default' ] . createElement ( _Filter [ 'default' ] , ( 0 , _extends2 [ 'default' ] ) ( { columnDef : columnDef } , props ) ) ; } else if ( columnDef . lookup ) { return _react [ 'default' ] . createElement ( _LookupFilter [ 'default' ] , ( 0 , _extends2 [ 'default' ] ) ( { columnDef : columnDef } , props ) ) ; } else if ( columnDef . type === 'boolean' ) { return _react [ 'default' ] . createElement ( _BooleanFilter [ 'default' ] , ( 0 , _extends2 [ 'default' ] ) ( { columnDef : columnDef } , props ) ) ; } else if ( [ 'date' , 'datetime' , 'time' ] . includes ( columnDef . type ) ) { return _react [ 'default' ] . createElement ( _DateFilter [ 'default' ] , ( 0 , _extends2 [ 'default' ] ) ( { columnDef : columnDef } , props ) ) ; } else { return _react [ 'default' ] . createElement ( _DefaultFilter [ 'default' ] , ( 0 , _extends2 [ 'default' ] ) ( { columnDef : columnDef } , props ) ) ; } } } function render ( ) { var columns = props . columns . filter ( function ( columnDef ) { return ! columnDef . hidden && ! ( columnDef . tableData . groupOrder > - 1 ) ; } ) . sort ( function ( a , b ) { return a . tableData . columnOrder - b . tableData . columnOrder ; } ) . map ( function ( columnDef ) { return _react [ 'default' ] . createElement ( _core . TableCell , { key : columnDef . tableData . id , style : _objectSpread ( _objectSpread ( { } , props . filterCellStyle ) , columnDef . filterCellStyle ) } , getComponentForColumn ( columnDef ) ) ; } ) ; if ( props . selection ) { columns . splice ( 0 , 0 , _react [ 'default' ] . createElement ( _core . TableCell , { padding : 'none' , key : 'key-selection-column' } ) ) ; } if ( props . hasActions ) { if ( props . actionsColumnIndex === - 1 ) { columns . push ( _react [ 'default' ] . createElement ( _core . TableCell , { key : 'key-action-column' } ) ) ; } else { var endPos = 0 ; if ( props . selection ) { endPos = 1 ; } columns . splice ( props . actionsColumnIndex + endPos , 0 , _react [ 'default' ] . createElement ( _core . TableCell , { key : 'key-action-column' } ) ) ; } } if ( props . hasDetailPanel ) { var alignment = props . detailPanelColumnAlignment ; var index = alignment === 'left' ? 0 : columns . length ; columns . splice ( index , 0 , _react [ 'default' ] . createElement ( _core . TableCell , { padding : 'none' , key : 'key-detail-panel-column' } ) ) ; } if ( props . isTreeData > 0 ) { columns . splice ( 0 , 0 , _react [ 'default' ] . createElement ( _core . TableCell , { padding : 'none' , key : 'key-tree-data-filter' } ) ) ; } props . columns . filter ( function ( columnDef ) { return columnDef . tableData . groupOrder > - 1 ; } ) . forEach ( function ( columnDef ) { columns . splice ( 0 , 0 , _react [ 'default' ] . createElement ( _core . TableCell , { padding : 'checkbox' , key : 'key-group-filter' + columnDef . tableData . id } ) ) ; } ) ; return _react [ 'default' ] . createElement ( _core . TableRow , { id : 'm--table--filter--row' , ref : props . forwardedRef , style : _objectSpread ( { height : 10 } , props . filterRowStyle ) } , columns ) ; } return render ( ) ; }
MTableFilterRow is the row that is shown when `MaterialTable.options.filtering` is true.
MTableFilterRow is the row that is shown when ` MaterialTable . options . filtering ` is true .
/*#__PURE__*/ /*#__PURE__*/ /*#__PURE__*/ /*#__PURE__*/ /*#__PURE__*/ /*#__PURE__*/ /*#__PURE__*/ /*#__PURE__*/ /*#__PURE__*/ /*#__PURE__*/ /*#__PURE__*/ /*#__PURE__*/ /*#__PURE__*/