@mui/x-data-grid 6.3.0 → 6.3.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.
@@ -2,9 +2,13 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  var _excluded = ["touchRippleRef", "inputProps", "onChange", "color", "size", "checked", "sx", "value", "inputRef"],
5
- _excluded2 = ["startIcon", "color", "endIcon", "size", "sx", "variant"],
6
- _excluded3 = ["color", "size", "sx"],
7
- _excluded4 = ["name", "checkedIcon", "color", "disableRipple", "disableFocusRipple", "disableTouchRipple", "edge", "icon", "inputProps", "inputRef", "size", "sx", "onChange", "onClick"];
5
+ _excluded2 = ["onChange", "label", "placeholder", "value", "inputRef", "type", "size", "variant"],
6
+ _excluded3 = ["startIcon", "color", "endIcon", "size", "sx", "variant"],
7
+ _excluded4 = ["color", "size", "sx", "touchRippleRef"],
8
+ _excluded5 = ["name", "checkedIcon", "color", "disableRipple", "disableFocusRipple", "disableTouchRipple", "edge", "icon", "inputProps", "inputRef", "size", "sx", "onChange", "onClick"],
9
+ _excluded6 = ["open", "onOpen", "value", "onChange", "size", "color", "variant", "inputProps", "MenuProps", "inputRef", "error", "native", "fullWidth", "labelId"],
10
+ _excluded7 = ["native"],
11
+ _excluded8 = ["shrink", "variant", "sx"];
8
12
  import * as React from 'react';
9
13
  import JoyCheckbox from '@mui/joy/Checkbox';
10
14
  import JoyInput from '@mui/joy/Input';
@@ -13,6 +17,9 @@ import JoyFormLabel from '@mui/joy/FormLabel';
13
17
  import JoyButton from '@mui/joy/Button';
14
18
  import JoyIconButton from '@mui/joy/IconButton';
15
19
  import JoySwitch from '@mui/joy/Switch';
20
+ import JoySelect from '@mui/joy/Select';
21
+ import JoyOption from '@mui/joy/Option';
22
+ import { unstable_useForkRef as useForkRef } from '@mui/utils';
16
23
  import { jsx as _jsx } from "react/jsx-runtime";
17
24
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
25
  function convertColor(color) {
@@ -35,13 +42,17 @@ function convertSize(size) {
35
42
  }[size] : size;
36
43
  }
37
44
  function convertVariant(variant) {
38
- return variant ? {
45
+ var defaultVariant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'plain';
46
+ if (!variant) {
47
+ return defaultVariant;
48
+ }
49
+ return {
50
+ standard: 'outlined',
39
51
  outlined: 'outlined',
40
52
  contained: 'solid',
41
53
  text: 'plain',
42
- standard: 'plain',
43
54
  filled: 'soft'
44
- }[variant] : variant;
55
+ }[variant] || defaultVariant;
45
56
  }
46
57
  var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
47
58
  var touchRippleRef = _ref.touchRippleRef,
@@ -66,58 +77,67 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
66
77
  }));
67
78
  });
68
79
  var TextField = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
80
+ var _props$InputProps, _props$inputProps;
69
81
  var onChange = _ref2.onChange,
70
82
  label = _ref2.label,
71
83
  placeholder = _ref2.placeholder,
72
84
  value = _ref2.value,
73
85
  inputRef = _ref2.inputRef,
74
- type = _ref2.type;
86
+ type = _ref2.type,
87
+ size = _ref2.size,
88
+ variant = _ref2.variant,
89
+ props = _objectWithoutProperties(_ref2, _excluded2);
90
+ var rootRef = useForkRef(ref, (_props$InputProps = props.InputProps) == null ? void 0 : _props$InputProps.ref);
91
+ var inputForkRef = useForkRef(inputRef, props == null ? void 0 : (_props$inputProps = props.inputProps) == null ? void 0 : _props$inputProps.ref);
92
+ var _ref3 = props.InputProps || {},
93
+ startAdornment = _ref3.startAdornment,
94
+ endAdornment = _ref3.endAdornment;
75
95
  return /*#__PURE__*/_jsxs(JoyFormControl, {
76
- ref: ref,
96
+ ref: rootRef,
77
97
  children: [/*#__PURE__*/_jsx(JoyFormLabel, {
78
- sx: {
79
- fontSize: 12
80
- },
81
98
  children: label
82
99
  }), /*#__PURE__*/_jsx(JoyInput, {
83
100
  type: type,
84
101
  value: value,
85
102
  onChange: onChange,
86
103
  placeholder: placeholder,
87
- size: "sm",
104
+ variant: convertVariant(variant, 'outlined'),
105
+ size: convertSize(size),
88
106
  slotProps: {
89
- input: {
90
- ref: inputRef
91
- }
92
- }
107
+ input: _extends({}, props == null ? void 0 : props.inputProps, {
108
+ ref: inputForkRef
109
+ })
110
+ },
111
+ startDecorator: startAdornment,
112
+ endDecorator: endAdornment
93
113
  })]
94
114
  });
