From e14fb4cd4e60b45b538dce2d52e9d07a831a1a9f Mon Sep 17 00:00:00 2001 From: Tim Schnell Date: Wed, 30 Aug 2023 13:51:02 -0500 Subject: [PATCH] adding api for additional display controls on the datagrid --- .../src/views/datagrid/basics/datagrid.js | 21 +++++++++++++++++++ .../datagrid/controls/display_selector.tsx | 7 +++++++ src/components/datagrid/data_grid_types.ts | 4 ++++ 3 files changed, 32 insertions(+) diff --git a/src-docs/src/views/datagrid/basics/datagrid.js b/src-docs/src/views/datagrid/basics/datagrid.js index a8898bb14b7..3efb5211d04 100644 --- a/src-docs/src/views/datagrid/basics/datagrid.js +++ b/src-docs/src/views/datagrid/basics/datagrid.js @@ -23,6 +23,7 @@ import { EuiFlyoutBody, EuiFlyoutFooter, EuiFlyoutHeader, + EuiFormRow, EuiLink, EuiModal, EuiModalBody, @@ -30,6 +31,7 @@ import { EuiModalHeader, EuiModalHeaderTitle, EuiPopover, + EuiRange, EuiScreenReaderOnly, EuiText, EuiTitle, @@ -406,12 +408,31 @@ export default () => { console.log(eventData); }); + const customDisplaySetting = ( + + + + ); return ( )} + {additionalDisplaySettings} + {showResetButton && ( diff --git a/src/components/datagrid/data_grid_types.ts b/src/components/datagrid/data_grid_types.ts index 7bdf0d5ba8b..3b3cc5a1371 100644 --- a/src/components/datagrid/data_grid_types.ts +++ b/src/components/datagrid/data_grid_types.ts @@ -846,6 +846,10 @@ export interface EuiDataGridToolBarVisibilityDisplaySelectorOptions { * When `false`, removes the ability to change row height display through the UI */ allowRowHeight?: boolean; + /** + * If passed an object it will append the additional option to the bottom of the display settings + */ + additionalDisplaySettings?: ReactNode; } export interface EuiDataGridToolBarVisibilityOptions {