@mui/x-data-grid 7.0.0-beta.6 → 7.0.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 (329) hide show
  1. package/CHANGELOG.md +311 -12
  2. package/DataGrid/DataGrid.js +57 -17
  3. package/DataGrid/useDataGridComponent.js +3 -0
  4. package/DataGrid/useDataGridProps.js +6 -7
  5. package/README.md +1 -1
  6. package/components/GridColumnHeaders.d.ts +1 -2
  7. package/components/GridColumnHeaders.js +6 -17
  8. package/components/GridFooter.js +2 -3
  9. package/components/GridHeader.js +1 -2
  10. package/components/GridHeaders.js +1 -4
  11. package/components/GridPagination.d.ts +6 -5
  12. package/components/GridPagination.js +14 -11
  13. package/components/GridRow.d.ts +1 -1
  14. package/components/GridRow.js +17 -36
  15. package/components/GridScrollArea.d.ts +10 -0
  16. package/components/GridScrollArea.js +150 -0
  17. package/components/base/GridFooterPlaceholder.js +1 -2
  18. package/components/base/GridOverlays.js +3 -6
  19. package/components/cell/GridActionsCell.js +4 -6
  20. package/components/cell/GridActionsCellItem.d.ts +8 -25
  21. package/components/cell/GridActionsCellItem.js +8 -5
  22. package/components/cell/GridBooleanCell.d.ts +1 -0
  23. package/components/cell/GridBooleanCell.js +3 -2
  24. package/components/cell/GridCell.d.ts +7 -0
  25. package/components/cell/GridCell.js +18 -11
  26. package/components/cell/GridEditBooleanCell.js +1 -2
  27. package/components/cell/GridEditDateCell.js +2 -3
  28. package/components/cell/GridEditInputCell.js +2 -2
  29. package/components/cell/GridEditSingleSelectCell.js +5 -8
  30. package/components/columnHeaders/ColumnHeaderMenuIcon.js +2 -3
  31. package/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
  32. package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -0
  33. package/components/columnHeaders/GridColumnGroupHeader.js +22 -13
  34. package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +2 -3
  35. package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -0
  36. package/components/columnHeaders/GridColumnHeaderItem.js +26 -12
  37. package/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
  38. package/components/columnHeaders/GridColumnHeaderTitle.js +2 -3
  39. package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -0
  40. package/components/columnHeaders/GridGenericColumnHeaderItem.js +7 -6
  41. package/components/columnSelection/GridCellCheckboxRenderer.js +3 -5
  42. package/components/columnSelection/GridHeaderCheckbox.js +1 -2
  43. package/components/columnsManagement/GridColumnsManagement.js +17 -21
  44. package/components/containers/GridRoot.js +3 -3
  45. package/components/containers/GridRootStyles.js +12 -20
  46. package/components/menu/GridMenu.js +4 -6
  47. package/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
  48. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -3
  49. package/components/panel/GridColumnsPanel.js +1 -2
  50. package/components/panel/GridPanel.d.ts +1 -10
  51. package/components/panel/GridPanel.js +1 -2
  52. package/components/panel/GridPreferencesPanel.js +2 -3
  53. package/components/panel/filterPanel/GridFilterForm.js +24 -27
  54. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -1
  55. package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
  56. package/components/panel/filterPanel/GridFilterInputDate.d.ts +1 -1
  57. package/components/panel/filterPanel/GridFilterInputDate.js +3 -4
  58. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +11 -15
  59. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +10 -14
  60. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -1
  61. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +10 -11
  62. package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -1
  63. package/components/panel/filterPanel/GridFilterInputValue.js +5 -7
  64. package/components/panel/filterPanel/GridFilterPanel.js +5 -9
  65. package/components/panel/filterPanel/filterPanelUtils.js +1 -1
  66. package/components/toolbar/GridToolbarColumnsButton.js +3 -5
  67. package/components/toolbar/GridToolbarDensitySelector.js +8 -10
  68. package/components/toolbar/GridToolbarExport.js +2 -2
  69. package/components/toolbar/GridToolbarExportContainer.js +3 -5
  70. package/components/toolbar/GridToolbarFilterButton.js +3 -5
  71. package/components/toolbar/GridToolbarQuickFilter.js +4 -5
  72. package/components/virtualization/GridVirtualScrollbar.js +4 -0
  73. package/components/virtualization/GridVirtualScroller.js +6 -1
  74. package/components/virtualization/GridVirtualScrollerContent.js +1 -2
  75. package/components/virtualization/GridVirtualScrollerFiller.js +2 -1
  76. package/components/virtualization/GridVirtualScrollerRenderZone.js +1 -2
  77. package/constants/gridClasses.d.ts +6 -32
  78. package/constants/gridClasses.js +1 -1
  79. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +5 -1
  80. package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +1 -2
  81. package/hooks/core/useGridApiInitialization.js +4 -6
  82. package/hooks/features/clipboard/useGridClipboard.js +6 -5
  83. package/hooks/features/columnGrouping/gridColumnGroupsSelector.js +4 -16
  84. package/hooks/features/columnGrouping/gridColumnGroupsUtils.js +4 -8
  85. package/hooks/features/columnGrouping/useGridColumnGrouping.js +12 -23
  86. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +23 -7
  87. package/hooks/features/columnHeaders/useGridColumnHeaders.js +186 -101
  88. package/hooks/features/columnMenu/useGridColumnMenuSlots.js +2 -2
  89. package/hooks/features/columnResize/columnResizeSelector.d.ts +3 -0
  90. package/hooks/features/columnResize/columnResizeSelector.js +3 -0
  91. package/hooks/features/columnResize/columnResizeState.d.ts +3 -0
  92. package/hooks/features/columnResize/columnResizeState.js +1 -0
  93. package/hooks/features/columnResize/gridColumnResizeApi.d.ts +44 -0
  94. package/hooks/features/columnResize/gridColumnResizeApi.js +10 -0
  95. package/hooks/features/columnResize/index.d.ts +3 -0
  96. package/hooks/features/columnResize/index.js +3 -0
  97. package/hooks/features/columnResize/useGridColumnResize.d.ts +10 -0
  98. package/hooks/features/columnResize/useGridColumnResize.js +553 -0
  99. package/hooks/features/columns/gridColumnsSelector.js +1 -2
  100. package/hooks/features/columns/gridColumnsUtils.d.ts +0 -9
  101. package/hooks/features/columns/gridColumnsUtils.js +5 -22
  102. package/hooks/features/columns/useGridColumnSpanning.js +1 -2
  103. package/hooks/features/columns/useGridColumns.js +11 -19
  104. package/hooks/features/density/densitySelector.d.ts +4 -2
  105. package/hooks/features/density/densitySelector.js +8 -2
  106. package/hooks/features/density/densityState.d.ts +1 -4
  107. package/hooks/features/density/useGridDensity.d.ts +2 -4
  108. package/hooks/features/density/useGridDensity.js +21 -29
  109. package/hooks/features/dimensions/useGridDimensions.js +7 -10
  110. package/hooks/features/editing/useGridCellEditing.js +25 -8
  111. package/hooks/features/editing/useGridEditing.js +1 -2
  112. package/hooks/features/editing/useGridRowEditing.js +4 -6
  113. package/hooks/features/export/serializers/csvSerializer.d.ts +2 -0
  114. package/hooks/features/export/serializers/csvSerializer.js +25 -16
  115. package/hooks/features/export/useGridCsvExport.js +9 -10
  116. package/hooks/features/export/useGridPrintExport.js +17 -22
  117. package/hooks/features/export/utils.js +2 -3
  118. package/hooks/features/filter/gridFilterSelector.js +15 -22
  119. package/hooks/features/filter/gridFilterUtils.js +10 -16
  120. package/hooks/features/filter/useGridFilter.js +9 -15
  121. package/hooks/features/focus/useGridFocus.js +5 -6
  122. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +1 -0
  123. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -0
  124. package/hooks/features/headerFiltering/useGridHeaderFiltering.js +23 -5
  125. package/hooks/features/index.d.ts +1 -0
  126. package/hooks/features/index.js +1 -0
  127. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +1 -2
  128. package/hooks/features/pagination/gridPaginationInterfaces.d.ts +19 -2
  129. package/hooks/features/pagination/gridPaginationSelector.d.ts +5 -0
  130. package/hooks/features/pagination/gridPaginationSelector.js +9 -4
  131. package/hooks/features/pagination/useGridPagination.d.ts +1 -6
  132. package/hooks/features/pagination/useGridPagination.js +9 -158
  133. package/hooks/features/pagination/useGridPaginationModel.d.ts +11 -0
  134. package/hooks/features/pagination/useGridPaginationModel.js +165 -0
  135. package/hooks/features/pagination/useGridRowCount.d.ts +8 -0
  136. package/hooks/features/pagination/useGridRowCount.js +94 -0
  137. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +7 -12
  138. package/hooks/features/rowSelection/useGridRowSelection.js +11 -16
  139. package/hooks/features/rows/gridRowsSelector.js +11 -19
  140. package/hooks/features/rows/gridRowsUtils.js +7 -9
  141. package/hooks/features/rows/useGridParamsApi.js +1 -1
  142. package/hooks/features/rows/useGridRows.js +4 -13
  143. package/hooks/features/rows/useGridRowsMeta.js +7 -13
  144. package/hooks/features/scroll/useGridScroll.js +3 -4
  145. package/hooks/features/sorting/gridSortingSelector.js +4 -7
  146. package/hooks/features/sorting/useGridSorting.js +8 -14
  147. package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +4 -4
  148. package/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
  149. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -3
  150. package/hooks/features/virtualization/useGridVirtualScroller.js +220 -71
  151. package/hooks/utils/useGridApiEventHandler.js +5 -10
  152. package/hooks/utils/useGridNativeEventListener.js +1 -2
  153. package/hooks/utils/useLazyRef.d.ts +1 -2
  154. package/hooks/utils/useLazyRef.js +1 -11
  155. package/hooks/utils/useOnMount.d.ts +1 -2
  156. package/hooks/utils/useOnMount.js +1 -7
  157. package/hooks/utils/useTimeout.d.ts +1 -11
  158. package/hooks/utils/useTimeout.js +1 -36
  159. package/index.js +1 -1
  160. package/internals/index.d.ts +3 -1
  161. package/internals/index.js +2 -1
  162. package/internals/utils/getPinnedCellOffset.d.ts +3 -0
  163. package/internals/utils/getPinnedCellOffset.js +17 -0
  164. package/internals/utils/useProps.js +1 -2
  165. package/joy/joySlots.js +18 -63
  166. package/locales/jaJP.js +3 -4
  167. package/material/index.js +0 -2
  168. package/models/api/gridApiCommon.d.ts +3 -3
  169. package/models/api/gridCoreApi.d.ts +1 -5
  170. package/models/api/gridRowsMetaApi.d.ts +1 -1
  171. package/models/api/index.d.ts +1 -1
  172. package/models/api/index.js +0 -1
  173. package/models/events/gridEventLookup.d.ts +13 -0
  174. package/models/gridExport.d.ts +6 -0
  175. package/models/gridHeaderFilteringModel.d.ts +1 -0
  176. package/models/gridSlotsComponent.d.ts +0 -5
  177. package/models/gridStateCommunity.d.ts +3 -0
  178. package/models/params/gridScrollParams.d.ts +5 -3
  179. package/models/props/DataGridProps.d.ts +58 -28
  180. package/modern/DataGrid/DataGrid.js +57 -17
  181. package/modern/DataGrid/useDataGridComponent.js +3 -0
  182. package/modern/DataGrid/useDataGridProps.js +6 -7
  183. package/modern/components/GridColumnHeaders.js +6 -17
  184. package/modern/components/GridHeaders.js +1 -4
  185. package/modern/components/GridPagination.js +13 -6
  186. package/modern/components/GridRow.js +4 -19
  187. package/modern/components/GridScrollArea.js +150 -0
  188. package/modern/components/cell/GridActionsCell.js +1 -1
  189. package/modern/components/cell/GridActionsCellItem.js +4 -0
  190. package/modern/components/cell/GridBooleanCell.js +3 -2
  191. package/modern/components/cell/GridCell.js +11 -3
  192. package/modern/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
  193. package/modern/components/columnHeaders/GridColumnGroupHeader.js +18 -8
  194. package/modern/components/columnHeaders/GridColumnHeaderItem.js +21 -6
  195. package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
  196. package/modern/components/containers/GridRoot.js +3 -3
  197. package/modern/components/containers/GridRootStyles.js +12 -20
  198. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  199. package/modern/components/panel/filterPanel/GridFilterInputDate.js +1 -1
  200. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
  201. package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  202. package/modern/components/toolbar/GridToolbarDensitySelector.js +5 -5
  203. package/modern/components/virtualization/GridVirtualScrollbar.js +4 -0
  204. package/modern/components/virtualization/GridVirtualScroller.js +6 -1
  205. package/modern/components/virtualization/GridVirtualScrollerFiller.js +2 -1
  206. package/modern/constants/gridClasses.js +1 -1
  207. package/modern/hooks/features/clipboard/useGridClipboard.js +4 -2
  208. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +184 -97
  209. package/modern/hooks/features/columnResize/columnResizeSelector.js +3 -0
  210. package/modern/hooks/features/columnResize/columnResizeState.js +1 -0
  211. package/modern/hooks/features/columnResize/gridColumnResizeApi.js +10 -0
  212. package/modern/hooks/features/columnResize/index.js +3 -0
  213. package/modern/hooks/features/columnResize/useGridColumnResize.js +553 -0
  214. package/modern/hooks/features/columns/gridColumnsUtils.js +4 -20
  215. package/modern/hooks/features/density/densitySelector.js +8 -2
  216. package/modern/hooks/features/density/useGridDensity.js +21 -29
  217. package/modern/hooks/features/dimensions/useGridDimensions.js +4 -5
  218. package/modern/hooks/features/editing/useGridCellEditing.js +22 -3
  219. package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
  220. package/modern/hooks/features/export/serializers/csvSerializer.js +23 -12
  221. package/modern/hooks/features/export/useGridCsvExport.js +2 -1
  222. package/modern/hooks/features/export/useGridPrintExport.js +8 -7
  223. package/modern/hooks/features/filter/gridFilterUtils.js +1 -1
  224. package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -0
  225. package/modern/hooks/features/headerFiltering/useGridHeaderFiltering.js +21 -2
  226. package/modern/hooks/features/index.js +1 -0
  227. package/modern/hooks/features/pagination/gridPaginationSelector.js +8 -2
  228. package/modern/hooks/features/pagination/useGridPagination.js +8 -149
  229. package/modern/hooks/features/pagination/useGridPaginationModel.js +165 -0
  230. package/modern/hooks/features/pagination/useGridRowCount.js +94 -0
  231. package/modern/hooks/features/rowSelection/useGridRowSelection.js +3 -2
  232. package/modern/hooks/features/scroll/useGridScroll.js +1 -1
  233. package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
  234. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +211 -57
  235. package/modern/hooks/utils/useLazyRef.js +1 -11
  236. package/modern/hooks/utils/useOnMount.js +1 -7
  237. package/modern/hooks/utils/useTimeout.js +1 -36
  238. package/modern/index.js +1 -1
  239. package/modern/internals/index.js +2 -1
  240. package/modern/internals/utils/getPinnedCellOffset.js +17 -0
  241. package/modern/joy/joySlots.js +11 -50
  242. package/modern/locales/jaJP.js +3 -4
  243. package/modern/material/index.js +0 -2
  244. package/modern/models/api/index.js +0 -1
  245. package/modern/utils/cellBorderUtils.js +8 -0
  246. package/modern/utils/createSelector.js +1 -1
  247. package/modern/utils/domUtils.js +144 -0
  248. package/modern/utils/keyboardUtils.js +1 -1
  249. package/node/DataGrid/DataGrid.js +57 -17
  250. package/node/DataGrid/useDataGridComponent.js +3 -0
  251. package/node/DataGrid/useDataGridProps.js +6 -7
  252. package/node/components/GridColumnHeaders.js +6 -16
  253. package/node/components/GridHeaders.js +1 -4
  254. package/node/components/GridPagination.js +10 -4
  255. package/node/components/GridRow.js +3 -18
  256. package/node/components/GridScrollArea.js +158 -0
  257. package/node/components/cell/GridActionsCell.js +1 -1
  258. package/node/components/cell/GridActionsCellItem.js +4 -0
  259. package/node/components/cell/GridBooleanCell.js +3 -2
  260. package/node/components/cell/GridCell.js +12 -4
  261. package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
  262. package/node/components/columnHeaders/GridColumnGroupHeader.js +18 -8
  263. package/node/components/columnHeaders/GridColumnHeaderItem.js +21 -6
  264. package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
  265. package/node/components/containers/GridRoot.js +2 -2
  266. package/node/components/containers/GridRootStyles.js +12 -20
  267. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  268. package/node/components/panel/filterPanel/GridFilterInputDate.js +1 -1
  269. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
  270. package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  271. package/node/components/toolbar/GridToolbarDensitySelector.js +4 -4
  272. package/node/components/virtualization/GridVirtualScrollbar.js +4 -0
  273. package/node/components/virtualization/GridVirtualScroller.js +6 -1
  274. package/node/components/virtualization/GridVirtualScrollerFiller.js +2 -1
  275. package/node/constants/gridClasses.js +1 -1
  276. package/node/hooks/features/clipboard/useGridClipboard.js +4 -2
  277. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +190 -103
  278. package/node/hooks/features/columnResize/columnResizeSelector.js +10 -0
  279. package/node/hooks/features/columnResize/columnResizeState.js +5 -0
  280. package/node/hooks/features/columnResize/gridColumnResizeApi.js +16 -0
  281. package/node/hooks/features/columnResize/index.js +38 -0
  282. package/node/hooks/features/columnResize/useGridColumnResize.js +564 -0
  283. package/node/hooks/features/columns/gridColumnsUtils.js +4 -21
  284. package/node/hooks/features/density/densitySelector.js +9 -3
  285. package/node/hooks/features/density/useGridDensity.js +22 -30
  286. package/node/hooks/features/dimensions/useGridDimensions.js +4 -5
  287. package/node/hooks/features/editing/useGridCellEditing.js +22 -3
  288. package/node/hooks/features/editing/useGridRowEditing.js +1 -1
  289. package/node/hooks/features/export/serializers/csvSerializer.js +23 -12
  290. package/node/hooks/features/export/useGridCsvExport.js +2 -1
  291. package/node/hooks/features/export/useGridPrintExport.js +8 -7
  292. package/node/hooks/features/filter/gridFilterUtils.js +1 -1
  293. package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +4 -1
  294. package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +21 -2
  295. package/node/hooks/features/index.js +11 -0
  296. package/node/hooks/features/pagination/gridPaginationSelector.js +8 -2
  297. package/node/hooks/features/pagination/useGridPagination.js +9 -153
  298. package/node/hooks/features/pagination/useGridPaginationModel.js +176 -0
  299. package/node/hooks/features/pagination/useGridRowCount.js +103 -0
  300. package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  301. package/node/hooks/features/scroll/useGridScroll.js +1 -1
  302. package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
  303. package/node/hooks/features/virtualization/useGridVirtualScroller.js +211 -57
  304. package/node/hooks/utils/useLazyRef.js +7 -13
  305. package/node/hooks/utils/useOnMount.js +8 -10
  306. package/node/hooks/utils/useTimeout.js +7 -37
  307. package/node/index.js +1 -1
  308. package/node/internals/index.js +27 -8
  309. package/node/internals/utils/getPinnedCellOffset.js +24 -0
  310. package/node/joy/joySlots.js +11 -50
  311. package/node/locales/jaJP.js +3 -4
  312. package/node/material/index.js +0 -2
  313. package/node/models/api/index.js +0 -11
  314. package/node/utils/cellBorderUtils.js +16 -0
  315. package/node/utils/createSelector.js +1 -1
  316. package/node/utils/domUtils.js +155 -0
  317. package/node/utils/keyboardUtils.js +1 -1
  318. package/package.json +4 -4
  319. package/utils/cellBorderUtils.d.ts +3 -0
  320. package/utils/cellBorderUtils.js +8 -0
  321. package/utils/createSelector.js +9 -9
  322. package/utils/domUtils.d.ts +14 -1
  323. package/utils/domUtils.js +144 -0
  324. package/utils/getGridLocalization.js +9 -12
  325. package/utils/keyboardUtils.js +1 -1
  326. package/components/columnHeaders/GridColumnHeadersInner.d.ts +0 -8
  327. package/components/columnHeaders/GridColumnHeadersInner.js +0 -58
  328. package/modern/components/columnHeaders/GridColumnHeadersInner.js +0 -58
  329. package/node/components/columnHeaders/GridColumnHeadersInner.js +0 -67
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getPinnedCellOffset = void 0;
7
+ var _columns = require("../../hooks/features/columns");
8
+ const getPinnedCellOffset = (pinnedPosition, computedWidth, columnIndex, columnPositions, dimensions) => {
9
+ const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
10
+ let pinnedOffset;
11
+ switch (pinnedPosition) {
12
+ case _columns.GridPinnedColumnPosition.LEFT:
13
+ pinnedOffset = columnPositions[columnIndex];
14
+ break;
15
+ case _columns.GridPinnedColumnPosition.RIGHT:
16
+ pinnedOffset = dimensions.columnsTotalWidth - columnPositions[columnIndex] - computedWidth + scrollbarWidth;
17
+ break;
18
+ default:
19
+ pinnedOffset = 0;
20
+ break;
21
+ }
22
+ return pinnedOffset;
23
+ };
24
+ exports.getPinnedCellOffset = getPinnedCellOffset;
@@ -14,7 +14,6 @@ var _FormControl = _interopRequireDefault(require("@mui/joy/FormControl"));
14
14
  var _FormLabel = _interopRequireDefault(require("@mui/joy/FormLabel"));
