@mui/x-data-grid 5.12.3 → 5.13.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 (111) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/DataGrid/DataGrid.js +4 -4
  3. package/colDef/gridStringOperators.d.ts +1 -1
  4. package/colDef/gridStringOperators.js +11 -6
  5. package/components/GridRow.js +1 -1
  6. package/components/cell/GridActionsCellItem.d.ts +2 -2
  7. package/components/panel/GridPanel.d.ts +1 -1
  8. package/components/panel/filterPanel/GridFilterForm.js +11 -4
  9. package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  10. package/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  11. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +3 -8
  12. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +30 -14
  13. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +3 -7
  14. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +32 -14
  15. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  16. package/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  17. package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +6 -3
  18. package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
  19. package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
  20. package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
  21. package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
  22. package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
  23. package/hooks/features/dimensions/useGridDimensions.js +28 -15
  24. package/hooks/features/editRows/useGridCellEditing.new.js +6 -0
  25. package/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  26. package/hooks/features/editRows/useGridRowEditing.new.js +6 -0
  27. package/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  28. package/hooks/features/rows/useGridRows.js +1 -1
  29. package/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  30. package/hooks/utils/useGridApiContext.js +1 -1
  31. package/hooks/utils/useGridRootProps.js +1 -1
  32. package/index.js +1 -1
  33. package/legacy/DataGrid/DataGrid.js +4 -4
  34. package/legacy/colDef/gridStringOperators.js +13 -5
  35. package/legacy/components/GridRow.js +1 -1
  36. package/legacy/components/panel/filterPanel/GridFilterForm.js +9 -4
  37. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  38. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  39. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +22 -7
  40. package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +24 -7
  41. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  42. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  43. package/legacy/hooks/features/dimensions/useGridDimensions.js +27 -15
  44. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +6 -0
  45. package/legacy/hooks/features/editRows/useGridCellEditing.old.js +16 -8
  46. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +6 -0
  47. package/legacy/hooks/features/editRows/useGridRowEditing.old.js +22 -14
  48. package/legacy/hooks/features/rows/useGridRows.js +1 -1
  49. package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  50. package/legacy/hooks/utils/useGridApiContext.js +1 -1
  51. package/legacy/hooks/utils/useGridRootProps.js +1 -1
  52. package/legacy/index.js +1 -1
  53. package/legacy/locales/index.js +2 -0
  54. package/legacy/locales/roRO.js +128 -0
  55. package/legacy/locales/skSK.js +16 -16
  56. package/legacy/utils/keyboardUtils.js +4 -3
  57. package/locales/index.d.ts +2 -0
  58. package/locales/index.js +2 -0
  59. package/locales/roRO.d.ts +2 -0
  60. package/locales/roRO.js +116 -0
  61. package/locales/skSK.js +16 -16
  62. package/modern/DataGrid/DataGrid.js +4 -4
  63. package/modern/colDef/gridStringOperators.js +11 -6
  64. package/modern/components/GridRow.js +1 -1
  65. package/modern/components/panel/filterPanel/GridFilterForm.js +11 -4
  66. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  67. package/modern/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  68. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +20 -8
  69. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +22 -8
  70. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  71. package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  72. package/modern/hooks/features/dimensions/useGridDimensions.js +28 -15
  73. package/modern/hooks/features/editRows/useGridCellEditing.new.js +6 -0
  74. package/modern/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  75. package/modern/hooks/features/editRows/useGridRowEditing.new.js +6 -0
  76. package/modern/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  77. package/modern/hooks/features/rows/useGridRows.js +1 -1
  78. package/modern/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  79. package/modern/hooks/utils/useGridApiContext.js +1 -1
  80. package/modern/hooks/utils/useGridRootProps.js +1 -1
  81. package/modern/index.js +1 -1
  82. package/modern/locales/index.js +2 -0
  83. package/modern/locales/roRO.js +116 -0
  84. package/modern/locales/skSK.js +16 -16
  85. package/modern/utils/keyboardUtils.js +4 -3
  86. package/node/DataGrid/DataGrid.js +4 -4
  87. package/node/colDef/gridStringOperators.js +11 -6
  88. package/node/components/GridRow.js +1 -1
  89. package/node/components/panel/filterPanel/GridFilterForm.js +9 -4
  90. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  91. package/node/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  92. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +31 -15
  93. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +33 -15
  94. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  95. package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  96. package/node/hooks/features/dimensions/useGridDimensions.js +28 -15
  97. package/node/hooks/features/editRows/useGridCellEditing.new.js +6 -0
  98. package/node/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  99. package/node/hooks/features/editRows/useGridRowEditing.new.js +6 -0
  100. package/node/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  101. package/node/hooks/features/rows/useGridRows.js +1 -1
  102. package/node/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  103. package/node/hooks/utils/useGridApiContext.js +1 -1
  104. package/node/hooks/utils/useGridRootProps.js +1 -1
  105. package/node/index.js +1 -1
  106. package/node/locales/index.js +26 -0
  107. package/node/locales/roRO.js +126 -0
  108. package/node/locales/skSK.js +16 -16
  109. package/node/utils/keyboardUtils.js +4 -3
  110. package/package.json +2 -2
  111. package/utils/keyboardUtils.js +4 -3
