Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Generate docs for components #2465

Merged
merged 19 commits into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ commands:
- restore_cache:
name: Restore yarn cache
keys:
- v7-yarn-{{ checksum "yarn.lock" }}
- v7-yarn-
- v8-yarn-{{ checksum "yarn.lock" }}
- v8-yarn-
- run:
name: Set yarn cache folder
command: |
# Keep path in sync with `save_cache` for key "v7-yarn-"
# Keep path in sync with `save_cache` for key "v8-yarn-"
yarn config set cache-folder /tmp/yarn-cache
# Debug information
yarn cache dir
Expand All @@ -83,7 +83,7 @@ commands:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: <<# parameters.browsers >>0<</ parameters.browsers >><<^ parameters.browsers >>1<</ parameters.browsers >>
- save_cache:
name: Save yarn cache
key: v7-yarn-{{ checksum "yarn.lock" }}
key: v8-yarn-{{ checksum "yarn.lock" }}
paths:
# Keep path in sync with "Set yarn cache folder"
# Can't use environment variables for `save_cache` paths (tested in https://app.circleci.com/pipelines/github/mui-org/material-ui/37813/workflows/5b1e207f-ac8b-44e7-9ba4-d0f9a01f5c55/jobs/223370)
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const defaultAlias = {
'@mui/x-data-grid-generator': resolveAliasPath('./packages/grid/x-grid-data-generator/src'),
'@mui/x-data-grid-pro': resolveAliasPath('./packages/grid/x-grid/src'),
'@mui/x-license-pro': resolveAliasPath('./packages/x-license/src'),
'typescript-to-proptypes': '@material-ui/monorepo/packages/typescript-to-proptypes/src',
flaviendelangle marked this conversation as resolved.
Show resolved Hide resolved
docs: resolveAliasPath('./node_modules/@material-ui/monorepo/docs'),
};

Expand Down
2 changes: 1 addition & 1 deletion docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = {
REACT_STRICT_MODE: reactStrictMode,
// Set by Netlify
GRID_EXPERIMENTAL_ENABLED: process.env.PULL_REQUEST === 'false' ? 'false' : 'true',
SOURCE_CODE_ROOT_URL: '/~https://github.com/mui-org/material-ui-x/blob/master',
SOURCE_CODE_ROOT_URL: '/~https://github.com/mui-org/material-ui-x/blob/next',
SOURCE_CODE_REPO: '/~https://github.com/mui-org/material-ui-x',
},
webpack5: true,
Expand Down
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@mui/styles": "^5.0.1",
"@mui/utils": "^5.0.1",
"@trendmicro/react-interpolate": "^0.5.5",
"@types/lodash": "^4.14.173",
"@types/react-dom": "^17.0.9",
"@types/react-router-dom": "^5.1.8",
"accept-language": "^3.0.18",
Expand Down
24 changes: 20 additions & 4 deletions docs/pages/api-docs/data-grid/data-grid-pro.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
import * as React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { demos, docs, demoComponents } from './data-grid-pro.md?@mui/markdown';
import ApiPage from 'docsx/src/modules/components/ApiPage';
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';
import jsonPageContent from './data-grid-pro.json';

