Skip to content

Commit

Permalink
[DataGrid] Fix ugly prop-types for the pageStyle prop of the `GridP…
Browse files Browse the repository at this point in the history
…rintExportMenuItem` component (#15015)
  • Loading branch information
flaviendelangle authored Oct 18, 2024
1 parent 6a5545e commit b3700ae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/pages/x/api/data-grid/grid-print-export-options.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)" } }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid/src/models/gridExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]].
Expand Down

0 comments on commit b3700ae

Please sign in to comment.