mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Lens] Remove deprecated closePopover call
- for closeCellPopover ref API
This commit is contained in:
parent
d6cdec1a8c
commit
4984200c1f
2 changed files with 12 additions and 6 deletions
|
@ -43,7 +43,8 @@ export const createGridColumns = (
|
|||
onColumnHide: ((eventData: { columnId: string }) => void) | undefined,
|
||||
alignments: Record<string, 'left' | 'right' | 'center'>,
|
||||
headerRowHeight: 'auto' | 'single' | 'custom',
|
||||
headerRowLines: number
|
||||
headerRowLines: number,
|
||||
closeCellPopover?: Function
|
||||
) => {
|
||||
const columnsReverseLookup = table.columns.reduce<
|
||||
Record<string, { name: string; index: number; meta?: DatatableColumnMeta }>
|
||||
|
@ -73,7 +74,7 @@ export const createGridColumns = (
|
|||
const cellActions =
|
||||
filterable && handleFilterClick
|
||||
? [
|
||||
({ rowIndex, columnId, Component, closePopover }: EuiDataGridColumnCellActionProps) => {
|
||||
({ rowIndex, columnId, Component }: EuiDataGridColumnCellActionProps) => {
|
||||
const { rowValue, contentsIsDefined, cellContent } = getContentData({
|
||||
rowIndex,
|
||||
columnId,
|
||||
|
@ -102,7 +103,7 @@ export const createGridColumns = (
|
|||
data-test-subj="lensDatatableFilterFor"
|
||||
onClick={() => {
|
||||
handleFilterClick(field, rowValue, colIndex, rowIndex);
|
||||
closePopover?.();
|
||||
closeCellPopover?.();
|
||||
}}
|
||||
iconType="plusInCircle"
|
||||
>
|
||||
|
@ -111,7 +112,7 @@ export const createGridColumns = (
|
|||
)
|
||||
);
|
||||
},
|
||||
({ rowIndex, columnId, Component, closePopover }: EuiDataGridColumnCellActionProps) => {
|
||||
({ rowIndex, columnId, Component }: EuiDataGridColumnCellActionProps) => {
|
||||
const { rowValue, contentsIsDefined, cellContent } = getContentData({
|
||||
rowIndex,
|
||||
columnId,
|
||||
|
@ -140,7 +141,7 @@ export const createGridColumns = (
|
|||
aria-label={filterOutAriaLabel}
|
||||
onClick={() => {
|
||||
handleFilterClick(field, rowValue, colIndex, rowIndex, true);
|
||||
closePopover?.();
|
||||
closeCellPopover?.();
|
||||
}}
|
||||
iconType="minusInCircle"
|
||||
>
|
||||
|
|
|
@ -13,6 +13,7 @@ import useDeepCompareEffect from 'react-use/lib/useDeepCompareEffect';
|
|||
import {
|
||||
EuiButtonIcon,
|
||||
EuiDataGrid,
|
||||
EuiDataGridRefProps,
|
||||
EuiDataGridControlColumn,
|
||||
EuiDataGridColumn,
|
||||
EuiDataGridSorting,
|
||||
|
@ -55,6 +56,8 @@ export const DEFAULT_PAGE_SIZE = 10;
|
|||
const PAGE_SIZE_OPTIONS = [DEFAULT_PAGE_SIZE, 20, 30, 50, 100];
|
||||
|
||||
export const DatatableComponent = (props: DatatableRenderProps) => {
|
||||
const dataGridRef = useRef<EuiDataGridRefProps>(null);
|
||||
|
||||
const [firstTable] = Object.values(props.data.tables);
|
||||
|
||||
const isInteractive = props.interactive;
|
||||
|
@ -272,7 +275,8 @@ export const DatatableComponent = (props: DatatableRenderProps) => {
|
|||
onColumnHide,
|
||||
alignments,
|
||||
headerRowHeight,
|
||||
headerRowLines
|
||||
headerRowLines,
|
||||
dataGridRef.current?.closeCellPopover
|
||||
),
|
||||
[
|
||||
bucketColumns,
|
||||
|
@ -454,6 +458,7 @@ export const DatatableComponent = (props: DatatableRenderProps) => {
|
|||
onColumnResize={onColumnResize}
|
||||
toolbarVisibility={false}
|
||||
renderFooterCellValue={renderSummaryRow}
|
||||
ref={dataGridRef}
|
||||
/>
|
||||
</DataContext.Provider>
|
||||
</VisualizationContainer>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue