@mui/x-data-grid 7.4.0 → 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 +93 -0
- package/DataGrid/DataGrid.js +9 -4
- package/hooks/features/editing/useGridRowEditing.js +5 -1
- package/index.js +1 -1
- package/internals/utils/propValidation.d.ts +2 -2
- package/internals/utils/propValidation.js +6 -9
- package/locales/esES.js +4 -4
- package/locales/nbNO.js +4 -5
- package/modern/DataGrid/DataGrid.js +9 -4
- package/modern/hooks/features/editing/useGridRowEditing.js +5 -1
- package/modern/index.js +1 -1
- package/modern/internals/utils/propValidation.js +6 -9
- package/modern/locales/esES.js +4 -4
- package/modern/locales/nbNO.js +4 -5
- package/node/DataGrid/DataGrid.js +9 -4
- package/node/hooks/features/editing/useGridRowEditing.js +5 -1
- package/node/index.js +1 -1
- package/node/internals/utils/propValidation.js +9 -12
- package/node/locales/esES.js +4 -4
- package/node/locales/nbNO.js +4 -5
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,77 @@
|
|
|
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` [](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` [](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` [](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
|
+
|
|
6
77
|
## 7.4.0
|
|
7
78
|
|
|
8
79
|
_May 10, 2024_
|
|
@@ -3346,6 +3417,28 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
|
|
|
3346
3417
|
- [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
|
|
3347
3418
|
- [license] Correctly throw errors (#10924) @oliviertassinari
|
|
3348
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` [](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
|
+
|
|
3349
3442
|
## 6.19.11
|
|
3350
3443
|
|
|
3351
3444
|
_Apr 18, 2024_
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
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,
|
|
@@ -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.
|
|
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) {
|
package/index.js
CHANGED
|
@@ -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
|
|
5
|
-
export declare
|
|
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
|
-
|
|
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
|
|
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
|
|
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: '
|
|
144
|
-
aggregationFunctionLabelAvg: '
|
|
145
|
-
aggregationFunctionLabelMin: '
|
|
146
|
-
aggregationFunctionLabelMax: '
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
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,
|
|
@@ -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.
|
|
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) {
|
package/modern/index.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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
|
|
18
|
+
}
|
|
19
|
+
export function clearWarningsCache() {
|
|
23
20
|
warnedOnceCache.clear();
|
|
24
|
-
}
|
|
21
|
+
}
|
package/modern/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: '
|
|
144
|
-
aggregationFunctionLabelAvg: '
|
|
145
|
-
aggregationFunctionLabelMin: '
|
|
146
|
-
aggregationFunctionLabelMax: '
|
|
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/modern/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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
(
|
|
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,
|
|
@@ -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.
|
|
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) {
|
package/node/index.js
CHANGED
|
@@ -3,30 +3,27 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
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
|
-
|
|
13
|
+
function warnOnce(message) {
|
|
12
14
|
if (!warnedOnceCache.has(message)) {
|
|
13
15
|
console.error(message);
|
|
14
16
|
warnedOnceCache.add(message);
|
|
15
17
|
}
|
|
16
|
-
}
|
|
17
|
-
|
|
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
|
-
|
|
29
|
-
const clearWarningsCache = () => {
|
|
26
|
+
}
|
|
27
|
+
function clearWarningsCache() {
|
|
30
28
|
warnedOnceCache.clear();
|
|
31
|
-
}
|
|
32
|
-
exports.clearWarningsCache = clearWarningsCache;
|
|
29
|
+
}
|
package/node/locales/esES.js
CHANGED
|
@@ -146,10 +146,10 @@ const esESGrid = {
|
|
|
146
146
|
rowReorderingHeaderName: 'Reordenar filas',
|
|
147
147
|
// Aggregation
|
|
148
148
|
aggregationMenuItemHeader: 'Agregación',
|
|
149
|
-
aggregationFunctionLabelSum: '
|
|
150
|
-
aggregationFunctionLabelAvg: '
|
|
151
|
-
aggregationFunctionLabelMin: '
|
|
152
|
-
aggregationFunctionLabelMax: '
|
|
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);
|
package/node/locales/nbNO.js
CHANGED
|
@@ -36,11 +36,10 @@ const nbNOGrid = {
|
|
|
36
36
|
toolbarExportPrint: 'Skriv ut',
|
|
37
37
|
toolbarExportExcel: 'Last ned som Excel',
|
|
38
38
|
// Columns management text
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
+
"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,7 +37,7 @@
|
|
|
37
37
|
"directory": "packages/x-data-grid"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@babel/runtime": "^7.24.
|
|
40
|
+
"@babel/runtime": "^7.24.5",
|
|
41
41
|
"@mui/system": "^5.15.14",
|
|
42
42
|
"@mui/utils": "^5.15.14",
|
|
43
43
|
"clsx": "^2.1.1",
|