@mui/x-data-grid 8.2.0 → 8.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +199 -6
  2. package/components/GridScrollArea.js +1 -2
  3. package/components/base/GridOverlays.js +2 -3
  4. package/components/columnSelection/GridCellCheckboxRenderer.js +4 -2
  5. package/components/columnSelection/GridHeaderCheckbox.js +4 -0
  6. package/esm/components/GridScrollArea.js +1 -2
  7. package/esm/components/base/GridOverlays.js +2 -3
  8. package/esm/components/columnSelection/GridCellCheckboxRenderer.js +6 -4
  9. package/esm/components/columnSelection/GridHeaderCheckbox.js +4 -0
  10. package/esm/hooks/features/columns/gridColumnsUtils.js +15 -7
  11. package/esm/hooks/features/editing/useGridCellEditing.js +2 -1
  12. package/esm/hooks/features/editing/useGridRowEditing.js +7 -6
  13. package/esm/hooks/features/rowSelection/useGridRowSelection.js +6 -6
  14. package/esm/hooks/features/rowSelection/utils.d.ts +4 -1
  15. package/esm/hooks/features/rowSelection/utils.js +34 -33
  16. package/esm/hooks/features/virtualization/useGridVirtualScroller.js +7 -6
  17. package/esm/index.d.ts +1 -0
  18. package/esm/index.js +2 -1
  19. package/esm/locales/koKR.js +68 -76
  20. package/esm/locales/nbNO.js +22 -24
  21. package/esm/material/index.js +24 -24
  22. package/esm/models/api/gridRowSelectionApi.d.ts +4 -2
  23. package/esm/models/events/gridEventLookup.d.ts +1 -0
  24. package/esm/utils/cleanupTracking/TimerBasedCleanupTracking.d.ts +1 -1
  25. package/esm/utils/css/context.js +4 -1
  26. package/hooks/features/columns/gridColumnsUtils.js +15 -7
  27. package/hooks/features/editing/useGridCellEditing.js +2 -1
  28. package/hooks/features/editing/useGridRowEditing.js +6 -5
  29. package/hooks/features/rowSelection/useGridRowSelection.js +6 -6
  30. package/hooks/features/rowSelection/utils.d.ts +4 -1
  31. package/hooks/features/rowSelection/utils.js +35 -35
  32. package/hooks/features/virtualization/useGridVirtualScroller.js +7 -6
  33. package/index.d.ts +1 -0
  34. package/index.js +2 -1
  35. package/locales/koKR.js +68 -76
  36. package/locales/nbNO.js +22 -24
  37. package/material/index.js +24 -24
  38. package/models/api/gridRowSelectionApi.d.ts +4 -2
  39. package/models/events/gridEventLookup.d.ts +1 -0
  40. package/package.json +4 -4
  41. package/utils/cleanupTracking/TimerBasedCleanupTracking.d.ts +1 -1
  42. package/utils/css/context.js +4 -1
package/material/index.js CHANGED
@@ -64,19 +64,19 @@ const _excluded = ["id", "label", "labelId", "material", "disabled", "slotProps"
64
64
  _excluded7 = ["material"],
65
65
  _excluded8 = ["material"],
66
66
  _excluded9 = ["material"],
67
+ _excluded0 = ["material"],
68
+ _excluded1 = ["material"],
67
69
  _excluded10 = ["material"],
68
- _excluded11 = ["material"],
70
+ _excluded11 = ["material", "label", "className"],
69
71
  _excluded12 = ["material"],
70
- _excluded13 = ["material", "label", "className"],
71
- _excluded14 = ["material"],
72
- _excluded15 = ["inert", "iconStart", "iconEnd", "children", "material"],
73
- _excluded16 = ["slotProps", "material"],
74
- _excluded17 = ["id", "multiple", "freeSolo", "options", "getOptionLabel", "isOptionEqualToValue", "value", "onChange", "label", "placeholder", "slotProps", "material"],
75
- _excluded18 = ["key"],
76
- _excluded19 = ["inputProps", "InputProps", "InputLabelProps"],
77
- _excluded20 = ["slotProps", "material"],
78
- _excluded21 = ["ref", "open", "children", "className", "clickAwayTouchEvent", "clickAwayMouseEvent", "flip", "focusTrap", "onExited", "onClickAway", "onDidShow", "onDidHide", "id", "target", "transition", "placement", "material"],
79
- _excluded22 = ["native"];
72
+ _excluded13 = ["inert", "iconStart", "iconEnd", "children", "material"],
73
+ _excluded14 = ["slotProps", "material"],
74
+ _excluded15 = ["id", "multiple", "freeSolo", "options", "getOptionLabel", "isOptionEqualToValue", "value", "onChange", "label", "placeholder", "slotProps", "material"],
75
+ _excluded16 = ["key"],
76
+ _excluded17 = ["inputProps", "InputProps", "InputLabelProps"],
77
+ _excluded18 = ["slotProps", "material"],
78
+ _excluded19 = ["ref", "open", "children", "className", "clickAwayTouchEvent", "clickAwayMouseEvent", "flip", "focusTrap", "onExited", "onClickAway", "onDidShow", "onDidHide", "id", "target", "transition", "placement", "material"],
79
+ _excluded20 = ["native"];
80
80
  /* eslint-disable material-ui/disallow-react-api-in-server-components */
81
81
 
82
82
  const InputAdornment = (0, _styles.styled)(_InputAdornment.default)(({
@@ -340,7 +340,7 @@ const BaseIconButton = (0, _forwardRef.forwardRef)(function BaseIconButton(props
340
340
  const {
341
341
  material
342
342
  } = props,
343
- rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded10);
343
+ rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded0);
344
344
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, (0, _extends2.default)({}, rest, material, {
345
345
  ref: ref
346
346
  }));
@@ -349,7 +349,7 @@ const BaseTooltip = (0, _forwardRef.forwardRef)(function BaseTooltip(props, ref)
349
349
  const {
350
350
  material
351
351
  } = props,
352
- rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded11);
352
+ rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded1);
353
353
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, (0, _extends2.default)({}, rest, material, {
354
354
  ref: ref
355
355
  }));
@@ -358,7 +358,7 @@ const BaseSkeleton = (0, _forwardRef.forwardRef)(function BaseSkeleton(props, re
358
358
  const {
359
359
  material
360
360
  } = props,
361
- rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded12);
361
+ rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded10);
362
362
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Skeleton.default, (0, _extends2.default)({}, rest, material, {
363
363
  ref: ref
364
364
  }));
