@mui/x-data-grid 9.11.0 → 9.12.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 (178) hide show
  1. package/CHANGELOG.md +165 -0
  2. package/DataGrid/DataGrid.js +3 -1
  3. package/DataGrid/DataGrid.mjs +3 -1
  4. package/DataGrid/useDataGridProps.d.mts +1 -1
  5. package/DataGrid/useDataGridProps.d.ts +1 -1
  6. package/components/cell/GridCell.js +14 -1
  7. package/components/cell/GridCell.mjs +14 -1
  8. package/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
  9. package/components/columnHeaders/GridBaseColumnHeaders.mjs +1 -1
  10. package/components/columnHeaders/GridColumnHeaderItem.js +4 -0
  11. package/components/columnHeaders/GridColumnHeaderItem.mjs +4 -0
  12. package/components/columnHeaders/GridGenericColumnHeaderItem.d.mts +7 -0
  13. package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +7 -0
  14. package/components/columnHeaders/GridGenericColumnHeaderItem.js +5 -4
  15. package/components/columnHeaders/GridGenericColumnHeaderItem.mjs +5 -4
  16. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +18 -6
  17. package/components/panel/filterPanel/GridFilterInputSingleSelect.mjs +18 -6
  18. package/constants/gridClasses.d.mts +12 -0
  19. package/constants/gridClasses.d.ts +12 -0
  20. package/constants/gridClasses.js +1 -1
  21. package/constants/gridClasses.mjs +1 -1
  22. package/constants/localeTextConstants.js +4 -0
  23. package/constants/localeTextConstants.mjs +4 -0
  24. package/hooks/core/useGridApiInitialization.js +5 -1
  25. package/hooks/core/useGridApiInitialization.mjs +5 -1
  26. package/hooks/core/useGridStateInitialization.js +3 -1
  27. package/hooks/core/useGridStateInitialization.mjs +3 -1
  28. package/hooks/core/useGridVirtualizer.js +3 -0
  29. package/hooks/core/useGridVirtualizer.mjs +3 -0
  30. package/hooks/features/columnResize/useGridColumnResize.js +5 -0
  31. package/hooks/features/columnResize/useGridColumnResize.mjs +5 -0
  32. package/hooks/features/columns/gridColumnsUtils.d.mts +1 -1
  33. package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
  34. package/hooks/features/columns/gridColumnsUtils.js +2 -2
  35. package/hooks/features/columns/gridColumnsUtils.mjs +2 -2
  36. package/hooks/features/dataSource/gridDataSourceSelector.js +6 -2
  37. package/hooks/features/dataSource/gridDataSourceSelector.mjs +6 -2
  38. package/hooks/features/dataSource/useGridDataSourceBase.js +14 -1
  39. package/hooks/features/dataSource/useGridDataSourceBase.mjs +14 -1
  40. package/hooks/features/dataSource/useGridDataSourceFilterModelChange.d.mts +9 -0
  41. package/hooks/features/dataSource/useGridDataSourceFilterModelChange.d.ts +9 -0
  42. package/hooks/features/dataSource/useGridDataSourceFilterModelChange.js +57 -0
  43. package/hooks/features/dataSource/useGridDataSourceFilterModelChange.mjs +49 -0
  44. package/hooks/features/editing/useGridCellEditing.js +3 -1
  45. package/hooks/features/editing/useGridCellEditing.mjs +3 -1
  46. package/hooks/features/editing/useGridRowEditing.js +3 -1
  47. package/hooks/features/editing/useGridRowEditing.mjs +3 -1
  48. package/hooks/features/filter/gridFilterUtils.d.mts +13 -0
  49. package/hooks/features/filter/gridFilterUtils.d.ts +13 -0
  50. package/hooks/features/filter/gridFilterUtils.js +32 -1
  51. package/hooks/features/filter/gridFilterUtils.mjs +29 -1
  52. package/hooks/features/filter/useGridFilter.js +1 -21
  53. package/hooks/features/filter/useGridFilter.mjs +2 -22
  54. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +1 -1
  55. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.mjs +1 -1
  56. package/hooks/features/rows/useGridRowSpanning.js +5 -0
  57. package/hooks/features/rows/useGridRowSpanning.mjs +5 -0
  58. package/hooks/features/virtualization/gridVirtualizationSelectors.d.mts +1 -1
  59. package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +1 -1
  60. package/hooks/utils/useGridEvent.d.mts +2 -2
  61. package/hooks/utils/useGridEvent.d.ts +2 -2
  62. package/hooks/utils/useGridEvent.js +2 -0
  63. package/hooks/utils/useGridEvent.mjs +2 -0
  64. package/index.js +1 -1
  65. package/index.mjs +1 -1
  66. package/internals/index.d.mts +2 -0
  67. package/internals/index.d.ts +2 -0
  68. package/internals/index.js +20 -0
  69. package/internals/index.mjs +2 -0
  70. package/locales/arSD.js +5 -0
  71. package/locales/arSD.mjs +5 -0
  72. package/locales/beBY.js +5 -0
  73. package/locales/beBY.mjs +5 -0
  74. package/locales/bgBG.js +5 -0
  75. package/locales/bgBG.mjs +5 -0
  76. package/locales/bnBD.js +5 -0
  77. package/locales/bnBD.mjs +5 -0
  78. package/locales/caES.js +5 -0
  79. package/locales/caES.mjs +5 -0
  80. package/locales/csCZ.js +5 -0
  81. package/locales/csCZ.mjs +5 -0
  82. package/locales/daDK.js +5 -0
  83. package/locales/daDK.mjs +5 -0
  84. package/locales/deDE.js +5 -0
  85. package/locales/deDE.mjs +5 -0
  86. package/locales/elGR.js +5 -0
  87. package/locales/elGR.mjs +5 -0
  88. package/locales/esES.js +5 -0
  89. package/locales/esES.mjs +5 -0
  90. package/locales/faIR.js +5 -0
  91. package/locales/faIR.mjs +5 -0
  92. package/locales/fiFI.js +5 -0
  93. package/locales/fiFI.mjs +5 -0
  94. package/locales/frFR.js +5 -0
  95. package/locales/frFR.mjs +5 -0
  96. package/locales/heIL.js +5 -0
  97. package/locales/heIL.mjs +5 -0
  98. package/locales/hrHR.js +5 -0
  99. package/locales/hrHR.mjs +5 -0
  100. package/locales/huHU.js +5 -0
  101. package/locales/huHU.mjs +5 -0
  102. package/locales/hyAM.js +5 -0
  103. package/locales/hyAM.mjs +5 -0
  104. package/locales/idID.js +5 -0
  105. package/locales/idID.mjs +5 -0
  106. package/locales/isIS.js +5 -0
  107. package/locales/isIS.mjs +5 -0
  108. package/locales/itIT.js +5 -0
  109. package/locales/itIT.mjs +5 -0
  110. package/locales/jaJP.js +5 -0
  111. package/locales/jaJP.mjs +5 -0
  112. package/locales/koKR.js +5 -0
  113. package/locales/koKR.mjs +5 -0
  114. package/locales/nbNO.js +5 -0
  115. package/locales/nbNO.mjs +5 -0
  116. package/locales/nlNL.js +5 -0
  117. package/locales/nlNL.mjs +5 -0
  118. package/locales/nnNO.js +5 -0
  119. package/locales/nnNO.mjs +5 -0
  120. package/locales/plPL.js +5 -0
  121. package/locales/plPL.mjs +5 -0
  122. package/locales/ptBR.js +5 -0
  123. package/locales/ptBR.mjs +5 -0
  124. package/locales/ptPT.js +5 -0
  125. package/locales/ptPT.mjs +5 -0
  126. package/locales/roRO.js +5 -0
  127. package/locales/roRO.mjs +5 -0
  128. package/locales/ruRU.js +5 -0
  129. package/locales/ruRU.mjs +5 -0
  130. package/locales/skSK.js +5 -0
  131. package/locales/skSK.mjs +5 -0
  132. package/locales/svSE.js +5 -0
  133. package/locales/svSE.mjs +5 -0
  134. package/locales/thTH.js +5 -0
  135. package/locales/thTH.mjs +5 -0
  136. package/locales/trTR.js +5 -0
  137. package/locales/trTR.mjs +5 -0
  138. package/locales/ukUA.js +5 -0
  139. package/locales/ukUA.mjs +5 -0
  140. package/locales/urPK.js +5 -0
  141. package/locales/urPK.mjs +5 -0
  142. package/locales/viVN.js +5 -0
  143. package/locales/viVN.mjs +5 -0
  144. package/locales/zhCN.js +5 -0
  145. package/locales/zhCN.mjs +5 -0
  146. package/locales/zhHK.js +5 -0
  147. package/locales/zhHK.mjs +5 -0
  148. package/locales/zhTW.js +5 -0
  149. package/locales/zhTW.mjs +5 -0
  150. package/models/api/gridApiCommon.d.mts +2 -2
  151. package/models/api/gridApiCommon.d.ts +2 -2
  152. package/models/api/gridCallbackDetails.d.mts +11 -1
  153. package/models/api/gridCallbackDetails.d.ts +11 -1
  154. package/models/api/gridLocaleTextApi.d.mts +3 -0
  155. package/models/api/gridLocaleTextApi.d.ts +3 -0
  156. package/models/api/gridRowApi.d.mts +12 -0
  157. package/models/api/gridRowApi.d.ts +12 -0
  158. package/models/api/gridStateApi.d.mts +3 -2
  159. package/models/api/gridStateApi.d.ts +3 -2
  160. package/models/api/index.d.mts +1 -1
  161. package/models/api/index.d.ts +1 -1
  162. package/models/colDef/gridColDef.d.mts +5 -0
  163. package/models/colDef/gridColDef.d.ts +5 -0
  164. package/models/configuration/gridConfiguration.d.mts +13 -1
  165. package/models/configuration/gridConfiguration.d.ts +13 -1
  166. package/models/controlStateItem.d.mts +3 -2
  167. package/models/controlStateItem.d.ts +3 -2
  168. package/models/events/gridEventListener.d.mts +3 -2
  169. package/models/events/gridEventListener.d.ts +3 -2
  170. package/models/props/DataGridProps.d.mts +38 -35
  171. package/models/props/DataGridProps.d.ts +38 -35
  172. package/package.json +3 -3
  173. package/utils/domUtils.js +1 -1
  174. package/utils/domUtils.mjs +1 -1
  175. package/utils/getPublicApiRef.d.mts +2 -2
  176. package/utils/getPublicApiRef.d.ts +2 -2
  177. package/utils/getPublicApiRef.js +15 -3
  178. package/utils/getPublicApiRef.mjs +15 -3
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.upsertFilterItemsInModel = exports.upsertFilterItemInModel = exports.shouldQuickFilterExcludeHiddenColumns = exports.setFilterLogicOperatorInModel = exports.sanitizeFilterModel = exports.removeDiacritics = exports.passFilterLogic = exports.mergeStateWithFilterModel = exports.deleteFilterItemFromModel = exports.cleanFilterItem = exports.buildAggregatedFilterApplier = void 0;
7
+ exports.upsertFilterItemsInModel = exports.upsertFilterItemInModel = exports.shouldQuickFilterExcludeHiddenColumns = exports.setFilterLogicOperatorInModel = exports.sanitizeFilterModel = exports.removeIncompleteFilterItems = exports.removeDiacritics = exports.passFilterLogic = exports.mergeStateWithFilterModel = exports.isFilterItemComplete = exports.deleteFilterItemFromModel = exports.cleanFilterItem = exports.buildAggregatedFilterApplier = void 0;
8
8
  var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _warning = require("@mui/x-internals/warning");
