@mui/x-data-grid 5.12.2 → 5.13.1

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 (177) hide show
  1. package/CHANGELOG.md +160 -6
  2. package/DataGrid/DataGrid.js +4 -4
  3. package/colDef/gridDateOperators.js +4 -2
  4. package/colDef/gridNumericOperators.js +4 -2
  5. package/colDef/gridStringOperators.d.ts +1 -1
  6. package/colDef/gridStringOperators.js +15 -8
  7. package/components/GridRow.js +1 -1
  8. package/components/cell/GridActionsCellItem.d.ts +2 -2
  9. package/components/cell/GridBooleanCell.js +4 -3
  10. package/components/cell/GridEditBooleanCell.js +4 -3
  11. package/components/cell/GridEditDateCell.js +4 -3
  12. package/components/cell/GridEditInputCell.js +4 -3
  13. package/components/cell/GridEditSingleSelectCell.js +9 -7
  14. package/components/panel/GridColumnsPanel.js +1 -1
  15. package/components/panel/GridPanel.d.ts +1 -1
  16. package/components/panel/filterPanel/GridFilterForm.js +11 -4
  17. package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  18. package/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  19. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +5 -9
  20. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +42 -19
  21. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +3 -7
  22. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +32 -14
  23. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  24. package/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  25. package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +6 -3
  26. package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
  27. package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
  28. package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
  29. package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
  30. package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
  31. package/hooks/features/dimensions/useGridDimensions.js +28 -15
  32. package/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  33. package/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  34. package/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  35. package/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  36. package/hooks/features/filter/gridFilterUtils.js +8 -5
  37. package/hooks/features/filter/useGridFilter.js +19 -1
  38. package/hooks/features/rows/useGridRows.js +16 -3
  39. package/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  40. package/hooks/features/virtualization/useGridVirtualScroller.js +14 -3
  41. package/hooks/utils/useGridApiContext.js +1 -1
  42. package/hooks/utils/useGridRootProps.js +1 -1
  43. package/index.js +1 -1
  44. package/legacy/DataGrid/DataGrid.js +4 -4
  45. package/legacy/colDef/gridDateOperators.js +4 -2
  46. package/legacy/colDef/gridNumericOperators.js +4 -2
  47. package/legacy/colDef/gridStringOperators.js +17 -7
  48. package/legacy/components/GridRow.js +1 -1
  49. package/legacy/components/cell/GridBooleanCell.js +3 -1
  50. package/legacy/components/cell/GridEditBooleanCell.js +4 -2
  51. package/legacy/components/cell/GridEditDateCell.js +4 -2
  52. package/legacy/components/cell/GridEditInputCell.js +4 -2
  53. package/legacy/components/cell/GridEditSingleSelectCell.js +9 -7
  54. package/legacy/components/panel/GridColumnsPanel.js +3 -1
  55. package/legacy/components/panel/filterPanel/GridFilterForm.js +9 -4
  56. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  57. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  58. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +34 -12
  59. package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +24 -7
  60. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  61. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  62. package/legacy/hooks/features/dimensions/useGridDimensions.js +27 -15
  63. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  64. package/legacy/hooks/features/editRows/useGridCellEditing.old.js +16 -8
  65. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  66. package/legacy/hooks/features/editRows/useGridRowEditing.old.js +22 -14
  67. package/legacy/hooks/features/filter/gridFilterUtils.js +8 -5
  68. package/legacy/hooks/features/filter/useGridFilter.js +19 -1
  69. package/legacy/hooks/features/rows/useGridRows.js +18 -3
  70. package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  71. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +19 -8
  72. package/legacy/hooks/utils/useGridApiContext.js +1 -1
  73. package/legacy/hooks/utils/useGridRootProps.js +1 -1
  74. package/legacy/index.js +1 -1
  75. package/legacy/locales/deDE.js +4 -4
  76. package/legacy/locales/frFR.js +11 -11
  77. package/legacy/locales/index.js +3 -0
  78. package/legacy/locales/nlNL.js +15 -15
  79. package/legacy/locales/ptBR.js +11 -11
  80. package/legacy/locales/roRO.js +128 -0
  81. package/legacy/locales/skSK.js +16 -16
  82. package/legacy/locales/svSE.js +128 -0
  83. package/legacy/utils/keyboardUtils.js +4 -3
  84. package/locales/deDE.js +4 -4
  85. package/locales/frFR.js +11 -11
  86. package/locales/index.d.ts +3 -0
  87. package/locales/index.js +3 -0
  88. package/locales/nlNL.js +15 -15
  89. package/locales/ptBR.js +11 -11
  90. package/locales/roRO.d.ts +2 -0
  91. package/locales/roRO.js +116 -0
  92. package/locales/skSK.js +16 -16
  93. package/locales/svSE.d.ts +2 -0
  94. package/locales/svSE.js +116 -0
  95. package/models/gridFilterOperator.d.ts +6 -0
  96. package/modern/DataGrid/DataGrid.js +4 -4
  97. package/modern/colDef/gridDateOperators.js +4 -2
  98. package/modern/colDef/gridNumericOperators.js +4 -2
  99. package/modern/colDef/gridStringOperators.js +15 -8
  100. package/modern/components/GridRow.js +1 -1
  101. package/modern/components/cell/GridBooleanCell.js +4 -3
  102. package/modern/components/cell/GridEditBooleanCell.js +4 -3
  103. package/modern/components/cell/GridEditDateCell.js +4 -3
  104. package/modern/components/cell/GridEditInputCell.js +4 -3
  105. package/modern/components/cell/GridEditSingleSelectCell.js +9 -7
  106. package/modern/components/panel/GridColumnsPanel.js +1 -1
  107. package/modern/components/panel/filterPanel/GridFilterForm.js +11 -4
  108. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  109. package/modern/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  110. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +32 -13
  111. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +22 -8
  112. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  113. package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  114. package/modern/hooks/features/dimensions/useGridDimensions.js +28 -15
  115. package/modern/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  116. package/modern/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  117. package/modern/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  118. package/modern/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  119. package/modern/hooks/features/filter/gridFilterUtils.js +8 -5
  120. package/modern/hooks/features/filter/useGridFilter.js +17 -1
  121. package/modern/hooks/features/rows/useGridRows.js +16 -3
  122. package/modern/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  123. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +10 -3
  124. package/modern/hooks/utils/useGridApiContext.js +1 -1
  125. package/modern/hooks/utils/useGridRootProps.js +1 -1
  126. package/modern/index.js +1 -1
  127. package/modern/locales/deDE.js +4 -4
  128. package/modern/locales/frFR.js +11 -11
  129. package/modern/locales/index.js +3 -0
  130. package/modern/locales/nlNL.js +15 -15
  131. package/modern/locales/ptBR.js +11 -11
  132. package/modern/locales/roRO.js +116 -0
  133. package/modern/locales/skSK.js +16 -16
  134. package/modern/locales/svSE.js +116 -0
  135. package/modern/utils/keyboardUtils.js +4 -3
  136. package/node/DataGrid/DataGrid.js +4 -4
  137. package/node/colDef/gridDateOperators.js +4 -2
  138. package/node/colDef/gridNumericOperators.js +4 -2
  139. package/node/colDef/gridStringOperators.js +15 -8
  140. package/node/components/GridRow.js +1 -1
  141. package/node/components/cell/GridBooleanCell.js +5 -3
  142. package/node/components/cell/GridEditBooleanCell.js +5 -3
  143. package/node/components/cell/GridEditDateCell.js +5 -3
  144. package/node/components/cell/GridEditInputCell.js +5 -3
  145. package/node/components/cell/GridEditSingleSelectCell.js +10 -7
  146. package/node/components/panel/GridColumnsPanel.js +1 -1
  147. package/node/components/panel/filterPanel/GridFilterForm.js +9 -4
  148. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  149. package/node/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  150. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +43 -20
  151. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +33 -15
  152. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  153. package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  154. package/node/hooks/features/dimensions/useGridDimensions.js +28 -15
  155. package/node/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  156. package/node/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  157. package/node/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  158. package/node/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  159. package/node/hooks/features/filter/gridFilterUtils.js +7 -4
  160. package/node/hooks/features/filter/useGridFilter.js +19 -1
  161. package/node/hooks/features/rows/useGridRows.js +16 -3
  162. package/node/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  163. package/node/hooks/features/virtualization/useGridVirtualScroller.js +14 -3
  164. package/node/hooks/utils/useGridApiContext.js +1 -1
  165. package/node/hooks/utils/useGridRootProps.js +1 -1
  166. package/node/index.js +1 -1
  167. package/node/locales/deDE.js +4 -4
  168. package/node/locales/frFR.js +11 -11
  169. package/node/locales/index.js +39 -0
  170. package/node/locales/nlNL.js +15 -15
  171. package/node/locales/ptBR.js +11 -11
  172. package/node/locales/roRO.js +126 -0
  173. package/node/locales/skSK.js +16 -16
  174. package/node/locales/svSE.js +126 -0
  175. package/node/utils/keyboardUtils.js +4 -3
  176. package/package.json +4 -4
  177. package/utils/keyboardUtils.js +4 -3
