@mui/x-data-grid 6.1.0 → 6.2.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +53 -1
  2. package/components/GridPagination.d.ts +2 -2
  3. package/components/panel/GridPanel.d.ts +1 -1
  4. package/components/panel/filterPanel/GridFilterInputBoolean.js +37 -29
  5. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +34 -30
  6. package/hooks/features/rowSelection/useGridRowSelection.js +5 -26
  7. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +36 -16
  8. package/index.js +1 -1
  9. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +37 -29
  10. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +34 -30
  11. package/legacy/hooks/features/rowSelection/useGridRowSelection.js +5 -24
  12. package/legacy/index.js +1 -1
  13. package/legacy/locales/frFR.js +7 -9
  14. package/legacy/locales/urPK.js +6 -6
  15. package/legacy/utils/utils.js +1 -1
  16. package/locales/frFR.js +7 -9
  17. package/locales/urPK.js +6 -6
  18. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +36 -28
  19. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +33 -29
  20. package/modern/hooks/features/rowSelection/useGridRowSelection.js +5 -26
  21. package/modern/index.js +1 -1
  22. package/modern/locales/frFR.js +7 -9
  23. package/modern/locales/urPK.js +6 -6
  24. package/modern/utils/utils.js +1 -1
  25. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +36 -28
  26. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +32 -29
  27. package/node/hooks/features/rowSelection/useGridRowSelection.js +4 -25
  28. package/node/index.js +1 -1
  29. package/node/locales/frFR.js +7 -9
  30. package/node/locales/urPK.js +6 -6
  31. package/node/utils/utils.js +1 -1
  32. package/package.json +1 -1
  33. package/utils/utils.d.ts +1 -1
  34. package/utils/utils.js +1 -1
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["item", "applyValue", "apiRef", "focusElementRef"];
4
4
  import * as React from 'react';
5
+ import { unstable_useId as useId } from '@mui/utils';
5
6
  import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
6
7
  import { jsx as _jsx } from "react/jsx-runtime";
7
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -15,6 +16,8 @@ export function GridFilterInputBoolean(props) {
15
16
  others = _objectWithoutPropertiesLoose(props, _excluded);
16
17
  const [filterValueState, setFilterValueState] = React.useState(item.value || '');
17
18
  const rootProps = useGridRootProps();
19
+ const labelId = useId();
20
+ const selectId = useId();
18
21
  const baseSelectProps = rootProps.slotProps?.baseSelect || {};
19
22
  const isSelectNative = baseSelectProps.native ?? true;
20
23
  const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};
@@ -28,34 +31,39 @@ export function GridFilterInputBoolean(props) {
28
31
  React.useEffect(() => {
29
32
  setFilterValueState(item.value || '');
30
33
  }, [item.value]);
31
- return /*#__PURE__*/_jsxs(rootProps.slots.baseTextField, _extends({
32
- // TODO: use baseSelect slot
33
- label: apiRef.current.getLocaleText('filterPanelInputLabel'),
34
- value: filterValueState,
35
- onChange: onFilterChange,
36
- select: true,
37
- variant: "standard",
38
- SelectProps: _extends({
34
+ const label = apiRef.current.getLocaleText('filterPanelInputLabel');
35
+ return /*#__PURE__*/_jsxs(React.Fragment, {
36
+ children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, rootProps.slotProps?.baseInputLabel, {
37
+ id: labelId,
38
+ shrink: true,
39
+ variant: "standard",
40
+ children: label
41
+ })), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
42
+ labelId: labelId,
43
+ id: selectId,
44
+ label: label,
45
+ value: filterValueState,
46
+ onChange: onFilterChange,
47
+ variant: "standard",
39
48
  native: isSelectNative,
40
- displayEmpty: true
41
- }, rootProps.slotProps?.baseSelect),
42
- InputLabelProps: {
43
- shrink: true
44
- },
45
- inputRef: focusElementRef
46
- }, others, rootProps.slotProps?.baseTextField, {
47
- children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
48
- native: isSelectNative,
49
- value: "",
50
- children: apiRef.current.getLocaleText('filterValueAny')
51
- })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
52
- native: isSelectNative,
53
- value: "true",
54
- children: apiRef.current.getLocaleText('filterValueTrue')
55
- })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
56
- native: isSelectNative,
57
- value: "false",
58
- children: apiRef.current.getLocaleText('filterValueFalse')
49
+ displayEmpty: true,
50
+ inputProps: {
51
+ ref: focusElementRef
52
+ }
53
+ }, others, baseSelectProps, {
54
+ children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
55
+ native: isSelectNative,
56
+ value: "",
57
+ children: apiRef.current.getLocaleText('filterValueAny')
58
+ })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
59
+ native: isSelectNative,
60
+ value: "true",
61
+ children: apiRef.current.getLocaleText('filterValueTrue')
62
+ })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
63
+ native: isSelectNative,
64
+ value: "false",
65
+ children: apiRef.current.getLocaleText('filterValueFalse')
66
+ }))]
59
67
  }))]
