@mui/x-data-grid 8.0.0-alpha.6 → 8.0.0-alpha.8

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 (397) hide show
  1. package/CHANGELOG.md +242 -1
  2. package/DataGrid/DataGrid.js +4 -5
  3. package/DataGrid/useDataGridComponent.d.ts +1 -1
  4. package/DataGrid/useDataGridComponent.js +1 -1
  5. package/components/GridHeaders.js +2 -2
  6. package/components/GridRow.d.ts +5 -9
  7. package/components/GridRow.js +26 -78
  8. package/components/GridSkeletonLoadingOverlay.js +18 -18
  9. package/components/cell/GridActionsCellItem.d.ts +16 -9
  10. package/components/cell/GridActionsCellItem.js +2 -0
  11. package/components/cell/GridCell.d.ts +9 -16
  12. package/components/cell/GridCell.js +17 -35
  13. package/components/cell/GridEditDateCell.js +1 -1
  14. package/components/cell/GridEditInputCell.js +1 -1
  15. package/components/cell/GridEditSingleSelectCell.js +2 -2
  16. package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
  17. package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -5
  18. package/components/columnHeaders/GridColumnGroupHeader.js +7 -10
  19. package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
  20. package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -5
  21. package/components/columnHeaders/GridColumnHeaderItem.js +13 -12
  22. package/components/columnSelection/GridCellCheckboxRenderer.js +4 -3
  23. package/components/columnSelection/GridHeaderCheckbox.js +6 -2
  24. package/components/columnsManagement/GridColumnsManagement.js +2 -2
  25. package/components/containers/GridRoot.d.ts +2 -2
  26. package/components/containers/GridRoot.js +14 -6
  27. package/components/containers/GridRootStyles.js +7 -0
  28. package/components/panel/GridPanel.d.ts +1 -1
  29. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -0
  30. package/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
  31. package/components/panel/filterPanel/GridFilterInputDate.d.ts +2 -1
  32. package/components/panel/filterPanel/GridFilterInputDate.js +32 -29
  33. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
  34. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
  35. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -0
  36. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
  37. package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -0
  38. package/components/panel/filterPanel/GridFilterInputValue.js +40 -37
  39. package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +1 -1
  40. package/components/toolbar/GridToolbarQuickFilter.js +2 -2
  41. package/components/virtualization/GridVirtualScrollbar.js +11 -12
  42. package/components/virtualization/GridVirtualScroller.js +4 -4
  43. package/constants/gridClasses.d.ts +12 -0
  44. package/constants/gridClasses.js +1 -1
  45. package/constants/localeTextConstants.js +1 -0
  46. package/context/GridContextProvider.d.ts +1 -1
  47. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +9 -2
  48. package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +1 -1
  49. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +1 -1
  50. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
  51. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +1 -1
  52. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
  53. package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +1 -1
  54. package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +1 -1
  55. package/hooks/core/useGridApiInitialization.d.ts +1 -1
  56. package/hooks/core/useGridApiInitialization.js +2 -2
  57. package/hooks/core/useGridInitialization.d.ts +1 -1
  58. package/hooks/core/useGridIsRtl.d.ts +1 -1
  59. package/hooks/core/useGridLocaleText.d.ts +1 -1
  60. package/hooks/core/useGridLoggerFactory.d.ts +1 -1
  61. package/hooks/core/useGridRefs.d.ts +1 -1
  62. package/hooks/core/useGridStateInitialization.d.ts +1 -1
  63. package/hooks/features/clipboard/useGridClipboard.d.ts +1 -1
  64. package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +1 -1
  65. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +5 -7
  66. package/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
  67. package/hooks/features/columnMenu/useGridColumnMenu.d.ts +1 -1
  68. package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
  69. package/hooks/features/columnResize/useGridColumnResize.js +4 -4
  70. package/hooks/features/columns/gridColumnsUtils.d.ts +3 -3
  71. package/hooks/features/columns/useGridColumnSpanning.d.ts +1 -1
  72. package/hooks/features/columns/useGridColumns.d.ts +1 -1
  73. package/hooks/features/density/useGridDensity.d.ts +1 -1
  74. package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
  75. package/hooks/features/editing/useGridCellEditing.d.ts +1 -1
  76. package/hooks/features/editing/useGridCellEditing.js +1 -1
  77. package/hooks/features/editing/useGridEditing.d.ts +1 -1
  78. package/hooks/features/editing/useGridRowEditing.d.ts +1 -1
  79. package/hooks/features/editing/useGridRowEditing.js +2 -2
  80. package/hooks/features/events/useGridEvents.d.ts +1 -1
  81. package/hooks/features/export/serializers/csvSerializer.d.ts +1 -1
  82. package/hooks/features/export/useGridCsvExport.d.ts +1 -1
  83. package/hooks/features/export/useGridPrintExport.d.ts +1 -1
  84. package/hooks/features/export/useGridPrintExport.js +1 -1
  85. package/hooks/features/export/utils.d.ts +1 -1
  86. package/hooks/features/filter/gridFilterSelector.d.ts +1 -1
  87. package/hooks/features/filter/gridFilterSelector.js +6 -1
  88. package/hooks/features/filter/gridFilterUtils.d.ts +6 -6
  89. package/hooks/features/filter/gridFilterUtils.js +3 -3
  90. package/hooks/features/filter/useGridFilter.d.ts +1 -1
  91. package/hooks/features/focus/useGridFocus.d.ts +1 -1
  92. package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +1 -1
  93. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
  94. package/hooks/features/keyboardNavigation/utils.d.ts +2 -2
  95. package/hooks/features/listView/useGridListView.d.ts +1 -1
  96. package/hooks/features/pagination/gridPaginationInterfaces.d.ts +3 -0
  97. package/hooks/features/pagination/gridPaginationSelector.d.ts +21 -2
  98. package/hooks/features/pagination/gridPaginationSelector.js +39 -1
  99. package/hooks/features/pagination/useGridPagination.d.ts +2 -2
  100. package/hooks/features/pagination/useGridPagination.js +5 -3
  101. package/hooks/features/pagination/useGridPaginationMeta.d.ts +1 -1
  102. package/hooks/features/pagination/useGridPaginationModel.d.ts +1 -1
  103. package/hooks/features/pagination/useGridPaginationModel.js +23 -1
  104. package/hooks/features/pagination/useGridRowCount.d.ts +1 -1
  105. package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +1 -1
  106. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
  107. package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
  108. package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +1 -1
  109. package/hooks/features/rowSelection/utils.d.ts +2 -2
  110. package/hooks/features/rows/gridRowSpanningUtils.d.ts +1 -1
  111. package/hooks/features/rows/gridRowsSelector.js +1 -1
  112. package/hooks/features/rows/gridRowsUtils.d.ts +3 -3
  113. package/hooks/features/rows/useGridParamsApi.d.ts +1 -1
  114. package/hooks/features/rows/useGridRowSpanning.d.ts +1 -1
  115. package/hooks/features/rows/useGridRows.d.ts +1 -1
  116. package/hooks/features/rows/useGridRows.js +2 -2
  117. package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
  118. package/hooks/features/rows/useGridRowsPreProcessors.d.ts +1 -1
  119. package/hooks/features/scroll/useGridScroll.d.ts +1 -1
  120. package/hooks/features/sorting/gridSortingUtils.d.ts +2 -2
  121. package/hooks/features/sorting/gridSortingUtils.js +2 -2
  122. package/hooks/features/sorting/useGridSorting.d.ts +1 -1
  123. package/hooks/features/statePersistence/useGridStatePersistence.d.ts +1 -1
  124. package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +6 -0
  125. package/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
  126. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +5 -4
  127. package/hooks/features/virtualization/useGridVirtualScroller.js +96 -43
  128. package/hooks/features/virtualization/useGridVirtualization.d.ts +1 -1
  129. package/hooks/utils/useGridApiContext.d.ts +1 -1
  130. package/hooks/utils/useGridApiEventHandler.d.ts +3 -3
  131. package/hooks/utils/useGridApiEventHandler.js +1 -1
  132. package/hooks/utils/useGridApiMethod.d.ts +1 -1
  133. package/hooks/utils/useGridApiRef.d.ts +1 -1
  134. package/hooks/utils/useGridInitializeState.d.ts +2 -2
  135. package/hooks/utils/useGridLogger.d.ts +1 -1
  136. package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
  137. package/hooks/utils/useGridPrivateApiContext.d.ts +1 -1
  138. package/hooks/utils/useGridSelector.d.ts +1 -1
  139. package/hooks/utils/useGridVisibleRows.d.ts +7 -5
  140. package/hooks/utils/useGridVisibleRows.js +5 -28
  141. package/index.js +1 -1
  142. package/internals/constants.d.ts +6 -0
  143. package/internals/constants.js +8 -1
  144. package/internals/index.d.ts +2 -1
  145. package/internals/index.js +1 -0
  146. package/internals/utils/attachPinnedStyle.d.ts +2 -0
  147. package/internals/utils/attachPinnedStyle.js +9 -0
  148. package/internals/utils/getPinnedCellOffset.d.ts +3 -3
  149. package/internals/utils/getPinnedCellOffset.js +6 -7
  150. package/internals/utils/index.d.ts +1 -0
  151. package/internals/utils/index.js +2 -1
  152. package/locales/arSD.js +2 -0
  153. package/locales/beBY.js +1 -0
  154. package/locales/bgBG.js +2 -0
  155. package/locales/csCZ.js +2 -0
  156. package/locales/daDK.js +2 -0
  157. package/locales/deDE.js +2 -0
  158. package/locales/elGR.js +2 -0
  159. package/locales/esES.js +2 -0
  160. package/locales/faIR.js +2 -0
  161. package/locales/fiFI.js +2 -0
  162. package/locales/frFR.js +2 -0
  163. package/locales/heIL.js +2 -0
  164. package/locales/hrHR.js +2 -0
  165. package/locales/huHU.js +2 -0
  166. package/locales/isIS.js +2 -0
  167. package/locales/itIT.js +2 -0
  168. package/locales/jaJP.js +2 -0
  169. package/locales/koKR.js +2 -0
  170. package/locales/nbNO.js +2 -0
  171. package/locales/nlNL.js +2 -0
  172. package/locales/nnNO.js +2 -0
  173. package/locales/plPL.js +2 -0
  174. package/locales/ptBR.js +2 -0
  175. package/locales/ptPT.js +2 -0
  176. package/locales/roRO.js +2 -0
  177. package/locales/ruRU.js +2 -0
  178. package/locales/skSK.js +2 -0
  179. package/locales/svSE.js +2 -0
  180. package/locales/trTR.js +2 -0
  181. package/locales/ukUA.js +2 -0
  182. package/locales/urPK.js +2 -0
  183. package/locales/viVN.js +2 -0
  184. package/locales/zhCN.js +2 -0
  185. package/locales/zhHK.js +2 -0
  186. package/locales/zhTW.js +2 -0
  187. package/material/index.js +2 -1
  188. package/models/api/gridCoreApi.d.ts +7 -7
  189. package/models/api/gridDensityApi.d.ts +1 -1
  190. package/models/api/gridLocaleTextApi.d.ts +1 -0
  191. package/models/colDef/gridColDef.d.ts +8 -8
  192. package/models/events/gridEventLookup.d.ts +6 -1
  193. package/models/gridBaseSlots.d.ts +32 -2
  194. package/models/gridExport.d.ts +1 -1
  195. package/models/gridFilterOperator.d.ts +1 -1
  196. package/models/gridIconSlotsComponent.d.ts +5 -0
  197. package/models/gridSlotsComponentsProps.d.ts +12 -8
  198. package/models/gridStateCommunity.d.ts +4 -0
  199. package/models/props/DataGridProps.d.ts +1 -1
  200. package/modern/DataGrid/DataGrid.js +4 -5
  201. package/modern/DataGrid/useDataGridComponent.js +1 -1
  202. package/modern/components/GridHeaders.js +2 -2
  203. package/modern/components/GridRow.js +26 -78
  204. package/modern/components/GridSkeletonLoadingOverlay.js +18 -18
  205. package/modern/components/cell/GridActionsCellItem.js +2 -0
  206. package/modern/components/cell/GridCell.js +17 -35
  207. package/modern/components/cell/GridEditDateCell.js +1 -1
  208. package/modern/components/cell/GridEditInputCell.js +1 -1
  209. package/modern/components/cell/GridEditSingleSelectCell.js +2 -2
  210. package/modern/components/columnHeaders/GridColumnGroupHeader.js +7 -10
  211. package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
  212. package/modern/components/columnHeaders/GridColumnHeaderItem.js +13 -12
  213. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +4 -3
  214. package/modern/components/columnSelection/GridHeaderCheckbox.js +6 -2
  215. package/modern/components/columnsManagement/GridColumnsManagement.js +2 -2
  216. package/modern/components/containers/GridRoot.js +14 -6
  217. package/modern/components/containers/GridRootStyles.js +7 -0
  218. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
  219. package/modern/components/panel/filterPanel/GridFilterInputDate.js +32 -29
  220. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
  221. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
  222. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
  223. package/modern/components/panel/filterPanel/GridFilterInputValue.js +40 -37
  224. package/modern/components/toolbar/GridToolbarQuickFilter.js +2 -2
  225. package/modern/components/virtualization/GridVirtualScrollbar.js +11 -12
  226. package/modern/components/virtualization/GridVirtualScroller.js +4 -4
  227. package/modern/constants/gridClasses.js +1 -1
  228. package/modern/constants/localeTextConstants.js +1 -0
  229. package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
  230. package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
  231. package/modern/hooks/core/useGridApiInitialization.js +2 -2
  232. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
  233. package/modern/hooks/features/columnResize/useGridColumnResize.js +4 -4
  234. package/modern/hooks/features/editing/useGridCellEditing.js +1 -1
  235. package/modern/hooks/features/editing/useGridRowEditing.js +2 -2
  236. package/modern/hooks/features/export/useGridPrintExport.js +1 -1
  237. package/modern/hooks/features/filter/gridFilterSelector.js +6 -1
  238. package/modern/hooks/features/filter/gridFilterUtils.js +3 -3
  239. package/modern/hooks/features/pagination/gridPaginationSelector.js +39 -1
  240. package/modern/hooks/features/pagination/useGridPagination.js +5 -3
  241. package/modern/hooks/features/pagination/useGridPaginationModel.js +23 -1
  242. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
  243. package/modern/hooks/features/rows/gridRowsSelector.js +1 -1
  244. package/modern/hooks/features/rows/useGridRows.js +2 -2
  245. package/modern/hooks/features/sorting/gridSortingUtils.js +2 -2
  246. package/modern/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
  247. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +96 -43
  248. package/modern/hooks/utils/useGridApiEventHandler.js +1 -1
  249. package/modern/hooks/utils/useGridVisibleRows.js +5 -28
  250. package/modern/index.js +1 -1
  251. package/modern/internals/constants.js +8 -1
  252. package/modern/internals/index.js +1 -0
  253. package/modern/internals/utils/attachPinnedStyle.js +9 -0
  254. package/modern/internals/utils/getPinnedCellOffset.js +6 -7
  255. package/modern/internals/utils/index.js +2 -1
  256. package/modern/locales/arSD.js +2 -0
  257. package/modern/locales/beBY.js +1 -0
  258. package/modern/locales/bgBG.js +2 -0
  259. package/modern/locales/csCZ.js +2 -0
  260. package/modern/locales/daDK.js +2 -0
  261. package/modern/locales/deDE.js +2 -0
  262. package/modern/locales/elGR.js +2 -0
  263. package/modern/locales/esES.js +2 -0
  264. package/modern/locales/faIR.js +2 -0
  265. package/modern/locales/fiFI.js +2 -0
  266. package/modern/locales/frFR.js +2 -0
  267. package/modern/locales/heIL.js +2 -0
  268. package/modern/locales/hrHR.js +2 -0
  269. package/modern/locales/huHU.js +2 -0
  270. package/modern/locales/isIS.js +2 -0
  271. package/modern/locales/itIT.js +2 -0
  272. package/modern/locales/jaJP.js +2 -0
  273. package/modern/locales/koKR.js +2 -0
  274. package/modern/locales/nbNO.js +2 -0
  275. package/modern/locales/nlNL.js +2 -0
  276. package/modern/locales/nnNO.js +2 -0
  277. package/modern/locales/plPL.js +2 -0
  278. package/modern/locales/ptBR.js +2 -0
  279. package/modern/locales/ptPT.js +2 -0
  280. package/modern/locales/roRO.js +2 -0
  281. package/modern/locales/ruRU.js +2 -0
  282. package/modern/locales/skSK.js +2 -0
  283. package/modern/locales/svSE.js +2 -0
  284. package/modern/locales/trTR.js +2 -0
  285. package/modern/locales/ukUA.js +2 -0
  286. package/modern/locales/urPK.js +2 -0
  287. package/modern/locales/viVN.js +2 -0
  288. package/modern/locales/zhCN.js +2 -0
  289. package/modern/locales/zhHK.js +2 -0
  290. package/modern/locales/zhTW.js +2 -0
  291. package/modern/material/index.js +2 -1
  292. package/modern/utils/cellBorderUtils.js +5 -5
  293. package/modern/utils/domUtils.js +7 -2
  294. package/modern/utils/rtlFlipSide.js +22 -0
  295. package/node/DataGrid/DataGrid.js +2 -3
  296. package/node/DataGrid/useDataGridComponent.js +1 -1
  297. package/node/components/GridHeaders.js +2 -2
  298. package/node/components/GridRow.js +25 -77
  299. package/node/components/GridSkeletonLoadingOverlay.js +17 -17
  300. package/node/components/cell/GridActionsCellItem.js +1 -1
  301. package/node/components/cell/GridCell.js +18 -36
  302. package/node/components/cell/GridEditDateCell.js +1 -1
  303. package/node/components/cell/GridEditInputCell.js +1 -1
  304. package/node/components/cell/GridEditSingleSelectCell.js +2 -2
  305. package/node/components/columnHeaders/GridColumnGroupHeader.js +7 -10
  306. package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
  307. package/node/components/columnHeaders/GridColumnHeaderItem.js +13 -12
  308. package/node/components/columnSelection/GridCellCheckboxRenderer.js +3 -2
  309. package/node/components/columnSelection/GridHeaderCheckbox.js +6 -2
  310. package/node/components/columnsManagement/GridColumnsManagement.js +2 -2
  311. package/node/components/containers/GridRoot.js +14 -6
  312. package/node/components/containers/GridRootStyles.js +7 -0
  313. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
  314. package/node/components/panel/filterPanel/GridFilterInputDate.js +31 -28
  315. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
  316. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
  317. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
  318. package/node/components/panel/filterPanel/GridFilterInputValue.js +39 -36
  319. package/node/components/toolbar/GridToolbarQuickFilter.js +2 -2
  320. package/node/components/virtualization/GridVirtualScrollbar.js +11 -12
  321. package/node/components/virtualization/GridVirtualScroller.js +4 -4
  322. package/node/constants/gridClasses.js +1 -1
  323. package/node/constants/localeTextConstants.js +1 -0
  324. package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
  325. package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
  326. package/node/hooks/core/useGridApiInitialization.js +2 -2
  327. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +32 -74
  328. package/node/hooks/features/columnResize/useGridColumnResize.js +4 -4
  329. package/node/hooks/features/editing/useGridCellEditing.js +1 -1
  330. package/node/hooks/features/editing/useGridRowEditing.js +2 -2
  331. package/node/hooks/features/export/useGridPrintExport.js +1 -1
  332. package/node/hooks/features/filter/gridFilterSelector.js +6 -1
  333. package/node/hooks/features/filter/gridFilterUtils.js +3 -3
  334. package/node/hooks/features/pagination/gridPaginationSelector.js +41 -3
  335. package/node/hooks/features/pagination/useGridPagination.js +5 -3
  336. package/node/hooks/features/pagination/useGridPaginationModel.js +23 -1
  337. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
  338. package/node/hooks/features/rows/gridRowsSelector.js +1 -1
  339. package/node/hooks/features/rows/useGridRows.js +1 -1
  340. package/node/hooks/features/sorting/gridSortingUtils.js +2 -2
  341. package/node/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +49 -0
  342. package/node/hooks/features/virtualization/useGridVirtualScroller.js +96 -43
  343. package/node/hooks/utils/useGridApiEventHandler.js +1 -1
  344. package/node/hooks/utils/useGridVisibleRows.js +3 -28
  345. package/node/index.js +1 -1
  346. package/node/internals/constants.js +9 -2
  347. package/node/internals/index.js +12 -0
  348. package/node/internals/utils/attachPinnedStyle.js +15 -0
  349. package/node/internals/utils/getPinnedCellOffset.js +6 -7
  350. package/node/internals/utils/index.js +11 -0
  351. package/node/locales/arSD.js +2 -0
  352. package/node/locales/beBY.js +1 -0
  353. package/node/locales/bgBG.js +2 -0
  354. package/node/locales/csCZ.js +2 -0
  355. package/node/locales/daDK.js +2 -0
  356. package/node/locales/deDE.js +2 -0
  357. package/node/locales/elGR.js +2 -0
  358. package/node/locales/esES.js +2 -0
  359. package/node/locales/faIR.js +2 -0
  360. package/node/locales/fiFI.js +2 -0
  361. package/node/locales/frFR.js +2 -0
  362. package/node/locales/heIL.js +2 -0
  363. package/node/locales/hrHR.js +2 -0
  364. package/node/locales/huHU.js +2 -0
  365. package/node/locales/isIS.js +2 -0
  366. package/node/locales/itIT.js +2 -0
  367. package/node/locales/jaJP.js +2 -0
  368. package/node/locales/koKR.js +2 -0
  369. package/node/locales/nbNO.js +2 -0
  370. package/node/locales/nlNL.js +2 -0
  371. package/node/locales/nnNO.js +2 -0
  372. package/node/locales/plPL.js +2 -0
  373. package/node/locales/ptBR.js +2 -0
  374. package/node/locales/ptPT.js +2 -0
  375. package/node/locales/roRO.js +2 -0
  376. package/node/locales/ruRU.js +2 -0
  377. package/node/locales/skSK.js +2 -0
  378. package/node/locales/svSE.js +2 -0
  379. package/node/locales/trTR.js +2 -0
  380. package/node/locales/ukUA.js +2 -0
  381. package/node/locales/urPK.js +2 -0
  382. package/node/locales/viVN.js +2 -0
  383. package/node/locales/zhCN.js +2 -0
  384. package/node/locales/zhHK.js +2 -0
  385. package/node/locales/zhTW.js +2 -0
  386. package/node/material/index.js +2 -1
  387. package/node/utils/cellBorderUtils.js +5 -5
  388. package/node/utils/domUtils.js +7 -2
  389. package/node/utils/rtlFlipSide.js +29 -0
  390. package/package.json +2 -2
  391. package/utils/cellBorderUtils.d.ts +3 -3
  392. package/utils/cellBorderUtils.js +5 -5
  393. package/utils/createSelector.d.ts +1 -1
  394. package/utils/domUtils.js +7 -2
  395. package/utils/getPublicApiRef.d.ts +1 -1
  396. package/utils/rtlFlipSide.d.ts +2 -0
  397. package/utils/rtlFlipSide.js +22 -0