@@ -66,7 +66,38 @@ const setFilterLogicOperatorInModel = (model, logicOperator) => {
66
66
  logicOperator
67
67
  });
68
68
  };
69
+
70
+ /**
71
+ * Whether a filter item carries everything its operator needs to be applied.
72
+ * Operators declaring `requiresFilterValue: false` (`isEmpty`, `isNotEmpty`) stay complete
73
+ * without a value, see https://github.com/mui/mui-x/issues/5402
74
+ */
69
75
  exports.setFilterLogicOperatorInModel = setFilterLogicOperatorInModel;
76
+ const isFilterItemComplete = (item, column) => {
77
+ if (item.value !== undefined) {
78
+ // Some operators like `isAnyOf` take an array as `item.value`. An empty one filters nothing.
79
+ return !(Array.isArray(item.value) && item.value.length === 0);
80
+ }
81
+ const filterOperator = column?.filterOperators?.find(operator => operator.value === item.operator);
82
+ return filterOperator?.requiresFilterValue === false;
83
+ };
84
+
85
+ /**
86
+ * Drops the filter items that cannot be applied, so incomplete items never reach a consumer
87
+ * that would treat them as a real constraint (`dataSource` sending them to a server, for one).
88
+ * Returns the same model reference when every item is complete.
89
+ */
90
+ exports.isFilterItemComplete = isFilterItemComplete;
91
+ const removeIncompleteFilterItems = (model, columnsLookup) => {
92
+ const items = model.items.filter(item => isFilterItemComplete(item, columnsLookup[item.field]));
93
+ if (items.length === model.items.length) {
94
+ return model;
95
+ }
96
+ return (0, _extends2.default)({}, model, {
97
+ items
98
+ });
99
+ };
100
+ exports.removeIncompleteFilterItems = removeIncompleteFilterItems;
70
101
  let hasEval;
