@mui/x-data-grid 8.11.1 → 8.11.3

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 (46) hide show
  1. package/CHANGELOG.md +181 -0
  2. package/DataGrid/DataGrid.js +5 -0
  3. package/components/GridShadowScrollArea.js +2 -2
  4. package/components/GridSkeletonLoadingOverlay.js +2 -2
  5. package/components/columnSelection/GridHeaderCheckbox.js +2 -2
  6. package/components/columnsManagement/GridColumnsManagement.js +1 -1
  7. package/components/panel/filterPanel/GridFilterInputBoolean.js +2 -2
  8. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +2 -2
  9. package/components/panel/filterPanel/GridFilterInputValue.js +2 -2
  10. package/components/quickFilter/QuickFilterControl.js +1 -1
  11. package/constants/dataGridPropsDefaultValues.js +1 -0
  12. package/esm/DataGrid/DataGrid.js +5 -0
  13. package/esm/components/GridShadowScrollArea.js +2 -2
  14. package/esm/components/GridSkeletonLoadingOverlay.js +2 -2
  15. package/esm/components/columnSelection/GridHeaderCheckbox.js +2 -2
  16. package/esm/components/columnsManagement/GridColumnsManagement.js +1 -1
  17. package/esm/components/panel/filterPanel/GridFilterInputBoolean.js +2 -2
  18. package/esm/components/panel/filterPanel/GridFilterInputSingleSelect.js +2 -2
  19. package/esm/components/panel/filterPanel/GridFilterInputValue.js +2 -2
  20. package/esm/components/quickFilter/QuickFilterControl.js +1 -1
  21. package/esm/constants/dataGridPropsDefaultValues.js +1 -0
  22. package/esm/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
  23. package/esm/hooks/features/rowSelection/useGridRowSelection.js +2 -2
  24. package/esm/hooks/features/rows/gridRowsSelector.d.ts +6 -0
  25. package/esm/hooks/features/rows/gridRowsSelector.js +8 -0
  26. package/esm/hooks/features/rows/index.d.ts +1 -1
  27. package/esm/hooks/features/rows/index.js +1 -1
  28. package/esm/index.js +1 -1
  29. package/esm/material/index.js +35 -35
  30. package/esm/material/variables.js +31 -3
  31. package/esm/models/gridFilterItem.d.ts +4 -2
  32. package/esm/models/gridFilterOperator.d.ts +1 -1
  33. package/esm/models/props/DataGridProps.d.ts +5 -0
  34. package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
  35. package/hooks/features/rowSelection/useGridRowSelection.js +2 -2
  36. package/hooks/features/rows/gridRowsSelector.d.ts +6 -0
  37. package/hooks/features/rows/gridRowsSelector.js +8 -0
  38. package/hooks/features/rows/index.d.ts +1 -1
  39. package/hooks/features/rows/index.js +7 -0
  40. package/index.js +1 -1
  41. package/material/index.js +35 -35
  42. package/material/variables.js +30 -2
  43. package/models/gridFilterItem.d.ts +4 -2
  44. package/models/gridFilterOperator.d.ts +1 -1
  45. package/models/props/DataGridProps.d.ts +5 -0
  46. package/package.json +4 -4
