-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Move data grid interfaces to standard API page layout (#12016)
Co-authored-by: Andrew Cherniavskyi <andrew@mui.com>
- Loading branch information
1 parent
7e2d2ec
commit 28da4ca
Showing
67 changed files
with
2,499 additions
and
931 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,26 @@ | ||
import * as React from 'react'; | ||
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; | ||
import * as pageProps from './grid-actions-col-def.md?muiMarkdown'; | ||
import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; | ||
import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; | ||
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
import jsonPageContent from './grid-actions-col-def.json'; | ||
|
||
export default function Page() { | ||
return <MarkdownDocs {...pageProps} />; | ||
export default function Page(props) { | ||
const { descriptions, pageContent } = props; | ||
return ( | ||
<InterfaceApiPage {...layoutConfig} descriptions={descriptions} pageContent={pageContent} /> | ||
); | ||
} | ||
|
||
Page.getInitialProps = () => { | ||
const req = require.context( | ||
'docsx/translations/api-docs/data-grid/', | ||
false, | ||
/\.\/grid-actions-col-def.*.json$/, | ||
); | ||
const descriptions = mapApiPageTranslations(req); | ||
|
||
return { | ||
descriptions, | ||
pageContent: jsonPageContent, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
{ | ||
"name": "GridActionsColDef", | ||
"imports": [ | ||
"import { GridActionsColDef } from '@mui/x-data-grid-premium'", | ||
"import { GridActionsColDef } from '@mui/x-data-grid-pro'", | ||
"import { GridActionsColDef } from '@mui/x-data-grid'" | ||
], | ||
"demos": "<ul><li><a href=\"/x/react-data-grid/column-definition/#special-properties\">Special column properties</a></li></ul>", | ||
"properties": { | ||
"field": { "type": { "description": "string" }, "required": true }, | ||
"getActions": { | ||
"type": { | ||
"description": "(params: GridRowParams<R>) => React.ReactElement<GridActionsCellItemProps>[]" | ||
}, | ||
"required": true | ||
}, | ||
"type": { "type": { "description": "'actions'" }, "default": "'actions'", "required": true }, | ||
"aggregable": { | ||
"type": { "description": "boolean" }, | ||
"default": "true", | ||
"isPremiumPlan": true | ||
}, | ||
"align": { "type": { "description": "GridAlignment" } }, | ||
"availableAggregationFunctions": { | ||
"type": { "description": "string[]" }, | ||
"isPremiumPlan": true | ||
}, | ||
"cellClassName": { "type": { "description": "GridCellClassNamePropType<R, V>" } }, | ||
"colSpan": { | ||
"type": { "description": "number | GridColSpanFn<R, V, F>" }, | ||
"default": "1" | ||
}, | ||
"description": { "type": { "description": "string" } }, | ||
"disableColumnMenu": { "type": { "description": "boolean" }, "default": "false" }, | ||
"disableExport": { "type": { "description": "boolean" }, "default": "false" }, | ||
"disableReorder": { "type": { "description": "boolean" }, "default": "false" }, | ||
"display": { "type": { "description": "'text' | 'flex'" } }, | ||
"editable": { "type": { "description": "boolean" }, "default": "false" }, | ||
"filterable": { "type": { "description": "boolean" }, "default": "true" }, | ||
"filterOperators": { "type": { "description": "GridFilterOperator<R, V, F>[]" } }, | ||
"flex": { "type": { "description": "number" } }, | ||
"getApplyQuickFilterFn": { "type": { "description": "GetApplyQuickFilterFn<R, V>" } }, | ||
"getSortComparator": { | ||
"type": { | ||
"description": "(sortDirection: GridSortDirection) => GridComparatorFn<V> | undefined" | ||
} | ||
}, | ||
"groupable": { "type": { "description": "boolean" }, "default": "true" }, | ||
"groupingValueGetter": { | ||
"type": { "description": "GridGroupingValueGetter<R>" }, | ||
"isPremiumPlan": true | ||
}, | ||
"headerAlign": { "type": { "description": "GridAlignment" } }, | ||
"headerClassName": { "type": { "description": "GridColumnHeaderClassNamePropType" } }, | ||
"headerName": { "type": { "description": "string" } }, | ||
"hideable": { "type": { "description": "boolean" }, "default": "true" }, | ||
"hideSortIcons": { "type": { "description": "boolean" }, "default": "false" }, | ||
"maxWidth": { "type": { "description": "number" }, "default": "Infinity" }, | ||
"minWidth": { "type": { "description": "number" }, "default": "50" }, | ||
"pastedValueParser": { | ||
"type": { "description": "GridPastedValueParser<R, V, F>" }, | ||
"isPremiumPlan": true | ||
}, | ||
"pinnable": { "type": { "description": "boolean" }, "default": "true" }, | ||
"preProcessEditCellProps": { | ||
"type": { | ||
"description": "(params: GridPreProcessEditCellProps) => GridEditCellProps | Promise<GridEditCellProps>" | ||
} | ||
}, | ||
"renderCell": { | ||
"type": { | ||
"description": "(params: GridRenderCellParams<R, V, F>) => React.ReactNode" | ||
} | ||
}, | ||
"renderEditCell": { | ||
"type": { | ||
"description": "(params: GridRenderEditCellParams<R, V, F>) => React.ReactNode" | ||
} | ||
}, | ||
"renderHeader": { | ||
"type": { | ||
"description": "(params: GridColumnHeaderParams<R, V, F>) => React.ReactNode" | ||
} | ||
}, | ||
"renderHeaderFilter": { | ||
"type": { "description": "(params: GridRenderHeaderFilterProps) => React.ReactNode" }, | ||
"isProPlan": true | ||
}, | ||
"resizable": { "type": { "description": "boolean" }, "default": "true" }, | ||
"sortable": { "type": { "description": "boolean" }, "default": "true" }, | ||
"sortComparator": { "type": { "description": "GridComparatorFn<V>" } }, | ||
"sortingOrder": { "type": { "description": "GridSortDirection[]" } }, | ||
"valueFormatter": { "type": { "description": "GridValueFormatter<R, V, F>" } }, | ||
"valueGetter": { "type": { "description": "GridValueGetter<R, V, F>" } }, | ||
"valueParser": { "type": { "description": "GridValueParser<R, V, F>" } }, | ||
"valueSetter": { "type": { "description": "GridValueSetter<R, V, F>" } }, | ||
"width": { "type": { "description": "number" }, "default": "100" } | ||
} | ||
} |
Oops, something went wrong.