From 8a89c8576df104c16ae3abf39b9db766e56d4e3b Mon Sep 17 00:00:00 2001
From: Cee Chen <549407+cee-chen@users.noreply.github.com>
Date: Mon, 30 Sep 2024 16:25:47 -0700
Subject: [PATCH] Upgrade EUI to v95.12.0 (#193805)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
`v95.11.0`⏩`v95.12.0-backport.0`
> [!note]
> A few fun highlights from this release:
> - Content within `EuiDataGrid`, `EuiBasicTable`, and
`EuiInMemoryTable`, when manually selected/highlighted by users, should
now more cleanly copy and paste into various spreadsheet apps
> - `EuiProvider` will now detect the user's system-level dark or light
mode and default to that if no `colorMode` prop is passed manually
_[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_
---
## [`v95.12.0`](https://github.com/elastic/eui/releases/v95.12.0)
- Enhanced `EuiDataGrid` and `EuiBasic/InMemoryTable` to clean content
newlines/tabs when users copy and paste from their tabular data
([#8019](https://github.com/elastic/eui/pull/8019))
- Updated `EuiResizableButton` with a new `accountForScrollbars` prop
([#8021](https://github.com/elastic/eui/pull/8021))
- Updated `EuiProvider` to inherit from the user's OS/system light/dark
mode setting if a `colorMode` prop has not been passed
([#8026](https://github.com/elastic/eui/pull/8026))
**Bug fixes**
- Fixed `EuiDatePicker`'s `onClear` button to not appear when the input
is `disabled` ([#8020](https://github.com/elastic/eui/pull/8020))
- Fixed several `EuiDataGrid` row height bugs:
([#8025](https://github.com/elastic/eui/pull/8025))
- Fixed row heights not recalculating when
`rowHeightOptions.lineHeight`, `gridStyles.fontSize`, or
`gridStyles.cellPadding` changed
- Fixed incorrect height calculations for `rowHeightOptions.rowHeights`
with `lineCount`s
- Fixed control column content to align better with multi-line row
heights, as well as custom line-heights
##
[`v95.12.0-backport.0`](https://github.com/elastic/eui/releases/v95.12.0-backport.0)
**This is a backport release only intended for use by Kibana.**
**Bug fixes**
- Fixed `EuiProvider`'s system color mode detection causing errors
during server-side rendering
([#8040](https://github.com/elastic/eui/pull/8040))
- Fixed an `EuiDataGrid` rendering bug that was causing bouncing
scrollbar issues ([#8041](https://github.com/elastic/eui/pull/8041))
---
package.json | 2 +-
.../src/jest/setup/polyfills.jsdom.js | 20 +++------
packages/kbn-unified-data-table/index.ts | 1 -
.../row_control_column.tsx | 37 ++++++++--------
.../row_menu_control_column.tsx | 34 ++++++--------
.../src/components/data_table.scss | 17 +++----
.../data_table_document_selection.tsx | 38 ++++++----------
.../components/data_table_expand_button.tsx | 44 ++++++++++---------
.../src/components/data_table_row_control.tsx | 26 -----------
src/dev/license_checker/config.ts | 2 +-
.../apps/discover/esql/_esql_view.ts | 2 +-
test/functional/services/data_grid.ts | 29 ++++++++----
.../cypress/e2e/all/packs_create_edit.cy.ts | 4 +-
.../cypress/tasks/response_actions.ts | 11 +++--
...stom_timeline_data_grid_body.test.tsx.snap | 5 ---
.../custom_timeline_data_grid_body.tsx | 3 --
.../services/ml/common_data_grid.ts | 2 +-
.../services/ml/data_frame_analytics_table.ts | 2 +-
.../hosts/hosts_risk_column.cy.ts | 4 +-
.../cypress/screens/alerts_details.ts | 2 +-
.../common/discover/esql/_esql_view.ts | 2 +-
yarn.lock | 8 ++--
22 files changed, 126 insertions(+), 169 deletions(-)
delete mode 100644 packages/kbn-unified-data-table/src/components/data_table_row_control.tsx
diff --git a/package.json b/package.json
index cad364998e3c8..110b8ec23a6bf 100644
--- a/package.json
+++ b/package.json
@@ -115,7 +115,7 @@
"@elastic/ecs": "^8.11.1",
"@elastic/elasticsearch": "^8.15.0",
"@elastic/ems-client": "8.5.3",
- "@elastic/eui": "95.11.0",
+ "@elastic/eui": "95.12.0-backport.0",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
diff --git a/packages/kbn-test/src/jest/setup/polyfills.jsdom.js b/packages/kbn-test/src/jest/setup/polyfills.jsdom.js
index 308bf18a9ffbd..e6616c2bccfa1 100644
--- a/packages/kbn-test/src/jest/setup/polyfills.jsdom.js
+++ b/packages/kbn-test/src/jest/setup/polyfills.jsdom.js
@@ -53,22 +53,16 @@ if (!Object.hasOwn(global, 'Worker')) {
if (!Object.hasOwn(global, 'matchMedia')) {
Object.defineProperty(global, 'matchMedia', {
writable: true,
- // eslint-disable-next-line no-undef
- value: jest.fn().mockImplementation((query) => ({
+ value: (query) => ({
matches: false,
media: query,
onchange: null,
- // eslint-disable-next-line no-undef
- addListener: jest.fn(), // deprecated
- // eslint-disable-next-line no-undef
- removeListener: jest.fn(), // deprecated
- // eslint-disable-next-line no-undef
- addEventListener: jest.fn(),
- // eslint-disable-next-line no-undef
- removeEventListener: jest.fn(),
- // eslint-disable-next-line no-undef
- dispatchEvent: jest.fn(),
- })),
+ addListener: () => {},
+ removeListener: () => {},
+ addEventListener: () => {},
+ removeEventListener: () => {},
+ dispatchEvent: () => {},
+ }),
});
}
}
diff --git a/packages/kbn-unified-data-table/index.ts b/packages/kbn-unified-data-table/index.ts
index 8f7e711bebcad..40a3dcc23dda8 100644
--- a/packages/kbn-unified-data-table/index.ts
+++ b/packages/kbn-unified-data-table/index.ts
@@ -28,7 +28,6 @@ export { popularizeField } from './src/utils/popularize_field';
export { useColumns, type UseColumnsProps } from './src/hooks/use_data_grid_columns';
export { OPEN_DETAILS, SELECT_ROW } from './src/components/data_table_columns'; // TODO: deprecate?
-export { DataTableRowControl } from './src/components/data_table_row_control';
export type {
UnifiedDataTableRenderCustomToolbar,
diff --git a/packages/kbn-unified-data-table/src/components/custom_control_columns/additional_row_control/row_control_column.tsx b/packages/kbn-unified-data-table/src/components/custom_control_columns/additional_row_control/row_control_column.tsx
index 3519bef843c4a..d1fec11906df4 100644
--- a/packages/kbn-unified-data-table/src/components/custom_control_columns/additional_row_control/row_control_column.tsx
+++ b/packages/kbn-unified-data-table/src/components/custom_control_columns/additional_row_control/row_control_column.tsx
@@ -16,7 +16,6 @@ import {
EuiToolTip,
} from '@elastic/eui';
import { RowControlColumn, RowControlProps } from '@kbn/discover-utils';
-import { DataTableRowControl, Size } from '../../data_table_row_control';
import { DEFAULT_CONTROL_COLUMN_WIDTH } from '../../../constants';
import { useControlColumn } from '../../../hooks/use_control_column';
@@ -40,23 +39,25 @@ export const RowControlCell = ({
tooltipContent,
}) => {
return (
-
-
- {
- if (record) {
- onClick?.({ record, rowIndex });
- }
- }}
- />
-
-
+
+ {
+ if (record) {
+ onClick?.({ record, rowIndex });
+ }
+ }}
+ />
+
);
},
[props.columnId, record, rowIndex]
diff --git a/packages/kbn-unified-data-table/src/components/custom_control_columns/additional_row_control/row_menu_control_column.tsx b/packages/kbn-unified-data-table/src/components/custom_control_columns/additional_row_control/row_menu_control_column.tsx
index 3d6cd19a53b1e..cc600df002502 100644
--- a/packages/kbn-unified-data-table/src/components/custom_control_columns/additional_row_control/row_menu_control_column.tsx
+++ b/packages/kbn-unified-data-table/src/components/custom_control_columns/additional_row_control/row_menu_control_column.tsx
@@ -19,9 +19,7 @@ import {
EuiToolTip,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import { css } from '@emotion/react';
import { RowControlColumn, RowControlProps } from '@kbn/discover-utils';
-import { DataTableRowControl, Size } from '../../data_table_row_control';
import { DEFAULT_CONTROL_COLUMN_WIDTH } from '../../../constants';
import { useControlColumn } from '../../../hooks/use_control_column';
@@ -80,26 +78,20 @@ export const RowMenuControlCell = ({
return (