@castlabs/ui 4.20.3 → 4.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -830,12 +830,20 @@ function clTableSorter (sorter, initialCol = 0, initialOrder = 'ASC') {
830
830
  * @param dataCallback Function that returns the to-be-sorted object array.
831
831
  * @param keys Columns/keys in object to sort.
832
832
  * @param initialCol Initial column to sort for.
833
+ * @param pageNo Pagination page, zero-based.
834
+ * @param pageSize Pagination page size, defaults to 'one big page'.
833
835
  * @returns Object expeced by table sort.
834
836
  */
835
- function clTableSorterObjects (dataCallback, keys, initialCol = 0) {
837
+ function clTableSorterObjects (
838
+ dataCallback,
839
+ keys,
840
+ initialCol = 0,
841
+ pageNoCallback = () => 0,
842
+ pageSizeCallback = () => Number.MAX_SAFE_INTEGER
843
+ ) {
836
844
  return clTableSorter((col, order) => {
837
845
  return {
838
- sorted: clSort(dataCallback, keys[col], order),
846
+ sorted: clPaginate(clSort(dataCallback, keys[col], order), pageNoCallback(), pageSizeCallback()),
839
847
  sortedOrder: order
840
848
  }
841
849
  }, initialCol)