export default function Page() {
return <MarkdownDocs demos={demos} docs={docs} demoComponents={demoComponents} />;
export default function Page(props) {
const { descriptions, pageContent } = props;
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
}

Page.getInitialProps = () => {
const req = require.context(
'docsx/translations/api-docs/data-grid',
false,
/data-grid-pro.*.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
296 changes: 296 additions & 0 deletions docs/pages/api-docs/data-grid/data-grid-pro.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,296 @@
{
"props": {
"columns": {
"type": { "name": "arrayOf", "description": "Array&lt;object&gt;" },
"required": true
},
"rows": {
"type": { "name": "arrayOf", "description": "Array&lt;object&gt;" },
"required": true
},
"apiRef": { "type": { "name": "shape", "description": "{ current: object }" } },
"aria-label": { "type": { "name": "string" } },
"aria-labelledby": { "type": { "name": "string" } },
"autoHeight": { "type": { "name": "bool" } },
"autoPageSize": { "type": { "name": "bool" } },
"checkboxSelection": { "type": { "name": "bool" } },
"checkboxSelectionVisibleOnly": {
"type": { "name": "custom", "description": "bool" },
"default": "false"
},
"classes": { "type": { "name": "object" } },
"columnBuffer": { "type": { "name": "number" }, "default": "3" },
"columnThreshold": { "type": { "name": "number" }, "default": "3" },
"columnTypes": { "type": { "name": "object" } },
"components": { "type": { "name": "object" } },
"componentsProps": { "type": { "name": "object" } },
"density": {
"type": {
"name": "enum",
"description": "'comfortable'<br>&#124;&nbsp;'compact'<br>&#124;&nbsp;'standard'"
},
"default": "\"standard\""
},
"disableColumnFilter": { "type": { "name": "bool" } },
"disableColumnMenu": { "type": { "name": "bool" } },
"disableColumnReorder": { "type": { "name": "bool" } },
"disableColumnResize": { "type": { "name": "bool" } },
"disableColumnSelector": { "type": { "name": "bool" } },
"disableDensitySelector": { "type": { "name": "bool" } },
"disableExtendRowFullWidth": { "type": { "name": "bool" } },
"disableMultipleColumnsFiltering": { "type": { "name": "bool" } },
"disableMultipleColumnsSorting": { "type": { "name": "bool" } },
"disableMultipleSelection": { "type": { "name": "bool" } },
"disableSelectionOnClick": { "type": { "name": "bool" } },
"disableVirtualization": { "type": { "name": "bool" } },
"editMode": {
"type": { "name": "enum", "description": "'cell'<br>&#124;&nbsp;'row'" },
"default": "\"cell\""
},
"editRowsModel": { "type": { "name": "object" } },
"error": { "type": { "name": "any" } },
"filterMode": {
"type": { "name": "enum", "description": "'client'<br>&#124;&nbsp;'server'" },
"default": "\"client\""
},
"filterModel": {
"type": {
"name": "shape",
"description": "{ items: Array&lt;{ columnField?: string, id?: number<br>&#124;&nbsp;string, operatorValue?: string, value?: any }&gt;, linkOperator?: 'and'<br>&#124;&nbsp;'or' }"
}
},
"getCellClassName": { "type": { "name": "func" } },
"getRowClassName": { "type": { "name": "func" } },
"getRowId": { "type": { "name": "func" } },
"headerHeight": { "type": { "name": "number" }, "default": "56" },
"hideFooter": { "type": { "name": "bool" } },
"hideFooterPagination": { "type": { "name": "bool" } },
"hideFooterRowCount": {
"type": { "name": "custom", "description": "bool" },
"default": "false"
},
"hideFooterSelectedRowCount": { "type": { "name": "bool" } },
"initialState": { "type": { "name": "object" } },
"isCellEditable": { "type": { "name": "func" } },
"isRowSelectable": { "type": { "name": "func" } },
"loading": { "type": { "name": "bool" } },
"localeText": { "type": { "name": "object" } },
"logger": {
"type": {
"name": "shape",
"description": "{ debug: func, error: func, info: func, warn: func }"
},
"default": "console"
},
"logLevel": {
"type": {
"name": "enum",
"description": "'debug'<br>&#124;&nbsp;'error'<br>&#124;&nbsp;'info'<br>&#124;&nbsp;'warn'<br>&#124;&nbsp;false"
},
"default": "\"debug\""
},
"nonce": { "type": { "name": "string" } },
"onCellClick": { "type": { "name": "func" } },
"onCellDoubleClick": { "type": { "name": "func" } },
"onCellEditCommit": { "type": { "name": "func" } },
"onCellEditStart": { "type": { "name": "func" } },
"onCellEditStop": { "type": { "name": "func" } },
"onCellFocusOut": { "type": { "name": "func" } },
"onCellKeyDown": { "type": { "name": "func" } },
"onCellValueChange": { "type": { "name": "func" } },
"onColumnHeaderClick": { "type": { "name": "func" } },
"onColumnHeaderDoubleClick": { "type": { "name": "func" } },
"onColumnHeaderEnter": { "type": { "name": "func" } },
"onColumnHeaderLeave": { "type": { "name": "func" } },
"onColumnHeaderOut": { "type": { "name": "func" } },
"onColumnHeaderOver": { "type": { "name": "func" } },
"onColumnOrderChange": { "type": { "name": "func" } },
"onColumnResize": { "type": { "name": "func" } },
"onColumnVisibilityChange": { "type": { "name": "func" } },
"onColumnWidthChange": { "type": { "name": "func" } },
"onEditCellPropsChange": { "type": { "name": "func" } },
"onEditRowsModelChange": { "type": { "name": "func" } },
"onError": { "type": { "name": "func" } },
"onFilterModelChange": { "type": { "name": "func" } },
"onPageChange": { "type": { "name": "func" } },
"onPageSizeChange": { "type": { "name": "func" } },
"onResize": { "type": { "name": "func" } },
"onRowClick": { "type": { "name": "func" } },
"onRowDoubleClick": { "type": { "name": "func" } },
"onRowEditCommit": { "type": { "name": "func" } },
"onRowEditStart": { "type": { "name": "func" } },
"onRowEditStop": { "type": { "name": "func" } },
"onRowsScrollEnd": { "type": { "name": "func" } },
"onSelectionModelChange": { "type": { "name": "func" } },
"onSortModelChange": { "type": { "name": "func" } },
"onStateChange": { "type": { "name": "func" } },
"page": { "type": { "name": "number" }, "default": "0" },
"pageSize": { "type": { "name": "number" }, "default": "100" },
"pagination": { "type": { "name": "bool" } },
"paginationMode": {
"type": { "name": "enum", "description": "'client'<br>&#124;&nbsp;'server'" },
"default": "\"client\""
},
"rowBuffer": { "type": { "name": "number" }, "default": "3" },
"rowCount": { "type": { "name": "number" } },
"rowHeight": { "type": { "name": "number" }, "default": "52" },
"rowsPerPageOptions": {
"type": { "name": "arrayOf", "description": "Array&lt;number&gt;" },
"default": "[25, 50, 100]"
},
"rowThreshold": { "type": { "name": "number" }, "default": "3" },
"scrollbarSize": { "type": { "name": "number" } },
"scrollEndThreshold": { "type": { "name": "number" } },
"selectionModel": {
"type": {
"name": "union",
"description": "Array&lt;number<br>&#124;&nbsp;string&gt;<br>&#124;&nbsp;number<br>&#124;&nbsp;string"
}
},
"showCellRightBorder": { "type": { "name": "bool" } },
"showColumnRightBorder": { "type": { "name": "bool" } },
"sortingMode": {
"type": { "name": "enum", "description": "'client'<br>&#124;&nbsp;'server'" },
"default": "\"client\""
},
"sortingOrder": {
"type": { "name": "arrayOf", "description": "Array&lt;'asc'<br>&#124;&nbsp;'desc'&gt;" },
"default": "['asc', 'desc', null]"
},
"sortModel": {
"type": {
"name": "arrayOf",
"description": "Array&lt;{ field: string, sort?: 'asc'<br>&#124;&nbsp;'desc' }&gt;"
}
},
"throttleRowsMs": { "type": { "name": "number" }, "default": "0" }
},
"slots": {
"BooleanCellFalseIcon": { "default": "GridCloseIcon", "type": { "name": "elementType" } },
"BooleanCellTrueIcon": { "default": "GridCheckIcon", "type": { "name": "elementType" } },
"Cell": { "type": { "name": "elementType" } },
"Checkbox": { "default": "Checkbox", "type": { "name": "elementType" } },
"ColumnFilteredIcon": { "default": "GridFilterAltIcon", "type": { "name": "elementType" } },
"ColumnMenu": { "default": "GridColumnMenu", "type": { "name": "elementType" } },
"ColumnMenuIcon": {
"default": "GridTripleDotsVerticalIcon",
"type": { "name": "elementType" }
},
"ColumnResizeIcon": { "default": "GridSeparatorIcon", "type": { "name": "elementType" } },
"ColumnSelectorIcon": { "default": "GridColumnIcon", "type": { "name": "elementType" } },
"ColumnSortedAscendingIcon": {
"default": "GridArrowUpwardIcon",
"type": { "name": "elementType | null" }
},
"ColumnSortedDescendingIcon": {
"default": "GridArrowDownwardIcon",
"type": { "name": "elementType | null" }
},
"ColumnsPanel": { "default": "GridColumnsPanel", "type": { "name": "elementType" } },
"ColumnUnsortedIcon": {
"default": "GridColumnUnsortedIcon",
"type": { "name": "elementType | null" }
},
"DensityComfortableIcon": {
"default": "GridViewStreamIcon",
"type": { "name": "elementType" }
},
"DensityCompactIcon": { "default": "GridViewHeadlineIcon", "type": { "name": "elementType" } },
"DensityStandardIcon": { "default": "GridTableRowsIcon", "type": { "name": "elementType" } },
"ErrorOverlay": { "default": "ErrorOverlay", "type": { "name": "elementType" } },
"ExportIcon": { "default": "GridSaveAltIcon", "type": { "name": "elementType" } },
"FilterPanel": { "default": "GridFilterPanel", "type": { "name": "elementType" } },
"Footer": { "default": "GridFooter", "type": { "name": "elementType" } },
"Header": { "default": "GridHeader", "type": { "name": "elementType" } },
"LoadingOverlay": { "default": "GridLoadingOverlay", "type": { "name": "elementType" } },
"MoreActionsIcon": { "default": "GridMoreVertIcon", "type": { "name": "elementType" } },
"NoResultsOverlay": { "default": "GridNoResultsOverlay", "type": { "name": "elementType" } },
"NoRowsOverlay": { "default": "GridNoRowsOverlay", "type": { "name": "elementType" } },
"OpenFilterButtonIcon": { "default": "GridFilterListIcon", "type": { "name": "elementType" } },
"Pagination": { "default": "Pagination", "type": { "name": "elementType | null" } },
"Panel": { "default": "GridPanel", "type": { "name": "elementType" } },
"PreferencesPanel": { "default": "GridPreferencesPanel", "type": { "name": "elementType" } },
"Row": { "type": { "name": "elementType" } },
"Toolbar": { "default": "null", "type": { "name": "elementType | null" } }
},
"name": "DataGridPro",
"styles": {
"classes": [
"autoHeight",
"booleanCell",
"cell--editable",
"cell--editing",
"cell--textCenter",
"cell--textLeft",
"cell--textRight",
"cell--withRenderer",
"cell",
"cellCheckbox",
"checkboxInput",
"columnHeader--alignCenter",
"columnHeader--alignLeft",
"columnHeader--alignRight",
"columnHeader--dragging",
"columnHeader--moving",
"columnHeader--numeric",
"columnHeader--sortable",
"columnHeader--sorted",
"columnHeader",
"columnHeaderCheckbox",
"columnHeaderDraggableContainer",
"columnHeaderDropZone",
"columnHeaderTitle",
"columnHeaderTitleContainer",
"columnHeaderWrapper",
"columnsContainer",
"columnSeparator--resizable",
"columnSeparator--resizing",
"columnSeparator",
"columnsPanel",
"columnsPanelRow",
"panel",
"panelHeader",
"panelWrapper",
"panelContent",
"panelFooter",
"paper",
"editBooleanCell",
"filterForm",
"editInputCell",
"filterIcon",
"footerContainer",
"iconButtonContainer",
"iconSeparator",
"main",
"menu",
"menuIcon",
"menuIconButton",
"menuOpen",
"menuList",
"overlay",
"virtualScroller",
"virtualScrollerContent",
"virtualScrollerRenderZone",
"root",
"row--editable",
"row--editing",
"row",
"rowCount",
"scrollArea",
"scrollAreaLeft",
"scrollAreaRight",
"selectedRowCount",
"sortIcon",
"toolbarContainer",
"toolbarFilterList",
"viewport",
"window",
"withBorder"
],
"globalClasses": {},
"name": "MuiDataGrid"
},
"forwardsRefTo": "GridRoot",
"filename": "/packages/grid/x-grid/src/DataGridPro.tsx",
"demos": "<ul><li><a href=\"/components/data-grid#commercial-version\">DataGridPro</a></li></ul>"
}
Loading