15
15
  var _Button = _interopRequireDefault(require("@mui/joy/Button"));
16
16
  var _IconButton = _interopRequireDefault(require("@mui/joy/IconButton"));
17
- var _Switch = _interopRequireDefault(require("@mui/joy/Switch"));
18
17
  var _Select = _interopRequireDefault(require("@mui/joy/Select"));
19
18
  var _Option = _interopRequireDefault(require("@mui/joy/Option"));
20
19
  var _Box = _interopRequireDefault(require("@mui/joy/Box"));
@@ -32,10 +31,9 @@ const _excluded = ["touchRippleRef", "inputProps", "onChange", "color", "size",
32
31
  _excluded2 = ["onChange", "label", "placeholder", "value", "inputRef", "type", "size", "variant"],
33
32
  _excluded3 = ["startIcon", "color", "endIcon", "size", "sx", "variant"],
34
33
  _excluded4 = ["color", "size", "sx", "touchRippleRef"],
35
- _excluded5 = ["name", "checkedIcon", "color", "disableRipple", "disableFocusRipple", "disableTouchRipple", "edge", "icon", "inputProps", "inputRef", "size", "sx", "onChange", "onClick"],
36
- _excluded6 = ["open", "onOpen", "value", "onChange", "size", "color", "variant", "inputProps", "MenuProps", "inputRef", "error", "native", "fullWidth", "labelId"],
37
- _excluded7 = ["native"],
38
- _excluded8 = ["shrink", "variant", "sx"];
34
+ _excluded5 = ["open", "onOpen", "value", "onChange", "size", "color", "variant", "inputProps", "MenuProps", "inputRef", "error", "native", "fullWidth", "labelId"],
35
+ _excluded6 = ["native"],
36
+ _excluded7 = ["shrink", "variant", "sx"];
39
37
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
40
38
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
41
39
  function convertColor(color) {
@@ -162,43 +160,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref4, ref)
162
160
  sx: sx
163
161
  }));
