From 702be5edb05c1d295d3e5ce8154cc7affb9719c7 Mon Sep 17 00:00:00 2001 From: alexandre Date: Thu, 28 Mar 2024 13:38:13 +0100 Subject: [PATCH 1/8] modify scripts and render page --- .../api/buildInterfacesDocumentation.ts | 225 +++++++++--------- docs/scripts/api/utils.ts | 6 +- .../modules/components/InterfaceApiPage.js | 183 ++++++++++++++ 3 files changed, 297 insertions(+), 117 deletions(-) create mode 100644 docs/src/modules/components/InterfaceApiPage.js diff --git a/docs/scripts/api/buildInterfacesDocumentation.ts b/docs/scripts/api/buildInterfacesDocumentation.ts index fe5d16a3bf28..ddbc03f4b090 100644 --- a/docs/scripts/api/buildInterfacesDocumentation.ts +++ b/docs/scripts/api/buildInterfacesDocumentation.ts @@ -1,10 +1,9 @@ import * as ts from 'typescript'; -import * as prettier from 'prettier'; +import { EOL } from 'os'; import kebabCase from 'lodash/kebabCase'; import path from 'path'; import { renderMarkdown } from '@mui/monorepo/packages/markdown'; import { - escapeCell, getSymbolDescription, getSymbolJSDocTags, linkify, @@ -12,6 +11,7 @@ import { writePrettifiedFile, resolveExportSpecifier, DocumentedInterfaces, + escapeCell, } from './utils'; import { XTypeScriptProjects, @@ -39,6 +39,10 @@ interface ParsedProperty { projects: XProjectNames[]; } +const translationPagesDirectory = 'docs/translations/api-docs/data-grid'; +const importTranslationPagesDirectory = 'docsx/translations/api-docs/data-grid'; +const apiPagesDirectory = path.join(process.cwd(), `docs/pages/x/api/data-grid`); + const GRID_API_INTERFACES_WITH_DEDICATED_PAGES = [ 'GridCellSelectionApi', 'GridColumnPinningApi', @@ -173,123 +177,55 @@ const parseInterfaceSymbol = async ( return parsedInterface; }; -function generateMarkdownFromProperties( - object: ParsedObject, - documentedInterfaces: DocumentedInterfaces, -) { - const hasDefaultValue = object.properties.some((property) => { - return property.tags.default; - }); - - const headers = hasDefaultValue - ? ` -| Name | Type | Default | Description | -|:-----|:-----|:--------|:------------|` - : ` -| Name | Type | Description | -|:-----|:-----|:------------|`; - - let text = `${headers}\n`; - - object.properties.forEach((property) => { - const defaultValue = property.tags.default?.text?.[0].text; - - let planImg: string; - if (property.projects.includes('x-data-grid')) { - planImg = ''; - } else if (property.projects.includes('x-data-grid-pro')) { - planImg = - ' [](/x/introduction/licensing/#pro-plan)'; - } else if (property.projects.includes('x-data-grid-premium')) { - planImg = - ' [](/x/introduction/licensing/#premium-plan)'; - } else { - throw new Error(`No valid plan found for ${property.name} property in ${object.name}`); - } - - const formattedName = property.isOptional - ? `${property.name}?${planImg}` - : `${property.name}${planImg}`; - - const formattedType = `${escapeCell(property.typeStr)}`; - - const formattedDefaultValue = - defaultValue == null ? '' : `${escapeCell(defaultValue)}`; - - const formattedDescription = escapeCell( - linkify(property.description, documentedInterfaces, 'markdown'), - ); - - if (hasDefaultValue) { - text += `| ${formattedName} | ${formattedType} | ${formattedDefaultValue} | ${formattedDescription} |\n`; - } else { - text += `| ${formattedName} | ${formattedType} | ${formattedDescription} |\n`; - } - }); - - return text; +function getPlanLevel(property: ParsedProperty) { + if (property.projects.includes('x-data-grid')) { + return ''; + } + if (property.projects.includes('x-data-grid-pro')) { + return 'pro'; + } + if (property.projects.includes('x-data-grid-premium')) { + return 'premium'; + } + throw new Error(`No valid plan found for ${property.name} property`); } -async function generateImportStatement(objects: ParsedObject[], projects: XTypeScriptProjects) { - let imports = '```js\n'; +function getDefaultValue(property: ParsedProperty) { + const defaultValue = property.tags.default?.text?.[0].text; + if (defaultValue === undefined) { + return defaultValue; + } + return escapeCell(defaultValue); +} +function generateImportStatement(object: ParsedObject, projects: XTypeScriptProjects) { const projectImports = Array.from(projects.values()) .map((project) => { - const objectsInProject = objects.filter((object) => { - return !!project.exports[object.name]; - }); - - if (objectsInProject.length === 0) { + if (!project.exports[object.name]) { return null; } - return `import {${objectsInProject.map((object) => object.name)}} from '@mui/${ - project.name - }'`; + return `import { ${object.name} } from '@mui/${project.name}'`; }) .filter((el): el is string => !!el) // Display the imports from the pro packages above imports from the community packages .sort((a, b) => b.length - a.length); - - imports += await prettier.format(projectImports.join('\n// or\n'), { - singleQuote: true, - semi: false, - trailingComma: 'none', - parser: 'typescript', - }); - imports += '\n```'; - - return imports; + return projectImports; } -async function generateMarkdown( - object: ParsedObject, - projects: XTypeScriptProjects, - documentedInterfaces: DocumentedInterfaces, -) { - const demos = object.tags.demos; - const description = linkify(object.description, documentedInterfaces, 'html'); - const imports = await generateImportStatement([object], projects); - - let text = `# ${object.name} Interface\n`; - text += `

${description}

\n\n`; - - if (demos && demos.text && demos.text.length > 0) { - text += '## Demos\n\n'; - text += ':::info\n'; - text += 'For examples and details on the usage, check the following pages:\n\n'; - demos.text.forEach((demoLink) => { - text += demoLink.text; - }); - text += '\n\n:::\n\n'; +function extractDemos(tagInfo: ts.JSDocTagInfo): { demos?: string } { + if (!tagInfo || !tagInfo.text) { + return {}; } + const demos = tagInfo.text + .map(({ text }) => text.matchAll(/\[(.*)\]\((.*)\)/g).next().value) + .map(([, text, url]) => `
  • ${text}
  • `); - text += '## Import\n\n'; - text += `${imports}\n\n`; - text += '## Properties\n\n'; - text += `${generateMarkdownFromProperties(object, documentedInterfaces)}`; + if (demos.length === 0) { + return {}; + } - return text; + return { demos: `` }; } interface BuildInterfacesDocumentationOptions { @@ -356,26 +292,91 @@ export default async function buildInterfacesDocumentation( // eslint-disable-next-line no-console console.log('Built JSON file for', parsedInterface.name); } else { + const content = { + name: parsedInterface.name, + imports: generateImportStatement(parsedInterface, projects), + ...extractDemos(parsedInterface.tags.demos), + properties: {}, + }; + + const translations = { + interfaceDescription: renderMarkdown( + escapeCell(linkify(parsedInterface.description, documentedInterfaces, 'html')), + ), + propertiesDescriptions: {}, + }; + + parsedInterface.properties + .map((property) => ({ + name: property.name, + description: renderMarkdown( + escapeCell(linkify(property.description, documentedInterfaces, 'html')), + ), + type: { description: escapeCell(property.typeStr) }, + default: getDefaultValue(property), + planLevel: getPlanLevel(property), + isOptional: property.isOptional, + })) + .sort((a, b) => a.name.localeCompare(b.name)) + .forEach(({ name, description, type, default: defaultValue, isOptional, planLevel }) => { + content.properties[name] = { type }; + if (defaultValue) { + content.properties[name].default = defaultValue; + } + if (isOptional) { + content.properties[name].isOptional = isOptional; + } + if (planLevel === 'pro') { + content.properties[name].isProPlan = true; + } + if (planLevel === 'premium') { + content.properties[name].isPremiumPlan = true; + } + translations.propertiesDescriptions[name] = { description }; + }); + // eslint-disable-next-line no-await-in-loop - const markdown = await generateMarkdown(parsedInterface, projects, documentedInterfaces); + await writePrettifiedFile( + path.resolve(apiPagesDirectory, `${slug}.json`), + JSON.stringify(content), + project, + ); + // eslint-disable-next-line no-await-in-loop await writePrettifiedFile( - path.resolve(apiPagesFolder, project.documentationFolderName, `${slug}.md`), - markdown, + path.resolve(translationPagesDirectory, `${slug}.json`), + JSON.stringify(translations), project, ); // eslint-disable-next-line no-await-in-loop await writePrettifiedFile( - path.resolve(apiPagesFolder, project.documentationFolderName, `${slug}.js`), + path.resolve(apiPagesDirectory, `${slug}.js`), `import * as React from 'react'; - import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; - import * as pageProps from './${slug}.md?muiMarkdown'; - - export default function Page() { - return ; + 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 './${slug}.json'; + + export default function Page(props) { + const { descriptions, pageContent } = props; + return ; } - `, + + Page.getInitialProps = () => { + const req = require.context( + '${importTranslationPagesDirectory}/', + false, + /\\.\\/${slug}.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; + }; + `.replace(/\r?\n/g, EOL), project, ); diff --git a/docs/scripts/api/utils.ts b/docs/scripts/api/utils.ts index ddb5f560a1fa..7f060a3805e5 100644 --- a/docs/scripts/api/utils.ts +++ b/docs/scripts/api/utils.ts @@ -26,11 +26,7 @@ export function getJsdocDefaultValue(jsdoc: Annotation) { } export function escapeCell(value: string) { - return value - .replace(//g, '>') - .replace(/\|/g, '\\|') - .replace(/\r?\n/g, '
    '); + return value.replace(//g, '>').replace(/\r?\n/g, '
    '); } export const formatType = async (rawType: string) => { diff --git a/docs/src/modules/components/InterfaceApiPage.js b/docs/src/modules/components/InterfaceApiPage.js new file mode 100644 index 000000000000..e73471f71236 --- /dev/null +++ b/docs/src/modules/components/InterfaceApiPage.js @@ -0,0 +1,183 @@ +/* eslint-disable react/no-danger */ +import * as React from 'react'; +import PropTypes from 'prop-types'; +import { exactProp } from '@mui/utils'; +import Typography from '@mui/material/Typography'; +import Alert from '@mui/material/Alert'; +import VerifiedRoundedIcon from '@mui/icons-material/VerifiedRounded'; +import { alpha } from '@mui/material/styles'; +import { useTranslate, useUserLanguage } from 'docs/src/modules/utils/i18n'; +import HighlightedCode from 'docs/src/modules/components/HighlightedCode'; +import MarkdownElement from 'docs/src/modules/components/MarkdownElement'; +import AppLayoutDocs from 'docs/src/modules/components/AppLayoutDocs'; +import PropertiesSection from 'docs/src/modules/components/ApiPage/sections/PropertiesSection'; +import { DEFAULT_API_LAYOUT_STORAGE_KEYS } from 'docs/src/modules/components/ApiPage/sections/ToggleDisplayOption'; + +export function getTranslatedHeader(t, header) { + const translations = { + demos: t('api-docs.demos'), + import: t('api-docs.import'), + }; + + // TODO Drop runtime type-checking once we type-check this file + if (!translations.hasOwnProperty(header)) { + throw new TypeError( + `Unable to translate header '${header}'. Did you mean one of '${Object.keys( + translations, + ).join("', '")}'`, + ); + } + + return translations[header] || header; +} + +function Heading(props) { + const { hash, level: Level = 'h2' } = props; + const t = useTranslate(); + + return ( + + {getTranslatedHeader(t, hash)} + + + + + + + ); +} + +Heading.propTypes = { + hash: PropTypes.string.isRequired, + level: PropTypes.string, +}; + +export default function ApiPage(props) { + const { + descriptions, + pageContent, + defaultLayout = 'expanded', + layoutStorageKey = DEFAULT_API_LAYOUT_STORAGE_KEYS, + } = props; + const t = useTranslate(); + const userLanguage = useUserLanguage(); + + const { demos, filename = '', properties } = pageContent; + + const { componentDescription, propertiesDescriptions, interfaceDescription } = + descriptions[userLanguage]; + const description = t('api-docs.pageDescription').replace(/{{name}}/, pageContent.name); + + // Prefer linking the .tsx or .d.ts for the "Edit this page" link. + const apiSourceLocation = filename.replace('.js', '.d.ts'); + + return ( + + +

    {pageContent.name} API

    + + + {demos && ( + } + sx={[ + (theme) => ({ + mt: 1.5, + pt: 1, + px: 2, + pb: 0, + fontSize: theme.typography.pxToRem(16), + backgroundColor: (theme.vars || theme).palette.success[50], + borderColor: (theme.vars || theme).palette.success[100], + '& * p': { + mb: 1, + }, + '& * a': { + fontWeight: theme.typography.fontWeightMedium, + color: (theme.vars || theme).palette.success[900], + textDecorationColor: alpha(theme.palette.success[600], 0.3), + }, + ...theme.applyDarkStyles({ + '& * a': { + color: (theme.vars || theme).palette.success[100], + textDecorationColor: alpha(theme.palette.success[100], 0.3), + }, + backgroundColor: alpha(theme.palette.success[700], 0.15), + borderColor: alpha(theme.palette.success[600], 0.3), + }), + }), + ]} + > + For examples and details on the usage, check the following pages:

    + ${demos}`, + }} + /> +
    + )} + + + + {componentDescription ? ( + +
    +
    + +
    + ) : null} + +
    + + + + + +
    + ); +} + +ApiPage.propTypes = { + defaultLayout: PropTypes.oneOf(['collapsed', 'expanded', 'table']), + descriptions: PropTypes.object.isRequired, + layoutStorageKey: PropTypes.shape({ + props: PropTypes.string, + }), + pageContent: PropTypes.object.isRequired, +}; + +if (process.env.NODE_ENV !== 'production') { + ApiPage.propTypes = exactProp(ApiPage.propTypes); +} From 6d13431f0efcfe29856a0e5845c5b2887ea9d278 Mon Sep 17 00:00:00 2001 From: alexandre Date: Thu, 28 Mar 2024 13:39:29 +0100 Subject: [PATCH 2/8] scripts --- .../x/api/data-grid/grid-actions-col-def.js | 27 +- .../x/api/data-grid/grid-actions-col-def.json | 152 +++++++++ .../data-grid/grid-aggregation-function.js | 27 +- .../data-grid/grid-aggregation-function.json | 40 +++ docs/pages/x/api/data-grid/grid-api.js | 27 +- docs/pages/x/api/data-grid/grid-api.json | 321 ++++++++++++++++++ .../pages/x/api/data-grid/grid-cell-params.js | 27 +- .../x/api/data-grid/grid-cell-params.json | 21 ++ docs/pages/x/api/data-grid/grid-col-def.js | 27 +- docs/pages/x/api/data-grid/grid-col-def.json | 151 ++++++++ .../api/data-grid/grid-csv-export-options.js | 27 +- .../data-grid/grid-csv-export-options.json | 34 ++ .../data-grid/grid-excel-export-options.js | 27 +- .../data-grid/grid-excel-export-options.json | 66 ++++ .../api/data-grid/grid-export-state-params.js | 27 +- .../data-grid/grid-export-state-params.json | 16 + .../pages/x/api/data-grid/grid-filter-item.js | 27 +- .../x/api/data-grid/grid-filter-item.json | 15 + .../x/api/data-grid/grid-filter-model.js | 27 +- .../x/api/data-grid/grid-filter-model.json | 32 ++ .../x/api/data-grid/grid-filter-operator.js | 27 +- .../x/api/data-grid/grid-filter-operator.json | 32 ++ .../data-grid/grid-print-export-options.js | 27 +- .../data-grid/grid-print-export-options.json | 32 ++ .../data-grid/grid-row-class-name-params.js | 27 +- .../data-grid/grid-row-class-name-params.json | 17 + docs/pages/x/api/data-grid/grid-row-params.js | 27 +- .../x/api/data-grid/grid-row-params.json | 14 + .../api/data-grid/grid-row-spacing-params.js | 27 +- .../data-grid/grid-row-spacing-params.json | 16 + .../data-grid/grid-single-select-col-def.js | 27 +- .../data-grid/grid-single-select-col-def.json | 161 +++++++++ .../data-grid/grid-actions-col-def.json | 95 ++++++ .../data-grid/grid-aggregation-function.json | 23 ++ .../api-docs/data-grid/grid-api.json | 257 ++++++++++++++ .../api-docs/data-grid/grid-cell-params.json | 18 + .../api-docs/data-grid/grid-col-def.json | 94 +++++ .../data-grid/grid-csv-export-options.json | 25 ++ .../data-grid/grid-excel-export-options.json | 32 ++ .../data-grid/grid-export-state-params.json | 8 + .../api-docs/data-grid/grid-filter-item.json | 13 + .../api-docs/data-grid/grid-filter-model.json | 16 + .../data-grid/grid-filter-operator.json | 25 ++ .../data-grid/grid-print-export-options.json | 29 ++ .../data-grid/grid-row-class-name-params.json | 13 + .../api-docs/data-grid/grid-row-params.json | 8 + .../data-grid/grid-row-spacing-params.json | 12 + .../data-grid/grid-single-select-col-def.json | 101 ++++++ 48 files changed, 2257 insertions(+), 64 deletions(-) create mode 100644 docs/pages/x/api/data-grid/grid-actions-col-def.json create mode 100644 docs/pages/x/api/data-grid/grid-aggregation-function.json create mode 100644 docs/pages/x/api/data-grid/grid-api.json create mode 100644 docs/pages/x/api/data-grid/grid-cell-params.json create mode 100644 docs/pages/x/api/data-grid/grid-col-def.json create mode 100644 docs/pages/x/api/data-grid/grid-csv-export-options.json create mode 100644 docs/pages/x/api/data-grid/grid-excel-export-options.json create mode 100644 docs/pages/x/api/data-grid/grid-export-state-params.json create mode 100644 docs/pages/x/api/data-grid/grid-filter-item.json create mode 100644 docs/pages/x/api/data-grid/grid-filter-model.json create mode 100644 docs/pages/x/api/data-grid/grid-filter-operator.json create mode 100644 docs/pages/x/api/data-grid/grid-print-export-options.json create mode 100644 docs/pages/x/api/data-grid/grid-row-class-name-params.json create mode 100644 docs/pages/x/api/data-grid/grid-row-params.json create mode 100644 docs/pages/x/api/data-grid/grid-row-spacing-params.json create mode 100644 docs/pages/x/api/data-grid/grid-single-select-col-def.json create mode 100644 docs/translations/api-docs/data-grid/grid-actions-col-def.json create mode 100644 docs/translations/api-docs/data-grid/grid-aggregation-function.json create mode 100644 docs/translations/api-docs/data-grid/grid-api.json create mode 100644 docs/translations/api-docs/data-grid/grid-cell-params.json create mode 100644 docs/translations/api-docs/data-grid/grid-col-def.json create mode 100644 docs/translations/api-docs/data-grid/grid-csv-export-options.json create mode 100644 docs/translations/api-docs/data-grid/grid-excel-export-options.json create mode 100644 docs/translations/api-docs/data-grid/grid-export-state-params.json create mode 100644 docs/translations/api-docs/data-grid/grid-filter-item.json create mode 100644 docs/translations/api-docs/data-grid/grid-filter-model.json create mode 100644 docs/translations/api-docs/data-grid/grid-filter-operator.json create mode 100644 docs/translations/api-docs/data-grid/grid-print-export-options.json create mode 100644 docs/translations/api-docs/data-grid/grid-row-class-name-params.json create mode 100644 docs/translations/api-docs/data-grid/grid-row-params.json create mode 100644 docs/translations/api-docs/data-grid/grid-row-spacing-params.json create mode 100644 docs/translations/api-docs/data-grid/grid-single-select-col-def.json diff --git a/docs/pages/x/api/data-grid/grid-actions-col-def.js b/docs/pages/x/api/data-grid/grid-actions-col-def.js index 7ca29be5152e..94781bd89118 100644 --- a/docs/pages/x/api/data-grid/grid-actions-col-def.js +++ b/docs/pages/x/api/data-grid/grid-actions-col-def.js @@ -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 ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +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, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-actions-col-def.json b/docs/pages/x/api/data-grid/grid-actions-col-def.json new file mode 100644 index 000000000000..bc2ad4105813 --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-actions-col-def.json @@ -0,0 +1,152 @@ +{ + "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": "", + "properties": { + "aggregable": { + "type": { "description": "boolean" }, + "default": "true", + "isOptional": true, + "isPremiumPlan": true + }, + "align": { "type": { "description": "GridAlignment" }, "isOptional": true }, + "availableAggregationFunctions": { + "type": { "description": "string[]" }, + "isOptional": true, + "isPremiumPlan": true + }, + "cellClassName": { + "type": { "description": "GridCellClassNamePropType<R, V>" }, + "isOptional": true + }, + "colSpan": { + "type": { "description": "number | GridColSpanFn<R, V, F>" }, + "default": "1", + "isOptional": true + }, + "description": { "type": { "description": "string" }, "isOptional": true }, + "disableColumnMenu": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + }, + "disableExport": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + }, + "disableReorder": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + }, + "display": { "type": { "description": "'text' | 'flex'" }, "isOptional": true }, + "editable": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, + "field": { "type": { "description": "string" } }, + "filterable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "filterOperators": { + "type": { "description": "GridFilterOperator<R, V, F>[]" }, + "isOptional": true + }, + "flex": { "type": { "description": "number" }, "isOptional": true }, + "getActions": { + "type": { + "description": "(params: GridRowParams<R>) => React.ReactElement<GridActionsCellItemProps>[]" + } + }, + "getApplyQuickFilterFn": { + "type": { "description": "GetApplyQuickFilterFn<R, V>" }, + "isOptional": true + }, + "getSortComparator": { + "type": { + "description": "(sortDirection: GridSortDirection) => GridComparatorFn<V> | undefined" + }, + "isOptional": true + }, + "groupable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "groupingValueGetter": { + "type": { "description": "GridGroupingValueGetter<R>" }, + "isOptional": true, + "isPremiumPlan": true + }, + "headerAlign": { "type": { "description": "GridAlignment" }, "isOptional": true }, + "headerClassName": { + "type": { "description": "GridColumnHeaderClassNamePropType" }, + "isOptional": true + }, + "headerName": { "type": { "description": "string" }, "isOptional": true }, + "hideable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "hideSortIcons": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + }, + "maxWidth": { "type": { "description": "number" }, "default": "Infinity", "isOptional": true }, + "minWidth": { "type": { "description": "number" }, "default": "50", "isOptional": true }, + "pastedValueParser": { + "type": { "description": "GridPastedValueParser<R, V, F>" }, + "isOptional": true, + "isPremiumPlan": true + }, + "pinnable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "preProcessEditCellProps": { + "type": { + "description": "(params: GridPreProcessEditCellProps) => GridEditCellProps | Promise<GridEditCellProps>" + }, + "isOptional": true + }, + "renderCell": { + "type": { + "description": "(params: GridRenderCellParams<R, V, F>) => React.ReactNode" + }, + "isOptional": true + }, + "renderEditCell": { + "type": { + "description": "(params: GridRenderEditCellParams<R, V, F>) => React.ReactNode" + }, + "isOptional": true + }, + "renderHeader": { + "type": { + "description": "(params: GridColumnHeaderParams<R, V, F>) => React.ReactNode" + }, + "isOptional": true + }, + "renderHeaderFilter": { + "type": { "description": "(params: GridRenderHeaderFilterProps) => React.ReactNode" }, + "isOptional": true, + "isProPlan": true + }, + "resizable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "sortable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "sortComparator": { + "type": { "description": "GridComparatorFn<V>" }, + "isOptional": true + }, + "sortingOrder": { "type": { "description": "GridSortDirection[]" }, "isOptional": true }, + "type": { "type": { "description": "'actions'" }, "default": "'actions'" }, + "valueFormatter": { + "type": { "description": "GridValueFormatter<R, V, F>" }, + "isOptional": true + }, + "valueGetter": { + "type": { "description": "GridValueGetter<R, V, F>" }, + "isOptional": true + }, + "valueParser": { + "type": { "description": "GridValueParser<R, V, F>" }, + "isOptional": true + }, + "valueSetter": { + "type": { "description": "GridValueSetter<R, V, F>" }, + "isOptional": true + }, + "width": { "type": { "description": "number" }, "default": "100", "isOptional": true } + } +} diff --git a/docs/pages/x/api/data-grid/grid-aggregation-function.js b/docs/pages/x/api/data-grid/grid-aggregation-function.js index c2255c2117ca..3cf533597da1 100644 --- a/docs/pages/x/api/data-grid/grid-aggregation-function.js +++ b/docs/pages/x/api/data-grid/grid-aggregation-function.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-aggregation-function.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-aggregation-function.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-aggregation-function.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-aggregation-function.json b/docs/pages/x/api/data-grid/grid-aggregation-function.json new file mode 100644 index 000000000000..16eef5bde368 --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-aggregation-function.json @@ -0,0 +1,40 @@ +{ + "name": "GridAggregationFunction", + "imports": ["import { GridAggregationFunction } from '@mui/x-data-grid-premium'"], + "demos": "", + "properties": { + "apply": { + "type": { + "description": "(params: GridAggregationParams<V>) => AV | null | undefined" + }, + "isPremiumPlan": true + }, + "columnTypes": { + "type": { "description": "string[]" }, + "isOptional": true, + "isPremiumPlan": true + }, + "getCellValue": { + "type": { "description": "(params: GridAggregationGetCellValueParams) => V" }, + "isOptional": true, + "isPremiumPlan": true + }, + "hasCellUnit": { + "type": { "description": "boolean" }, + "default": "`true`", + "isOptional": true, + "isPremiumPlan": true + }, + "label": { + "type": { "description": "string" }, + "default": "`apiRef.current.getLocaleText('aggregationFunctionLabel{capitalize(name)})`", + "isOptional": true, + "isPremiumPlan": true + }, + "valueFormatter": { + "type": { "description": "(params: GridValueFormatterParams<AV>) => FAV" }, + "isOptional": true, + "isPremiumPlan": true + } + } +} diff --git a/docs/pages/x/api/data-grid/grid-api.js b/docs/pages/x/api/data-grid/grid-api.js index 3ec62f326b40..b79184bd8dcb 100644 --- a/docs/pages/x/api/data-grid/grid-api.js +++ b/docs/pages/x/api/data-grid/grid-api.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-api.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-api.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-api.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-api.json b/docs/pages/x/api/data-grid/grid-api.json new file mode 100644 index 000000000000..7fed3c5d1d8c --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-api.json @@ -0,0 +1,321 @@ +{ + "name": "GridApi", + "imports": [ + "import { GridApi } from '@mui/x-data-grid-premium'", + "import { GridApi } from '@mui/x-data-grid-pro'", + "import { GridApi } from '@mui/x-data-grid'" + ], + "demos": "", + "properties": { + "addRowGroupingCriteria": { + "type": { + "description": "(groupingCriteriaField: string, groupingIndex?: number) => void" + }, + "isPremiumPlan": true + }, + "applySorting": { "type": { "description": "() => void" } }, + "autosizeColumns": { + "type": { "description": "(options?: GridAutosizeOptions) => Promise<void>" } + }, + "deleteFilterItem": { "type": { "description": "(item: GridFilterItem) => void" } }, + "exportDataAsCsv": { "type": { "description": "(options?: GridCsvExportOptions) => void" } }, + "exportDataAsExcel": { + "type": { "description": "(options?: GridExcelExportOptions) => Promise<void>" }, + "isPremiumPlan": true + }, + "exportDataAsPrint": { + "type": { "description": "(options?: GridPrintExportOptions) => void" } + }, + "exportState": { + "type": { "description": "(params?: GridExportStateParams) => InitialState" } + }, + "forceUpdate": { "type": { "description": "() => void" } }, + "getAllColumns": { "type": { "description": "() => GridStateColDef[]" } }, + "getAllGroupDetails": { "type": { "description": "() => GridColumnGroupLookup" } }, + "getAllRowIds": { "type": { "description": "() => GridRowId[]" } }, + "getCellElement": { + "type": { "description": "(id: GridRowId, field: string) => HTMLDivElement | null" } + }, + "getCellMode": { + "type": { "description": "(id: GridRowId, field: string) => GridCellMode" } + }, + "getCellParams": { + "type": { + "description": "<R extends GridValidRowModel = any, V = unknown, F = V, N extends GridTreeNode = GridTreeNode>(id: GridRowId, field: string) => GridCellParams<R, V, F, N>" + } + }, + "getCellSelectionModel": { + "type": { "description": "() => GridCellSelectionModel" }, + "isPremiumPlan": true + }, + "getCellValue": { + "type": { "description": "<V extends any = any>(id: GridRowId, field: string) => V" } + }, + "getColumn": { "type": { "description": "(field: string) => GridStateColDef" } }, + "getColumnGroupPath": { + "type": { "description": "(field: string) => GridColumnGroup['groupId'][]" } + }, + "getColumnHeaderElement": { + "type": { "description": "(field: string) => HTMLDivElement | null" } + }, + "getColumnHeaderParams": { + "type": { "description": "(field: string) => GridColumnHeaderParams" } + }, + "getColumnIndex": { + "type": { "description": "(field: string, useVisibleColumns?: boolean) => number" } + }, + "getColumnIndexRelativeToVisibleColumns": { + "type": { "description": "(field: string) => number" } + }, + "getColumnPosition": { "type": { "description": "(field: string) => number" } }, + "getDataAsCsv": { "type": { "description": "(options?: GridCsvExportOptions) => string" } }, + "getDataAsExcel": { + "type": { + "description": "(options?: GridExcelExportOptions) => Promise<Excel.Workbook> | null" + }, + "isPremiumPlan": true + }, + "getExpandedDetailPanels": { + "type": { "description": "() => GridRowId[]" }, + "isProPlan": true + }, + "getLocaleText": { + "type": { + "description": "<T extends GridTranslationKeys>(key: T) => GridLocaleText[T]" + } + }, + "getPinnedColumns": { + "type": { "description": "() => GridPinnedColumnFields" }, + "isProPlan": true + }, + "getRootDimensions": { "type": { "description": "() => GridDimensions" } }, + "getRow": { + "type": { + "description": "<R extends GridValidRowModel = any>(id: GridRowId) => R | null" + } + }, + "getRowElement": { "type": { "description": "(id: GridRowId) => HTMLDivElement | null" } }, + "getRowGroupChildren": { + "type": { "description": "(params: GridRowGroupChildrenGetterParams) => GridRowId[]" }, + "isProPlan": true + }, + "getRowId": { + "type": { "description": "<R extends GridValidRowModel = any>(row: R) => GridRowId" } + }, + "getRowIdFromRowIndex": { "type": { "description": "(index: number) => GridRowId" } }, + "getRowIndexRelativeToVisibleRows": { + "type": { "description": "(id: GridRowId) => number" } + }, + "getRowMode": { "type": { "description": "(id: GridRowId) => GridRowMode" } }, + "getRowModels": { "type": { "description": "() => Map<GridRowId, GridRowModel>" } }, + "getRowNode": { + "type": { "description": "<N extends GridTreeNode>(id: GridRowId) => N | null" } + }, + "getRowParams": { "type": { "description": "(id: GridRowId) => GridRowParams" } }, + "getRowsCount": { "type": { "description": "() => number" } }, + "getRowWithUpdatedValues": { + "type": { "description": "(id: GridRowId, field: string) => GridRowModel" } + }, + "getScrollPosition": { "type": { "description": "() => GridScrollParams" } }, + "getSelectedCellsAsArray": { + "type": { "description": "() => GridCellCoordinates[]" }, + "isPremiumPlan": true + }, + "getSelectedRows": { "type": { "description": "() => Map<GridRowId, GridRowModel>" } }, + "getSortedRowIds": { "type": { "description": "() => GridRowId[]" } }, + "getSortedRows": { "type": { "description": "() => GridRowModel[]" } }, + "getSortModel": { "type": { "description": "() => GridSortModel" } }, + "getVisibleColumns": { "type": { "description": "() => GridStateColDef[]" } }, + "hideColumnMenu": { "type": { "description": "() => void" } }, + "hideFilterPanel": { "type": { "description": "() => void" } }, + "hideHeaderFilterMenu": { "type": { "description": "() => void" } }, + "hidePreferences": { "type": { "description": "() => void" } }, + "ignoreDiacritics": { "type": { "description": "DataGridProcessedProps['ignoreDiacritics']" } }, + "isCellEditable": { "type": { "description": "(params: GridCellParams) => boolean" } }, + "isCellSelected": { + "type": { "description": "(id: GridRowId, field: GridColDef['field']) => boolean" }, + "isPremiumPlan": true + }, + "isColumnPinned": { + "type": { "description": "(field: string) => GridPinnedColumnPosition | false" }, + "isProPlan": true + }, + "isRowSelectable": { "type": { "description": "(id: GridRowId) => boolean" } }, + "isRowSelected": { "type": { "description": "(id: GridRowId) => boolean" } }, + "pinColumn": { + "type": { "description": "(field: string, side: GridPinnedColumnPosition) => void" }, + "isProPlan": true + }, + "publishEvent": { "type": { "description": "GridEventPublisher" } }, + "removeRowGroupingCriteria": { + "type": { "description": "(groupingCriteriaField: string) => void" }, + "isPremiumPlan": true + }, + "resetRowHeights": { "type": { "description": "() => void" } }, + "resize": { "type": { "description": "() => void" } }, + "restoreState": { "type": { "description": "(stateToRestore: InitialState) => void" } }, + "scroll": { "type": { "description": "(params: Partial<GridScrollParams>) => void" } }, + "scrollToIndexes": { + "type": { "description": "(params: Partial<GridCellIndexCoordinates>) => boolean" } + }, + "selectCellRange": { + "type": { + "description": "(start: GridCellCoordinates, end: GridCellCoordinates, keepOtherSelected?: boolean) => void" + }, + "isPremiumPlan": true + }, + "selectRow": { + "type": { + "description": "(id: GridRowId, isSelected?: boolean, resetSelection?: boolean) => void" + } + }, + "selectRowRange": { + "type": { + "description": "(range: { startId: GridRowId; endId: GridRowId }, isSelected?: boolean, resetSelection?: boolean) => void" + }, + "isProPlan": true + }, + "selectRows": { + "type": { + "description": "(ids: GridRowId[], isSelected?: boolean, resetSelection?: boolean) => void" + }, + "isProPlan": true + }, + "setAggregationModel": { + "type": { "description": "(model: GridAggregationModel) => void" }, + "isPremiumPlan": true + }, + "setCellFocus": { "type": { "description": "(id: GridRowId, field: string) => void" } }, + "setCellSelectionModel": { + "type": { "description": "(newModel: GridCellSelectionModel) => void" }, + "isPremiumPlan": true + }, + "setColumnHeaderFilterFocus": { + "type": { "description": "(field: string, event?: MuiBaseEvent) => void" } + }, + "setColumnHeaderFocus": { + "type": { "description": "(field: string, event?: MuiBaseEvent) => void" } + }, + "setColumnIndex": { + "type": { "description": "(field: string, targetIndexPosition: number) => void" }, + "isProPlan": true + }, + "setColumnVisibility": { + "type": { "description": "(field: string, isVisible: boolean) => void" } + }, + "setColumnVisibilityModel": { + "type": { "description": "(model: GridColumnVisibilityModel) => void" } + }, + "setColumnWidth": { "type": { "description": "(field: string, width: number) => void" } }, + "setDensity": { "type": { "description": "(density: GridDensity) => void" } }, + "setEditCellValue": { + "type": { + "description": "(params: GridEditCellValueParams, event?: MuiBaseEvent) => Promise<boolean> | void" + } + }, + "setExpandedDetailPanels": { + "type": { "description": "(ids: GridRowId[]) => void" }, + "isProPlan": true + }, + "setFilterLogicOperator": { + "type": { "description": "(operator: GridLogicOperator) => void" } + }, + "setFilterModel": { + "type": { + "description": "(model: GridFilterModel, reason?: GridControlledStateReasonLookup['filter']) => void" + } + }, + "setPage": { "type": { "description": "(page: number) => void" } }, + "setPageSize": { "type": { "description": "(pageSize: number) => void" } }, + "setPaginationModel": { "type": { "description": "(model: GridPaginationModel) => void" } }, + "setPinnedColumns": { + "type": { "description": "(pinnedColumns: GridPinnedColumnFields) => void" }, + "isProPlan": true + }, + "setQuickFilterValues": { "type": { "description": "(values: any[]) => void" } }, + "setRowChildrenExpansion": { + "type": { "description": "(id: GridRowId, isExpanded: boolean) => void" }, + "isProPlan": true + }, + "setRowCount": { "type": { "description": "(rowCount: number) => void" } }, + "setRowGroupingCriteriaIndex": { + "type": { + "description": "(groupingCriteriaField: string, groupingIndex: number) => void" + }, + "isPremiumPlan": true + }, + "setRowGroupingModel": { + "type": { "description": "(model: GridRowGroupingModel) => void" }, + "isPremiumPlan": true + }, + "setRowIndex": { + "type": { "description": "(rowId: GridRowId, targetIndex: number) => void" }, + "isProPlan": true + }, + "setRows": { "type": { "description": "(rows: GridRowModel[]) => void" } }, + "setRowSelectionModel": { "type": { "description": "(rowIds: GridRowId[]) => void" } }, + "setSortModel": { "type": { "description": "(model: GridSortModel) => void" } }, + "showColumnMenu": { "type": { "description": "(field: string) => void" } }, + "showFilterPanel": { + "type": { + "description": "(targetColumnField?: string, panelId?: string, labelId?: string) => void" + } + }, + "showHeaderFilterMenu": { + "type": { "description": "(field: GridColDef['field']) => void" } + }, + "showPreferences": { + "type": { + "description": "(newValue: GridPreferencePanelsValue, panelId?: string, labelId?: string) => void" + } + }, + "sortColumn": { + "type": { + "description": "(field: GridColDef['field'], direction?: GridSortDirection, allowMultipleSorting?: boolean) => void" + } + }, + "startCellEditMode": { + "type": { "description": "(params: GridStartCellEditModeParams) => void" } + }, + "startHeaderFilterEditMode": { + "type": { "description": "(field: GridColDef['field']) => void" } + }, + "startRowEditMode": { + "type": { "description": "(params: GridStartRowEditModeParams) => void" } + }, + "state": { "type": { "description": "State" } }, + "stopCellEditMode": { + "type": { "description": "(params: GridStopCellEditModeParams) => void" } + }, + "stopHeaderFilterEditMode": { "type": { "description": "() => void" } }, + "stopRowEditMode": { + "type": { "description": "(params: GridStopRowEditModeParams) => void" } + }, + "subscribeEvent": { + "type": { + "description": "<E extends GridEvents>(event: E, handler: GridEventListener<E>, options?: EventListenerOptions) => () => void" + } + }, + "toggleColumnMenu": { "type": { "description": "(field: string) => void" } }, + "toggleDetailPanel": { + "type": { "description": "(id: GridRowId) => void" }, + "isProPlan": true + }, + "unpinColumn": { "type": { "description": "(field: string) => void" }, "isProPlan": true }, + "unstable_replaceRows": { + "type": { "description": "(firstRowToReplace: number, newRows: GridRowModel[]) => void" } + }, + "unstable_setColumnVirtualization": { + "type": { "description": "(enabled: boolean) => void" } + }, + "unstable_setPinnedRows": { + "type": { "description": "(pinnedRows?: GridPinnedRowsProp) => void" }, + "isProPlan": true + }, + "unstable_setVirtualization": { "type": { "description": "(enabled: boolean) => void" } }, + "updateColumns": { "type": { "description": "(cols: GridColDef[]) => void" } }, + "updateRows": { "type": { "description": "(updates: GridRowModelUpdate[]) => void" } }, + "upsertFilterItem": { "type": { "description": "(item: GridFilterItem) => void" } }, + "upsertFilterItems": { "type": { "description": "(items: GridFilterItem[]) => void" } } + } +} diff --git a/docs/pages/x/api/data-grid/grid-cell-params.js b/docs/pages/x/api/data-grid/grid-cell-params.js index aa00cd536832..cd53f73a76ff 100644 --- a/docs/pages/x/api/data-grid/grid-cell-params.js +++ b/docs/pages/x/api/data-grid/grid-cell-params.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-cell-params.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-cell-params.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-cell-params.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-cell-params.json b/docs/pages/x/api/data-grid/grid-cell-params.json new file mode 100644 index 000000000000..f97c41daaf25 --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-cell-params.json @@ -0,0 +1,21 @@ +{ + "name": "GridCellParams", + "imports": [ + "import { GridCellParams } from '@mui/x-data-grid-premium'", + "import { GridCellParams } from '@mui/x-data-grid-pro'", + "import { GridCellParams } from '@mui/x-data-grid'" + ], + "properties": { + "cellMode": { "type": { "description": "GridCellMode" } }, + "colDef": { "type": { "description": "GridStateColDef" } }, + "field": { "type": { "description": "string" } }, + "formattedValue": { "type": { "description": "F | undefined" }, "isOptional": true }, + "hasFocus": { "type": { "description": "boolean" } }, + "id": { "type": { "description": "GridRowId" } }, + "isEditable": { "type": { "description": "boolean" }, "isOptional": true }, + "row": { "type": { "description": "GridRowModel<R>" } }, + "rowNode": { "type": { "description": "N" } }, + "tabIndex": { "type": { "description": "0 | -1" } }, + "value": { "type": { "description": "V | undefined" }, "isOptional": true } + } +} diff --git a/docs/pages/x/api/data-grid/grid-col-def.js b/docs/pages/x/api/data-grid/grid-col-def.js index 01c423562290..ffdbb477ddcb 100644 --- a/docs/pages/x/api/data-grid/grid-col-def.js +++ b/docs/pages/x/api/data-grid/grid-col-def.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-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-col-def.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-col-def.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-col-def.json b/docs/pages/x/api/data-grid/grid-col-def.json new file mode 100644 index 000000000000..d98147f75a2f --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-col-def.json @@ -0,0 +1,151 @@ +{ + "name": "GridColDef", + "imports": [ + "import { GridColDef } from '@mui/x-data-grid-premium'", + "import { GridColDef } from '@mui/x-data-grid-pro'", + "import { GridColDef } from '@mui/x-data-grid'" + ], + "demos": "", + "properties": { + "aggregable": { + "type": { "description": "boolean" }, + "default": "true", + "isOptional": true, + "isPremiumPlan": true + }, + "align": { "type": { "description": "GridAlignment" }, "isOptional": true }, + "availableAggregationFunctions": { + "type": { "description": "string[]" }, + "isOptional": true, + "isPremiumPlan": true + }, + "cellClassName": { + "type": { "description": "GridCellClassNamePropType<R, V>" }, + "isOptional": true + }, + "colSpan": { + "type": { "description": "number | GridColSpanFn<R, V, F>" }, + "default": "1", + "isOptional": true + }, + "description": { "type": { "description": "string" }, "isOptional": true }, + "disableColumnMenu": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + }, + "disableExport": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + }, + "disableReorder": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + }, + "display": { "type": { "description": "'text' | 'flex'" }, "isOptional": true }, + "editable": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, + "field": { "type": { "description": "string" } }, + "filterable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "filterOperators": { + "type": { "description": "GridFilterOperator<R, V, F>[]" }, + "isOptional": true + }, + "flex": { "type": { "description": "number" }, "isOptional": true }, + "getApplyQuickFilterFn": { + "type": { "description": "GetApplyQuickFilterFn<R, V>" }, + "isOptional": true + }, + "getSortComparator": { + "type": { + "description": "(sortDirection: GridSortDirection) => GridComparatorFn<V> | undefined" + }, + "isOptional": true + }, + "groupable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "groupingValueGetter": { + "type": { "description": "GridGroupingValueGetter<R>" }, + "isOptional": true, + "isPremiumPlan": true + }, + "headerAlign": { "type": { "description": "GridAlignment" }, "isOptional": true }, + "headerClassName": { + "type": { "description": "GridColumnHeaderClassNamePropType" }, + "isOptional": true + }, + "headerName": { "type": { "description": "string" }, "isOptional": true }, + "hideable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "hideSortIcons": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + }, + "maxWidth": { "type": { "description": "number" }, "default": "Infinity", "isOptional": true }, + "minWidth": { "type": { "description": "number" }, "default": "50", "isOptional": true }, + "pastedValueParser": { + "type": { "description": "GridPastedValueParser<R, V, F>" }, + "isOptional": true, + "isPremiumPlan": true + }, + "pinnable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "preProcessEditCellProps": { + "type": { + "description": "(params: GridPreProcessEditCellProps) => GridEditCellProps | Promise<GridEditCellProps>" + }, + "isOptional": true + }, + "renderCell": { + "type": { + "description": "(params: GridRenderCellParams<R, V, F>) => React.ReactNode" + }, + "isOptional": true + }, + "renderEditCell": { + "type": { + "description": "(params: GridRenderEditCellParams<R, V, F>) => React.ReactNode" + }, + "isOptional": true + }, + "renderHeader": { + "type": { + "description": "(params: GridColumnHeaderParams<R, V, F>) => React.ReactNode" + }, + "isOptional": true + }, + "renderHeaderFilter": { + "type": { "description": "(params: GridRenderHeaderFilterProps) => React.ReactNode" }, + "isOptional": true, + "isProPlan": true + }, + "resizable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "sortable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "sortComparator": { + "type": { "description": "GridComparatorFn<V>" }, + "isOptional": true + }, + "sortingOrder": { "type": { "description": "GridSortDirection[]" }, "isOptional": true }, + "type": { + "type": { "description": "GridColType" }, + "default": "'singleSelect'", + "isOptional": true + }, + "valueFormatter": { + "type": { "description": "GridValueFormatter<R, V, F>" }, + "isOptional": true + }, + "valueGetter": { + "type": { "description": "GridValueGetter<R, V, F>" }, + "isOptional": true + }, + "valueParser": { + "type": { "description": "GridValueParser<R, V, F>" }, + "isOptional": true + }, + "valueSetter": { + "type": { "description": "GridValueSetter<R, V, F>" }, + "isOptional": true + }, + "width": { "type": { "description": "number" }, "default": "100", "isOptional": true } + } +} diff --git a/docs/pages/x/api/data-grid/grid-csv-export-options.js b/docs/pages/x/api/data-grid/grid-csv-export-options.js index 606363051651..782c8b7cbb96 100644 --- a/docs/pages/x/api/data-grid/grid-csv-export-options.js +++ b/docs/pages/x/api/data-grid/grid-csv-export-options.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-csv-export-options.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-csv-export-options.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-csv-export-options.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-csv-export-options.json b/docs/pages/x/api/data-grid/grid-csv-export-options.json new file mode 100644 index 000000000000..fc5f69a48f01 --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-csv-export-options.json @@ -0,0 +1,34 @@ +{ + "name": "GridCsvExportOptions", + "imports": [ + "import { GridCsvExportOptions } from '@mui/x-data-grid-premium'", + "import { GridCsvExportOptions } from '@mui/x-data-grid-pro'", + "import { GridCsvExportOptions } from '@mui/x-data-grid'" + ], + "demos": "", + "properties": { + "allColumns": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, + "delimiter": { "type": { "description": "string" }, "default": "','", "isOptional": true }, + "fields": { "type": { "description": "string[]" }, "isOptional": true }, + "fileName": { + "type": { "description": "string" }, + "default": "`document.title`", + "isOptional": true + }, + "getRowsToExport": { + "type": { "description": "(params: GridCsvGetRowsToExportParams) => GridRowId[]" }, + "isOptional": true + }, + "includeColumnGroupsHeaders": { + "type": { "description": "boolean" }, + "default": "true", + "isOptional": true + }, + "includeHeaders": { + "type": { "description": "boolean" }, + "default": "true", + "isOptional": true + }, + "utf8WithBom": { "type": { "description": "boolean" }, "default": "false", "isOptional": true } + } +} diff --git a/docs/pages/x/api/data-grid/grid-excel-export-options.js b/docs/pages/x/api/data-grid/grid-excel-export-options.js index 8807a36df2fe..53b29b9b03b6 100644 --- a/docs/pages/x/api/data-grid/grid-excel-export-options.js +++ b/docs/pages/x/api/data-grid/grid-excel-export-options.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-excel-export-options.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-excel-export-options.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-excel-export-options.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-excel-export-options.json b/docs/pages/x/api/data-grid/grid-excel-export-options.json new file mode 100644 index 000000000000..f2f0f5d24113 --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-excel-export-options.json @@ -0,0 +1,66 @@ +{ + "name": "GridExcelExportOptions", + "imports": ["import { GridExcelExportOptions } from '@mui/x-data-grid-premium'"], + "demos": "", + "properties": { + "allColumns": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true, + "isPremiumPlan": true + }, + "columnsStyles": { + "type": { "description": "ColumnsStylesInterface" }, + "isOptional": true, + "isPremiumPlan": true + }, + "exceljsPostProcess": { + "type": { + "description": "(processInput: GridExceljsProcessInput) => Promise<void>" + }, + "isOptional": true, + "isPremiumPlan": true + }, + "exceljsPreProcess": { + "type": { + "description": "(processInput: GridExceljsProcessInput) => Promise<void>" + }, + "isOptional": true, + "isPremiumPlan": true + }, + "fields": { "type": { "description": "string[]" }, "isOptional": true, "isPremiumPlan": true }, + "fileName": { + "type": { "description": "string" }, + "default": "`document.title`", + "isOptional": true, + "isPremiumPlan": true + }, + "getRowsToExport": { + "type": { "description": "(params: GridGetRowsToExportParams<Api>) => GridRowId[]" }, + "isOptional": true, + "isPremiumPlan": true + }, + "includeColumnGroupsHeaders": { + "type": { "description": "boolean" }, + "default": "true", + "isOptional": true, + "isPremiumPlan": true + }, + "includeHeaders": { + "type": { "description": "boolean" }, + "default": "true", + "isOptional": true, + "isPremiumPlan": true + }, + "valueOptionsSheetName": { + "type": { "description": "string" }, + "isOptional": true, + "isPremiumPlan": true + }, + "worker": { + "type": { "description": "() => Worker" }, + "isOptional": true, + "isPremiumPlan": true + } + } +} diff --git a/docs/pages/x/api/data-grid/grid-export-state-params.js b/docs/pages/x/api/data-grid/grid-export-state-params.js index e1f093bdb24e..2aed47dee2a5 100644 --- a/docs/pages/x/api/data-grid/grid-export-state-params.js +++ b/docs/pages/x/api/data-grid/grid-export-state-params.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-export-state-params.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-export-state-params.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-export-state-params.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-export-state-params.json b/docs/pages/x/api/data-grid/grid-export-state-params.json new file mode 100644 index 000000000000..e1ae5bf430ff --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-export-state-params.json @@ -0,0 +1,16 @@ +{ + "name": "GridExportStateParams", + "imports": [ + "import { GridExportStateParams } from '@mui/x-data-grid-premium'", + "import { GridExportStateParams } from '@mui/x-data-grid-pro'", + "import { GridExportStateParams } from '@mui/x-data-grid'" + ], + "demos": "", + "properties": { + "exportOnlyDirtyModels": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + } + } +} diff --git a/docs/pages/x/api/data-grid/grid-filter-item.js b/docs/pages/x/api/data-grid/grid-filter-item.js index 0e496ac37ad7..de27ba795f3f 100644 --- a/docs/pages/x/api/data-grid/grid-filter-item.js +++ b/docs/pages/x/api/data-grid/grid-filter-item.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-filter-item.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-filter-item.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-filter-item.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-filter-item.json b/docs/pages/x/api/data-grid/grid-filter-item.json new file mode 100644 index 000000000000..9bbb9f778a0a --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-filter-item.json @@ -0,0 +1,15 @@ +{ + "name": "GridFilterItem", + "imports": [ + "import { GridFilterItem } from '@mui/x-data-grid-premium'", + "import { GridFilterItem } from '@mui/x-data-grid-pro'", + "import { GridFilterItem } from '@mui/x-data-grid'" + ], + "demos": "", + "properties": { + "field": { "type": { "description": "string" } }, + "id": { "type": { "description": "number | string" }, "isOptional": true }, + "operator": { "type": { "description": "string" } }, + "value": { "type": { "description": "any" }, "isOptional": true } + } +} diff --git a/docs/pages/x/api/data-grid/grid-filter-model.js b/docs/pages/x/api/data-grid/grid-filter-model.js index 4e4fb6f1cfe4..391130de7831 100644 --- a/docs/pages/x/api/data-grid/grid-filter-model.js +++ b/docs/pages/x/api/data-grid/grid-filter-model.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-filter-model.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-filter-model.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-filter-model.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-filter-model.json b/docs/pages/x/api/data-grid/grid-filter-model.json new file mode 100644 index 000000000000..e2e04c312fd9 --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-filter-model.json @@ -0,0 +1,32 @@ +{ + "name": "GridFilterModel", + "imports": [ + "import { GridFilterModel } from '@mui/x-data-grid-premium'", + "import { GridFilterModel } from '@mui/x-data-grid-pro'", + "import { GridFilterModel } from '@mui/x-data-grid'" + ], + "demos": "", + "properties": { + "items": { "type": { "description": "GridFilterItem[]" }, "default": "[]" }, + "logicOperator": { + "type": { "description": "GridLogicOperator" }, + "default": "`GridLogicOperator.And`", + "isOptional": true + }, + "quickFilterExcludeHiddenColumns": { + "type": { "description": "boolean" }, + "default": "true", + "isOptional": true + }, + "quickFilterLogicOperator": { + "type": { "description": "GridLogicOperator" }, + "default": "`GridLogicOperator.And`", + "isOptional": true + }, + "quickFilterValues": { + "type": { "description": "any[]" }, + "default": "`[]`", + "isOptional": true + } + } +} diff --git a/docs/pages/x/api/data-grid/grid-filter-operator.js b/docs/pages/x/api/data-grid/grid-filter-operator.js index 6f8a94320880..a9e1bb931eb7 100644 --- a/docs/pages/x/api/data-grid/grid-filter-operator.js +++ b/docs/pages/x/api/data-grid/grid-filter-operator.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-filter-operator.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-filter-operator.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-filter-operator.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-filter-operator.json b/docs/pages/x/api/data-grid/grid-filter-operator.json new file mode 100644 index 000000000000..3cb0d3223f94 --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-filter-operator.json @@ -0,0 +1,32 @@ +{ + "name": "GridFilterOperator", + "imports": [ + "import { GridFilterOperator } from '@mui/x-data-grid-premium'", + "import { GridFilterOperator } from '@mui/x-data-grid-pro'", + "import { GridFilterOperator } from '@mui/x-data-grid'" + ], + "demos": "", + "properties": { + "getApplyFilterFn": { "type": { "description": "GetApplyFilterFn<R, V, F>" } }, + "getValueAsString": { + "type": { "description": "(value: GridFilterItem['value']) => string" }, + "isOptional": true + }, + "headerLabel": { "type": { "description": "string" }, "isOptional": true }, + "InputComponent": { + "type": { "description": "React.JSXElementConstructor<any>" }, + "isOptional": true + }, + "InputComponentProps": { + "type": { "description": "Record<string, any>" }, + "isOptional": true + }, + "label": { "type": { "description": "string" }, "isOptional": true }, + "requiresFilterValue": { + "type": { "description": "boolean" }, + "default": "true", + "isOptional": true + }, + "value": { "type": { "description": "string" } } + } +} diff --git a/docs/pages/x/api/data-grid/grid-print-export-options.js b/docs/pages/x/api/data-grid/grid-print-export-options.js index bf0ba5f8800d..60999a722589 100644 --- a/docs/pages/x/api/data-grid/grid-print-export-options.js +++ b/docs/pages/x/api/data-grid/grid-print-export-options.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-print-export-options.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-print-export-options.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-print-export-options.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; 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 new file mode 100644 index 000000000000..ddd56f3eadf1 --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-print-export-options.json @@ -0,0 +1,32 @@ +{ + "name": "GridPrintExportOptions", + "imports": [ + "import { GridPrintExportOptions } from '@mui/x-data-grid-premium'", + "import { GridPrintExportOptions } from '@mui/x-data-grid-pro'", + "import { GridPrintExportOptions } from '@mui/x-data-grid'" + ], + "demos": "", + "properties": { + "allColumns": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, + "bodyClassName": { "type": { "description": "string" }, "isOptional": true }, + "copyStyles": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "fields": { "type": { "description": "string[]" }, "isOptional": true }, + "fileName": { + "type": { "description": "string" }, + "default": "The title of the page.", + "isOptional": true + }, + "getRowsToExport": { + "type": { "description": "(params: GridPrintGetRowsToExportParams) => GridRowId[]" }, + "isOptional": true + }, + "hideFooter": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, + "hideToolbar": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, + "includeCheckboxes": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + }, + "pageStyle": { "type": { "description": "string | Function" }, "isOptional": true } + } +} diff --git a/docs/pages/x/api/data-grid/grid-row-class-name-params.js b/docs/pages/x/api/data-grid/grid-row-class-name-params.js index 02f1a861f343..5fac145126d2 100644 --- a/docs/pages/x/api/data-grid/grid-row-class-name-params.js +++ b/docs/pages/x/api/data-grid/grid-row-class-name-params.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-row-class-name-params.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-row-class-name-params.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-row-class-name-params.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-row-class-name-params.json b/docs/pages/x/api/data-grid/grid-row-class-name-params.json new file mode 100644 index 000000000000..e4dcfd2be853 --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-row-class-name-params.json @@ -0,0 +1,17 @@ +{ + "name": "GridRowClassNameParams", + "imports": [ + "import { GridRowClassNameParams } from '@mui/x-data-grid-premium'", + "import { GridRowClassNameParams } from '@mui/x-data-grid-pro'", + "import { GridRowClassNameParams } from '@mui/x-data-grid'" + ], + "demos": "", + "properties": { + "columns": { "type": { "description": "GridColDef[]" } }, + "id": { "type": { "description": "GridRowId" } }, + "indexRelativeToCurrentPage": { "type": { "description": "number" } }, + "isFirstVisible": { "type": { "description": "boolean" } }, + "isLastVisible": { "type": { "description": "boolean" } }, + "row": { "type": { "description": "R" } } + } +} diff --git a/docs/pages/x/api/data-grid/grid-row-params.js b/docs/pages/x/api/data-grid/grid-row-params.js index e963d9494bf6..9742086b972e 100644 --- a/docs/pages/x/api/data-grid/grid-row-params.js +++ b/docs/pages/x/api/data-grid/grid-row-params.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-row-params.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-row-params.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-row-params.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-row-params.json b/docs/pages/x/api/data-grid/grid-row-params.json new file mode 100644 index 000000000000..d799afa1427c --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-row-params.json @@ -0,0 +1,14 @@ +{ + "name": "GridRowParams", + "imports": [ + "import { GridRowParams } from '@mui/x-data-grid-premium'", + "import { GridRowParams } from '@mui/x-data-grid-pro'", + "import { GridRowParams } from '@mui/x-data-grid'" + ], + "demos": "", + "properties": { + "columns": { "type": { "description": "GridColDef[]" } }, + "id": { "type": { "description": "GridRowId" } }, + "row": { "type": { "description": "R" } } + } +} diff --git a/docs/pages/x/api/data-grid/grid-row-spacing-params.js b/docs/pages/x/api/data-grid/grid-row-spacing-params.js index 4e3be6c53759..2547f839fc7f 100644 --- a/docs/pages/x/api/data-grid/grid-row-spacing-params.js +++ b/docs/pages/x/api/data-grid/grid-row-spacing-params.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-row-spacing-params.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-row-spacing-params.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-row-spacing-params.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-row-spacing-params.json b/docs/pages/x/api/data-grid/grid-row-spacing-params.json new file mode 100644 index 000000000000..fddc9038e033 --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-row-spacing-params.json @@ -0,0 +1,16 @@ +{ + "name": "GridRowSpacingParams", + "imports": [ + "import { GridRowSpacingParams } from '@mui/x-data-grid-premium'", + "import { GridRowSpacingParams } from '@mui/x-data-grid-pro'", + "import { GridRowSpacingParams } from '@mui/x-data-grid'" + ], + "demos": "", + "properties": { + "id": { "type": { "description": "GridRowId" } }, + "indexRelativeToCurrentPage": { "type": { "description": "number" } }, + "isFirstVisible": { "type": { "description": "boolean" } }, + "isLastVisible": { "type": { "description": "boolean" } }, + "model": { "type": { "description": "R" } } + } +} diff --git a/docs/pages/x/api/data-grid/grid-single-select-col-def.js b/docs/pages/x/api/data-grid/grid-single-select-col-def.js index bb9fedb9b879..77a3ef72e58e 100644 --- a/docs/pages/x/api/data-grid/grid-single-select-col-def.js +++ b/docs/pages/x/api/data-grid/grid-single-select-col-def.js @@ -1,7 +1,26 @@ import * as React from 'react'; -import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; -import * as pageProps from './grid-single-select-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-single-select-col-def.json'; -export default function Page() { - return ; +export default function Page(props) { + const { descriptions, pageContent } = props; + return ( + + ); } + +Page.getInitialProps = () => { + const req = require.context( + 'docsx/translations/api-docs/data-grid/', + false, + /\.\/grid-single-select-col-def.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/x/api/data-grid/grid-single-select-col-def.json b/docs/pages/x/api/data-grid/grid-single-select-col-def.json new file mode 100644 index 000000000000..c64768bb253a --- /dev/null +++ b/docs/pages/x/api/data-grid/grid-single-select-col-def.json @@ -0,0 +1,161 @@ +{ + "name": "GridSingleSelectColDef", + "imports": [ + "import { GridSingleSelectColDef } from '@mui/x-data-grid-premium'", + "import { GridSingleSelectColDef } from '@mui/x-data-grid-pro'", + "import { GridSingleSelectColDef } from '@mui/x-data-grid'" + ], + "demos": "", + "properties": { + "aggregable": { + "type": { "description": "boolean" }, + "default": "true", + "isOptional": true, + "isPremiumPlan": true + }, + "align": { "type": { "description": "GridAlignment" }, "isOptional": true }, + "availableAggregationFunctions": { + "type": { "description": "string[]" }, + "isOptional": true, + "isPremiumPlan": true + }, + "cellClassName": { + "type": { "description": "GridCellClassNamePropType<R, V>" }, + "isOptional": true + }, + "colSpan": { + "type": { "description": "number | GridColSpanFn<R, V, F>" }, + "default": "1", + "isOptional": true + }, + "description": { "type": { "description": "string" }, "isOptional": true }, + "disableColumnMenu": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + }, + "disableExport": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + }, + "disableReorder": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + }, + "display": { "type": { "description": "'text' | 'flex'" }, "isOptional": true }, + "editable": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, + "field": { "type": { "description": "string" } }, + "filterable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "filterOperators": { + "type": { "description": "GridFilterOperator<R, V, F>[]" }, + "isOptional": true + }, + "flex": { "type": { "description": "number" }, "isOptional": true }, + "getApplyQuickFilterFn": { + "type": { "description": "GetApplyQuickFilterFn<R, V>" }, + "isOptional": true + }, + "getOptionLabel": { + "type": { "description": "(value: ValueOptions) => string" }, + "isOptional": true + }, + "getOptionValue": { + "type": { "description": "(value: ValueOptions) => any" }, + "isOptional": true + }, + "getSortComparator": { + "type": { + "description": "(sortDirection: GridSortDirection) => GridComparatorFn<V> | undefined" + }, + "isOptional": true + }, + "groupable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "groupingValueGetter": { + "type": { "description": "GridGroupingValueGetter<R>" }, + "isOptional": true, + "isPremiumPlan": true + }, + "headerAlign": { "type": { "description": "GridAlignment" }, "isOptional": true }, + "headerClassName": { + "type": { "description": "GridColumnHeaderClassNamePropType" }, + "isOptional": true + }, + "headerName": { "type": { "description": "string" }, "isOptional": true }, + "hideable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "hideSortIcons": { + "type": { "description": "boolean" }, + "default": "false", + "isOptional": true + }, + "maxWidth": { "type": { "description": "number" }, "default": "Infinity", "isOptional": true }, + "minWidth": { "type": { "description": "number" }, "default": "50", "isOptional": true }, + "pastedValueParser": { + "type": { "description": "GridPastedValueParser<R, V, F>" }, + "isOptional": true, + "isPremiumPlan": true + }, + "pinnable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "preProcessEditCellProps": { + "type": { + "description": "(params: GridPreProcessEditCellProps) => GridEditCellProps | Promise<GridEditCellProps>" + }, + "isOptional": true + }, + "renderCell": { + "type": { + "description": "(params: GridRenderCellParams<R, V, F>) => React.ReactNode" + }, + "isOptional": true + }, + "renderEditCell": { + "type": { + "description": "(params: GridRenderEditCellParams<R, V, F>) => React.ReactNode" + }, + "isOptional": true + }, + "renderHeader": { + "type": { + "description": "(params: GridColumnHeaderParams<R, V, F>) => React.ReactNode" + }, + "isOptional": true + }, + "renderHeaderFilter": { + "type": { "description": "(params: GridRenderHeaderFilterProps) => React.ReactNode" }, + "isOptional": true, + "isProPlan": true + }, + "resizable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "sortable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "sortComparator": { + "type": { "description": "GridComparatorFn<V>" }, + "isOptional": true + }, + "sortingOrder": { "type": { "description": "GridSortDirection[]" }, "isOptional": true }, + "type": { "type": { "description": "'singleSelect'" }, "default": "'singleSelect'" }, + "valueFormatter": { + "type": { "description": "GridValueFormatter<R, V, F>" }, + "isOptional": true + }, + "valueGetter": { + "type": { "description": "GridValueGetter<R, V, F>" }, + "isOptional": true + }, + "valueOptions": { + "type": { + "description": "Array<ValueOptions> | ((params: GridValueOptionsParams<R>) => Array<ValueOptions>)" + }, + "isOptional": true + }, + "valueParser": { + "type": { "description": "GridValueParser<R, V, F>" }, + "isOptional": true + }, + "valueSetter": { + "type": { "description": "GridValueSetter<R, V, F>" }, + "isOptional": true + }, + "width": { "type": { "description": "number" }, "default": "100", "isOptional": true } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-actions-col-def.json b/docs/translations/api-docs/data-grid/grid-actions-col-def.json new file mode 100644 index 000000000000..8b275128177a --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-actions-col-def.json @@ -0,0 +1,95 @@ +{ + "interfaceDescription": "Column Definition interface used for columns with the actions type.", + "propertiesDescriptions": { + "aggregable": { + "description": "If true, the cells of the column can be aggregated based." + }, + "align": { "description": "Allows to align the column values in cells." }, + "availableAggregationFunctions": { + "description": "Limit the aggregation function usable on this column.
    By default, the column will have all the aggregation functions that are compatible with its type." + }, + "cellClassName": { "description": "Class name that will be added in cells for that column." }, + "colSpan": { "description": "Number of columns a cell should span." }, + "description": { + "description": "The description of the column rendered as tooltip if the column header name is not fully displayed." + }, + "disableColumnMenu": { + "description": "If true, the column menu is disabled for this column." + }, + "disableExport": { + "description": "If true, this column will not be included in exports." + }, + "disableReorder": { "description": "If true, this column cannot be reordered." }, + "display": { + "description": "Display mode for the cell:
    - 'text': For text-based cells (default)
    - 'flex': For cells with HTMLElement children" + }, + "editable": { "description": "If true, the cells of the column are editable." }, + "field": { + "description": "The column identifier. It's used to map with GridRowModel values." + }, + "filterable": { "description": "If true, the column is filterable." }, + "filterOperators": { "description": "Allows setting the filter operators for this column." }, + "flex": { "description": "If set, it indicates that a column has fluid width. Range [0, ∞)." }, + "getActions": { "description": "Function that returns the actions to be shown." }, + "getApplyQuickFilterFn": { + "description": "The callback that generates a filtering function for a given quick filter value.
    This function can return null to skip filtering for this value and column." + }, + "getSortComparator": { + "description": "Allows to use a different comparator function depending on the sort direction.
    Takes precedence over sortComparator." + }, + "groupable": { + "description": "If true, the rows can be grouped based on this column values (pro-plan only).
    Only available in DataGridPremium." + }, + "groupingValueGetter": { + "description": "Function that transforms a complex cell value into a key that be used for grouping the rows." + }, + "headerAlign": { "description": "Header cell element alignment." }, + "headerClassName": { + "description": "Class name that will be added in the column header cell." + }, + "headerName": { "description": "The title of the column rendered in the column header cell." }, + "hideable": { + "description": "If false, removes the buttons for hiding this column." + }, + "hideSortIcons": { "description": "Toggle the visibility of the sort icons." }, + "maxWidth": { "description": "Sets the maximum width of a column." }, + "minWidth": { "description": "Sets the minimum width of a column." }, + "pastedValueParser": { + "description": "Function that takes the clipboard-pasted value and converts it to a value used internally." + }, + "pinnable": { + "description": "If false, the menu items for column pinning menu will not be rendered.
    Only available in DataGridPro." + }, + "preProcessEditCellProps": { + "description": "Callback fired when the edit props of the cell changes.
    It allows to process the props that saved into the state." + }, + "renderCell": { + "description": "Allows to override the component rendered as cell for this column." + }, + "renderEditCell": { + "description": "Allows to override the component rendered in edit cell mode for this column." + }, + "renderHeader": { "description": "Allows to render a component in the column header cell." }, + "renderHeaderFilter": { + "description": "Allows to render a component in the column header filter cell." + }, + "resizable": { "description": "If true, the column is resizable." }, + "sortable": { "description": "If true, the column is sortable." }, + "sortComparator": { "description": "A comparator function used to sort rows." }, + "sortingOrder": { "description": "The order of the sorting sequence." }, + "type": { "description": "The type of the column." }, + "valueFormatter": { + "description": "Function that allows to apply a formatter before rendering its value." + }, + "valueGetter": { + "description": "Function that allows to get a specific data instead of field to render in the cell." + }, + "valueParser": { + "description": "Function that takes the user-entered value and converts it to a value used internally." + }, + "valueSetter": { + "description": "Function that allows to customize how the entered value is stored in the row.
    It only works with cell/row editing." + }, + "width": { "description": "Set the width of the column." } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-aggregation-function.json b/docs/translations/api-docs/data-grid/grid-aggregation-function.json new file mode 100644 index 000000000000..4a5bee820d1e --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-aggregation-function.json @@ -0,0 +1,23 @@ +{ + "interfaceDescription": "Grid aggregation function definition interface.", + "propertiesDescriptions": { + "apply": { + "description": "Function that takes the current cell values and generates the aggregated value." + }, + "columnTypes": { + "description": "Column types supported by this aggregation function.
    If not defined, all types are supported (in most cases this property should be defined)." + }, + "getCellValue": { + "description": "Function that allows to transform the value of the cell passed to the aggregation function applier.
    Useful for aggregating data from multiple row fields." + }, + "hasCellUnit": { + "description": "Indicates if the aggregated value have the same unit as the cells used to generate it.
    It can be used to apply a custom cell renderer only if the aggregated value has the same unit." + }, + "label": { + "description": "Label of the aggregation function.
    Will be used to add a label on the footer of the grouping column when this aggregation function is the only one being used." + }, + "valueFormatter": { + "description": "Function that allows to apply a formatter to the aggregated value.
    If not defined, the grid will use the formatter of the column." + } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-api.json b/docs/translations/api-docs/data-grid/grid-api.json new file mode 100644 index 000000000000..d3c3678e05e8 --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-api.json @@ -0,0 +1,257 @@ +{ + "interfaceDescription": "The full grid API.", + "propertiesDescriptions": { + "addRowGroupingCriteria": { "description": "Adds the field to the row grouping model." }, + "applySorting": { "description": "Applies the current sort model to the rows." }, + "autosizeColumns": { + "description": "Auto-size the columns of the grid based on the cells' content and the space available." + }, + "deleteFilterItem": { + "description": "Deletes a <a href="/x/api/data-grid/grid-filter-item/">GridFilterItem</a>." + }, + "exportDataAsCsv": { "description": "Downloads and exports a CSV of the grid's data." }, + "exportDataAsExcel": { + "description": "Downloads and exports an Excel file of the grid's data." + }, + "exportDataAsPrint": { "description": "Print the grid's data." }, + "exportState": { + "description": "Generates a serializable object containing the exportable parts of the DataGrid state.
    These values can then be passed to the initialState prop or injected using the restoreState method." + }, + "forceUpdate": { + "description": "Forces the grid to rerender. It's often used after a state update." + }, + "getAllColumns": { + "description": "Returns an array of <a href="/x/api/data-grid/grid-col-def/">GridColDef</a> containing all the column definitions." + }, + "getAllGroupDetails": { "description": "Returns the column group lookup." }, + "getAllRowIds": { "description": "Gets the list of row ids." }, + "getCellElement": { + "description": "Gets the underlying DOM element for a cell at the given id and field." + }, + "getCellMode": { "description": "Gets the mode of a cell." }, + "getCellParams": { + "description": "Gets the <a href="/x/api/data-grid/grid-cell-params/">GridCellParams</a> object that is passed as argument in events." + }, + "getCellSelectionModel": { + "description": "Returns an object containing the selection state of the cells.
    The keys of the object correpond to the row IDs.
    The value of each key is another object whose keys are the fields and values are the selection state." + }, + "getCellValue": { + "description": "Gets the value of a cell at the given id and field." + }, + "getColumn": { + "description": "Returns the <a href="/x/api/data-grid/grid-col-def/">GridColDef</a> for the given field." + }, + "getColumnGroupPath": { + "description": "Returns the id of the groups leading to the requested column.
    The array is ordered by increasing depth (the last element is the direct parent of the column)." + }, + "getColumnHeaderElement": { + "description": "Gets the underlying DOM element for the column header with the given field." + }, + "getColumnHeaderParams": { + "description": "Gets the GridColumnHeaderParams object that is passed as argument in events." + }, + "getColumnIndex": { + "description": "Returns the index position of a column. By default, only the visible columns are considered.
    Pass false to useVisibleColumns to consider all columns." + }, + "getColumnIndexRelativeToVisibleColumns": { + "description": "Gets the index of a column relative to the columns that are reachable by scroll." + }, + "getColumnPosition": { + "description": "Returns the left-position of a column relative to the inner border of the grid." + }, + "getDataAsCsv": { + "description": "Returns the grid data as a CSV string.
    This method is used internally by exportDataAsCsv." + }, + "getDataAsExcel": { + "description": "Returns the grid data as an exceljs workbook.
    This method is used internally by exportDataAsExcel." + }, + "getExpandedDetailPanels": { "description": "Returns the rows whose detail panel is open." }, + "getLocaleText": { "description": "Returns the translation for the key." }, + "getPinnedColumns": { "description": "Returns which columns are pinned." }, + "getRootDimensions": { "description": "Returns the dimensions of the grid" }, + "getRow": { "description": "Gets the row data with a given id." }, + "getRowElement": { + "description": "Gets the underlying DOM element for a row at the given id." + }, + "getRowGroupChildren": { + "description": "Gets the rows of a grouping criteria.
    Only contains the rows provided to the grid, not the rows automatically generated by it." + }, + "getRowId": { "description": "Gets the ID of a row given its data." }, + "getRowIdFromRowIndex": { + "description": "Gets the GridRowId of a row at a specific index.
    The index is based on the sorted but unfiltered row list." + }, + "getRowIndexRelativeToVisibleRows": { + "description": "Gets the index of a row relative to the rows that are reachable by scroll." + }, + "getRowMode": { "description": "Gets the mode of a row." }, + "getRowModels": { + "description": "Gets the full set of rows as Map<GridRowId, GridRowModel>." + }, + "getRowNode": { "description": "Gets the row node from the internal tree structure." }, + "getRowParams": { + "description": "Gets the <a href="/x/api/data-grid/grid-row-params/">GridRowParams</a> object that is passed as argument in events." + }, + "getRowsCount": { "description": "Gets the total number of rows in the grid." }, + "getRowWithUpdatedValues": { + "description": "Returns the row with the values that were set by editing the cells.
    In row editing, field is ignored and all fields are considered." + }, + "getScrollPosition": { "description": "Returns the current scroll position." }, + "getSelectedCellsAsArray": { + "description": "Returns an array containing only the selected cells.
    Each item is an object with the ID and field of the cell." + }, + "getSelectedRows": { "description": "Returns an array of the selected rows." }, + "getSortedRowIds": { + "description": "Returns all row ids sorted according to the active sort model." + }, + "getSortedRows": { + "description": "Returns all rows sorted according to the active sort model." + }, + "getSortModel": { "description": "Returns the sort model currently applied to the grid." }, + "getVisibleColumns": { "description": "Returns the currently visible columns." }, + "hideColumnMenu": { "description": "Hides the column menu that is open." }, + "hideFilterPanel": { "description": "Hides the filter panel." }, + "hideHeaderFilterMenu": { "description": "Hides the header filter menu." }, + "hidePreferences": { "description": "Hides the preferences panel." }, + "ignoreDiacritics": { + "description": "Returns the value of the ignoreDiacritics prop." + }, + "isCellEditable": { "description": "Controls if a cell is editable." }, + "isCellSelected": { "description": "Determines if a cell is selected or not." }, + "isColumnPinned": { "description": "Returns which side a column is pinned to." }, + "isRowSelectable": { "description": "Determines if a row can be selected or not." }, + "isRowSelected": { "description": "Determines if a row is selected or not." }, + "pinColumn": { "description": "Pins a column to the left or right side of the grid." }, + "publishEvent": { "description": "Emits an event." }, + "removeRowGroupingCriteria": { "description": "Remove the field from the row grouping model." }, + "resetRowHeights": { "description": "Forces the recalculation of the heights of all rows." }, + "resize": { + "description": "Triggers a resize of the component and recalculation of width and height." + }, + "restoreState": { "description": "Inject the given values into the state of the DataGrid." }, + "scroll": { + "description": "Triggers the viewport to scroll to the given positions (in pixels)." + }, + "scrollToIndexes": { + "description": "Triggers the viewport to scroll to the cell at indexes given by params.
    Returns true if the grid had to scroll to reach the target." + }, + "selectCellRange": { + "description": "Selects all cells that are inside the range given by start and end coordinates." + }, + "selectRow": { "description": "Change the selection state of a row." }, + "selectRowRange": { + "description": "Change the selection state of all the selectable rows in a range." + }, + "selectRows": { "description": "Change the selection state of multiple rows." }, + "setAggregationModel": { + "description": "Sets the aggregation model to the one given by model." + }, + "setCellFocus": { + "description": "Sets the focus to the cell at the given id and field." + }, + "setCellSelectionModel": { + "description": "Updates the selected cells to be those passed to the newModel argument.
    Any cell already selected will be unselected." + }, + "setColumnHeaderFilterFocus": { + "description": "Sets the focus to the column header filter at the given field." + }, + "setColumnHeaderFocus": { + "description": "Sets the focus to the column header at the given field." + }, + "setColumnIndex": { + "description": "Moves a column from its original position to the position given by targetIndexPosition." + }, + "setColumnVisibility": { + "description": "Changes the visibility of the column referred by field." + }, + "setColumnVisibilityModel": { + "description": "Sets the column visibility model to the one given by model." + }, + "setColumnWidth": { "description": "Updates the width of a column." }, + "setDensity": { "description": "Sets the density of the grid." }, + "setEditCellValue": { + "description": "Sets the value of the edit cell.
    Commonly used inside the edit cell component." + }, + "setExpandedDetailPanels": { "description": "Changes which rows to expand the detail panel." }, + "setFilterLogicOperator": { + "description": "Changes the GridLogicOperator used to connect the filters." + }, + "setFilterModel": { + "description": "Sets the filter model to the one given by model." + }, + "setPage": { + "description": "Sets the displayed page to the value given by page." + }, + "setPageSize": { + "description": "Sets the number of displayed rows to the value given by pageSize." + }, + "setPaginationModel": { + "description": "Sets the paginationModel to a new value." + }, + "setPinnedColumns": { "description": "Changes the pinned columns." }, + "setQuickFilterValues": { + "description": "Set the quick filter values to the one given by values" + }, + "setRowChildrenExpansion": { "description": "Expand or collapse a row children." }, + "setRowCount": { "description": "Sets the rowCount to a new value." }, + "setRowGroupingCriteriaIndex": { + "description": "Sets the grouping index of a grouping criteria." + }, + "setRowGroupingModel": { "description": "Sets the columns to use as grouping criteria." }, + "setRowIndex": { + "description": "Moves a row from its original position to the position given by targetIndex." + }, + "setRows": { "description": "Sets a new set of rows." }, + "setRowSelectionModel": { + "description": "Updates the selected rows to be those passed to the rowIds argument.
    Any row already selected will be unselected." + }, + "setSortModel": { "description": "Updates the sort model and triggers the sorting of rows." }, + "showColumnMenu": { + "description": "Display the column menu under the field column." + }, + "showFilterPanel": { + "description": "Shows the filter panel. If targetColumnField is given, a filter for this field is also added." + }, + "showHeaderFilterMenu": { "description": "Opens the header filter menu for the given field." }, + "showPreferences": { + "description": "Displays the preferences panel. The newValue argument controls the content of the panel." + }, + "sortColumn": { "description": "Sorts a column." }, + "startCellEditMode": { + "description": "Puts the cell corresponding to the given row id and field into edit mode." + }, + "startHeaderFilterEditMode": { + "description": "Puts the cell corresponding to the given row id and field into edit mode." + }, + "startRowEditMode": { + "description": "Puts the row corresponding to the given id into edit mode." + }, + "state": { "description": "Property that contains the whole state of the grid." }, + "stopCellEditMode": { + "description": "Puts the cell corresponding to the given row id and field into view mode and updates the original row with the new value stored.
    If params.ignoreModifications is true it will discard the modifications made." + }, + "stopHeaderFilterEditMode": { "description": "Stops the edit mode for the current field." }, + "stopRowEditMode": { + "description": "Puts the row corresponding to the given id and into view mode and updates the original row with the new values stored.
    If params.ignoreModifications is true it will discard the modifications made." + }, + "subscribeEvent": { "description": "Registers a handler for an event." }, + "toggleColumnMenu": { + "description": "Toggles the column menu under the field column." + }, + "toggleDetailPanel": { "description": "Expands or collapses the detail panel of a row." }, + "unpinColumn": { "description": "Unpins a column." }, + "unstable_replaceRows": { "description": "Replace a set of rows with new rows." }, + "unstable_setColumnVirtualization": { "description": "Enable/disable column virtualization." }, + "unstable_setPinnedRows": { "description": "Changes the pinned rows." }, + "unstable_setVirtualization": { "description": "Enable/disable virtualization." }, + "updateColumns": { + "description": "Updates the definition of multiple columns at the same time." + }, + "updateRows": { "description": "Allows to update, insert and delete rows." }, + "upsertFilterItem": { + "description": "Updates or inserts a <a href="/x/api/data-grid/grid-filter-item/">GridFilterItem</a>." + }, + "upsertFilterItems": { + "description": "Updates or inserts many <a href="/x/api/data-grid/grid-filter-item/">GridFilterItem</a>." + } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-cell-params.json b/docs/translations/api-docs/data-grid/grid-cell-params.json new file mode 100644 index 000000000000..822353871e12 --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-cell-params.json @@ -0,0 +1,18 @@ +{ + "interfaceDescription": "Object passed as parameter in the column <a href="/x/api/data-grid/grid-col-def/">GridColDef</a> cell renderer.", + "propertiesDescriptions": { + "cellMode": { "description": "The mode of the cell." }, + "colDef": { "description": "The column of the row that the current cell belongs to." }, + "field": { "description": "The column field of the cell that triggered the event." }, + "formattedValue": { "description": "The cell value formatted with the column valueFormatter." }, + "hasFocus": { "description": "If true, the cell is the active element." }, + "id": { "description": "The grid row id." }, + "isEditable": { "description": "If true, the cell is editable." }, + "row": { "description": "The row model of the row that the current cell belongs to." }, + "rowNode": { "description": "The node of the row that the current cell belongs to." }, + "tabIndex": { "description": "the tabIndex value." }, + "value": { + "description": "The cell value.
    If the column has valueGetter, use params.row to directly access the fields." + } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-col-def.json b/docs/translations/api-docs/data-grid/grid-col-def.json new file mode 100644 index 000000000000..481a5143e06c --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-col-def.json @@ -0,0 +1,94 @@ +{ + "interfaceDescription": "Column Definition interface.", + "propertiesDescriptions": { + "aggregable": { + "description": "If true, the cells of the column can be aggregated based." + }, + "align": { "description": "Allows to align the column values in cells." }, + "availableAggregationFunctions": { + "description": "Limit the aggregation function usable on this column.
    By default, the column will have all the aggregation functions that are compatible with its type." + }, + "cellClassName": { "description": "Class name that will be added in cells for that column." }, + "colSpan": { "description": "Number of columns a cell should span." }, + "description": { + "description": "The description of the column rendered as tooltip if the column header name is not fully displayed." + }, + "disableColumnMenu": { + "description": "If true, the column menu is disabled for this column." + }, + "disableExport": { + "description": "If true, this column will not be included in exports." + }, + "disableReorder": { "description": "If true, this column cannot be reordered." }, + "display": { + "description": "Display mode for the cell:
    - 'text': For text-based cells (default)
    - 'flex': For cells with HTMLElement children" + }, + "editable": { "description": "If true, the cells of the column are editable." }, + "field": { + "description": "The column identifier. It's used to map with GridRowModel values." + }, + "filterable": { "description": "If true, the column is filterable." }, + "filterOperators": { "description": "Allows setting the filter operators for this column." }, + "flex": { "description": "If set, it indicates that a column has fluid width. Range [0, ∞)." }, + "getApplyQuickFilterFn": { + "description": "The callback that generates a filtering function for a given quick filter value.
    This function can return null to skip filtering for this value and column." + }, + "getSortComparator": { + "description": "Allows to use a different comparator function depending on the sort direction.
    Takes precedence over sortComparator." + }, + "groupable": { + "description": "If true, the rows can be grouped based on this column values (pro-plan only).
    Only available in DataGridPremium." + }, + "groupingValueGetter": { + "description": "Function that transforms a complex cell value into a key that be used for grouping the rows." + }, + "headerAlign": { "description": "Header cell element alignment." }, + "headerClassName": { + "description": "Class name that will be added in the column header cell." + }, + "headerName": { "description": "The title of the column rendered in the column header cell." }, + "hideable": { + "description": "If false, removes the buttons for hiding this column." + }, + "hideSortIcons": { "description": "Toggle the visibility of the sort icons." }, + "maxWidth": { "description": "Sets the maximum width of a column." }, + "minWidth": { "description": "Sets the minimum width of a column." }, + "pastedValueParser": { + "description": "Function that takes the clipboard-pasted value and converts it to a value used internally." + }, + "pinnable": { + "description": "If false, the menu items for column pinning menu will not be rendered.
    Only available in DataGridPro." + }, + "preProcessEditCellProps": { + "description": "Callback fired when the edit props of the cell changes.
    It allows to process the props that saved into the state." + }, + "renderCell": { + "description": "Allows to override the component rendered as cell for this column." + }, + "renderEditCell": { + "description": "Allows to override the component rendered in edit cell mode for this column." + }, + "renderHeader": { "description": "Allows to render a component in the column header cell." }, + "renderHeaderFilter": { + "description": "Allows to render a component in the column header filter cell." + }, + "resizable": { "description": "If true, the column is resizable." }, + "sortable": { "description": "If true, the column is sortable." }, + "sortComparator": { "description": "A comparator function used to sort rows." }, + "sortingOrder": { "description": "The order of the sorting sequence." }, + "type": { "description": "The type of the column." }, + "valueFormatter": { + "description": "Function that allows to apply a formatter before rendering its value." + }, + "valueGetter": { + "description": "Function that allows to get a specific data instead of field to render in the cell." + }, + "valueParser": { + "description": "Function that takes the user-entered value and converts it to a value used internally." + }, + "valueSetter": { + "description": "Function that allows to customize how the entered value is stored in the row.
    It only works with cell/row editing." + }, + "width": { "description": "Set the width of the column." } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-csv-export-options.json b/docs/translations/api-docs/data-grid/grid-csv-export-options.json new file mode 100644 index 000000000000..dfcea88f04e0 --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-csv-export-options.json @@ -0,0 +1,25 @@ +{ + "interfaceDescription": "The options to apply on the CSV export.", + "propertiesDescriptions": { + "allColumns": { + "description": "If true, the hidden columns will also be exported." + }, + "delimiter": { "description": "The character used to separate fields." }, + "fields": { + "description": "The columns exported.
    This should only be used if you want to restrict the columns exports." + }, + "fileName": { "description": "The string used as the file name." }, + "getRowsToExport": { + "description": "Function that returns the list of row ids to export on the order they should be exported." + }, + "includeColumnGroupsHeaders": { + "description": "If true, the CSV will include the column groups." + }, + "includeHeaders": { + "description": "If true, the CSV will include the column headers and column groups.
    Use includeColumnGroupsHeaders to control whether the column groups are included." + }, + "utf8WithBom": { + "description": "If true, the UTF-8 Byte Order Mark (BOM) prefixes the exported file.
    This can allow Excel to automatically detect file encoding as UTF-8." + } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-excel-export-options.json b/docs/translations/api-docs/data-grid/grid-excel-export-options.json new file mode 100644 index 000000000000..f05570b1eaff --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-excel-export-options.json @@ -0,0 +1,32 @@ +{ + "interfaceDescription": "The options to apply on the Excel export.", + "propertiesDescriptions": { + "allColumns": { + "description": "If true, the hidden columns will also be exported." + }, + "columnsStyles": { "description": "Object mapping column field to Exceljs style" }, + "exceljsPostProcess": { + "description": "Method called after adding the rows to the workbook.
    Not supported when worker is set.
    To use with web workers, use the option in setupExcelExportWebWorker." + }, + "exceljsPreProcess": { + "description": "Method called before adding the rows to the workbook.
    Not supported when worker is set.
    To use with web workers, use the option in setupExcelExportWebWorker." + }, + "fields": { + "description": "The columns exported.
    This should only be used if you want to restrict the columns exports." + }, + "fileName": { "description": "The string used as the file name." }, + "getRowsToExport": { + "description": "Function that returns the list of row ids to export on the order they should be exported." + }, + "includeColumnGroupsHeaders": { + "description": "If true, the headers of the column groups will be added into the file." + }, + "includeHeaders": { + "description": "If true, the first row of the file will include the headers of the grid." + }, + "valueOptionsSheetName": { + "description": "Name given to the worksheet containing the columns valueOptions.
    valueOptions are added to this worksheet if they are provided as an array." + }, + "worker": { "description": "Function to return the Worker instance to be called." } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-export-state-params.json b/docs/translations/api-docs/data-grid/grid-export-state-params.json new file mode 100644 index 000000000000..752dbbf77893 --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-export-state-params.json @@ -0,0 +1,8 @@ +{ + "interfaceDescription": "Object passed as parameter in the exportState() grid API method.", + "propertiesDescriptions": { + "exportOnlyDirtyModels": { + "description": "By default, the grid exports all the models.
    You can switch this property to true to only exports models that are either controlled, initialized or modified.
    For instance, with this property, if you don't control or initialize the filterModel and you did not apply any filter, the model won't be exported.
    Note that the column dimensions are not a model. The grid only exports the dimensions of the modified columns even when exportOnlyDirtyModels is false." + } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-filter-item.json b/docs/translations/api-docs/data-grid/grid-filter-item.json new file mode 100644 index 000000000000..b860fc89a881 --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-filter-item.json @@ -0,0 +1,13 @@ +{ + "interfaceDescription": "Filter item definition interface.", + "propertiesDescriptions": { + "field": { "description": "The column from which we want to filter the rows." }, + "id": { + "description": "Must be unique.
    Only useful when the model contains several items." + }, + "operator": { "description": "The name of the operator we want to apply." }, + "value": { + "description": "The filtering value.
    The operator filtering function will decide for each row if the row values is correct compared to this value." + } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-filter-model.json b/docs/translations/api-docs/data-grid/grid-filter-model.json new file mode 100644 index 000000000000..32f3d45af480 --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-filter-model.json @@ -0,0 +1,16 @@ +{ + "interfaceDescription": "Model describing the filters to apply to the grid.", + "propertiesDescriptions": { + "items": { "description": "" }, + "logicOperator": { + "description": "- GridLogicOperator.And: the row must pass all the filter items.
    - GridLogicOperator.Or: the row must pass at least on filter item." + }, + "quickFilterExcludeHiddenColumns": { + "description": "If false, the quick filter will also consider cell values from hidden columns." + }, + "quickFilterLogicOperator": { + "description": "- GridLogicOperator.And: the row must pass all the values.
    - GridLogicOperator.Or: the row must pass at least one value." + }, + "quickFilterValues": { "description": "values used to quick filter rows" } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-filter-operator.json b/docs/translations/api-docs/data-grid/grid-filter-operator.json new file mode 100644 index 000000000000..7f5c8f73391a --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-filter-operator.json @@ -0,0 +1,25 @@ +{ + "interfaceDescription": "Filter operator definition interface.", + "propertiesDescriptions": { + "getApplyFilterFn": { + "description": "The callback that generates a filtering function for a given filter item and column.
    This function can return null to skip filtering for this item and column." + }, + "getValueAsString": { + "description": "Converts the value of a filter item to a human-readable form." + }, + "headerLabel": { "description": "The label of the filter shown in header filter row." }, + "InputComponent": { + "description": "The input component to render in the filter panel for this filter operator." + }, + "InputComponentProps": { + "description": "The props to pass to the input component in the filter panel for this filter operator." + }, + "label": { "description": "The label of the filter operator." }, + "requiresFilterValue": { + "description": "If false, filter operator doesn't require user-entered value to work.
    Usually should be set to false for filter operators that don't have InputComponent (for example isEmpty)" + }, + "value": { + "description": "The name of the filter operator.
    It will be matched with the operator property of the filter items." + } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-print-export-options.json b/docs/translations/api-docs/data-grid/grid-print-export-options.json new file mode 100644 index 000000000000..cee7cee030e4 --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-print-export-options.json @@ -0,0 +1,29 @@ +{ + "interfaceDescription": "The options to apply on the Print export.", + "propertiesDescriptions": { + "allColumns": { + "description": "If true, the hidden columns will also be exported." + }, + "bodyClassName": { "description": "One or more classes passed to the print window." }, + "copyStyles": { + "description": "If false, all <style> and <link type="stylesheet" /> tags from the <head> will not be copied
    to the print window." + }, + "fields": { + "description": "The columns exported.
    This should only be used if you want to restrict the columns exports." + }, + "fileName": { "description": "The value to be used as the print window title." }, + "getRowsToExport": { + "description": "Function that returns the list of row ids to export in the order they should be exported." + }, + "hideFooter": { + "description": "If true, the footer is removed for when printing." + }, + "hideToolbar": { + "description": "If true, the toolbar is removed for when printing." + }, + "includeCheckboxes": { + "description": "If true, the selection checkboxes will be included when printing." + }, + "pageStyle": { "description": "Provide Print specific styles to the print window." } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-row-class-name-params.json b/docs/translations/api-docs/data-grid/grid-row-class-name-params.json new file mode 100644 index 000000000000..e3f7e4f1b6ed --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-row-class-name-params.json @@ -0,0 +1,13 @@ +{ + "interfaceDescription": "Object passed as parameter in the row getRowClassName callback prop.", + "propertiesDescriptions": { + "columns": { "description": "All grid columns." }, + "id": { "description": "The grid row id." }, + "indexRelativeToCurrentPage": { + "description": "Index of the row in the current page.
    If the pagination is disabled, it will be the index relative to all filtered rows." + }, + "isFirstVisible": { "description": "Whether this row is the first visible or not." }, + "isLastVisible": { "description": "Whether this row is the last visible or not." }, + "row": { "description": "The row model of the row that the current cell belongs to." } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-row-params.json b/docs/translations/api-docs/data-grid/grid-row-params.json new file mode 100644 index 000000000000..b50741df1a32 --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-row-params.json @@ -0,0 +1,8 @@ +{ + "interfaceDescription": "Object passed as parameter in the row callbacks.", + "propertiesDescriptions": { + "columns": { "description": "All grid columns." }, + "id": { "description": "The grid row id." }, + "row": { "description": "The row model of the row that the current cell belongs to." } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-row-spacing-params.json b/docs/translations/api-docs/data-grid/grid-row-spacing-params.json new file mode 100644 index 000000000000..d2b53254082b --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-row-spacing-params.json @@ -0,0 +1,12 @@ +{ + "interfaceDescription": "Object passed as parameter in the row getRowSpacing callback prop.", + "propertiesDescriptions": { + "id": { "description": "The row id." }, + "indexRelativeToCurrentPage": { + "description": "Index of the row in the current page.
    If the pagination is disabled, it will be the index relative to all filtered rows." + }, + "isFirstVisible": { "description": "Whether this row is the first visible or not." }, + "isLastVisible": { "description": "Whether this row is the last visible or not." }, + "model": { "description": "The row model." } + } +} diff --git a/docs/translations/api-docs/data-grid/grid-single-select-col-def.json b/docs/translations/api-docs/data-grid/grid-single-select-col-def.json new file mode 100644 index 000000000000..346664aa577b --- /dev/null +++ b/docs/translations/api-docs/data-grid/grid-single-select-col-def.json @@ -0,0 +1,101 @@ +{ + "interfaceDescription": "Column Definition interface used for columns with the singleSelect type.", + "propertiesDescriptions": { + "aggregable": { + "description": "If true, the cells of the column can be aggregated based." + }, + "align": { "description": "Allows to align the column values in cells." }, + "availableAggregationFunctions": { + "description": "Limit the aggregation function usable on this column.
    By default, the column will have all the aggregation functions that are compatible with its type." + }, + "cellClassName": { "description": "Class name that will be added in cells for that column." }, + "colSpan": { "description": "Number of columns a cell should span." }, + "description": { + "description": "The description of the column rendered as tooltip if the column header name is not fully displayed." + }, + "disableColumnMenu": { + "description": "If true, the column menu is disabled for this column." + }, + "disableExport": { + "description": "If true, this column will not be included in exports." + }, + "disableReorder": { "description": "If true, this column cannot be reordered." }, + "display": { + "description": "Display mode for the cell:
    - 'text': For text-based cells (default)
    - 'flex': For cells with HTMLElement children" + }, + "editable": { "description": "If true, the cells of the column are editable." }, + "field": { + "description": "The column identifier. It's used to map with GridRowModel values." + }, + "filterable": { "description": "If true, the column is filterable." }, + "filterOperators": { "description": "Allows setting the filter operators for this column." }, + "flex": { "description": "If set, it indicates that a column has fluid width. Range [0, ∞)." }, + "getApplyQuickFilterFn": { + "description": "The callback that generates a filtering function for a given quick filter value.
    This function can return null to skip filtering for this value and column." + }, + "getOptionLabel": { + "description": "Used to determine the label displayed for a given value option." + }, + "getOptionValue": { "description": "Used to determine the value used for a value option." }, + "getSortComparator": { + "description": "Allows to use a different comparator function depending on the sort direction.
    Takes precedence over sortComparator." + }, + "groupable": { + "description": "If true, the rows can be grouped based on this column values (pro-plan only).
    Only available in DataGridPremium." + }, + "groupingValueGetter": { + "description": "Function that transforms a complex cell value into a key that be used for grouping the rows." + }, + "headerAlign": { "description": "Header cell element alignment." }, + "headerClassName": { + "description": "Class name that will be added in the column header cell." + }, + "headerName": { "description": "The title of the column rendered in the column header cell." }, + "hideable": { + "description": "If false, removes the buttons for hiding this column." + }, + "hideSortIcons": { "description": "Toggle the visibility of the sort icons." }, + "maxWidth": { "description": "Sets the maximum width of a column." }, + "minWidth": { "description": "Sets the minimum width of a column." }, + "pastedValueParser": { + "description": "Function that takes the clipboard-pasted value and converts it to a value used internally." + }, + "pinnable": { + "description": "If false, the menu items for column pinning menu will not be rendered.
    Only available in DataGridPro." + }, + "preProcessEditCellProps": { + "description": "Callback fired when the edit props of the cell changes.
    It allows to process the props that saved into the state." + }, + "renderCell": { + "description": "Allows to override the component rendered as cell for this column." + }, + "renderEditCell": { + "description": "Allows to override the component rendered in edit cell mode for this column." + }, + "renderHeader": { "description": "Allows to render a component in the column header cell." }, + "renderHeaderFilter": { + "description": "Allows to render a component in the column header filter cell." + }, + "resizable": { "description": "If true, the column is resizable." }, + "sortable": { "description": "If true, the column is sortable." }, + "sortComparator": { "description": "A comparator function used to sort rows." }, + "sortingOrder": { "description": "The order of the sorting sequence." }, + "type": { "description": "The type of the column." }, + "valueFormatter": { + "description": "Function that allows to apply a formatter before rendering its value." + }, + "valueGetter": { + "description": "Function that allows to get a specific data instead of field to render in the cell." + }, + "valueOptions": { + "description": "To be used in combination with type: 'singleSelect'. This is an array (or a function returning an array) of the possible cell values and labels." + }, + "valueParser": { + "description": "Function that takes the user-entered value and converts it to a value used internally." + }, + "valueSetter": { + "description": "Function that allows to customize how the entered value is stored in the row.
    It only works with cell/row editing." + }, + "width": { "description": "Set the width of the column." } + } +} From 0aa215b303062b68d48c62fc5b28194b6586c8a1 Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Thu, 28 Mar 2024 19:34:54 +0100 Subject: [PATCH 3/8] fix required properties not being reflected in the docs --- docs/scripts/api/buildInterfacesDocumentation.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/scripts/api/buildInterfacesDocumentation.ts b/docs/scripts/api/buildInterfacesDocumentation.ts index ddbc03f4b090..c2ddc7f3b2d9 100644 --- a/docs/scripts/api/buildInterfacesDocumentation.ts +++ b/docs/scripts/api/buildInterfacesDocumentation.ts @@ -31,7 +31,7 @@ interface ParsedProperty { name: string; description: string; tags: { [tagName: string]: ts.JSDocTagInfo }; - isOptional: boolean; + required: boolean; typeStr: string; /** * Name of the projects on which the interface has this property @@ -97,7 +97,7 @@ const parseProperty = async ( name: propertySymbol.name, description: getSymbolDescription(propertySymbol, project), tags: getSymbolJSDocTags(propertySymbol), - isOptional: !!propertySymbol.declarations?.find(ts.isPropertySignature)?.questionToken, + required: !propertySymbol.declarations?.find(ts.isPropertySignature)?.questionToken, typeStr: await stringifySymbol(propertySymbol, project), projects: [project.name], }); @@ -315,16 +315,16 @@ export default async function buildInterfacesDocumentation( type: { description: escapeCell(property.typeStr) }, default: getDefaultValue(property), planLevel: getPlanLevel(property), - isOptional: property.isOptional, + required: property.required, })) .sort((a, b) => a.name.localeCompare(b.name)) - .forEach(({ name, description, type, default: defaultValue, isOptional, planLevel }) => { + .forEach(({ name, description, type, default: defaultValue, required, planLevel }) => { content.properties[name] = { type }; if (defaultValue) { content.properties[name].default = defaultValue; } - if (isOptional) { - content.properties[name].isOptional = isOptional; + if (required) { + content.properties[name].required = required; } if (planLevel === 'pro') { content.properties[name].isProPlan = true; From f386171502d404efa61212fdd6c2df049805c546 Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Thu, 28 Mar 2024 19:42:18 +0100 Subject: [PATCH 4/8] show required properties first --- docs/scripts/api/buildInterfacesDocumentation.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/scripts/api/buildInterfacesDocumentation.ts b/docs/scripts/api/buildInterfacesDocumentation.ts index c2ddc7f3b2d9..9b9f5c8a4ee2 100644 --- a/docs/scripts/api/buildInterfacesDocumentation.ts +++ b/docs/scripts/api/buildInterfacesDocumentation.ts @@ -317,7 +317,15 @@ export default async function buildInterfacesDocumentation( planLevel: getPlanLevel(property), required: property.required, })) - .sort((a, b) => a.name.localeCompare(b.name)) + .sort((a, b) => { + if ((a.required && b.required) || (!a.required && !b.required)) { + return a.name.localeCompare(b.name); + } + if (a.required) { + return -1; + } + return 1; + }) .forEach(({ name, description, type, default: defaultValue, required, planLevel }) => { content.properties[name] = { type }; if (defaultValue) { From 7de8352a709edb384368aa222fb0cf9f24b5508c Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Thu, 28 Mar 2024 19:51:37 +0100 Subject: [PATCH 5/8] fix links --- docs/scripts/api/buildInterfacesDocumentation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/scripts/api/buildInterfacesDocumentation.ts b/docs/scripts/api/buildInterfacesDocumentation.ts index 9b9f5c8a4ee2..e994cba656c0 100644 --- a/docs/scripts/api/buildInterfacesDocumentation.ts +++ b/docs/scripts/api/buildInterfacesDocumentation.ts @@ -301,7 +301,7 @@ export default async function buildInterfacesDocumentation( const translations = { interfaceDescription: renderMarkdown( - escapeCell(linkify(parsedInterface.description, documentedInterfaces, 'html')), + linkify(escapeCell(parsedInterface.description || ''), documentedInterfaces, 'html'), ), propertiesDescriptions: {}, }; @@ -310,7 +310,7 @@ export default async function buildInterfacesDocumentation( .map((property) => ({ name: property.name, description: renderMarkdown( - escapeCell(linkify(property.description, documentedInterfaces, 'html')), + linkify(escapeCell(property.description), documentedInterfaces, 'html'), ), type: { description: escapeCell(property.typeStr) }, default: getDefaultValue(property), From 31c9504d630dd2730ebe4cb7ffa09f3c888c03be Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Thu, 28 Mar 2024 19:51:49 +0100 Subject: [PATCH 6/8] docs:api --- .../x/api/data-grid/grid-actions-col-def.json | 143 +++---- .../data-grid/grid-aggregation-function.json | 11 +- docs/pages/x/api/data-grid/grid-api.json | 364 +++++++++++++----- .../x/api/data-grid/grid-cell-params.json | 22 +- docs/pages/x/api/data-grid/grid-col-def.json | 136 ++----- .../data-grid/grid-csv-export-options.json | 29 +- .../data-grid/grid-excel-export-options.json | 27 +- .../data-grid/grid-export-state-params.json | 6 +- .../x/api/data-grid/grid-filter-item.json | 8 +- .../x/api/data-grid/grid-filter-model.json | 20 +- .../x/api/data-grid/grid-filter-operator.json | 30 +- .../data-grid/grid-print-export-options.json | 29 +- .../data-grid/grid-row-class-name-params.json | 12 +- .../x/api/data-grid/grid-row-params.json | 6 +- .../data-grid/grid-row-spacing-params.json | 10 +- .../data-grid/grid-single-select-col-def.json | 149 +++---- .../data-grid/grid-actions-col-def.json | 10 +- .../api-docs/data-grid/grid-api.json | 14 +- .../api-docs/data-grid/grid-cell-params.json | 6 +- .../api-docs/data-grid/grid-col-def.json | 6 +- .../api-docs/data-grid/grid-filter-item.json | 2 +- .../data-grid/grid-filter-operator.json | 6 +- .../data-grid/grid-single-select-col-def.json | 8 +- 23 files changed, 494 insertions(+), 560 deletions(-) diff --git a/docs/pages/x/api/data-grid/grid-actions-col-def.json b/docs/pages/x/api/data-grid/grid-actions-col-def.json index bc2ad4105813..ca909eb5cbaa 100644 --- a/docs/pages/x/api/data-grid/grid-actions-col-def.json +++ b/docs/pages/x/api/data-grid/grid-actions-col-def.json @@ -7,146 +7,93 @@ ], "demos": "", "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", - "isOptional": true, "isPremiumPlan": true }, - "align": { "type": { "description": "GridAlignment" }, "isOptional": true }, + "align": { "type": { "description": "GridAlignment" } }, "availableAggregationFunctions": { "type": { "description": "string[]" }, - "isOptional": true, "isPremiumPlan": true }, - "cellClassName": { - "type": { "description": "GridCellClassNamePropType<R, V>" }, - "isOptional": true - }, + "cellClassName": { "type": { "description": "GridCellClassNamePropType<R, V>" } }, "colSpan": { "type": { "description": "number | GridColSpanFn<R, V, F>" }, - "default": "1", - "isOptional": true - }, - "description": { "type": { "description": "string" }, "isOptional": true }, - "disableColumnMenu": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true - }, - "disableExport": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true - }, - "disableReorder": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true - }, - "display": { "type": { "description": "'text' | 'flex'" }, "isOptional": true }, - "editable": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, - "field": { "type": { "description": "string" } }, - "filterable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, - "filterOperators": { - "type": { "description": "GridFilterOperator<R, V, F>[]" }, - "isOptional": true - }, - "flex": { "type": { "description": "number" }, "isOptional": true }, - "getActions": { - "type": { - "description": "(params: GridRowParams<R>) => React.ReactElement<GridActionsCellItemProps>[]" - } - }, - "getApplyQuickFilterFn": { - "type": { "description": "GetApplyQuickFilterFn<R, V>" }, - "isOptional": true - }, + "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" - }, - "isOptional": true + } }, - "groupable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "groupable": { "type": { "description": "boolean" }, "default": "true" }, "groupingValueGetter": { "type": { "description": "GridGroupingValueGetter<R>" }, - "isOptional": true, "isPremiumPlan": true }, - "headerAlign": { "type": { "description": "GridAlignment" }, "isOptional": true }, - "headerClassName": { - "type": { "description": "GridColumnHeaderClassNamePropType" }, - "isOptional": true - }, - "headerName": { "type": { "description": "string" }, "isOptional": true }, - "hideable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, - "hideSortIcons": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true - }, - "maxWidth": { "type": { "description": "number" }, "default": "Infinity", "isOptional": true }, - "minWidth": { "type": { "description": "number" }, "default": "50", "isOptional": 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>" }, - "isOptional": true, "isPremiumPlan": true }, - "pinnable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "pinnable": { "type": { "description": "boolean" }, "default": "true" }, "preProcessEditCellProps": { "type": { "description": "(params: GridPreProcessEditCellProps) => GridEditCellProps | Promise<GridEditCellProps>" - }, - "isOptional": true + } }, "renderCell": { "type": { "description": "(params: GridRenderCellParams<R, V, F>) => React.ReactNode" - }, - "isOptional": true + } }, "renderEditCell": { "type": { "description": "(params: GridRenderEditCellParams<R, V, F>) => React.ReactNode" - }, - "isOptional": true + } }, "renderHeader": { "type": { "description": "(params: GridColumnHeaderParams<R, V, F>) => React.ReactNode" - }, - "isOptional": true + } }, "renderHeaderFilter": { "type": { "description": "(params: GridRenderHeaderFilterProps) => React.ReactNode" }, - "isOptional": true, "isProPlan": true }, - "resizable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, - "sortable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, - "sortComparator": { - "type": { "description": "GridComparatorFn<V>" }, - "isOptional": true - }, - "sortingOrder": { "type": { "description": "GridSortDirection[]" }, "isOptional": true }, - "type": { "type": { "description": "'actions'" }, "default": "'actions'" }, - "valueFormatter": { - "type": { "description": "GridValueFormatter<R, V, F>" }, - "isOptional": true - }, - "valueGetter": { - "type": { "description": "GridValueGetter<R, V, F>" }, - "isOptional": true - }, - "valueParser": { - "type": { "description": "GridValueParser<R, V, F>" }, - "isOptional": true - }, - "valueSetter": { - "type": { "description": "GridValueSetter<R, V, F>" }, - "isOptional": true - }, - "width": { "type": { "description": "number" }, "default": "100", "isOptional": 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" } } } diff --git a/docs/pages/x/api/data-grid/grid-aggregation-function.json b/docs/pages/x/api/data-grid/grid-aggregation-function.json index 16eef5bde368..e4209cf783dd 100644 --- a/docs/pages/x/api/data-grid/grid-aggregation-function.json +++ b/docs/pages/x/api/data-grid/grid-aggregation-function.json @@ -7,33 +7,26 @@ "type": { "description": "(params: GridAggregationParams<V>) => AV | null | undefined" }, + "required": true, "isPremiumPlan": true }, - "columnTypes": { - "type": { "description": "string[]" }, - "isOptional": true, - "isPremiumPlan": true - }, + "columnTypes": { "type": { "description": "string[]" }, "isPremiumPlan": true }, "getCellValue": { "type": { "description": "(params: GridAggregationGetCellValueParams) => V" }, - "isOptional": true, "isPremiumPlan": true }, "hasCellUnit": { "type": { "description": "boolean" }, "default": "`true`", - "isOptional": true, "isPremiumPlan": true }, "label": { "type": { "description": "string" }, "default": "`apiRef.current.getLocaleText('aggregationFunctionLabel{capitalize(name)})`", - "isOptional": true, "isPremiumPlan": true }, "valueFormatter": { "type": { "description": "(params: GridValueFormatterParams<AV>) => FAV" }, - "isOptional": true, "isPremiumPlan": true } } diff --git a/docs/pages/x/api/data-grid/grid-api.json b/docs/pages/x/api/data-grid/grid-api.json index 7fed3c5d1d8c..4acb3f3986bb 100644 --- a/docs/pages/x/api/data-grid/grid-api.json +++ b/docs/pages/x/api/data-grid/grid-api.json @@ -11,311 +11,483 @@ "type": { "description": "(groupingCriteriaField: string, groupingIndex?: number) => void" }, + "required": true, "isPremiumPlan": true }, - "applySorting": { "type": { "description": "() => void" } }, + "applySorting": { "type": { "description": "() => void" }, "required": true }, "autosizeColumns": { - "type": { "description": "(options?: GridAutosizeOptions) => Promise<void>" } + "type": { "description": "(options?: GridAutosizeOptions) => Promise<void>" }, + "required": true + }, + "deleteFilterItem": { + "type": { "description": "(item: GridFilterItem) => void" }, + "required": true + }, + "exportDataAsCsv": { + "type": { "description": "(options?: GridCsvExportOptions) => void" }, + "required": true }, - "deleteFilterItem": { "type": { "description": "(item: GridFilterItem) => void" } }, - "exportDataAsCsv": { "type": { "description": "(options?: GridCsvExportOptions) => void" } }, "exportDataAsExcel": { "type": { "description": "(options?: GridExcelExportOptions) => Promise<void>" }, + "required": true, "isPremiumPlan": true }, "exportDataAsPrint": { - "type": { "description": "(options?: GridPrintExportOptions) => void" } + "type": { "description": "(options?: GridPrintExportOptions) => void" }, + "required": true }, "exportState": { - "type": { "description": "(params?: GridExportStateParams) => InitialState" } + "type": { "description": "(params?: GridExportStateParams) => InitialState" }, + "required": true + }, + "forceUpdate": { "type": { "description": "() => void" }, "required": true }, + "getAllColumns": { "type": { "description": "() => GridStateColDef[]" }, "required": true }, + "getAllGroupDetails": { + "type": { "description": "() => GridColumnGroupLookup" }, + "required": true }, - "forceUpdate": { "type": { "description": "() => void" } }, - "getAllColumns": { "type": { "description": "() => GridStateColDef[]" } }, - "getAllGroupDetails": { "type": { "description": "() => GridColumnGroupLookup" } }, - "getAllRowIds": { "type": { "description": "() => GridRowId[]" } }, + "getAllRowIds": { "type": { "description": "() => GridRowId[]" }, "required": true }, "getCellElement": { - "type": { "description": "(id: GridRowId, field: string) => HTMLDivElement | null" } + "type": { "description": "(id: GridRowId, field: string) => HTMLDivElement | null" }, + "required": true }, "getCellMode": { - "type": { "description": "(id: GridRowId, field: string) => GridCellMode" } + "type": { "description": "(id: GridRowId, field: string) => GridCellMode" }, + "required": true }, "getCellParams": { "type": { "description": "<R extends GridValidRowModel = any, V = unknown, F = V, N extends GridTreeNode = GridTreeNode>(id: GridRowId, field: string) => GridCellParams<R, V, F, N>" - } + }, + "required": true }, "getCellSelectionModel": { "type": { "description": "() => GridCellSelectionModel" }, + "required": true, "isPremiumPlan": true }, "getCellValue": { - "type": { "description": "<V extends any = any>(id: GridRowId, field: string) => V" } + "type": { + "description": "<V extends any = any>(id: GridRowId, field: string) => V" + }, + "required": true + }, + "getColumn": { + "type": { "description": "(field: string) => GridStateColDef" }, + "required": true }, - "getColumn": { "type": { "description": "(field: string) => GridStateColDef" } }, "getColumnGroupPath": { - "type": { "description": "(field: string) => GridColumnGroup['groupId'][]" } + "type": { "description": "(field: string) => GridColumnGroup['groupId'][]" }, + "required": true }, "getColumnHeaderElement": { - "type": { "description": "(field: string) => HTMLDivElement | null" } + "type": { "description": "(field: string) => HTMLDivElement | null" }, + "required": true }, "getColumnHeaderParams": { - "type": { "description": "(field: string) => GridColumnHeaderParams" } + "type": { "description": "(field: string) => GridColumnHeaderParams" }, + "required": true }, "getColumnIndex": { - "type": { "description": "(field: string, useVisibleColumns?: boolean) => number" } + "type": { "description": "(field: string, useVisibleColumns?: boolean) => number" }, + "required": true }, "getColumnIndexRelativeToVisibleColumns": { - "type": { "description": "(field: string) => number" } + "type": { "description": "(field: string) => number" }, + "required": true + }, + "getColumnPosition": { + "type": { "description": "(field: string) => number" }, + "required": true + }, + "getDataAsCsv": { + "type": { "description": "(options?: GridCsvExportOptions) => string" }, + "required": true }, - "getColumnPosition": { "type": { "description": "(field: string) => number" } }, - "getDataAsCsv": { "type": { "description": "(options?: GridCsvExportOptions) => string" } }, "getDataAsExcel": { "type": { "description": "(options?: GridExcelExportOptions) => Promise<Excel.Workbook> | null" }, + "required": true, "isPremiumPlan": true }, "getExpandedDetailPanels": { "type": { "description": "() => GridRowId[]" }, + "required": true, "isProPlan": true }, "getLocaleText": { "type": { "description": "<T extends GridTranslationKeys>(key: T) => GridLocaleText[T]" - } + }, + "required": true }, "getPinnedColumns": { "type": { "description": "() => GridPinnedColumnFields" }, + "required": true, "isProPlan": true }, - "getRootDimensions": { "type": { "description": "() => GridDimensions" } }, + "getRootDimensions": { "type": { "description": "() => GridDimensions" }, "required": true }, "getRow": { "type": { "description": "<R extends GridValidRowModel = any>(id: GridRowId) => R | null" - } + }, + "required": true + }, + "getRowElement": { + "type": { "description": "(id: GridRowId) => HTMLDivElement | null" }, + "required": true }, - "getRowElement": { "type": { "description": "(id: GridRowId) => HTMLDivElement | null" } }, "getRowGroupChildren": { "type": { "description": "(params: GridRowGroupChildrenGetterParams) => GridRowId[]" }, + "required": true, "isProPlan": true }, "getRowId": { - "type": { "description": "<R extends GridValidRowModel = any>(row: R) => GridRowId" } + "type": { + "description": "<R extends GridValidRowModel = any>(row: R) => GridRowId" + }, + "required": true + }, + "getRowIdFromRowIndex": { + "type": { "description": "(index: number) => GridRowId" }, + "required": true }, - "getRowIdFromRowIndex": { "type": { "description": "(index: number) => GridRowId" } }, "getRowIndexRelativeToVisibleRows": { - "type": { "description": "(id: GridRowId) => number" } + "type": { "description": "(id: GridRowId) => number" }, + "required": true + }, + "getRowMode": { + "type": { "description": "(id: GridRowId) => GridRowMode" }, + "required": true + }, + "getRowModels": { + "type": { "description": "() => Map<GridRowId, GridRowModel>" }, + "required": true }, - "getRowMode": { "type": { "description": "(id: GridRowId) => GridRowMode" } }, - "getRowModels": { "type": { "description": "() => Map<GridRowId, GridRowModel>" } }, "getRowNode": { - "type": { "description": "<N extends GridTreeNode>(id: GridRowId) => N | null" } + "type": { "description": "<N extends GridTreeNode>(id: GridRowId) => N | null" }, + "required": true + }, + "getRowParams": { + "type": { "description": "(id: GridRowId) => GridRowParams" }, + "required": true }, - "getRowParams": { "type": { "description": "(id: GridRowId) => GridRowParams" } }, - "getRowsCount": { "type": { "description": "() => number" } }, + "getRowsCount": { "type": { "description": "() => number" }, "required": true }, "getRowWithUpdatedValues": { - "type": { "description": "(id: GridRowId, field: string) => GridRowModel" } + "type": { "description": "(id: GridRowId, field: string) => GridRowModel" }, + "required": true + }, + "getScrollPosition": { + "type": { "description": "() => GridScrollParams" }, + "required": true }, - "getScrollPosition": { "type": { "description": "() => GridScrollParams" } }, "getSelectedCellsAsArray": { "type": { "description": "() => GridCellCoordinates[]" }, + "required": true, "isPremiumPlan": true }, - "getSelectedRows": { "type": { "description": "() => Map<GridRowId, GridRowModel>" } }, - "getSortedRowIds": { "type": { "description": "() => GridRowId[]" } }, - "getSortedRows": { "type": { "description": "() => GridRowModel[]" } }, - "getSortModel": { "type": { "description": "() => GridSortModel" } }, - "getVisibleColumns": { "type": { "description": "() => GridStateColDef[]" } }, - "hideColumnMenu": { "type": { "description": "() => void" } }, - "hideFilterPanel": { "type": { "description": "() => void" } }, - "hideHeaderFilterMenu": { "type": { "description": "() => void" } }, - "hidePreferences": { "type": { "description": "() => void" } }, - "ignoreDiacritics": { "type": { "description": "DataGridProcessedProps['ignoreDiacritics']" } }, - "isCellEditable": { "type": { "description": "(params: GridCellParams) => boolean" } }, + "getSelectedRows": { + "type": { "description": "() => Map<GridRowId, GridRowModel>" }, + "required": true + }, + "getSortedRowIds": { "type": { "description": "() => GridRowId[]" }, "required": true }, + "getSortedRows": { "type": { "description": "() => GridRowModel[]" }, "required": true }, + "getSortModel": { "type": { "description": "() => GridSortModel" }, "required": true }, + "getVisibleColumns": { + "type": { "description": "() => GridStateColDef[]" }, + "required": true + }, + "hideColumnMenu": { "type": { "description": "() => void" }, "required": true }, + "hideFilterPanel": { "type": { "description": "() => void" }, "required": true }, + "hideHeaderFilterMenu": { "type": { "description": "() => void" }, "required": true }, + "hidePreferences": { "type": { "description": "() => void" }, "required": true }, + "ignoreDiacritics": { + "type": { "description": "DataGridProcessedProps['ignoreDiacritics']" }, + "required": true + }, + "isCellEditable": { + "type": { "description": "(params: GridCellParams) => boolean" }, + "required": true + }, "isCellSelected": { "type": { "description": "(id: GridRowId, field: GridColDef['field']) => boolean" }, + "required": true, "isPremiumPlan": true }, "isColumnPinned": { "type": { "description": "(field: string) => GridPinnedColumnPosition | false" }, + "required": true, "isProPlan": true }, - "isRowSelectable": { "type": { "description": "(id: GridRowId) => boolean" } }, - "isRowSelected": { "type": { "description": "(id: GridRowId) => boolean" } }, + "isRowSelectable": { + "type": { "description": "(id: GridRowId) => boolean" }, + "required": true + }, + "isRowSelected": { + "type": { "description": "(id: GridRowId) => boolean" }, + "required": true + }, "pinColumn": { "type": { "description": "(field: string, side: GridPinnedColumnPosition) => void" }, + "required": true, "isProPlan": true }, - "publishEvent": { "type": { "description": "GridEventPublisher" } }, + "publishEvent": { "type": { "description": "GridEventPublisher" }, "required": true }, "removeRowGroupingCriteria": { "type": { "description": "(groupingCriteriaField: string) => void" }, + "required": true, "isPremiumPlan": true }, - "resetRowHeights": { "type": { "description": "() => void" } }, - "resize": { "type": { "description": "() => void" } }, - "restoreState": { "type": { "description": "(stateToRestore: InitialState) => void" } }, - "scroll": { "type": { "description": "(params: Partial<GridScrollParams>) => void" } }, + "resetRowHeights": { "type": { "description": "() => void" }, "required": true }, + "resize": { "type": { "description": "() => void" }, "required": true }, + "restoreState": { + "type": { "description": "(stateToRestore: InitialState) => void" }, + "required": true + }, + "scroll": { + "type": { "description": "(params: Partial<GridScrollParams>) => void" }, + "required": true + }, "scrollToIndexes": { - "type": { "description": "(params: Partial<GridCellIndexCoordinates>) => boolean" } + "type": { "description": "(params: Partial<GridCellIndexCoordinates>) => boolean" }, + "required": true }, "selectCellRange": { "type": { "description": "(start: GridCellCoordinates, end: GridCellCoordinates, keepOtherSelected?: boolean) => void" }, + "required": true, "isPremiumPlan": true }, "selectRow": { "type": { "description": "(id: GridRowId, isSelected?: boolean, resetSelection?: boolean) => void" - } + }, + "required": true }, "selectRowRange": { "type": { "description": "(range: { startId: GridRowId; endId: GridRowId }, isSelected?: boolean, resetSelection?: boolean) => void" }, + "required": true, "isProPlan": true }, "selectRows": { "type": { "description": "(ids: GridRowId[], isSelected?: boolean, resetSelection?: boolean) => void" }, + "required": true, "isProPlan": true }, "setAggregationModel": { "type": { "description": "(model: GridAggregationModel) => void" }, + "required": true, "isPremiumPlan": true }, - "setCellFocus": { "type": { "description": "(id: GridRowId, field: string) => void" } }, + "setCellFocus": { + "type": { "description": "(id: GridRowId, field: string) => void" }, + "required": true + }, "setCellSelectionModel": { "type": { "description": "(newModel: GridCellSelectionModel) => void" }, + "required": true, "isPremiumPlan": true }, "setColumnHeaderFilterFocus": { - "type": { "description": "(field: string, event?: MuiBaseEvent) => void" } + "type": { "description": "(field: string, event?: MuiBaseEvent) => void" }, + "required": true }, "setColumnHeaderFocus": { - "type": { "description": "(field: string, event?: MuiBaseEvent) => void" } + "type": { "description": "(field: string, event?: MuiBaseEvent) => void" }, + "required": true }, "setColumnIndex": { "type": { "description": "(field: string, targetIndexPosition: number) => void" }, + "required": true, "isProPlan": true }, "setColumnVisibility": { - "type": { "description": "(field: string, isVisible: boolean) => void" } + "type": { "description": "(field: string, isVisible: boolean) => void" }, + "required": true }, "setColumnVisibilityModel": { - "type": { "description": "(model: GridColumnVisibilityModel) => void" } + "type": { "description": "(model: GridColumnVisibilityModel) => void" }, + "required": true + }, + "setColumnWidth": { + "type": { "description": "(field: string, width: number) => void" }, + "required": true + }, + "setDensity": { + "type": { "description": "(density: GridDensity) => void" }, + "required": true }, - "setColumnWidth": { "type": { "description": "(field: string, width: number) => void" } }, - "setDensity": { "type": { "description": "(density: GridDensity) => void" } }, "setEditCellValue": { "type": { "description": "(params: GridEditCellValueParams, event?: MuiBaseEvent) => Promise<boolean> | void" - } + }, + "required": true }, "setExpandedDetailPanels": { "type": { "description": "(ids: GridRowId[]) => void" }, + "required": true, "isProPlan": true }, "setFilterLogicOperator": { - "type": { "description": "(operator: GridLogicOperator) => void" } + "type": { "description": "(operator: GridLogicOperator) => void" }, + "required": true }, "setFilterModel": { "type": { "description": "(model: GridFilterModel, reason?: GridControlledStateReasonLookup['filter']) => void" - } + }, + "required": true + }, + "setPage": { "type": { "description": "(page: number) => void" }, "required": true }, + "setPageSize": { "type": { "description": "(pageSize: number) => void" }, "required": true }, + "setPaginationModel": { + "type": { "description": "(model: GridPaginationModel) => void" }, + "required": true }, - "setPage": { "type": { "description": "(page: number) => void" } }, - "setPageSize": { "type": { "description": "(pageSize: number) => void" } }, - "setPaginationModel": { "type": { "description": "(model: GridPaginationModel) => void" } }, "setPinnedColumns": { "type": { "description": "(pinnedColumns: GridPinnedColumnFields) => void" }, + "required": true, "isProPlan": true }, - "setQuickFilterValues": { "type": { "description": "(values: any[]) => void" } }, + "setQuickFilterValues": { + "type": { "description": "(values: any[]) => void" }, + "required": true + }, "setRowChildrenExpansion": { "type": { "description": "(id: GridRowId, isExpanded: boolean) => void" }, + "required": true, "isProPlan": true }, - "setRowCount": { "type": { "description": "(rowCount: number) => void" } }, + "setRowCount": { "type": { "description": "(rowCount: number) => void" }, "required": true }, "setRowGroupingCriteriaIndex": { "type": { "description": "(groupingCriteriaField: string, groupingIndex: number) => void" }, + "required": true, "isPremiumPlan": true }, "setRowGroupingModel": { "type": { "description": "(model: GridRowGroupingModel) => void" }, + "required": true, "isPremiumPlan": true }, "setRowIndex": { "type": { "description": "(rowId: GridRowId, targetIndex: number) => void" }, + "required": true, "isProPlan": true }, - "setRows": { "type": { "description": "(rows: GridRowModel[]) => void" } }, - "setRowSelectionModel": { "type": { "description": "(rowIds: GridRowId[]) => void" } }, - "setSortModel": { "type": { "description": "(model: GridSortModel) => void" } }, - "showColumnMenu": { "type": { "description": "(field: string) => void" } }, + "setRows": { "type": { "description": "(rows: GridRowModel[]) => void" }, "required": true }, + "setRowSelectionModel": { + "type": { "description": "(rowIds: GridRowId[]) => void" }, + "required": true + }, + "setSortModel": { + "type": { "description": "(model: GridSortModel) => void" }, + "required": true + }, + "showColumnMenu": { "type": { "description": "(field: string) => void" }, "required": true }, "showFilterPanel": { "type": { "description": "(targetColumnField?: string, panelId?: string, labelId?: string) => void" - } + }, + "required": true }, "showHeaderFilterMenu": { - "type": { "description": "(field: GridColDef['field']) => void" } + "type": { "description": "(field: GridColDef['field']) => void" }, + "required": true }, "showPreferences": { "type": { "description": "(newValue: GridPreferencePanelsValue, panelId?: string, labelId?: string) => void" - } + }, + "required": true }, "sortColumn": { "type": { "description": "(field: GridColDef['field'], direction?: GridSortDirection, allowMultipleSorting?: boolean) => void" - } + }, + "required": true }, "startCellEditMode": { - "type": { "description": "(params: GridStartCellEditModeParams) => void" } + "type": { "description": "(params: GridStartCellEditModeParams) => void" }, + "required": true }, "startHeaderFilterEditMode": { - "type": { "description": "(field: GridColDef['field']) => void" } + "type": { "description": "(field: GridColDef['field']) => void" }, + "required": true }, "startRowEditMode": { - "type": { "description": "(params: GridStartRowEditModeParams) => void" } + "type": { "description": "(params: GridStartRowEditModeParams) => void" }, + "required": true }, - "state": { "type": { "description": "State" } }, + "state": { "type": { "description": "State" }, "required": true }, "stopCellEditMode": { - "type": { "description": "(params: GridStopCellEditModeParams) => void" } + "type": { "description": "(params: GridStopCellEditModeParams) => void" }, + "required": true }, - "stopHeaderFilterEditMode": { "type": { "description": "() => void" } }, + "stopHeaderFilterEditMode": { "type": { "description": "() => void" }, "required": true }, "stopRowEditMode": { - "type": { "description": "(params: GridStopRowEditModeParams) => void" } + "type": { "description": "(params: GridStopRowEditModeParams) => void" }, + "required": true }, "subscribeEvent": { "type": { "description": "<E extends GridEvents>(event: E, handler: GridEventListener<E>, options?: EventListenerOptions) => () => void" - } + }, + "required": true + }, + "toggleColumnMenu": { + "type": { "description": "(field: string) => void" }, + "required": true }, - "toggleColumnMenu": { "type": { "description": "(field: string) => void" } }, "toggleDetailPanel": { "type": { "description": "(id: GridRowId) => void" }, + "required": true, + "isProPlan": true + }, + "unpinColumn": { + "type": { "description": "(field: string) => void" }, + "required": true, "isProPlan": true }, - "unpinColumn": { "type": { "description": "(field: string) => void" }, "isProPlan": true }, "unstable_replaceRows": { - "type": { "description": "(firstRowToReplace: number, newRows: GridRowModel[]) => void" } + "type": { "description": "(firstRowToReplace: number, newRows: GridRowModel[]) => void" }, + "required": true }, "unstable_setColumnVirtualization": { - "type": { "description": "(enabled: boolean) => void" } + "type": { "description": "(enabled: boolean) => void" }, + "required": true }, "unstable_setPinnedRows": { "type": { "description": "(pinnedRows?: GridPinnedRowsProp) => void" }, + "required": true, "isProPlan": true }, - "unstable_setVirtualization": { "type": { "description": "(enabled: boolean) => void" } }, - "updateColumns": { "type": { "description": "(cols: GridColDef[]) => void" } }, - "updateRows": { "type": { "description": "(updates: GridRowModelUpdate[]) => void" } }, - "upsertFilterItem": { "type": { "description": "(item: GridFilterItem) => void" } }, - "upsertFilterItems": { "type": { "description": "(items: GridFilterItem[]) => void" } } + "unstable_setVirtualization": { + "type": { "description": "(enabled: boolean) => void" }, + "required": true + }, + "updateColumns": { + "type": { "description": "(cols: GridColDef[]) => void" }, + "required": true + }, + "updateRows": { + "type": { "description": "(updates: GridRowModelUpdate[]) => void" }, + "required": true + }, + "upsertFilterItem": { + "type": { "description": "(item: GridFilterItem) => void" }, + "required": true + }, + "upsertFilterItems": { + "type": { "description": "(items: GridFilterItem[]) => void" }, + "required": true + } } } diff --git a/docs/pages/x/api/data-grid/grid-cell-params.json b/docs/pages/x/api/data-grid/grid-cell-params.json index f97c41daaf25..ff6ddfd6dd02 100644 --- a/docs/pages/x/api/data-grid/grid-cell-params.json +++ b/docs/pages/x/api/data-grid/grid-cell-params.json @@ -6,16 +6,16 @@ "import { GridCellParams } from '@mui/x-data-grid'" ], "properties": { - "cellMode": { "type": { "description": "GridCellMode" } }, - "colDef": { "type": { "description": "GridStateColDef" } }, - "field": { "type": { "description": "string" } }, - "formattedValue": { "type": { "description": "F | undefined" }, "isOptional": true }, - "hasFocus": { "type": { "description": "boolean" } }, - "id": { "type": { "description": "GridRowId" } }, - "isEditable": { "type": { "description": "boolean" }, "isOptional": true }, - "row": { "type": { "description": "GridRowModel<R>" } }, - "rowNode": { "type": { "description": "N" } }, - "tabIndex": { "type": { "description": "0 | -1" } }, - "value": { "type": { "description": "V | undefined" }, "isOptional": true } + "cellMode": { "type": { "description": "GridCellMode" }, "required": true }, + "colDef": { "type": { "description": "GridStateColDef" }, "required": true }, + "field": { "type": { "description": "string" }, "required": true }, + "hasFocus": { "type": { "description": "boolean" }, "required": true }, + "id": { "type": { "description": "GridRowId" }, "required": true }, + "row": { "type": { "description": "GridRowModel<R>" }, "required": true }, + "rowNode": { "type": { "description": "N" }, "required": true }, + "tabIndex": { "type": { "description": "0 | -1" }, "required": true }, + "formattedValue": { "type": { "description": "F | undefined" } }, + "isEditable": { "type": { "description": "boolean" } }, + "value": { "type": { "description": "V | undefined" } } } } diff --git a/docs/pages/x/api/data-grid/grid-col-def.json b/docs/pages/x/api/data-grid/grid-col-def.json index d98147f75a2f..6173cc8c314e 100644 --- a/docs/pages/x/api/data-grid/grid-col-def.json +++ b/docs/pages/x/api/data-grid/grid-col-def.json @@ -7,145 +7,87 @@ ], "demos": "", "properties": { + "field": { "type": { "description": "string" }, "required": true }, "aggregable": { "type": { "description": "boolean" }, "default": "true", - "isOptional": true, "isPremiumPlan": true }, - "align": { "type": { "description": "GridAlignment" }, "isOptional": true }, + "align": { "type": { "description": "GridAlignment" } }, "availableAggregationFunctions": { "type": { "description": "string[]" }, - "isOptional": true, "isPremiumPlan": true }, - "cellClassName": { - "type": { "description": "GridCellClassNamePropType<R, V>" }, - "isOptional": true - }, + "cellClassName": { "type": { "description": "GridCellClassNamePropType<R, V>" } }, "colSpan": { "type": { "description": "number | GridColSpanFn<R, V, F>" }, - "default": "1", - "isOptional": true - }, - "description": { "type": { "description": "string" }, "isOptional": true }, - "disableColumnMenu": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true - }, - "disableExport": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true - }, - "disableReorder": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true - }, - "display": { "type": { "description": "'text' | 'flex'" }, "isOptional": true }, - "editable": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, - "field": { "type": { "description": "string" } }, - "filterable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, - "filterOperators": { - "type": { "description": "GridFilterOperator<R, V, F>[]" }, - "isOptional": true - }, - "flex": { "type": { "description": "number" }, "isOptional": true }, - "getApplyQuickFilterFn": { - "type": { "description": "GetApplyQuickFilterFn<R, V>" }, - "isOptional": true - }, + "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" - }, - "isOptional": true + } }, - "groupable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "groupable": { "type": { "description": "boolean" }, "default": "true" }, "groupingValueGetter": { "type": { "description": "GridGroupingValueGetter<R>" }, - "isOptional": true, "isPremiumPlan": true }, - "headerAlign": { "type": { "description": "GridAlignment" }, "isOptional": true }, - "headerClassName": { - "type": { "description": "GridColumnHeaderClassNamePropType" }, - "isOptional": true - }, - "headerName": { "type": { "description": "string" }, "isOptional": true }, - "hideable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, - "hideSortIcons": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true - }, - "maxWidth": { "type": { "description": "number" }, "default": "Infinity", "isOptional": true }, - "minWidth": { "type": { "description": "number" }, "default": "50", "isOptional": 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>" }, - "isOptional": true, "isPremiumPlan": true }, - "pinnable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "pinnable": { "type": { "description": "boolean" }, "default": "true" }, "preProcessEditCellProps": { "type": { "description": "(params: GridPreProcessEditCellProps) => GridEditCellProps | Promise<GridEditCellProps>" - }, - "isOptional": true + } }, "renderCell": { "type": { "description": "(params: GridRenderCellParams<R, V, F>) => React.ReactNode" - }, - "isOptional": true + } }, "renderEditCell": { "type": { "description": "(params: GridRenderEditCellParams<R, V, F>) => React.ReactNode" - }, - "isOptional": true + } }, "renderHeader": { "type": { "description": "(params: GridColumnHeaderParams<R, V, F>) => React.ReactNode" - }, - "isOptional": true + } }, "renderHeaderFilter": { "type": { "description": "(params: GridRenderHeaderFilterProps) => React.ReactNode" }, - "isOptional": true, "isProPlan": true }, - "resizable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, - "sortable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, - "sortComparator": { - "type": { "description": "GridComparatorFn<V>" }, - "isOptional": true - }, - "sortingOrder": { "type": { "description": "GridSortDirection[]" }, "isOptional": true }, - "type": { - "type": { "description": "GridColType" }, - "default": "'singleSelect'", - "isOptional": true - }, - "valueFormatter": { - "type": { "description": "GridValueFormatter<R, V, F>" }, - "isOptional": true - }, - "valueGetter": { - "type": { "description": "GridValueGetter<R, V, F>" }, - "isOptional": true - }, - "valueParser": { - "type": { "description": "GridValueParser<R, V, F>" }, - "isOptional": true - }, - "valueSetter": { - "type": { "description": "GridValueSetter<R, V, F>" }, - "isOptional": true - }, - "width": { "type": { "description": "number" }, "default": "100", "isOptional": true } + "resizable": { "type": { "description": "boolean" }, "default": "true" }, + "sortable": { "type": { "description": "boolean" }, "default": "true" }, + "sortComparator": { "type": { "description": "GridComparatorFn<V>" } }, + "sortingOrder": { "type": { "description": "GridSortDirection[]" } }, + "type": { "type": { "description": "GridColType" }, "default": "'singleSelect'" }, + "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" } } } diff --git a/docs/pages/x/api/data-grid/grid-csv-export-options.json b/docs/pages/x/api/data-grid/grid-csv-export-options.json index fc5f69a48f01..c8ec2874beb7 100644 --- a/docs/pages/x/api/data-grid/grid-csv-export-options.json +++ b/docs/pages/x/api/data-grid/grid-csv-export-options.json @@ -7,28 +7,15 @@ ], "demos": "", "properties": { - "allColumns": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, - "delimiter": { "type": { "description": "string" }, "default": "','", "isOptional": true }, - "fields": { "type": { "description": "string[]" }, "isOptional": true }, - "fileName": { - "type": { "description": "string" }, - "default": "`document.title`", - "isOptional": true - }, + "allColumns": { "type": { "description": "boolean" }, "default": "false" }, + "delimiter": { "type": { "description": "string" }, "default": "','" }, + "fields": { "type": { "description": "string[]" } }, + "fileName": { "type": { "description": "string" }, "default": "`document.title`" }, "getRowsToExport": { - "type": { "description": "(params: GridCsvGetRowsToExportParams) => GridRowId[]" }, - "isOptional": true - }, - "includeColumnGroupsHeaders": { - "type": { "description": "boolean" }, - "default": "true", - "isOptional": true - }, - "includeHeaders": { - "type": { "description": "boolean" }, - "default": "true", - "isOptional": true + "type": { "description": "(params: GridCsvGetRowsToExportParams) => GridRowId[]" } }, - "utf8WithBom": { "type": { "description": "boolean" }, "default": "false", "isOptional": true } + "includeColumnGroupsHeaders": { "type": { "description": "boolean" }, "default": "true" }, + "includeHeaders": { "type": { "description": "boolean" }, "default": "true" }, + "utf8WithBom": { "type": { "description": "boolean" }, "default": "false" } } } diff --git a/docs/pages/x/api/data-grid/grid-excel-export-options.json b/docs/pages/x/api/data-grid/grid-excel-export-options.json index f2f0f5d24113..8df7897c3fd4 100644 --- a/docs/pages/x/api/data-grid/grid-excel-export-options.json +++ b/docs/pages/x/api/data-grid/grid-excel-export-options.json @@ -6,61 +6,42 @@ "allColumns": { "type": { "description": "boolean" }, "default": "false", - "isOptional": true, - "isPremiumPlan": true - }, - "columnsStyles": { - "type": { "description": "ColumnsStylesInterface" }, - "isOptional": true, "isPremiumPlan": true }, + "columnsStyles": { "type": { "description": "ColumnsStylesInterface" }, "isPremiumPlan": true }, "exceljsPostProcess": { "type": { "description": "(processInput: GridExceljsProcessInput) => Promise<void>" }, - "isOptional": true, "isPremiumPlan": true }, "exceljsPreProcess": { "type": { "description": "(processInput: GridExceljsProcessInput) => Promise<void>" }, - "isOptional": true, "isPremiumPlan": true }, - "fields": { "type": { "description": "string[]" }, "isOptional": true, "isPremiumPlan": true }, + "fields": { "type": { "description": "string[]" }, "isPremiumPlan": true }, "fileName": { "type": { "description": "string" }, "default": "`document.title`", - "isOptional": true, "isPremiumPlan": true }, "getRowsToExport": { "type": { "description": "(params: GridGetRowsToExportParams<Api>) => GridRowId[]" }, - "isOptional": true, "isPremiumPlan": true }, "includeColumnGroupsHeaders": { "type": { "description": "boolean" }, "default": "true", - "isOptional": true, "isPremiumPlan": true }, "includeHeaders": { "type": { "description": "boolean" }, "default": "true", - "isOptional": true, - "isPremiumPlan": true - }, - "valueOptionsSheetName": { - "type": { "description": "string" }, - "isOptional": true, "isPremiumPlan": true }, - "worker": { - "type": { "description": "() => Worker" }, - "isOptional": true, - "isPremiumPlan": true - } + "valueOptionsSheetName": { "type": { "description": "string" }, "isPremiumPlan": true }, + "worker": { "type": { "description": "() => Worker" }, "isPremiumPlan": true } } } diff --git a/docs/pages/x/api/data-grid/grid-export-state-params.json b/docs/pages/x/api/data-grid/grid-export-state-params.json index e1ae5bf430ff..5c34d3ef7b1d 100644 --- a/docs/pages/x/api/data-grid/grid-export-state-params.json +++ b/docs/pages/x/api/data-grid/grid-export-state-params.json @@ -7,10 +7,6 @@ ], "demos": "", "properties": { - "exportOnlyDirtyModels": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true - } + "exportOnlyDirtyModels": { "type": { "description": "boolean" }, "default": "false" } } } diff --git a/docs/pages/x/api/data-grid/grid-filter-item.json b/docs/pages/x/api/data-grid/grid-filter-item.json index 9bbb9f778a0a..85bb43343309 100644 --- a/docs/pages/x/api/data-grid/grid-filter-item.json +++ b/docs/pages/x/api/data-grid/grid-filter-item.json @@ -7,9 +7,9 @@ ], "demos": "", "properties": { - "field": { "type": { "description": "string" } }, - "id": { "type": { "description": "number | string" }, "isOptional": true }, - "operator": { "type": { "description": "string" } }, - "value": { "type": { "description": "any" }, "isOptional": true } + "field": { "type": { "description": "string" }, "required": true }, + "operator": { "type": { "description": "string" }, "required": true }, + "id": { "type": { "description": "number | string" } }, + "value": { "type": { "description": "any" } } } } diff --git a/docs/pages/x/api/data-grid/grid-filter-model.json b/docs/pages/x/api/data-grid/grid-filter-model.json index e2e04c312fd9..c67155f35a6b 100644 --- a/docs/pages/x/api/data-grid/grid-filter-model.json +++ b/docs/pages/x/api/data-grid/grid-filter-model.json @@ -7,26 +7,16 @@ ], "demos": "", "properties": { - "items": { "type": { "description": "GridFilterItem[]" }, "default": "[]" }, + "items": { "type": { "description": "GridFilterItem[]" }, "default": "[]", "required": true }, "logicOperator": { "type": { "description": "GridLogicOperator" }, - "default": "`GridLogicOperator.And`", - "isOptional": true - }, - "quickFilterExcludeHiddenColumns": { - "type": { "description": "boolean" }, - "default": "true", - "isOptional": true + "default": "`GridLogicOperator.And`" }, + "quickFilterExcludeHiddenColumns": { "type": { "description": "boolean" }, "default": "true" }, "quickFilterLogicOperator": { "type": { "description": "GridLogicOperator" }, - "default": "`GridLogicOperator.And`", - "isOptional": true + "default": "`GridLogicOperator.And`" }, - "quickFilterValues": { - "type": { "description": "any[]" }, - "default": "`[]`", - "isOptional": true - } + "quickFilterValues": { "type": { "description": "any[]" }, "default": "`[]`" } } } diff --git a/docs/pages/x/api/data-grid/grid-filter-operator.json b/docs/pages/x/api/data-grid/grid-filter-operator.json index 3cb0d3223f94..bde12a0cc644 100644 --- a/docs/pages/x/api/data-grid/grid-filter-operator.json +++ b/docs/pages/x/api/data-grid/grid-filter-operator.json @@ -7,26 +7,18 @@ ], "demos": "", "properties": { - "getApplyFilterFn": { "type": { "description": "GetApplyFilterFn<R, V, F>" } }, - "getValueAsString": { - "type": { "description": "(value: GridFilterItem['value']) => string" }, - "isOptional": true - }, - "headerLabel": { "type": { "description": "string" }, "isOptional": true }, - "InputComponent": { - "type": { "description": "React.JSXElementConstructor<any>" }, - "isOptional": true + "getApplyFilterFn": { + "type": { "description": "GetApplyFilterFn<R, V, F>" }, + "required": true }, - "InputComponentProps": { - "type": { "description": "Record<string, any>" }, - "isOptional": true - }, - "label": { "type": { "description": "string" }, "isOptional": true }, - "requiresFilterValue": { - "type": { "description": "boolean" }, - "default": "true", - "isOptional": true + "value": { "type": { "description": "string" }, "required": true }, + "getValueAsString": { + "type": { "description": "(value: GridFilterItem['value']) => string" } }, - "value": { "type": { "description": "string" } } + "headerLabel": { "type": { "description": "string" } }, + "InputComponent": { "type": { "description": "React.JSXElementConstructor<any>" } }, + "InputComponentProps": { "type": { "description": "Record<string, any>" } }, + "label": { "type": { "description": "string" } }, + "requiresFilterValue": { "type": { "description": "boolean" }, "default": "true" } } } 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 ddd56f3eadf1..6d19c1df3ffc 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 @@ -7,26 +7,17 @@ ], "demos": "", "properties": { - "allColumns": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, - "bodyClassName": { "type": { "description": "string" }, "isOptional": true }, - "copyStyles": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, - "fields": { "type": { "description": "string[]" }, "isOptional": true }, - "fileName": { - "type": { "description": "string" }, - "default": "The title of the page.", - "isOptional": true - }, + "allColumns": { "type": { "description": "boolean" }, "default": "false" }, + "bodyClassName": { "type": { "description": "string" } }, + "copyStyles": { "type": { "description": "boolean" }, "default": "true" }, + "fields": { "type": { "description": "string[]" } }, + "fileName": { "type": { "description": "string" }, "default": "The title of the page." }, "getRowsToExport": { - "type": { "description": "(params: GridPrintGetRowsToExportParams) => GridRowId[]" }, - "isOptional": true - }, - "hideFooter": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, - "hideToolbar": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, - "includeCheckboxes": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true + "type": { "description": "(params: GridPrintGetRowsToExportParams) => GridRowId[]" } }, - "pageStyle": { "type": { "description": "string | Function" }, "isOptional": true } + "hideFooter": { "type": { "description": "boolean" }, "default": "false" }, + "hideToolbar": { "type": { "description": "boolean" }, "default": "false" }, + "includeCheckboxes": { "type": { "description": "boolean" }, "default": "false" }, + "pageStyle": { "type": { "description": "string | Function" } } } } diff --git a/docs/pages/x/api/data-grid/grid-row-class-name-params.json b/docs/pages/x/api/data-grid/grid-row-class-name-params.json index e4dcfd2be853..a465debda6d7 100644 --- a/docs/pages/x/api/data-grid/grid-row-class-name-params.json +++ b/docs/pages/x/api/data-grid/grid-row-class-name-params.json @@ -7,11 +7,11 @@ ], "demos": "", "properties": { - "columns": { "type": { "description": "GridColDef[]" } }, - "id": { "type": { "description": "GridRowId" } }, - "indexRelativeToCurrentPage": { "type": { "description": "number" } }, - "isFirstVisible": { "type": { "description": "boolean" } }, - "isLastVisible": { "type": { "description": "boolean" } }, - "row": { "type": { "description": "R" } } + "columns": { "type": { "description": "GridColDef[]" }, "required": true }, + "id": { "type": { "description": "GridRowId" }, "required": true }, + "indexRelativeToCurrentPage": { "type": { "description": "number" }, "required": true }, + "isFirstVisible": { "type": { "description": "boolean" }, "required": true }, + "isLastVisible": { "type": { "description": "boolean" }, "required": true }, + "row": { "type": { "description": "R" }, "required": true } } } diff --git a/docs/pages/x/api/data-grid/grid-row-params.json b/docs/pages/x/api/data-grid/grid-row-params.json index d799afa1427c..1231121600c4 100644 --- a/docs/pages/x/api/data-grid/grid-row-params.json +++ b/docs/pages/x/api/data-grid/grid-row-params.json @@ -7,8 +7,8 @@ ], "demos": "", "properties": { - "columns": { "type": { "description": "GridColDef[]" } }, - "id": { "type": { "description": "GridRowId" } }, - "row": { "type": { "description": "R" } } + "columns": { "type": { "description": "GridColDef[]" }, "required": true }, + "id": { "type": { "description": "GridRowId" }, "required": true }, + "row": { "type": { "description": "R" }, "required": true } } } diff --git a/docs/pages/x/api/data-grid/grid-row-spacing-params.json b/docs/pages/x/api/data-grid/grid-row-spacing-params.json index fddc9038e033..72cd33c599de 100644 --- a/docs/pages/x/api/data-grid/grid-row-spacing-params.json +++ b/docs/pages/x/api/data-grid/grid-row-spacing-params.json @@ -7,10 +7,10 @@ ], "demos": "", "properties": { - "id": { "type": { "description": "GridRowId" } }, - "indexRelativeToCurrentPage": { "type": { "description": "number" } }, - "isFirstVisible": { "type": { "description": "boolean" } }, - "isLastVisible": { "type": { "description": "boolean" } }, - "model": { "type": { "description": "R" } } + "id": { "type": { "description": "GridRowId" }, "required": true }, + "indexRelativeToCurrentPage": { "type": { "description": "number" }, "required": true }, + "isFirstVisible": { "type": { "description": "boolean" }, "required": true }, + "isLastVisible": { "type": { "description": "boolean" }, "required": true }, + "model": { "type": { "description": "R" }, "required": true } } } diff --git a/docs/pages/x/api/data-grid/grid-single-select-col-def.json b/docs/pages/x/api/data-grid/grid-single-select-col-def.json index c64768bb253a..2e62dcbf36e9 100644 --- a/docs/pages/x/api/data-grid/grid-single-select-col-def.json +++ b/docs/pages/x/api/data-grid/grid-single-select-col-def.json @@ -7,155 +7,98 @@ ], "demos": "", "properties": { + "field": { "type": { "description": "string" }, "required": true }, + "type": { + "type": { "description": "'singleSelect'" }, + "default": "'singleSelect'", + "required": true + }, "aggregable": { "type": { "description": "boolean" }, "default": "true", - "isOptional": true, "isPremiumPlan": true }, - "align": { "type": { "description": "GridAlignment" }, "isOptional": true }, + "align": { "type": { "description": "GridAlignment" } }, "availableAggregationFunctions": { "type": { "description": "string[]" }, - "isOptional": true, "isPremiumPlan": true }, - "cellClassName": { - "type": { "description": "GridCellClassNamePropType<R, V>" }, - "isOptional": true - }, + "cellClassName": { "type": { "description": "GridCellClassNamePropType<R, V>" } }, "colSpan": { "type": { "description": "number | GridColSpanFn<R, V, F>" }, - "default": "1", - "isOptional": true - }, - "description": { "type": { "description": "string" }, "isOptional": true }, - "disableColumnMenu": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true - }, - "disableExport": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true - }, - "disableReorder": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true - }, - "display": { "type": { "description": "'text' | 'flex'" }, "isOptional": true }, - "editable": { "type": { "description": "boolean" }, "default": "false", "isOptional": true }, - "field": { "type": { "description": "string" } }, - "filterable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, - "filterOperators": { - "type": { "description": "GridFilterOperator<R, V, F>[]" }, - "isOptional": true - }, - "flex": { "type": { "description": "number" }, "isOptional": true }, - "getApplyQuickFilterFn": { - "type": { "description": "GetApplyQuickFilterFn<R, V>" }, - "isOptional": true - }, - "getOptionLabel": { - "type": { "description": "(value: ValueOptions) => string" }, - "isOptional": true - }, - "getOptionValue": { - "type": { "description": "(value: ValueOptions) => any" }, - "isOptional": true - }, + "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>" } }, + "getOptionLabel": { "type": { "description": "(value: ValueOptions) => string" } }, + "getOptionValue": { "type": { "description": "(value: ValueOptions) => any" } }, "getSortComparator": { "type": { "description": "(sortDirection: GridSortDirection) => GridComparatorFn<V> | undefined" - }, - "isOptional": true + } }, - "groupable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "groupable": { "type": { "description": "boolean" }, "default": "true" }, "groupingValueGetter": { "type": { "description": "GridGroupingValueGetter<R>" }, - "isOptional": true, "isPremiumPlan": true }, - "headerAlign": { "type": { "description": "GridAlignment" }, "isOptional": true }, - "headerClassName": { - "type": { "description": "GridColumnHeaderClassNamePropType" }, - "isOptional": true - }, - "headerName": { "type": { "description": "string" }, "isOptional": true }, - "hideable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, - "hideSortIcons": { - "type": { "description": "boolean" }, - "default": "false", - "isOptional": true - }, - "maxWidth": { "type": { "description": "number" }, "default": "Infinity", "isOptional": true }, - "minWidth": { "type": { "description": "number" }, "default": "50", "isOptional": 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>" }, - "isOptional": true, "isPremiumPlan": true }, - "pinnable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, + "pinnable": { "type": { "description": "boolean" }, "default": "true" }, "preProcessEditCellProps": { "type": { "description": "(params: GridPreProcessEditCellProps) => GridEditCellProps | Promise<GridEditCellProps>" - }, - "isOptional": true + } }, "renderCell": { "type": { "description": "(params: GridRenderCellParams<R, V, F>) => React.ReactNode" - }, - "isOptional": true + } }, "renderEditCell": { "type": { "description": "(params: GridRenderEditCellParams<R, V, F>) => React.ReactNode" - }, - "isOptional": true + } }, "renderHeader": { "type": { "description": "(params: GridColumnHeaderParams<R, V, F>) => React.ReactNode" - }, - "isOptional": true + } }, "renderHeaderFilter": { "type": { "description": "(params: GridRenderHeaderFilterProps) => React.ReactNode" }, - "isOptional": true, "isProPlan": true }, - "resizable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, - "sortable": { "type": { "description": "boolean" }, "default": "true", "isOptional": true }, - "sortComparator": { - "type": { "description": "GridComparatorFn<V>" }, - "isOptional": true - }, - "sortingOrder": { "type": { "description": "GridSortDirection[]" }, "isOptional": true }, - "type": { "type": { "description": "'singleSelect'" }, "default": "'singleSelect'" }, - "valueFormatter": { - "type": { "description": "GridValueFormatter<R, V, F>" }, - "isOptional": true - }, - "valueGetter": { - "type": { "description": "GridValueGetter<R, V, F>" }, - "isOptional": 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>" } }, "valueOptions": { "type": { "description": "Array<ValueOptions> | ((params: GridValueOptionsParams<R>) => Array<ValueOptions>)" - }, - "isOptional": true - }, - "valueParser": { - "type": { "description": "GridValueParser<R, V, F>" }, - "isOptional": true - }, - "valueSetter": { - "type": { "description": "GridValueSetter<R, V, F>" }, - "isOptional": true + } }, - "width": { "type": { "description": "number" }, "default": "100", "isOptional": true } + "valueParser": { "type": { "description": "GridValueParser<R, V, F>" } }, + "valueSetter": { "type": { "description": "GridValueSetter<R, V, F>" } }, + "width": { "type": { "description": "number" }, "default": "100" } } } diff --git a/docs/translations/api-docs/data-grid/grid-actions-col-def.json b/docs/translations/api-docs/data-grid/grid-actions-col-def.json index 8b275128177a..087bee3376cc 100644 --- a/docs/translations/api-docs/data-grid/grid-actions-col-def.json +++ b/docs/translations/api-docs/data-grid/grid-actions-col-def.json @@ -1,6 +1,11 @@ { "interfaceDescription": "Column Definition interface used for columns with the actions type.", "propertiesDescriptions": { + "field": { + "description": "The column identifier. It's used to map with GridRowModel values." + }, + "getActions": { "description": "Function that returns the actions to be shown." }, + "type": { "description": "The type of the column." }, "aggregable": { "description": "If true, the cells of the column can be aggregated based." }, @@ -24,13 +29,9 @@ "description": "Display mode for the cell:
    - 'text': For text-based cells (default)
    - 'flex': For cells with HTMLElement children" }, "editable": { "description": "If true, the cells of the column are editable." }, - "field": { - "description": "The column identifier. It's used to map with GridRowModel values." - }, "filterable": { "description": "If true, the column is filterable." }, "filterOperators": { "description": "Allows setting the filter operators for this column." }, "flex": { "description": "If set, it indicates that a column has fluid width. Range [0, ∞)." }, - "getActions": { "description": "Function that returns the actions to be shown." }, "getApplyQuickFilterFn": { "description": "The callback that generates a filtering function for a given quick filter value.
    This function can return null to skip filtering for this value and column." }, @@ -77,7 +78,6 @@ "sortable": { "description": "If true, the column is sortable." }, "sortComparator": { "description": "A comparator function used to sort rows." }, "sortingOrder": { "description": "The order of the sorting sequence." }, - "type": { "description": "The type of the column." }, "valueFormatter": { "description": "Function that allows to apply a formatter before rendering its value." }, diff --git a/docs/translations/api-docs/data-grid/grid-api.json b/docs/translations/api-docs/data-grid/grid-api.json index d3c3678e05e8..ba27c6f79b3a 100644 --- a/docs/translations/api-docs/data-grid/grid-api.json +++ b/docs/translations/api-docs/data-grid/grid-api.json @@ -7,7 +7,7 @@ "description": "Auto-size the columns of the grid based on the cells' content and the space available." }, "deleteFilterItem": { - "description": "Deletes a <a href="/x/api/data-grid/grid-filter-item/">GridFilterItem</a>." + "description": "Deletes a GridFilterItem." }, "exportDataAsCsv": { "description": "Downloads and exports a CSV of the grid's data." }, "exportDataAsExcel": { @@ -21,7 +21,7 @@ "description": "Forces the grid to rerender. It's often used after a state update." }, "getAllColumns": { - "description": "Returns an array of <a href="/x/api/data-grid/grid-col-def/">GridColDef</a> containing all the column definitions." + "description": "Returns an array of GridColDef containing all the column definitions." }, "getAllGroupDetails": { "description": "Returns the column group lookup." }, "getAllRowIds": { "description": "Gets the list of row ids." }, @@ -30,7 +30,7 @@ }, "getCellMode": { "description": "Gets the mode of a cell." }, "getCellParams": { - "description": "Gets the <a href="/x/api/data-grid/grid-cell-params/">GridCellParams</a> object that is passed as argument in events." + "description": "Gets the GridCellParams object that is passed as argument in events." }, "getCellSelectionModel": { "description": "Returns an object containing the selection state of the cells.
    The keys of the object correpond to the row IDs.
    The value of each key is another object whose keys are the fields and values are the selection state." @@ -39,7 +39,7 @@ "description": "Gets the value of a cell at the given id and field." }, "getColumn": { - "description": "Returns the <a href="/x/api/data-grid/grid-col-def/">GridColDef</a> for the given field." + "description": "Returns the GridColDef for the given field." }, "getColumnGroupPath": { "description": "Returns the id of the groups leading to the requested column.
    The array is ordered by increasing depth (the last element is the direct parent of the column)." @@ -89,7 +89,7 @@ }, "getRowNode": { "description": "Gets the row node from the internal tree structure." }, "getRowParams": { - "description": "Gets the <a href="/x/api/data-grid/grid-row-params/">GridRowParams</a> object that is passed as argument in events." + "description": "Gets the GridRowParams object that is passed as argument in events." }, "getRowsCount": { "description": "Gets the total number of rows in the grid." }, "getRowWithUpdatedValues": { @@ -248,10 +248,10 @@ }, "updateRows": { "description": "Allows to update, insert and delete rows." }, "upsertFilterItem": { - "description": "Updates or inserts a <a href="/x/api/data-grid/grid-filter-item/">GridFilterItem</a>." + "description": "Updates or inserts a GridFilterItem." }, "upsertFilterItems": { - "description": "Updates or inserts many <a href="/x/api/data-grid/grid-filter-item/">GridFilterItem</a>." + "description": "Updates or inserts many GridFilterItem." } } } diff --git a/docs/translations/api-docs/data-grid/grid-cell-params.json b/docs/translations/api-docs/data-grid/grid-cell-params.json index 822353871e12..39d3bbcc3661 100644 --- a/docs/translations/api-docs/data-grid/grid-cell-params.json +++ b/docs/translations/api-docs/data-grid/grid-cell-params.json @@ -1,16 +1,16 @@ { - "interfaceDescription": "Object passed as parameter in the column <a href="/x/api/data-grid/grid-col-def/">GridColDef</a> cell renderer.", + "interfaceDescription": "Object passed as parameter in the column GridColDef cell renderer.", "propertiesDescriptions": { "cellMode": { "description": "The mode of the cell." }, "colDef": { "description": "The column of the row that the current cell belongs to." }, "field": { "description": "The column field of the cell that triggered the event." }, - "formattedValue": { "description": "The cell value formatted with the column valueFormatter." }, "hasFocus": { "description": "If true, the cell is the active element." }, "id": { "description": "The grid row id." }, - "isEditable": { "description": "If true, the cell is editable." }, "row": { "description": "The row model of the row that the current cell belongs to." }, "rowNode": { "description": "The node of the row that the current cell belongs to." }, "tabIndex": { "description": "the tabIndex value." }, + "formattedValue": { "description": "The cell value formatted with the column valueFormatter." }, + "isEditable": { "description": "If true, the cell is editable." }, "value": { "description": "The cell value.
    If the column has valueGetter, use params.row to directly access the fields." } diff --git a/docs/translations/api-docs/data-grid/grid-col-def.json b/docs/translations/api-docs/data-grid/grid-col-def.json index 481a5143e06c..15b648e0809e 100644 --- a/docs/translations/api-docs/data-grid/grid-col-def.json +++ b/docs/translations/api-docs/data-grid/grid-col-def.json @@ -1,6 +1,9 @@ { "interfaceDescription": "Column Definition interface.", "propertiesDescriptions": { + "field": { + "description": "The column identifier. It's used to map with GridRowModel values." + }, "aggregable": { "description": "If true, the cells of the column can be aggregated based." }, @@ -24,9 +27,6 @@ "description": "Display mode for the cell:
    - 'text': For text-based cells (default)
    - 'flex': For cells with HTMLElement children" }, "editable": { "description": "If true, the cells of the column are editable." }, - "field": { - "description": "The column identifier. It's used to map with GridRowModel values." - }, "filterable": { "description": "If true, the column is filterable." }, "filterOperators": { "description": "Allows setting the filter operators for this column." }, "flex": { "description": "If set, it indicates that a column has fluid width. Range [0, ∞)." }, diff --git a/docs/translations/api-docs/data-grid/grid-filter-item.json b/docs/translations/api-docs/data-grid/grid-filter-item.json index b860fc89a881..68a0d9cafdd1 100644 --- a/docs/translations/api-docs/data-grid/grid-filter-item.json +++ b/docs/translations/api-docs/data-grid/grid-filter-item.json @@ -2,10 +2,10 @@ "interfaceDescription": "Filter item definition interface.", "propertiesDescriptions": { "field": { "description": "The column from which we want to filter the rows." }, + "operator": { "description": "The name of the operator we want to apply." }, "id": { "description": "Must be unique.
    Only useful when the model contains several items." }, - "operator": { "description": "The name of the operator we want to apply." }, "value": { "description": "The filtering value.
    The operator filtering function will decide for each row if the row values is correct compared to this value." } diff --git a/docs/translations/api-docs/data-grid/grid-filter-operator.json b/docs/translations/api-docs/data-grid/grid-filter-operator.json index 7f5c8f73391a..38d966ab5a97 100644 --- a/docs/translations/api-docs/data-grid/grid-filter-operator.json +++ b/docs/translations/api-docs/data-grid/grid-filter-operator.json @@ -4,6 +4,9 @@ "getApplyFilterFn": { "description": "The callback that generates a filtering function for a given filter item and column.
    This function can return null to skip filtering for this item and column." }, + "value": { + "description": "The name of the filter operator.
    It will be matched with the operator property of the filter items." + }, "getValueAsString": { "description": "Converts the value of a filter item to a human-readable form." }, @@ -17,9 +20,6 @@ "label": { "description": "The label of the filter operator." }, "requiresFilterValue": { "description": "If false, filter operator doesn't require user-entered value to work.
    Usually should be set to false for filter operators that don't have InputComponent (for example isEmpty)" - }, - "value": { - "description": "The name of the filter operator.
    It will be matched with the operator property of the filter items." } } } diff --git a/docs/translations/api-docs/data-grid/grid-single-select-col-def.json b/docs/translations/api-docs/data-grid/grid-single-select-col-def.json index 346664aa577b..fdd0720fd1a2 100644 --- a/docs/translations/api-docs/data-grid/grid-single-select-col-def.json +++ b/docs/translations/api-docs/data-grid/grid-single-select-col-def.json @@ -1,6 +1,10 @@ { "interfaceDescription": "Column Definition interface used for columns with the singleSelect type.", "propertiesDescriptions": { + "field": { + "description": "The column identifier. It's used to map with GridRowModel values." + }, + "type": { "description": "The type of the column." }, "aggregable": { "description": "If true, the cells of the column can be aggregated based." }, @@ -24,9 +28,6 @@ "description": "Display mode for the cell:
    - 'text': For text-based cells (default)
    - 'flex': For cells with HTMLElement children" }, "editable": { "description": "If true, the cells of the column are editable." }, - "field": { - "description": "The column identifier. It's used to map with GridRowModel values." - }, "filterable": { "description": "If true, the column is filterable." }, "filterOperators": { "description": "Allows setting the filter operators for this column." }, "flex": { "description": "If set, it indicates that a column has fluid width. Range [0, ∞)." }, @@ -80,7 +81,6 @@ "sortable": { "description": "If true, the column is sortable." }, "sortComparator": { "description": "A comparator function used to sort rows." }, "sortingOrder": { "description": "The order of the sorting sequence." }, - "type": { "description": "The type of the column." }, "valueFormatter": { "description": "Function that allows to apply a formatter before rendering its value." }, From ca055736d59fa009467ab0585c0aac9db5e8b11c Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Thu, 28 Mar 2024 19:58:42 +0100 Subject: [PATCH 7/8] show "optional" labels instead of "required" --- docs/src/modules/components/InterfaceApiPage.js | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/modules/components/InterfaceApiPage.js b/docs/src/modules/components/InterfaceApiPage.js index e73471f71236..a2b02e6f8291 100644 --- a/docs/src/modules/components/InterfaceApiPage.js +++ b/docs/src/modules/components/InterfaceApiPage.js @@ -158,6 +158,7 @@ export default function ApiPage(props) { titleHash="properties" defaultLayout={defaultLayout} layoutStorageKey={layoutStorageKey.props} + showOptionalAbbr /> From bc681d5b3e1d1d3646fd656a447df2ec3f4db74d Mon Sep 17 00:00:00 2001 From: alexandre Date: Fri, 29 Mar 2024 10:33:15 +0100 Subject: [PATCH 8/8] remove md files --- .../x/api/data-grid/grid-actions-col-def.md | 71 --------- .../data-grid/grid-aggregation-function.md | 29 ---- docs/pages/x/api/data-grid/grid-api.md | 149 ------------------ .../pages/x/api/data-grid/grid-cell-params.md | 29 ---- docs/pages/x/api/data-grid/grid-col-def.md | 70 -------- .../api/data-grid/grid-csv-export-options.md | 35 ---- .../data-grid/grid-excel-export-options.md | 34 ---- .../api/data-grid/grid-export-state-params.md | 28 ---- .../pages/x/api/data-grid/grid-filter-item.md | 31 ---- .../x/api/data-grid/grid-filter-model.md | 32 ---- .../x/api/data-grid/grid-filter-operator.md | 35 ---- .../data-grid/grid-print-export-options.md | 37 ----- .../data-grid/grid-row-class-name-params.md | 33 ---- docs/pages/x/api/data-grid/grid-row-params.md | 30 ---- .../api/data-grid/grid-row-spacing-params.md | 32 ---- .../data-grid/grid-single-select-col-def.md | 73 --------- 16 files changed, 748 deletions(-) delete mode 100644 docs/pages/x/api/data-grid/grid-actions-col-def.md delete mode 100644 docs/pages/x/api/data-grid/grid-aggregation-function.md delete mode 100644 docs/pages/x/api/data-grid/grid-api.md delete mode 100644 docs/pages/x/api/data-grid/grid-cell-params.md delete mode 100644 docs/pages/x/api/data-grid/grid-col-def.md delete mode 100644 docs/pages/x/api/data-grid/grid-csv-export-options.md delete mode 100644 docs/pages/x/api/data-grid/grid-excel-export-options.md delete mode 100644 docs/pages/x/api/data-grid/grid-export-state-params.md delete mode 100644 docs/pages/x/api/data-grid/grid-filter-item.md delete mode 100644 docs/pages/x/api/data-grid/grid-filter-model.md delete mode 100644 docs/pages/x/api/data-grid/grid-filter-operator.md delete mode 100644 docs/pages/x/api/data-grid/grid-print-export-options.md delete mode 100644 docs/pages/x/api/data-grid/grid-row-class-name-params.md delete mode 100644 docs/pages/x/api/data-grid/grid-row-params.md delete mode 100644 docs/pages/x/api/data-grid/grid-row-spacing-params.md delete mode 100644 docs/pages/x/api/data-grid/grid-single-select-col-def.md diff --git a/docs/pages/x/api/data-grid/grid-actions-col-def.md b/docs/pages/x/api/data-grid/grid-actions-col-def.md deleted file mode 100644 index e1f9daf908f4..000000000000 --- a/docs/pages/x/api/data-grid/grid-actions-col-def.md +++ /dev/null @@ -1,71 +0,0 @@ -# GridActionsColDef Interface - -

    Column Definition interface used for columns with the `actions` type.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [Special column properties](/x/react-data-grid/column-definition/#special-properties) - -::: - -## Import - -```js -import { GridActionsColDef } from '@mui/x-data-grid-premium'; -// or -import { GridActionsColDef } from '@mui/x-data-grid-pro'; -// or -import { GridActionsColDef } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Default | Description | -| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| aggregable? [](/x/introduction/licensing/#premium-plan) | boolean | true | If `true`, the cells of the column can be aggregated based. | -| align? | GridAlignment | | Allows to align the column values in cells. | -| availableAggregationFunctions? [](/x/introduction/licensing/#premium-plan) | string[] | | Limit the aggregation function usable on this column.
    By default, the column will have all the aggregation functions that are compatible with its type. | -| cellClassName? | GridCellClassNamePropType<R, V> | | Class name that will be added in cells for that column. | -| colSpan? | number \| GridColSpanFn<R, V, F> | 1 | Number of columns a cell should span. | -| description? | string | | The description of the column rendered as tooltip if the column header name is not fully displayed. | -| disableColumnMenu? | boolean | false | If `true`, the column menu is disabled for this column. | -| disableExport? | boolean | false | If `true`, this column will not be included in exports. | -| disableReorder? | boolean | false | If `true`, this column cannot be reordered. | -| display? | 'text' \| 'flex' | | Display mode for the cell:
    - 'text': For text-based cells (default)
    - 'flex': For cells with HTMLElement children | -| editable? | boolean | false | If `true`, the cells of the column are editable. | -| field | string | | The column identifier. It's used to map with GridRowModel values. | -| filterable? | boolean | true | If `true`, the column is filterable. | -| filterOperators? | GridFilterOperator<R, V, F>[] | | Allows setting the filter operators for this column. | -| flex? | number | | If set, it indicates that a column has fluid width. Range [0, ∞). | -| getActions | (params: GridRowParams<R>) => React.ReactElement<GridActionsCellItemProps>[] | | Function that returns the actions to be shown. | -| getApplyQuickFilterFn? | GetApplyQuickFilterFn<R, V> | | The callback that generates a filtering function for a given quick filter value.
    This function can return `null` to skip filtering for this value and column. | -| getSortComparator? | (sortDirection: GridSortDirection) => GridComparatorFn<V> \| undefined | | Allows to use a different comparator function depending on the sort direction.
    Takes precedence over `sortComparator`. | -| groupable? | boolean | true | If `true`, the rows can be grouped based on this column values (pro-plan only).
    Only available in DataGridPremium. | -| groupingValueGetter? [](/x/introduction/licensing/#premium-plan) | GridGroupingValueGetter<R> | | Function that transforms a complex cell value into a key that be used for grouping the rows. | -| headerAlign? | GridAlignment | | Header cell element alignment. | -| headerClassName? | GridColumnHeaderClassNamePropType | | Class name that will be added in the column header cell. | -| headerName? | string | | The title of the column rendered in the column header cell. | -| hideable? | boolean | true | If `false`, removes the buttons for hiding this column. | -| hideSortIcons? | boolean | false | Toggle the visibility of the sort icons. | -| maxWidth? | number | Infinity | Sets the maximum width of a column. | -| minWidth? | number | 50 | Sets the minimum width of a column. | -| pastedValueParser? [](/x/introduction/licensing/#premium-plan) | GridPastedValueParser<R, V, F> | | Function that takes the clipboard-pasted value and converts it to a value used internally. | -| pinnable? | boolean | true | If `false`, the menu items for column pinning menu will not be rendered.
    Only available in DataGridPro. | -| preProcessEditCellProps? | (params: GridPreProcessEditCellProps) => GridEditCellProps \| Promise<GridEditCellProps> | | Callback fired when the edit props of the cell changes.
    It allows to process the props that saved into the state. | -| renderCell? | (params: GridRenderCellParams<R, V, F>) => React.ReactNode | | Allows to override the component rendered as cell for this column. | -| renderEditCell? | (params: GridRenderEditCellParams<R, V, F>) => React.ReactNode | | Allows to override the component rendered in edit cell mode for this column. | -| renderHeader? | (params: GridColumnHeaderParams<R, V, F>) => React.ReactNode | | Allows to render a component in the column header cell. | -| renderHeaderFilter? [](/x/introduction/licensing/#pro-plan) | (params: GridRenderHeaderFilterProps) => React.ReactNode | | Allows to render a component in the column header filter cell. | -| resizable? | boolean | true | If `true`, the column is resizable. | -| sortable? | boolean | true | If `true`, the column is sortable. | -| sortComparator? | GridComparatorFn<V> | | A comparator function used to sort rows. | -| sortingOrder? | GridSortDirection[] | | The order of the sorting sequence. | -| type | 'actions' | 'actions' | The type of the column. | -| valueFormatter? | GridValueFormatter<R, V, F> | | Function that allows to apply a formatter before rendering its value. | -| valueGetter? | GridValueGetter<R, V, F> | | Function that allows to get a specific data instead of field to render in the cell. | -| valueParser? | GridValueParser<R, V, F> | | Function that takes the user-entered value and converts it to a value used internally. | -| valueSetter? | GridValueSetter<R, V, F> | | Function that allows to customize how the entered value is stored in the row.
    It only works with cell/row editing. | -| width? | number | 100 | Set the width of the column. | diff --git a/docs/pages/x/api/data-grid/grid-aggregation-function.md b/docs/pages/x/api/data-grid/grid-aggregation-function.md deleted file mode 100644 index 6500040e6dda..000000000000 --- a/docs/pages/x/api/data-grid/grid-aggregation-function.md +++ /dev/null @@ -1,29 +0,0 @@ -# GridAggregationFunction Interface - -

    Grid aggregation function definition interface.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [Aggregation functions](/x/react-data-grid/aggregation/#aggregation-functions) - -::: - -## Import - -```js -import { GridAggregationFunction } from '@mui/x-data-grid-premium'; -``` - -## Properties - -| Name | Type | Default | Description | -| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| apply [](/x/introduction/licensing/#premium-plan) | (params: GridAggregationParams<V>) => AV \| null \| undefined | | Function that takes the current cell values and generates the aggregated value. | -| columnTypes? [](/x/introduction/licensing/#premium-plan) | string[] | | Column types supported by this aggregation function.
    If not defined, all types are supported (in most cases this property should be defined). | -| getCellValue? [](/x/introduction/licensing/#premium-plan) | (params: GridAggregationGetCellValueParams) => V | | Function that allows to transform the value of the cell passed to the aggregation function applier.
    Useful for aggregating data from multiple row fields. | -| hasCellUnit? [](/x/introduction/licensing/#premium-plan) | boolean | `true` | Indicates if the aggregated value have the same unit as the cells used to generate it.
    It can be used to apply a custom cell renderer only if the aggregated value has the same unit. | -| label? [](/x/introduction/licensing/#premium-plan) | string | `apiRef.current.getLocaleText('aggregationFunctionLabel{capitalize(name)})` | Label of the aggregation function.
    Will be used to add a label on the footer of the grouping column when this aggregation function is the only one being used. | -| valueFormatter? [](/x/introduction/licensing/#premium-plan) | (params: GridValueFormatterParams<AV>) => FAV | | Function that allows to apply a formatter to the aggregated value.
    If not defined, the grid will use the formatter of the column. | diff --git a/docs/pages/x/api/data-grid/grid-api.md b/docs/pages/x/api/data-grid/grid-api.md deleted file mode 100644 index cf6a2bdbf7de..000000000000 --- a/docs/pages/x/api/data-grid/grid-api.md +++ /dev/null @@ -1,149 +0,0 @@ -# GridApi Interface - -

    The full grid API.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [API object](/x/react-data-grid/api-object/) - -::: - -## Import - -```js -import { GridApi } from '@mui/x-data-grid-premium'; -// or -import { GridApi } from '@mui/x-data-grid-pro'; -// or -import { GridApi } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Description | -| :------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| addRowGroupingCriteria [](/x/introduction/licensing/#premium-plan) | (groupingCriteriaField: string, groupingIndex?: number) => void | Adds the field to the row grouping model. | -| applySorting | () => void | Applies the current sort model to the rows. | -| autosizeColumns | (options?: GridAutosizeOptions) => Promise<void> | Auto-size the columns of the grid based on the cells' content and the space available. | -| deleteFilterItem | (item: GridFilterItem) => void | Deletes a [GridFilterItem](/x/api/data-grid/grid-filter-item/). | -| exportDataAsCsv | (options?: GridCsvExportOptions) => void | Downloads and exports a CSV of the grid's data. | -| exportDataAsExcel [](/x/introduction/licensing/#premium-plan) | (options?: GridExcelExportOptions) => Promise<void> | Downloads and exports an Excel file of the grid's data. | -| exportDataAsPrint | (options?: GridPrintExportOptions) => void | Print the grid's data. | -| exportState | (params?: GridExportStateParams) => InitialState | Generates a serializable object containing the exportable parts of the DataGrid state.
    These values can then be passed to the `initialState` prop or injected using the `restoreState` method. | -| forceUpdate | () => void | Forces the grid to rerender. It's often used after a state update. | -| getAllColumns | () => GridStateColDef[] | Returns an array of [GridColDef](/x/api/data-grid/grid-col-def/) containing all the column definitions. | -| getAllGroupDetails | () => GridColumnGroupLookup | Returns the column group lookup. | -| getAllRowIds | () => GridRowId[] | Gets the list of row ids. | -| getCellElement | (id: GridRowId, field: string) => HTMLDivElement \| null | Gets the underlying DOM element for a cell at the given `id` and `field`. | -| getCellMode | (id: GridRowId, field: string) => GridCellMode | Gets the mode of a cell. | -| getCellParams | <R extends GridValidRowModel = any, V = unknown, F = V, N extends GridTreeNode = GridTreeNode>(id: GridRowId, field: string) => GridCellParams<R, V, F, N> | Gets the [GridCellParams](/x/api/data-grid/grid-cell-params/) object that is passed as argument in events. | -| getCellSelectionModel [](/x/introduction/licensing/#premium-plan) | () => GridCellSelectionModel | Returns an object containing the selection state of the cells.
    The keys of the object correpond to the row IDs.
    The value of each key is another object whose keys are the fields and values are the selection state. | -| getCellValue | <V extends any = any>(id: GridRowId, field: string) => V | Gets the value of a cell at the given `id` and `field`. | -| getColumn | (field: string) => GridStateColDef | Returns the [GridColDef](/x/api/data-grid/grid-col-def/) for the given `field`. | -| getColumnGroupPath | (field: string) => GridColumnGroup['groupId'][] | Returns the id of the groups leading to the requested column.
    The array is ordered by increasing depth (the last element is the direct parent of the column). | -| getColumnHeaderElement | (field: string) => HTMLDivElement \| null | Gets the underlying DOM element for the column header with the given `field`. | -| getColumnHeaderParams | (field: string) => GridColumnHeaderParams | Gets the GridColumnHeaderParams object that is passed as argument in events. | -| getColumnIndex | (field: string, useVisibleColumns?: boolean) => number | Returns the index position of a column. By default, only the visible columns are considered.
    Pass `false` to `useVisibleColumns` to consider all columns. | -| getColumnIndexRelativeToVisibleColumns | (field: string) => number | Gets the index of a column relative to the columns that are reachable by scroll. | -| getColumnPosition | (field: string) => number | Returns the left-position of a column relative to the inner border of the grid. | -| getDataAsCsv | (options?: GridCsvExportOptions) => string | Returns the grid data as a CSV string.
    This method is used internally by `exportDataAsCsv`. | -| getDataAsExcel [](/x/introduction/licensing/#premium-plan) | (options?: GridExcelExportOptions) => Promise<Excel.Workbook> \| null | Returns the grid data as an exceljs workbook.
    This method is used internally by `exportDataAsExcel`. | -| getExpandedDetailPanels [](/x/introduction/licensing/#pro-plan) | () => GridRowId[] | Returns the rows whose detail panel is open. | -| getLocaleText | <T extends GridTranslationKeys>(key: T) => GridLocaleText[T] | Returns the translation for the `key`. | -| getPinnedColumns [](/x/introduction/licensing/#pro-plan) | () => GridPinnedColumnFields | Returns which columns are pinned. | -| getRootDimensions | () => GridDimensions | Returns the dimensions of the grid | -| getRow | <R extends GridValidRowModel = any>(id: GridRowId) => R \| null | Gets the row data with a given id. | -| getRowElement | (id: GridRowId) => HTMLDivElement \| null | Gets the underlying DOM element for a row at the given `id`. | -| getRowGroupChildren [](/x/introduction/licensing/#pro-plan) | (params: GridRowGroupChildrenGetterParams) => GridRowId[] | Gets the rows of a grouping criteria.
    Only contains the rows provided to the grid, not the rows automatically generated by it. | -| getRowId | <R extends GridValidRowModel = any>(row: R) => GridRowId | Gets the ID of a row given its data. | -| getRowIdFromRowIndex | (index: number) => GridRowId | Gets the `GridRowId` of a row at a specific index.
    The index is based on the sorted but unfiltered row list. | -| getRowIndexRelativeToVisibleRows | (id: GridRowId) => number | Gets the index of a row relative to the rows that are reachable by scroll. | -| getRowMode | (id: GridRowId) => GridRowMode | Gets the mode of a row. | -| getRowModels | () => Map<GridRowId, GridRowModel> | Gets the full set of rows as Map<GridRowId, GridRowModel>. | -| getRowNode | <N extends GridTreeNode>(id: GridRowId) => N \| null | Gets the row node from the internal tree structure. | -| getRowParams | (id: GridRowId) => GridRowParams | Gets the [GridRowParams](/x/api/data-grid/grid-row-params/) object that is passed as argument in events. | -| getRowsCount | () => number | Gets the total number of rows in the grid. | -| getRowWithUpdatedValues | (id: GridRowId, field: string) => GridRowModel | Returns the row with the values that were set by editing the cells.
    In row editing, `field` is ignored and all fields are considered. | -| getScrollPosition | () => GridScrollParams | Returns the current scroll position. | -| getSelectedCellsAsArray [](/x/introduction/licensing/#premium-plan) | () => GridCellCoordinates[] | Returns an array containing only the selected cells.
    Each item is an object with the ID and field of the cell. | -| getSelectedRows | () => Map<GridRowId, GridRowModel> | Returns an array of the selected rows. | -| getSortedRowIds | () => GridRowId[] | Returns all row ids sorted according to the active sort model. | -| getSortedRows | () => GridRowModel[] | Returns all rows sorted according to the active sort model. | -| getSortModel | () => GridSortModel | Returns the sort model currently applied to the grid. | -| getVisibleColumns | () => GridStateColDef[] | Returns the currently visible columns. | -| hideColumnMenu | () => void | Hides the column menu that is open. | -| hideFilterPanel | () => void | Hides the filter panel. | -| hideHeaderFilterMenu | () => void | Hides the header filter menu. | -| hidePreferences | () => void | Hides the preferences panel. | -| ignoreDiacritics | DataGridProcessedProps['ignoreDiacritics'] | Returns the value of the `ignoreDiacritics` prop. | -| isCellEditable | (params: GridCellParams) => boolean | Controls if a cell is editable. | -| isCellSelected [](/x/introduction/licensing/#premium-plan) | (id: GridRowId, field: GridColDef['field']) => boolean | Determines if a cell is selected or not. | -| isColumnPinned [](/x/introduction/licensing/#pro-plan) | (field: string) => GridPinnedColumnPosition \| false | Returns which side a column is pinned to. | -| isRowSelectable | (id: GridRowId) => boolean | Determines if a row can be selected or not. | -| isRowSelected | (id: GridRowId) => boolean | Determines if a row is selected or not. | -| pinColumn [](/x/introduction/licensing/#pro-plan) | (field: string, side: GridPinnedColumnPosition) => void | Pins a column to the left or right side of the grid. | -| publishEvent | GridEventPublisher | Emits an event. | -| removeRowGroupingCriteria [](/x/introduction/licensing/#premium-plan) | (groupingCriteriaField: string) => void | Remove the field from the row grouping model. | -| resetRowHeights | () => void | Forces the recalculation of the heights of all rows. | -| resize | () => void | Triggers a resize of the component and recalculation of width and height. | -| restoreState | (stateToRestore: InitialState) => void | Inject the given values into the state of the DataGrid. | -| scroll | (params: Partial<GridScrollParams>) => void | Triggers the viewport to scroll to the given positions (in pixels). | -| scrollToIndexes | (params: Partial<GridCellIndexCoordinates>) => boolean | Triggers the viewport to scroll to the cell at indexes given by `params`.
    Returns `true` if the grid had to scroll to reach the target. | -| selectCellRange [](/x/introduction/licensing/#premium-plan) | (start: GridCellCoordinates, end: GridCellCoordinates, keepOtherSelected?: boolean) => void | Selects all cells that are inside the range given by `start` and `end` coordinates. | -| selectRow | (id: GridRowId, isSelected?: boolean, resetSelection?: boolean) => void | Change the selection state of a row. | -| selectRowRange [](/x/introduction/licensing/#pro-plan) | (range: { startId: GridRowId; endId: GridRowId }, isSelected?: boolean, resetSelection?: boolean) => void | Change the selection state of all the selectable rows in a range. | -| selectRows [](/x/introduction/licensing/#pro-plan) | (ids: GridRowId[], isSelected?: boolean, resetSelection?: boolean) => void | Change the selection state of multiple rows. | -| setAggregationModel [](/x/introduction/licensing/#premium-plan) | (model: GridAggregationModel) => void | Sets the aggregation model to the one given by `model`. | -| setCellFocus | (id: GridRowId, field: string) => void | Sets the focus to the cell at the given `id` and `field`. | -| setCellSelectionModel [](/x/introduction/licensing/#premium-plan) | (newModel: GridCellSelectionModel) => void | Updates the selected cells to be those passed to the `newModel` argument.
    Any cell already selected will be unselected. | -| setColumnHeaderFilterFocus | (field: string, event?: MuiBaseEvent) => void | Sets the focus to the column header filter at the given `field`. | -| setColumnHeaderFocus | (field: string, event?: MuiBaseEvent) => void | Sets the focus to the column header at the given `field`. | -| setColumnIndex [](/x/introduction/licensing/#pro-plan) | (field: string, targetIndexPosition: number) => void | Moves a column from its original position to the position given by `targetIndexPosition`. | -| setColumnVisibility | (field: string, isVisible: boolean) => void | Changes the visibility of the column referred by `field`. | -| setColumnVisibilityModel | (model: GridColumnVisibilityModel) => void | Sets the column visibility model to the one given by `model`. | -| setColumnWidth | (field: string, width: number) => void | Updates the width of a column. | -| setDensity | (density: GridDensity) => void | Sets the density of the grid. | -| setEditCellValue | (params: GridEditCellValueParams, event?: MuiBaseEvent) => Promise<boolean> \| void | Sets the value of the edit cell.
    Commonly used inside the edit cell component. | -| setExpandedDetailPanels [](/x/introduction/licensing/#pro-plan) | (ids: GridRowId[]) => void | Changes which rows to expand the detail panel. | -| setFilterLogicOperator | (operator: GridLogicOperator) => void | Changes the GridLogicOperator used to connect the filters. | -| setFilterModel | (model: GridFilterModel, reason?: GridControlledStateReasonLookup['filter']) => void | Sets the filter model to the one given by `model`. | -| setPage | (page: number) => void | Sets the displayed page to the value given by `page`. | -| setPageSize | (pageSize: number) => void | Sets the number of displayed rows to the value given by `pageSize`. | -| setPaginationModel | (model: GridPaginationModel) => void | Sets the `paginationModel` to a new value. | -| setPinnedColumns [](/x/introduction/licensing/#pro-plan) | (pinnedColumns: GridPinnedColumnFields) => void | Changes the pinned columns. | -| setQuickFilterValues | (values: any[]) => void | Set the quick filter values to the one given by `values` | -| setRowChildrenExpansion [](/x/introduction/licensing/#pro-plan) | (id: GridRowId, isExpanded: boolean) => void | Expand or collapse a row children. | -| setRowCount | (rowCount: number) => void | Sets the `rowCount` to a new value. | -| setRowGroupingCriteriaIndex [](/x/introduction/licensing/#premium-plan) | (groupingCriteriaField: string, groupingIndex: number) => void | Sets the grouping index of a grouping criteria. | -| setRowGroupingModel [](/x/introduction/licensing/#premium-plan) | (model: GridRowGroupingModel) => void | Sets the columns to use as grouping criteria. | -| setRowIndex [](/x/introduction/licensing/#pro-plan) | (rowId: GridRowId, targetIndex: number) => void | Moves a row from its original position to the position given by `targetIndex`. | -| setRows | (rows: GridRowModel[]) => void | Sets a new set of rows. | -| setRowSelectionModel | (rowIds: GridRowId[]) => void | Updates the selected rows to be those passed to the `rowIds` argument.
    Any row already selected will be unselected. | -| setSortModel | (model: GridSortModel) => void | Updates the sort model and triggers the sorting of rows. | -| showColumnMenu | (field: string) => void | Display the column menu under the `field` column. | -| showFilterPanel | (targetColumnField?: string, panelId?: string, labelId?: string) => void | Shows the filter panel. If `targetColumnField` is given, a filter for this field is also added. | -| showHeaderFilterMenu | (field: GridColDef['field']) => void | Opens the header filter menu for the given field. | -| showPreferences | (newValue: GridPreferencePanelsValue, panelId?: string, labelId?: string) => void | Displays the preferences panel. The `newValue` argument controls the content of the panel. | -| sortColumn | (field: GridColDef['field'], direction?: GridSortDirection, allowMultipleSorting?: boolean) => void | Sorts a column. | -| startCellEditMode | (params: GridStartCellEditModeParams) => void | Puts the cell corresponding to the given row id and field into edit mode. | -| startHeaderFilterEditMode | (field: GridColDef['field']) => void | Puts the cell corresponding to the given row id and field into edit mode. | -| startRowEditMode | (params: GridStartRowEditModeParams) => void | Puts the row corresponding to the given id into edit mode. | -| state | State | Property that contains the whole state of the grid. | -| stopCellEditMode | (params: GridStopCellEditModeParams) => void | Puts the cell corresponding to the given row id and field into view mode and updates the original row with the new value stored.
    If `params.ignoreModifications` is `true` it will discard the modifications made. | -| stopHeaderFilterEditMode | () => void | Stops the edit mode for the current field. | -| stopRowEditMode | (params: GridStopRowEditModeParams) => void | Puts the row corresponding to the given id and into view mode and updates the original row with the new values stored.
    If `params.ignoreModifications` is `true` it will discard the modifications made. | -| subscribeEvent | <E extends GridEvents>(event: E, handler: GridEventListener<E>, options?: EventListenerOptions) => () => void | Registers a handler for an event. | -| toggleColumnMenu | (field: string) => void | Toggles the column menu under the `field` column. | -| toggleDetailPanel [](/x/introduction/licensing/#pro-plan) | (id: GridRowId) => void | Expands or collapses the detail panel of a row. | -| unpinColumn [](/x/introduction/licensing/#pro-plan) | (field: string) => void | Unpins a column. | -| unstable_replaceRows | (firstRowToReplace: number, newRows: GridRowModel[]) => void | Replace a set of rows with new rows. | -| unstable_setColumnVirtualization | (enabled: boolean) => void | Enable/disable column virtualization. | -| unstable_setPinnedRows [](/x/introduction/licensing/#pro-plan) | (pinnedRows?: GridPinnedRowsProp) => void | Changes the pinned rows. | -| unstable_setVirtualization | (enabled: boolean) => void | Enable/disable virtualization. | -| updateColumns | (cols: GridColDef[]) => void | Updates the definition of multiple columns at the same time. | -| updateRows | (updates: GridRowModelUpdate[]) => void | Allows to update, insert and delete rows. | -| upsertFilterItem | (item: GridFilterItem) => void | Updates or inserts a [GridFilterItem](/x/api/data-grid/grid-filter-item/). | -| upsertFilterItems | (items: GridFilterItem[]) => void | Updates or inserts many [GridFilterItem](/x/api/data-grid/grid-filter-item/). | diff --git a/docs/pages/x/api/data-grid/grid-cell-params.md b/docs/pages/x/api/data-grid/grid-cell-params.md deleted file mode 100644 index abafc29de75f..000000000000 --- a/docs/pages/x/api/data-grid/grid-cell-params.md +++ /dev/null @@ -1,29 +0,0 @@ -# GridCellParams Interface - -

    Object passed as parameter in the column GridColDef cell renderer.

    - -## Import - -```js -import { GridCellParams } from '@mui/x-data-grid-premium'; -// or -import { GridCellParams } from '@mui/x-data-grid-pro'; -// or -import { GridCellParams } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Description | -| :----------------------------------------------------------------------------------------------- | :--------------------------------------------------- | :---------------------------------------------------------------------------------------------------- | -| cellMode | GridCellMode | The mode of the cell. | -| colDef | GridStateColDef | The column of the row that the current cell belongs to. | -| field | string | The column field of the cell that triggered the event. | -| formattedValue? | F \| undefined | The cell value formatted with the column valueFormatter. | -| hasFocus | boolean | If true, the cell is the active element. | -| id | GridRowId | The grid row id. | -| isEditable? | boolean | If true, the cell is editable. | -| row | GridRowModel<R> | The row model of the row that the current cell belongs to. | -| rowNode | N | The node of the row that the current cell belongs to. | -| tabIndex | 0 \| -1 | the tabIndex value. | -| value? | V \| undefined | The cell value.
    If the column has `valueGetter`, use `params.row` to directly access the fields. | diff --git a/docs/pages/x/api/data-grid/grid-col-def.md b/docs/pages/x/api/data-grid/grid-col-def.md deleted file mode 100644 index b8927910ff2e..000000000000 --- a/docs/pages/x/api/data-grid/grid-col-def.md +++ /dev/null @@ -1,70 +0,0 @@ -# GridColDef Interface - -

    Column Definition interface.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [Column definition](/x/react-data-grid/column-definition/) - -::: - -## Import - -```js -import { GridColDef } from '@mui/x-data-grid-premium'; -// or -import { GridColDef } from '@mui/x-data-grid-pro'; -// or -import { GridColDef } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Default | Description | -| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| aggregable? [](/x/introduction/licensing/#premium-plan) | boolean | true | If `true`, the cells of the column can be aggregated based. | -| align? | GridAlignment | | Allows to align the column values in cells. | -| availableAggregationFunctions? [](/x/introduction/licensing/#premium-plan) | string[] | | Limit the aggregation function usable on this column.
    By default, the column will have all the aggregation functions that are compatible with its type. | -| cellClassName? | GridCellClassNamePropType<R, V> | | Class name that will be added in cells for that column. | -| colSpan? | number \| GridColSpanFn<R, V, F> | 1 | Number of columns a cell should span. | -| description? | string | | The description of the column rendered as tooltip if the column header name is not fully displayed. | -| disableColumnMenu? | boolean | false | If `true`, the column menu is disabled for this column. | -| disableExport? | boolean | false | If `true`, this column will not be included in exports. | -| disableReorder? | boolean | false | If `true`, this column cannot be reordered. | -| display? | 'text' \| 'flex' | | Display mode for the cell:
    - 'text': For text-based cells (default)
    - 'flex': For cells with HTMLElement children | -| editable? | boolean | false | If `true`, the cells of the column are editable. | -| field | string | | The column identifier. It's used to map with GridRowModel values. | -| filterable? | boolean | true | If `true`, the column is filterable. | -| filterOperators? | GridFilterOperator<R, V, F>[] | | Allows setting the filter operators for this column. | -| flex? | number | | If set, it indicates that a column has fluid width. Range [0, ∞). | -| getApplyQuickFilterFn? | GetApplyQuickFilterFn<R, V> | | The callback that generates a filtering function for a given quick filter value.
    This function can return `null` to skip filtering for this value and column. | -| getSortComparator? | (sortDirection: GridSortDirection) => GridComparatorFn<V> \| undefined | | Allows to use a different comparator function depending on the sort direction.
    Takes precedence over `sortComparator`. | -| groupable? | boolean | true | If `true`, the rows can be grouped based on this column values (pro-plan only).
    Only available in DataGridPremium. | -| groupingValueGetter? [](/x/introduction/licensing/#premium-plan) | GridGroupingValueGetter<R> | | Function that transforms a complex cell value into a key that be used for grouping the rows. | -| headerAlign? | GridAlignment | | Header cell element alignment. | -| headerClassName? | GridColumnHeaderClassNamePropType | | Class name that will be added in the column header cell. | -| headerName? | string | | The title of the column rendered in the column header cell. | -| hideable? | boolean | true | If `false`, removes the buttons for hiding this column. | -| hideSortIcons? | boolean | false | Toggle the visibility of the sort icons. | -| maxWidth? | number | Infinity | Sets the maximum width of a column. | -| minWidth? | number | 50 | Sets the minimum width of a column. | -| pastedValueParser? [](/x/introduction/licensing/#premium-plan) | GridPastedValueParser<R, V, F> | | Function that takes the clipboard-pasted value and converts it to a value used internally. | -| pinnable? | boolean | true | If `false`, the menu items for column pinning menu will not be rendered.
    Only available in DataGridPro. | -| preProcessEditCellProps? | (params: GridPreProcessEditCellProps) => GridEditCellProps \| Promise<GridEditCellProps> | | Callback fired when the edit props of the cell changes.
    It allows to process the props that saved into the state. | -| renderCell? | (params: GridRenderCellParams<R, V, F>) => React.ReactNode | | Allows to override the component rendered as cell for this column. | -| renderEditCell? | (params: GridRenderEditCellParams<R, V, F>) => React.ReactNode | | Allows to override the component rendered in edit cell mode for this column. | -| renderHeader? | (params: GridColumnHeaderParams<R, V, F>) => React.ReactNode | | Allows to render a component in the column header cell. | -| renderHeaderFilter? [](/x/introduction/licensing/#pro-plan) | (params: GridRenderHeaderFilterProps) => React.ReactNode | | Allows to render a component in the column header filter cell. | -| resizable? | boolean | true | If `true`, the column is resizable. | -| sortable? | boolean | true | If `true`, the column is sortable. | -| sortComparator? | GridComparatorFn<V> | | A comparator function used to sort rows. | -| sortingOrder? | GridSortDirection[] | | The order of the sorting sequence. | -| type? | GridColType | 'singleSelect' | The type of the column. | -| valueFormatter? | GridValueFormatter<R, V, F> | | Function that allows to apply a formatter before rendering its value. | -| valueGetter? | GridValueGetter<R, V, F> | | Function that allows to get a specific data instead of field to render in the cell. | -| valueParser? | GridValueParser<R, V, F> | | Function that takes the user-entered value and converts it to a value used internally. | -| valueSetter? | GridValueSetter<R, V, F> | | Function that allows to customize how the entered value is stored in the row.
    It only works with cell/row editing. | -| width? | number | 100 | Set the width of the column. | diff --git a/docs/pages/x/api/data-grid/grid-csv-export-options.md b/docs/pages/x/api/data-grid/grid-csv-export-options.md deleted file mode 100644 index e862ab57a9b3..000000000000 --- a/docs/pages/x/api/data-grid/grid-csv-export-options.md +++ /dev/null @@ -1,35 +0,0 @@ -# GridCsvExportOptions Interface - -

    The options to apply on the CSV export.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [CSV export](/x/react-data-grid/export/#csv-export) - -::: - -## Import - -```js -import { GridCsvExportOptions } from '@mui/x-data-grid-premium'; -// or -import { GridCsvExportOptions } from '@mui/x-data-grid-pro'; -// or -import { GridCsvExportOptions } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Default | Description | -| :----------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| allColumns? | boolean | false | If `true`, the hidden columns will also be exported. | -| delimiter? | string | ',' | The character used to separate fields. | -| fields? | string[] | | The columns exported.
    This should only be used if you want to restrict the columns exports. | -| fileName? | string | `document.title` | The string used as the file name. | -| getRowsToExport? | (params: GridCsvGetRowsToExportParams) => GridRowId[] | | Function that returns the list of row ids to export on the order they should be exported. | -| includeColumnGroupsHeaders? | boolean | true | If `true`, the CSV will include the column groups. | -| includeHeaders? | boolean | true | If `true`, the CSV will include the column headers and column groups.
    Use `includeColumnGroupsHeaders` to control whether the column groups are included. | -| utf8WithBom? | boolean | false | If `true`, the UTF-8 Byte Order Mark (BOM) prefixes the exported file.
    This can allow Excel to automatically detect file encoding as UTF-8. | diff --git a/docs/pages/x/api/data-grid/grid-excel-export-options.md b/docs/pages/x/api/data-grid/grid-excel-export-options.md deleted file mode 100644 index ee4f465bcffa..000000000000 --- a/docs/pages/x/api/data-grid/grid-excel-export-options.md +++ /dev/null @@ -1,34 +0,0 @@ -# GridExcelExportOptions Interface - -

    The options to apply on the Excel export.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [Excel export](/x/react-data-grid/export/#excel-export) - -::: - -## Import - -```js -import { GridExcelExportOptions } from '@mui/x-data-grid-premium'; -``` - -## Properties - -| Name | Type | Default | Description | -| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------- | :------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| allColumns? [](/x/introduction/licensing/#premium-plan) | boolean | false | If `true`, the hidden columns will also be exported. | -| columnsStyles? [](/x/introduction/licensing/#premium-plan) | ColumnsStylesInterface | | Object mapping column field to Exceljs style | -| exceljsPostProcess? [](/x/introduction/licensing/#premium-plan) | (processInput: GridExceljsProcessInput) => Promise<void> | | Method called after adding the rows to the workbook.
    Not supported when `worker` is set.
    To use with web workers, use the option in `setupExcelExportWebWorker`. | -| exceljsPreProcess? [](/x/introduction/licensing/#premium-plan) | (processInput: GridExceljsProcessInput) => Promise<void> | | Method called before adding the rows to the workbook.
    Not supported when `worker` is set.
    To use with web workers, use the option in `setupExcelExportWebWorker`. | -| fields? [](/x/introduction/licensing/#premium-plan) | string[] | | The columns exported.
    This should only be used if you want to restrict the columns exports. | -| fileName? [](/x/introduction/licensing/#premium-plan) | string | `document.title` | The string used as the file name. | -| getRowsToExport? [](/x/introduction/licensing/#premium-plan) | (params: GridGetRowsToExportParams<Api>) => GridRowId[] | | Function that returns the list of row ids to export on the order they should be exported. | -| includeColumnGroupsHeaders? [](/x/introduction/licensing/#premium-plan) | boolean | true | If `true`, the headers of the column groups will be added into the file. | -| includeHeaders? [](/x/introduction/licensing/#premium-plan) | boolean | true | If `true`, the first row of the file will include the headers of the grid. | -| valueOptionsSheetName? [](/x/introduction/licensing/#premium-plan) | string | | Name given to the worksheet containing the columns valueOptions.
    valueOptions are added to this worksheet if they are provided as an array. | -| worker? [](/x/introduction/licensing/#premium-plan) | () => Worker | | Function to return the Worker instance to be called. | diff --git a/docs/pages/x/api/data-grid/grid-export-state-params.md b/docs/pages/x/api/data-grid/grid-export-state-params.md deleted file mode 100644 index 7ac92feb158d..000000000000 --- a/docs/pages/x/api/data-grid/grid-export-state-params.md +++ /dev/null @@ -1,28 +0,0 @@ -# GridExportStateParams Interface - -

    Object passed as parameter in the `exportState()` grid API method.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [Restore state with `apiRef`](/x/react-data-grid/state/#restore-the-state-with-apiref) - -::: - -## Import - -```js -import { GridExportStateParams } from '@mui/x-data-grid-premium'; -// or -import { GridExportStateParams } from '@mui/x-data-grid-pro'; -// or -import { GridExportStateParams } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Default | Description | -| :------------------------------------------------------------------------------------------------------ | :------------------------------------- | :-------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| exportOnlyDirtyModels? | boolean | false | By default, the grid exports all the models.
    You can switch this property to `true` to only exports models that are either controlled, initialized or modified.
    For instance, with this property, if you don't control or initialize the `filterModel` and you did not apply any filter, the model won't be exported.
    Note that the column dimensions are not a model. The grid only exports the dimensions of the modified columns even when `exportOnlyDirtyModels` is false. | diff --git a/docs/pages/x/api/data-grid/grid-filter-item.md b/docs/pages/x/api/data-grid/grid-filter-item.md deleted file mode 100644 index 0f9ccd97bfd7..000000000000 --- a/docs/pages/x/api/data-grid/grid-filter-item.md +++ /dev/null @@ -1,31 +0,0 @@ -# GridFilterItem Interface - -

    Filter item definition interface.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [Custom filter operator](/x/react-data-grid/filtering/customization/#create-a-custom-operator) - -::: - -## Import - -```js -import { GridFilterItem } from '@mui/x-data-grid-premium'; -// or -import { GridFilterItem } from '@mui/x-data-grid-pro'; -// or -import { GridFilterItem } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Description | -| :-------------------------------------------------------------------------------------- | :---------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | -| field | string | The column from which we want to filter the rows. | -| id? | number \| string | Must be unique.
    Only useful when the model contains several items. | -| operator | string | The name of the operator we want to apply. | -| value? | any | The filtering value.
    The operator filtering function will decide for each row if the row values is correct compared to this value. | diff --git a/docs/pages/x/api/data-grid/grid-filter-model.md b/docs/pages/x/api/data-grid/grid-filter-model.md deleted file mode 100644 index 621d3039abc6..000000000000 --- a/docs/pages/x/api/data-grid/grid-filter-model.md +++ /dev/null @@ -1,32 +0,0 @@ -# GridFilterModel Interface - -

    Model describing the filters to apply to the grid.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [Pass filters to the grid](/x/react-data-grid/filtering/#pass-filters-to-the-data-grid) - -::: - -## Import - -```js -import { GridFilterModel } from '@mui/x-data-grid-premium'; -// or -import { GridFilterModel } from '@mui/x-data-grid-pro'; -// or -import { GridFilterModel } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Default | Description | -| :---------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- | :-------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------- | -| items | GridFilterItem[] | [] | | -| logicOperator? | GridLogicOperator | `GridLogicOperator.And` | - `GridLogicOperator.And`: the row must pass all the filter items.
    - `GridLogicOperator.Or`: the row must pass at least on filter item. | -| quickFilterExcludeHiddenColumns? | boolean | true | If `false`, the quick filter will also consider cell values from hidden columns. | -| quickFilterLogicOperator? | GridLogicOperator | `GridLogicOperator.And` | - `GridLogicOperator.And`: the row must pass all the values.
    - `GridLogicOperator.Or`: the row must pass at least one value. | -| quickFilterValues? | any[] | `[]` | values used to quick filter rows | diff --git a/docs/pages/x/api/data-grid/grid-filter-operator.md b/docs/pages/x/api/data-grid/grid-filter-operator.md deleted file mode 100644 index 9cdcdb86d29c..000000000000 --- a/docs/pages/x/api/data-grid/grid-filter-operator.md +++ /dev/null @@ -1,35 +0,0 @@ -# GridFilterOperator Interface - -

    Filter operator definition interface.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [Custom filter operator](/x/react-data-grid/filtering/customization/#create-a-custom-operator) - -::: - -## Import - -```js -import { GridFilterOperator } from '@mui/x-data-grid-premium'; -// or -import { GridFilterOperator } from '@mui/x-data-grid-pro'; -// or -import { GridFilterOperator } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Default | Description | -| :---------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------- | :------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| getApplyFilterFn | GetApplyFilterFn<R, V, F> | | The callback that generates a filtering function for a given filter item and column.
    This function can return `null` to skip filtering for this item and column. | -| getValueAsString? | (value: GridFilterItem['value']) => string | | Converts the value of a filter item to a human-readable form. | -| headerLabel? | string | | The label of the filter shown in header filter row. | -| InputComponent? | React.JSXElementConstructor<any> | | The input component to render in the filter panel for this filter operator. | -| InputComponentProps? | Record<string, any> | | The props to pass to the input component in the filter panel for this filter operator. | -| label? | string | | The label of the filter operator. | -| requiresFilterValue? | boolean | true | If `false`, filter operator doesn't require user-entered value to work.
    Usually should be set to `false` for filter operators that don't have `InputComponent` (for example `isEmpty`) | -| value | string | | The name of the filter operator.
    It will be matched with the `operator` property of the filter items. | diff --git a/docs/pages/x/api/data-grid/grid-print-export-options.md b/docs/pages/x/api/data-grid/grid-print-export-options.md deleted file mode 100644 index 2106c9ec94a1..000000000000 --- a/docs/pages/x/api/data-grid/grid-print-export-options.md +++ /dev/null @@ -1,37 +0,0 @@ -# GridPrintExportOptions Interface - -

    The options to apply on the Print export.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [Print export](/x/react-data-grid/export/#print-export) - -::: - -## Import - -```js -import { GridPrintExportOptions } from '@mui/x-data-grid-premium'; -// or -import { GridPrintExportOptions } from '@mui/x-data-grid-pro'; -// or -import { GridPrintExportOptions } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Default | Description | -| :-------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------- | :------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------- | -| allColumns? | boolean | false | If `true`, the hidden columns will also be exported. | -| bodyClassName? | string | | One or more classes passed to the print window. | -| copyStyles? | boolean | true | If `false`, all <style> and <link type="stylesheet" /> tags from the <head> will not be copied
    to the print window. | -| fields? | string[] | | The columns exported.
    This should only be used if you want to restrict the columns exports. | -| fileName? | string | The title of the page. | The value to be used as the print window title. | -| getRowsToExport? | (params: GridPrintGetRowsToExportParams) => GridRowId[] | | Function that returns the list of row ids to export in the order they should be exported. | -| hideFooter? | boolean | false | If `true`, the footer is removed for when printing. | -| hideToolbar? | boolean | false | If `true`, the toolbar is removed for when printing. | -| includeCheckboxes? | boolean | false | If `true`, the selection checkboxes will be included when printing. | -| pageStyle? | string \| Function | | Provide Print specific styles to the print window. | diff --git a/docs/pages/x/api/data-grid/grid-row-class-name-params.md b/docs/pages/x/api/data-grid/grid-row-class-name-params.md deleted file mode 100644 index 9016971bce36..000000000000 --- a/docs/pages/x/api/data-grid/grid-row-class-name-params.md +++ /dev/null @@ -1,33 +0,0 @@ -# GridRowClassNameParams Interface - -

    Object passed as parameter in the row `getRowClassName` callback prop.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [Styling rows](/x/react-data-grid/style/#styling-rows) - -::: - -## Import - -```js -import { GridRowClassNameParams } from '@mui/x-data-grid-premium'; -// or -import { GridRowClassNameParams } from '@mui/x-data-grid-pro'; -// or -import { GridRowClassNameParams } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Description | -| :-------------------------------------------------------- | :------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------- | -| columns | GridColDef[] | All grid columns. | -| id | GridRowId | The grid row id. | -| indexRelativeToCurrentPage | number | Index of the row in the current page.
    If the pagination is disabled, it will be the index relative to all filtered rows. | -| isFirstVisible | boolean | Whether this row is the first visible or not. | -| isLastVisible | boolean | Whether this row is the last visible or not. | -| row | R | The row model of the row that the current cell belongs to. | diff --git a/docs/pages/x/api/data-grid/grid-row-params.md b/docs/pages/x/api/data-grid/grid-row-params.md deleted file mode 100644 index f6ed198f4ae2..000000000000 --- a/docs/pages/x/api/data-grid/grid-row-params.md +++ /dev/null @@ -1,30 +0,0 @@ -# GridRowParams Interface - -

    Object passed as parameter in the row callbacks.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [Master detail](/x/react-data-grid/master-detail/) - -::: - -## Import - -```js -import { GridRowParams } from '@mui/x-data-grid-premium'; -// or -import { GridRowParams } from '@mui/x-data-grid-pro'; -// or -import { GridRowParams } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Description | -| :------------------------------------- | :------------------------------------------ | :--------------------------------------------------------- | -| columns | GridColDef[] | All grid columns. | -| id | GridRowId | The grid row id. | -| row | R | The row model of the row that the current cell belongs to. | diff --git a/docs/pages/x/api/data-grid/grid-row-spacing-params.md b/docs/pages/x/api/data-grid/grid-row-spacing-params.md deleted file mode 100644 index e62d1975949a..000000000000 --- a/docs/pages/x/api/data-grid/grid-row-spacing-params.md +++ /dev/null @@ -1,32 +0,0 @@ -# GridRowSpacingParams Interface - -

    Object passed as parameter in the row `getRowSpacing` callback prop.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [Row spacing](/x/react-data-grid/row-height/#row-spacing) - -::: - -## Import - -```js -import { GridRowSpacingParams } from '@mui/x-data-grid-premium'; -// or -import { GridRowSpacingParams } from '@mui/x-data-grid-pro'; -// or -import { GridRowSpacingParams } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Description | -| :-------------------------------------------------------- | :--------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------- | -| id | GridRowId | The row id. | -| indexRelativeToCurrentPage | number | Index of the row in the current page.
    If the pagination is disabled, it will be the index relative to all filtered rows. | -| isFirstVisible | boolean | Whether this row is the first visible or not. | -| isLastVisible | boolean | Whether this row is the last visible or not. | -| model | R | The row model. | diff --git a/docs/pages/x/api/data-grid/grid-single-select-col-def.md b/docs/pages/x/api/data-grid/grid-single-select-col-def.md deleted file mode 100644 index b42076119a95..000000000000 --- a/docs/pages/x/api/data-grid/grid-single-select-col-def.md +++ /dev/null @@ -1,73 +0,0 @@ -# GridSingleSelectColDef Interface - -

    Column Definition interface used for columns with the `singleSelect` type.

    - -## Demos - -:::info -For examples and details on the usage, check the following pages: - -- [Special column properties](/x/react-data-grid/column-definition/#special-properties) - -::: - -## Import - -```js -import { GridSingleSelectColDef } from '@mui/x-data-grid-premium'; -// or -import { GridSingleSelectColDef } from '@mui/x-data-grid-pro'; -// or -import { GridSingleSelectColDef } from '@mui/x-data-grid'; -``` - -## Properties - -| Name | Type | Default | Description | -| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| aggregable? [](/x/introduction/licensing/#premium-plan) | boolean | true | If `true`, the cells of the column can be aggregated based. | -| align? | GridAlignment | | Allows to align the column values in cells. | -| availableAggregationFunctions? [](/x/introduction/licensing/#premium-plan) | string[] | | Limit the aggregation function usable on this column.
    By default, the column will have all the aggregation functions that are compatible with its type. | -| cellClassName? | GridCellClassNamePropType<R, V> | | Class name that will be added in cells for that column. | -| colSpan? | number \| GridColSpanFn<R, V, F> | 1 | Number of columns a cell should span. | -| description? | string | | The description of the column rendered as tooltip if the column header name is not fully displayed. | -| disableColumnMenu? | boolean | false | If `true`, the column menu is disabled for this column. | -| disableExport? | boolean | false | If `true`, this column will not be included in exports. | -| disableReorder? | boolean | false | If `true`, this column cannot be reordered. | -| display? | 'text' \| 'flex' | | Display mode for the cell:
    - 'text': For text-based cells (default)
    - 'flex': For cells with HTMLElement children | -| editable? | boolean | false | If `true`, the cells of the column are editable. | -| field | string | | The column identifier. It's used to map with GridRowModel values. | -| filterable? | boolean | true | If `true`, the column is filterable. | -| filterOperators? | GridFilterOperator<R, V, F>[] | | Allows setting the filter operators for this column. | -| flex? | number | | If set, it indicates that a column has fluid width. Range [0, ∞). | -| getApplyQuickFilterFn? | GetApplyQuickFilterFn<R, V> | | The callback that generates a filtering function for a given quick filter value.
    This function can return `null` to skip filtering for this value and column. | -| getOptionLabel? | (value: ValueOptions) => string | | Used to determine the label displayed for a given value option. | -| getOptionValue? | (value: ValueOptions) => any | | Used to determine the value used for a value option. | -| getSortComparator? | (sortDirection: GridSortDirection) => GridComparatorFn<V> \| undefined | | Allows to use a different comparator function depending on the sort direction.
    Takes precedence over `sortComparator`. | -| groupable? | boolean | true | If `true`, the rows can be grouped based on this column values (pro-plan only).
    Only available in DataGridPremium. | -| groupingValueGetter? [](/x/introduction/licensing/#premium-plan) | GridGroupingValueGetter<R> | | Function that transforms a complex cell value into a key that be used for grouping the rows. | -| headerAlign? | GridAlignment | | Header cell element alignment. | -| headerClassName? | GridColumnHeaderClassNamePropType | | Class name that will be added in the column header cell. | -| headerName? | string | | The title of the column rendered in the column header cell. | -| hideable? | boolean | true | If `false`, removes the buttons for hiding this column. | -| hideSortIcons? | boolean | false | Toggle the visibility of the sort icons. | -| maxWidth? | number | Infinity | Sets the maximum width of a column. | -| minWidth? | number | 50 | Sets the minimum width of a column. | -| pastedValueParser? [](/x/introduction/licensing/#premium-plan) | GridPastedValueParser<R, V, F> | | Function that takes the clipboard-pasted value and converts it to a value used internally. | -| pinnable? | boolean | true | If `false`, the menu items for column pinning menu will not be rendered.
    Only available in DataGridPro. | -| preProcessEditCellProps? | (params: GridPreProcessEditCellProps) => GridEditCellProps \| Promise<GridEditCellProps> | | Callback fired when the edit props of the cell changes.
    It allows to process the props that saved into the state. | -| renderCell? | (params: GridRenderCellParams<R, V, F>) => React.ReactNode | | Allows to override the component rendered as cell for this column. | -| renderEditCell? | (params: GridRenderEditCellParams<R, V, F>) => React.ReactNode | | Allows to override the component rendered in edit cell mode for this column. | -| renderHeader? | (params: GridColumnHeaderParams<R, V, F>) => React.ReactNode | | Allows to render a component in the column header cell. | -| renderHeaderFilter? [](/x/introduction/licensing/#pro-plan) | (params: GridRenderHeaderFilterProps) => React.ReactNode | | Allows to render a component in the column header filter cell. | -| resizable? | boolean | true | If `true`, the column is resizable. | -| sortable? | boolean | true | If `true`, the column is sortable. | -| sortComparator? | GridComparatorFn<V> | | A comparator function used to sort rows. | -| sortingOrder? | GridSortDirection[] | | The order of the sorting sequence. | -| type | 'singleSelect' | 'singleSelect' | The type of the column. | -| valueFormatter? | GridValueFormatter<R, V, F> | | Function that allows to apply a formatter before rendering its value. | -| valueGetter? | GridValueGetter<R, V, F> | | Function that allows to get a specific data instead of field to render in the cell. | -| valueOptions? | Array<ValueOptions> \| ((params: GridValueOptionsParams<R>) => Array<ValueOptions>) | | To be used in combination with `type: 'singleSelect'`. This is an array (or a function returning an array) of the possible cell values and labels. | -| valueParser? | GridValueParser<R, V, F> | | Function that takes the user-entered value and converts it to a value used internally. | -| valueSetter? | GridValueSetter<R, V, F> | | Function that allows to customize how the entered value is stored in the row.
    It only works with cell/row editing. | -| width? | number | 100 | Set the width of the column. |