@@ -26,6 +26,8 @@ var _gridClasses = require("../../constants/gridClasses");
26
26
 
27
27
  var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
28
28
 
29
+ var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
30
+
29
31
  var _jsxRuntime = require("react/jsx-runtime");
30
32
 
31
33
  const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange"];
@@ -50,13 +52,13 @@ function GridEditBooleanCell(props) {
50
52
  const {
51
53
  id: idProp,
52
54
  value,
53
- api,
54
55
  field,
55
56
  className,
56
57
  hasFocus,
57
58
  onValueChange
58
59
  } = props,
59
60
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
61
+ const apiRef = (0, _useGridApiContext.useGridApiContext)();
60
62
  const inputRef = React.useRef(null);
61
63
  const id = (0, _utils.unstable_useId)();
62
64
  const [valueState, setValueState] = React.useState(value);
@@ -73,12 +75,12 @@ function GridEditBooleanCell(props) {
73
75
  }
74
76
 
75
77
  setValueState(newValue);
76
- await api.setEditCellValue({
78
+ await apiRef.current.setEditCellValue({
77
79
  id: idProp,
78
80
  field,
79
81
  value: newValue
80
82
  }, event);
81
- }, [api, field, idProp, onValueChange]);
83
+ }, [apiRef, field, idProp, onValueChange]);
82
84
  React.useEffect(() => {
83
85
  setValueState(value);
84
86
  }, [value]);
