From 6d95073efb688fd45c8ea43d21a87962e9e17ee6 Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskii Date: Sat, 25 May 2024 00:35:52 +0200 Subject: [PATCH] [DataGrid] Export `GridColumnHeadersProps` (#13229) --- docs/pages/x/api/data-grid/data-grid-premium.json | 2 +- docs/pages/x/api/data-grid/data-grid-pro.json | 2 +- docs/pages/x/api/data-grid/data-grid.json | 2 +- packages/x-data-grid-premium/src/index.ts | 1 + packages/x-data-grid-pro/src/components/GridColumnHeaders.tsx | 4 ++-- packages/x-data-grid-pro/src/index.ts | 1 + packages/x-data-grid/src/index.ts | 1 + packages/x-data-grid/src/models/gridSlotsComponent.ts | 2 +- scripts/x-data-grid-premium.exports.json | 1 + scripts/x-data-grid-pro.exports.json | 1 + scripts/x-data-grid.exports.json | 1 + 11 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/pages/x/api/data-grid/data-grid-premium.json b/docs/pages/x/api/data-grid/data-grid-premium.json index 5800b14cc52f..9c1b3c520566 100644 --- a/docs/pages/x/api/data-grid/data-grid-premium.json +++ b/docs/pages/x/api/data-grid/data-grid-premium.json @@ -673,7 +673,7 @@ { "name": "columnHeaders", "description": "Component responsible for rendering the column headers.", - "default": "DataGridColumnHeaders", + "default": "GridColumnHeaders", "class": "MuiDataGridPremium-columnHeaders" }, { diff --git a/docs/pages/x/api/data-grid/data-grid-pro.json b/docs/pages/x/api/data-grid/data-grid-pro.json index 5e96f8adbe84..adac731e3a34 100644 --- a/docs/pages/x/api/data-grid/data-grid-pro.json +++ b/docs/pages/x/api/data-grid/data-grid-pro.json @@ -608,7 +608,7 @@ { "name": "columnHeaders", "description": "Component responsible for rendering the column headers.", - "default": "DataGridColumnHeaders", + "default": "GridColumnHeaders", "class": "MuiDataGridPro-columnHeaders" }, { diff --git a/docs/pages/x/api/data-grid/data-grid.json b/docs/pages/x/api/data-grid/data-grid.json index 8fad1a4c4063..b7d2b16bc7ea 100644 --- a/docs/pages/x/api/data-grid/data-grid.json +++ b/docs/pages/x/api/data-grid/data-grid.json @@ -506,7 +506,7 @@ { "name": "columnHeaders", "description": "Component responsible for rendering the column headers.", - "default": "DataGridColumnHeaders", + "default": "GridColumnHeaders", "class": "MuiDataGrid-columnHeaders" }, { diff --git a/packages/x-data-grid-premium/src/index.ts b/packages/x-data-grid-premium/src/index.ts index 5e9f3e0c5334..0def4c628a75 100644 --- a/packages/x-data-grid-premium/src/index.ts +++ b/packages/x-data-grid-premium/src/index.ts @@ -25,6 +25,7 @@ export * from './models'; export * from './components'; export { GridColumnHeaders } from '@mui/x-data-grid-pro'; +export type { GridColumnHeadersProps } from '@mui/x-data-grid-pro'; export type { DataGridPremiumProps, diff --git a/packages/x-data-grid-pro/src/components/GridColumnHeaders.tsx b/packages/x-data-grid-pro/src/components/GridColumnHeaders.tsx index 25305f8e2c3f..ea0327ece85e 100644 --- a/packages/x-data-grid-pro/src/components/GridColumnHeaders.tsx +++ b/packages/x-data-grid-pro/src/components/GridColumnHeaders.tsx @@ -9,11 +9,11 @@ const Filler = styled('div')({ backgroundColor: 'var(--DataGrid-containerBackground)', }); -interface DataGridProColumnHeadersProps +export interface GridColumnHeadersProps extends React.HTMLAttributes, UseGridColumnHeadersProps {} -const GridColumnHeaders = React.forwardRef( +const GridColumnHeaders = React.forwardRef( function GridColumnHeaders(props, ref) { const { style, diff --git a/packages/x-data-grid-pro/src/index.ts b/packages/x-data-grid-pro/src/index.ts index 3a47149e4706..e100b7283cca 100644 --- a/packages/x-data-grid-pro/src/index.ts +++ b/packages/x-data-grid-pro/src/index.ts @@ -38,3 +38,4 @@ export { } from './components/reexports'; export { GridColumnHeaders } from './components/GridColumnHeaders'; +export type { GridColumnHeadersProps } from './components/GridColumnHeaders'; diff --git a/packages/x-data-grid/src/index.ts b/packages/x-data-grid/src/index.ts index 1414eac4e3b6..385e5a8da1e7 100644 --- a/packages/x-data-grid/src/index.ts +++ b/packages/x-data-grid/src/index.ts @@ -20,6 +20,7 @@ export type { GridToolbarExportProps } from './components/toolbar/GridToolbarExp export type { GridExportFormat, GridExportExtension } from './models/gridExport'; export { GridColumnHeaders } from './components/GridColumnHeaders'; +export type { GridColumnHeadersProps } from './components/GridColumnHeaders'; /** * Reexportable components. diff --git a/packages/x-data-grid/src/models/gridSlotsComponent.ts b/packages/x-data-grid/src/models/gridSlotsComponent.ts index e9badaecaf5d..f08dc9dde12f 100644 --- a/packages/x-data-grid/src/models/gridSlotsComponent.ts +++ b/packages/x-data-grid/src/models/gridSlotsComponent.ts @@ -100,7 +100,7 @@ export interface GridSlotsComponent extends GridBaseSlots, GridIconSlotsComponen columnMenu: React.JSXElementConstructor; /** * Component responsible for rendering the column headers. - * @default DataGridColumnHeaders + * @default GridColumnHeaders */ columnHeaders: React.JSXElementConstructor; /** diff --git a/scripts/x-data-grid-premium.exports.json b/scripts/x-data-grid-premium.exports.json index 9723176f8754..8958c94d078b 100644 --- a/scripts/x-data-grid-premium.exports.json +++ b/scripts/x-data-grid-premium.exports.json @@ -175,6 +175,7 @@ { "name": "GridColumnHeaderSeparatorSides", "kind": "Enum" }, { "name": "GridColumnHeaderSortIcon", "kind": "Variable" }, { "name": "GridColumnHeaderSortIconProps", "kind": "Interface" }, + { "name": "GridColumnHeadersProps", "kind": "Interface" }, { "name": "GridColumnHeaderTitle", "kind": "Function" }, { "name": "GridColumnHeaderTitleProps", "kind": "Interface" }, { "name": "GridColumnIcon", "kind": "Variable" }, diff --git a/scripts/x-data-grid-pro.exports.json b/scripts/x-data-grid-pro.exports.json index 314428c421b6..6a7d1870c023 100644 --- a/scripts/x-data-grid-pro.exports.json +++ b/scripts/x-data-grid-pro.exports.json @@ -151,6 +151,7 @@ { "name": "GridColumnHeaderSeparatorSides", "kind": "Enum" }, { "name": "GridColumnHeaderSortIcon", "kind": "Variable" }, { "name": "GridColumnHeaderSortIconProps", "kind": "Interface" }, + { "name": "GridColumnHeadersProps", "kind": "Interface" }, { "name": "GridColumnHeaderTitle", "kind": "Function" }, { "name": "GridColumnHeaderTitleProps", "kind": "Interface" }, { "name": "GridColumnIcon", "kind": "Variable" }, diff --git a/scripts/x-data-grid.exports.json b/scripts/x-data-grid.exports.json index 16a74ef16850..c23d717cd34b 100644 --- a/scripts/x-data-grid.exports.json +++ b/scripts/x-data-grid.exports.json @@ -143,6 +143,7 @@ { "name": "GridColumnHeaderSeparatorSides", "kind": "Enum" }, { "name": "GridColumnHeaderSortIcon", "kind": "Variable" }, { "name": "GridColumnHeaderSortIconProps", "kind": "Interface" }, + { "name": "GridColumnHeadersProps", "kind": "Interface" }, { "name": "GridColumnHeaderTitle", "kind": "Function" }, { "name": "GridColumnHeaderTitleProps", "kind": "Interface" }, { "name": "GridColumnIcon", "kind": "Variable" },