robsontenorio / mary

Laravel Blade UI Components for Livewire 3
https://mary-ui.com
Other
924 stars 110 forks source link

Table - Add Support for Cursor pagination. #527

Closed c-perez closed 1 month ago

c-perez commented 1 month ago

Currently don't support "CursorPaginator" because the component use a specific function of "LengthAwarePaginator" (onEachSide(1))

This improvement can be done to the PR "Add Pagination component and integrate into Table component " but may have a few UI implications and decisions to make to be able to adjust the "perPage" select. https://github.com/robsontenorio/mary/pull/523

HTML/Blade https://github.com/robsontenorio/mary/blob/main/src/View/Components/Table.php#L356

{{ $rows**->onEachSide(1)**->links(data: ['scrollTo' => false])  }}

image

This is like a missing feature because of a bug.

robsontenorio commented 1 month ago

Please , consider to comment on the PR and see if the original author is able to include this change.

robsontenorio commented 1 month ago

@c-perez Are you able to implement a solution ? Free feel to comment on that PR.

c-perez commented 1 month ago

After viewing the PR I see that everything is fine, it would only be necessary to add a validation in the render of the pagination to maintain support for other types of Laravel Pagination.

https://github.com/robsontenorio/mary/pull/523/files#diff-c511ca5774f2bb21057ad876e254f8a1c329abd6f26dbb99bd628c58804769b5

No need to implement this my self, just improve a bit this PR https://github.com/robsontenorio/mary/pull/523

I'll contribute in the future, for sure.

robsontenorio commented 1 month ago

For now, I have merged it as is. If you are willing to contribute I would accept your PR to support Cursor Paginator.