Skip to content

Changelog - @caspeco/casper-ui-library

Version 5.0.0

What’s Changed

Library changes

  • [BREAKING] UTF-1257 Update paginator by @MarcusCaspeco in https://github.com/Caspeco/casper-ui-library/pull/452

    Removed props:

    • localeString - renamed to locale
    • pageSizeOptions - no longer used
    • pageCount - calculated automatically, replaced by itemCount
    • canPreviousPage - calculated automatically
    • canNextPage - calculated automatically
    • setPageSize - no longer used
    • setPageIndex - renamed to onPageChange

    Added props:

    • locale - replaces localeString
    • itemCount - the total number of items (instead of pageCount)
    • onPageChange - invoked when the page index changes
    • All ThemeStyleProps - passed down to the <Box> ancestor for easier styling

    Example migration:

    BeforeAfter
    <Paginator
    localeString="en-US"
    pageSize={pageSize}
    pageIndex={pageIndex}
    pageCount={pageCount}
    pageSizeOptions={[5, 10]}
    canPreviousPage={pageIndex > 0}
    canNextPage={pageIndex < pageCount - 1}
    setPageSize={(e) => {
    setPageSize(e);
    setPageIndex(0);
    }}
    setPageIndex={(e) => {
    setPageIndex(e);
    }}
    />
    <Paginator
    locale="en-US"
    pageSize={pageSize} // optional, default = 10
    pageIndex={pageIndex} // optional if starting on index 0
    itemCount={data.length}
    onPageChange={setPageIndex}
    />

Full Changelog: https://github.com/Caspeco/casper-ui-library/compare/4.1.1...5.0.0