@@ -45,7 +45,8 @@ var _gridClasses = require("../../../constants/gridClasses");
45
45
 
46
46
  var _jsxRuntime = require("react/jsx-runtime");
47
47
 
48
- const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "multiFilterOperator", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "linkOperators", "columnsSort", "deleteIconProps", "linkOperatorInputProps", "operatorInputProps", "columnInputProps", "valueInputProps", "children"];
48
+ const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "multiFilterOperator", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "linkOperators", "columnsSort", "deleteIconProps", "linkOperatorInputProps", "operatorInputProps", "columnInputProps", "valueInputProps", "children"],
49
+ _excluded2 = ["InputComponentProps"];
49
50
 
50
51
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
51
52
 
@@ -175,6 +176,10 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
175
176
  const baseSelectProps = ((_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect) || {};
176
177
  const isBaseSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
177
178
  const OptionComponent = isBaseSelectNative ? 'option' : _MenuItem.default;
179
+ const {
180
+ InputComponentProps
181
+ } = valueInputProps,
182
+ valueInputPropsOther = (0, _objectWithoutPropertiesLoose2.default)(valueInputProps, _excluded2);
178
183
  const sortedFilterableColumns = React.useMemo(() => {
179
184
  switch (columnsSort) {
180
185
  case 'asc':
@@ -345,14 +350,14 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
345
350
  })), /*#__PURE__*/(0, _jsxRuntime.jsx)(FilterFormValueInput, (0, _extends2.default)({
346
351
  variant: "standard",
347
352
  as: rootProps.components.BaseFormControl
348
- }, baseFormControlProps, valueInputProps, {
349
- className: (0, _clsx.default)(classes.valueInput, baseFormControlProps.className, valueInputProps.className),
353
+ }, baseFormControlProps, valueInputPropsOther, {
354
+ className: (0, _clsx.default)(classes.valueInput, baseFormControlProps.className, valueInputPropsOther.className),
350
355
  children: currentOperator != null && currentOperator.InputComponent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(currentOperator.InputComponent, (0, _extends2.default)({
351
356
  apiRef: apiRef,
352
357
  item: item,
353
358
  applyValue: applyFilterChanges,
354
359
  focusElementRef: valueRef
355
- }, currentOperator.InputComponentProps)) : null
360
+ }, currentOperator.InputComponentProps, InputComponentProps)) : null
356
361
  }))]
357
362
  }));
358
363
  });