60
- }));
68
+ });
61
69
  }
@@ -8,6 +8,7 @@ import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
8
8
  import { getValueFromValueOptions, isSingleSelectColDef } from './filterPanelUtils';
9
9
  import { createElement as _createElement } from "react";
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
11
12
  const renderSingleSelectOptions = ({
12
13
  column: {
13
14
  valueOptions,
@@ -45,10 +46,9 @@ function GridFilterInputSingleSelect(props) {
45
46
  others = _objectWithoutPropertiesLoose(props, _excluded);
46
47
  const [filterValueState, setFilterValueState] = React.useState(item.value ?? '');
47
48
  const id = useId();
49
+ const labelId = useId();
48
50
  const rootProps = useGridRootProps();
49
- const baseSelectProps = rootProps.slotProps?.baseSelect || {};
50
- const isSelectNative = baseSelectProps.native ?? true;
51
- const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};
51
+ const isSelectNative = rootProps.slotProps?.baseSelect?.native ?? true;
52
52
  let resolvedColumn = null;
53
53
  if (item.field) {
54
54
  const column = apiRef.current.getColumn(item.field);
@@ -99,33 +99,37 @@ function GridFilterInputSingleSelect(props) {
99
99
  if (!isSingleSelectColDef(resolvedColumn)) {
100
100
  return null;
101
101
  }
102
- return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
103
- // TODO: use baseSelect slot
104
- id: id,
105
- label: apiRef.current.getLocaleText('filterPanelInputLabel'),
106
- placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
107
- value: filterValueState,
108
- onChange: onFilterChange,
109
- variant: "standard",
110
- type: type || 'text',
111
- InputLabelProps: {
112
- shrink: true
113
- },
114
- inputRef: focusElementRef,
115
- select: true,
116
- SelectProps: _extends({
102
+ const label = apiRef.current.getLocaleText('filterPanelInputLabel');
103
+ return /*#__PURE__*/_jsxs(React.Fragment, {
104
+ children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, rootProps.slotProps?.baseInputLabel, {
105
+ id: labelId,
106
+ shrink: true,
107
+ variant: "standard",
108
+ children: label
109
+ })), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
110
+ id: id,
111
+ label: label,
112
+ labelId: labelId,
113
+ value: filterValueState,
114
+ onChange: onFilterChange,
115
+ variant: "standard",
116
+ type: type || 'text',
117
+ inputProps: {
118
+ ref: focusElementRef,
119
+ placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder')
120
+ },
117
121
  native: isSelectNative
118
- }, rootProps.slotProps?.baseSelect)
119
- }, others, rootProps.slotProps?.baseTextField, {
120
- children: renderSingleSelectOptions({
121
- column: resolvedColumn,
122
- OptionComponent: rootProps.slots.baseSelectOption,
123
- getOptionLabel,
124
- getOptionValue,
125
- isSelectNative,
126
- baseSelectOptionProps
127
- })
128
- }));
122
+ }, others, rootProps.slotProps?.baseSelect, {
123
+ children: renderSingleSelectOptions({
124
+ column: resolvedColumn,
125
+ OptionComponent: rootProps.slots.baseSelectOption,
126
+ getOptionLabel,
127
+ getOptionValue,
128
+ isSelectNative,
129
+ baseSelectOptionProps: rootProps.slotProps?.baseSelectOption
130
+ })
131
+ }))]
132
+ });
129
133
  }