95
115
  });
96
- var Button = /*#__PURE__*/React.forwardRef(function Button(_ref3, ref) {
97
- var _convertVariant;
98
- var startIcon = _ref3.startIcon,
99
- color = _ref3.color,
100
- endIcon = _ref3.endIcon,
101
- size = _ref3.size,
102
- sx = _ref3.sx,
103
- variant = _ref3.variant,
104
- props = _objectWithoutProperties(_ref3, _excluded2);
116
+ var Button = /*#__PURE__*/React.forwardRef(function Button(_ref4, ref) {
117
+ var startIcon = _ref4.startIcon,
118
+ color = _ref4.color,
119
+ endIcon = _ref4.endIcon,
120
+ size = _ref4.size,
121
+ sx = _ref4.sx,
122
+ variant = _ref4.variant,
123
+ props = _objectWithoutProperties(_ref4, _excluded3);
105
124
  return /*#__PURE__*/_jsx(JoyButton, _extends({}, props, {
106
125
  size: convertSize(size),
107
126
  color: convertColor(color),
108
- variant: (_convertVariant = convertVariant(variant)) != null ? _convertVariant : 'plain',
127
+ variant: convertVariant(variant),
109
128
  ref: ref,
110
129
  startDecorator: startIcon,
111
130
  endDecorator: endIcon,
112
131
  sx: sx
113
132
  }));
114
133
  });
115
- var IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref4, ref) {
134
+ var IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref5, ref) {
116
135
  var _convertColor;
117
- var color = _ref4.color,
118
- size = _ref4.size,
119
- sx = _ref4.sx,
120
- props = _objectWithoutProperties(_ref4, _excluded3);
136
+ var color = _ref5.color,
137
+ size = _ref5.size,
138
+ sx = _ref5.sx,
139
+ touchRippleRef = _ref5.touchRippleRef,
140
+ props = _objectWithoutProperties(_ref5, _excluded4);
121
141
  return /*#__PURE__*/_jsx(JoyIconButton, _extends({}, props, {
122
142
  size: convertSize(size),
123
143
  color: (_convertColor = convertColor(color)) != null ? _convertColor : 'neutral',
@@ -126,22 +146,22 @@ var IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref4, ref) {
126
146
  sx: sx
127
147
  }));
128
148
  });
129
- var Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref5, ref) {
130
- var name = _ref5.name,
131
- checkedIcon = _ref5.checkedIcon,
132
- colorProp = _ref5.color,
133
- disableRipple = _ref5.disableRipple,
134
- disableFocusRipple = _ref5.disableFocusRipple,
135
- disableTouchRipple = _ref5.disableTouchRipple,
136
- edge = _ref5.edge,
137
- icon = _ref5.icon,
138
- inputProps = _ref5.inputProps,
139
- inputRef = _ref5.inputRef,
140
- size = _ref5.size,
141
- sx = _ref5.sx,
142
- onChange = _ref5.onChange,
143
- onClick = _ref5.onClick,
144
- props = _objectWithoutProperties(_ref5, _excluded4);
149
+ var Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref6, ref) {
150
+ var name = _ref6.name,
151
+ checkedIcon = _ref6.checkedIcon,
152
+ colorProp = _ref6.color,
153
+ disableRipple = _ref6.disableRipple,
154
+ disableFocusRipple = _ref6.disableFocusRipple,
155
+ disableTouchRipple = _ref6.disableTouchRipple,
156
+ edge = _ref6.edge,
157
+ icon = _ref6.icon,
158
+ inputProps = _ref6.inputProps,
159
+ inputRef = _ref6.inputRef,
160
+ size = _ref6.size,
161
+ sx = _ref6.sx,
162
+ onChange = _ref6.onChange,
163
+ onClick = _ref6.onClick,
164
+ props = _objectWithoutProperties(_ref6, _excluded5);
145
165
  return /*#__PURE__*/_jsx(JoySwitch, _extends({}, props, {
146
166
  onChange: onChange,
147
167
  size: convertSize(size),
@@ -164,15 +184,100 @@ var Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref5, ref) {
164
184
  })].concat(_toConsumableArray(Array.isArray(sx) ? sx : [sx]))
165
185
  }));