@@ -54,8 +54,8 @@ function GridFilterInputBoolean(props) {
54
54
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
55
55
  value: filterValueState,
56
56
  onChange: onFilterChange,
57
- variant: "standard",
58
57
  select: true,
58
+ variant: "standard",
59
59
  SelectProps: (0, _extends2.default)({
60
60
  native: isSelectNative,
61
61
  displayEmpty: true
@@ -79,8 +79,8 @@ function GridFilterInputDate(props) {
79
79
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
80
80
  value: filterValueState,
81
81
  onChange: onFilterChange,
82
- type: type || 'text',
83
82
  variant: "standard",
83
+ type: type || 'text',
84
84
  InputLabelProps: {
85
85
  shrink: true
86
86
  },
@@ -100,7 +100,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
100
100
  // | These PropTypes are generated from the TypeScript type definitions |
101
101
  // | To update them edit the TypeScript types and run "yarn proptypes" |
102
102
  // ----------------------------------------------------------------------
103
- apiRef: _propTypes.default.any.isRequired,
103
+ apiRef: _propTypes.default.shape({
104
+ current: _propTypes.default.object.isRequired
105
+ }).isRequired,
104
106
  applyValue: _propTypes.default.func.isRequired,
105
107
  focusElementRef: _propTypes.default
106
108
  /* @typescript-to-proptypes-ignore */
@@ -19,15 +19,15 @@ var _Autocomplete = _interopRequireWildcard(require("@mui/material/Autocomplete"
19
19
 
20
20
  var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
21
21
 
22
- var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
23
-
24
22
  var _utils = require("@mui/material/utils");
25
23
 
26
24
  var _filterPanelUtils = require("./filterPanelUtils");
27
25
 
26
+ var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
27
+
28
28
  var _jsxRuntime = require("react/jsx-runtime");
29
29
 
30
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
30
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"];
31
31
 
32
32
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
33
 
@@ -42,10 +42,23 @@ function GridFilterInputMultipleSingleSelect(props) {
42
42
  item,
43
43
  applyValue,
44
44
  apiRef,
45
- focusElementRef
45
+ focusElementRef,
46
+ color,
47
+ error,
48
+ helperText,
49
+ size,
50
+ variant = 'standard'
46
51
  } = props,
47
52
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
53
+ const TextFieldProps = {
54
+ color,
55
+ error,
56
+ helperText,
57
+ size,
58
+ variant
59
+ };
48
60
  const id = (0, _utils.unstable_useId)();
61
+ const rootProps = (0, _useGridRootProps.useGridRootProps)();
49
62
  const resolvedColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
50
63
  const resolvedValueOptions = React.useMemo(() => {
51
64
  if (!(resolvedColumn != null && resolvedColumn.valueOptions)) {
@@ -89,7 +102,7 @@ function GridFilterInputMultipleSingleSelect(props) {
89
102
 
90
103
  if (resolvedValueOptions !== undefined) {
91
104
  const itemValueIndexes = item.value.map(element => {
92
- // get the index matching between values and valueoptions
105
+ // get the index matching between values and valueOptions
93
106
  const formattedElement = (0, _filterPanelUtils.getValueFromOption)(element);
94
107
  const index = (resolvedFormattedValueOptions == null ? void 0 : resolvedFormattedValueOptions.findIndex(formatedOption => formatedOption === formattedElement)) || 0;
95
108
  return index;
@@ -128,16 +141,19 @@ function GridFilterInputMultipleSingleSelect(props) {
128
141
  }, getTagProps({
129
142
  index
130
143
  })))),
131
- renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, (0, _extends2.default)({}, params, {
132
- label: apiRef.current.getLocaleText('filterPanelInputLabel'),
133
- placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
134
- InputLabelProps: (0, _extends2.default)({}, params.InputLabelProps, {
135
- shrink: true
136
- }),
137
- inputRef: focusElementRef,
138
- type: 'singleSelect',
139
- variant: "standard"
140
- }))
144
+ renderInput: params => {
145
+ var _rootProps$components;
146
+
147
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseTextField, (0, _extends2.default)({}, params, {
148
+ label: apiRef.current.getLocaleText('filterPanelInputLabel'),
149
+ placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
150
+ InputLabelProps: (0, _extends2.default)({}, params.InputLabelProps, {
151
+ shrink: true
152
+ }),
153
+ inputRef: focusElementRef,
154
+ type: "singleSelect"
155
+ }, TextFieldProps, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseTextField));
156
+ }
141
157
  }, other));
142
158
  }
143
159
 
@@ -19,13 +19,13 @@ var _Autocomplete = _interopRequireDefault(require("@mui/material/Autocomplete")
19
19
 
20
20
  var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
21
21
 
22
- var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
23
-
24
22
  var _utils = require("@mui/material/utils");
25
23
 
24
+ var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
25
+
26
26
  var _jsxRuntime = require("react/jsx-runtime");
27
27
 
28
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
28
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"];
29
29
 
30
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
31
 
@@ -37,11 +37,24 @@ function GridFilterInputMultipleValue(props) {
37
37
  applyValue,
38
38
  type,
39
39
  apiRef,
40
- focusElementRef
40
+ focusElementRef,
41
+ color,
42
+ error,
43
+ helperText,
44
+ size,
45
+ variant
41
46
  } = props,
42
47
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
48
+ const TextFieldProps = {
49
+ color,
50
+ error,
51
+ helperText,
52
+ size,
53
+ variant
54
+ };
43
55
  const [filterValueState, setFilterValueState] = React.useState(item.value || []);
44
56
  const id = (0, _utils.unstable_useId)();
57
+ const rootProps = (0, _useGridRootProps.useGridRootProps)();
45
58
  React.useEffect(() => {
46
59
  var _item$value;
47
60
 
@@ -75,16 +88,19 @@ function GridFilterInputMultipleValue(props) {
75
88
  }, getTagProps({
76
89
  index
77
90
  })))),
78
- renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, (0, _extends2.default)({}, params, {
79
- label: apiRef.current.getLocaleText('filterPanelInputLabel'),
80
- placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
81
- InputLabelProps: (0, _extends2.default)({}, params.InputLabelProps, {
82
- shrink: true
83
- }),
84
- inputRef: focusElementRef,
85
- type: type || 'text',
86
- variant: "standard"
87
- }))
91
+ renderInput: params => {
92
+ var _rootProps$components;
93
+
94
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseTextField, (0, _extends2.default)({}, params, {
95
+ label: apiRef.current.getLocaleText('filterPanelInputLabel'),
96
+ placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
97
+ InputLabelProps: (0, _extends2.default)({}, params.InputLabelProps, {
98
+ shrink: true
99
+ }),
100
+ inputRef: focusElementRef,
101
+ type: type || 'text'
102
+ }, TextFieldProps, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseTextField));
103
+ }
88
104
  }, other));