130
134
  process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes = {
131
135
  // ----------------------------- Warning --------------------------------
@@ -11,7 +11,7 @@ import { gridExpandedSortedRowIdsSelector } from '../filter/gridFilterSelector';
11
11
  import { GRID_CHECKBOX_SELECTION_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from '../../../colDef';
12
12
  import { GridCellModes } from '../../../models/gridEditRowModel';
13
13
  import { isKeyboardEvent, isNavigationKey } from '../../../utils/keyboardUtils';
14
- import { getVisibleRows, useGridVisibleRows } from '../../utils/useGridVisibleRows';
14
+ import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
15
15
  import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPanelToggleField';
16
16
  import { gridClasses } from '../../../constants/gridClasses';
17
17
  const getSelectionModelPropValue = (selectionModelProp, prevSelectionModel) => {
@@ -58,8 +58,6 @@ export const useGridRowSelection = (apiRef, props) => {
58
58
  checkboxSelection,
59
59
  disableMultipleRowSelection,
60
60
  disableRowSelectionOnClick,
61
- pagination,
62
- paginationMode,
63
61
  isRowSelectable: propIsRowSelectable
64
62
  } = props;
65
63
  const canHaveMultipleSelection = !disableMultipleRowSelection || checkboxSelection;
@@ -375,32 +373,13 @@ export const useGridRowSelection = (apiRef, props) => {
375
373
  }
376
374
  }, [apiRef, isRowSelectable, isStateControlled, props.rowSelection]);
377
375
  React.useEffect(() => {
378
- if (!props.rowSelection) {
376
+ if (!props.rowSelection || isStateControlled) {
379
377
  return;
380
378
  }
381
379
  const currentSelection = gridRowSelectionStateSelector(apiRef.current.state);
382
380
  if (!canHaveMultipleSelection && currentSelection.length > 1) {
383
- const {
384
- rows: currentPageRows
385
- } = getVisibleRows(apiRef, {
386
- pagination,
387
- paginationMode
388
- });
389
- const currentPageRowsLookup = currentPageRows.reduce((acc, {
390
- id
391
- }) => {
392
- acc[id] = true;
393
- return acc;
394
- }, {});
395
- const firstSelectableRow = currentSelection.find(id => {
396
- let isSelectable = true;
397
- if (isRowSelectable) {
398
- isSelectable = isRowSelectable(id);
399
- }
400
- return isSelectable && currentPageRowsLookup[id]; // Check if the row is in the current page
401
- });
402
-
403
- apiRef.current.setRowSelectionModel(firstSelectableRow !== undefined ? [firstSelectableRow] : []);
381
+ // See https://github.com/mui/mui-x/issues/8455
382
+ apiRef.current.setRowSelectionModel([]);
404
383
  }
405
- }, [apiRef, canHaveMultipleSelection, checkboxSelection, disableMultipleRowSelection, isRowSelectable, pagination, paginationMode, props.rowSelection]);
384
+ }, [apiRef, canHaveMultipleSelection, checkboxSelection, isStateControlled, props.rowSelection]);
406
385
  };
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.1.0
2
+ * @mui/x-data-grid v6.2.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -111,15 +111,13 @@ const frFRGrid = {
111
111
  expandDetailPanel: 'Afficher',
112
112
  collapseDetailPanel: 'Masquer',
113
113
  // Row reordering text
114
- rowReorderingHeaderName: 'Positionnement des lignes'
115
-
114
+ rowReorderingHeaderName: 'Positionnement des lignes',
116
115
  // Aggregation
117
- // aggregationMenuItemHeader: 'Aggregation',
118
- // aggregationFunctionLabelSum: 'sum',
119
- // aggregationFunctionLabelAvg: 'avg',
120
- // aggregationFunctionLabelMin: 'min',
121
- // aggregationFunctionLabelMax: 'max',
122
- // aggregationFunctionLabelSize: 'size',
116
+ aggregationMenuItemHeader: 'Agrégation',
117
+ aggregationFunctionLabelSum: 'Somme',
118
+ aggregationFunctionLabelAvg: 'Moyenne',
119
+ aggregationFunctionLabelMin: 'Minimum',
120
+ aggregationFunctionLabelMax: 'Maximum',
121
+ aggregationFunctionLabelSize: "Nombre d'éléments"
123
122
  };
124
-
125
123
  export const frFR = getGridLocalization(frFRGrid, frFRCore);
@@ -113,11 +113,11 @@ const urPKGrid = {
113
113
  // Row reordering text
114
114
  rowReorderingHeaderName: 'قطاروں کی ترتیب تبدیل کریں',
115
115
  // Aggregation
116
- aggregationMenuItemHeader: 'Aggregation',
117
- aggregationFunctionLabelSum: 'sum',
118
- aggregationFunctionLabelAvg: 'avg',
119
- aggregationFunctionLabelMin: 'min',
120
- aggregationFunctionLabelMax: 'max',
121
- aggregationFunctionLabelSize: 'size'
116
+ aggregationMenuItemHeader: 'ایگریگیشن',
117
+ aggregationFunctionLabelSum: 'کل',
118
+ aggregationFunctionLabelAvg: 'اوسط',
119
+ aggregationFunctionLabelMin: 'کم از کم',
120
+ aggregationFunctionLabelMax: 'زیادہ سے زیادہ',
121
+ aggregationFunctionLabelSize: 'سائز'
122
122
  };
