Add a new way to paginate
This partially merges pagination in the core of the library by adding a new property to the Tabular class which is hasNextPage.
The commit also introduces a new property to PaginationConfig:
type: PaginationType
which accepts to values:
export type PaginationType = "opaque-based" | "offset-based";
They are the two pagination types.
offset-based is already provided by Gridjs natively and needs the total property in the server's one to work.
opaque-based is the new one and it works by changing the property total by hasNextPage one. It has the same signature (hasNextPage: (data) => boolean).
By enabling opaque-based pagination using the type property, Gridjs will skip automatically renderPages and renderSummary since this pagination type, usually, relies on "next page tokens" and the pattern does not provide information about how many pages are left or the total count of entries in the server.
NOTE: opaque-based pagination is enabled by default.
The normal behavior of Gridjs pagination can be enabled by switching type to offset-based.
@afshinm hey! check this out and tell me what do you think about it.
Thanks @TomasWeg! I will take a look
Sure, I will do it in a moment.