164
162
  });
165
- const Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref5, ref) {
166
- let {
167
- name,
168
- color: colorProp,
169
- edge,
170
- icon,
171
- inputProps,
172
- inputRef,
173
- size,
174
- sx,
175
- onChange,
176
- onClick
177
- } = _ref5,
178
- props = (0, _objectWithoutPropertiesLoose2.default)(_ref5, _excluded5);
179
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, (0, _extends2.default)({}, props, {
180
- onChange: onChange,
181
- size: convertSize(size),
182
- color: convertColor(colorProp),
183
- ref: ref,
184
- slotProps: {
185
- input: (0, _extends2.default)({}, inputProps, {
186
- name,
187
- onClick: onClick,
188
- ref: inputRef
189
- }),
190
- thumb: {
191
- children: icon
192
- }
193
- },
194
- sx: [(0, _extends2.default)({}, edge === 'start' && {
195
- ml: '-8px'
196
- }, edge === 'end' && {
197
- mr: '-8px'
198
- }), ...(Array.isArray(sx) ? sx : [sx])]
199
- }));
200
- });
201
- const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
163
+ const Select = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
202
164
  let {
203
165
  open,
204
166
  onOpen,
@@ -210,8 +172,8 @@ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
210
172
  MenuProps,
211
173
  inputRef,
212
174
  labelId
213
- } = _ref6,
214
- props = (0, _objectWithoutPropertiesLoose2.default)(_ref6, _excluded6);
175
+ } = _ref5,
176
+ props = (0, _objectWithoutPropertiesLoose2.default)(_ref5, _excluded5);
215
177
  const handleChange = (event, newValue) => {
216
178
  if (event && onChange) {
217
179
  // Same as in https://github.com/mui/material-ui/blob/e5558282a8f36856aef1299f3a36f3235e92e770/packages/mui-material/src/Select/SelectInput.js#L288-L300
@@ -262,17 +224,17 @@ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
262
224
  }
263
225
  }));