123
123
  export const urPK = getGridLocalization(urPKGrid, urPKCore);
@@ -33,7 +33,7 @@ export const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
33
33
  /**
34
34
  * Based on `fast-deep-equal`
35
35
  *
36
- * MIT License
36
+ * MIT License
37
37
  *
38
38
  * Copyright (c) 2017 Evgeny Poberezkin
39
39
  *
@@ -8,6 +8,7 @@ exports.GridFilterInputBoolean = GridFilterInputBoolean;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
+ var _utils = require("@mui/utils");
11
12
  var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  const _excluded = ["item", "applyValue", "apiRef", "focusElementRef"];
@@ -23,6 +24,8 @@ function GridFilterInputBoolean(props) {
23
24
  others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
24
25
  const [filterValueState, setFilterValueState] = React.useState(item.value || '');
25
26
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
27
+ const labelId = (0, _utils.unstable_useId)();
28
+ const selectId = (0, _utils.unstable_useId)();
26
29
  const baseSelectProps = rootProps.slotProps?.baseSelect || {};
27
30
  const isSelectNative = baseSelectProps.native ?? true;
28
31
  const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};
@@ -36,34 +39,39 @@ function GridFilterInputBoolean(props) {
36
39
  React.useEffect(() => {
37
40
  setFilterValueState(item.value || '');
38
41
  }, [item.value]);
39
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(rootProps.slots.baseTextField, (0, _extends2.default)({
40
- // TODO: use baseSelect slot
41
- label: apiRef.current.getLocaleText('filterPanelInputLabel'),
42
- value: filterValueState,
43
- onChange: onFilterChange,
44
- select: true,
45
- variant: "standard",
46
- SelectProps: (0, _extends2.default)({
42
+ const label = apiRef.current.getLocaleText('filterPanelInputLabel');
43
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
44
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseInputLabel, (0, _extends2.default)({}, rootProps.slotProps?.baseInputLabel, {
45
+ id: labelId,
46
+ shrink: true,
47
+ variant: "standard",
48
+ children: label
49
+ })), /*#__PURE__*/(0, _jsxRuntime.jsxs)(rootProps.slots.baseSelect, (0, _extends2.default)({
50
+ labelId: labelId,
51
+ id: selectId,
52
+ label: label,
53
+ value: filterValueState,
54
+ onChange: onFilterChange,
55
+ variant: "standard",
47
56
  native: isSelectNative,
48
- displayEmpty: true
49
- }, rootProps.slotProps?.baseSelect),
50
- InputLabelProps: {
51
- shrink: true
52
- },
53
- inputRef: focusElementRef
54
- }, others, rootProps.slotProps?.baseTextField, {
55
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
56
- native: isSelectNative,
57
- value: "",
58
- children: apiRef.current.getLocaleText('filterValueAny')
59
- })), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
60
- native: isSelectNative,
61
- value: "true",
62
- children: apiRef.current.getLocaleText('filterValueTrue')
63
- })), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
64
- native: isSelectNative,
65
- value: "false",
66
- children: apiRef.current.getLocaleText('filterValueFalse')
57
+ displayEmpty: true,
58
+ inputProps: {
59
+ ref: focusElementRef
60
+ }
61
+ }, others, baseSelectProps, {
62
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
63
+ native: isSelectNative,
64
+ value: "",
65
+ children: apiRef.current.getLocaleText('filterValueAny')
66
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
67
+ native: isSelectNative,
68
+ value: "true",
69
+ children: apiRef.current.getLocaleText('filterValueTrue')
70
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
71
+ native: isSelectNative,
72
+ value: "false",
73
+ children: apiRef.current.getLocaleText('filterValueFalse')
74
+ }))]
67
75
  }))]
68
- }));
76
+ });
69
77
  }
