@mui/x-data-grid 9.10.0 → 9.11.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 (43) hide show
  1. package/CHANGELOG.md +224 -0
  2. package/README.md +1 -11
  3. package/components/cell/GridEditInputCell.js +1 -1
  4. package/components/cell/GridEditInputCell.mjs +1 -1
  5. package/components/cell/GridEditLongTextCell.js +1 -1
  6. package/components/cell/GridEditLongTextCell.mjs +1 -1
  7. package/components/toolbarV8/Toolbar.js +2 -125
  8. package/components/toolbarV8/Toolbar.mjs +2 -125
  9. package/components/toolbarV8/ToolbarButton.js +11 -50
  10. package/components/toolbarV8/ToolbarButton.mjs +11 -50
  11. package/hooks/features/columnResize/useGridColumnResize.js +3 -0
  12. package/hooks/features/columnResize/useGridColumnResize.mjs +3 -0
  13. package/hooks/features/columns/useGridColumns.js +5 -1
  14. package/hooks/features/columns/useGridColumns.mjs +5 -1
  15. package/hooks/features/dataSource/useGridDataSourceBase.js +33 -4
  16. package/hooks/features/dataSource/useGridDataSourceBase.mjs +33 -4
  17. package/hooks/features/editing/useGridCellEditing.js +9 -3
  18. package/hooks/features/editing/useGridCellEditing.mjs +9 -3
  19. package/hooks/features/editing/useGridRowEditing.js +7 -5
  20. package/hooks/features/editing/useGridRowEditing.mjs +7 -5
  21. package/hooks/features/filter/useGridFilter.js +1 -1
  22. package/hooks/features/filter/useGridFilter.mjs +1 -1
  23. package/hooks/features/rows/gridRowsUtils.js +17 -1
  24. package/hooks/features/rows/gridRowsUtils.mjs +17 -1
  25. package/hooks/features/rows/useGridParamsApi.d.mts +1 -1
  26. package/hooks/features/rows/useGridParamsApi.d.ts +1 -1
  27. package/hooks/features/rows/useGridParamsApi.js +1 -0
  28. package/hooks/features/rows/useGridParamsApi.mjs +1 -0
  29. package/hooks/features/sorting/useGridSorting.js +3 -0
  30. package/hooks/features/sorting/useGridSorting.mjs +3 -0
  31. package/index.js +1 -1
  32. package/index.mjs +1 -1
  33. package/models/api/gridColumnApi.d.mts +2 -2
  34. package/models/api/gridColumnApi.d.ts +2 -2
  35. package/package.json +4 -4
  36. package/components/toolbarV8/ToolbarContext.d.mts +0 -11
  37. package/components/toolbarV8/ToolbarContext.d.ts +0 -11
  38. package/components/toolbarV8/ToolbarContext.js +0 -21
  39. package/components/toolbarV8/ToolbarContext.mjs +0 -13
  40. package/components/toolbarV8/utils.d.mts +0 -5
  41. package/components/toolbarV8/utils.d.ts +0 -5
  42. package/components/toolbarV8/utils.js +0 -23
  43. package/components/toolbarV8/utils.mjs +0 -17