264
226
  });
265
- const Option = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
266
- let props = (0, _objectWithoutPropertiesLoose2.default)(_ref7, _excluded7);
227
+ const Option = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
228
+ let props = (0, _objectWithoutPropertiesLoose2.default)(_ref6, _excluded6);
267
229
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Option.default, (0, _extends2.default)({}, props, {
268
230
  ref: ref
269
231
  }));
270
232
  });
271
- const InputLabel = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
233
+ const InputLabel = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
272
234
  let {
273
235
  sx
274
- } = _ref8,
275
- props = (0, _objectWithoutPropertiesLoose2.default)(_ref8, _excluded8);
236
+ } = _ref7,
237
+ props = (0, _objectWithoutPropertiesLoose2.default)(_ref7, _excluded7);
276
238
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormLabel.default, (0, _extends2.default)({}, props, {
277
239
  ref: ref,
278
240
  sx: sx
@@ -402,7 +364,6 @@ const joySlots = (0, _extends2.default)({}, _icons.default, {
402
364
  baseTextField: TextField,
403
365
  baseButton: Button,
404
366
  baseIconButton: IconButton,
405
- baseSwitch: Switch,
406
367
  baseSelect: Select,
407
368
  baseSelectOption: Option,
408
369
  baseInputLabel: InputLabel,
@@ -36,10 +36,9 @@ const jaJPGrid = {
36
36
  toolbarExportPrint: '印刷',
37
37
  toolbarExportExcel: 'Excelダウンロード',
38
38
  // Columns management text
39
- // columnsManagementSearchTitle: 'Search',
40
- // columnsManagementNoColumns: 'No columns',
41
- // columnsManagementShowHideAllText: 'Show/Hide All',
42
-
39
+ columnsManagementSearchTitle: '検索',
40
+ columnsManagementNoColumns: 'カラムなし',
41
+ columnsManagementShowHideAllText: 'すべて表示/非表示',
43
42
  // Filter panel text
44
43
  filterPanelAddFilter: 'フィルター追加',
45
44
  filterPanelRemoveAll: 'すべて削除',
@@ -10,7 +10,6 @@ var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
10
10
  var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
11
11
  var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
12
12
  var _Select = _interopRequireDefault(require("@mui/material/Select"));
13
- var _Switch = _interopRequireDefault(require("@mui/material/Switch"));
14
13
  var _Button = _interopRequireDefault(require("@mui/material/Button"));
15
14
  var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
16
15
  var _InputAdornment = _interopRequireDefault(require("@mui/material/InputAdornment"));
@@ -63,7 +62,6 @@ const materialSlots = (0, _extends2.default)({}, iconSlots, {
63
62
  baseTextField: _TextField.default,
64
63
  baseFormControl: _FormControl.default,
65
64
  baseSelect: _Select.default,
66
- baseSwitch: _Switch.default,
67
65
  baseButton: _Button.default,
68
66
  baseIconButton: _IconButton.default,
69
67
  baseInputAdornment: _InputAdornment.default,
@@ -156,15 +156,4 @@ Object.keys(_gridScrollApi).forEach(function (key) {
156
156
  return _gridScrollApi[key];
157
157
  }
158
158
  });
159
- });
160
- var _gridVirtualizationApi = require("./gridVirtualizationApi");
161
- Object.keys(_gridVirtualizationApi).forEach(function (key) {
162
- if (key === "default" || key === "__esModule") return;
163
- if (key in exports && exports[key] === _gridVirtualizationApi[key]) return;
164
- Object.defineProperty(exports, key, {
165
- enumerable: true,
166
- get: function () {
167
- return _gridVirtualizationApi[key];
168
- }
169
- });
170
159
  });
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.shouldCellShowRightBorder = exports.shouldCellShowLeftBorder = void 0;
7
+ var _gridColumnsInterfaces = require("../hooks/features/columns/gridColumnsInterfaces");
8
+ const shouldCellShowRightBorder = (pinnedPosition, indexInSection, sectionLength, showCellVerticalBorderRootProp) => {
9
+ const isSectionLastCell = indexInSection === sectionLength - 1;
10
+ return showCellVerticalBorderRootProp && (pinnedPosition !== _gridColumnsInterfaces.GridPinnedColumnPosition.LEFT ? !isSectionLastCell : true) || pinnedPosition === _gridColumnsInterfaces.GridPinnedColumnPosition.LEFT && isSectionLastCell;
11
+ };
12
+ exports.shouldCellShowRightBorder = shouldCellShowRightBorder;
13
+ const shouldCellShowLeftBorder = (pinnedPosition, indexInSection) => {
14
+ return pinnedPosition === _gridColumnsInterfaces.GridPinnedColumnPosition.RIGHT && indexInSection === 0;
15
+ };
16
+ exports.shouldCellShowLeftBorder = shouldCellShowLeftBorder;
@@ -7,7 +7,7 @@ exports.createSelectorMemoized = exports.createSelector = void 0;
7
7
  var _reselect = require("reselect");
8
8
  var _warning = require("./warning");
9
9
  const cache = new WeakMap();
10
- const missingInstanceIdWarning = (0, _warning.buildWarning)(['MUI X: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g. `mySelector(state, apiRef.current.instanceId)`.']);
10
+ const missingInstanceIdWarning = (0, _warning.buildWarning)(['MUI X: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, for example `mySelector(apiRef)`, or pass the instance ID explicitly, for example `mySelector(state, apiRef.current.instanceId)`.']);
11
11
  function checkIsAPIRef(value) {
12
12
  return 'current' in value && 'instanceId' in value.current;
13
13
  }
@@ -3,8 +3,19 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.findGridCellElementsFromCol = findGridCellElementsFromCol;
7
+ exports.findGridCells = findGridCells;
8
+ exports.findGridElement = findGridElement;
9
+ exports.findGridHeader = findGridHeader;
10
+ exports.findGroupHeaderElementsFromField = findGroupHeaderElementsFromField;
11
+ exports.findHeaderElementFromField = findHeaderElementFromField;
12
+ exports.findLeftPinnedCellsAfterCol = findLeftPinnedCellsAfterCol;
13
+ exports.findLeftPinnedHeadersAfterCol = findLeftPinnedHeadersAfterCol;
6
14
  exports.findParentElementFromClassName = findParentElementFromClassName;
15
+ exports.findRightPinnedCellsBeforeCol = findRightPinnedCellsBeforeCol;
16
+ exports.findRightPinnedHeadersBeforeCol = findRightPinnedHeadersBeforeCol;
7
17
  exports.getActiveElement = void 0;
18
+ exports.getFieldFromHeaderElem = getFieldFromHeaderElem;
8
19
  exports.getGridCellElement = getGridCellElement;
9
20
  exports.getGridColumnHeaderElement = getGridColumnHeaderElement;
10
21
  exports.getGridRowElement = getGridRowElement;
@@ -59,4 +70,148 @@ function isEventTargetInPortal(event) {
59
70
  return true;
60
71
  }
61
72
  return false;
73
+ }
74
+ function getFieldFromHeaderElem(colCellEl) {
75
+ return colCellEl.getAttribute('data-field');
76
+ }
77
+ function findHeaderElementFromField(elem, field) {
78
+ return elem.querySelector(`[data-field="${field}"]`);
79
+ }
80
+ function findGroupHeaderElementsFromField(elem, field) {
81
+ return Array.from(elem.querySelectorAll(`[data-fields*="|-${field}-|"]`) ?? []);
82
+ }
83
+ function findGridCellElementsFromCol(col, api) {
84
+ const root = findParentElementFromClassName(col, _gridClasses.gridClasses.root);
85
+ if (!root) {
86
+ throw new Error('MUI X: The root element is not found.');
87
+ }
88
+ const ariaColIndex = col.getAttribute('aria-colindex');
89
+ if (!ariaColIndex) {
90
+ return [];
91
+ }
92
+ const colIndex = Number(ariaColIndex) - 1;
93
+ const cells = [];
94
+ if (!api.virtualScrollerRef?.current) {
95
+ return [];
96
+ }
97
+ queryRows(api).forEach(rowElement => {
98
+ const rowId = rowElement.getAttribute('data-id');
99
+ if (!rowId) {
100
+ return;
101
+ }
102
+ let columnIndex = colIndex;
103
+ const cellColSpanInfo = api.unstable_getCellColSpanInfo(rowId, colIndex);
104
+ if (cellColSpanInfo && cellColSpanInfo.spannedByColSpan) {
105
+ columnIndex = cellColSpanInfo.leftVisibleCellIndex;
106
+ }
107
+ const cell = rowElement.querySelector(`[data-colindex="${columnIndex}"]`);
108
+ if (cell) {
109
+ cells.push(cell);
110
+ }
111
+ });
112
+ return cells;
113
+ }
114
+ function findGridElement(api, klass) {
115
+ return api.rootElementRef.current.querySelector(`.${_gridClasses.gridClasses[klass]}`);
116
+ }
117
+ const findPinnedCells = ({
118
+ api,
119
+ colIndex,
120
+ position,
121
+ filterFn
122
+ }) => {
123
+ if (colIndex === null) {
124
+ return [];
125
+ }
126
+ const cells = [];
127
+ queryRows(api).forEach(rowElement => {
128
+ const rowId = rowElement.getAttribute('data-id');
129
+ if (!rowId) {
130
+ return;
131
+ }
132
+ rowElement.querySelectorAll(`.${_gridClasses.gridClasses[position === 'left' ? 'cell--pinnedLeft' : 'cell--pinnedRight']}`).forEach(cell => {
133
+ const currentColIndex = parseCellColIndex(cell);
134
+ if (currentColIndex !== null && filterFn(currentColIndex)) {
135
+ cells.push(cell);
136
+ }
137
+ });
138
+ });
139
+ return cells;
140
+ };
141
+ function findLeftPinnedCellsAfterCol(api, col) {
142
+ const colIndex = parseCellColIndex(col);
143
+ return findPinnedCells({
144
+ api,
145
+ colIndex,
146
+ position: 'left',
147
+ filterFn: index => index > colIndex
148
+ });
149
+ }
150
+ function findRightPinnedCellsBeforeCol(api, col) {
151
+ const colIndex = parseCellColIndex(col);
152
+ return findPinnedCells({
153
+ api,
154
+ colIndex,
155
+ position: 'right',
156
+ filterFn: index => index < colIndex
157
+ });
158
+ }
159
+ const findPinnedHeaders = ({
160
+ api,
161
+ colIndex,
162
+ position,
163
+ filterFn
164
+ }) => {
165
+ if (!api.columnHeadersContainerRef?.current) {
166
+ return [];
167
+ }
168
+ if (colIndex === null) {
169
+ return [];
170
+ }
171
+ const elements = [];
172
+ api.columnHeadersContainerRef.current.querySelectorAll(`.${_gridClasses.gridClasses[position === 'left' ? 'columnHeader--pinnedLeft' : 'columnHeader--pinnedRight']}`).forEach(element => {
173
+ const currentColIndex = parseCellColIndex(element);
174
+ if (currentColIndex !== null && filterFn(currentColIndex)) {
175
+ elements.push(element);
176
+ }
177
+ });
178
+ return elements;
179
+ };
180
+ function findLeftPinnedHeadersAfterCol(api, col) {
181
+ const colIndex = parseCellColIndex(col);
182
+ return findPinnedHeaders({
183
+ api,
184
+ position: 'left',
185
+ colIndex,
186
+ filterFn: index => index > colIndex
187
+ });
188
+ }
189
+ function findRightPinnedHeadersBeforeCol(api, col) {
190
+ const colIndex = parseCellColIndex(col);
191
+ return findPinnedHeaders({
192
+ api,
193
+ position: 'right',
194
+ colIndex,
195
+ filterFn: index => index < colIndex
196
+ });
197
+ }
198
+ function findGridHeader(api, field) {
199
+ const headers = api.columnHeadersContainerRef.current;
200
+ return headers.querySelector(`:scope > div > [data-field="${field}"][role="columnheader"]`);
201
+ }
202
+ function findGridCells(api, field) {
203
+ const container = api.virtualScrollerRef.current;
204
+ return Array.from(container.querySelectorAll(`:scope > div > div > div > [data-field="${field}"][role="gridcell"]`));
205
+ }
206
+ function queryRows(api) {
207
+ return api.virtualScrollerRef.current.querySelectorAll(
208
+ // Use > to ignore rows from nested data grids (for example in detail panel)
209
+ `:scope > div > div > .${_gridClasses.gridClasses.row}`);
210
+ }
211
+ function parseCellColIndex(col) {
212
+ const ariaColIndex = col.getAttribute('aria-colindex');
213
+ if (!ariaColIndex) {
214
+ return null;
215
+ }
216
+ return Number(ariaColIndex) - 1;
62
217
  }
@@ -18,7 +18,7 @@ const isEscapeKey = key => key === 'Escape';
18
18
  exports.isEscapeKey = isEscapeKey;
19
19
  const isTabKey = key => key === 'Tab';
20
20
 
21
- // Non printable keys have a name, e.g. "ArrowRight", see the whole list:
21
+ // Non printable keys have a name, for example "ArrowRight", see the whole list:
22
22
  // https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
23
23
  // So event.key.length === 1 is often enough.
24
24
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "7.0.0-beta.6",
3
+ "version": "7.0.0",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -37,14 +37,14 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@babel/runtime": "^7.24.0",
40
- "@mui/system": "^5.15.9",
41
- "@mui/utils": "^5.15.9",
40
+ "@mui/system": "^5.15.14",
41
+ "@mui/utils": "^5.15.14",
42
42
  "clsx": "^2.1.0",
43
43
  "prop-types": "^15.8.1",
44
44
  "reselect": "^4.1.8"
45
45
  },
46
46
  "peerDependencies": {
47
- "@mui/material": "^5.15.0",
47
+ "@mui/material": "^5.15.14",
48
48
  "react": "^17.0.0 || ^18.0.0",
49
49
  "react-dom": "^17.0.0 || ^18.0.0"
50
50
  },
@@ -0,0 +1,3 @@
1
+ import { GridPinnedColumnPosition } from '../hooks/features/columns/gridColumnsInterfaces';
2
+ export declare const shouldCellShowRightBorder: (pinnedPosition: GridPinnedColumnPosition | undefined, indexInSection: number, sectionLength: number, showCellVerticalBorderRootProp: boolean) => boolean;
3
+ export declare const shouldCellShowLeftBorder: (pinnedPosition: GridPinnedColumnPosition | undefined, indexInSection: number) => boolean;
@@ -0,0 +1,8 @@
1
+ import { GridPinnedColumnPosition } from '../hooks/features/columns/gridColumnsInterfaces';
2
+ export const shouldCellShowRightBorder = (pinnedPosition, indexInSection, sectionLength, showCellVerticalBorderRootProp) => {
3
+ const isSectionLastCell = indexInSection === sectionLength - 1;
4
+ return showCellVerticalBorderRootProp && (pinnedPosition !== GridPinnedColumnPosition.LEFT ? !isSectionLastCell : true) || pinnedPosition === GridPinnedColumnPosition.LEFT && isSectionLastCell;
5
+ };
6
+ export const shouldCellShowLeftBorder = (pinnedPosition, indexInSection) => {
7
+ return pinnedPosition === GridPinnedColumnPosition.RIGHT && indexInSection === 0;
8
+ };
@@ -1,7 +1,7 @@
1
1
  import { createSelector as reselectCreateSelector } from 'reselect';
2
2
  import { buildWarning } from './warning';
3
3
  const cache = new WeakMap();
4
- const missingInstanceIdWarning = buildWarning(['MUI X: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g. `mySelector(state, apiRef.current.instanceId)`.']);
4
+ const missingInstanceIdWarning = buildWarning(['MUI X: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, for example `mySelector(apiRef)`, or pass the instance ID explicitly, for example `mySelector(state, apiRef.current.instanceId)`.']);
5
5
  function checkIsAPIRef(value) {
6
6
  return 'current' in value && 'instanceId' in value.current;
7
7
  }
@@ -16,7 +16,7 @@ export const createSelector = (a, b, c, d, e, f, ...rest) => {
16
16
  if (a && b && c && d && e && f) {
17
17
  selector = (stateOrApiRef, instanceIdParam) => {
18
18
  const isAPIRef = checkIsAPIRef(stateOrApiRef);
19
- const instanceId = instanceIdParam != null ? instanceIdParam : isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID;
19
+ const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
20
20
  const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
21
21
  const va = a(state, instanceId);
22
22
  const vb = b(state, instanceId);
@@ -28,7 +28,7 @@ export const createSelector = (a, b, c, d, e, f, ...rest) => {
28
28
  } else if (a && b && c && d && e) {
29
29
  selector = (stateOrApiRef, instanceIdParam) => {
30
30
  const isAPIRef = checkIsAPIRef(stateOrApiRef);
31
- const instanceId = instanceIdParam != null ? instanceIdParam : isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID;
31
+ const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
32
32
  const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
33
33
  const va = a(state, instanceId);
34
34
  const vb = b(state, instanceId);
@@ -39,7 +39,7 @@ export const createSelector = (a, b, c, d, e, f, ...rest) => {
39
39
  } else if (a && b && c && d) {
40
40
  selector = (stateOrApiRef, instanceIdParam) => {
41
41
  const isAPIRef = checkIsAPIRef(stateOrApiRef);
42
- const instanceId = instanceIdParam != null ? instanceIdParam : isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID;
42
+ const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
43
43
  const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
44
44
  const va = a(state, instanceId);
45
45
  const vb = b(state, instanceId);
@@ -49,7 +49,7 @@ export const createSelector = (a, b, c, d, e, f, ...rest) => {
49
49
  } else if (a && b && c) {
50
50
  selector = (stateOrApiRef, instanceIdParam) => {
51
51
  const isAPIRef = checkIsAPIRef(stateOrApiRef);
52
- const instanceId = instanceIdParam != null ? instanceIdParam : isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID;
52
+ const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
53
53
  const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
54
54
  const va = a(state, instanceId);
55
55
  const vb = b(state, instanceId);
@@ -58,7 +58,7 @@ export const createSelector = (a, b, c, d, e, f, ...rest) => {
58
58
  } else if (a && b) {
59
59
  selector = (stateOrApiRef, instanceIdParam) => {
60
60
  const isAPIRef = checkIsAPIRef(stateOrApiRef);
61
- const instanceId = instanceIdParam != null ? instanceIdParam : isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID;
61
+ const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
62
62
  const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
63
63
  const va = a(state, instanceId);
64
64
  return b(va);
@@ -75,7 +75,7 @@ export const createSelector = (a, b, c, d, e, f, ...rest) => {
75
75
  export const createSelectorMemoized = (...args) => {
76
76
  const selector = (stateOrApiRef, instanceId) => {
77
77
  const isAPIRef = checkIsAPIRef(stateOrApiRef);
78
- const cacheKey = isAPIRef ? stateOrApiRef.current.instanceId : instanceId != null ? instanceId : DEFAULT_INSTANCE_ID;
78
+ const cacheKey = isAPIRef ? stateOrApiRef.current.instanceId : instanceId ?? DEFAULT_INSTANCE_ID;
79
79
  const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
80
80
  if (process.env.NODE_ENV !== 'production') {
81
81
  if (cacheKey.id === 'default') {
@@ -83,8 +83,8 @@ export const createSelectorMemoized = (...args) => {
83
83
  }
84
84
  }
85
85
  const cacheArgsInit = cache.get(cacheKey);
86
- const cacheArgs = cacheArgsInit != null ? cacheArgsInit : new Map();
87
- const cacheFn = cacheArgs == null ? void 0 : cacheArgs.get(args);
86
+ const cacheArgs = cacheArgsInit ?? new Map();
87
+ const cacheFn = cacheArgs?.get(args);
88
88
  if (cacheArgs && cacheFn) {
89
89
  // We pass the cache key because the called selector might have as
90
90
  // dependency another selector created with this `createSelector`.
@@ -1,5 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { GridRowId } from '../models/gridRows';
2
+ import { gridClasses } from '../constants/gridClasses';
3
+ import type { GridPrivateApiCommunity } from '../models/api/gridApiCommunity';
4
+ import type { GridRowId } from '../models/gridRows';
3
5
  export declare function isOverflown(element: Element): boolean;
4
6
  export declare function findParentElementFromClassName(elem: Element, className: string): Element | null;
5
7
  export declare function getGridColumnHeaderElement(root: Element, field: string): HTMLDivElement | null;
@@ -10,3 +12,14 @@ export declare function getGridCellElement(root: Element, { id, field }: {
10
12
  }): HTMLDivElement | null;
11
13
  export declare const getActiveElement: (root?: Document | ShadowRoot) => Element | null;
12
14
  export declare function isEventTargetInPortal(event: React.SyntheticEvent): boolean;
15
+ export declare function getFieldFromHeaderElem(colCellEl: Element): string;
16
+ export declare function findHeaderElementFromField(elem: Element, field: string): HTMLDivElement;
17
+ export declare function findGroupHeaderElementsFromField(elem: Element, field: string): Element[];
18
+ export declare function findGridCellElementsFromCol(col: HTMLElement, api: GridPrivateApiCommunity): Element[];
19
+ export declare function findGridElement(api: GridPrivateApiCommunity, klass: keyof typeof gridClasses): HTMLElement;
20
+ export declare function findLeftPinnedCellsAfterCol(api: GridPrivateApiCommunity, col: HTMLElement): HTMLElement[];
21
+ export declare function findRightPinnedCellsBeforeCol(api: GridPrivateApiCommunity, col: HTMLElement): HTMLElement[];
22
+ export declare function findLeftPinnedHeadersAfterCol(api: GridPrivateApiCommunity, col: HTMLElement): HTMLElement[];
23
+ export declare function findRightPinnedHeadersBeforeCol(api: GridPrivateApiCommunity, col: HTMLElement): HTMLElement[];
24
+ export declare function findGridHeader(api: GridPrivateApiCommunity, field: string): Element | null;
25
+ export declare function findGridCells(api: GridPrivateApiCommunity, field: string): Element[];