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 tolocalepageSizeOptions- no longer usedpageCount- calculated automatically, replaced byitemCountcanPreviousPage- calculated automaticallycanNextPage- calculated automaticallysetPageSize- no longer usedsetPageIndex- renamed toonPageChange
Added props:
locale- replaceslocaleStringitemCount- the total number of items (instead ofpageCount)onPageChange- invoked when the page index changes- All
ThemeStyleProps- passed down to the<Box>ancestor for easier styling
Example migration:
Before After <PaginatorlocaleString="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);}}/><Paginatorlocale="en-US"pageSize={pageSize} // optional, default = 10pageIndex={pageIndex} // optional if starting on index 0itemCount={data.length}onPageChange={setPageIndex}/>
Full Changelog: https://github.com/Caspeco/casper-ui-library/compare/4.1.1...5.0.0