Skip to content

Commit

Permalink
[cleanup] Remove more now-unnecessary height-based CSS/logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Nov 8, 2023
1 parent f64bb1a commit 95e65cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
8 changes: 0 additions & 8 deletions src/components/datagrid/_data_grid_data_row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,6 @@
align-items: center;
}

.euiDataGridRowCell__numericalHeight {
// Without this rule, popover anchors content that overflows off the page
[data-euiportal],
.euiPopover {
height: 100%;
}
}

// Positioning for cell actions & the cell expansion popover
.euiDataGridRowCell__actions,
.euiDataGridRowCell__actions + [data-euiportal] > .euiPopover {
Expand Down
9 changes: 3 additions & 6 deletions src/components/datagrid/body/data_grid_cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const EuiDataGridCellContent: FunctionComponent<
isFocused: boolean;
ariaRowIndex: number;
rowHeight?: EuiDataGridRowHeightOption;
cellHeightType: string;
cellActions?: ReactNode;
}
> = memo(
Expand All @@ -69,14 +68,16 @@ const EuiDataGridCellContent: FunctionComponent<
rowHeightUtils,
isControlColumn,
isFocused,
cellHeightType,
cellActions,
...rest
}) => {
// React is more permissible than the TS types indicate
const CellElement =
renderCellValue as JSXElementConstructor<EuiDataGridCellValueElementProps>;

const cellHeightType =
rowHeightUtils?.getHeightType(rowHeight) || 'default';

const classes = classNames(
'euiDataGridRowCell__content',
!isControlColumn && {
Expand Down Expand Up @@ -710,15 +711,12 @@ export class EuiDataGridCell extends Component<
rowIndex,
rowHeightsOptions
);
const cellHeightType =
rowHeightUtils?.getHeightType(rowHeight) || 'default';

const cellContentProps = {
...rest,
setCellProps: this.setCellProps,
column,
columnType,
cellHeightType,
isExpandable,
isExpanded: popoverIsOpen,
isDetails: false,
Expand All @@ -738,7 +736,6 @@ export class EuiDataGridCell extends Component<
rowIndex={rowIndex}
colIndex={colIndex}
column={column}
cellHeightType={cellHeightType}
onExpandClick={() => {
if (popoverIsOpen) {
closeCellPopover();
Expand Down
13 changes: 5 additions & 8 deletions src/components/datagrid/body/data_grid_cell_actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@ import { EuiButtonIcon, EuiButtonIconProps } from '../../button/button_icon';
import { EuiButtonEmpty, EuiButtonEmptyProps } from '../../button/button_empty';
import { EuiFlexGroup, EuiFlexItem } from '../../flex';
import { EuiPopoverFooter } from '../../popover';
import classNames from 'classnames';

export const EuiDataGridCellActions = ({
onExpandClick,
column,
rowIndex,
colIndex,
cellHeightType,
}: {
onExpandClick: () => void;
column?: EuiDataGridColumn;
rowIndex: number;
colIndex: number;
cellHeightType: string;
}) => {
// Note: The cell expand button/expansion popover is *always* rendered if
// column.cellActions is present (regardless of column.isExpandable).
Expand Down Expand Up @@ -96,11 +93,11 @@ export const EuiDataGridCellActions = ({
);
}, [column, colIndex, rowIndex]);

const classes = classNames('euiDataGridRowCell__actions', {
'euiDataGridRowCell__actions--overlay': cellHeightType !== 'default',
});

return <div className={classes}>{[...additionalButtons, expandButton]}</div>;
return (
<div className="euiDataGridRowCell__actions">
{[...additionalButtons, expandButton]}
</div>
);
};

export const EuiDataGridCellPopoverActions = ({
Expand Down

0 comments on commit 95e65cf

Please sign in to comment.