@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
@@ -1,3 +1,3 @@
1
1
  import type { RefObject } from '@mui/x-internals/types';
2
- import type { GridPrivateApiCommunity } from "../models/api/gridApiCommunity.js";
3
- export declare function getPublicApiRef<PrivateApi extends GridPrivateApiCommunity>(apiRef: RefObject<PrivateApi>): RefObject<ReturnType<PrivateApi['getPublicApi']>>;
2
+ import type { GridPrivateApiCommon } from "../models/api/gridApiCommon.js";
3
+ export declare function getPublicApiRef<PrivateApi extends GridPrivateApiCommon>(apiRef: RefObject<PrivateApi>): Readonly<RefObject<ReturnType<PrivateApi['getPublicApi']>>>;
@@ -4,8 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getPublicApiRef = getPublicApiRef;
7
+ const publicApiRefCache = new WeakMap();
7
8
  function getPublicApiRef(apiRef) {
8
- return {
9
- current: apiRef.current.getPublicApi()
10
- };
9
+ const privateApi = apiRef.current;
10
+ let publicApiRef = publicApiRefCache.get(privateApi);
11
+ if (!publicApiRef) {
12
+ // The ref is cached per grid instance and getter-based so that `publishEvent`
13
+ // (called for every grid event) doesn't allocate, and so that consumers cannot
14
+ // re-point the grid's internal ref through it.
15
+ publicApiRef = {
16
+ get current() {
17
+ return privateApi.getPublicApi();
18
+ }
19
+ };
20
+ publicApiRefCache.set(privateApi, publicApiRef);
21
+ }
22
+ return publicApiRef;
11
23
  }
@@ -1,5 +1,17 @@
1
+ const publicApiRefCache = new WeakMap();
1
2
  export function getPublicApiRef(apiRef) {
2
- return {
3
- current: apiRef.current.getPublicApi()
4
- };
3
+ const privateApi = apiRef.current;
4
+ let publicApiRef = publicApiRefCache.get(privateApi);
5
+ if (!publicApiRef) {
6
+ // The ref is cached per grid instance and getter-based so that `publishEvent`
7
+ // (called for every grid event) doesn't allocate, and so that consumers cannot
8
+ // re-point the grid's internal ref through it.
9
+ publicApiRef = {
10
+ get current() {
11
+ return privateApi.getPublicApi();
12
+ }
13
+ };
14
+ publicApiRefCache.set(privateApi, publicApiRef);
15
+ }
16
+ return publicApiRef;
5
17
  }