@@ -53,10 +53,9 @@ function GridFilterInputSingleSelect(props) {
53
53
  others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
54
54
  const [filterValueState, setFilterValueState] = React.useState(item.value ?? '');
55
55
  const id = (0, _utils.unstable_useId)();
56
+ const labelId = (0, _utils.unstable_useId)();
56
57
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
57
- const baseSelectProps = rootProps.slotProps?.baseSelect || {};
58
- const isSelectNative = baseSelectProps.native ?? true;
59
- const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};
58
+ const isSelectNative = rootProps.slotProps?.baseSelect?.native ?? true;
60
59
  let resolvedColumn = null;
61
60
  if (item.field) {
62
61
  const column = apiRef.current.getColumn(item.field);
@@ -107,33 +106,37 @@ function GridFilterInputSingleSelect(props) {
107
106
  if (!(0, _filterPanelUtils.isSingleSelectColDef)(resolvedColumn)) {
108
107
  return null;
109
108
  }
110
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTextField, (0, _extends2.default)({
111
- // TODO: use baseSelect slot
112
- id: id,
113
- label: apiRef.current.getLocaleText('filterPanelInputLabel'),
114
- placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
115
- value: filterValueState,
116
- onChange: onFilterChange,
117
- variant: "standard",
118
- type: type || 'text',
119
- InputLabelProps: {
120
- shrink: true
121
- },
122
- inputRef: focusElementRef,
123
- select: true,
124
- SelectProps: (0, _extends2.default)({
109
+ const label = apiRef.current.getLocaleText('filterPanelInputLabel');
110
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
111
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseInputLabel, (0, _extends2.default)({}, rootProps.slotProps?.baseInputLabel, {
112
+ id: labelId,
113
+ shrink: true,
114
+ variant: "standard",
115
+ children: label
116
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelect, (0, _extends2.default)({
117
+ id: id,
118
+ label: label,
119
+ labelId: labelId,
120
+ value: filterValueState,
121
+ onChange: onFilterChange,
122
+ variant: "standard",
123
+ type: type || 'text',
124
+ inputProps: {
125
+ ref: focusElementRef,
126
+ placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder')
127
+ },
125
128
  native: isSelectNative
126
- }, rootProps.slotProps?.baseSelect)
127
- }, others, rootProps.slotProps?.baseTextField, {
128
- children: renderSingleSelectOptions({
129
- column: resolvedColumn,
130
- OptionComponent: rootProps.slots.baseSelectOption,
131
- getOptionLabel,
132
- getOptionValue,
133
- isSelectNative,
134
- baseSelectOptionProps
135
- })
136
- }));
129
+ }, others, rootProps.slotProps?.baseSelect, {
130
+ children: renderSingleSelectOptions({
131
+ column: resolvedColumn,
132
+ OptionComponent: rootProps.slots.baseSelectOption,
133
+ getOptionLabel,
134
+ getOptionValue,
135
+ isSelectNative,
136
+ baseSelectOptionProps: rootProps.slotProps?.baseSelectOption
137
+ })
138
+ }))]
139
+ });
137
140
  }
138
141
  process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes = {
139
142
  // ----------------------------- Warning --------------------------------
@@ -68,8 +68,6 @@ const useGridRowSelection = (apiRef, props) => {
68
68
  checkboxSelection,
69
69
  disableMultipleRowSelection,
70
70
  disableRowSelectionOnClick,
71
- pagination,
72
- paginationMode,
73
71
  isRowSelectable: propIsRowSelectable
74
72
  } = props;
75
73
  const canHaveMultipleSelection = !disableMultipleRowSelection || checkboxSelection;
@@ -385,33 +383,14 @@ const useGridRowSelection = (apiRef, props) => {
385
383
  }
386
384
  }, [apiRef, isRowSelectable, isStateControlled, props.rowSelection]);
387
385
  React.useEffect(() => {
388
- if (!props.rowSelection) {
386
+ if (!props.rowSelection || isStateControlled) {
389
387
  return;
390
388
  }
391
389
  const currentSelection = (0, _gridRowSelectionSelector.gridRowSelectionStateSelector)(apiRef.current.state);
392
390
  if (!canHaveMultipleSelection && currentSelection.length > 1) {
393
- const {
394
- rows: currentPageRows
395
- } = (0, _useGridVisibleRows.getVisibleRows)(apiRef, {
396
- pagination,
397
- paginationMode
398
- });
399
- const currentPageRowsLookup = currentPageRows.reduce((acc, {
400
- id
401
- }) => {
402
- acc[id] = true;
403
- return acc;
404
- }, {});
405
- const firstSelectableRow = currentSelection.find(id => {
406
- let isSelectable = true;
407
- if (isRowSelectable) {
408
- isSelectable = isRowSelectable(id);
409
- }
410
- return isSelectable && currentPageRowsLookup[id]; // Check if the row is in the current page
411
- });
412
-
413
- apiRef.current.setRowSelectionModel(firstSelectableRow !== undefined ? [firstSelectableRow] : []);
391
+ // See https://github.com/mui/mui-x/issues/8455
392
+ apiRef.current.setRowSelectionModel([]);
414
393
  }
415
- }, [apiRef, canHaveMultipleSelection, checkboxSelection, disableMultipleRowSelection, isRowSelectable, pagination, paginationMode, props.rowSelection]);
394
+ }, [apiRef, canHaveMultipleSelection, checkboxSelection, isStateControlled, props.rowSelection]);
416
395
  };