@@ -12,7 +12,7 @@ var _cssVariables = require("../constants/cssVariables");
12
12
  function useMaterialCSSVariables() {
13
13
  const theme = (0, _styles.useTheme)();
14
14
  return React.useMemo(() => {
15
- const id = (0, _hash.hash)((0, _hash.stringify)(theme));
15
+ const id = (0, _hash.hash)(stringifyTheme(theme));
16
16
  const variables = transformTheme(theme);
17
17
  return {
18
18
  id,
@@ -103,5 +103,33 @@ function formatFont(font) {
103
103
  if (!font) {
104
104
  return undefined;
105
105
  }
106
- return `${font.fontWeight} ${font.fontSize} / ${font.lineHeight} ${font.fontFamily}`;
106
+ const fontSize = typeof font.fontSize === 'number' ? `${font.fontSize}px` : font.fontSize;
107
+ return `${font.fontWeight} ${fontSize} / ${font.lineHeight} ${font.fontFamily}`;
108
+ }
109
+
110
+ /**
111
+ * A version of JSON.stringify for theme objects.
112
+ * Fixes: https://github.com/mui/mui-x/issues/17521
113
+ * Source: https://www.30secondsofcode.org/js/s/stringify-circular-json/
114
+ */
115
+ function stringifyTheme(input) {
116
+ const seen = new WeakSet();
117
+ return JSON.stringify(input, (_, v) => {
118
+ // https://github.com/mui/mui-x/issues/17855
119
+ if (typeof window !== 'undefined' && v === window || typeof document !== 'undefined' && v === document) {
120
+ return v.toString();
121
+ }
122
+ if (v !== null && typeof v === 'object') {
123
+ // Do not attempt to serialize React elements due to performance concerns.
124
+ // Fixes https://github.com/mui/mui-x/issues/19414
125
+ if (/*#__PURE__*/React.isValidElement(v)) {
126
+ return null;
127
+ }
128
+ if (seen.has(v)) {
129
+ return null;
130
+ }
131
+ seen.add(v);
132
+ }
133
+ return v;
134
+ });
107
135
  }
@@ -1,3 +1,4 @@
1
+ import { GridBaseColDef } from "./colDef/gridColDef.js";
1
2
  /**
2
3
  * Filter item definition interface.
3
4
  * @demos
@@ -12,7 +13,7 @@ export interface GridFilterItem {
12
13
  /**
13
14
  * The column from which we want to filter the rows.
14
15
  */
15
- field: string;
16
+ field: GridBaseColDef['field'];
16
17
  /**
17
18
  * The filtering value.
18
19
  * The operator filtering function will decide for each row if the row values is correct compared to this value.
@@ -20,8 +21,9 @@ export interface GridFilterItem {
20
21
  value?: any;
21
22
  /**
22
23
  * The name of the operator we want to apply.
24
+ * A custom operator is supported by providing any string value.
23
25
  */
24
- operator: string;
26
+ operator: 'contains' | 'doesNotContain' | 'equals' | 'doesNotEqual' | 'startsWith' | 'endsWith' | '=' | '!=' | '>' | '>=' | '<' | '<=' | 'is' | 'not' | 'after' | 'onOrAfter' | 'before' | 'onOrBefore' | 'isEmpty' | 'isNotEmpty' | 'isAnyOf' | (string & {});
25
27
  }
26
28
  declare enum GridLogicOperator {
27
29
  And = "and",
@@ -25,7 +25,7 @@ export interface GridFilterOperator<R extends GridValidRowModel = any, V = any,
25
25
  * The name of the filter operator.
26
26
  * It will be matched with the `operator` property of the filter items.
27
27
  */
28
- value: string;
28
+ value: GridFilterItem['operator'];
29
29
  /**
30
30
  * The callback that generates a filtering function for a given filter item and column.
31
31
  * This function can return `null` to skip filtering for this item and column.
@@ -175,6 +175,11 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
175
175
  * @default false
176
176
  */
177
177
  disableRowSelectionOnClick: boolean;
178
+ /**
179
+ * If `true`, the Data Grid will not use the exclude model optimization when selecting all rows.
180
+ * @default false
181
+ */
182
+ disableRowSelectionExcludeModel: boolean;
178
183
  /**
179
184
  * If `true`, the virtualization is disabled.
180
185
  * @default false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "8.11.1",
3
+ "version": "8.11.3",
4
4
  "author": "MUI Team",
5
5
  "description": "The Community plan edition of the MUI X Data Grid components.",
6
6
  "license": "MIT",
@@ -38,12 +38,12 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@babel/runtime": "^7.28.2",
41
- "@mui/utils": "^7.3.1",
41
+ "@mui/utils": "^7.3.2",
42
42
  "clsx": "^2.1.1",
43
43
  "prop-types": "^15.8.1",
44
44
  "use-sync-external-store": "^1.5.0",
45
- "@mui/x-internals": "8.11.1",
46
- "@mui/x-virtualizer": "0.1.5"
45
+ "@mui/x-internals": "8.11.3",
46
+ "@mui/x-virtualizer": "0.1.7"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@emotion/react": "^11.9.0",