166
186
  });
187
+ var Select = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
188
+ var open = _ref7.open,
189
+ onOpen = _ref7.onOpen,
190
+ value = _ref7.value,
191
+ onChange = _ref7.onChange,
192
+ size = _ref7.size,
193
+ color = _ref7.color,
194
+ variant = _ref7.variant,
195
+ inputProps = _ref7.inputProps,
196
+ MenuProps = _ref7.MenuProps,
197
+ inputRef = _ref7.inputRef,
198
+ error = _ref7.error,
199
+ native = _ref7.native,
200
+ fullWidth = _ref7.fullWidth,
201
+ labelId = _ref7.labelId,
202
+ props = _objectWithoutProperties(_ref7, _excluded6);
203
+ var handleChange = function handleChange(event, newValue) {
204
+ if (event && onChange) {
205
+ // Same as in https://github.com/mui/material-ui/blob/e5558282a8f36856aef1299f3a36f3235e92e770/packages/mui-material/src/Select/SelectInput.js#L288-L300
206
+
207
+ // Redefine target to allow name and value to be read.
208
+ // This allows seamless integration with the most popular form libraries.
209
+ // https://github.com/mui/material-ui/issues/13485#issuecomment-676048492
210
+ // Clone the event to not override `target` of the original event.
211
+ var nativeEvent = event.nativeEvent || event;
212
+ // @ts-ignore The nativeEvent is function, not object
213
+ var clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
214
+ Object.defineProperty(clonedEvent, 'target', {
215
+ writable: true,
216
+ value: {
217
+ value: newValue,
218
+ name: props.name
219
+ }
220
+ });
221
+ onChange(clonedEvent, null);
222
+ }
223
+ };
224
+ return /*#__PURE__*/_jsx(JoySelect, _extends({}, props, {
225
+ listboxOpen: open,
226
+ onListboxOpenChange: function onListboxOpenChange(isOpen) {
227
+ if (isOpen) {
228
+ onOpen == null ? void 0 : onOpen({});
229
+ } else {
230
+ var _MenuProps$onClose;
231
+ MenuProps == null ? void 0 : (_MenuProps$onClose = MenuProps.onClose) == null ? void 0 : _MenuProps$onClose.call(MenuProps, {}, undefined);
232
+ }
233
+ },
234
+ size: convertSize(size),
235
+ color: convertColor(color),
236
+ variant: convertVariant(variant, 'outlined'),
237
+ ref: ref,
238
+ value: value,
239
+ onChange: handleChange,
240
+ slotProps: {
241
+ button: {
242
+ 'aria-labelledby': labelId,
243
+ ref: inputRef
244
+ },
245
+ listbox: {
246
+ disablePortal: false,
247
+ sx: {
248
+ zIndex: 1350
249
+ }
250
+ }
251
+ }
252
+ }));
253
+ });
254
+ var Option = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
255
+ var native = _ref8.native,
256
+ props = _objectWithoutProperties(_ref8, _excluded7);
257
+ return /*#__PURE__*/_jsx(JoyOption, _extends({}, props, {
258
+ ref: ref
259
+ }));
260
+ });
261
+ var InputLabel = /*#__PURE__*/React.forwardRef(function (_ref9, ref) {
262
+ var shrink = _ref9.shrink,
263
+ variant = _ref9.variant,
264
+ sx = _ref9.sx,
265
+ props = _objectWithoutProperties(_ref9, _excluded8);
266
+ return /*#__PURE__*/_jsx(JoyFormLabel, _extends({}, props, {
267
+ ref: ref,
268
+ sx: sx
269
+ }));
270
+ });
167
271
  var joySlots = {
168
272
  baseCheckbox: Checkbox,
169
273
  baseTextField: TextField,
170
274
  baseButton: Button,
171
275
  baseIconButton: IconButton,
172
- baseSwitch: Switch
173
- // BaseFormControl: MUIFormControl,
174
- // baseSelect: Select,
175
- // baseSelectOption: Option,
276
+ baseSwitch: Switch,
277
+ baseSelect: Select,
278
+ baseSelectOption: Option,
279
+ baseInputLabel: InputLabel,
280
+ baseFormControl: JoyFormControl
176
281
  // BaseTooltip: MUITooltip,
177
282
  // BasePopper: MUIPopper,
178
283
  };