@@ -26,6 +26,8 @@ var _gridClasses = require("../../constants/gridClasses");
26
26
 
27
27
  var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
28
28
 
29
+ var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
30
+
29
31
  var _jsxRuntime = require("react/jsx-runtime");
30
32
 
31
33
  const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "inputProps", "isValidating", "isProcessingProps", "onValueChange"];
@@ -48,7 +50,6 @@ function GridEditDateCell(props) {
48
50
  const {
49
51
  id,
50
52
  value: valueProp,
51
- api,
52
53
  field,
53
54
  colDef,
54
55
  hasFocus,
@@ -57,6 +58,7 @@ function GridEditDateCell(props) {
57
58
  } = props,
58
59
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
59
60
  const isDateTime = colDef.type === 'dateTime';
61
+ const apiRef = (0, _useGridApiContext.useGridApiContext)();
60
62
  const inputRef = React.useRef();
61
63
  const valueTransformed = React.useMemo(() => {
62
64
  let parsedDate;
@@ -116,12 +118,12 @@ function GridEditDateCell(props) {
116
118
  parsed: newParsedDate,
117
119
  formatted: newFormattedDate
118
120
  });
119
- api.setEditCellValue({
121
+ apiRef.current.setEditCellValue({
120
122
  id,
121
123
  field,
122
124
  value: newParsedDate
123
125
  }, event);
124
- }, [api, field, id, onValueChange]);
126
+ }, [apiRef, field, id, onValueChange]);
125
127
  React.useEffect(() => {
126
128
  setValueState(state => {
127
129
  var _valueTransformed$par, _state$parsed;
@@ -32,6 +32,8 @@ var _index = require("../icons/index");
32
32
 
33
33
  var _GridFilterInputValue = require("../panel/filterPanel/GridFilterInputValue");
34
34
 
35
+ var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
36
+
35
37
  var _jsxRuntime = require("react/jsx-runtime");
36
38
 
37
39
  const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "isValidating", "debounceMs", "isProcessingProps", "onValueChange"];
@@ -71,7 +73,6 @@ function GridEditInputCell(props) {
71
73
  const {
72
74
  id,
73
75
  value,
74
- api,
75
76
  field,
76
77
  colDef,
77
78
  hasFocus,
@@ -80,6 +81,7 @@ function GridEditInputCell(props) {
80
81
  onValueChange
81
82
  } = props,
82
83
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
84
+ const apiRef = (0, _useGridApiContext.useGridApiContext)();
83
85
  const inputRef = React.useRef();
84
86
  const [valueState, setValueState] = React.useState(value);
85
87
  const ownerState = {
@@ -94,13 +96,13 @@ function GridEditInputCell(props) {
94
96
  }
95
97
 
96
98
  setValueState(newValue);
97
- api.setEditCellValue({
99
+ apiRef.current.setEditCellValue({
98
100
  id,
99
101
  field,
100
102
  value: newValue,
101
103
  debounceMs
102
104
  }, event);
103
- }, [api, debounceMs, field, id, onValueChange]);
105
+ }, [apiRef, debounceMs, field, id, onValueChange]);
104
106
  React.useEffect(() => {
105
107
  setValueState(value);
106
108
  }, [value]);
@@ -28,6 +28,8 @@ var _gridEditRowModel = require("../../models/gridEditRowModel");
28
28
 
29
29
  var _filterPanelUtils = require("../panel/filterPanel/filterPanelUtils");
30
30
 
31
+ var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
32
+
31
33
  var _jsxRuntime = require("react/jsx-runtime");
32
34
 
33
35
  const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange"];
@@ -62,6 +64,7 @@ function GridEditSingleSelectCell(props) {
62
64
  onValueChange
63
65
  } = props,
64
66
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
67
+ const apiRef = (0, _useGridApiContext.useGridApiContext)();
65
68
  const ref = React.useRef();
66
69
  const inputRef = React.useRef();
67
70
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
@@ -110,7 +113,7 @@ function GridEditSingleSelectCell(props) {
110
113
  await onValueChange(event, formattedTargetValue);
111
114
  }
112
115
 
113
- const isValid = await api.setEditCellValue({
116
+ const isValid = await apiRef.current.setEditCellValue({
114
117
  id,
115
118
  field,
116
119
  value: formattedTargetValue
@@ -125,18 +128,18 @@ function GridEditSingleSelectCell(props) {
125
128
  return;
126
129
  }
127
130
 
128
- const canCommit = await Promise.resolve(api.commitCellChange({
131
+ const canCommit = await Promise.resolve(apiRef.current.commitCellChange({
129
132
  id,
130
133
  field
131
134
  }, event));
132
135
 
133
136
  if (canCommit) {
134
- api.setCellMode(id, field, 'view');
137
+ apiRef.current.setCellMode(id, field, 'view');
135
138
 
136
139
  if (event.key) {
137
140
  // TODO v6: remove once we stop ignoring events fired from portals
138
- const params = api.getCellParams(id, field);
139
- api.publishEvent('cellNavigationKeyDown', params, event);
141
+ const params = apiRef.current.getCellParams(id, field);
142
+ apiRef.current.publishEvent('cellNavigationKeyDown', params, event);
140
143
  }
141
144
  }
142
145
  };
@@ -151,13 +154,13 @@ function GridEditSingleSelectCell(props) {
151
154
  var _rootProps$experiment2;
152
155
 
153
156
  if ((_rootProps$experiment2 = rootProps.experimentalFeatures) != null && _rootProps$experiment2.newEditingApi) {
154
- api.stopCellEditMode({
157
+ apiRef.current.stopCellEditMode({
155
158
  id,
156
159
  field,
157
160
  ignoreModifications: true
158
161
  });
159
162
  } else {
160
- api.setCellMode(id, field, 'view');
163
+ apiRef.current.setCellMode(id, field, 'view');
161
164
  }
162
165
  }
163
166
  };
@@ -112,7 +112,7 @@ function GridColumnsPanel(props) {
112
112
  return apiRef.current.setColumnVisibilityModel({});
113
113
  }
114
114
 
115
- return apiRef.current.setColumnVisibilityModel(Object.fromEntries(columns.map(col => [col.field, false])));
115
+ return apiRef.current.setColumnVisibilityModel(Object.fromEntries(columns.filter(col => col.hideable !== false).map(col => [col.field, false])));
116
116
  } // TODO v6: Remove
117
117
 
118
118
 
@@ -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,15 +42,36 @@ 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
- return typeof (resolvedColumn == null ? void 0 : resolvedColumn.valueOptions) === 'function' ? resolvedColumn.valueOptions({
52
- field: resolvedColumn.field
53
- }) : resolvedColumn == null ? void 0 : resolvedColumn.valueOptions;
64
+ if (!(resolvedColumn != null && resolvedColumn.valueOptions)) {
65
+ return [];
66
+ }
67
+
68
+ if (typeof resolvedColumn.valueOptions === 'function') {
69
+ return resolvedColumn.valueOptions({
70
+ field: resolvedColumn.field
71
+ });
72
+ }
73
+
74
+ return resolvedColumn.valueOptions;
54
75
  }, [resolvedColumn]);
55
76
  const resolvedFormattedValueOptions = React.useMemo(() => {
56
77
  return resolvedValueOptions == null ? void 0 : resolvedValueOptions.map(_filterPanelUtils.getValueFromOption);
@@ -81,7 +102,7 @@ function GridFilterInputMultipleSingleSelect(props) {
81
102
 
82
103
  if (resolvedValueOptions !== undefined) {
83
104
  const itemValueIndexes = item.value.map(element => {
84
- // get the index matching between values and valueoptions
105
+ // get the index matching between values and valueOptions
85
106
  const formattedElement = (0, _filterPanelUtils.getValueFromOption)(element);
86
107
  const index = (resolvedFormattedValueOptions == null ? void 0 : resolvedFormattedValueOptions.findIndex(formatedOption => formatedOption === formattedElement)) || 0;
87
108
  return index;
@@ -107,8 +128,7 @@ function GridFilterInputMultipleSingleSelect(props) {
107
128
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Autocomplete.default, (0, _extends2.default)({
108
129
  multiple: true,
109
130
  limitTags: 1,
110
- options: resolvedValueOptions // TODO: avoid `any`?
111
- ,
131
+ options: resolvedValueOptions,
112
132
  isOptionEqualToValue: isOptionEqualToValue,
113
133
  filterOptions: filter,
114
134
  id: id,
@@ -121,16 +141,19 @@ function GridFilterInputMultipleSingleSelect(props) {
121
141
  }, getTagProps({
122
142
  index
123
143
  })))),
124
- renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, (0, _extends2.default)({}, params, {
125
- label: apiRef.current.getLocaleText('filterPanelInputLabel'),
126
- placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
127
- InputLabelProps: (0, _extends2.default)({}, params.InputLabelProps, {
128
- shrink: true
129
- }),
130
- inputRef: focusElementRef,
131
- type: 'singleSelect',
132
- variant: "standard"
133
- }))
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
+ }
134
157
  }, other));
135
158
  }
136
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') {
@@ -116,7 +122,7 @@ const useGridCellEditing = (apiRef, props) => {
116
122
  let reason;
117
123
 
118
124
  if ((0, _keyboardUtils.isPrintableKey)(event.key)) {
119
- if (event.shiftKey || event.ctrlKey || event.metaKey || event.altKey) {
125
+ if (event.ctrlKey && event.key !== 'v' || event.metaKey && event.key !== 'v' || event.altKey) {
120
126
  return;
121
127
  }
122
128
 
@@ -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') {
@@ -170,7 +176,7 @@ const useGridRowEditing = (apiRef, props) => {
170
176
  let reason;
171
177
 
172
178
  if ((0, _keyboardUtils.isPrintableKey)(event.key)) {
173
- if (event.shiftKey || event.ctrlKey || event.metaKey || event.altKey) {
179
+ if (event.ctrlKey && event.key !== 'v' || event.metaKey && event.key !== 'v' || event.altKey) {
174
180
  return;
175
181
  }
176
182
 
@@ -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