@@ -24,7 +24,6 @@ var _useRunOnce = require("../../utils/useRunOnce");
24
24
  var _gridColumnsSelector = require("../columns/gridColumnsSelector");
25
25
  var _gridDimensionsSelectors = require("../dimensions/gridDimensionsSelectors");
26
26
  var _gridRowsSelector = require("../rows/gridRowsSelector");
27
- var _gridFocusStateSelector = require("../focus/gridFocusStateSelector");
28
27
  var _useGridVisibleRows = require("../../utils/useGridVisibleRows");
29
28
  var _utils2 = require("../../utils");
30
29
  var platform = _interopRequireWildcard(require("../../../utils/platform"));
@@ -37,6 +36,7 @@ var _useGridVirtualization = require("./useGridVirtualization");
37
36
  var _gridRowSpanningSelectors = require("../rows/gridRowSpanningSelectors");
38
37
  var _gridListViewSelectors = require("../listView/gridListViewSelectors");
39
38
  var _gridRowsUtils = require("../rows/gridRowsUtils");
39
+ var _gridFocusedVirtualCellSelector = require("./gridFocusedVirtualCellSelector");
40
40
  var _jsxRuntime = require("react/jsx-runtime");
41
41
  const MINIMUM_COLUMN_WIDTH = 50;
