GetDKAN / data-catalog-components

https://getdkan.github.io/data-catalog-components
9 stars 6 forks source link

DataTable updates #158

Closed dgading closed 2 years ago

dgading commented 2 years ago

This PR adds some missing loading and no result features to the DataTable and DataTableResults section.

The DataTable gets 2 additional props and uses the loading state to show/hide the rows. The additional props allow for new components to be passed through to replace the default loading/no results jsx.

For the DataTablePageResults components there are two fixes:

  1. When on the last page of a dataset results, the limit was always applied to the offset, which could result in the display showing 11-20 out of 17. It will now show the total results if limit + offset is greater than total.
  2. When no total is passed, it will return 0-0 of 0 rows instead of 1-0 of 0 rows.