@@ -15,7 +15,8 @@ declare const materialSlots: {
15
15
  BaseButton: import("@mui/material").ExtendButtonBase<import("@mui/material/Button").ButtonTypeMap<{}, "button">>;
16
16
  BaseIconButton: import("@mui/material").ExtendButtonBase<import("@mui/material/IconButton").IconButtonTypeMap<{}, "button">>;
17
17
  BaseTooltip: typeof MUITooltip;
18
- BasePopper: import("react").ForwardRefExoticComponent<Omit<import("@mui/base").PopperProps<"div", {}>, "direction"> & {
18
+ BasePopper: import("react").ForwardRefExoticComponent<Omit<import("@mui/base").PopperProps<"div">, "direction"> & {
19
+ component?: import("react").ElementType<any> | undefined;
19
20
  components?: {
20
21
  Root?: import("react").ElementType<any> | undefined;
21
22
  } | undefined;
@@ -41,7 +41,8 @@ export const GridPagination = /*#__PURE__*/React.forwardRef(function GridPaginat
41
41
  if (process.env.NODE_ENV !== 'production') {
42
42
  // eslint-disable-next-line react-hooks/rules-of-hooks
43
43
  const warnedOnceMissingInPageSizeOptions = React.useRef(false);
44
- if (!warnedOnceMissingInPageSizeOptions.current && !rootProps.autoPageSize && !rootProps.pageSizeOptions.includes(paginationModel.pageSize)) {
44
+ const pageSize = rootProps.paginationModel?.pageSize ?? paginationModel.pageSize;
45
+ if (!warnedOnceMissingInPageSizeOptions.current && !rootProps.autoPageSize && !rootProps.pageSizeOptions.includes(pageSize)) {
45
46
  console.warn([`MUI: The page size \`${paginationModel.pageSize}\` is not preset in the \`pageSizeOptions\``, `Add it to show the pagination select.`].join('\n'));
46
47
  warnedOnceMissingInPageSizeOptions.current = true;
47
48
  }
@@ -18,7 +18,8 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
18
18
  function GridBody(props) {
19
19
  const {
20
20
  VirtualScrollerComponent,
21
- ColumnHeadersProps
21
+ ColumnHeadersProps,
22
+ children
22
23
  } = props;
23
24
  const apiRef = useGridPrivateApiContext();
24
25
  const rootProps = useGridRootProps();
@@ -119,7 +120,7 @@ function GridBody(props) {
119
120
  , {
120
121
  ref: virtualScrollerRef,
121
122
  disableVirtualization: isVirtualizationDisabled
122
- })]
123
+ }), children]
123
124
  });
124
125
  }