71
102
  function getHasEval() {
72
103
  if (hasEval !== undefined) {
@@ -5,7 +5,6 @@ import { GridLogicOperator } from "../../../models/index.mjs";
5
5
  import { getDefaultGridFilterModel } from "./gridFilterState.mjs";
6
6
  import { getPublicApiRef } from "../../../utils/getPublicApiRef.mjs";
7
7
  import { gridColumnFieldsSelector, gridColumnLookupSelector, gridColumnVisibilityModelSelector } from "../columns/index.mjs";
8
-
9
8
  /**
10
9
  * Pure helpers computing a new filter model from an existing one.
11
10
  * Shared by the imperative `apiRef` methods (`useGridFilter`) and the controlled
@@ -57,6 +56,35 @@ export const setFilterLogicOperatorInModel = (model, logicOperator) => {
57
56
  logicOperator
58
57
  });
59
58
  };
59
+
60
+ /**
61
+ * Whether a filter item carries everything its operator needs to be applied.
62
+ * Operators declaring `requiresFilterValue: false` (`isEmpty`, `isNotEmpty`) stay complete
63
+ * without a value, see https://github.com/mui/mui-x/issues/5402
64
+ */
65
+ export const isFilterItemComplete = (item, column) => {
66
+ if (item.value !== undefined) {
67
+ // Some operators like `isAnyOf` take an array as `item.value`. An empty one filters nothing.
68
+ return !(Array.isArray(item.value) && item.value.length === 0);
69
+ }
70
+ const filterOperator = column?.filterOperators?.find(operator => operator.value === item.operator);
71
+ return filterOperator?.requiresFilterValue === false;
72
+ };
73
+
74
+ /**
75
+ * Drops the filter items that cannot be applied, so incomplete items never reach a consumer
76
+ * that would treat them as a real constraint (`dataSource` sending them to a server, for one).
77
+ * Returns the same model reference when every item is complete.
78
+ */
79
+ export const removeIncompleteFilterItems = (model, columnsLookup) => {
80
+ const items = model.items.filter(item => isFilterItemComplete(item, columnsLookup[item.field]));
81
+ if (items.length === model.items.length) {
82
+ return model;
83
+ }
84
+ return _extends({}, model, {
85
+ items
86
+ });
87
+ };
60
88
  let hasEval;
61
89
  function getHasEval() {
62
90
  if (hasEval !== undefined) {
@@ -103,27 +103,7 @@ const useGridFilter = (apiRef, props, configuration) => {
103
103
  logger.debug('Displaying filter panel');
104
104
  if (targetColumnField) {
105
105
  const filterModel = (0, _gridFilterSelector.gridFilterModelSelector)(apiRef);
106
- const filterItemsWithValue = filterModel.items.filter(item => {
107
- if (item.value !== undefined) {
108
- // Some filters like `isAnyOf` support array as `item.value`.
109
- // If array is empty, we want to remove it from the filter model.
110
- if (Array.isArray(item.value) && item.value.length === 0) {
111
- return false;
112
- }
113
- return true;
114
- }
115
- const column = apiRef.current.getColumn(item.field);
116
- const filterOperator = column?.filterOperators?.find(operator => operator.value === item.operator);
117
- const requiresFilterValue = typeof filterOperator?.requiresFilterValue === 'undefined' ? true : filterOperator?.requiresFilterValue;
118
-
119
- // Operators like `isEmpty` don't have and don't require `item.value`.
120
- // So we don't want to remove them from the filter model if `item.value === undefined`.
121
- // See https://github.com/mui/mui-x/issues/5402
122
- if (requiresFilterValue) {
123
- return false;
124
- }
125
- return true;
126
- });
106
+ const filterItemsWithValue = filterModel.items.filter(item => (0, _gridFilterUtils.isFilterItemComplete)(item, apiRef.current.getColumn(item.field)));
127
107
  let newFilterItems;
128
108
  const filterItemOnTarget = filterItemsWithValue.find(item => item.field === targetColumnField);
129
109
  const targetColumn = apiRef.current.getColumn(targetColumnField);
@@ -15,7 +15,7 @@ import { useFirstRender } from "../../utils/useFirstRender.mjs";
15
15
  import { gridRowsLookupSelector } from "../rows/index.mjs";
16
16
  import { useGridRegisterPipeProcessor } from "../../core/pipeProcessing/index.mjs";
17
17
  import { GRID_DEFAULT_STRATEGY, useGridRegisterStrategyProcessor } from "../../core/strategyProcessing/index.mjs";
18
- import { buildAggregatedFilterApplier, sanitizeFilterModel, mergeStateWithFilterModel, cleanFilterItem, passFilterLogic, shouldQuickFilterExcludeHiddenColumns, upsertFilterItemInModel, upsertFilterItemsInModel, deleteFilterItemFromModel, setFilterLogicOperatorInModel } from "./gridFilterUtils.mjs";
18
+ import { buildAggregatedFilterApplier, sanitizeFilterModel, mergeStateWithFilterModel, cleanFilterItem, passFilterLogic, shouldQuickFilterExcludeHiddenColumns, upsertFilterItemInModel, upsertFilterItemsInModel, deleteFilterItemFromModel, setFilterLogicOperatorInModel, isFilterItemComplete } from "./gridFilterUtils.mjs";
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
20
  export const filterStateInitializer = (state, props, apiRef) => {
21
21
  const filterModel = props.filterModel ?? props.initialState?.filter?.filterModel ?? getDefaultGridFilterModel();
@@ -94,27 +94,7 @@ export const useGridFilter = (apiRef, props, configuration) => {
94
94
  logger.debug('Displaying filter panel');
95
95
  if (targetColumnField) {
96
96
  const filterModel = gridFilterModelSelector(apiRef);
97
- const filterItemsWithValue = filterModel.items.filter(item => {
98
- if (item.value !== undefined) {
99
- // Some filters like `isAnyOf` support array as `item.value`.
100
- // If array is empty, we want to remove it from the filter model.
101
- if (Array.isArray(item.value) && item.value.length === 0) {
102
- return false;
103
- }
104
- return true;
105
- }
106
- const column = apiRef.current.getColumn(item.field);
107
- const filterOperator = column?.filterOperators?.find(operator => operator.value === item.operator);
108
- const requiresFilterValue = typeof filterOperator?.requiresFilterValue === 'undefined' ? true : filterOperator?.requiresFilterValue;
109
-
110
- // Operators like `isEmpty` don't have and don't require `item.value`.
111
- // So we don't want to remove them from the filter model if `item.value === undefined`.
112
- // See https://github.com/mui/mui-x/issues/5402
113
- if (requiresFilterValue) {
114
- return false;
115
- }
116
- return true;
117
- });
97
+ const filterItemsWithValue = filterModel.items.filter(item => isFilterItemComplete(item, apiRef.current.getColumn(item.field)));
118
98
  let newFilterItems;
119
99
  const filterItemOnTarget = filterItemsWithValue.find(item => item.field === targetColumnField);
120
100
  const targetColumn = apiRef.current.getColumn(targetColumnField);
@@ -7,7 +7,7 @@ exports.gridHeaderFilteringStateSelector = exports.gridHeaderFilteringMenuSelect
7
7
  var _createSelector = require("../../../utils/createSelector");
8
8
  const gridHeaderFilteringStateSelector = exports.gridHeaderFilteringStateSelector = (0, _createSelector.createRootSelector)(state => state.headerFiltering);
9
9
  const gridHeaderFilteringEnabledSelector = exports.gridHeaderFilteringEnabledSelector = (0, _createSelector.createSelector)(gridHeaderFilteringStateSelector,
10
- // No initialization in MIT, so we need to default to false to be used by `getTotalHeaderHeight`
10
+ // The state is only initialized in Pro, so it is `undefined` on the MIT grid.
11
11
  headerFilteringState => headerFilteringState?.enabled ?? false);
12
12
  const gridHeaderFilteringEditFieldSelector = exports.gridHeaderFilteringEditFieldSelector = (0, _createSelector.createSelector)(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.editing);
13
13
  const gridHeaderFilteringMenuSelector = exports.gridHeaderFilteringMenuSelector = (0, _createSelector.createSelector)(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.menuOpen);
@@ -1,7 +1,7 @@
1
1
  import { createSelector, createRootSelector } from "../../../utils/createSelector.mjs";
2
2
  export const gridHeaderFilteringStateSelector = createRootSelector(state => state.headerFiltering);
3
3
  export const gridHeaderFilteringEnabledSelector = createSelector(gridHeaderFilteringStateSelector,
4
- // No initialization in MIT, so we need to default to false to be used by `getTotalHeaderHeight`
4
+ // The state is only initialized in Pro, so it is `undefined` on the MIT grid.
5
5
  headerFilteringState => headerFilteringState?.enabled ?? false);
6
6
  export const gridHeaderFilteringEditFieldSelector = createSelector(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.editing);
7
7
  export const gridHeaderFilteringMenuSelector = createSelector(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.menuOpen);
@@ -15,6 +15,7 @@ var _useGridVisibleRows = require("../../utils/useGridVisibleRows");
15
15
  var _gridVirtualizationSelectors = require("../virtualization/gridVirtualizationSelectors");
16
16
  var _gridRowSpanningUtils = require("./gridRowSpanningUtils");
17
17
  var _useGridEvent = require("../../utils/useGridEvent");
18
+ var _useGridApiMethod = require("../../utils/useGridApiMethod");
18
19
  var _utils = require("../../../utils/utils");
19
20
  var _useRunOncePerLoop = require("../../utils/useRunOncePerLoop");
20
21
  const EMPTY_CACHES = {
@@ -200,6 +201,10 @@ const useGridRowSpanning = (apiRef, props) => {
200
201
  (0, _useGridEvent.useGridEvent)(apiRef, 'filteredRowsSet', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
201
202
  (0, _useGridEvent.useGridEvent)(apiRef, 'columnsChange', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
202
203
  (0, _useGridEvent.useGridEvent)(apiRef, 'rowExpansionChange', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
204
+ const rowSpanningPrivateApi = {
205
+ resetRowSpanningState: (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState)
206
+ };
207
+ (0, _useGridApiMethod.useGridApiMethod)(apiRef, rowSpanningPrivateApi, 'private');
203
208
  React.useEffect(() => {
204
209
  const store = apiRef.current.virtualizer?.store;
205
210
  if (!store) {
@@ -8,6 +8,7 @@ import { getVisibleRows } from "../../utils/useGridVisibleRows.mjs";
8
8
  import { gridRenderContextSelector } from "../virtualization/gridVirtualizationSelectors.mjs";
9
9
  import { getUnprocessedRange, isRowContextInitialized, getCellValue } from "./gridRowSpanningUtils.mjs";
10
10
  import { useGridEvent } from "../../utils/useGridEvent.mjs";
11
+ import { useGridApiMethod } from "../../utils/useGridApiMethod.mjs";
11
12
  import { runIf } from "../../../utils/utils.mjs";
12
13
  import { useRunOncePerLoop } from "../../utils/useRunOncePerLoop.mjs";
13
14
  const EMPTY_CACHES = {
@@ -192,6 +193,10 @@ export const useGridRowSpanning = (apiRef, props) => {
192
193
  useGridEvent(apiRef, 'filteredRowsSet', runIf(props.rowSpanning, resetRowSpanningState));
193
194
  useGridEvent(apiRef, 'columnsChange', runIf(props.rowSpanning, resetRowSpanningState));
194
195
  useGridEvent(apiRef, 'rowExpansionChange', runIf(props.rowSpanning, resetRowSpanningState));
196
+ const rowSpanningPrivateApi = {
197
+ resetRowSpanningState: runIf(props.rowSpanning, resetRowSpanningState)
198
+ };
199
+ useGridApiMethod(apiRef, rowSpanningPrivateApi, 'private');
195
200
  React.useEffect(() => {
196
201
  const store = apiRef.current.virtualizer?.store;
197
202
  if (!store) {
@@ -34,7 +34,7 @@ export declare const gridVirtualizationRowEnabledSelector: (args_0: import("reac
34
34
  */
35
35
  export declare const gridVirtualizationLayoutModeSelector: (args_0: import("react").RefObject<{
36
36
  state: GridStateCommunity;
37
- } | null>) => "controlled" | "uncontrolled";
37
+ } | null>) => "controlled" | "sticky" | "uncontrolled";
38
38
  /**
39
39
  * Get the render context
40
40
  * @category Virtualization
@@ -34,7 +34,7 @@ export declare const gridVirtualizationRowEnabledSelector: (args_0: import("reac
34
34
  */
35
35
  export declare const gridVirtualizationLayoutModeSelector: (args_0: import("react").RefObject<{
36
36
  state: GridStateCommunity;
37
- } | null>) => "controlled" | "uncontrolled";
37
+ } | null>) => "controlled" | "sticky" | "uncontrolled";
38
38
  /**
39
39
  * Get the render context
40
40
  * @category Virtualization
@@ -4,8 +4,8 @@ import type { GridEventListener, GridEvents } from "../../models/events/index.mj
4
4
  import { TimerBasedCleanupTracking } from "../../utils/cleanupTracking/TimerBasedCleanupTracking.mjs";
5
5
  import { FinalizationRegistryBasedCleanupTracking } from "../../utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.mjs";
6
6
  import type { GridApiCommon } from "../../models/index.mjs";
7
- export declare function useGridEvent<Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E>, options?: EventListenerOptions): void;
8
- export declare function useGridEventPriority<Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E>): void;
7
+ export declare function useGridEvent<Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E, Api>, options?: EventListenerOptions): void;
8
+ export declare function useGridEventPriority<Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E, Api>): void;
9
9
  export declare function unstable_resetCleanupTracking(): void;
10
10
  export declare const internal_registryContainer: {
11
11
  current: FinalizationRegistryBasedCleanupTracking | TimerBasedCleanupTracking;
@@ -4,8 +4,8 @@ import type { GridEventListener, GridEvents } from "../../models/events/index.js
4
4
  import { TimerBasedCleanupTracking } from "../../utils/cleanupTracking/TimerBasedCleanupTracking.js";
5
5
  import { FinalizationRegistryBasedCleanupTracking } from "../../utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.js";
6
6
  import type { GridApiCommon } from "../../models/index.js";
7
- export declare function useGridEvent<Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E>, options?: EventListenerOptions): void;
8
- export declare function useGridEventPriority<Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E>): void;
7
+ export declare function useGridEvent<Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E, Api>, options?: EventListenerOptions): void;
8
+ export declare function useGridEventPriority<Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E, Api>): void;
9
9
  export declare function unstable_resetCleanupTracking(): void;
10
10
  export declare const internal_registryContainer: {
11
11
  current: FinalizationRegistryBasedCleanupTracking | TimerBasedCleanupTracking;
@@ -32,6 +32,8 @@ function useGridEvent(apiRef, eventName, handler, options) {
32
32
  handlerRef.current = handler;
33
33
  const cleanupTokenRef = React.useRef(null);
34
34
  if (!subscription.current && handlerRef.current) {
35
+ // The event system is typed against `GridApiCommon`, while the handler can be typed
36
+ // against the package-specific API: `any` bridges the two at this single boundary.
35
37
  const enhancedHandler = (params, event, details) => {
36
38
  // Check for the existence of the event once more to avoid Safari 26 issue
37
39
  // https://github.com/mui/mui-x/issues/20159
@@ -23,6 +23,8 @@ export function useGridEvent(apiRef, eventName, handler, options) {
23
23
  handlerRef.current = handler;
24
24
  const cleanupTokenRef = React.useRef(null);
25
25
  if (!subscription.current && handlerRef.current) {
26
+ // The event system is typed against `GridApiCommon`, while the handler can be typed
27
+ // against the package-specific API: `any` bridges the two at this single boundary.
26
28
  const enhancedHandler = (params, event, details) => {
27
29
  // Check for the existence of the event once more to avoid Safari 26 issue
28
30
  // https://github.com/mui/mui-x/issues/20159
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v9.11.0
2
+ * @mui/x-data-grid v9.12.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v9.11.0
2
+ * @mui/x-data-grid v9.12.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -101,8 +101,10 @@ export { DataSourceRowsUpdateStrategy } from "../hooks/features/dataSource/utils
101
101
  export { useGridDataSourceBase } from "../hooks/features/dataSource/useGridDataSourceBase.mjs";
102
102
  export { CacheChunkManager } from "../hooks/features/dataSource/utils.mjs";
103
103
  export { gridGetRowsParamsSelector } from "../hooks/features/dataSource/gridDataSourceSelector.mjs";
104
+ export { useGridDataSourceFilterModelChange } from "../hooks/features/dataSource/useGridDataSourceFilterModelChange.mjs";
104
105
  export { getColumnsToExport, defaultGetRowsToExport } from "../hooks/features/export/utils.mjs";
105
106
  export * from "../utils/createControllablePromise.mjs";
107
+ export * from "../utils/focusElement.mjs";
106
108
  export * from "../utils/rtlFlipSide.mjs";
107
109
  export { NotRendered } from "../utils/assert.mjs";
108
110
  export { createSelector, createRootSelector, createSelectorMemoized } from "../utils/createSelector.mjs";
@@ -101,8 +101,10 @@ export { DataSourceRowsUpdateStrategy } from "../hooks/features/dataSource/utils
101
101
  export { useGridDataSourceBase } from "../hooks/features/dataSource/useGridDataSourceBase.js";
102
102
  export { CacheChunkManager } from "../hooks/features/dataSource/utils.js";
103
103
  export { gridGetRowsParamsSelector } from "../hooks/features/dataSource/gridDataSourceSelector.js";
104
+ export { useGridDataSourceFilterModelChange } from "../hooks/features/dataSource/useGridDataSourceFilterModelChange.js";
104
105
  export { getColumnsToExport, defaultGetRowsToExport } from "../hooks/features/export/utils.js";
105
106
  export * from "../utils/createControllablePromise.js";
107
+ export * from "../utils/focusElement.js";
106
108
  export * from "../utils/rtlFlipSide.js";
107
109
  export { NotRendered } from "../utils/assert.js";
108
110
  export { createSelector, createRootSelector, createSelectorMemoized } from "../utils/createSelector.js";
@@ -117,6 +117,7 @@ var _exportNames = {
117
117
  CacheChunkManager: true,
118
118
  useGridDataSourceBase: true,
119
119
  gridGetRowsParamsSelector: true,
120
+ useGridDataSourceFilterModelChange: true,
120
121
  getColumnsToExport: true,
121
122
  defaultGetRowsToExport: true,
122
123
  NotRendered: true,
@@ -736,6 +737,12 @@ Object.defineProperty(exports, "useGridDataSourceBase", {
736
737
  return _useGridDataSourceBase.useGridDataSourceBase;
737
738
  }
738
739
  });
740
+ Object.defineProperty(exports, "useGridDataSourceFilterModelChange", {
741
+ enumerable: true,
742
+ get: function () {
743
+ return _useGridDataSourceFilterModelChange.useGridDataSourceFilterModelChange;
744
+ }
745
+ });
739
746
  Object.defineProperty(exports, "useGridDensity", {
740
747
  enumerable: true,
741
748
  get: function () {
@@ -1108,6 +1115,7 @@ var _usePinnedScrollOffset = require("../hooks/utils/usePinnedScrollOffset");
1108
1115
  var _utils2 = require("../hooks/features/dataSource/utils");
1109
1116
  var _useGridDataSourceBase = require("../hooks/features/dataSource/useGridDataSourceBase");
1110
1117
  var _gridDataSourceSelector = require("../hooks/features/dataSource/gridDataSourceSelector");
1118
+ var _useGridDataSourceFilterModelChange = require("../hooks/features/dataSource/useGridDataSourceFilterModelChange");
1111
1119
  var _utils3 = require("../hooks/features/export/utils");
1112
1120
  var _createControllablePromise = require("../utils/createControllablePromise");
1113
1121
  Object.keys(_createControllablePromise).forEach(function (key) {
@@ -1121,6 +1129,18 @@ Object.keys(_createControllablePromise).forEach(function (key) {
1121
1129
  }
1122
1130
  });
1123
1131
  });
1132
+ var _focusElement = require("../utils/focusElement");
1133
+ Object.keys(_focusElement).forEach(function (key) {
1134
+ if (key === "default" || key === "__esModule") return;
1135
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
1136
+ if (key in exports && exports[key] === _focusElement[key]) return;
1137
+ Object.defineProperty(exports, key, {
1138
+ enumerable: true,
1139
+ get: function () {
1140
+ return _focusElement[key];
1141
+ }
1142
+ });
1143
+ });
1124
1144
  var _rtlFlipSide = require("../utils/rtlFlipSide");
1125
1145
  Object.keys(_rtlFlipSide).forEach(function (key) {
1126
1146
  if (key === "default" || key === "__esModule") return;
@@ -79,8 +79,10 @@ export { DataSourceRowsUpdateStrategy } from "../hooks/features/dataSource/utils
79
79
  export { useGridDataSourceBase } from "../hooks/features/dataSource/useGridDataSourceBase.mjs";
80
80
  export { CacheChunkManager } from "../hooks/features/dataSource/utils.mjs";
81
81
  export { gridGetRowsParamsSelector } from "../hooks/features/dataSource/gridDataSourceSelector.mjs";
82
+ export { useGridDataSourceFilterModelChange } from "../hooks/features/dataSource/useGridDataSourceFilterModelChange.mjs";
82
83
  export { getColumnsToExport, defaultGetRowsToExport } from "../hooks/features/export/utils.mjs";
83
84
  export * from "../utils/createControllablePromise.mjs";
85
+ export * from "../utils/focusElement.mjs";
84
86
  export * from "../utils/rtlFlipSide.mjs";
85
87
  export { NotRendered } from "../utils/assert.mjs";
86
88
  export { createSelector, createRootSelector, createSelectorMemoized } from "../utils/createSelector.mjs";
package/locales/arSD.js CHANGED
@@ -51,6 +51,11 @@ const arSDGrid = {
51
51
  // Toolbar AI Assistant button
52
52
  // toolbarAssistant: 'AI Assistant',
53
53
 
54
+ // Formula bar (Premium formulas)
55
+ // formulaBarLabel: 'Formula bar',
56
+ // formulaBarInputLabel: 'Formula',
57
+ // formulaBarAddressLabel: 'Active cell',
58
+
54
59
  // Columns management text
55
60
  columnsManagementSearchTitle: 'بحث',
56
61
  columnsManagementNoColumns: 'لا يوجد أعمدة',
package/locales/arSD.mjs CHANGED
@@ -45,6 +45,11 @@ const arSDGrid = {
45
45
  // Toolbar AI Assistant button
46
46
  // toolbarAssistant: 'AI Assistant',
47
47
 
48
+ // Formula bar (Premium formulas)
49
+ // formulaBarLabel: 'Formula bar',
50
+ // formulaBarInputLabel: 'Formula',
51
+ // formulaBarAddressLabel: 'Active cell',
52
+
48
53
  // Columns management text
49
54
  columnsManagementSearchTitle: 'بحث',
50
55
  columnsManagementNoColumns: 'لا يوجد أعمدة',
package/locales/beBY.js CHANGED
@@ -64,6 +64,11 @@ const beBYGrid = {
64
64
  // Toolbar AI Assistant button
65
65
  // toolbarAssistant: 'AI Assistant',
66
66
 
67
+ // Formula bar (Premium formulas)
68
+ // formulaBarLabel: 'Formula bar',
69
+ // formulaBarInputLabel: 'Formula',
70
+ // formulaBarAddressLabel: 'Active cell',
71
+
67
72
  // Columns management text
68
73
  // columnsManagementSearchTitle: 'Search',
69
74
  // columnsManagementNoColumns: 'No columns',
package/locales/beBY.mjs CHANGED
@@ -58,6 +58,11 @@ const beBYGrid = {
58
58
  // Toolbar AI Assistant button
59
59
  // toolbarAssistant: 'AI Assistant',
60
60
 
61
+ // Formula bar (Premium formulas)
62
+ // formulaBarLabel: 'Formula bar',
63
+ // formulaBarInputLabel: 'Formula',
64
+ // formulaBarAddressLabel: 'Active cell',
65
+
61
66
  // Columns management text
62
67
  // columnsManagementSearchTitle: 'Search',
63
68
  // columnsManagementNoColumns: 'No columns',
package/locales/bgBG.js CHANGED
@@ -50,6 +50,11 @@ const bgBGGrid = {
50
50
  // Toolbar AI Assistant button
51
51
  // toolbarAssistant: 'AI Assistant',
52
52
 
53
+ // Formula bar (Premium formulas)
54
+ // formulaBarLabel: 'Formula bar',
55
+ // formulaBarInputLabel: 'Formula',
56
+ // formulaBarAddressLabel: 'Active cell',
57
+
53
58
  // Columns management text
54
59
  columnsManagementSearchTitle: 'Търсене',
55
60
  columnsManagementNoColumns: 'Няма колони',
package/locales/bgBG.mjs CHANGED
@@ -44,6 +44,11 @@ const bgBGGrid = {
44
44
  // Toolbar AI Assistant button
45
45
  // toolbarAssistant: 'AI Assistant',
46
46
 
47
+ // Formula bar (Premium formulas)
48
+ // formulaBarLabel: 'Formula bar',
49
+ // formulaBarInputLabel: 'Formula',
50
+ // formulaBarAddressLabel: 'Active cell',
51
+
47
52
  // Columns management text
48
53
  columnsManagementSearchTitle: 'Търсене',
49
54
  columnsManagementNoColumns: 'Няма колони',
package/locales/bnBD.js CHANGED
@@ -50,6 +50,11 @@ const bnBDGrid = {
50
50
  // Toolbar AI Assistant button
51
51
  // toolbarAssistant: 'AI Assistant',
52
52
 
53
+ // Formula bar (Premium formulas)
54
+ // formulaBarLabel: 'Formula bar',
55
+ // formulaBarInputLabel: 'Formula',
56
+ // formulaBarAddressLabel: 'Active cell',
57
+
53
58
  // Columns management text
54
59
  columnsManagementSearchTitle: 'অনুসন্ধান',
55
60
  columnsManagementNoColumns: 'কোনো কলাম নেই',
package/locales/bnBD.mjs CHANGED
@@ -44,6 +44,11 @@ const bnBDGrid = {
44
44
  // Toolbar AI Assistant button
45
45
  // toolbarAssistant: 'AI Assistant',
46
46
 
47
+ // Formula bar (Premium formulas)
48
+ // formulaBarLabel: 'Formula bar',
49
+ // formulaBarInputLabel: 'Formula',
50
+ // formulaBarAddressLabel: 'Active cell',
51
+
47
52
  // Columns management text
48
53
  columnsManagementSearchTitle: 'অনুসন্ধান',
49
54
  columnsManagementNoColumns: 'কোনো কলাম নেই',
package/locales/caES.js CHANGED
@@ -47,6 +47,11 @@ const caESGrid = {
47
47
  toolbarCharts: 'Gràfics',
48
48
  // Toolbar AI Assistant button
49
49
  toolbarAssistant: "Assistent d'IA",
50
+ // Formula bar (Premium formulas)
51
+ // formulaBarLabel: 'Formula bar',
52
+ // formulaBarInputLabel: 'Formula',
53
+ // formulaBarAddressLabel: 'Active cell',
54
+
50
55
  // Columns management text
51
56
  columnsManagementSearchTitle: 'Cerca',
52
57
  columnsManagementNoColumns: 'Sense columnes',
package/locales/caES.mjs CHANGED
@@ -41,6 +41,11 @@ const caESGrid = {
41
41
  toolbarCharts: 'Gràfics',
42
42
  // Toolbar AI Assistant button
43
43
  toolbarAssistant: "Assistent d'IA",
44
+ // Formula bar (Premium formulas)
45
+ // formulaBarLabel: 'Formula bar',
46
+ // formulaBarInputLabel: 'Formula',
47
+ // formulaBarAddressLabel: 'Active cell',
48
+
44
49
  // Columns management text
45
50
  columnsManagementSearchTitle: 'Cerca',
46
51
  columnsManagementNoColumns: 'Sense columnes',
package/locales/csCZ.js CHANGED
@@ -59,6 +59,11 @@ const csCZGrid = {
59
59
  // Toolbar AI Assistant button
60
60
  // toolbarAssistant: 'AI Assistant',
61
61
 
62
+ // Formula bar (Premium formulas)
63
+ // formulaBarLabel: 'Formula bar',
64
+ // formulaBarInputLabel: 'Formula',
65
+ // formulaBarAddressLabel: 'Active cell',
66
+
62
67
  // Columns management text
63
68
  columnsManagementSearchTitle: 'Hledat sloupce',
64
69
  columnsManagementNoColumns: 'Žádné sloupce',
package/locales/csCZ.mjs CHANGED
@@ -53,6 +53,11 @@ const csCZGrid = {
53
53
  // Toolbar AI Assistant button
54
54
  // toolbarAssistant: 'AI Assistant',
55
55
 
56
+ // Formula bar (Premium formulas)
57
+ // formulaBarLabel: 'Formula bar',
58
+ // formulaBarInputLabel: 'Formula',
59
+ // formulaBarAddressLabel: 'Active cell',
60
+
56
61
  // Columns management text
57
62
  columnsManagementSearchTitle: 'Hledat sloupce',
58
63
  columnsManagementNoColumns: 'Žádné sloupce',
package/locales/daDK.js CHANGED
@@ -50,6 +50,11 @@ const daDKGrid = {
50
50
  // Toolbar AI Assistant button
51
51
  // toolbarAssistant: 'AI Assistant',
52
52
 
53
+ // Formula bar (Premium formulas)
54
+ // formulaBarLabel: 'Formula bar',
55
+ // formulaBarInputLabel: 'Formula',
56
+ // formulaBarAddressLabel: 'Active cell',
57
+
53
58
  // Columns management text
54
59
  columnsManagementSearchTitle: 'Søg',
55
60
  columnsManagementNoColumns: 'Ingen søjler',
package/locales/daDK.mjs CHANGED
@@ -44,6 +44,11 @@ const daDKGrid = {
44
44
  // Toolbar AI Assistant button
45
45
  // toolbarAssistant: 'AI Assistant',
46
46
 
47
+ // Formula bar (Premium formulas)
48
+ // formulaBarLabel: 'Formula bar',
49
+ // formulaBarInputLabel: 'Formula',
50
+ // formulaBarAddressLabel: 'Active cell',
51
+
47
52
  // Columns management text
48
53
  columnsManagementSearchTitle: 'Søg',
49
54
  columnsManagementNoColumns: 'Ingen søjler',
package/locales/deDE.js CHANGED
@@ -48,6 +48,11 @@ const deDEGrid = {
48
48
 
49
49
  // Toolbar AI Assistant button
50
50
  toolbarAssistant: 'KI-Assistent',
51
+ // Formula bar (Premium formulas)
52
+ // formulaBarLabel: 'Formula bar',
53
+ // formulaBarInputLabel: 'Formula',
54
+ // formulaBarAddressLabel: 'Active cell',
55
+
51
56
  // Columns management text
52
57
  columnsManagementSearchTitle: 'Suche',
53
58
  columnsManagementNoColumns: 'Keine Spalten',
package/locales/deDE.mjs CHANGED
@@ -42,6 +42,11 @@ const deDEGrid = {
42
42
 
43
43
  // Toolbar AI Assistant button
44
44
  toolbarAssistant: 'KI-Assistent',
45
+ // Formula bar (Premium formulas)
46
+ // formulaBarLabel: 'Formula bar',
47
+ // formulaBarInputLabel: 'Formula',
48
+ // formulaBarAddressLabel: 'Active cell',
49
+
45
50
  // Columns management text
46
51
  columnsManagementSearchTitle: 'Suche',
47
52
  columnsManagementNoColumns: 'Keine Spalten',
package/locales/elGR.js CHANGED
@@ -50,6 +50,11 @@ const elGRGrid = {
50
50
  // Toolbar AI Assistant button
51
51
  // toolbarAssistant: 'AI Assistant',
52
52
 
53
+ // Formula bar (Premium formulas)
54
+ // formulaBarLabel: 'Formula bar',
55
+ // formulaBarInputLabel: 'Formula',
56
+ // formulaBarAddressLabel: 'Active cell',
57
+
53
58
  // Columns management text
54
59
  // columnsManagementSearchTitle: 'Search',
55
60
  // columnsManagementNoColumns: 'No columns',
package/locales/elGR.mjs CHANGED
@@ -44,6 +44,11 @@ const elGRGrid = {
44
44
  // Toolbar AI Assistant button
45
45
  // toolbarAssistant: 'AI Assistant',
46
46
 
47
+ // Formula bar (Premium formulas)
48
+ // formulaBarLabel: 'Formula bar',
49
+ // formulaBarInputLabel: 'Formula',
50
+ // formulaBarAddressLabel: 'Active cell',
51
+
47
52
  // Columns management text
48
53
  // columnsManagementSearchTitle: 'Search',
49
54
  // columnsManagementNoColumns: 'No columns',