Cristi Socea ca2ba3c5c7 [ADF-994] Integrate SFS enhancements for Pagination component (#2119)
* Add pagination module with pagination component

* Update the old pagination to have the old selector

* Add licence headers to ts files

* Update pagination files

* Rename properties for consistency reasons and remove redundant event emitters

* Add PaginationQueryParams interface to reference the query params used for paginated requests

* Add documentation of pagination (work in progress)

* Add i18n translations to pagination component

* Rename some variables used in pagination template

* Update pagination component to be backwards compatible

* Update pagination component specs

* Update pagination’s documentation

* Remove the old pagination code

* Add old alfresco-pagination tag selector

* Update document list component to include the new pagination

* Add adf-pagination in search component

* Update link to pagination component from main readme file

* Update search component specs

* Add a default pagination object in case it’s not provided

* Assign pagination to default one to default the missing properties (if any)

* Remove unused variables

* Add fail hints from expectancies of pagination tests

* Add default onInit and remove the old defaults
2017-09-05 15:16:41 +01:00

1.8 KiB

Pagination Component

Basic example

<adf-pagination
    [pagination]="pagination"
    [supportedPageSizes]="sizes"
    (change)="onChange($event)"
    (nextPage)="onNextPage($event)"
    (prevPage)="onPreviousPage($event)"
    (changePageSize)="onChangePageSize($event)"
    (changePageNumber)="onChangePageNumber($event)">
</adf-pagination>

Depending on the pagination data, you should see result similar to the following one:

Properties

Name Type Default Description
pagination Pagination Pagination object
supportedPageSizes Array<number> [ 25, 50, 100 ] An array of page sizes
change EventEmitter<PaginationQueryParams> Triggered for any action in pagination
nextPage EventEmitter<Pagination> Triggered on next page action
prevPage EventEmitter<Pagination> Triggered on previous page action
changePageSize EventEmitter<Pagination> Triggered on page size change action
changePageNumber EventEmitter<Pagination> Triggered on page change action

Each event helps to detect the certain action that user have made using the component.

For change event, a PaginationQueryParams (including the query params supported by the REST API, skipCount and maxItems) is returned.

For all other events, other than change, a new Pagination object is returned as in the folowing example, with updated properties to be used to query further.