125
126
  process.env.NODE_ENV !== "production" ? GridBody.propTypes = {
@@ -127,6 +128,7 @@ process.env.NODE_ENV !== "production" ? GridBody.propTypes = {
127
128
  // | These PropTypes are generated from the TypeScript type definitions |
128
129
  // | To update them edit the TypeScript types and run "yarn proptypes" |
129
130
  // ----------------------------------------------------------------------
131
+ children: PropTypes.node,
130
132
  ColumnHeadersProps: PropTypes.object,
131
133
  VirtualScrollerComponent: PropTypes.elementType.isRequired
132
134
  } : void 0;
@@ -68,7 +68,9 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
68
68
  children: activeFilters.map((item, index) => _extends({}, lookup[item.field] && /*#__PURE__*/_jsx("li", {
69
69
  children: `${lookup[item.field].headerName || item.field}
70
70
  ${getOperatorLabel(item)}
71
- ${item.value ? getFilterItemValue(item) : ''}`
71
+ ${
72
+ // implicit check for null and undefined
73
+ item.value != null ? getFilterItemValue(item) : ''}`
72
74
  }, index)))
73
75
  })]
74
76
  });
@@ -298,9 +298,9 @@ export const useGridFocus = (apiRef, props) => {
298
298
  useGridApiMethod(apiRef, focusPrivateApi, 'private');
299
299
  React.useEffect(() => {
300
300
  const doc = ownerDocument(apiRef.current.rootElementRef.current);
301
- doc.addEventListener('click', handleDocumentClick);
301
+ doc.addEventListener('mouseup', handleDocumentClick);
302
302
  return () => {
303
- doc.removeEventListener('click', handleDocumentClick);
303
+ doc.removeEventListener('mouseup', handleDocumentClick);
304
304
  };
305
305
  }, [apiRef, handleDocumentClick]);
306
306
  useGridApiEventHandler(apiRef, 'columnHeaderBlur', handleBlur);
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.3.0
2
+ * @mui/x-data-grid v6.3.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,9 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["touchRippleRef", "inputProps", "onChange", "color", "size", "checked", "sx", "value", "inputRef"],
4
- _excluded2 = ["startIcon", "color", "endIcon", "size", "sx", "variant"],
5
- _excluded3 = ["color", "size", "sx"],
6
- _excluded4 = ["name", "checkedIcon", "color", "disableRipple", "disableFocusRipple", "disableTouchRipple", "edge", "icon", "inputProps", "inputRef", "size", "sx", "onChange", "onClick"];
4
+ _excluded2 = ["onChange", "label", "placeholder", "value", "inputRef", "type", "size", "variant"],
5
+ _excluded3 = ["startIcon", "color", "endIcon", "size", "sx", "variant"],
6
+ _excluded4 = ["color", "size", "sx", "touchRippleRef"],
7
+ _excluded5 = ["name", "checkedIcon", "color", "disableRipple", "disableFocusRipple", "disableTouchRipple", "edge", "icon", "inputProps", "inputRef", "size", "sx", "onChange", "onClick"],
8
+ _excluded6 = ["open", "onOpen", "value", "onChange", "size", "color", "variant", "inputProps", "MenuProps", "inputRef", "error", "native", "fullWidth", "labelId"],
9
+ _excluded7 = ["native"],
10
+ _excluded8 = ["shrink", "variant", "sx"];
7
11
  import * as React from 'react';
8
12
  import JoyCheckbox from '@mui/joy/Checkbox';
9
13
  import JoyInput from '@mui/joy/Input';
@@ -12,6 +16,9 @@ import JoyFormLabel from '@mui/joy/FormLabel';
12
16
  import JoyButton from '@mui/joy/Button';
13
17
  import JoyIconButton from '@mui/joy/IconButton';
14
18
  import JoySwitch from '@mui/joy/Switch';
19
+ import JoySelect from '@mui/joy/Select';
20
+ import JoyOption from '@mui/joy/Option';
21
+ import { unstable_useForkRef as useForkRef } from '@mui/utils';
15
22
  import { jsx as _jsx } from "react/jsx-runtime";
16
23
  import { jsxs as _jsxs } from "react/jsx-runtime";
17
24
  function convertColor(color) {
@@ -33,14 +40,17 @@ function convertSize(size) {
33
40
  large: 'lg'
34
41
  }[size] : size;
35
42
  }
36
- function convertVariant(variant) {
37
- return variant ? {
43
+ function convertVariant(variant, defaultVariant = 'plain') {
44
+ if (!variant) {
45
+ return defaultVariant;
46
+ }
47
+ return {
48
+ standard: 'outlined',
38
49
  outlined: 'outlined',
39
50
  contained: 'solid',
40
51
  text: 'plain',
41
- standard: 'plain',
42
52
  filled: 'soft'
43
- }[variant] : variant;
53
+ }[variant] || defaultVariant;
44
54
  }
45
55
  const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
46
56
  let {
@@ -61,36 +71,46 @@ const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
61
71
  onChange: onChange
62
72
  }));
63
73
  });
64
- const TextField = /*#__PURE__*/React.forwardRef(({
65
- onChange,
66
- label,
67
- placeholder,
68
- value,
69
- inputRef,
70
- type
71
- }, ref) => {
74
+ const TextField = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
75
+ let {
76
+ onChange,
77
+ label,
78
+ placeholder,
79
+ value,
80
+ inputRef,
81
+ type,
82
+ size,
83
+ variant
84
+ } = _ref2,
85
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
86
+ const rootRef = useForkRef(ref, props.InputProps?.ref);
87
+ const inputForkRef = useForkRef(inputRef, props?.inputProps?.ref);
88
+ const {
89
+ startAdornment,
90
+ endAdornment
91
+ } = props.InputProps || {};
72
92
  return /*#__PURE__*/_jsxs(JoyFormControl, {
73
- ref: ref,
93
+ ref: rootRef,
74
94
  children: [/*#__PURE__*/_jsx(JoyFormLabel, {
75
- sx: {
76
- fontSize: 12
77
- },
78
95
  children: label
79
96
  }), /*#__PURE__*/_jsx(JoyInput, {
80
97
  type: type,
81
98
  value: value,
82
99
  onChange: onChange,
83
100
  placeholder: placeholder,
84
- size: "sm",
101
+ variant: convertVariant(variant, 'outlined'),
102
+ size: convertSize(size),
85
103
  slotProps: {
86
- input: {
87
- ref: inputRef
88
- }
89
- }
104
+ input: _extends({}, props?.inputProps, {
105
+ ref: inputForkRef
106
+ })
107
+ },
108
+ startDecorator: startAdornment,
109
+ endDecorator: endAdornment
90
110
  })]
91
111
  });
92
112
  });
93
- const Button = /*#__PURE__*/React.forwardRef(function Button(_ref2, ref) {
113
+ const Button = /*#__PURE__*/React.forwardRef(function Button(_ref3, ref) {
94
114
  let {
95
115
  startIcon,
96
116
  color,
@@ -98,25 +118,25 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(_ref2, ref) {
98
118
  size,
99
119
  sx,
100
120
  variant
101
- } = _ref2,
102
- props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
121
+ } = _ref3,
122
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
103
123
  return /*#__PURE__*/_jsx(JoyButton, _extends({}, props, {
104
124
  size: convertSize(size),
105
125
  color: convertColor(color),
106
- variant: convertVariant(variant) ?? 'plain',
126
+ variant: convertVariant(variant),
107
127
  ref: ref,
108
128
  startDecorator: startIcon,
109
129
  endDecorator: endIcon,
110
130
  sx: sx
111
131
  }));
112
132
  });
113
- const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref3, ref) {
133
+ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref4, ref) {
114
134
  let {
115
135
  color,
116
136
  size,
117
137
  sx
118
- } = _ref3,
119
- props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
138
+ } = _ref4,
139
+ props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
120
140
  return /*#__PURE__*/_jsx(JoyIconButton, _extends({}, props, {
121
141
  size: convertSize(size),
122
142
  color: convertColor(color) ?? 'neutral',
@@ -125,7 +145,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref3, ref)
125
145
  sx: sx
126
146
  }));
127
147
  });
128
- const Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref4, ref) {
148
+ const Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref5, ref) {
129
149
  let {
130
150
  name,
131
151
  color: colorProp,
@@ -137,8 +157,8 @@ const Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref4, ref) {
137
157
  sx,
138
158
  onChange,
139
159
  onClick
140
- } = _ref4,
141
- props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
160
+ } = _ref5,
161
+ props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
142
162
  return /*#__PURE__*/_jsx(JoySwitch, _extends({}, props, {
143
163
  onChange: onChange,
144
164
  size: convertSize(size),
@@ -161,15 +181,96 @@ const Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref4, ref) {
161
181
  }), ...(Array.isArray(sx) ? sx : [sx])]
162
182
  }));
163
183
  });
184
+ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
185
+ let {
186
+ open,
187
+ onOpen,
188
+ value,
189
+ onChange,
190
+ size,
191
+ color,
192
+ variant,
193
+ MenuProps,
194
+ inputRef,
195
+ labelId
196
+ } = _ref6,
197
+ props = _objectWithoutPropertiesLoose(_ref6, _excluded6);
198
+ const handleChange = (event, newValue) => {
199
+ if (event && onChange) {
200
+ // Same as in https://github.com/mui/material-ui/blob/e5558282a8f36856aef1299f3a36f3235e92e770/packages/mui-material/src/Select/SelectInput.js#L288-L300
201
+
202
+ // Redefine target to allow name and value to be read.
203
+ // This allows seamless integration with the most popular form libraries.
204
+ // https://github.com/mui/material-ui/issues/13485#issuecomment-676048492
205
+ // Clone the event to not override `target` of the original event.
206
+ const nativeEvent = event.nativeEvent || event;
207
+ // @ts-ignore The nativeEvent is function, not object
208
+ const clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
209
+ Object.defineProperty(clonedEvent, 'target', {
210
+ writable: true,
211
+ value: {
212
+ value: newValue,
213
+ name: props.name
214
+ }
215
+ });
216
+ onChange(clonedEvent, null);
217
+ }
218
+ };
219
+ return /*#__PURE__*/_jsx(JoySelect, _extends({}, props, {
220
+ listboxOpen: open,
221
+ onListboxOpenChange: isOpen => {
222
+ if (isOpen) {
223
+ onOpen?.({});
224
+ } else {
225
+ MenuProps?.onClose?.({}, undefined);
226
+ }
227
+ },
228
+ size: convertSize(size),
229
+ color: convertColor(color),
230
+ variant: convertVariant(variant, 'outlined'),
231
+ ref: ref,
232
+ value: value,
233
+ onChange: handleChange,
234
+ slotProps: {
235
+ button: {
236
+ 'aria-labelledby': labelId,
237
+ ref: inputRef
238
+ },
239
+ listbox: {
240
+ disablePortal: false,
241
+ sx: {
242
+ zIndex: 1350
243
+ }
244
+ }
245
+ }
246
+ }));
247
+ });
248
+ const Option = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
249
+ let props = _objectWithoutPropertiesLoose(_ref7, _excluded7);
250
+ return /*#__PURE__*/_jsx(JoyOption, _extends({}, props, {
251
+ ref: ref
252
+ }));
253
+ });
254
+ const InputLabel = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
255
+ let {
256
+ sx
257
+ } = _ref8,
258
+ props = _objectWithoutPropertiesLoose(_ref8, _excluded8);
259
+ return /*#__PURE__*/_jsx(JoyFormLabel, _extends({}, props, {
260
+ ref: ref,
261
+ sx: sx
262
+ }));
263
+ });
164
264
  const joySlots = {
165
265
  baseCheckbox: Checkbox,
166
266
  baseTextField: TextField,
167
267
  baseButton: Button,
168
268
  baseIconButton: IconButton,
169
- baseSwitch: Switch
170
- // BaseFormControl: MUIFormControl,
171
- // baseSelect: Select,
172
- // baseSelectOption: Option,
269
+ baseSwitch: Switch,
270
+ baseSelect: Select,
271
+ baseSelectOption: Option,
272
+ baseInputLabel: InputLabel,
273
+ baseFormControl: JoyFormControl
173
274
  // BaseTooltip: MUITooltip,
174
275
  // BasePopper: MUIPopper,
175
276
  };
@@ -50,7 +50,8 @@ const GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(pro
50
50
  if (process.env.NODE_ENV !== 'production') {
51
51
  // eslint-disable-next-line react-hooks/rules-of-hooks
52
52
  const warnedOnceMissingInPageSizeOptions = React.useRef(false);
53
- if (!warnedOnceMissingInPageSizeOptions.current && !rootProps.autoPageSize && !rootProps.pageSizeOptions.includes(paginationModel.pageSize)) {
53
+ const pageSize = rootProps.paginationModel?.pageSize ?? paginationModel.pageSize;
54
+ if (!warnedOnceMissingInPageSizeOptions.current && !rootProps.autoPageSize && !rootProps.pageSizeOptions.includes(pageSize)) {
54
55
  console.warn([`MUI: The page size \`${paginationModel.pageSize}\` is not preset in the \`pageSizeOptions\``, `Add it to show the pagination select.`].join('\n'));
55
56
  warnedOnceMissingInPageSizeOptions.current = true;
56
57
  }
@@ -26,7 +26,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
26
26
  function GridBody(props) {
27
27
  const {
28
28
  VirtualScrollerComponent,
29
- ColumnHeadersProps
29
+ ColumnHeadersProps,
30
+ children
30
31
  } = props;
31
32
  const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
32
33
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
@@ -127,7 +128,7 @@ function GridBody(props) {
127
128
  , {
128
129
  ref: virtualScrollerRef,
129
130
  disableVirtualization: isVirtualizationDisabled
130
- })]
131
+ }), children]
131
132
  });
132
133
  }
133
134
  process.env.NODE_ENV !== "production" ? GridBody.propTypes = {
@@ -135,6 +136,7 @@ process.env.NODE_ENV !== "production" ? GridBody.propTypes = {
135
136
  // | These PropTypes are generated from the TypeScript type definitions |
136
137
  // | To update them edit the TypeScript types and run "yarn proptypes" |
137
138
  // ----------------------------------------------------------------------
139
+ children: _propTypes.default.node,
138
140
  ColumnHeadersProps: _propTypes.default.object,
139
141
  VirtualScrollerComponent: _propTypes.default.elementType.isRequired
140
142
  } : void 0;