diff --git a/docs/data/data-grid/localization/data.json b/docs/data/data-grid/localization/data.json index 15945bbcef96..40b3eef90a27 100644 --- a/docs/data/data-grid/localization/data.json +++ b/docs/data/data-grid/localization/data.json @@ -67,7 +67,7 @@ "languageTag": "da-DK", "importName": "daDK", "localeName": "Danish", - "missingKeysCount": 5, + "missingKeysCount": 0, "totalKeysCount": 122, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/daDK.ts" }, @@ -139,7 +139,7 @@ "languageTag": "it-IT", "importName": "itIT", "localeName": "Italian", - "missingKeysCount": 8, + "missingKeysCount": 0, "totalKeysCount": 122, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/itIT.ts" }, @@ -203,7 +203,7 @@ "languageTag": "pt-BR", "importName": "ptBR", "localeName": "Portuguese (Brazil)", - "missingKeysCount": 4, + "missingKeysCount": 0, "totalKeysCount": 122, "githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/ptBR.ts" }, diff --git a/docs/data/data-grid/pagination/PageSizeCustomOptions.js b/docs/data/data-grid/pagination/PageSizeCustomOptions.js index 667abfb9a412..2cdb2ddfa58b 100644 --- a/docs/data/data-grid/pagination/PageSizeCustomOptions.js +++ b/docs/data/data-grid/pagination/PageSizeCustomOptions.js @@ -17,7 +17,7 @@ export default function PageSizeCustomOptions() { ...data.initialState, pagination: { paginationModel: { pageSize: 5 } }, }} - pageSizeOptions={[5, 10, 25]} + pageSizeOptions={[5, 10, 25, { value: -1, label: 'All' }]} /> ); diff --git a/docs/data/data-grid/pagination/PageSizeCustomOptions.tsx b/docs/data/data-grid/pagination/PageSizeCustomOptions.tsx index 667abfb9a412..2cdb2ddfa58b 100644 --- a/docs/data/data-grid/pagination/PageSizeCustomOptions.tsx +++ b/docs/data/data-grid/pagination/PageSizeCustomOptions.tsx @@ -17,7 +17,7 @@ export default function PageSizeCustomOptions() { ...data.initialState, pagination: { paginationModel: { pageSize: 5 } }, }} - pageSizeOptions={[5, 10, 25]} + pageSizeOptions={[5, 10, 25, { value: -1, label: 'All' }]} /> ); diff --git a/docs/data/data-grid/pagination/PageSizeCustomOptions.tsx.preview b/docs/data/data-grid/pagination/PageSizeCustomOptions.tsx.preview index 88965a8c26f4..1f4dad3d8994 100644 --- a/docs/data/data-grid/pagination/PageSizeCustomOptions.tsx.preview +++ b/docs/data/data-grid/pagination/PageSizeCustomOptions.tsx.preview @@ -4,5 +4,5 @@ ...data.initialState, pagination: { paginationModel: { pageSize: 5 } }, }} - pageSizeOptions={[5, 10, 25]} + pageSizeOptions={[5, 10, 25, { value: -1, label: 'All' }]} /> \ No newline at end of file diff --git a/docs/data/data-grid/pagination/pagination.md b/docs/data/data-grid/pagination/pagination.md index 90b26b56d8d7..7259d7fca5b0 100644 --- a/docs/data/data-grid/pagination/pagination.md +++ b/docs/data/data-grid/pagination/pagination.md @@ -41,10 +41,10 @@ You should provide an array of items, each item should be one of these types: ``` -- **object**, the `value` and `label` keys will be used respectively for the value and label of the option. +- **object**, the `value` and `label` keys will be used respectively for the value and label of the option. Define `value` as `-1` to display all results. ```jsx - + ``` {{"demo": "PageSizeCustomOptions.js", "bg": "inline"}} diff --git a/docs/pages/x/api/data-grid/data-grid-premium.json b/docs/pages/x/api/data-grid/data-grid-premium.json index 478f8854a196..99283c51b8ae 100644 --- a/docs/pages/x/api/data-grid/data-grid-premium.json +++ b/docs/pages/x/api/data-grid/data-grid-premium.json @@ -796,12 +796,24 @@ "default": "GridRow", "class": "MuiDataGridPremium-row" }, + { + "name": "baseBadge", + "description": "The custom Badge component used in the grid for both header and cells.", + "default": "Badge", + "class": null + }, { "name": "baseCheckbox", "description": "The custom Checkbox component used in the grid for both header and cells.", "default": "Checkbox", "class": null }, + { + "name": "baseDivider", + "description": "The custom Divider component used in the grid.", + "default": "Divider", + "class": null + }, { "name": "baseInputAdornment", "description": "The custom InputAdornment component used in the grid.", diff --git a/docs/pages/x/api/data-grid/data-grid-pro.json b/docs/pages/x/api/data-grid/data-grid-pro.json index 54a8ab54294e..3a0923e1a1d9 100644 --- a/docs/pages/x/api/data-grid/data-grid-pro.json +++ b/docs/pages/x/api/data-grid/data-grid-pro.json @@ -728,12 +728,24 @@ "default": "GridRow", "class": "MuiDataGridPro-row" }, + { + "name": "baseBadge", + "description": "The custom Badge component used in the grid for both header and cells.", + "default": "Badge", + "class": null + }, { "name": "baseCheckbox", "description": "The custom Checkbox component used in the grid for both header and cells.", "default": "Checkbox", "class": null }, + { + "name": "baseDivider", + "description": "The custom Divider component used in the grid.", + "default": "Divider", + "class": null + }, { "name": "baseInputAdornment", "description": "The custom InputAdornment component used in the grid.", diff --git a/docs/pages/x/api/data-grid/data-grid.json b/docs/pages/x/api/data-grid/data-grid.json index 25e56f8402bc..87da7c9e9a81 100644 --- a/docs/pages/x/api/data-grid/data-grid.json +++ b/docs/pages/x/api/data-grid/data-grid.json @@ -615,12 +615,24 @@ "default": "GridRow", "class": "MuiDataGrid-row" }, + { + "name": "baseBadge", + "description": "The custom Badge component used in the grid for both header and cells.", + "default": "Badge", + "class": null + }, { "name": "baseCheckbox", "description": "The custom Checkbox component used in the grid for both header and cells.", "default": "Checkbox", "class": null }, + { + "name": "baseDivider", + "description": "The custom Divider component used in the grid.", + "default": "Divider", + "class": null + }, { "name": "baseInputAdornment", "description": "The custom InputAdornment component used in the grid.", 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 6d19c1df3ffc..09e234b76a5a 100644 --- a/docs/pages/x/api/data-grid/grid-print-export-options.json +++ b/docs/pages/x/api/data-grid/grid-print-export-options.json @@ -18,6 +18,6 @@ "hideFooter": { "type": { "description": "boolean" }, "default": "false" }, "hideToolbar": { "type": { "description": "boolean" }, "default": "false" }, "includeCheckboxes": { "type": { "description": "boolean" }, "default": "false" }, - "pageStyle": { "type": { "description": "string | Function" } } + "pageStyle": { "type": { "description": "string | (() => string)" } } } } diff --git a/docs/translations/api-docs/data-grid/data-grid-premium/data-grid-premium.json b/docs/translations/api-docs/data-grid/data-grid-premium/data-grid-premium.json index 5e463ec7b112..dc242fd21180 100644 --- a/docs/translations/api-docs/data-grid/data-grid-premium/data-grid-premium.json +++ b/docs/translations/api-docs/data-grid/data-grid-premium/data-grid-premium.json @@ -1230,9 +1230,11 @@ } }, "slotDescriptions": { + "baseBadge": "The custom Badge component used in the grid for both header and cells.", "baseButton": "The custom Button component used in the grid.", "baseCheckbox": "The custom Checkbox component used in the grid for both header and cells.", "baseChip": "The custom Chip component used in the grid.", + "baseDivider": "The custom Divider component used in the grid.", "baseFormControl": "The custom FormControl component used in the grid.", "baseIconButton": "The custom IconButton component used in the grid.", "baseInputAdornment": "The custom InputAdornment component used in the grid.", diff --git a/docs/translations/api-docs/data-grid/data-grid-pro/data-grid-pro.json b/docs/translations/api-docs/data-grid/data-grid-pro/data-grid-pro.json index b2b762362095..42302d388bbf 100644 --- a/docs/translations/api-docs/data-grid/data-grid-pro/data-grid-pro.json +++ b/docs/translations/api-docs/data-grid/data-grid-pro/data-grid-pro.json @@ -1168,9 +1168,11 @@ } }, "slotDescriptions": { + "baseBadge": "The custom Badge component used in the grid for both header and cells.", "baseButton": "The custom Button component used in the grid.", "baseCheckbox": "The custom Checkbox component used in the grid for both header and cells.", "baseChip": "The custom Chip component used in the grid.", + "baseDivider": "The custom Divider component used in the grid.", "baseFormControl": "The custom FormControl component used in the grid.", "baseIconButton": "The custom IconButton component used in the grid.", "baseInputAdornment": "The custom InputAdornment component used in the grid.", diff --git a/docs/translations/api-docs/data-grid/data-grid/data-grid.json b/docs/translations/api-docs/data-grid/data-grid/data-grid.json index 9cf3ea258f2a..141c83b1b2eb 100644 --- a/docs/translations/api-docs/data-grid/data-grid/data-grid.json +++ b/docs/translations/api-docs/data-grid/data-grid/data-grid.json @@ -1048,9 +1048,11 @@ } }, "slotDescriptions": { + "baseBadge": "The custom Badge component used in the grid for both header and cells.", "baseButton": "The custom Button component used in the grid.", "baseCheckbox": "The custom Checkbox component used in the grid for both header and cells.", "baseChip": "The custom Chip component used in the grid.", + "baseDivider": "The custom Divider component used in the grid.", "baseFormControl": "The custom FormControl component used in the grid.", "baseIconButton": "The custom IconButton component used in the grid.", "baseInputAdornment": "The custom InputAdornment component used in the grid.", diff --git a/packages/x-data-grid-pro/src/components/GridDataSourceTreeDataGroupingCell.tsx b/packages/x-data-grid-pro/src/components/GridDataSourceTreeDataGroupingCell.tsx index 79e002211adf..d5ee7aa79ab5 100644 --- a/packages/x-data-grid-pro/src/components/GridDataSourceTreeDataGroupingCell.tsx +++ b/packages/x-data-grid-pro/src/components/GridDataSourceTreeDataGroupingCell.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import composeClasses from '@mui/utils/composeClasses'; import Box from '@mui/material/Box'; -import Badge from '@mui/material/Badge'; import { getDataGridUtilityClass, GridRenderCellParams, @@ -93,9 +92,9 @@ function GridTreeDataGroupingCellIcon(props: GridTreeDataGroupingCellIconProps) {...rootProps?.slotProps?.baseIconButton} > - + - + ) : null; diff --git a/packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderFilterIconButton.tsx b/packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderFilterIconButton.tsx index d48bc0ccdfe2..92641c45e46e 100644 --- a/packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderFilterIconButton.tsx +++ b/packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderFilterIconButton.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils'; -import Badge from '@mui/material/Badge'; import { useGridSelector } from '../../hooks'; import { gridPreferencePanelStateSelector } from '../../hooks/features/preferencesPanel/gridPreferencePanelSelector'; import { GridPreferencePanelsValue } from '../../hooks/features/preferencesPanel/gridPreferencePanelsValue'; @@ -97,9 +96,9 @@ function GridColumnHeaderFilterIconButton(props: ColumnHeaderFilterIconButtonPro > {counter > 1 && ( - + {iconButton} - + )} {counter === 1 && iconButton} diff --git a/packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderSortIcon.tsx b/packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderSortIcon.tsx index 367931b7e3c9..778579bcc0e3 100644 --- a/packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderSortIcon.tsx +++ b/packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderSortIcon.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import composeClasses from '@mui/utils/composeClasses'; -import Badge from '@mui/material/Badge'; import { GridSlotsComponent } from '../../models/gridSlotsComponent'; import { GridSortDirection } from '../../models/gridSortModel'; import { useGridApiContext } from '../../hooks/utils/useGridApiContext'; @@ -80,9 +79,9 @@ function GridColumnHeaderSortIconRaw(props: GridColumnHeaderSortIconProps) { return ( {index != null && ( - + {iconButton} - + )} {index == null && iconButton} diff --git a/packages/x-data-grid/src/components/toolbar/GridToolbar.tsx b/packages/x-data-grid/src/components/toolbar/GridToolbar.tsx index 216335a99ba3..260f22437210 100644 --- a/packages/x-data-grid/src/components/toolbar/GridToolbar.tsx +++ b/packages/x-data-grid/src/components/toolbar/GridToolbar.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -import Box from '@mui/material/Box'; import { GridToolbarContainer, GridToolbarContainerProps, @@ -61,7 +60,7 @@ const GridToolbar = React.forwardRef( // TODO: remove the reference to excelOptions in community package excelOptions={excelOptions} /> - +
{showQuickFilter && } ); diff --git a/packages/x-data-grid/src/components/toolbar/GridToolbarExport.tsx b/packages/x-data-grid/src/components/toolbar/GridToolbarExport.tsx index 672e5e32dbe1..7b3ee4453cf5 100644 --- a/packages/x-data-grid/src/components/toolbar/GridToolbarExport.tsx +++ b/packages/x-data-grid/src/components/toolbar/GridToolbarExport.tsx @@ -107,22 +107,7 @@ GridPrintExportMenuItem.propTypes = { hideFooter: PropTypes.bool, hideToolbar: PropTypes.bool, includeCheckboxes: PropTypes.bool, - pageStyle: PropTypes.oneOfType([ - PropTypes.shape({ - '__@hasInstance@646': PropTypes.func.isRequired, - '__@metadata@648': PropTypes.any, - apply: PropTypes.func.isRequired, - arguments: PropTypes.any.isRequired, - bind: PropTypes.func.isRequired, - call: PropTypes.func.isRequired, - caller: PropTypes.object.isRequired, - length: PropTypes.number.isRequired, - name: PropTypes.string.isRequired, - prototype: PropTypes.any.isRequired, - toString: PropTypes.func.isRequired, - }), - PropTypes.string, - ]), + pageStyle: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), }), } as any; diff --git a/packages/x-data-grid/src/components/toolbar/GridToolbarFilterButton.tsx b/packages/x-data-grid/src/components/toolbar/GridToolbarFilterButton.tsx index 2e286a44519d..5f7bbb6f473f 100644 --- a/packages/x-data-grid/src/components/toolbar/GridToolbarFilterButton.tsx +++ b/packages/x-data-grid/src/components/toolbar/GridToolbarFilterButton.tsx @@ -6,7 +6,6 @@ import { unstable_capitalize as capitalize, unstable_useId as useId, } from '@mui/utils'; -import Badge from '@mui/material/Badge'; import { ButtonProps } from '@mui/material/Button'; import { TooltipProps } from '@mui/material/Tooltip'; import { gridColumnLookupSelector } from '../../hooks/features/columns/gridColumnsSelector'; @@ -144,9 +143,9 @@ const GridToolbarFilterButton = React.forwardRef + - + } {...buttonProps} onClick={toggleFilter} diff --git a/packages/x-data-grid/src/hooks/features/columnMenu/useGridColumnMenuSlots.ts b/packages/x-data-grid/src/hooks/features/columnMenu/useGridColumnMenuSlots.ts index ee8b2fecd978..fbb6c996fd6f 100644 --- a/packages/x-data-grid/src/hooks/features/columnMenu/useGridColumnMenuSlots.ts +++ b/packages/x-data-grid/src/hooks/features/columnMenu/useGridColumnMenuSlots.ts @@ -1,7 +1,7 @@ import * as React from 'react'; -import Divider from '@mui/material/Divider'; import { GridColumnMenuRootProps } from './columnMenuInterfaces'; import { GridColDef } from '../../../models/colDef/gridColDef'; +import { useGridRootProps } from '../../utils/useGridRootProps'; import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext'; interface UseGridColumnMenuSlotsProps extends GridColumnMenuRootProps { @@ -16,6 +16,7 @@ type UseGridColumnMenuSlotsResponse = Array< const useGridColumnMenuSlots = (props: UseGridColumnMenuSlotsProps) => { const apiRef = useGridPrivateApiContext(); + const rootProps = useGridRootProps(); const { defaultSlots, defaultSlotProps, @@ -71,7 +72,7 @@ const useGridColumnMenuSlots = (props: UseGridColumnMenuSlotsProps) => { itemProps = { ...itemProps, ...customProps }; } return addDividers && index !== sorted.length - 1 - ? [...acc, [processedComponents[key]!, itemProps], [Divider, {}]] + ? [...acc, [processedComponents[key]!, itemProps], [rootProps.slots.baseDivider, {}]] : [...acc, [processedComponents[key]!, itemProps]]; }, []); }, [ @@ -82,6 +83,7 @@ const useGridColumnMenuSlots = (props: UseGridColumnMenuSlotsProps) => { processedComponents, processedSlotProps, userItems, + rootProps.slots.baseDivider, ]); }; diff --git a/packages/x-data-grid/src/hooks/features/pagination/gridPaginationSelector.ts b/packages/x-data-grid/src/hooks/features/pagination/gridPaginationSelector.ts index 786ba8881b45..f9c8698e5929 100644 --- a/packages/x-data-grid/src/hooks/features/pagination/gridPaginationSelector.ts +++ b/packages/x-data-grid/src/hooks/features/pagination/gridPaginationSelector.ts @@ -8,6 +8,8 @@ import { import { gridRowMaximumTreeDepthSelector, gridRowTreeSelector } from '../rows/gridRowsSelector'; import { getPageCount } from './gridPaginationUtils'; +const ALL_RESULTS_PAGE_VALUE = -1; + /** * @category Pagination * @ignore - do not document. @@ -92,10 +94,13 @@ export const gridPaginationRowRangeSelector = createSelectorMemoized( paginationModel.pageSize * paginationModel.page, visibleTopLevelRowCount - 1, ); - const topLevelLastRowIndex = Math.min( - topLevelFirstRowIndex + paginationModel.pageSize - 1, - visibleTopLevelRowCount - 1, - ); + const topLevelLastRowIndex = + paginationModel.pageSize === ALL_RESULTS_PAGE_VALUE + ? visibleTopLevelRowCount - 1 + : Math.min( + topLevelFirstRowIndex + paginationModel.pageSize - 1, + visibleTopLevelRowCount - 1, + ); // The range contains no element if (topLevelFirstRowIndex === -1 || topLevelLastRowIndex === -1) { diff --git a/packages/x-data-grid/src/joy/joySlots.tsx b/packages/x-data-grid/src/joy/joySlots.tsx index 246799f568a6..a5645d892066 100644 --- a/packages/x-data-grid/src/joy/joySlots.tsx +++ b/packages/x-data-grid/src/joy/joySlots.tsx @@ -1,7 +1,9 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { ColorPaletteProp, Theme, VariantProp } from '@mui/joy/styles'; +import JoyBadge from '@mui/joy/Badge'; import JoyCheckbox from '@mui/joy/Checkbox'; +import JoyDivider from '@mui/joy/Divider'; import JoyInput from '@mui/joy/Input'; import JoyFormControl from '@mui/joy/FormControl'; import JoyFormLabel from '@mui/joy/FormLabel'; @@ -69,6 +71,20 @@ function convertVariant>( + ({ slotProps, variant, color, sx, ...props }, ref) => { + return ( + } + ref={ref as any} + /> + ); + }, +); + const Checkbox = React.forwardRef< HTMLElement, NonNullable @@ -374,7 +390,9 @@ const LoadingOverlay = React.forwardRef< const joySlots: Partial = { ...joyIconSlots, + baseBadge: Badge, baseCheckbox: Checkbox, + baseDivider: JoyDivider, baseTextField: TextField, baseButton: Button, baseIconButton: IconButton, diff --git a/packages/x-data-grid/src/locales/daDK.ts b/packages/x-data-grid/src/locales/daDK.ts index 9e31979bb081..dc305634c30e 100644 --- a/packages/x-data-grid/src/locales/daDK.ts +++ b/packages/x-data-grid/src/locales/daDK.ts @@ -42,7 +42,7 @@ const daDKGrid: Partial = { columnsManagementSearchTitle: 'Søg', columnsManagementNoColumns: 'Ingen søjler', columnsManagementShowHideAllText: 'Vis/Skjul Alle', - // columnsManagementReset: 'Reset', + columnsManagementReset: 'Nulstil', // Filter panel text filterPanelAddFilter: 'Tilføj filter', @@ -58,9 +58,9 @@ const daDKGrid: Partial = { // Filter operators text filterOperatorContains: 'indeholder', - // filterOperatorDoesNotContain: 'does not contain', + filterOperatorDoesNotContain: 'indeholder ikke', filterOperatorEquals: 'lig med', - // filterOperatorDoesNotEqual: 'does not equal', + filterOperatorDoesNotEqual: 'ikke lig med', filterOperatorStartsWith: 'begynder med', filterOperatorEndsWith: 'ender med', filterOperatorIs: 'er lig med', @@ -81,9 +81,9 @@ const daDKGrid: Partial = { // Header filter operators text headerFilterOperatorContains: 'Indeholder', - // headerFilterOperatorDoesNotContain: 'Does not contain', + headerFilterOperatorDoesNotContain: 'Indeholder ikke', headerFilterOperatorEquals: 'Lig med', - // headerFilterOperatorDoesNotEqual: 'Does not equal', + headerFilterOperatorDoesNotEqual: 'Ikke lig med', headerFilterOperatorStartsWith: 'Begynder med', headerFilterOperatorEndsWith: 'Ender med', headerFilterOperatorIs: 'Er lig med', diff --git a/packages/x-data-grid/src/locales/itIT.ts b/packages/x-data-grid/src/locales/itIT.ts index 31b09da652c5..2058096d6165 100644 --- a/packages/x-data-grid/src/locales/itIT.ts +++ b/packages/x-data-grid/src/locales/itIT.ts @@ -39,10 +39,10 @@ const itITGrid: Partial = { toolbarExportExcel: 'Scarica come Excel', // Columns management text - // columnsManagementSearchTitle: 'Search', - // columnsManagementNoColumns: 'No columns', - // columnsManagementShowHideAllText: 'Show/Hide All', - // columnsManagementReset: 'Reset', + columnsManagementSearchTitle: 'Cerca', + columnsManagementNoColumns: 'Nessuna colonna', + columnsManagementShowHideAllText: 'Mostra/Nascondi Tutto', + columnsManagementReset: 'Resetta', // Filter panel text filterPanelAddFilter: 'Aggiungi un filtro', @@ -58,13 +58,13 @@ const itITGrid: Partial = { // Filter operators text filterOperatorContains: 'contiene', - // filterOperatorDoesNotContain: 'does not contain', + filterOperatorDoesNotContain: 'non contiene', filterOperatorEquals: 'uguale a', - // filterOperatorDoesNotEqual: 'does not equal', + filterOperatorDoesNotEqual: 'diverso da', filterOperatorStartsWith: 'comincia per', filterOperatorEndsWith: 'termina per', filterOperatorIs: 'uguale a', - filterOperatorNot: 'diversa da', + filterOperatorNot: 'diverso da', filterOperatorAfter: 'dopo il', filterOperatorOnOrAfter: 'a partire dal', filterOperatorBefore: 'prima del', @@ -81,26 +81,26 @@ const itITGrid: Partial = { // Header filter operators text headerFilterOperatorContains: 'Contiene', - // headerFilterOperatorDoesNotContain: 'Does not contain', - headerFilterOperatorEquals: 'uguale a', - // headerFilterOperatorDoesNotEqual: 'Does not equal', - headerFilterOperatorStartsWith: 'comincia per', - headerFilterOperatorEndsWith: 'termina per', - headerFilterOperatorIs: 'uguale a', - headerFilterOperatorNot: 'diversa da', - headerFilterOperatorAfter: 'dopo il', - headerFilterOperatorOnOrAfter: 'a partire dal', - headerFilterOperatorBefore: 'prima del', - headerFilterOperatorOnOrBefore: 'fino al', - headerFilterOperatorIsEmpty: 'è vuoto', - headerFilterOperatorIsNotEmpty: 'non è vuoto', - headerFilterOperatorIsAnyOf: 'è uno tra', - 'headerFilterOperator=': 'uguale a', - 'headerFilterOperator!=': 'diverso da', - 'headerFilterOperator>': 'maggiore di', - 'headerFilterOperator>=': 'maggiore o uguale a', - 'headerFilterOperator<': 'minore di', - 'headerFilterOperator<=': 'minore o uguale a', + headerFilterOperatorDoesNotContain: 'Non contiene', + headerFilterOperatorEquals: 'Uguale a', + headerFilterOperatorDoesNotEqual: 'Diverso da', + headerFilterOperatorStartsWith: 'Comincia per', + headerFilterOperatorEndsWith: 'Termina per', + headerFilterOperatorIs: 'Uguale a', + headerFilterOperatorNot: 'Diverso da', + headerFilterOperatorAfter: 'Dopo il', + headerFilterOperatorOnOrAfter: 'A partire dal', + headerFilterOperatorBefore: 'Prima del', + headerFilterOperatorOnOrBefore: 'Fino al', + headerFilterOperatorIsEmpty: 'È vuoto', + headerFilterOperatorIsNotEmpty: 'Non è vuoto', + headerFilterOperatorIsAnyOf: 'È uno tra', + 'headerFilterOperator=': 'Uguale a', + 'headerFilterOperator!=': 'Diverso da', + 'headerFilterOperator>': 'Maggiore di', + 'headerFilterOperator>=': 'Maggiore o uguale a', + 'headerFilterOperator<': 'Minore di', + 'headerFilterOperator<=': 'Minore o uguale a', // Filter values text filterValueAny: 'qualunque', diff --git a/packages/x-data-grid/src/locales/ptBR.ts b/packages/x-data-grid/src/locales/ptBR.ts index bd9a3153b868..4dbd7b806024 100644 --- a/packages/x-data-grid/src/locales/ptBR.ts +++ b/packages/x-data-grid/src/locales/ptBR.ts @@ -58,9 +58,9 @@ const ptBRGrid: Partial = { // Filter operators text filterOperatorContains: 'contém', - // filterOperatorDoesNotContain: 'does not contain', + filterOperatorDoesNotContain: 'não contém', filterOperatorEquals: 'é igual a', - // filterOperatorDoesNotEqual: 'does not equal', + filterOperatorDoesNotEqual: 'não é igual a', filterOperatorStartsWith: 'começa com', filterOperatorEndsWith: 'termina com', filterOperatorIs: 'é', @@ -81,9 +81,9 @@ const ptBRGrid: Partial = { // Header filter operators text headerFilterOperatorContains: 'Contém', - // headerFilterOperatorDoesNotContain: 'Does not contain', + headerFilterOperatorDoesNotContain: 'Não contém', headerFilterOperatorEquals: 'Igual', - // headerFilterOperatorDoesNotEqual: 'Does not equal', + headerFilterOperatorDoesNotEqual: 'Não é igual a', headerFilterOperatorStartsWith: 'Começa com', headerFilterOperatorEndsWith: 'Termina com', headerFilterOperatorIs: 'É', diff --git a/packages/x-data-grid/src/material/index.ts b/packages/x-data-grid/src/material/index.ts index 6011f2c4606e..5377891acffc 100644 --- a/packages/x-data-grid/src/material/index.ts +++ b/packages/x-data-grid/src/material/index.ts @@ -1,4 +1,6 @@ +import MUIBadge from '@mui/material/Badge'; import MUICheckbox from '@mui/material/Checkbox'; +import MUIDivider from '@mui/material/Divider'; import MUITextField from '@mui/material/TextField'; import MUIFormControl from '@mui/material/FormControl'; import MUISelect from '@mui/material/Select'; @@ -81,7 +83,9 @@ const iconSlots: GridIconSlotsComponent = { const materialSlots: GridBaseSlots & GridIconSlotsComponent = { ...iconSlots, + baseBadge: MUIBadge, baseCheckbox: MUICheckbox, + baseDivider: MUIDivider, baseTextField: MUITextField, baseFormControl: MUIFormControl, baseSelect: MUISelect, diff --git a/packages/x-data-grid/src/models/gridExport.ts b/packages/x-data-grid/src/models/gridExport.ts index 98220015a855..a0a628b4b38c 100644 --- a/packages/x-data-grid/src/models/gridExport.ts +++ b/packages/x-data-grid/src/models/gridExport.ts @@ -149,7 +149,7 @@ export interface GridPrintExportOptions extends GridExportOptions { /** * Provide Print specific styles to the print window. */ - pageStyle?: string | Function; + pageStyle?: string | (() => string); /** * Function that returns the list of row ids to export in the order they should be exported. * @param {GridPrintGetRowsToExportParams} params With all properties from [[GridPrintGetRowsToExportParams]]. diff --git a/packages/x-data-grid/src/models/gridSlotsComponent.ts b/packages/x-data-grid/src/models/gridSlotsComponent.ts index 4fe7ea508c74..51fc7ccac3b8 100644 --- a/packages/x-data-grid/src/models/gridSlotsComponent.ts +++ b/packages/x-data-grid/src/models/gridSlotsComponent.ts @@ -5,6 +5,11 @@ import type { GridIconSlotsComponent } from './gridIconSlotsComponent'; export type { GridSlotProps } from './gridSlotsComponentsProps'; export interface GridBaseSlots { + /** + * The custom Badge component used in the grid for both header and cells. + * @default Badge + */ + baseBadge: React.JSXElementConstructor; /** * The custom Checkbox component used in the grid for both header and cells. * @default Checkbox @@ -15,6 +20,11 @@ export interface GridBaseSlots { * @default Chip */ baseChip: React.JSXElementConstructor; + /** + * The custom Divider component used in the grid. + * @default Divider + */ + baseDivider: React.JSXElementConstructor; /** * The custom InputAdornment component used in the grid. * @default InputAdornment diff --git a/packages/x-data-grid/src/models/gridSlotsComponentsProps.ts b/packages/x-data-grid/src/models/gridSlotsComponentsProps.ts index 6ea9c9f27613..fb3a00c76088 100644 --- a/packages/x-data-grid/src/models/gridSlotsComponentsProps.ts +++ b/packages/x-data-grid/src/models/gridSlotsComponentsProps.ts @@ -1,4 +1,5 @@ import * as React from 'react'; +import type { BadgeProps } from '@mui/material/Badge'; import type { CheckboxProps } from '@mui/material/Checkbox'; import type { TextFieldProps } from '@mui/material/TextField'; import type { FormControlProps } from '@mui/material/FormControl'; @@ -31,8 +32,12 @@ import type { GridLoadingOverlayProps } from '../components/GridLoadingOverlay'; import type { GridRowCountProps } from '../components/GridRowCount'; import type { GridColumnHeaderSortIconProps } from '../components/columnHeaders/GridColumnHeaderSortIcon'; +type DividerProps = {}; + // Overrides for module augmentation +export interface BaseBadgePropsOverrides {} export interface BaseCheckboxPropsOverrides {} +export interface BaseDividerPropsOverrides {} export interface BaseTextFieldPropsOverrides {} export interface BaseFormControlPropsOverrides {} export interface BaseSelectPropsOverrides {} @@ -66,7 +71,9 @@ export interface SkeletonCellPropsOverrides {} export interface RowPropsOverrides {} export interface GridSlotProps { + baseBadge: BadgeProps & BaseBadgePropsOverrides; baseCheckbox: CheckboxProps & BaseCheckboxPropsOverrides; + baseDivider: DividerProps & BaseDividerPropsOverrides; baseTextField: TextFieldProps & BaseTextFieldPropsOverrides; baseFormControl: FormControlProps & BaseFormControlPropsOverrides; baseSelect: SelectProps & BaseSelectPropsOverrides; diff --git a/scripts/x-data-grid-premium.exports.json b/scripts/x-data-grid-premium.exports.json index 5c536da99e51..f6e08468b288 100644 --- a/scripts/x-data-grid-premium.exports.json +++ b/scripts/x-data-grid-premium.exports.json @@ -1,7 +1,9 @@ [ + { "name": "BaseBadgePropsOverrides", "kind": "Interface" }, { "name": "BaseButtonPropsOverrides", "kind": "Interface" }, { "name": "BaseCheckboxPropsOverrides", "kind": "Interface" }, { "name": "BaseChipPropsOverrides", "kind": "Interface" }, + { "name": "BaseDividerPropsOverrides", "kind": "Interface" }, { "name": "BaseFormControlPropsOverrides", "kind": "Interface" }, { "name": "BaseIconButtonPropsOverrides", "kind": "Interface" }, { "name": "BaseInputAdornmentPropsOverrides", "kind": "Interface" }, diff --git a/scripts/x-data-grid-pro.exports.json b/scripts/x-data-grid-pro.exports.json index dcb194f6eac7..e88ab0b759cf 100644 --- a/scripts/x-data-grid-pro.exports.json +++ b/scripts/x-data-grid-pro.exports.json @@ -1,7 +1,9 @@ [ + { "name": "BaseBadgePropsOverrides", "kind": "Interface" }, { "name": "BaseButtonPropsOverrides", "kind": "Interface" }, { "name": "BaseCheckboxPropsOverrides", "kind": "Interface" }, { "name": "BaseChipPropsOverrides", "kind": "Interface" }, + { "name": "BaseDividerPropsOverrides", "kind": "Interface" }, { "name": "BaseFormControlPropsOverrides", "kind": "Interface" }, { "name": "BaseIconButtonPropsOverrides", "kind": "Interface" }, { "name": "BaseInputAdornmentPropsOverrides", "kind": "Interface" }, diff --git a/scripts/x-data-grid.exports.json b/scripts/x-data-grid.exports.json index cc85a19301e4..8414b824889b 100644 --- a/scripts/x-data-grid.exports.json +++ b/scripts/x-data-grid.exports.json @@ -1,7 +1,9 @@ [ + { "name": "BaseBadgePropsOverrides", "kind": "Interface" }, { "name": "BaseButtonPropsOverrides", "kind": "Interface" }, { "name": "BaseCheckboxPropsOverrides", "kind": "Interface" }, { "name": "BaseChipPropsOverrides", "kind": "Interface" }, + { "name": "BaseDividerPropsOverrides", "kind": "Interface" }, { "name": "BaseFormControlPropsOverrides", "kind": "Interface" }, { "name": "BaseIconButtonPropsOverrides", "kind": "Interface" }, { "name": "BaseInputAdornmentPropsOverrides", "kind": "Interface" },