@@ -369,7 +369,7 @@ const BaseSwitch = (0, _forwardRef.forwardRef)(function BaseSwitch(props, ref) {
369
369
  label,
370
370
  className
371
371
  } = props,
372
- rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded13);
372
+ rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded11);
373
373
  if (!label) {
374
374
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, (0, _extends2.default)({}, rest, material, {
375
375
  className: className,
@@ -388,7 +388,7 @@ const BaseMenuList = (0, _forwardRef.forwardRef)(function BaseMenuList(props, re
388
388
  const {
389
389
  material
390
390
  } = props,
391
- rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded14);
391
+ rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded12);
392
392
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuList.default, (0, _extends2.default)({}, rest, material, {
393
393
  ref: ref
394
394
  }));
@@ -401,7 +401,7 @@ function BaseMenuItem(props) {
401
401
  children,
402
402
  material
403
403
  } = props,
404
- other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded15);
404
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded13);
405
405
  if (inert) {
406
406
  other.disableRipple = true;
407
407
  }
@@ -420,7 +420,7 @@ function BaseTextField(props) {
420
420
  slotProps,
421
421
  material
422
422
  } = props,
423
- rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded16);
423
+ rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded14);
424
424
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, (0, _extends2.default)({
425
425
  variant: "outlined"
426
426
  }, rest, material, {
@@ -447,7 +447,7 @@ function BaseAutocomplete(props) {
447
447
  slotProps,
448
448
  material
449
449
  } = props,
450
- rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded17);
450
+ rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded15);
451
451
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Autocomplete.default, (0, _extends2.default)({
452
452
  id: id,
453
453
  multiple: multiple,
@@ -464,7 +464,7 @@ function BaseAutocomplete(props) {
464
464
  {
465
465
  key
466
466
  } = _getTagProps,
467
- tagProps = (0, _objectWithoutPropertiesLoose2.default)(_getTagProps, _excluded18);
467
+ tagProps = (0, _objectWithoutPropertiesLoose2.default)(_getTagProps, _excluded16);
468
468
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, (0, _extends2.default)({
469
469
  variant: "outlined",
470
470
  size: "small",
@@ -477,7 +477,7 @@ function BaseAutocomplete(props) {
477
477
  InputProps,
478
478
  InputLabelProps
479
479
  } = params,
480
- inputRest = (0, _objectWithoutPropertiesLoose2.default)(params, _excluded19);
480
+ inputRest = (0, _objectWithoutPropertiesLoose2.default)(params, _excluded17);
481
481
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, (0, _extends2.default)({}, inputRest, {
482
482
  label: label,
483
483
  placeholder: placeholder,
@@ -501,7 +501,7 @@ function transformInputProps(props, wrapAdornments = true) {
501
501
  slotProps,
502
502
  material
503
503
  } = props,
504
- rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded20);
504
+ rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded18);
505
505
  const result = rest;
506
506
  if (wrapAdornments) {
507
507
  if (result.startAdornment) {
@@ -550,7 +550,7 @@ function BasePopper(props) {
550
550
  placement,
551
551
  material
552
552
  } = props,
553
- rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded21);
553
+ rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded19);
554
554
  const modifiers = React.useMemo(() => {
555
555
  const result = [{
556
556
  name: 'preventOverflow',
@@ -648,7 +648,7 @@ function BaseSelectOption(_ref) {
648
648
  let {
649
649
  native
650
650
  } = _ref,
651
- props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded22);
651
+ props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded20);
652
652
  if (native) {
653
653
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", (0, _extends2.default)({}, props));
654
654
  }
@@ -1,5 +1,6 @@
1
1
  import type { GridRowId, GridRowModel } from "../gridRows.js";
2
2
  import type { GridRowSelectionModel } from "../gridRowSelectionModel.js";
3
+ import { GridControlledStateReasonLookup } from "../events/index.js";
3
4
  /**
4
5
  * The selection API interface that is available in the grid [[apiRef]].
5
6
  */
@@ -34,9 +35,10 @@ export interface GridRowSelectionApi {
34
35
  *
35
36
  * ⚠️ Caution: `setRowSelectionModel` doesn't apply the selection propagation automatically.
36
37
  * Pass model returned by API method `getPropagatedRowSelectionModel` instead to apply the selection propagation.
37
- * @param {gridRowSelectionModel} rowSelectionModel The new row selection model
38
+ * @param {gridRowSelectionModel} rowSelectionModel The new row selection model.
39
+ * @param {string} reason The reason for the state change.
38
40
  */
39
- setRowSelectionModel: (rowSelectionModel: GridRowSelectionModel) => void;
41
+ setRowSelectionModel: (rowSelectionModel: GridRowSelectionModel, reason?: GridControlledStateReasonLookup['rowSelection']) => void;
40
42
  }
41
43
  export interface GridRowMultiSelectionApi {
42
44
  /**
@@ -400,6 +400,7 @@ export interface GridControlledStateReasonLookup {
400
400
  filter: 'upsertFilterItem' | 'upsertFilterItems' | 'deleteFilterItem' | 'changeLogicOperator' | 'restoreState' | 'removeAllFilterItems';
401
401
  pagination: 'setPaginationModel' | 'stateRestorePreProcessing';
402
402
  rows: 'addSkeletonRows';
403
+ rowSelection: 'singleRowSelection' | 'multipleRowsSelection';
403
404
  }
404
405
  export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEventLookup, GridHeaderFilterEventLookup, GridColumnGroupHeaderEventLookup, GridCellEventLookup, GridControlledStateEventLookup {
405
406
  /**
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "8.2.0",
4
- "description": "The Community plan edition of the Data Grid components (MUI X).",
3
+ "version": "8.3.1",
5
4
  "author": "MUI Team",
5
+ "description": "The Community plan edition of the MUI X Data Grid components.",
6
6
  "main": "./index.js",
7
7
  "license": "MIT",
8
8
  "bugs": {
@@ -39,13 +39,13 @@
39
39
  "directory": "packages/x-data-grid"
40
40
  },
41
41
  "dependencies": {
42
- "@babel/runtime": "^7.27.0",
42
+ "@babel/runtime": "^7.27.1",
43
43
  "@mui/utils": "^7.0.2",
44
44
  "clsx": "^2.1.1",
45
45
  "prop-types": "^15.8.1",
46
46
  "reselect": "^5.1.1",
47
47
  "use-sync-external-store": "^1.5.0",
48
- "@mui/x-internals": "8.2.0"
48
+ "@mui/x-internals": "8.3.1"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@emotion/react": "^11.9.0",
@@ -1,6 +1,6 @@
1
1
  import { CleanupTracking, UnregisterToken, UnsubscribeFn } from "./CleanupTracking.js";
2
2
  export declare class TimerBasedCleanupTracking implements CleanupTracking {
3
- timeouts?: Map<number, NodeJS.Timeout> | undefined;
3
+ timeouts?: Map<number, number> | undefined;
4
4
  cleanupTimeout: number;
5
5
  constructor(timeout?: number);
6
6
  register(object: any, unsubscribe: UnsubscribeFn, unregisterToken: UnregisterToken): void;
@@ -9,6 +9,7 @@ exports.GridPortalWrapper = GridPortalWrapper;
9
9
  exports.useCSSVariablesClass = useCSSVariablesClass;
10
10
  exports.useCSSVariablesContext = useCSSVariablesContext;
11
11
  var React = _interopRequireWildcard(require("react"));
12
+ var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
12
13
  var _useGridConfiguration = require("../../hooks/utils/useGridConfiguration");
13
14
  var _jsxRuntime = require("react/jsx-runtime");
14
15
  const CLASSNAME_PREFIX = 'MuiDataGridVariables';
@@ -35,19 +36,21 @@ function GridPortalWrapper({
35
36
  }
36
37
  function GridCSSVariablesContext(props) {
37
38
  const config = (0, _useGridConfiguration.useGridConfiguration)();
39
+ const rootProps = (0, _useGridRootProps.useGridRootProps)();
38
40
  const description = config.hooks.useCSSVariables();
39
41
  const context = React.useMemo(() => {
40
42
  const className = `${CLASSNAME_PREFIX}-${description.id}`;
41
43
  const cssString = `.${className}{${variablesToString(description.variables)}}`;
42
44
  const tag = /*#__PURE__*/(0, _jsxRuntime.jsx)("style", {
43
45
  href: `/${className}`,
46
+ nonce: rootProps.nonce,
44
47
  children: cssString
45
48
  });
46
49
  return {
47
50
  className,
48
51
  tag
49
52
  };
50
- }, [description]);
53
+ }, [rootProps.nonce, description]);
51
54
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(CSSVariablesContext.Provider, {
52
55
  value: context,
53
56
  children: props.children