From 8b8973052992b6084979eb288c4734896b816980 Mon Sep 17 00:00:00 2001 From: Cee Chen Date: Tue, 25 Jul 2023 18:12:50 -0700 Subject: [PATCH] [docs] Fix EuiDataGrid not correctly loading pagination `@default`s --- .../datagrid/advanced/datagrid_memory_example.js | 2 +- src-docs/src/views/datagrid/basics/_props.tsx | 12 ++++++++++-- .../src/views/datagrid/basics/datagrid_example.js | 3 +-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src-docs/src/views/datagrid/advanced/datagrid_memory_example.js b/src-docs/src/views/datagrid/advanced/datagrid_memory_example.js index 506f35d67cfa..e55927a27504 100644 --- a/src-docs/src/views/datagrid/advanced/datagrid_memory_example.js +++ b/src-docs/src/views/datagrid/advanced/datagrid_memory_example.js @@ -23,7 +23,6 @@ const inMemorySortingDataGridSource = require('!!raw-loader!./in_memory_sorting' import { EuiDataGridColumn, - EuiDataGridPaginationProps, EuiDataGridSorting, EuiDataGridInMemory, EuiDataGridStyle, @@ -32,6 +31,7 @@ import { EuiDataGridCellValueElementProps, EuiDataGridSchemaDetector, } from '!!prop-loader!../../../../../src/components/datagrid/data_grid_types'; +import { EuiDataGridPaginationProps } from '../basics/_props'; export const DataGridMemoryExample = { sections: [ diff --git a/src-docs/src/views/datagrid/basics/_props.tsx b/src-docs/src/views/datagrid/basics/_props.tsx index 33d578b0ca63..875890ca7012 100644 --- a/src-docs/src/views/datagrid/basics/_props.tsx +++ b/src-docs/src/views/datagrid/basics/_props.tsx @@ -1,5 +1,8 @@ -import React from 'react'; -import { EuiDataGrid } from '../../../../../src/components'; +import React, { FunctionComponent } from 'react'; +import { + EuiDataGrid, + EuiDataGridPaginationProps as _EuiDataGridPaginationProps, +} from '../../../../../src/components'; import { DataGridPropsTable } from '../_props_table'; import { gridSnippets } from '../_snippets'; @@ -41,3 +44,8 @@ export const DataGridTopProps = () => { /> ); }; + +// Loading `EuiDataGridPaginationProps` via !prop-loader doesn't correctly inherit @defaults +export const EuiDataGridPaginationProps: FunctionComponent< + _EuiDataGridPaginationProps +> = () =>
; diff --git a/src-docs/src/views/datagrid/basics/datagrid_example.js b/src-docs/src/views/datagrid/basics/datagrid_example.js index 67eb4a168570..42aff13527c7 100644 --- a/src-docs/src/views/datagrid/basics/datagrid_example.js +++ b/src-docs/src/views/datagrid/basics/datagrid_example.js @@ -12,7 +12,7 @@ import { } from '../../../../../src/components'; import DataGrid from './datagrid'; -import { DataGridTopProps } from './_props'; +import { DataGridTopProps, EuiDataGridPaginationProps } from './_props'; const dataGridSource = require('!!raw-loader!./datagrid'); import DataGridContainer from './container'; @@ -28,7 +28,6 @@ const dataGridVirtualizationConstrainedSource = require('!!raw-loader!./virtuali import { EuiDataGridColumn, EuiDataGridColumnCellAction, - EuiDataGridPaginationProps, EuiDataGridSorting, EuiDataGridInMemory, EuiDataGridStyle,