@@ -8,9 +8,9 @@ export interface GridColumnApi {
8
8
  /**
9
9
  * Returns the [[GridColDef]] for the given `field`.
10
10
  * @param {string} field The column field.
11
- * @returns {{GridStateColDef}} The [[GridStateColDef]].
11
+ * @returns {GridStateColDef | undefined} The [[GridStateColDef]], or `undefined` if the field is not in the current column set.
12
12
  */
13
- getColumn: (field: string) => GridStateColDef;
13
+ getColumn: (field: string) => GridStateColDef | undefined;
14
14
  /**
15
15
  * Returns an array of [[GridColDef]] containing all the column definitions.
16
16
  * @returns {GridStateColDef[]} An array of [[GridStateColDef]].
@@ -8,9 +8,9 @@ export interface GridColumnApi {
8
8
  /**
9
9
  * Returns the [[GridColDef]] for the given `field`.
10
10
  * @param {string} field The column field.
11
- * @returns {{GridStateColDef}} The [[GridStateColDef]].
11
+ * @returns {GridStateColDef | undefined} The [[GridStateColDef]], or `undefined` if the field is not in the current column set.
12
12
  */
13
- getColumn: (field: string) => GridStateColDef;
13
+ getColumn: (field: string) => GridStateColDef | undefined;
14
14
  /**
15
15
  * Returns an array of [[GridColDef]] containing all the column definitions.
16
16
  * @returns {GridStateColDef[]} An array of [[GridStateColDef]].
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "9.10.0",
3
+ "version": "9.11.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The Community plan edition of the MUI X Data Grid components.",
6
6
  "license": "MIT",
@@ -39,12 +39,12 @@
39
39
  "dependencies": {
40
40
  "@babel/runtime": "^7.29.7",
41
41
  "@base-ui/utils": "^0.3.1",
42
- "@mui/utils": "^9.2.0",
42
+ "@mui/utils": "^9.3.0",
43
43
  "clsx": "^2.1.1",
44
44
  "prop-types": "^15.8.1",
45
45
  "use-sync-external-store": "^1.6.0",
46
- "@mui/x-internals": "^9.10.0",
47
- "@mui/x-virtualizer": "0.6.1"
46
+ "@mui/x-internals": "^9.11.0",
47
+ "@mui/x-virtualizer": "0.6.3"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@emotion/react": "^11.9.0",
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- export interface ToolbarContextValue {
3
- focusableItemId: string | null;
4
- registerItem: (id: string, ref: React.RefObject<HTMLButtonElement | null>) => void;
5
- unregisterItem: (id: string) => void;
6
- onItemKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
7
- onItemFocus: (id: string) => void;
8
- onItemDisabled: (id: string, disabled: boolean) => void;
9
- }
10
- export declare const ToolbarContext: React.Context<ToolbarContextValue | undefined>;
11
- export declare function useToolbarContext(): ToolbarContextValue;
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- export interface ToolbarContextValue {
3
- focusableItemId: string | null;
4
- registerItem: (id: string, ref: React.RefObject<HTMLButtonElement | null>) => void;
5
- unregisterItem: (id: string) => void;
6
- onItemKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
7
- onItemFocus: (id: string) => void;
8
- onItemDisabled: (id: string, disabled: boolean) => void;
9
- }
10
- export declare const ToolbarContext: React.Context<ToolbarContextValue | undefined>;
11
- export declare function useToolbarContext(): ToolbarContextValue;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- 'use client';
3
-
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
6
- Object.defineProperty(exports, "__esModule", {
7
- value: true
8
- });
9
- exports.ToolbarContext = void 0;
10
- exports.useToolbarContext = useToolbarContext;
11
- var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
12
- var React = _interopRequireWildcard(require("react"));
13
- const ToolbarContext = exports.ToolbarContext = /*#__PURE__*/React.createContext(undefined);
14
- if (process.env.NODE_ENV !== "production") ToolbarContext.displayName = "ToolbarContext";
15
- function useToolbarContext() {
16
- const context = React.useContext(ToolbarContext);
17
- if (context === undefined) {
18
- throw new Error(process.env.NODE_ENV !== "production" ? 'MUI X: Missing context. Toolbar subcomponents must be placed within a <Toolbar /> component.' : (0, _formatErrorMessage2.default)(63));
19
- }
20
- return context;
21
- }
@@ -1,13 +0,0 @@
1
- 'use client';
2
-
3
- import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
4
- import * as React from 'react';
5
- export const ToolbarContext = /*#__PURE__*/React.createContext(undefined);
6
- if (process.env.NODE_ENV !== "production") ToolbarContext.displayName = "ToolbarContext";
7
- export function useToolbarContext() {
8
- const context = React.useContext(ToolbarContext);
9
- if (context === undefined) {
10
- throw new Error(process.env.NODE_ENV !== "production" ? 'MUI X: Missing context. Toolbar subcomponents must be placed within a <Toolbar /> component.' : _formatErrorMessage(63));
11
- }
12
- return context;
13
- }
@@ -1,5 +0,0 @@
1
- export declare function sortByDocumentPosition(a: {
2
- ref: React.RefObject<HTMLButtonElement | null>;
3
- }, b: {
4
- ref: React.RefObject<HTMLButtonElement | null>;
5
- }): -1 | 0 | 1;
@@ -1,5 +0,0 @@
1
- export declare function sortByDocumentPosition(a: {
2
- ref: React.RefObject<HTMLButtonElement | null>;
3
- }, b: {
4
- ref: React.RefObject<HTMLButtonElement | null>;
5
- }): -1 | 0 | 1;
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.sortByDocumentPosition = sortByDocumentPosition;
7
- /* eslint-disable no-bitwise */
8
- function sortByDocumentPosition(a, b) {
9
- if (!a.ref.current || !b.ref.current) {
10
- return 0;
11
- }
12
- const position = a.ref.current.compareDocumentPosition(b.ref.current);
13
- if (!position) {
14
- return 0;
15
- }
16
- if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) {
17
- return -1;
18
- }
19
- if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) {
20
- return 1;
21
- }
22
- return 0;
23
- }
@@ -1,17 +0,0 @@
1
- /* eslint-disable no-bitwise */
2
- export function sortByDocumentPosition(a, b) {
3
- if (!a.ref.current || !b.ref.current) {
4
- return 0;
5
- }
6
- const position = a.ref.current.compareDocumentPosition(b.ref.current);
7
- if (!position) {
8
- return 0;
9
- }
10
- if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) {
11
- return -1;
12
- }
13
- if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) {
14
- return 1;
15
- }
16
- return 0;
17
- }