diff --git a/docs/pages/x/api/data-grid/grid-print-export-options.json b/docs/pages/x/api/data-grid/grid-print-export-options.json index 6d19c1df3ffc0..09e234b76a5a0 100644 --- a/docs/pages/x/api/data-grid/grid-print-export-options.json +++ b/docs/pages/x/api/data-grid/grid-print-export-options.json @@ -18,6 +18,6 @@ "hideFooter": { "type": { "description": "boolean" }, "default": "false" }, "hideToolbar": { "type": { "description": "boolean" }, "default": "false" }, "includeCheckboxes": { "type": { "description": "boolean" }, "default": "false" }, - "pageStyle": { "type": { "description": "string | Function" } } + "pageStyle": { "type": { "description": "string | (() => string)" } } } } diff --git a/packages/x-data-grid/src/components/toolbar/GridToolbarExport.tsx b/packages/x-data-grid/src/components/toolbar/GridToolbarExport.tsx index 672e5e32dbe15..7b3ee4453cf51 100644 --- a/packages/x-data-grid/src/components/toolbar/GridToolbarExport.tsx +++ b/packages/x-data-grid/src/components/toolbar/GridToolbarExport.tsx @@ -107,22 +107,7 @@ GridPrintExportMenuItem.propTypes = { hideFooter: PropTypes.bool, hideToolbar: PropTypes.bool, includeCheckboxes: PropTypes.bool, - pageStyle: PropTypes.oneOfType([ - PropTypes.shape({ - '__@hasInstance@646': PropTypes.func.isRequired, - '__@metadata@648': PropTypes.any, - apply: PropTypes.func.isRequired, - arguments: PropTypes.any.isRequired, - bind: PropTypes.func.isRequired, - call: PropTypes.func.isRequired, - caller: PropTypes.object.isRequired, - length: PropTypes.number.isRequired, - name: PropTypes.string.isRequired, - prototype: PropTypes.any.isRequired, - toString: PropTypes.func.isRequired, - }), - PropTypes.string, - ]), + pageStyle: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), }), } as any; diff --git a/packages/x-data-grid/src/models/gridExport.ts b/packages/x-data-grid/src/models/gridExport.ts index 98220015a8557..a0a628b4b38c0 100644 --- a/packages/x-data-grid/src/models/gridExport.ts +++ b/packages/x-data-grid/src/models/gridExport.ts @@ -149,7 +149,7 @@ export interface GridPrintExportOptions extends GridExportOptions { /** * Provide Print specific styles to the print window. */ - pageStyle?: string | Function; + pageStyle?: string | (() => string); /** * Function that returns the list of row ids to export in the order they should be exported. * @param {GridPrintGetRowsToExportParams} params With all properties from [[GridPrintGetRowsToExportParams]].