[EuiTablePagination] Adding a Show all option; Plus Pagination Guidelines#5547
[EuiTablePagination] Adding a Show all option; Plus Pagination Guidelines#5547cchaos merged 43 commits intoelastic:mainfrom
Show all option; Plus Pagination Guidelines#5547Conversation
…rows’` option for `compressed`
…pdating the other `arrow` icons to a thicker weight
…nation # Conflicts: # CHANGELOG.md # src/components/icon/__snapshots__/icon.test.tsx.snap
[Breaking] Changed `hidePerPageOptions` to the positive `showPerPageOptions`
cchaos
left a comment
There was a problem hiding this comment.
This PR is now ready for review while I finish up the PR checklist. 😄
| <EuiFlexGroup | ||
| justifyContent="spaceBetween" | ||
| alignItems="center" | ||
| responsive={false} |
There was a problem hiding this comment.
I removed responsive={false} to better ensure that the items wrap on small screens. Still not 100% effective for responsive behavior, but better than getting cutoff.
There was a problem hiding this comment.
Ok, I think I've solved this even better:
Before the layout added scrollbars, but the problem is that this visually prioritizes the "Rows per page" instead of the actual pagination numbers.
After the layout has wrap on it, so without having to monitor the actual size of the container, if it's too narrow the pagination numbers will just wrap below the "Rows per page" first, then scroll if still necessary
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5547/ |
Fix dark mode in guidelines
Show all option; Plus Pagination GuidelinesShow all option; Plus Pagination Guidelines
343dfdd to
62ab0cc
Compare
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5547/ |
cee-chen
left a comment
There was a problem hiding this comment.
Apologies for the lateness, I planned on finishing reviewing last Friday after my eye exam but then my pupils got dilated and my near vision was shot for a few hours after 🙈 I just have some some super minor type-related feedback, everything else looks great!
|
This PR is ready for final review. Thanks so much @constancecchen for addition of the @1Copenut I'd love you a11y evaluation over how this affects the overall table screen reader functionality. You can see a full example under the |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5547/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5547/ |
|
@cchaos I took a look at the linked page, and spent a while considering language. I noticed the option |
cee-chen
left a comment
There was a problem hiding this comment.
Love the wrap change! This LGTM to me from a code POV, although I have a few small perf suggestions. If you're OK with them I can push up the memoization hooks to this branch, up to you
Yes please!!! 🙏 |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5547/ |
|
@1Copenut Based on Gail's recommendation for the button text and your suggestion for screen-reader text, I've just gone ahead and updated the option's visible text to include the word |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5547/ |
elizabetdev
left a comment
There was a problem hiding this comment.
Thanks for fixing the issues.
I read the guidelines and tested the changes again. LGTM! 🎉




Guidelines
Can be found at
/navigation/pagination/guidelines.Internal only: Google doc for reference
EuiTablePagination
🔔 Breaking Change
This is a semi-trivial change, but I changed the name of the prop
hidePerPageOptionstoshowPerPageOptionsbecause I hate double-negative prop names. Boolean props should always be in the positive (with the exception ofdisabledsince we inherit this from standard HTML). So that it's easier to readshowPerPageOptions={false}vshidePerPageOptions={true}.Added the ability to present a "Show all" option by passing
'all'in theitemsPerPagearrayIfBut the idea is to not have to add yet another boolean prop but make it available as an option in the array.0doesn't seem appropriate, I'm up for suggestions (maybe-1is better).Unless someone can help@constancecchen helped me allow the termallinto that prop's array as a different way to do this.When this option is selected, it will hide the numbered pagination and present the button text as "Showing all".
Added a docs example for this component under Pagination / Table Pagination
With props tab and playground.
Other small fixes
Fixed layout of EuiTablePagination when it's container is narrow
Before the layout added scrollbars, but the problem is that this visually prioritizes the "Rows per page" instead of the actual pagination numbers.
After the layout has
wrapon it, so without having to monitor the actual size of the container, if it's too narrow the pagination numbers will just wrap below the "Rows per page" first, then scroll if still necessaryFixed EuiImage images from staying restricted to it's parent container's width, by adding
max-width: 100%:Before

After

Checklist