-
Notifications
You must be signed in to change notification settings - Fork 833
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
[Emotion] Convert EuiBasicTable #6539
Changes from all commits
6bcb0a2
3f5e8c1
f396769
bbe16ef
9a5d0c9
3ea3cb6
f9ba5cf
3b6e129
7563c40
dfcd39b
c6687c6
ea9b8d0
6a889eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -6,7 +6,57 @@ | |||||||||||||||
* Side Public License, v 1. | ||||||||||||||||
*/ | ||||||||||||||||
|
||||||||||||||||
import { css } from '@emotion/react'; | ||||||||||||||||
import { css, keyframes } from '@emotion/react'; | ||||||||||||||||
|
||||||||||||||||
import { logicalCSS, euiCantAnimate } from '../../global_styling'; | ||||||||||||||||
import { UseEuiTheme } from '../../services'; | ||||||||||||||||
|
||||||||||||||||
const tableLoadingLine = keyframes` | ||||||||||||||||
from { | ||||||||||||||||
${logicalCSS('left', 0)} | ||||||||||||||||
${logicalCSS('width', 0)} | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
20% { | ||||||||||||||||
${logicalCSS('left', 0)} | ||||||||||||||||
${logicalCSS('width', '40%')} | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
80% { | ||||||||||||||||
${logicalCSS('left', '60%')} | ||||||||||||||||
${logicalCSS('width', '40%')} | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
100% { | ||||||||||||||||
${logicalCSS('left', '100%')} | ||||||||||||||||
${logicalCSS('width', 0)} | ||||||||||||||||
} | ||||||||||||||||
`; | ||||||||||||||||
|
||||||||||||||||
export const euiBasicTableBodyLoading = ({ euiTheme }: UseEuiTheme) => css` | ||||||||||||||||
position: relative; | ||||||||||||||||
overflow: hidden; | ||||||||||||||||
|
||||||||||||||||
&::before { | ||||||||||||||||
position: absolute; | ||||||||||||||||
content: ''; | ||||||||||||||||
${logicalCSS('width', '100%')} | ||||||||||||||||
${logicalCSS('height', euiTheme.border.width.thick)} | ||||||||||||||||
background-color: ${euiTheme.colors.primary}; | ||||||||||||||||
animation: ${tableLoadingLine} 1s linear infinite; | ||||||||||||||||
|
||||||||||||||||
${euiCantAnimate} { | ||||||||||||||||
animation-duration: 2s; | ||||||||||||||||
} | ||||||||||||||||
Comment on lines
+46
to
+50
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. [not sure if this conversation belongs in this PR or as a separate/follow-up item] @miukimiu I'm not sure if this needs to be DRY'd out with https://elastic.github.io/eui/#/display/progress eui/src/components/progress/progress.styles.ts Lines 124 to 130 in 4c285cd
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'm going to work next on tables empty and loading states. So I think for now we can leave it as it is. Then according to the direction the design takes, I can refactor the code. 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. On second thought, I do still want to investigate this, but I'd prefer we address it in a follow-up PR rather than this PR. I'm hoping to get this in by tomorrow's release so we have an Emotion conversion in for the next Kibana upgrade 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. Sounds great, thanks @miukimiu! |
||||||||||||||||
} | ||||||||||||||||
`; | ||||||||||||||||
|
||||||||||||||||
// Fix to make the loading indicator position correctly in Safari | ||||||||||||||||
// For whatever annoying reason, Safari doesn't respect `position: relative;` | ||||||||||||||||
// on `tbody` without `position: relative` on the parent `table` | ||||||||||||||||
export const safariLoadingWorkaround = () => css` | ||||||||||||||||
position: relative; | ||||||||||||||||
`; | ||||||||||||||||
|
||||||||||||||||
// Unsets the extra height caused by tooltip/popover wrappers around table action buttons | ||||||||||||||||
// Without this, the row height jumps whenever actions are disabled | ||||||||||||||||
|
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.
(Follow up to #6539 (review))
Quick FYI as to where these classes are coming from - the conditional Emotion styles I added via
loading &&
are working correctly, but for reasons (emotion-js/emotion#1529) Emotion still applies a blank/emptycss-0
class when anything is passed to thecss={}
prop, evenfalse
orundefined
, so this gets output.This will probably end up looking less strange when we convert all our underlying table styles to Emotion (it will get the
euiTable-
prefix at that point).