From 60f9bd15a8822da2766dbef40df1f75f766b94ec Mon Sep 17 00:00:00 2001 From: Dave Snider Date: Wed, 20 Jan 2021 11:19:54 -0800 Subject: [PATCH] fix prettier / ts issues --- .../datagrid/_data_grid_data_row.scss | 42 ++++++++++--------- src/components/datagrid/data_grid.tsx | 1 - src/components/datagrid/data_grid_body.tsx | 2 +- src/components/datagrid/data_grid_cell.tsx | 3 +- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/components/datagrid/_data_grid_data_row.scss b/src/components/datagrid/_data_grid_data_row.scss index 7405754228e..6c3164716c6 100644 --- a/src/components/datagrid/_data_grid_data_row.scss +++ b/src/components/datagrid/_data_grid_data_row.scss @@ -3,18 +3,6 @@ min-width: 100%; // Needed to prevent wraps. Inline flex is tricky } -@keyframes euiDataGridCellButtonSlideIn { - from { - margin-left: 0; - width: 0; - } - - to { - margin-left: $euiDataGridCellPaddingM; - width: $euiSizeM; - } -} - @include euiDataGridRowCell { @include euiFontSizeS; @@ -50,23 +38,24 @@ // Long delays on hover to mitigate the accordion effect &:hover { .euiDataGridRowCell__expandButtonIcon { - animation-duration: $euiAnimSpeedFast; + animation-duration: $euiAnimSpeedExtraFast; animation-name: euiDataGridCellButtonSlideIn; animation-iteration-count: 1; - animation-delay: 1000ms; - animation-fill-mode: forwards; + animation-delay: $euiAnimSpeedNormal; + animation-fill-mode: forwards; } .euiDataGridRowCell__actionButtonIcon { - animation-duration: $euiAnimSpeedFast; + animation-duration: $euiAnimSpeedExtraFast; animation-name: euiDataGridCellButtonSlideIn; animation-iteration-count: 1; - animation-delay: 1000ms; - animation-fill-mode: forwards; + animation-delay: $euiAnimSpeedNormal; + animation-fill-mode: forwards; } } - &:not(:hover), &.euiDataGridRowCell--open { + &:not(:hover), + &.euiDataGridRowCell--open { .euiDataGridRowCell__expandButtonIcon { animation: none; margin-left: $euiDataGridCellPaddingM; @@ -90,7 +79,8 @@ // if a cell is not hovered nor focused nor open via popover, don't show buttons in general &:not(:hover):not(:focus):not(.euiDataGridRowCell--open) { - .euiDataGridRowCell__expandButtonIcon, .euiDataGridRowCell__actionButtonIcon { + .euiDataGridRowCell__expandButtonIcon, + .euiDataGridRowCell__actionButtonIcon { display: none; } } @@ -257,3 +247,15 @@ } } } + +@keyframes euiDataGridCellButtonSlideIn { + from { + margin-left: 0; + width: 0; + } + + to { + margin-left: $euiDataGridCellPaddingM; + width: $euiSizeM; + } +} diff --git a/src/components/datagrid/data_grid.tsx b/src/components/datagrid/data_grid.tsx index 0b74d19a25a..89261e070e3 100644 --- a/src/components/datagrid/data_grid.tsx +++ b/src/components/datagrid/data_grid.tsx @@ -650,7 +650,6 @@ export const EuiDataGrid: FunctionComponent = (props) => { const [interactiveCellId] = useState(htmlIdGenerator()()); const [headerIsInteractive, setHeaderIsInteractive] = useState(false); - const cellsUpdateFocus = useRef>(new Map()); const [wrappingDivFocusProps, focusedCell, setFocusedCell] = useFocus( diff --git a/src/components/datagrid/data_grid_body.tsx b/src/components/datagrid/data_grid_body.tsx index 9ae3d9a975b..3111f41287f 100644 --- a/src/components/datagrid/data_grid_body.tsx +++ b/src/components/datagrid/data_grid_body.tsx @@ -546,7 +546,7 @@ export const EuiDataGridBody: FunctionComponent = ( ) { setWidth(boundingRect.width); } - }, [unconstrainedHeight, wrapperDimensions]); + }, [unconstrainedHeight, wrapperDimensions, height, width]); const preventTabbing = useCallback(() => { if (wrapperRef.current) { diff --git a/src/components/datagrid/data_grid_cell.tsx b/src/components/datagrid/data_grid_cell.tsx index 09f45e3ee48..e5de27e8aa2 100644 --- a/src/components/datagrid/data_grid_cell.tsx +++ b/src/components/datagrid/data_grid_cell.tsx @@ -258,7 +258,8 @@ export class EuiDataGridCell extends Component< return true; if (nextState.isEntered !== this.state.isEntered) return true; if (nextState.isFocused !== this.state.isFocused) return true; - if (nextState.enableInteractions !== this.state.enableInteractions) return true; + if (nextState.enableInteractions !== this.state.enableInteractions) + return true; if (nextState.disableCellTabIndex !== this.state.disableCellTabIndex) return true;