From c02dbf013c00535cf21412348c756cda3dffee80 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Thu, 22 Oct 2020 09:36:39 -0600 Subject: [PATCH] in-progress virtualizatin --- src-docs/src/views/datagrid/datagrid.js | 76 ++- src/components/datagrid/column_selector.tsx | 47 +- src/components/datagrid/data_grid.tsx | 388 +++++++------- src/components/datagrid/data_grid_body.tsx | 474 +++++++++++++++--- src/components/datagrid/data_grid_cell.tsx | 49 +- .../datagrid/data_grid_cell_popover.tsx | 4 +- src/components/datagrid/data_grid_context.tsx | 18 +- .../data_grid_control_header_cell.tsx | 32 +- .../datagrid/data_grid_footer_row.tsx | 10 - .../datagrid/data_grid_header_cell.tsx | 51 +- .../datagrid/data_grid_header_row.tsx | 15 - src/components/datagrid/data_grid_schema.tsx | 8 +- 12 files changed, 783 insertions(+), 389 deletions(-) diff --git a/src-docs/src/views/datagrid/datagrid.js b/src-docs/src/views/datagrid/datagrid.js index 7024a855e752..4fcb28da6b73 100644 --- a/src-docs/src/views/datagrid/datagrid.js +++ b/src-docs/src/views/datagrid/datagrid.js @@ -6,6 +6,7 @@ import React, { useState, createContext, useContext, + useRef, } from 'react'; import { fake } from 'faker'; @@ -158,6 +159,70 @@ const columns = [ }, ]; +const leadingControlColumns = [ + { + id: 'actions', + width: 40, + headerCellRender: () => null, + rowCellRender: function RowCellRender() { + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + return ( +
+ setIsPopoverOpen(!isPopoverOpen)} + /> + } + closePopover={() => setIsPopoverOpen(false)} + ownFocus={true}> + Actions +
+ + + +
+
+
+ ); + }, + }, +]; + const trailingControlColumns = [ { id: 'actions', @@ -183,7 +248,7 @@ const trailingControlColumns = [ ownFocus={true}> Actions
-