42
42
  var ScrollDirection = /*#__PURE__*/function (ScrollDirection) {
@@ -84,12 +84,9 @@ const useGridVirtualScroller = () => {
84
84
  const hasBottomPinnedRows = pinnedRows.bottom.length > 0;
85
85
  const [panels, setPanels] = React.useState(EMPTY_DETAIL_PANELS);
86
86
  const isRtl = (0, _RtlProvider.useRtl)();
87
- const cellFocus = (0, _useGridSelector.useGridSelector)(apiRef, _gridFocusStateSelector.gridFocusCellSelector);
88
- const cellTabIndex = (0, _useGridSelector.useGridSelector)(apiRef, _gridFocusStateSelector.gridTabIndexCellSelector);
89
87
  const rowsMeta = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsMetaSelector.gridRowsMetaSelector);
90
88
  const selectedRowsLookup = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowSelectionSelector.selectedIdsLookupSelector);
91
89
  const currentPage = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef, rootProps);
92
- const gridRootRef = apiRef.current.rootElementRef;
93
90
  const mainRef = apiRef.current.mainElementRef;
94
91
  const scrollerRef = apiRef.current.virtualScrollerRef;
95
92
  const scrollbarVerticalRef = apiRef.current.virtualScrollbarVerticalRef;
@@ -97,6 +94,8 @@ const useGridVirtualScroller = () => {
97
94
  const contentHeight = dimensions.contentSize.height;
98
95
  const columnsTotalWidth = dimensions.columnsTotalWidth;
99
96
  const hasColSpan = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridHasColSpanSelector);
