From d87ea6ee9baf9f082c0587dac5ef31ef7cf1bb2a Mon Sep 17 00:00:00 2001 From: Dave Snider Date: Fri, 26 Jul 2019 00:34:05 -0700 Subject: [PATCH 1/3] Initial css fixes --- .../__snapshots__/data_grid.test.tsx.snap | 2 +- src/components/datagrid/_data_grid.scss | 5 ++++ .../datagrid/_data_grid_column_resizer.scss | 24 ++++++++++++++++--- .../datagrid/_data_grid_data_row.scss | 13 ++++++---- .../datagrid/_data_grid_header_row.scss | 15 +++++++++--- src/components/datagrid/_index.scss | 3 +++ src/components/datagrid/_mixins.scss | 0 src/components/datagrid/_variables.scss | 1 + src/components/datagrid/data_grid.tsx | 2 +- 9 files changed, 52 insertions(+), 13 deletions(-) create mode 100644 src/components/datagrid/_data_grid.scss create mode 100644 src/components/datagrid/_mixins.scss create mode 100644 src/components/datagrid/_variables.scss diff --git a/src/components/datagrid/__snapshots__/data_grid.test.tsx.snap b/src/components/datagrid/__snapshots__/data_grid.test.tsx.snap index 4ec27255852..afcd5f37c68 100644 --- a/src/components/datagrid/__snapshots__/data_grid.test.tsx.snap +++ b/src/components/datagrid/__snapshots__/data_grid.test.tsx.snap @@ -3,7 +3,7 @@ exports[`EuiDataGrid rendering renders with common and div attributes 1`] = `
{ const { columns, rowCount, renderCellValue, ...rest } = this.props; return ( -
+
Date: Fri, 26 Jul 2019 08:39:14 -0700 Subject: [PATCH 2/3] works in IE, addresses feedback --- .../__snapshots__/data_grid.test.tsx.snap | 96 +++++++++---------- src/components/datagrid/_data_grid.scss | 2 + .../datagrid/_data_grid_data_row.scss | 1 + .../datagrid/_data_grid_header_row.scss | 1 + src/components/datagrid/data_grid.tsx | 13 ++- 5 files changed, 60 insertions(+), 53 deletions(-) diff --git a/src/components/datagrid/__snapshots__/data_grid.test.tsx.snap b/src/components/datagrid/__snapshots__/data_grid.test.tsx.snap index afcd5f37c68..318decfc653 100644 --- a/src/components/datagrid/__snapshots__/data_grid.test.tsx.snap +++ b/src/components/datagrid/__snapshots__/data_grid.test.tsx.snap @@ -3,7 +3,7 @@ exports[`EuiDataGrid rendering renders with common and div attributes 1`] = `
-
- 0, A -
-
- 0, B -
+ 0, A
-
- 1, A -
-
- 1, B -
+ 0, B
+
+
-
- 2, A -
-
- 2, B -
+ 1, A +
+
+ 1, B +
+
+
+
+ 2, A +
+
+ 2, B
diff --git a/src/components/datagrid/_data_grid.scss b/src/components/datagrid/_data_grid.scss index 9f4b3aed915..794f0effbaf 100644 --- a/src/components/datagrid/_data_grid.scss +++ b/src/components/datagrid/_data_grid.scss @@ -2,4 +2,6 @@ @include euiScrollBar; font-feature-settings: 'tnum' 1; // Tabular numbers overflow-x: auto; + max-width: 100%; + width: 100%; } \ No newline at end of file diff --git a/src/components/datagrid/_data_grid_data_row.scss b/src/components/datagrid/_data_grid_data_row.scss index 3a2b0339c4f..baec186f8af 100644 --- a/src/components/datagrid/_data_grid_data_row.scss +++ b/src/components/datagrid/_data_grid_data_row.scss @@ -12,6 +12,7 @@ border-bottom: $euiBorderThin; overflow: hidden; white-space: nowrap; + flex: 0 0 auto; &:first-of-type { border-left: $euiBorderThin; diff --git a/src/components/datagrid/_data_grid_header_row.scss b/src/components/datagrid/_data_grid_header_row.scss index a166a7bf1b8..5605acd492e 100644 --- a/src/components/datagrid/_data_grid_header_row.scss +++ b/src/components/datagrid/_data_grid_header_row.scss @@ -12,6 +12,7 @@ position: relative; background: $euiColorLightestShade; user-select: none; + flex: 0 0 auto; &:first-of-type { diff --git a/src/components/datagrid/data_grid.tsx b/src/components/datagrid/data_grid.tsx index 68d7870d41a..4fafca0250b 100644 --- a/src/components/datagrid/data_grid.tsx +++ b/src/components/datagrid/data_grid.tsx @@ -4,6 +4,7 @@ import { EuiDataGridDataRow } from './data_grid_data_row'; import { CommonProps } from '../common'; import { Column, ColumnWidths } from './data_grid_types'; import { EuiDataGridCellProps } from './data_grid_cell'; +import classNames from 'classnames'; type EuiDataGridProps = CommonProps & HTMLAttributes & { @@ -60,16 +61,22 @@ export class EuiDataGrid extends Component { render() { const { columnWidths, rows } = this.state; - const { columns, rowCount, renderCellValue, ...rest } = this.props; + const { + columns, + rowCount, + renderCellValue, + className, + ...rest + } = this.props; return ( -
+
-
{rows}
+ {rows}
); } From e0069e5986a7b957b001c3f9a3cca6a8548dc4c4 Mon Sep 17 00:00:00 2001 From: Dave Snider Date: Fri, 26 Jul 2019 09:02:44 -0700 Subject: [PATCH 3/3] remove user select --- src/components/datagrid/_data_grid_header_row.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/datagrid/_data_grid_header_row.scss b/src/components/datagrid/_data_grid_header_row.scss index 5605acd492e..cab0119b318 100644 --- a/src/components/datagrid/_data_grid_header_row.scss +++ b/src/components/datagrid/_data_grid_header_row.scss @@ -11,7 +11,6 @@ border-left: none; position: relative; background: $euiColorLightestShade; - user-select: none; flex: 0 0 auto;