89
105
  }
90
106
 
@@ -93,7 +109,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes =
93
109
  // | These PropTypes are generated from the TypeScript type definitions |
94
110
  // | To update them edit the TypeScript types and run "yarn proptypes" |
95
111
  // ----------------------------------------------------------------------
96
- apiRef: _propTypes.default.any.isRequired,
112
+ apiRef: _propTypes.default.shape({
113
+ current: _propTypes.default.object.isRequired
114
+ }).isRequired,
97
115
  applyValue: _propTypes.default.func.isRequired,
98
116
  focusElementRef: _propTypes.default
99
117
  /* @typescript-to-proptypes-ignore */
@@ -74,6 +74,10 @@ function GridFilterInputSingleSelect(props) {
74
74
  const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
75
75
  const currentColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
76
76
  const currentValueOptions = React.useMemo(() => {
77
+ if (currentColumn === null) {
78
+ return undefined;
79
+ }
80
+
77
81
  return typeof currentColumn.valueOptions === 'function' ? currentColumn.valueOptions({
78
82
  field: currentColumn.field
79
83
  }) : currentColumn.valueOptions;
@@ -115,8 +119,8 @@ function GridFilterInputSingleSelect(props) {
115
119
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
116
120
  value: filterValueState,
117
121
  onChange: onFilterChange,
118
- type: type || 'text',
119
122
  variant: "standard",
123
+ type: type || 'text',
120
124
  InputLabelProps: {
121
125
  shrink: true
122
126
  },
@@ -135,7 +139,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
135
139
  // | These PropTypes are generated from the TypeScript type definitions |
136
140
  // | To update them edit the TypeScript types and run "yarn proptypes" |
137
141
  // ----------------------------------------------------------------------
138
- apiRef: _propTypes.default.any.isRequired,
142
+ apiRef: _propTypes.default.shape({
143
+ current: _propTypes.default.object.isRequired
144
+ }).isRequired,
139
145
  applyValue: _propTypes.default.func.isRequired,
140
146
  focusElementRef: _propTypes.default
141
147
  /* @typescript-to-proptypes-ignore */
@@ -141,8 +141,8 @@ function GridFilterInputValue(props) {
141
141
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
142
142
  value: filterValueState,
143
143
  onChange: onFilterChange,
144
- type: type || 'text',
145
144
  variant: "standard",
145
+ type: type || 'text',
146
146
  InputProps: InputProps,
147
147
  InputLabelProps: {
148
148
  shrink: true
@@ -156,7 +156,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
156
156
  // | These PropTypes are generated from the TypeScript type definitions |
157
157
  // | To update them edit the TypeScript types and run "yarn proptypes" |
158
158
  // ----------------------------------------------------------------------
159
- apiRef: _propTypes.default.any.isRequired,
159
+ apiRef: _propTypes.default.shape({
160
+ current: _propTypes.default.object.isRequired
161
+ }).isRequired,
160
162
  applyValue: _propTypes.default.func.isRequired,
161
163
  focusElementRef: _propTypes.default
162
164
  /* @typescript-to-proptypes-ignore */
@@ -92,21 +92,34 @@ function useGridDimensions(apiRef, props) {
92
92
  rootElement.removeChild(scrollDiv);
93
93
  }
94
94
 
95
- const viewportOuterSize = {
96
- width: rootDimensionsRef.current.width,
97
- height: props.autoHeight ? rowsMeta.currentPageTotalHeight : rootDimensionsRef.current.height - headerHeight
98
- };
99
- const {
100
- hasScrollX,
101
- hasScrollY
102
- } = hasScroll({
103
- content: {
104
- width: Math.round(columnsTotalWidth),
105
- height: rowsMeta.currentPageTotalHeight
106
- },
107
- container: viewportOuterSize,
108
- scrollBarSize
109
- });
95
+ let viewportOuterSize;
96
+ let hasScrollX;
97
+ let hasScrollY;
98
+
99
+ if (props.autoHeight) {
100
+ hasScrollY = false;
101
+ hasScrollX = Math.round(columnsTotalWidth) > rootDimensionsRef.current.width;
102
+ viewportOuterSize = {
103
+ width: rootDimensionsRef.current.width,
104
+ height: rowsMeta.currentPageTotalHeight + (hasScrollX ? scrollBarSize : 0)
105
+ };
106
+ } else {
107
+ viewportOuterSize = {
108
+ width: rootDimensionsRef.current.width,
109
+ height: rootDimensionsRef.current.height - headerHeight
110
+ };
111
+ const scrollInformation = hasScroll({
112
+ content: {
113
+ width: Math.round(columnsTotalWidth),
114
+ height: rowsMeta.currentPageTotalHeight
115
+ },
116
+ container: viewportOuterSize,
117
+ scrollBarSize
118
+ });
119
+ hasScrollY = scrollInformation.hasScrollY;
120
+ hasScrollX = scrollInformation.hasScrollX;
121
+ }
122
+
110
123
  const viewportInnerSize = {
111
124
  width: viewportOuterSize.width - (hasScrollY ? scrollBarSize : 0),
112
125
  height: viewportOuterSize.height - (hasScrollX ? scrollBarSize : 0)
@@ -95,6 +95,12 @@ const useGridCellEditing = (apiRef, props) => {
95
95
  }, [apiRef]);
96
96
  const handleCellKeyDown = React.useCallback((params, event) => {
97
97
  if (params.cellMode === _gridEditRowModel.GridCellModes.Edit) {
98
+ // Wait until IME is settled for Asian languages like Japanese and Chinese
99
+ // TODO: `event.which` is depricated but this is a temporary workaround
100
+ if (event.which === 229) {
101
+ return;
102
+ }
103
+
98
104
  let reason;
99
105
 
100
106
  if (event.key === 'Escape') {
@@ -199,6 +199,12 @@ const useCellEditing = (apiRef, props) => {
199
199
  };
200
200
  (0, _useGridApiMethod.useGridApiMethod)(apiRef, cellEditingApi, 'EditRowApi');
201
201
  const handleCellKeyDown = React.useCallback(async (params, event) => {
202
+ // Wait until IME is settled for Asian languages like Japanese and Chinese
203
+ // TODO: `event.which` is depricated but this is a temporary workaround
204
+ if (event.which === 229) {
205
+ return;
206
+ }
207
+
202
208
  const {
203
209
  id,
204
210
  field,
@@ -134,6 +134,12 @@ const useGridRowEditing = (apiRef, props) => {
134
134
  }, []);
135
135
  const handleCellKeyDown = React.useCallback((params, event) => {
136
136
  if (params.cellMode === _gridEditRowModel.GridRowModes.Edit) {
137
+ // Wait until IME is settled for Asian languages like Japanese and Chinese
138
+ // TODO: `event.which` is depricated but this is a temporary workaround
139
+ if (event.which === 229) {
140
+ return;
141
+ }
142
+
137
143
  let reason;
138
144
 
139
145
  if (event.key === 'Escape') {
@@ -199,6 +199,12 @@ const useGridRowEditing = (apiRef, props) => {
199
199
  };
200
200
  (0, _useGridApiMethod.useGridApiMethod)(apiRef, rowEditingApi, 'EditRowApi');
201
201
  const handleCellKeyDown = React.useCallback(async (params, event) => {
202
+ // Wait until IME is settled for Asian languages like Japanese and Chinese
203
+ // TODO: `event.which` is depricated but this is a temporary workaround
204
+ if (event.which === 229) {
205
+ return;
206
+ }
207
+
202
208
  const {
203
209
  cellMode,
204
210
  isEditable
@@ -124,7 +124,7 @@ const useGridRows = (apiRef, props) => {
124
124
  const updateRows = React.useCallback(updates => {
125
125
  if (props.signature === _useGridApiEventHandler.GridSignature.DataGrid && updates.length > 1) {
126
126
  // TODO: Add test with direct call to `apiRef.current.updateRows` in DataGrid after enabling the `apiRef` on the free plan.
127
- throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.", 'You need to upgrade to the DataGridPro component to unlock this feature.'].join('\n'));
127
+ throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.", 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
128
128
  } // we remove duplicate updates. A server can batch updates, and send several updates for the same row in one fn call.
129
129
 
130
130
 
@@ -18,7 +18,7 @@ const flatRowTreeCreationMethod = ({
18
18
  for (let i = 0; i < ids.length; i += 1) {
19
19
  const rowId = ids[i];
20
20
 
21
- if (previousTree && previousTree[rowId]) {
21
+ if (previousTree && previousTree[rowId] && previousTree[rowId].depth === 0 && previousTree[rowId].parent == null) {
22
22
  tree[rowId] = previousTree[rowId];
23
23
  } else {
24
24
  tree[rowId] = {
@@ -17,7 +17,7 @@ function useGridApiContext() {
17
17
  const apiRef = React.useContext(_GridApiContext.GridApiContext);
18
18
 
19
19
  if (apiRef === undefined) {
20
- throw new Error(['MUI: Could not find the data grid context.', 'It looks like you rendered your component outside of a DataGrid or DataGridPro parent component.', 'This can also happen if you are bundling multiple versions of the data grid.'].join('\n'));
20
+ throw new Error(['MUI: Could not find the data grid context.', 'It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.', 'This can also happen if you are bundling multiple versions of the data grid.'].join('\n'));
21
21
  }
22
22
 
23
23
  return apiRef;
@@ -17,7 +17,7 @@ const useGridRootProps = () => {
17
17
  const contextValue = React.useContext(_GridRootPropsContext.GridRootPropsContext);
18
18
 
19
19
  if (!contextValue) {
20
- throw new Error('MUI: useGridRootProps should only be used inside the DataGrid/DataGridPro component.');
20
+ throw new Error('MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.');
21
21
  }
22
22
 
23
23
  return contextValue;
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.12.3
1
+ /** @license MUI v5.13.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -212,6 +212,19 @@ Object.keys(_koKR).forEach(function (key) {
212
212
  });
213
213
  });
214
214
 
215
+ var _nbNO = require("./nbNO");
216
+
217
+ Object.keys(_nbNO).forEach(function (key) {
218
+ if (key === "default" || key === "__esModule") return;
219
+ if (key in exports && exports[key] === _nbNO[key]) return;
220
+ Object.defineProperty(exports, key, {
221
+ enumerable: true,
222
+ get: function () {
223
+ return _nbNO[key];
224
+ }
225
+ });
226
+ });
227
+
215
228
  var _nlNL = require("./nlNL");
216
229
 
217
230
  Object.keys(_nlNL).forEach(function (key) {
@@ -251,6 +264,19 @@ Object.keys(_ptBR).forEach(function (key) {
251
264
  });
252
265
  });
253
266
 
267
+ var _roRO = require("./roRO");
268
+
269
+ Object.keys(_roRO).forEach(function (key) {
270
+ if (key === "default" || key === "__esModule") return;
271
+ if (key in exports && exports[key] === _roRO[key]) return;
272
+ Object.defineProperty(exports, key, {
273
+ enumerable: true,
274
+ get: function () {
275
+ return _roRO[key];
276
+ }
277
+ });
278
+ });
279
+
254
280
  var _ruRU = require("./ruRU");
255
281
 
256
282
  Object.keys(_ruRU).forEach(function (key) {
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.roRO = void 0;
7
+
8
+ var _locale = require("@mui/material/locale");
9
+
10
+ var _getGridLocalization = require("../utils/getGridLocalization");
11
+
12
+ const roROGrid = {
13
+ // Root
14
+ noRowsLabel: 'Lipsă date',
15
+ noResultsOverlayLabel: 'Nu au fost găsite rezultate.',
16
+ errorOverlayDefaultLabel: 'A apărut o eroare neașteptată.',
17
+ // Density selector toolbar button text
18
+ toolbarDensity: 'Înălțime rând',
19
+ toolbarDensityLabel: 'Înălțime rând',
20
+ toolbarDensityCompact: 'Compact',
21
+ toolbarDensityStandard: 'Standard',
22
+ toolbarDensityComfortable: 'Lat',
23
+ // Columns selector toolbar button text
24
+ toolbarColumns: 'Coloane',
25
+ toolbarColumnsLabel: 'Afișează selecție coloane',
26
+ // Filters toolbar button text
27
+ toolbarFilters: 'Filtru',
28
+ toolbarFiltersLabel: 'Afișează filtru',
29
+ toolbarFiltersTooltipHide: 'Ascunde filtru',
30
+ toolbarFiltersTooltipShow: 'Afișează filtru',
31
+ toolbarFiltersTooltipActive: count => count !== 1 ? `${count} filtru activ` : `${count} filtru activ`,
32
+ // Quick filter toolbar field
33
+ // toolbarQuickFilterPlaceholder: 'Search...',
34
+ // toolbarQuickFilterLabel: 'Search',
35
+ // toolbarQuickFilterDeleteIconLabel: 'Clear',
36
+ // Export selector toolbar button text
37
+ toolbarExport: 'Export',
38
+ toolbarExportLabel: 'Export',
39
+ toolbarExportCSV: 'Download în format CSV',
40
+ toolbarExportPrint: 'Printare',
41
+ toolbarExportExcel: 'Download în format Excel',
42
+ // Columns panel text
43
+ columnsPanelTextFieldLabel: 'Găsește coloana',
44
+ columnsPanelTextFieldPlaceholder: 'Titlu coloană',
45
+ columnsPanelDragIconLabel: 'Resortare coloană',
46
+ columnsPanelShowAllButton: 'Afișează tot',
47
+ columnsPanelHideAllButton: 'Ascunde tot',
48
+ // Filter panel text
49
+ filterPanelAddFilter: 'Adăugare filtru',
50
+ filterPanelDeleteIconLabel: 'Ștergere',
51
+ filterPanelLinkOperator: 'Operatori logici',
52
+ filterPanelOperators: 'Operatori',
53
+ // TODO v6: rename to filterPanelOperator
54
+ filterPanelOperatorAnd: 'Și',
55
+ filterPanelOperatorOr: 'Sau',
56
+ filterPanelColumns: 'Coloane',
57
+ filterPanelInputLabel: 'Valoare',
58
+ filterPanelInputPlaceholder: 'Filtrare valoare',
59
+ // Filter operators text
60
+ filterOperatorContains: 'conține',
61
+ filterOperatorEquals: 'este egal cu',
62
+ filterOperatorStartsWith: 'începe cu',
63
+ filterOperatorEndsWith: 'se termină cu',
64
+ filterOperatorIs: 'este',
65
+ filterOperatorNot: 'nu este',
66
+ filterOperatorAfter: 'este după',
67
+ filterOperatorOnOrAfter: 'este la sau după',
68
+ filterOperatorBefore: 'este înainte de',
69
+ filterOperatorOnOrBefore: 'este la sau înainte de',
70
+ filterOperatorIsEmpty: 'este gol',
71
+ filterOperatorIsNotEmpty: 'nu este gol',
72
+ filterOperatorIsAnyOf: 'este una din valori',
73
+ // Filter values text
74
+ filterValueAny: 'Aleatoriu',
75
+ filterValueTrue: 'Da',
76
+ filterValueFalse: 'Nu',
77
+ // Column menu text
78
+ columnMenuLabel: 'Meniu',
79
+ columnMenuShowColumns: 'Afișează toate coloanele',
80
+ columnMenuFilter: 'Filtru',
81
+ columnMenuHideColumn: 'Ascunde',
82
+ columnMenuUnsort: 'Dezactivare sortare',
83
+ columnMenuSortAsc: 'Sortează crescător',
84
+ columnMenuSortDesc: 'Sortează descrescător',
85
+ // Column header text
86
+ columnHeaderFiltersTooltipActive: count => count !== 1 ? `${count} filtru activ` : `${count} filtru activ`,
87
+ columnHeaderFiltersLabel: 'Afișează filtru',
88
+ columnHeaderSortIconLabel: 'Sortare',
89
+ // Rows selected footer text
90
+ footerRowSelected: count => count !== 1 ? `${count.toLocaleString()} Înregistrări selectate` : `${count.toLocaleString()} Înregistrare selectată`,
91
+ // Total row amount footer text
92
+ footerTotalRows: 'Total:',
93
+ // Total visible row amount footer text
94
+ footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} din ${totalCount.toLocaleString()}`,
95
+ // Checkbox selection text
96
+ checkboxSelectionHeaderName: 'Checkbox Selecție',
97
+ checkboxSelectionSelectAllRows: 'Selectare toate rândurile',
98
+ checkboxSelectionUnselectAllRows: 'Deselectare toate rândurile',
99
+ checkboxSelectionSelectRow: 'Selectare rând',
100
+ checkboxSelectionUnselectRow: 'Deselectare rând',
101
+ // Boolean cell text
102
+ booleanCellTrueLabel: 'Da',
103
+ booleanCellFalseLabel: 'Nu',
104
+ // Actions cell more text
105
+ actionsCellMore: 'Mai multe',
106
+ // Column pinning text
107
+ pinToLeft: 'Fixare în stânga',
108
+ pinToRight: 'Fixare în dreapta',
109
+ unpin: 'Anulare fixare',
110
+ // Tree Data
111
+ treeDataGroupingHeaderName: 'Grup',
112
+ treeDataExpand: 'Afișare copii',
113
+ treeDataCollapse: 'Ascundere copii',
114
+ // Grouping columns
115
+ groupingColumnHeaderName: 'Grupare',
116
+ groupColumn: name => `Grupare după ${name}`,
117
+ unGroupColumn: name => `Anulare Grupare după ${name}`,
118
+ // Master/detail
119
+ // detailPanelToggle: 'Detail panel toggle',
120
+ expandDetailPanel: 'Extindere',
121
+ collapseDetailPanel: 'Restrângere',
122
+ // Row reordering text
123
+ rowReorderingHeaderName: 'Reordonare rânduri'
124
+ };
125
+ const roRO = (0, _getGridLocalization.getGridLocalization)(roROGrid, _locale.roRO);
126
+ exports.roRO = roRO;