title: Conditional onSelectAll in react-bootstrap-table-next?
body: <p>I am trying to implement conditional select and selectAll in <code>react-bootstrap-table-next</code>.
  Meaning I want to disable the <code>selectRow</code> elements when a condition is true.</p>
  <h3>Case:</h3>
  <p>A user uploads a file - <code>file has an Upload DateTime</code> - They shouldn't be allowed to Delete the file unless 15 minutes has passed by.</p>
  <h3>Logic:</h3>
  <p><code>moment() &gt;= moment(row.upload_date).add(15, 'minutes')</code></p>
  <h3>UI Implementation:</h3>
  <p><a href="https://i.stack.imgur.com/iYiPY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iYiPY.png" alt="enter image description here" /></a></p>
  <h3><code>selectRow</code> defenition:</h3>
  <pre><code>const selectRow = {
  mode: &quot;checkbox&quot;,
  selected: selectedFiles.id,
  onSelect: (row, isSelect, rowIndex, e) =&gt; {
    if ( moment() &gt;= moment(row.upload_date).add(15, 'minutes')) {
      handleOnSelect(row, isSelect);
    } else {
      return false;
    }
  },
  onSelectAll:(rows, isSelected) =&gt; {
    if(isSelected) {
      for(let i = 0 ; i &lt; rows.length ; i++){
        if (moment() &gt;= moment(rows[i].upload_date).add(15, 'minutes')){
          handleOnSelectAll(rows[i], isSelected);
        } else {
          return false;
        }
      }
    } else {
      return false;
    }
  },
  selectionHeaderRenderer: ({ indeterminate, ...rest }) =&gt; (
    &lt;Form.Check
      custom
      type=&quot;checkbox&quot;
      label={(&lt;&gt;&lt;/&gt;)}
      ref={ (input) =&gt; {
        if (input) input.indeterminate = indeterminate;
      } }
      { ...rest }
    /&gt;
  ),
  selectionRenderer: ({ mode ,...rest }) =&gt; (
      &lt;Form.Check 
        custom
        type=&quot;checkbox&quot;
        label={(&lt;&gt;&lt;/&gt;)}
        type={ mode } { ...rest } 
      /&gt;
  )
  };
  </code></pre>
  <h3><code>handleOnSelect</code> implementation:</h3>
  <pre><code>const handleOnSelect = (row, isSelect) =&gt; {
  // Selected file
  if (isSelect) {
    if (
      !selectedFiles.length ||
      (selectedFiles.length &amp;&amp; selectedFiles[0].id !== row.id)
    ) {
      setSelectedFiles([...selectedFiles, row]);
    }
  }
  // Deselected file
  else {
    setSelectedFiles(selectedFiles.filter((x) =&gt; x.id !== row.id));
  }
  };
  </code></pre>
  <p><code>handleOnSelect</code> is working fine.
  <a href="https://i.stack.imgur.com/oIrmw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oIrmw.png" alt="enter image description here" /></a></p>
  <h3><code>handleOnSelectAll</code> implementation:</h3>
  <pre><code>const handleOnSelectAll = (isSelected, rows) =&gt; {
  console.log(rows)
  let files = rows.map((r) =&gt; r);
  console.log(files)
  // Selected all files
  if (isSelected) {
    setSelectedFiles(files);
  }
  // Deselected all files
  else {
    setSelectedFiles([]);
  }
  };
  </code></pre>
  <p><code>handleOnSelectAll</code> isn't working as expected.
  <a href="https://i.stack.imgur.com/r20uh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r20uh.png" alt="enter image description here" /></a></p>
  <p>When we click on select all it should not check the file which is recently uploaded.
  I have referred to <a href="https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/row-select-props.html#selectrowonselectall-function" rel="nofollow noreferrer">react-bootstrap-table-next</a> API documentation but I am failing to implement that.</p>
  <p>Please guide me, Thanks</p>