97
+ const isRenderContextReady = React.useRef(false);
98
+ const previousSize = React.useRef(null);
100
99
  const mainRefCallback = React.useCallback(node => {
101
100
  mainRef.current = node;
102
101
  if (!node) {
@@ -104,7 +103,10 @@ const useGridVirtualScroller = () => {
104
103
  }
105
104
  const initialRect = node.getBoundingClientRect();
106
105
  let lastSize = roundDimensions(initialRect);
107
- apiRef.current.publishEvent('resize', lastSize);
106
+ if (!previousSize.current || lastSize.width !== previousSize.current.width && lastSize.height !== previousSize.current.height) {
107
+ previousSize.current = lastSize;
108
+ apiRef.current.publishEvent('resize', lastSize);
109
+ }
108
110
  if (typeof ResizeObserver === 'undefined') {
109
111
  return undefined;
110
112
  }
@@ -145,17 +147,15 @@ const useGridVirtualScroller = () => {
145
147
  * work that's not necessary. Thus we store the context at the start of the scroll in `frozenContext`, and the rows
146
148
  * that are part of this old context will keep their same render context as to avoid re-rendering.
147
149
  */
148
- const scrollPosition = React.useRef(EMPTY_SCROLL_POSITION);
150
+ const scrollPosition = React.useRef(rootProps.initialState?.scroll ?? EMPTY_SCROLL_POSITION);
151
+ const ignoreNextScrollEvent = React.useRef(false);
149
152
  const previousContextScrollPosition = React.useRef(EMPTY_SCROLL_POSITION);
150
153
  const previousRowContext = React.useRef(_useGridVirtualization.EMPTY_RENDER_CONTEXT);
151
154
  const renderContext = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridRenderContextSelector);
155
+ const focusedVirtualCell = (0, _useGridSelector.useGridSelector)(apiRef, _gridFocusedVirtualCellSelector.gridFocusedVirtualCellSelector);
152
156
  const scrollTimeout = (0, _useTimeout.default)();
153
157
  const frozenContext = React.useRef(undefined);
154
158
  const scrollCache = (0, _useLazyRef.default)(() => createScrollCache(isRtl, rootProps.rowBufferPx, rootProps.columnBufferPx, dimensions.rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6)).current;
155
- const focusedCell = {
156
- rowIndex: React.useMemo(() => cellFocus ? currentPage.rows.findIndex(row => row.id === cellFocus.id) : -1, [cellFocus, currentPage.rows]),
157
- columnIndex: React.useMemo(() => cellFocus ? visibleColumns.findIndex(column => column.field === cellFocus.field) : -1, [cellFocus, visibleColumns])
158
- };
159
159
  const updateRenderContext = React.useCallback(nextRenderContext => {
160
160
  if (areRenderContextsEqual(nextRenderContext, apiRef.current.state.virtualization.renderContext)) {
161
161
  return;
@@ -239,6 +239,10 @@ const useGridVirtualScroller = () => {
239
239
  updateRenderContext(nextRenderContext);
240
240
  };
241
241
  const handleScroll = (0, _utils.unstable_useEventCallback)(event => {
242
+ if (ignoreNextScrollEvent.current) {
243
+ ignoreNextScrollEvent.current = false;
244
+ return;
245
+ }
242
246
  const {
243
247
  scrollTop,
244
248
  scrollLeft
@@ -297,14 +301,14 @@ const useGridVirtualScroller = () => {
297
301
  const lastRowToRender = Math.min(baseRenderContext.lastRowIndex, rowModels.length);
298
302
  const rowIndexes = params.rows ? (0, _utils3.range)(0, params.rows.length) : (0, _utils3.range)(firstRowToRender, lastRowToRender);
299
303
  let virtualRowIndex = -1;
300
- if (!isPinnedSection && focusedCell.rowIndex !== -1) {
301
- if (focusedCell.rowIndex < firstRowToRender) {
302
- virtualRowIndex = focusedCell.rowIndex;
303
- rowIndexes.unshift(virtualRowIndex);
304
+ if (!isPinnedSection && focusedVirtualCell) {
305
+ if (focusedVirtualCell.rowIndex < firstRowToRender) {
306
+ rowIndexes.unshift(focusedVirtualCell.rowIndex);
307
+ virtualRowIndex = focusedVirtualCell.rowIndex;
304
308
  }
305
- if (focusedCell.rowIndex >= lastRowToRender) {
306
- virtualRowIndex = focusedCell.rowIndex;
307
- rowIndexes.push(virtualRowIndex);
309
+ if (focusedVirtualCell.rowIndex > lastRowToRender) {
310
+ rowIndexes.push(focusedVirtualCell.rowIndex);
311
+ virtualRowIndex = focusedVirtualCell.rowIndex;
308
312
  }
309
313
  }
310
314
  const rows = [];
@@ -344,7 +348,6 @@ const useGridVirtualScroller = () => {
344
348
  });
345
349
  }
346
350
  }
347
- const hasFocus = cellFocus?.id === id;
348
351
  const baseRowHeight = !apiRef.current.rowHasAutoHeight(id) ? apiRef.current.unstable_getRowHeight(id) : 'auto';
349
352
  let isSelected;
350
353
  if (selectedRowsLookup[id] == null) {
@@ -369,19 +372,16 @@ const useGridVirtualScroller = () => {
369
372
  isLastVisible = isLastVisibleInSection;
370
373
  }
371
374
  }
372
- const isVirtualRow = rowIndexInPage === virtualRowIndex;
373
- const isNotVisible = isVirtualRow;
374
- let tabbableCell = null;
375
- if (cellTabIndex !== null && cellTabIndex.id === id) {
376
- const cellParams = apiRef.current.getCellParams(id, cellTabIndex.field);
377
- tabbableCell = cellParams.cellMode === 'view' ? cellTabIndex.field : null;
378
- }
379
375
  let currentRenderContext = baseRenderContext;
380
376
  if (!isPinnedSection && frozenContext.current && rowIndexInPage >= frozenContext.current.firstRowIndex && rowIndexInPage < frozenContext.current.lastRowIndex) {
381
377
  currentRenderContext = frozenContext.current;
382
378
  }
379
+ const isVirtualFocusRow = rowIndexInPage === virtualRowIndex;
380
+ const isVirtualFocusColumn = focusedVirtualCell?.rowIndex === rowIndex;
383
381
  const offsetLeft = computeOffsetLeft(columnPositions, currentRenderContext, pinnedColumns.left.length);
384
382
  const showBottomBorder = isLastVisibleInSection && params.position === 'top';
383
+ const firstColumnIndex = currentRenderContext.firstColumnIndex;
384
+ const lastColumnIndex = currentRenderContext.lastColumnIndex;
385
385
  rows.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.row, (0, _extends2.default)({
386
386
  row: model,
387
387
  rowId: id,
@@ -389,19 +389,21 @@ const useGridVirtualScroller = () => {
389
389
  selected: isSelected,
390
390
  offsetTop: params.rows ? undefined : rowsMeta.positions[rowIndexInPage],
391
391
  offsetLeft: offsetLeft,
392
- dimensions: dimensions,
392
+ columnsTotalWidth: dimensions.columnsTotalWidth,
393
393
  rowHeight: baseRowHeight,
394
- tabbableCell: tabbableCell,
395
394
  pinnedColumns: pinnedColumns,
396
395
  visibleColumns: visibleColumns,
397
- renderContext: currentRenderContext,
398
- focusedColumnIndex: hasFocus ? focusedCell.columnIndex : undefined,
396
+ firstColumnIndex: firstColumnIndex,
397
+ lastColumnIndex: lastColumnIndex,
398
+ focusedColumnIndex: isVirtualFocusColumn ? focusedVirtualCell.columnIndex : undefined,
399
399
  isFirstVisible: isFirstVisible,
400
400
  isLastVisible: isLastVisible,
401
- isNotVisible: isNotVisible,
402
- showBottomBorder: showBottomBorder
401
+ isNotVisible: isVirtualFocusRow,
402
+ showBottomBorder: showBottomBorder,
403
+ scrollbarWidth: dimensions.hasScrollY ? dimensions.scrollbarSize : 0,
404
+ gridHasFiller: dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width
403
405
  }, rowProps), id));
404
- if (isNotVisible) {
406
+ if (isVirtualFocusRow) {
405
407
  return;
406
408
  }
407
409
  const panel = panels.get(id);
@@ -432,18 +434,21 @@ const useGridVirtualScroller = () => {
432
434
  }
433
435
  return size;
434
436
  }, [columnsTotalWidth, contentHeight, needsHorizontalScrollbar]);
435
- React.useEffect(() => {
436
- apiRef.current.publishEvent('virtualScrollerContentSizeChange');
437
- }, [apiRef, contentSize]);
438
- (0, _utils.unstable_useEnhancedEffect)(() => {
439
- // TODO a scroll reset should not be necessary
440
- if (enabledForColumns) {
441
- scrollerRef.current.scrollLeft = 0;
437
+ const onContentSizeApplied = React.useCallback(node => {
438
+ if (!node) {
439
+ return;
442
440
  }
443
- if (enabledForRows) {
444
- scrollerRef.current.scrollTop = 0;
441
+ apiRef.current.publishEvent('virtualScrollerContentSizeChange', {
442
+ columnsTotalWidth,
443
+ contentHeight
444
+ });
445
+ }, [apiRef, columnsTotalWidth, contentHeight]);
446
+ (0, _utils.unstable_useEnhancedEffect)(() => {
447
+ if (!isRenderContextReady.current) {
448
+ return;
445
449
  }
446
- }, [enabledForColumns, enabledForRows, gridRootRef, scrollerRef]);
450
+ apiRef.current.updateRenderContext?.();
451
+ }, [apiRef, enabledForColumns, enabledForRows]);
447
452
  (0, _utils.unstable_useEnhancedEffect)(() => {
448
453
  if (listView) {
449
454
  scrollerRef.current.scrollLeft = 0;
@@ -458,6 +463,53 @@ const useGridVirtualScroller = () => {
458
463
  left: scrollPosition.current.left,
459
464
  renderContext: initialRenderContext
460
465
  });
466
+ isRenderContextReady.current = true;
467
+ if (rootProps.initialState?.scroll && scrollerRef.current) {
468
+ const scroller = scrollerRef.current;
469
+ const {
470
+ top,
471
+ left
472
+ } = rootProps.initialState.scroll;
473
+
474
+ // On initial mount, if we have columns available, we can restore the horizontal scroll immediately, but we need to skip the resulting scroll event, otherwise we would recalculate the render context at position top=0, left=restoredValue, but the initial render context is already calculated based on the initial value of scrollPosition ref.
475
+ const isScrollRestored = {
476
+ top: !(top > 0),
477
+ left: !(left > 0)
478
+ };
479
+ if (!isScrollRestored.left && columnsTotalWidth) {
480
+ scroller.scrollLeft = left;
481
+ ignoreNextScrollEvent.current = true;
482
+ isScrollRestored.left = true;
483
+ }
484
+
485
+ // For the sake of completeness, but I'm not sure if contentHeight is ever available at this point. Maybe when virtualisation is disabled?
486
+ if (!isScrollRestored.top && contentHeight) {
487
+ scroller.scrollTop = top;
488
+ ignoreNextScrollEvent.current = true;
489
+ isScrollRestored.top = true;
490
+ }
491
+
492
+ // To restore the vertical scroll, we need to wait until the rows are available in the DOM (otherwise there's nowhere to scroll), but before paint to avoid reflows
493
+ if (!isScrollRestored.top || !isScrollRestored.left) {
494
+ const unsubscribeContentSizeChange = apiRef.current.subscribeEvent('virtualScrollerContentSizeChange', params => {
495
+ if (!isScrollRestored.left && params.columnsTotalWidth) {
496
+ scroller.scrollLeft = left;
497
+ ignoreNextScrollEvent.current = true;
498
+ isScrollRestored.left = true;
499
+ }
500
+ if (!isScrollRestored.top && params.contentHeight) {
501
+ scroller.scrollTop = top;
502
+ ignoreNextScrollEvent.current = true;
503
+ isScrollRestored.top = true;
504
+ }
505
+ if (isScrollRestored.left && isScrollRestored.top) {
506
+ unsubscribeContentSizeChange();
507
+ }
508
+ });
509
+ return unsubscribeContentSizeChange;
510
+ }
511
+ }
512
+ return undefined;
461
513
  });
462
514
  apiRef.current.register('private', {
463
515
  updateRenderContext: forceUpdateRenderContext
@@ -485,7 +537,8 @@ const useGridVirtualScroller = () => {
485
537
  }),
486
538
  getContentProps: () => ({
487
539
  style: contentSize,
488
- role: 'presentation'
540
+ role: 'presentation',
541
+ ref: onContentSizeApplied
489
542
  }),
490
543
  getRenderZoneProps: () => ({
491
544
  role: 'rowgroup'
@@ -34,7 +34,7 @@ function createUseGridApiEventHandler(registryContainer) {
34
34
  }
35
35
  const [objectRetainedByReact] = React.useState(new ObjectToBeRetainedByReact());
36
36
  const subscription = React.useRef(null);
37
- const handlerRef = React.useRef();
37
+ const handlerRef = React.useRef(null);
38
38
  handlerRef.current = handler;
39
39
  const cleanupTokenRef = React.useRef(null);
40
40
  if (!subscription.current && handlerRef.current) {
@@ -1,34 +1,13 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.useGridVisibleRows = exports.getVisibleRows = void 0;
8
- var React = _interopRequireWildcard(require("react"));
9
7
  var _gridPaginationSelector = require("../features/pagination/gridPaginationSelector");
10
- var _gridFilterSelector = require("../features/filter/gridFilterSelector");
8
+ var _ = require(".");
11
9
  const getVisibleRows = (apiRef, props) => {
12
- let rows;
13
- let range;
14
- if (props.pagination && props.paginationMode === 'client') {
15
- range = (0, _gridPaginationSelector.gridPaginationRowRangeSelector)(apiRef);
16
- rows = (0, _gridPaginationSelector.gridPaginatedVisibleSortedGridRowEntriesSelector)(apiRef);
17
- } else {
18
- rows = (0, _gridFilterSelector.gridExpandedSortedRowEntriesSelector)(apiRef);
19
- if (rows.length === 0) {
20
- range = null;
21
- } else {
22
- range = {
23
- firstRowIndex: 0,
24
- lastRowIndex: rows.length - 1
25
- };
26
- }
27
- }
28
- return {
29
- rows,
30
- range
31
- };
10
+ return (0, _gridPaginationSelector.gridVisibleRowsSelector)(apiRef);
32
11
  };
33
12
 
34
13
  /**
@@ -40,10 +19,6 @@ const getVisibleRows = (apiRef, props) => {
40
19
  */
41
20
  exports.getVisibleRows = getVisibleRows;
42
21
  const useGridVisibleRows = (apiRef, props) => {
43
- const response = getVisibleRows(apiRef, props);
44
- return React.useMemo(() => ({
45
- rows: response.rows,
46
- range: response.range
47
- }), [response.rows, response.range]);
22
+ return (0, _.useGridSelector)(apiRef, _gridPaginationSelector.gridVisibleRowsSelector);
48
23
  };
49
24
  exports.useGridVisibleRows = useGridVisibleRows;
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.0.0-alpha.6
2
+ * @mui/x-data-grid v8.0.0-alpha.8
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -3,7 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.GRID_TREE_DATA_GROUPING_FIELD = exports.GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = exports.GRID_DETAIL_PANEL_TOGGLE_FIELD = void 0;
6
+ exports.PinnedColumnPosition = exports.GRID_TREE_DATA_GROUPING_FIELD = exports.GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = exports.GRID_DETAIL_PANEL_TOGGLE_FIELD = void 0;
7
7
  const GRID_TREE_DATA_GROUPING_FIELD = exports.GRID_TREE_DATA_GROUPING_FIELD = '__tree_data_group__';
8
8
  const GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = exports.GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = '__row_group_by_columns_group__';
9
- const GRID_DETAIL_PANEL_TOGGLE_FIELD = exports.GRID_DETAIL_PANEL_TOGGLE_FIELD = '__detail_panel_toggle__';
9
+ const GRID_DETAIL_PANEL_TOGGLE_FIELD = exports.GRID_DETAIL_PANEL_TOGGLE_FIELD = '__detail_panel_toggle__';
10
+ let PinnedColumnPosition = exports.PinnedColumnPosition = /*#__PURE__*/function (PinnedColumnPosition) {
11
+ PinnedColumnPosition[PinnedColumnPosition["NONE"] = 0] = "NONE";
12
+ PinnedColumnPosition[PinnedColumnPosition["LEFT"] = 1] = "LEFT";
13
+ PinnedColumnPosition[PinnedColumnPosition["RIGHT"] = 2] = "RIGHT";
14
+ PinnedColumnPosition[PinnedColumnPosition["VIRTUAL"] = 3] = "VIRTUAL";
15
+ return PinnedColumnPosition;
16
+ }({});
@@ -814,6 +814,18 @@ Object.keys(_createControllablePromise).forEach(function (key) {
814
814
  }
815
815
  });
816
816
  });
817
+ var _rtlFlipSide = require("../utils/rtlFlipSide");
818
+ Object.keys(_rtlFlipSide).forEach(function (key) {
819
+ if (key === "default" || key === "__esModule") return;
820
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
821
+ if (key in exports && exports[key] === _rtlFlipSide[key]) return;
822
+ Object.defineProperty(exports, key, {
823
+ enumerable: true,
824
+ get: function () {
825
+ return _rtlFlipSide[key];
826
+ }
827
+ });
828
+ });
817
829
  var _createSelector = require("../utils/createSelector");
818
830
  var _domUtils = require("../utils/domUtils");
819
831
  var _keyboardUtils = require("../utils/keyboardUtils");
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.attachPinnedStyle = attachPinnedStyle;
7
+ var _rtlFlipSide = require("../../utils/rtlFlipSide");
8
+ function attachPinnedStyle(style, isRtl, pinnedPosition, pinnedOffset) {
9
+ const side = (0, _rtlFlipSide.rtlFlipSide)(pinnedPosition, isRtl);
10
+ if (!side || pinnedOffset === undefined) {
11
+ return style;
12
+ }
13
+ style[side] = pinnedOffset;
14
+ return style;
15
+ }
@@ -4,19 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
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;
7
+ var _constants = require("../constants");
8
+ const getPinnedCellOffset = (pinnedPosition, computedWidth, columnIndex, columnPositions, columnsTotalWidth, scrollbarWidth) => {
10
9
  let pinnedOffset;
11
10
  switch (pinnedPosition) {
12
- case _columns.GridPinnedColumnPosition.LEFT:
11
+ case _constants.PinnedColumnPosition.LEFT:
13
12
  pinnedOffset = columnPositions[columnIndex];
14
13
  break;
15
- case _columns.GridPinnedColumnPosition.RIGHT:
16
- pinnedOffset = dimensions.columnsTotalWidth - columnPositions[columnIndex] - computedWidth + scrollbarWidth;
14
+ case _constants.PinnedColumnPosition.RIGHT:
15
+ pinnedOffset = columnsTotalWidth - columnPositions[columnIndex] - computedWidth + scrollbarWidth;
17
16
  break;
18
17
  default:
19
- pinnedOffset = 0;
18
+ pinnedOffset = undefined;
20
19
  break;
21
20
  }
22
21
  return pinnedOffset;
@@ -35,4 +35,15 @@ Object.keys(_gridRowGroupingUtils).forEach(function (key) {
35
35
  return _gridRowGroupingUtils[key];
36
36
  }
37
37
  });
38
+ });
39
+ var _attachPinnedStyle = require("./attachPinnedStyle");
40
+ Object.keys(_attachPinnedStyle).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _attachPinnedStyle[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _attachPinnedStyle[key];
47
+ }
48
+ });
38
49
  });
@@ -108,6 +108,8 @@ const arSDGrid = {
108
108
  'headerFilterOperator>=': 'أكبر من او يساوي',
109
109
  'headerFilterOperator<': 'اصغر من',
110
110
  'headerFilterOperator<=': 'اصغر من او يساوي',
111
+ // headerFilterClear: 'Clear filter',
112
+
111
113
  // Filter values text
112
114
  filterValueAny: 'أي',
113
115
  filterValueTrue: 'صائب',
@@ -123,6 +123,7 @@ const beBYGrid = {
123
123
  // 'headerFilterOperator>=': 'Greater than or equal to',
124
124
  // 'headerFilterOperator<': 'Less than',
125
125
  // 'headerFilterOperator<=': 'Less than or equal to',
126
+ // headerFilterClear: 'Clear filter',
126
127
 
127
128
  // Filter values text
128
129
  filterValueAny: 'усякі',
@@ -108,6 +108,8 @@ const bgBGGrid = {
108
108
  'headerFilterOperator>=': 'По-голямо или равно на',
109
109
  'headerFilterOperator<': 'По-малко от',
110
110
  'headerFilterOperator<=': 'По-малко или равно на',
111
+ // headerFilterClear: 'Clear filter',
112
+
111
113
  // Filter values text
112
114
  filterValueAny: 'всякакви',
113
115
  filterValueTrue: 'вярно',
@@ -116,6 +116,8 @@ const csCZGrid = {
116
116
  'headerFilterOperator>=': 'Větší než nebo rovno',
117
117
  'headerFilterOperator<': 'Menší než',
118
118
  'headerFilterOperator<=': 'Menší než nebo rovno',
119
+ // headerFilterClear: 'Clear filter',
120
+
119
121
  // Filter values text
120
122
  filterValueAny: 'jakýkoliv',
121
123
  filterValueTrue: 'ano',
@@ -108,6 +108,8 @@ const daDKGrid = {
108
108
  'headerFilterOperator>=': 'Større end eller lig med',
109
109
  'headerFilterOperator<': 'Mindre end',
110
110
  'headerFilterOperator<=': 'Mindre end eller lig med',
111
+ // headerFilterClear: 'Clear filter',
112
+
111
113
  // Filter values text
112
114
  filterValueAny: 'hvilken som helst',
113
115
  filterValueTrue: 'positiv',
@@ -106,6 +106,8 @@ const deDEGrid = {
106
106
  'headerFilterOperator>=': 'Größer als oder gleich',
107
107
  'headerFilterOperator<': 'Kleiner als',
108
108
  'headerFilterOperator<=': 'Kleiner als oder gleich',
109
+ // headerFilterClear: 'Clear filter',
110
+
109
111
  // Filter values text
110
112
  filterValueAny: 'Beliebig',
111
113
  filterValueTrue: 'Ja',
@@ -108,6 +108,8 @@ const elGRGrid = {
108
108
  'headerFilterOperator>=': 'Μεγαλύτερο ή ίσο με',
109
109
  'headerFilterOperator<': 'Μικρότερο από',
110
110
  'headerFilterOperator<=': 'Μικρότερο ή ίσο με',
111
+ // headerFilterClear: 'Clear filter',
112
+
111
113
  // Filter values text
112
114
  filterValueAny: 'οποιοδήποτε',
113
115
  filterValueTrue: 'αληθές',
@@ -106,6 +106,8 @@ const esESGrid = {
106
106
  'headerFilterOperator>=': 'Es mayor o igual que',
107
107
  'headerFilterOperator<': 'Es menor que',
108
108
  'headerFilterOperator<=': 'Es menor o igual que',
109
+ // headerFilterClear: 'Clear filter',
110
+
109
111
  // Filter values text
110
112
  filterValueAny: 'cualquiera',
111
113
  filterValueTrue: 'verdadero',
@@ -108,6 +108,8 @@ const faIRGrid = {
108
108
  'headerFilterOperator>=': 'بزرگتر یا مساوی',
109
109
  'headerFilterOperator<': 'کوچکتر',
110
110
  'headerFilterOperator<=': 'کوچکتر یا مساوی',
111
+ // headerFilterClear: 'Clear filter',
112
+
111
113
  // Filter values text
112
114
  filterValueAny: 'هرچیزی',
113
115
  filterValueTrue: 'صحیح',
@@ -108,6 +108,8 @@ const fiFIGrid = {
108
108
  'headerFilterOperator>=': 'Enemmän tai yhtä paljon kuin',
109
109
  'headerFilterOperator<': 'Vähemmän kuin',
110
110
  'headerFilterOperator<=': 'Vähemmän tai yhtä paljon kuin',
111
+ // headerFilterClear: 'Clear filter',
112
+
111
113
  // Filter values text
112
114
  filterValueAny: 'mikä tahansa',
113
115
  filterValueTrue: 'tosi',
@@ -108,6 +108,8 @@ const frFRGrid = {
108
108
  'headerFilterOperator>=': 'Est supérieur ou égal à',
109
109
  'headerFilterOperator<': 'Est inférieur à',
110
110
  'headerFilterOperator<=': 'Est inférieur ou égal à',
111
+ // headerFilterClear: 'Clear filter',
112
+
111
113
  // Filter values text
112
114
  filterValueAny: 'tous',
113
115
  filterValueTrue: 'vrai',
@@ -106,6 +106,8 @@ const heILGrid = {
106
106
  'headerFilterOperator>=': 'גדול שווה ל-',
107
107
  'headerFilterOperator<': 'קטן מ-',
108
108
  'headerFilterOperator<=': 'קטן שווה ל-',
109
+ // headerFilterClear: 'Clear filter',
110
+
109
111
  // Filter values text
110
112
  filterValueAny: 'כל ערך',
111
113
  filterValueTrue: 'כן',
@@ -116,6 +116,8 @@ const hrHRGrid = {
116
116
  'headerFilterOperator>=': 'Veće ili jednako',
117
117
  'headerFilterOperator<': 'Manje od',
118
118
  'headerFilterOperator<=': 'Manje od ili jednako',
119
+ // headerFilterClear: 'Clear filter',
120
+
119
121
  // Filter values text
120
122
  filterValueAny: 'bilo koji',
121
123
  filterValueTrue: 'tačno',
@@ -108,6 +108,8 @@ const huHUGrid = {
108
108
  'headerFilterOperator>=': 'Nagyobb vagy egyenlő',
109
109
  'headerFilterOperator<': 'Kisebb mint',
110
110
  'headerFilterOperator<=': 'Kisebb vagy egyenlő',
111
+ // headerFilterClear: 'Clear filter',
112
+
111
113
  // Filter values text
112
114
  filterValueAny: 'bármilyen',
113
115
  filterValueTrue: 'igaz',
@@ -108,6 +108,8 @@ const isISGrid = {
108
108
  'headerFilterOperator>=': 'Stærra en eða jafnt og',
109
109
  'headerFilterOperator<': 'Minna en',
110
110
  'headerFilterOperator<=': 'Minna en eða jafnt og',
111
+ // headerFilterClear: 'Clear filter',
112
+
111
113
  // Filter values text
112
114
  filterValueAny: 'hvað sem er',
113
115
  filterValueTrue: 'satt',
@@ -108,6 +108,8 @@ const itITGrid = {
108
108
  'headerFilterOperator>=': 'Maggiore o uguale a',
109
109
  'headerFilterOperator<': 'Minore di',
110
110
  'headerFilterOperator<=': 'Minore o uguale a',
111
+ // headerFilterClear: 'Clear filter',
112
+
111
113
  // Filter values text
112
114
  filterValueAny: 'qualunque',
113
115
  filterValueTrue: 'vero',
@@ -108,6 +108,8 @@ const jaJPGrid = {
108
108
  'headerFilterOperator>=': '以上',
109
109
  'headerFilterOperator<': '未満',
110
110
  'headerFilterOperator<=': '以下',
111
+ // headerFilterClear: 'Clear filter',
112
+
111
113
  // Filter values text
112
114
  filterValueAny: 'いずれか',
113
115
  filterValueTrue: '真',
@@ -106,6 +106,8 @@ const koKRGrid = {
106
106
  'headerFilterOperator>=': '같거나 더 큰',
107
107
  'headerFilterOperator<': '더 작은',
108
108
  'headerFilterOperator<=': '같거나 더 작은',
109
+ // headerFilterClear: 'Clear filter',
110
+
109
111
  // Filter values text
110
112
  filterValueAny: '아무값',
111
113
  filterValueTrue: '참',
@@ -108,6 +108,8 @@ const nbNOGrid = {
108
108
  'headerFilterOperator>=': 'Større enn eller lik',
109
109
  'headerFilterOperator<': 'Mindre enn',
110
110
  'headerFilterOperator<=': 'Mindre enn eller lik',
111
+ // headerFilterClear: 'Clear filter',
112
+
111
113
  // Filter values text
112
114
  filterValueAny: 'noen',
113
115
  filterValueTrue: 'sant',
@@ -107,6 +107,8 @@ const nlNLGrid = {
107
107
  'headerFilterOperator>=': 'Is groter dan of gelijk aan',
108
108
  'headerFilterOperator<': 'Is kleiner dan',
109
109
  'headerFilterOperator<=': 'Is kleiner dan of gelijk aan',
110
+ // headerFilterClear: 'Clear filter',
111
+
110
112
  // Filter values text
111
113
  filterValueAny: 'alles',
112
114
  filterValueTrue: 'waar',
@@ -108,6 +108,8 @@ const nnNOGrid = {
108
108
  'headerFilterOperator>=': 'Større enn eller lik',
109
109
  'headerFilterOperator<': 'Mindre enn',
110
110
  'headerFilterOperator<=': 'Mindre enn eller lik',
111
+ // headerFilterClear: 'Clear filter',
112
+
111
113
  // Filter values text
112
114
  filterValueAny: 'nokon',
113
115
  filterValueTrue: 'sant',
@@ -109,6 +109,8 @@ const plPLGrid = {
109
109
  'headerFilterOperator>=': 'Większy lub równy',
110
110
  'headerFilterOperator<': 'Mniejszy niż',
111
111
  'headerFilterOperator<=': 'Mniejszy lub równe',
112
+ // headerFilterClear: 'Clear filter',
113
+
112
114
  // Filter values text
113
115
  filterValueAny: 'dowolny',
114
116
  filterValueTrue: 'prawda',