417
396
  exports.useGridRowSelection = useGridRowSelection;
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.1.0
2
+ * @mui/x-data-grid v6.2.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -117,16 +117,14 @@ const frFRGrid = {
117
117
  expandDetailPanel: 'Afficher',
118
118
  collapseDetailPanel: 'Masquer',
119
119
  // Row reordering text
120
- rowReorderingHeaderName: 'Positionnement des lignes'
121
-
120
+ rowReorderingHeaderName: 'Positionnement des lignes',
122
121
  // Aggregation
123
- // aggregationMenuItemHeader: 'Aggregation',
124
- // aggregationFunctionLabelSum: 'sum',
125
- // aggregationFunctionLabelAvg: 'avg',
126
- // aggregationFunctionLabelMin: 'min',
127
- // aggregationFunctionLabelMax: 'max',
128
- // aggregationFunctionLabelSize: 'size',
122
+ aggregationMenuItemHeader: 'Agrégation',
123
+ aggregationFunctionLabelSum: 'Somme',
124
+ aggregationFunctionLabelAvg: 'Moyenne',
125
+ aggregationFunctionLabelMin: 'Minimum',
126
+ aggregationFunctionLabelMax: 'Maximum',
127
+ aggregationFunctionLabelSize: "Nombre d'éléments"
129
128
  };
130
-
131
129
  const frFR = (0, _getGridLocalization.getGridLocalization)(frFRGrid, _locale.frFR);
132
130
  exports.frFR = frFR;
@@ -119,12 +119,12 @@ const urPKGrid = {
119
119
  // Row reordering text
120
120
  rowReorderingHeaderName: 'قطاروں کی ترتیب تبدیل کریں',
121
121
  // Aggregation
122
- aggregationMenuItemHeader: 'Aggregation',
123
- aggregationFunctionLabelSum: 'sum',
124
- aggregationFunctionLabelAvg: 'avg',
125
- aggregationFunctionLabelMin: 'min',
126
- aggregationFunctionLabelMax: 'max',
127
- aggregationFunctionLabelSize: 'size'
122
+ aggregationMenuItemHeader: 'ایگریگیشن',
123
+ aggregationFunctionLabelSum: 'کل',
124
+ aggregationFunctionLabelAvg: 'اوسط',
125
+ aggregationFunctionLabelMin: 'کم از کم',
126
+ aggregationFunctionLabelMax: 'زیادہ سے زیادہ',
127
+ aggregationFunctionLabelSize: 'سائز'
128
128
  };
129
129
  const urPK = (0, _getGridLocalization.getGridLocalization)(urPKGrid, _coreLocales.urPKCore);
130
130
  exports.urPK = urPK;
@@ -47,7 +47,7 @@ const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
47
47
  /**
48
48
  * Based on `fast-deep-equal`
49
49
  *
50
- * MIT License
50
+ * MIT License
51
51
  *
52
52
  * Copyright (c) 2017 Evgeny Poberezkin
53
53
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "6.1.0",
3
+ "version": "6.2.0",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
package/utils/utils.d.ts CHANGED
@@ -11,7 +11,7 @@ export declare const clamp: (value: number, min: number, max: number) => number;
11
11
  /**
12
12
  * Based on `fast-deep-equal`
13
13
  *
14
- * MIT License
14
+ * MIT License
15
15
  *
16
16
  * Copyright (c) 2017 Evgeny Poberezkin
17
17
  *
package/utils/utils.js CHANGED
@@ -33,7 +33,7 @@ export const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
33
33
  /**
34
34
  * Based on `fast-deep-equal`
35
35
  *
36
- * MIT License
36
+ * MIT License
37
37
  *
38
38
  * Copyright (c) 2017 Evgeny Poberezkin
39
39
  *