-
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
Changes from 3 commits
7b9109d
1c9d899
3a2a221
8745217
10bc8c2
2e43c54
22d85f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| .euiDataGrid__displayFormRow { | ||
| width: $euiFormMaxWidth; | ||
| .euiDataGrid__stylePopoverPanel { | ||
| width: $euiFormMaxWidth + $euiSize; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| position: relative; | ||
| z-index: 3; // Needs to sit above the content blow that sits below it | ||
| border: $euiBorderThin; | ||
| padding: $euiSizeXS; | ||
| padding: $euiSizeXS $euiSizeXS $euiSizeXS 0; | ||
| display: flex; | ||
| justify-content: space-between; | ||
| } | ||
|
|
@@ -28,18 +28,9 @@ | |
| } | ||
| } | ||
|
|
||
| .euiDataGrid__controlBtn { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fantastic, thanks for cleaning this up! |
||
| border-radius: $euiBorderRadius; | ||
|
|
||
| &:focus { | ||
| background: shadeOrTint($euiColorLightestShade, 10%, 10%); | ||
| } | ||
| } | ||
|
|
||
| .euiDataGrid__controlBtn--active, | ||
| .euiDataGrid__controlBtn--active:focus { | ||
| font-weight: $euiFontWeightSemiBold; | ||
| color: $euiColorFullShade; | ||
| } | ||
|
|
||
| @include euiDataGridStyles(bordersNone) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ | |
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| import React from 'react'; | ||
| import React, { useEffect } from 'react'; | ||
| import { EuiButtonIcon } from '../../button'; | ||
| import { useEuiI18n } from '../../i18n'; | ||
| import { | ||
|
|
@@ -48,11 +48,18 @@ export const EuiDataGridToolbar = ({ | |
| ? true | ||
| : gridWidth > minSizeForControls || isFullScreen; | ||
|
|
||
| // need to safely access those Web APIs | ||
| if (typeof document !== 'undefined') { | ||
| // When data grid is full screen, we add a class to the body to remove the extra scrollbar | ||
| document.body.classList.toggle(GRID_IS_FULLSCREEN_CLASSNAME, isFullScreen); | ||
| } | ||
| 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]); | ||
|
Comment on lines
+52
to
+63
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't hurt to give it a callout
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And I think that actually closes this: elastic#5092
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 fullScreenSelector = ( | ||
| <EuiButtonIcon | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -71,7 +71,7 @@ export const useDataGridStyleSelector = ( | |||||
| closePopover={() => setIsOpen(false)} | ||||||
| anchorPosition="downRight" | ||||||
| panelPaddingSize="s" | ||||||
| panelClassName="euiDataGrid__controlPopover" | ||||||
| panelClassName="euiDataGrid__stylePopoverPanel" | ||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This still needs the generic
Suggested change
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||
| button={ | ||||||
| <EuiButtonIcon | ||||||
| size="xs" | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.