@mui/x-data-grid 7.3.2 → 7.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,144 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## v7.5.0
7
+
8
+ _May 17, 2024_
9
+
10
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🎁 Add support for checkbox selection on the Tree View components
13
+ - 🌍 Improve Norwegian (nb-NO) and Spanish (es-ES) locales on the Data Grid
14
+ - 🐞 Bugfixes
15
+ - 📚 Documentation improvements
16
+
17
+ ### Data Grid
18
+
19
+ #### `@mui/x-data-grid@7.5.0`
20
+
21
+ - [DataGrid] Fix `rowModesModel` controlled prop (#13056) @Janpot
22
+ - [DataGrid] Reduce bundle size with error messages (#12992) @oliviertassinari
23
+ - [l10n] Improve Norwegian (nb-NO) locale (#13106) @oliverlaidma
24
+ - [l10n] Improve Spanish (es-ES) locale (#13133) @Jucabel
25
+
26
+ #### `@mui/x-data-grid-pro@7.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
27
+
28
+ Same changes as in `@mui/x-data-grid@7.5.0`.
29
+
30
+ #### `@mui/x-data-grid-premium@7.5.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
31
+
32
+ Same changes as in `@mui/x-data-grid-pro@7.5.0`.
33
+
34
+ ### Date and Time Pickers
35
+
36
+ #### `@mui/x-date-pickers@7.5.0`
37
+
38
+ - [fields] Allow empty `textField` slot placeholder value (#13148) @arthurbalduini
39
+ - [pickers] Fix `AdapterMomentJalaali` regression (#13144) @LukasTy
40
+ - [pickers] Fix field focusing when switching to view without a renderer (#13112) @LukasTy
41
+ - [pickers] Reuse `AdapterDateFnsBase` in Jalali adapters (#13075) @LukasTy
42
+
43
+ #### `@mui/x-date-pickers-pro@7.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
44
+
45
+ Same changes as in `@mui/x-date-pickers@7.5.0`.
46
+
47
+ ### Charts
48
+
49
+ #### `@mui/x-charts@7.5.0`
50
+
51
+ - [charts] Tooltip with `trigger=axis` now follow touch on mobile (#13043) @wzdorowa
52
+ - [charts] Allow `series.label` property to receive a function with the "location" it is going to be displayed on (#12830) @JCQuintas
53
+ - [charts] Improve TypeScript performance (#13137) @alexfauquette
54
+ - [charts] Fix area order when overlapping (#13121) @alexfauquette
55
+ - [charts] Improve `useSlotProps` types (#13141) @alexfauquette
56
+ - [charts] Fix using the theme's font in the Overlay (#13107) @alexfauquette
57
+
58
+ ### Tree View
59
+
60
+ #### `@mui/x-tree-view@7.5.0`
61
+
62
+ - [TreeView] Add support for checkbox selection (#11452) @flaviendelangle
63
+ - [TreeView] Remove unused code (#12917) @flaviendelangle
64
+
65
+ ### Docs
66
+
67
+ - [docs] Document missing Charts API's (#12875) @alexfauquette
68
+
69
+ ### Core
70
+
71
+ - [core] Avoid root level `@mui/x-date-pickers` imports (#13120) @LukasTy
72
+ - [core] Refactor ESLint config to disallow root level imports (#13130) @LukasTy
73
+ - [core] Simplify Danger's config (#13062) @oliviertassinari
74
+ - [core] Shift aliasing from babel to webpack (#13051) @Janpot
75
+ - [core] Reuse the `SectionTitle` component in the doc (#13139) @alexfauquette
76
+
77
+ ## 7.4.0
78
+
79
+ _May 10, 2024_
80
+
81
+ We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
82
+
83
+ - ✨ Add optional `id` attribute on shortcut items of the Date and Time Pickers
84
+ - 🎁 Add support for `date-fns-jalali` v3 in the Date and Time Pickers
85
+ - 🚀 Support rounded corners on `BarChart`
86
+ - 🌍 Add accessibility page to TreeView docs
87
+ - 🐞 Bugfixes
88
+ - 📚 Documentation improvements
89
+
90
+ ### Data Grid
91
+
92
+ #### `@mui/x-data-grid@7.4.0`
93
+
94
+ - [DataGrid] Fix error when focus moves from column header to `svg` element (#13028) @oukunan
95
+ - [DataGrid] Fix error on column groups change (#12965) @romgrk
96
+
97
+ #### `@mui/x-data-grid-pro@7.4.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
98
+
99
+ Same changes as in `@mui/x-data-grid@7.4.0`.
100
+
101
+ #### `@mui/x-data-grid-premium@7.4.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
102
+
103
+ Same changes as in `@mui/x-data-grid-pro@7.4.0`.
104
+
105
+ ### Date and Time Pickers
106
+
107
+ #### `@mui/x-date-pickers@7.4.0`
108
+
109
+ - [fields] Fix regression preventing form submit on "Enter" click (#13065) @LukasTy
110
+ - [pickers] Add `AdapterDateFnsJalaliV3` adapter (#12891) @smmoosavi
111
+ - [pickers] Add optional `id` attribute on shortcut items (#12976) @noraleonte
112
+
113
+ #### `@mui/x-date-pickers-pro@7.4.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
114
+
115
+ Same changes as in `@mui/x-date-pickers@7.4.0`.
116
+
117
+ ### Charts
118
+
119
+ #### `@mui/x-charts@7.4.0`
120
+
121
+ - [charts] Add `ChartsGrid` to `themeAugmentation` (#13026) @noraleonte
122
+ - [charts] Support rounded corners on `BarChart` (#12834) @JCQuintas
123
+
124
+ ### Tree View
125
+
126
+ #### `@mui/x-tree-view@7.4.0`
127
+
128
+ - [TreeView] Fix props propagation and theme entry in `TreeItem2` (#12889) @flaviendelangle
129
+
130
+ ### Docs
131
+
132
+ - [docs] Add accessibility page to TreeView docs (#12845) @noraleonte
133
+ - [docs] Fix Charts styling typos (#13061) @oliviertassinari
134
+ - [docs] Fix legal link to EULA free trial (#13013) @oliviertassinari
135
+ - [docs] Update interface name in pinned columns docs (#13070) @cherniavskii
136
+
137
+ ### Core
138
+
139
+ - [core] Improve release process docs (#12977) @JCQuintas
140
+ - [core] Prepare React 19 (#12991) @oliviertassinari
141
+ - [docs-infra] Fix Netlify PR preview path (#12993) @oliviertassinari
142
+ - [infra] Automation: Add release PR reviewers (#12982) @michelengelen
143
+
6
144
  ## 7.3.2
7
145
 
8
146
  _May 2, 2024_
@@ -17,8 +155,6 @@ We'd like to offer a big thanks to the 11 contributors who made this release pos
17
155
  - 🐞 Bugfixes
18
156
  - 📚 Documentation improvements
19
157
 
20
- <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
21
-
22
158
  ### Data Grid
23
159
 
24
160
  #### `@mui/x-data-grid@7.3.2`
@@ -3281,6 +3417,28 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
3281
3417
  - [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
3282
3418
  - [license] Correctly throw errors (#10924) @oliviertassinari
3283
3419
 
3420
+ ## 6.19.12
3421
+
3422
+ _May 17, 2024_
3423
+
3424
+ We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
3425
+
3426
+ - 🐞 Bugfixes
3427
+
3428
+ ### Date Pickers
3429
+
3430
+ #### `@mui/x-date-pickers@6.19.12`
3431
+
3432
+ - [pickers] Fix `AdapterMomentJalaali` regression (#13150) @LukasTy
3433
+
3434
+ #### `@mui/x-date-pickers-pro@6.19.12` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
3435
+
3436
+ Same changes as in `@mui/x-date-pickers@6.19.12`.
3437
+
3438
+ ### Docs
3439
+
3440
+ - [docs] Use MUI X v6 in Codesandbox and Stackblitz demos (#12838) @cherniavskii
3441
+
3284
3442
  ## 6.19.11
3285
3443
 
3286
3444
  _Apr 18, 2024_
@@ -9,13 +9,18 @@ import { useDataGridComponent } from './useDataGridComponent';
9
9
  import { useDataGridProps } from './useDataGridProps';
10
10
  import { propValidatorsDataGrid, validateProps } from '../internals/utils/propValidation';
11
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
- const propValidators = [...propValidatorsDataGrid,
13
- // Only validate in MIT version
14
- props => props.columns && props.columns.some(column => column.resizable) && [`MUI X: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n') || undefined];
12
+ let propValidators;
13
+ if (process.env.NODE_ENV !== 'production') {
14
+ propValidators = [...propValidatorsDataGrid,
15
+ // Only validate in MIT version
16
+ props => props.columns && props.columns.some(column => column.resizable) && [`MUI X: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n') || undefined];
17
+ }
15
18
  const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref) {
16
19
  const props = useDataGridProps(inProps);
17
20
  const privateApiRef = useDataGridComponent(props.apiRef, props);
18
- validateProps(props, propValidators);
21
+ if (process.env.NODE_ENV !== 'production') {
22
+ validateProps(props, propValidators);
23
+ }
19
24
  return /*#__PURE__*/_jsx(GridContextProvider, {
20
25
  privateApiRef: privateApiRef,
21
26
  props: props,
@@ -12,6 +12,7 @@ import { gridRenderContextColumnsSelector, gridVirtualizationColumnEnabledSelect
12
12
  import { computeOffsetLeft } from '../virtualization/useGridVirtualScroller';
13
13
  import { GridColumnGroupHeader } from '../../../components/columnHeaders/GridColumnGroupHeader';
14
14
  import { GridPinnedColumnPosition, gridColumnPositionsSelector, gridVisiblePinnedColumnDefinitionsSelector } from '../columns';
15
+ import { gridColumnGroupsUnwrappedModelSelector } from '../columnGrouping/gridColumnGroupsSelector';
15
16
  import { GridScrollbarFillerCell as ScrollbarFiller } from '../../../components/GridScrollbarFillerCell';
16
17
  import { getPinnedCellOffset } from '../../../internals/utils/getPinnedCellOffset';
17
18
  import { GridColumnHeaderSeparatorSides } from '../../../components/columnHeaders/GridColumnHeaderSeparator';
@@ -44,8 +45,9 @@ export const useGridColumnHeaders = props => {
44
45
  const apiRef = useGridPrivateApiContext();
45
46
  const theme = useTheme();
46
47
  const rootProps = useGridRootProps();
47
- const hasVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
48
48
  const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
49
+ const hasVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
50
+ const columnGroupsModel = useGridSelector(apiRef, gridColumnGroupsUnwrappedModelSelector);
49
51
  const columnPositions = useGridSelector(apiRef, gridColumnPositionsSelector);
50
52
  const renderContext = useGridSelector(apiRef, gridRenderContextColumnsSelector);
51
53
  const pinnedColumns = useGridSelector(apiRef, gridVisiblePinnedColumnDefinitionsSelector);
@@ -214,13 +216,13 @@ export const useGridColumnHeaders = props => {
214
216
  } = columnsToRender;
215
217
  const rowStructure = columnGroupsHeaderStructure[depth];
216
218
  const firstColumnFieldToRender = visibleColumns[firstColumnToRender].field;
217
- const firstGroupToRender = apiRef.current.getColumnGroupPath(firstColumnFieldToRender)[depth] ?? null;
219
+ const firstGroupToRender = columnGroupsModel[firstColumnFieldToRender]?.[depth] ?? null;
218
220
  const firstGroupIndex = rowStructure.findIndex(({
219
221
  groupId,
220
222
  columnFields
221
223
  }) => groupId === firstGroupToRender && columnFields.includes(firstColumnFieldToRender));
222
224
  const lastColumnFieldToRender = visibleColumns[lastColumnToRender - 1].field;
223
- const lastGroupToRender = apiRef.current.getColumnGroupPath(lastColumnFieldToRender)[depth] ?? null;
225
+ const lastGroupToRender = columnGroupsModel[lastColumnFieldToRender]?.[depth] ?? null;
224
226
  const lastGroupIndex = rowStructure.findIndex(({
225
227
  groupId,
226
228
  columnFields
@@ -550,7 +550,11 @@ export const useGridRowEditing = (apiRef, props) => {
550
550
  const copyOfPrevRowModesModel = prevRowModesModel.current;
551
551
  prevRowModesModel.current = deepClone(rowModesModel); // Do a deep-clone because the attributes might be changed later
552
552
 
553
- Object.entries(rowModesModel).forEach(([id, params]) => {
553
+ const ids = new Set([...Object.keys(rowModesModel), ...Object.keys(copyOfPrevRowModesModel)]);
554
+ Array.from(ids).forEach(id => {
555
+ const params = rowModesModel[id] ?? {
556
+ mode: GridRowModes.View
557
+ };
554
558
  const prevMode = copyOfPrevRowModesModel[id]?.mode || GridRowModes.View;
555
559
  const originalId = idToIdLookup[id] ?? id;
556
560
  if (params.mode === GridRowModes.Edit && prevMode === GridRowModes.View) {
@@ -252,7 +252,7 @@ export const useGridFocus = (apiRef, props) => {
252
252
  apiRef.current.setColumnGroupHeaderFocus(fields[0], depth, event);
253
253
  }, [apiRef]);
254
254
  const handleBlur = React.useCallback((_, event) => {
255
- if (event.relatedTarget?.className.includes(gridClasses.columnHeader)) {
255
+ if (event.relatedTarget?.getAttribute('class')?.includes(gridClasses.columnHeader)) {
256
256
  return;
257
257
  }
258
258
  logger.debug(`Clearing focus`);
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.3.2
2
+ * @mui/x-data-grid v7.5.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,5 +1,5 @@
1
1
  import { DataGridProcessedProps } from '../../models/props/DataGridProps';
2
2
  export type PropValidator<TProps> = (props: TProps) => string | undefined;
3
3
  export declare const propValidatorsDataGrid: PropValidator<DataGridProcessedProps>[];
4
- export declare const validateProps: <TProps>(props: TProps, validators: PropValidator<TProps>[]) => void;
5
- export declare const clearWarningsCache: () => void;
4
+ export declare function validateProps<TProps>(props: TProps, validators: PropValidator<TProps>[]): void;
5
+ export declare function clearWarningsCache(): void;
@@ -2,23 +2,20 @@ import { isNumber } from '../../utils/utils';
2
2
  import { GridSignature } from '../../hooks/utils/useGridApiEventHandler';
3
3
  export const propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.paginationMode === 'client' && props.paginationMeta != null && ['MUI X: Usage of the `paginationMeta` prop with client-side pagination (`paginationMode="client"`) has no effect.', '`paginationMeta` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.signature === GridSignature.DataGrid && props.paginationMode === 'client' && isNumber(props.rowCount) && ['MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect.', '`rowCount` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.paginationMode === 'server' && props.rowCount == null && ["MUI X: The `rowCount` prop must be passed using `paginationMode='server'`", 'For more detail, see http://mui.com/components/data-grid/pagination/#index-based-pagination'].join('\n') || undefined];
4
4
  const warnedOnceCache = new Set();
5
- const warnOnce = message => {
5
+ function warnOnce(message) {
6
6
  if (!warnedOnceCache.has(message)) {
7
7
  console.error(message);
8
8
  warnedOnceCache.add(message);
9
9
  }
10
- };
11
- export const validateProps = (props, validators) => {
12
- if (process.env.NODE_ENV === 'production') {
13
- return;
14
- }
10
+ }
11
+ export function validateProps(props, validators) {
15
12
  validators.forEach(validator => {
16
13
  const warning = validator(props);
17
14
  if (warning) {
18
15
  warnOnce(warning);
19
16
  }
20
17
  });
21
- };
22
- export const clearWarningsCache = () => {
18
+ }
19
+ export function clearWarningsCache() {
23
20
  warnedOnceCache.clear();
24
- };
21
+ }
package/locales/esES.js CHANGED
@@ -140,10 +140,10 @@ const esESGrid = {
140
140
  rowReorderingHeaderName: 'Reordenar filas',
141
141
  // Aggregation
142
142
  aggregationMenuItemHeader: 'Agregación',
143
- aggregationFunctionLabelSum: 'sum',
144
- aggregationFunctionLabelAvg: 'avg',
145
- aggregationFunctionLabelMin: 'min',
146
- aggregationFunctionLabelMax: 'max',
143
+ aggregationFunctionLabelSum: 'suma',
144
+ aggregationFunctionLabelAvg: 'promedio',
145
+ aggregationFunctionLabelMin: 'mínimo',
146
+ aggregationFunctionLabelMax: 'máximo',
147
147
  aggregationFunctionLabelSize: 'tamaño'
148
148
  };
149
149
  export const esES = getGridLocalization(esESGrid, esESCore);
package/locales/nbNO.js CHANGED
@@ -30,11 +30,10 @@ const nbNOGrid = {
30
30
  toolbarExportPrint: 'Skriv ut',
31
31
  toolbarExportExcel: 'Last ned som Excel',
32
32
  // Columns management text
33
- // columnsManagementSearchTitle: 'Search',
34
- // columnsManagementNoColumns: 'No columns',
35
- // columnsManagementShowHideAllText: 'Show/Hide All',
36
- // columnsManagementReset: 'Reset',
37
-
33
+ columnsManagementSearchTitle: 'Søk',
34
+ columnsManagementNoColumns: 'Ingen kolonner',
35
+ columnsManagementShowHideAllText: 'Vis/skjul alle',
36
+ columnsManagementReset: 'Nullstill',
38
37
  // Filter panel text
39
38
  filterPanelAddFilter: 'Legg til filter',
40
39
  filterPanelRemoveAll: 'Fjern alle',
@@ -9,13 +9,18 @@ import { useDataGridComponent } from './useDataGridComponent';
9
9
  import { useDataGridProps } from './useDataGridProps';
10
10
  import { propValidatorsDataGrid, validateProps } from '../internals/utils/propValidation';
11
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
- const propValidators = [...propValidatorsDataGrid,
13
- // Only validate in MIT version
14
- props => props.columns && props.columns.some(column => column.resizable) && [`MUI X: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n') || undefined];
12
+ let propValidators;
13
+ if (process.env.NODE_ENV !== 'production') {
14
+ propValidators = [...propValidatorsDataGrid,
15
+ // Only validate in MIT version
16
+ props => props.columns && props.columns.some(column => column.resizable) && [`MUI X: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n') || undefined];
17
+ }
15
18
  const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref) {
16
19
  const props = useDataGridProps(inProps);
17
20
  const privateApiRef = useDataGridComponent(props.apiRef, props);
18
- validateProps(props, propValidators);
21
+ if (process.env.NODE_ENV !== 'production') {
22
+ validateProps(props, propValidators);
23
+ }
19
24
  return /*#__PURE__*/_jsx(GridContextProvider, {
20
25
  privateApiRef: privateApiRef,
21
26
  props: props,
@@ -12,6 +12,7 @@ import { gridRenderContextColumnsSelector, gridVirtualizationColumnEnabledSelect
12
12
  import { computeOffsetLeft } from '../virtualization/useGridVirtualScroller';
13
13
  import { GridColumnGroupHeader } from '../../../components/columnHeaders/GridColumnGroupHeader';
14
14
  import { GridPinnedColumnPosition, gridColumnPositionsSelector, gridVisiblePinnedColumnDefinitionsSelector } from '../columns';
15
+ import { gridColumnGroupsUnwrappedModelSelector } from '../columnGrouping/gridColumnGroupsSelector';
15
16
  import { GridScrollbarFillerCell as ScrollbarFiller } from '../../../components/GridScrollbarFillerCell';
16
17
  import { getPinnedCellOffset } from '../../../internals/utils/getPinnedCellOffset';
17
18
  import { GridColumnHeaderSeparatorSides } from '../../../components/columnHeaders/GridColumnHeaderSeparator';
@@ -44,8 +45,9 @@ export const useGridColumnHeaders = props => {
44
45
  const apiRef = useGridPrivateApiContext();
45
46
  const theme = useTheme();
46
47
  const rootProps = useGridRootProps();
47
- const hasVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
48
48
  const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
49
+ const hasVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
50
+ const columnGroupsModel = useGridSelector(apiRef, gridColumnGroupsUnwrappedModelSelector);
49
51
  const columnPositions = useGridSelector(apiRef, gridColumnPositionsSelector);
50
52
  const renderContext = useGridSelector(apiRef, gridRenderContextColumnsSelector);
51
53
  const pinnedColumns = useGridSelector(apiRef, gridVisiblePinnedColumnDefinitionsSelector);
@@ -214,13 +216,13 @@ export const useGridColumnHeaders = props => {
214
216
  } = columnsToRender;
215
217
  const rowStructure = columnGroupsHeaderStructure[depth];
216
218
  const firstColumnFieldToRender = visibleColumns[firstColumnToRender].field;
217
- const firstGroupToRender = apiRef.current.getColumnGroupPath(firstColumnFieldToRender)[depth] ?? null;
219
+ const firstGroupToRender = columnGroupsModel[firstColumnFieldToRender]?.[depth] ?? null;
218
220
  const firstGroupIndex = rowStructure.findIndex(({
219
221
  groupId,
220
222
  columnFields
221
223
  }) => groupId === firstGroupToRender && columnFields.includes(firstColumnFieldToRender));
222
224
  const lastColumnFieldToRender = visibleColumns[lastColumnToRender - 1].field;
223
- const lastGroupToRender = apiRef.current.getColumnGroupPath(lastColumnFieldToRender)[depth] ?? null;
225
+ const lastGroupToRender = columnGroupsModel[lastColumnFieldToRender]?.[depth] ?? null;
224
226
  const lastGroupIndex = rowStructure.findIndex(({
225
227
  groupId,
226
228
  columnFields
@@ -550,7 +550,11 @@ export const useGridRowEditing = (apiRef, props) => {
550
550
  const copyOfPrevRowModesModel = prevRowModesModel.current;
551
551
  prevRowModesModel.current = deepClone(rowModesModel); // Do a deep-clone because the attributes might be changed later
552
552
 
553
- Object.entries(rowModesModel).forEach(([id, params]) => {
553
+ const ids = new Set([...Object.keys(rowModesModel), ...Object.keys(copyOfPrevRowModesModel)]);
554
+ Array.from(ids).forEach(id => {
555
+ const params = rowModesModel[id] ?? {
556
+ mode: GridRowModes.View
557
+ };
554
558
  const prevMode = copyOfPrevRowModesModel[id]?.mode || GridRowModes.View;
555
559
  const originalId = idToIdLookup[id] ?? id;
556
560
  if (params.mode === GridRowModes.Edit && prevMode === GridRowModes.View) {
@@ -252,7 +252,7 @@ export const useGridFocus = (apiRef, props) => {
252
252
  apiRef.current.setColumnGroupHeaderFocus(fields[0], depth, event);
253
253
  }, [apiRef]);
254
254
  const handleBlur = React.useCallback((_, event) => {
255
- if (event.relatedTarget?.className.includes(gridClasses.columnHeader)) {
255
+ if (event.relatedTarget?.getAttribute('class')?.includes(gridClasses.columnHeader)) {
256
256
  return;
257
257
  }
258
258
  logger.debug(`Clearing focus`);
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.3.2
2
+ * @mui/x-data-grid v7.5.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -2,23 +2,20 @@ import { isNumber } from '../../utils/utils';
2
2
  import { GridSignature } from '../../hooks/utils/useGridApiEventHandler';
3
3
  export const propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.paginationMode === 'client' && props.paginationMeta != null && ['MUI X: Usage of the `paginationMeta` prop with client-side pagination (`paginationMode="client"`) has no effect.', '`paginationMeta` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.signature === GridSignature.DataGrid && props.paginationMode === 'client' && isNumber(props.rowCount) && ['MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect.', '`rowCount` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.paginationMode === 'server' && props.rowCount == null && ["MUI X: The `rowCount` prop must be passed using `paginationMode='server'`", 'For more detail, see http://mui.com/components/data-grid/pagination/#index-based-pagination'].join('\n') || undefined];
4
4
  const warnedOnceCache = new Set();
5
- const warnOnce = message => {
5
+ function warnOnce(message) {
6
6
  if (!warnedOnceCache.has(message)) {
7
7
  console.error(message);
8
8
  warnedOnceCache.add(message);
9
9
  }
10
- };
11
- export const validateProps = (props, validators) => {
12
- if (process.env.NODE_ENV === 'production') {
13
- return;
14
- }
10
+ }
11
+ export function validateProps(props, validators) {
15
12
  validators.forEach(validator => {
16
13
  const warning = validator(props);
17
14
  if (warning) {
18
15
  warnOnce(warning);
19
16
  }
20
17
  });
21
- };
22
- export const clearWarningsCache = () => {
18
+ }
19
+ export function clearWarningsCache() {
23
20
  warnedOnceCache.clear();
24
- };
21
+ }
@@ -140,10 +140,10 @@ const esESGrid = {
140
140
  rowReorderingHeaderName: 'Reordenar filas',
141
141
  // Aggregation
142
142
  aggregationMenuItemHeader: 'Agregación',
143
- aggregationFunctionLabelSum: 'sum',
144
- aggregationFunctionLabelAvg: 'avg',
145
- aggregationFunctionLabelMin: 'min',
146
- aggregationFunctionLabelMax: 'max',
143
+ aggregationFunctionLabelSum: 'suma',
144
+ aggregationFunctionLabelAvg: 'promedio',
145
+ aggregationFunctionLabelMin: 'mínimo',
146
+ aggregationFunctionLabelMax: 'máximo',
147
147
  aggregationFunctionLabelSize: 'tamaño'
148
148
  };
149
149
  export const esES = getGridLocalization(esESGrid, esESCore);
@@ -30,11 +30,10 @@ const nbNOGrid = {
30
30
  toolbarExportPrint: 'Skriv ut',
31
31
  toolbarExportExcel: 'Last ned som Excel',
32
32
  // Columns management text
33
- // columnsManagementSearchTitle: 'Search',
34
- // columnsManagementNoColumns: 'No columns',
35
- // columnsManagementShowHideAllText: 'Show/Hide All',
36
- // columnsManagementReset: 'Reset',
37
-
33
+ columnsManagementSearchTitle: 'Søk',
34
+ columnsManagementNoColumns: 'Ingen kolonner',
35
+ columnsManagementShowHideAllText: 'Vis/skjul alle',
36
+ columnsManagementReset: 'Nullstill',
38
37
  // Filter panel text
39
38
  filterPanelAddFilter: 'Legg til filter',
40
39
  filterPanelRemoveAll: 'Fjern alle',
@@ -17,13 +17,18 @@ var _propValidation = require("../internals/utils/propValidation");
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
18
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
19
19
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
- const propValidators = [..._propValidation.propValidatorsDataGrid,
21
- // Only validate in MIT version
22
- props => props.columns && props.columns.some(column => column.resizable) && [`MUI X: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n') || undefined];
20
+ let propValidators;
21
+ if (process.env.NODE_ENV !== 'production') {
22
+ propValidators = [..._propValidation.propValidatorsDataGrid,
23
+ // Only validate in MIT version
24
+ props => props.columns && props.columns.some(column => column.resizable) && [`MUI X: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n') || undefined];
25
+ }
23
26
  const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref) {
24
27
  const props = (0, _useDataGridProps.useDataGridProps)(inProps);
25
28
  const privateApiRef = (0, _useDataGridComponent.useDataGridComponent)(props.apiRef, props);
26
- (0, _propValidation.validateProps)(props, propValidators);
29
+ if (process.env.NODE_ENV !== 'production') {
30
+ (0, _propValidation.validateProps)(props, propValidators);
31
+ }
27
32
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridContextProvider.GridContextProvider, {
28
33
  privateApiRef: privateApiRef,
29
34
  props: props,
@@ -19,6 +19,7 @@ var _virtualization = require("../virtualization");
19
19
  var _useGridVirtualScroller = require("../virtualization/useGridVirtualScroller");
20
20
  var _GridColumnGroupHeader = require("../../../components/columnHeaders/GridColumnGroupHeader");
21
21
  var _columns = require("../columns");
22
+ var _gridColumnGroupsSelector = require("../columnGrouping/gridColumnGroupsSelector");
22
23
  var _GridScrollbarFillerCell = require("../../../components/GridScrollbarFillerCell");
23
24
  var _getPinnedCellOffset = require("../../../internals/utils/getPinnedCellOffset");
24
25
  var _GridColumnHeaderSeparator = require("../../../components/columnHeaders/GridColumnHeaderSeparator");
@@ -53,8 +54,9 @@ const useGridColumnHeaders = props => {
53
54
  const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
54
55
  const theme = (0, _styles.useTheme)();
55
56
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
56
- const hasVirtualization = (0, _utils.useGridSelector)(apiRef, _virtualization.gridVirtualizationColumnEnabledSelector);
57
57
  const dimensions = (0, _utils.useGridSelector)(apiRef, _dimensions.gridDimensionsSelector);
58
+ const hasVirtualization = (0, _utils.useGridSelector)(apiRef, _virtualization.gridVirtualizationColumnEnabledSelector);
59
+ const columnGroupsModel = (0, _utils.useGridSelector)(apiRef, _gridColumnGroupsSelector.gridColumnGroupsUnwrappedModelSelector);
58
60
  const columnPositions = (0, _utils.useGridSelector)(apiRef, _columns.gridColumnPositionsSelector);
59
61
  const renderContext = (0, _utils.useGridSelector)(apiRef, _virtualization.gridRenderContextColumnsSelector);
60
62
  const pinnedColumns = (0, _utils.useGridSelector)(apiRef, _columns.gridVisiblePinnedColumnDefinitionsSelector);
@@ -223,13 +225,13 @@ const useGridColumnHeaders = props => {
223
225
  } = columnsToRender;
224
226
  const rowStructure = columnGroupsHeaderStructure[depth];
225
227
  const firstColumnFieldToRender = visibleColumns[firstColumnToRender].field;
226
- const firstGroupToRender = apiRef.current.getColumnGroupPath(firstColumnFieldToRender)[depth] ?? null;
228
+ const firstGroupToRender = columnGroupsModel[firstColumnFieldToRender]?.[depth] ?? null;
227
229
  const firstGroupIndex = rowStructure.findIndex(({
228
230
  groupId,
229
231
  columnFields
230
232
  }) => groupId === firstGroupToRender && columnFields.includes(firstColumnFieldToRender));
231
233
  const lastColumnFieldToRender = visibleColumns[lastColumnToRender - 1].field;
232
- const lastGroupToRender = apiRef.current.getColumnGroupPath(lastColumnFieldToRender)[depth] ?? null;
234
+ const lastGroupToRender = columnGroupsModel[lastColumnFieldToRender]?.[depth] ?? null;
233
235
  const lastGroupIndex = rowStructure.findIndex(({
234
236
  groupId,
235
237
  columnFields
@@ -559,7 +559,11 @@ const useGridRowEditing = (apiRef, props) => {
559
559
  const copyOfPrevRowModesModel = prevRowModesModel.current;
560
560
  prevRowModesModel.current = (0, _utils2.deepClone)(rowModesModel); // Do a deep-clone because the attributes might be changed later
561
561
 
562
- Object.entries(rowModesModel).forEach(([id, params]) => {
562
+ const ids = new Set([...Object.keys(rowModesModel), ...Object.keys(copyOfPrevRowModesModel)]);
563
+ Array.from(ids).forEach(id => {
564
+ const params = rowModesModel[id] ?? {
565
+ mode: _gridEditRowModel.GridRowModes.View
566
+ };
563
567
  const prevMode = copyOfPrevRowModesModel[id]?.mode || _gridEditRowModel.GridRowModes.View;
564
568
  const originalId = idToIdLookup[id] ?? id;
565
569
  if (params.mode === _gridEditRowModel.GridRowModes.Edit && prevMode === _gridEditRowModel.GridRowModes.View) {
@@ -262,7 +262,7 @@ const useGridFocus = (apiRef, props) => {
262
262
  apiRef.current.setColumnGroupHeaderFocus(fields[0], depth, event);
263
263
  }, [apiRef]);
264
264
  const handleBlur = React.useCallback((_, event) => {
265
- if (event.relatedTarget?.className.includes(_gridClasses.gridClasses.columnHeader)) {
265
+ if (event.relatedTarget?.getAttribute('class')?.includes(_gridClasses.gridClasses.columnHeader)) {
266
266
  return;
267
267
  }
268
268
  logger.debug(`Clearing focus`);
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.3.2
2
+ * @mui/x-data-grid v7.5.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -3,30 +3,27 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.validateProps = exports.propValidatorsDataGrid = exports.clearWarningsCache = void 0;
6
+ exports.clearWarningsCache = clearWarningsCache;
7
+ exports.propValidatorsDataGrid = void 0;
8
+ exports.validateProps = validateProps;
7
9
  var _utils = require("../../utils/utils");
8
10
  var _useGridApiEventHandler = require("../../hooks/utils/useGridApiEventHandler");
9
11
  const propValidatorsDataGrid = exports.propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.paginationMode === 'client' && props.paginationMeta != null && ['MUI X: Usage of the `paginationMeta` prop with client-side pagination (`paginationMode="client"`) has no effect.', '`paginationMeta` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.signature === _useGridApiEventHandler.GridSignature.DataGrid && props.paginationMode === 'client' && (0, _utils.isNumber)(props.rowCount) && ['MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect.', '`rowCount` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.paginationMode === 'server' && props.rowCount == null && ["MUI X: The `rowCount` prop must be passed using `paginationMode='server'`", 'For more detail, see http://mui.com/components/data-grid/pagination/#index-based-pagination'].join('\n') || undefined];
10
12
  const warnedOnceCache = new Set();
11
- const warnOnce = message => {
13
+ function warnOnce(message) {
12
14
  if (!warnedOnceCache.has(message)) {
13
15
  console.error(message);
14
16
  warnedOnceCache.add(message);
15
17
  }
16
- };
17
- const validateProps = (props, validators) => {
18
- if (process.env.NODE_ENV === 'production') {
19
- return;
20
- }
18
+ }
19
+ function validateProps(props, validators) {
21
20
  validators.forEach(validator => {
22
21
  const warning = validator(props);
23
22
  if (warning) {
24
23
  warnOnce(warning);
25
24
  }
26
25
  });
27
- };
28
- exports.validateProps = validateProps;
29
- const clearWarningsCache = () => {
26
+ }
27
+ function clearWarningsCache() {
30
28
  warnedOnceCache.clear();
31
- };
32
- exports.clearWarningsCache = clearWarningsCache;
29
+ }
@@ -146,10 +146,10 @@ const esESGrid = {
146
146
  rowReorderingHeaderName: 'Reordenar filas',
147
147
  // Aggregation
148
148
  aggregationMenuItemHeader: 'Agregación',
149
- aggregationFunctionLabelSum: 'sum',
150
- aggregationFunctionLabelAvg: 'avg',
151
- aggregationFunctionLabelMin: 'min',
152
- aggregationFunctionLabelMax: 'max',
149
+ aggregationFunctionLabelSum: 'suma',
150
+ aggregationFunctionLabelAvg: 'promedio',
151
+ aggregationFunctionLabelMin: 'mínimo',
152
+ aggregationFunctionLabelMax: 'máximo',
153
153
  aggregationFunctionLabelSize: 'tamaño'
154
154
  };
155
155
  const esES = exports.esES = (0, _getGridLocalization.getGridLocalization)(esESGrid, _locale.esES);
@@ -36,11 +36,10 @@ const nbNOGrid = {
36
36
  toolbarExportPrint: 'Skriv ut',
37
37
  toolbarExportExcel: 'Last ned som Excel',
38
38
  // Columns management text
39
- // columnsManagementSearchTitle: 'Search',
40
- // columnsManagementNoColumns: 'No columns',
41
- // columnsManagementShowHideAllText: 'Show/Hide All',
42
- // columnsManagementReset: 'Reset',
43
-
39
+ columnsManagementSearchTitle: 'Søk',
40
+ columnsManagementNoColumns: 'Ingen kolonner',
41
+ columnsManagementShowHideAllText: 'Vis/skjul alle',
42
+ columnsManagementReset: 'Nullstill',
44
43
  // Filter panel text
45
44
  filterPanelAddFilter: 'Legg til filter',
46
45
  filterPanelRemoveAll: 'Fjern alle',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "7.3.2",
3
+ "version": "7.5.0",
4
4
  "description": "The Community plan edition of the Data Grid components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -37,10 +37,10 @@
37
37
  "directory": "packages/x-data-grid"
38
38
  },
39
39
  "dependencies": {
40
- "@babel/runtime": "^7.24.0",
40
+ "@babel/runtime": "^7.24.5",
41
41
  "@mui/system": "^5.15.14",
42
42
  "@mui/utils": "^5.15.14",
43
- "clsx": "^2.1.0",
43
+ "clsx": "^2.1.1",
44
44
  "prop-types": "^15.8.1",
45
45
  "reselect": "^4.1.8"
46
46
  },