-
Notifications
You must be signed in to change notification settings - Fork 0
Datagrid toolbar #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
And lower left padding
Removed all the unnecessary manual additions of `className="euiDataGrid__controlBtn”`
| anchorPosition="downRight" | ||
| panelPaddingSize="s" | ||
| panelClassName="euiDataGrid__controlPopover" | ||
| panelClassName="euiDataGrid__stylePopoverPanel" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs the generic .euiDataGrid__controlPopover class, as that CSS has transform/z-index stuff specific to all toolbar popovers
| panelClassName="euiDataGrid__stylePopoverPanel" | |
| panelClassName="euiDataGrid__controlPopover euiDataGrid__stylePopoverPanel" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That transform stuff is actually only needed on popovers whose contents contains the drag-and-drop functionality like the sort and column selector. This new popover is just a simple form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohhh that's super good to know! Now I feel like I should have named that CSS class better. I'll fix that after this merges
| useEffect(() => { | ||
| // When data grid is full screen, we add a class to the body to remove the extra scrollbar and stay above any fixed headers | ||
| if (isFullScreen && typeof document !== 'undefined') { | ||
| document.body.classList.add(GRID_IS_FULLSCREEN_CLASSNAME); | ||
|
|
||
| return () => { | ||
| if (typeof document !== 'undefined') { | ||
| document.body.classList.remove(GRID_IS_FULLSCREEN_CLASSNAME); | ||
| } | ||
| }; | ||
| } | ||
| }, [isFullScreen]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super awesome fix, thanks! Do you think this needs a changelog entry or probably not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't hurt to give it a callout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I think that actually closes this: elastic#5092
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I added a changelog entry and a closes commit (which I think should auto close on merge to main?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly don't know if a commit message will. But might as well add it to your PR summary as well.
| const buttonLabel = useEuiI18n( | ||
| 'euiStyleSelector.buttonText', | ||
| 'Display options' | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 Nice, thanks for the copy-fu!
| } | ||
| } | ||
|
|
||
| .euiDataGrid__controlBtn { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic, thanks for cleaning this up!
* [Setup] Move toolbar CSS to own file * [Cleanup] DRY out repeated specific CSS class - naming was incorrect in the case of the style selector popover * Reorder toolbar per Caroline's mocks - Columns & Sort on left, with additionalControls to the right of those (+ update prop types to indicate that) - Style (TBD naming) and Fullscreen to the right * Convert display buttons to icons only + tweak grid styles icon to match Caroline's mock + popover location * Convert density UI to a compressed EuiFormRow w/ new text/order per mocks - refactor densityOptions to const outside hook * Update test snapshots * Add changelog entry * [PR feedback] Revert location of additionalControls + fix props description * [PR feedback] CSS feedback * [PR feature request] Change toolbar icon based on grid density * [PR feedback][extra] Fix missing sort control on styling example NB: sorting functionality won't actually work/isn't hooked up, but this should at least allow the show/hide UI toggle to work as expected * updoot snaps * Fix changelog * [misc] Reorganize EuiDataGridToolbar utils to bottom of file - makes it easier for devs to immediately jump to the main component/fn, rather than have to scroll past helper/minutae details - if it gets complex enough, also worth pulling out to a separate file * Rename CSS toolbar class to left/right to match API - Per GH discussion display/data is ambiguous and naming this left/right is likely more helpful * Add API support for left/right positioning of `additionalControls` * Update additionalControls documentation + example * PR feedback & cleanup from Caroline (#4) * Update some props comments and fix popover’s responsiveness * [Design] Remove a few extraneous style overrides to control buttons And lower left padding * Fixed add/remove of fullscreen body class * Added tooltips around icon buttons with long delay * Updated examples and snippets with “real world” examples Removed all the unnecessary manual additions of `className="euiDataGrid__controlBtn”` * More responsive fixes * Change class name * Update CSS class to be more specific - It isn't necessary for popovers without drag & drop, name becomes verbose but it's hopefully worth it for clearer usage * closes elastic#5092 - add changelog for fullscreen bugfix in Caroline's work * [PR feedback] Changelog * Update snapshots * PR feedback * Remove unused CSS class - Class was removed in a previous commit by Caroline Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
@constancecchen
Here's a quick PR (I've detailed the changes in the commits). Mostly just some design tweaks, adding tooltips, and updating the examples to showcase "Real world" examples.
Let me know if you have any questions.