@mui/x-data-grid 7.0.0-alpha.7 → 7.0.0-alpha.9
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.
- package/CHANGELOG.md +554 -51
- package/DataGrid/DataGrid.js +15 -27
- package/DataGrid/useDataGridComponent.js +2 -1
- package/DataGrid/useDataGridProps.js +1 -0
- package/README.md +1 -1
- package/colDef/gridDateColDef.js +1 -1
- package/components/GridColumnHeaders.d.ts +3 -2
- package/components/GridColumnHeaders.js +3 -11
- package/components/GridDetailPanels.d.ts +5 -0
- package/components/GridDetailPanels.js +4 -0
- package/components/GridHeaders.d.ts +4 -0
- package/components/GridHeaders.js +53 -0
- package/components/GridPagination.d.ts +4 -4
- package/components/GridPagination.js +1 -1
- package/components/GridPinnedRows.d.ts +7 -0
- package/components/GridPinnedRows.js +4 -0
- package/components/GridRow.d.ts +7 -4
- package/components/GridRow.js +260 -97
- package/components/GridScrollbarFillerCell.d.ts +7 -0
- package/components/GridScrollbarFillerCell.js +39 -0
- package/components/base/GridBody.d.ts +2 -13
- package/components/base/GridBody.js +2 -116
- package/components/base/GridOverlays.js +10 -21
- package/components/cell/GridActionsCell.js +1 -1
- package/components/cell/GridActionsCellItem.d.ts +6 -6
- package/components/cell/GridCell.d.ts +15 -21
- package/components/cell/GridCell.js +68 -373
- package/components/columnHeaders/GridBaseColumnHeaders.js +1 -6
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +2 -1
- package/components/columnHeaders/GridColumnHeaderItem.js +7 -3
- package/components/columnHeaders/GridColumnHeaderSortIcon.d.ts +1 -0
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +5 -2
- package/components/columnHeaders/GridColumnHeadersInner.js +1 -2
- package/components/containers/GridRoot.js +18 -15
- package/components/containers/GridRootStyles.js +307 -204
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/components/panel/GridPanel.d.ts +3 -3
- package/components/panel/GridPanel.js +3 -4
- package/components/panel/filterPanel/GridFilterForm.d.ts +6 -4
- package/components/panel/filterPanel/GridFilterForm.js +32 -15
- package/components/panel/filterPanel/GridFilterPanel.js +46 -20
- package/components/toolbar/GridToolbarColumnsButton.d.ts +13 -1
- package/components/toolbar/GridToolbarColumnsButton.js +40 -22
- package/components/toolbar/GridToolbarDensitySelector.d.ts +13 -1
- package/components/toolbar/GridToolbarDensitySelector.js +40 -22
- package/components/toolbar/GridToolbarExport.d.ts +10 -1
- package/components/toolbar/GridToolbarExport.js +6 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +15 -1
- package/components/toolbar/GridToolbarExportContainer.js +41 -23
- package/components/toolbar/GridToolbarFilterButton.d.ts +5 -4
- package/components/toolbar/GridToolbarFilterButton.js +6 -10
- package/components/toolbar/GridToolbarQuickFilter.d.ts +4 -0
- package/components/toolbar/GridToolbarQuickFilter.js +4 -0
- package/components/virtualization/GridBottomContainer.d.ts +2 -0
- package/components/virtualization/GridBottomContainer.js +25 -0
- package/components/{containers → virtualization}/GridMainContainer.d.ts +2 -0
- package/components/virtualization/GridMainContainer.js +20 -0
- package/components/virtualization/GridTopContainer.d.ts +2 -0
- package/components/virtualization/GridTopContainer.js +35 -0
- package/components/virtualization/GridVirtualScrollbar.d.ts +7 -0
- package/components/virtualization/GridVirtualScrollbar.js +131 -0
- package/components/virtualization/GridVirtualScroller.d.ts +4 -4
- package/components/virtualization/GridVirtualScroller.js +69 -16
- package/components/virtualization/GridVirtualScrollerFiller.d.ts +4 -0
- package/components/virtualization/GridVirtualScrollerFiller.js +71 -0
- package/components/virtualization/GridVirtualScrollerRenderZone.js +2 -1
- package/constants/defaultGridSlotsComponents.js +6 -2
- package/constants/gridClasses.d.ts +60 -8
- package/constants/gridClasses.js +1 -1
- package/hooks/core/gridCoreSelector.d.ts +6 -0
- package/hooks/core/gridCoreSelector.js +5 -0
- package/hooks/core/useGridInitialization.js +4 -0
- package/hooks/core/useGridLoggerFactory.js +2 -2
- package/hooks/core/useGridRefs.d.ts +3 -0
- package/hooks/core/useGridRefs.js +13 -0
- package/hooks/core/useGridTheme.d.ts +3 -0
- package/hooks/core/useGridTheme.js +19 -0
- package/hooks/features/columnGrouping/gridColumnGroupsUtils.js +1 -1
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +1 -1
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +13 -18
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +13 -18
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +68 -162
- package/hooks/features/columnMenu/useGridColumnMenu.js +28 -23
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +17 -0
- package/hooks/features/columns/gridColumnsInterfaces.js +9 -1
- package/hooks/features/columns/gridColumnsSelector.d.ts +14 -1
- package/hooks/features/columns/gridColumnsSelector.js +52 -0
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -5
- package/hooks/features/columns/gridColumnsUtils.js +10 -12
- package/hooks/features/columns/index.d.ts +2 -2
- package/hooks/features/columns/index.js +2 -1
- package/hooks/features/columns/useGridColumnSpanning.js +62 -61
- package/hooks/features/columns/useGridColumns.js +20 -23
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +60 -11
- package/hooks/features/dimensions/gridDimensionsSelectors.d.ts +2 -0
- package/hooks/features/dimensions/gridDimensionsSelectors.js +1 -0
- package/hooks/features/dimensions/index.d.ts +2 -0
- package/hooks/features/dimensions/index.js +1 -0
- package/hooks/features/dimensions/useGridDimensions.d.ts +7 -1
- package/hooks/features/dimensions/useGridDimensions.js +216 -148
- package/hooks/features/editing/useGridCellEditing.js +4 -4
- package/hooks/features/editing/useGridRowEditing.js +4 -4
- package/hooks/features/export/serializers/csvSerializer.js +3 -3
- package/hooks/features/export/useGridPrintExport.js +1 -1
- package/hooks/features/filter/gridFilterUtils.js +5 -5
- package/hooks/features/filter/useGridFilter.js +3 -3
- package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -2
- package/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/hooks/features/focus/useGridFocus.js +3 -3
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +3 -16
- package/hooks/features/pagination/gridPaginationUtils.js +2 -2
- package/hooks/features/pagination/useGridPagination.js +3 -5
- package/hooks/features/rowSelection/useGridRowSelection.js +1 -1
- package/hooks/features/rows/gridRowsInterfaces.d.ts +1 -0
- package/hooks/features/rows/gridRowsSelector.d.ts +2 -2
- package/hooks/features/rows/gridRowsSelector.js +5 -5
- package/hooks/features/rows/gridRowsUtils.d.ts +1 -1
- package/hooks/features/rows/gridRowsUtils.js +6 -6
- package/hooks/features/rows/useGridRows.js +7 -7
- package/hooks/features/rows/useGridRowsMeta.js +9 -6
- package/hooks/features/scroll/useGridScroll.js +8 -10
- package/hooks/features/sorting/gridSortingUtils.js +5 -3
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/features/sorting/useGridSorting.js +15 -10
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +14 -0
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +22 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +27 -42
- package/hooks/features/virtualization/useGridVirtualScroller.js +441 -438
- package/hooks/features/virtualization/useGridVirtualization.d.ts +8 -0
- package/hooks/features/virtualization/useGridVirtualization.js +8 -1
- package/hooks/utils/index.d.ts +3 -0
- package/hooks/utils/index.js +4 -1
- package/hooks/utils/useGridApiContext.js +1 -1
- package/hooks/utils/useGridAriaAttributes.js +1 -2
- package/hooks/utils/useGridNativeEventListener.js +4 -9
- package/hooks/utils/useGridPrivateApiContext.js +1 -1
- package/hooks/utils/useGridRootProps.js +1 -1
- package/hooks/utils/useGridSelector.js +1 -1
- package/hooks/utils/useResizeObserver.d.ts +2 -0
- package/hooks/utils/useResizeObserver.js +36 -0
- package/hooks/utils/useRunOnce.d.ts +5 -0
- package/hooks/utils/useRunOnce.js +18 -0
- package/index.d.ts +0 -1
- package/index.js +1 -2
- package/internals/index.d.ts +13 -9
- package/internals/index.js +9 -7
- package/internals/utils/index.d.ts +1 -0
- package/internals/utils/index.js +2 -1
- package/internals/utils/propValidation.d.ts +4 -0
- package/internals/utils/propValidation.js +19 -0
- package/legacy/DataGrid/DataGrid.js +20 -29
- package/legacy/DataGrid/useDataGridComponent.js +2 -1
- package/legacy/DataGrid/useDataGridProps.js +1 -0
- package/legacy/colDef/gridDateColDef.js +1 -1
- package/legacy/components/GridColumnHeaders.js +3 -11
- package/legacy/components/GridDetailPanels.js +4 -0
- package/legacy/components/GridHeaders.js +53 -0
- package/legacy/components/GridPagination.js +1 -1
- package/legacy/components/GridPinnedRows.js +4 -0
- package/legacy/components/GridRow.js +258 -98
- package/legacy/components/GridScrollbarFillerCell.js +36 -0
- package/legacy/components/base/GridBody.js +2 -114
- package/legacy/components/base/GridOverlays.js +10 -25
- package/legacy/components/cell/GridActionsCell.js +1 -1
- package/legacy/components/cell/GridCell.js +70 -378
- package/legacy/components/columnHeaders/GridBaseColumnHeaders.js +1 -6
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +7 -3
- package/legacy/components/columnHeaders/GridColumnHeaderSortIcon.js +5 -2
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +1 -2
- package/legacy/components/containers/GridRoot.js +18 -15
- package/legacy/components/containers/GridRootStyles.js +215 -137
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/legacy/components/panel/GridPanel.js +3 -4
- package/legacy/components/panel/filterPanel/GridFilterForm.js +31 -14
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +49 -20
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +40 -21
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +40 -21
- package/legacy/components/toolbar/GridToolbarExport.js +6 -1
- package/legacy/components/toolbar/GridToolbarExportContainer.js +40 -21
- package/legacy/components/toolbar/GridToolbarFilterButton.js +6 -10
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +4 -0
- package/legacy/components/virtualization/GridBottomContainer.js +25 -0
- package/legacy/components/virtualization/GridMainContainer.js +20 -0
- package/legacy/components/virtualization/GridTopContainer.js +35 -0
- package/legacy/components/virtualization/GridVirtualScrollbar.js +129 -0
- package/legacy/components/virtualization/GridVirtualScroller.js +67 -16
- package/legacy/components/virtualization/GridVirtualScrollerFiller.js +70 -0
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +2 -1
- package/legacy/constants/defaultGridSlotsComponents.js +6 -2
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/hooks/core/gridCoreSelector.js +7 -0
- package/legacy/hooks/core/useGridInitialization.js +4 -0
- package/legacy/hooks/core/useGridLoggerFactory.js +2 -2
- package/legacy/hooks/core/useGridRefs.js +13 -0
- package/legacy/hooks/core/useGridTheme.js +21 -0
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsUtils.js +1 -1
- package/legacy/hooks/features/columnGrouping/useGridColumnGrouping.js +13 -18
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +69 -181
- package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +28 -23
- package/legacy/hooks/features/columns/gridColumnsInterfaces.js +9 -1
- package/legacy/hooks/features/columns/gridColumnsSelector.js +62 -0
- package/legacy/hooks/features/columns/gridColumnsUtils.js +10 -16
- package/legacy/hooks/features/columns/index.js +2 -1
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +60 -59
- package/legacy/hooks/features/columns/useGridColumns.js +22 -23
- package/legacy/hooks/features/dimensions/gridDimensionsSelectors.js +3 -0
- package/legacy/hooks/features/dimensions/index.js +1 -0
- package/legacy/hooks/features/dimensions/useGridDimensions.js +226 -151
- package/legacy/hooks/features/editing/useGridCellEditing.js +4 -4
- package/legacy/hooks/features/editing/useGridRowEditing.js +4 -4
- package/legacy/hooks/features/export/serializers/csvSerializer.js +3 -3
- package/legacy/hooks/features/export/useGridPrintExport.js +1 -1
- package/legacy/hooks/features/filter/gridFilterUtils.js +5 -5
- package/legacy/hooks/features/filter/useGridFilter.js +3 -3
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/legacy/hooks/features/focus/useGridFocus.js +3 -3
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +3 -16
- package/legacy/hooks/features/pagination/gridPaginationUtils.js +2 -2
- package/legacy/hooks/features/pagination/useGridPagination.js +3 -5
- package/legacy/hooks/features/rowSelection/useGridRowSelection.js +1 -1
- package/legacy/hooks/features/rows/gridRowsSelector.js +5 -5
- package/legacy/hooks/features/rows/gridRowsUtils.js +6 -6
- package/legacy/hooks/features/rows/useGridParamsApi.js +4 -5
- package/legacy/hooks/features/rows/useGridRows.js +7 -7
- package/legacy/hooks/features/rows/useGridRowsMeta.js +9 -6
- package/legacy/hooks/features/scroll/useGridScroll.js +8 -10
- package/legacy/hooks/features/sorting/gridSortingUtils.js +5 -3
- package/legacy/hooks/features/sorting/useGridSorting.js +15 -10
- package/legacy/hooks/features/virtualization/gridVirtualizationSelectors.js +29 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +490 -483
- package/legacy/hooks/features/virtualization/useGridVirtualization.js +8 -1
- package/legacy/hooks/utils/index.js +4 -1
- package/legacy/hooks/utils/useGridApiContext.js +1 -1
- package/legacy/hooks/utils/useGridAriaAttributes.js +1 -2
- package/legacy/hooks/utils/useGridNativeEventListener.js +4 -9
- package/legacy/hooks/utils/useGridPrivateApiContext.js +1 -1
- package/legacy/hooks/utils/useGridRootProps.js +1 -1
- package/legacy/hooks/utils/useGridSelector.js +1 -1
- package/legacy/hooks/utils/useResizeObserver.js +36 -0
- package/legacy/hooks/utils/useRunOnce.js +18 -0
- package/legacy/index.js +1 -2
- package/legacy/internals/index.js +9 -7
- package/legacy/internals/utils/index.js +2 -1
- package/legacy/internals/utils/propValidation.js +21 -0
- package/legacy/locales/hrHR.js +161 -0
- package/legacy/locales/index.js +4 -1
- package/legacy/locales/ptPT.js +161 -0
- package/legacy/locales/zhHK.js +161 -0
- package/legacy/models/index.js +0 -1
- package/legacy/models/params/index.js +1 -2
- package/legacy/utils/createSelector.js +1 -1
- package/legacy/utils/exportAs.js +1 -1
- package/legacy/utils/utils.js +10 -1
- package/locales/hrHR.d.ts +1 -0
- package/locales/hrHR.js +149 -0
- package/locales/index.d.ts +3 -0
- package/locales/index.js +4 -1
- package/locales/ptPT.d.ts +1 -0
- package/locales/ptPT.js +149 -0
- package/locales/zhHK.d.ts +1 -0
- package/locales/zhHK.js +149 -0
- package/models/api/gridColumnGroupingApi.d.ts +2 -2
- package/models/api/gridCoreApi.d.ts +16 -16
- package/models/api/gridRowsMetaApi.d.ts +1 -1
- package/models/api/gridVirtualizationApi.d.ts +2 -3
- package/models/events/gridEventLookup.d.ts +3 -3
- package/models/gridFilterModel.d.ts +1 -1
- package/models/gridSlotsComponent.d.ts +16 -2
- package/models/gridStateCommunity.d.ts +5 -1
- package/models/index.d.ts +0 -1
- package/models/index.js +0 -1
- package/models/params/index.d.ts +0 -1
- package/models/params/index.js +1 -2
- package/models/props/DataGridProps.d.ts +7 -12
- package/modern/DataGrid/DataGrid.js +15 -27
- package/modern/DataGrid/useDataGridComponent.js +2 -1
- package/modern/DataGrid/useDataGridProps.js +1 -0
- package/modern/colDef/gridDateColDef.js +1 -1
- package/modern/components/GridColumnHeaders.js +3 -11
- package/modern/components/GridDetailPanels.js +4 -0
- package/modern/components/GridHeaders.js +53 -0
- package/modern/components/GridPagination.js +1 -1
- package/modern/components/GridPinnedRows.js +4 -0
- package/modern/components/GridRow.js +258 -96
- package/modern/components/GridScrollbarFillerCell.js +39 -0
- package/modern/components/base/GridBody.js +2 -116
- package/modern/components/base/GridOverlays.js +10 -16
- package/modern/components/cell/GridActionsCell.js +1 -1
- package/modern/components/cell/GridCell.js +66 -370
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +1 -6
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +7 -3
- package/modern/components/columnHeaders/GridColumnHeaderSortIcon.js +5 -2
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +1 -1
- package/modern/components/containers/GridRoot.js +18 -14
- package/modern/components/containers/GridRootStyles.js +307 -204
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/modern/components/panel/GridPanel.js +3 -4
- package/modern/components/panel/filterPanel/GridFilterForm.js +31 -14
- package/modern/components/panel/filterPanel/GridFilterPanel.js +46 -20
- package/modern/components/toolbar/GridToolbarColumnsButton.js +38 -21
- package/modern/components/toolbar/GridToolbarDensitySelector.js +38 -21
- package/modern/components/toolbar/GridToolbarExport.js +6 -1
- package/modern/components/toolbar/GridToolbarExportContainer.js +39 -22
- package/modern/components/toolbar/GridToolbarFilterButton.js +6 -10
- package/modern/components/toolbar/GridToolbarQuickFilter.js +4 -0
- package/modern/components/virtualization/GridBottomContainer.js +25 -0
- package/modern/components/virtualization/GridMainContainer.js +20 -0
- package/modern/components/virtualization/GridTopContainer.js +35 -0
- package/modern/components/virtualization/GridVirtualScrollbar.js +131 -0
- package/modern/components/virtualization/GridVirtualScroller.js +69 -16
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +71 -0
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +2 -1
- package/modern/constants/defaultGridSlotsComponents.js +6 -2
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/core/gridCoreSelector.js +5 -0
- package/modern/hooks/core/useGridInitialization.js +4 -0
- package/modern/hooks/core/useGridLoggerFactory.js +2 -2
- package/modern/hooks/core/useGridRefs.js +13 -0
- package/modern/hooks/core/useGridTheme.js +19 -0
- package/modern/hooks/features/columnGrouping/gridColumnGroupsUtils.js +1 -1
- package/modern/hooks/features/columnGrouping/useGridColumnGrouping.js +11 -16
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +67 -160
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +28 -23
- package/modern/hooks/features/columns/gridColumnsInterfaces.js +9 -1
- package/modern/hooks/features/columns/gridColumnsSelector.js +51 -0
- package/modern/hooks/features/columns/gridColumnsUtils.js +10 -12
- package/modern/hooks/features/columns/index.js +2 -1
- package/modern/hooks/features/columns/useGridColumnSpanning.js +62 -61
- package/modern/hooks/features/columns/useGridColumns.js +19 -21
- package/modern/hooks/features/dimensions/gridDimensionsSelectors.js +1 -0
- package/modern/hooks/features/dimensions/index.js +1 -0
- package/modern/hooks/features/dimensions/useGridDimensions.js +214 -146
- package/modern/hooks/features/editing/useGridCellEditing.js +4 -4
- package/modern/hooks/features/editing/useGridRowEditing.js +4 -4
- package/modern/hooks/features/export/serializers/csvSerializer.js +3 -3
- package/modern/hooks/features/export/useGridPrintExport.js +1 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +5 -5
- package/modern/hooks/features/filter/useGridFilter.js +3 -3
- package/modern/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/modern/hooks/features/focus/useGridFocus.js +3 -3
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +3 -16
- package/modern/hooks/features/pagination/gridPaginationUtils.js +2 -2
- package/modern/hooks/features/pagination/useGridPagination.js +3 -5
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +1 -1
- package/modern/hooks/features/rows/gridRowsSelector.js +2 -2
- package/modern/hooks/features/rows/gridRowsUtils.js +6 -6
- package/modern/hooks/features/rows/useGridRows.js +7 -7
- package/modern/hooks/features/rows/useGridRowsMeta.js +9 -6
- package/modern/hooks/features/scroll/useGridScroll.js +8 -9
- package/modern/hooks/features/sorting/gridSortingUtils.js +5 -3
- package/modern/hooks/features/sorting/useGridSorting.js +15 -10
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +22 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +435 -432
- package/modern/hooks/features/virtualization/useGridVirtualization.js +8 -1
- package/modern/hooks/utils/index.js +4 -1
- package/modern/hooks/utils/useGridApiContext.js +1 -1
- package/modern/hooks/utils/useGridAriaAttributes.js +1 -1
- package/modern/hooks/utils/useGridNativeEventListener.js +3 -9
- package/modern/hooks/utils/useGridPrivateApiContext.js +1 -1
- package/modern/hooks/utils/useGridRootProps.js +1 -1
- package/modern/hooks/utils/useGridSelector.js +1 -1
- package/modern/hooks/utils/useResizeObserver.js +36 -0
- package/modern/hooks/utils/useRunOnce.js +18 -0
- package/modern/index.js +1 -2
- package/modern/internals/index.js +9 -7
- package/modern/internals/utils/index.js +2 -1
- package/modern/internals/utils/propValidation.js +19 -0
- package/modern/locales/hrHR.js +149 -0
- package/modern/locales/index.js +4 -1
- package/modern/locales/ptPT.js +149 -0
- package/modern/locales/zhHK.js +149 -0
- package/modern/models/index.js +0 -1
- package/modern/models/params/index.js +1 -2
- package/modern/utils/createSelector.js +1 -1
- package/modern/utils/exportAs.js +1 -1
- package/modern/utils/utils.js +10 -1
- package/node/DataGrid/DataGrid.js +15 -27
- package/node/DataGrid/useDataGridComponent.js +1 -0
- package/node/DataGrid/useDataGridProps.js +1 -0
- package/node/colDef/gridDateColDef.js +1 -1
- package/node/components/GridColumnHeaders.js +3 -11
- package/node/components/GridDetailPanels.js +10 -0
- package/node/components/GridHeaders.js +60 -0
- package/node/components/GridPagination.js +1 -1
- package/node/components/GridPinnedRows.js +10 -0
- package/node/components/GridRow.js +256 -94
- package/node/components/GridScrollbarFillerCell.js +47 -0
- package/node/components/base/GridBody.js +7 -118
- package/node/components/base/GridOverlays.js +9 -15
- package/node/components/cell/GridActionsCell.js +1 -1
- package/node/components/cell/GridCell.js +67 -370
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -6
- package/node/components/columnHeaders/GridColumnHeaderItem.js +8 -4
- package/node/components/columnHeaders/GridColumnHeaderSortIcon.js +5 -2
- package/node/components/columnHeaders/GridColumnHeadersInner.js +1 -1
- package/node/components/containers/GridRoot.js +17 -14
- package/node/components/containers/GridRootStyles.js +175 -72
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/node/components/panel/GridPanel.js +3 -4
- package/node/components/panel/filterPanel/GridFilterForm.js +30 -13
- package/node/components/panel/filterPanel/GridFilterPanel.js +45 -19
- package/node/components/toolbar/GridToolbarColumnsButton.js +36 -20
- package/node/components/toolbar/GridToolbarDensitySelector.js +36 -20
- package/node/components/toolbar/GridToolbarExport.js +6 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +37 -21
- package/node/components/toolbar/GridToolbarFilterButton.js +6 -10
- package/node/components/toolbar/GridToolbarQuickFilter.js +4 -0
- package/node/components/virtualization/GridBottomContainer.js +34 -0
- package/node/components/{containers → virtualization}/GridMainContainer.js +7 -29
- package/node/components/virtualization/GridTopContainer.js +44 -0
- package/node/components/virtualization/GridVirtualScrollbar.js +138 -0
- package/node/components/virtualization/GridVirtualScroller.js +69 -17
- package/node/components/virtualization/GridVirtualScrollerFiller.js +77 -0
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +2 -1
- package/node/constants/defaultGridSlotsComponents.js +5 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/core/gridCoreSelector.js +12 -0
- package/node/hooks/core/useGridInitialization.js +4 -0
- package/node/hooks/core/useGridLoggerFactory.js +2 -2
- package/node/hooks/core/useGridRefs.js +22 -0
- package/node/hooks/core/useGridTheme.js +29 -0
- package/node/hooks/features/columnGrouping/gridColumnGroupsUtils.js +1 -1
- package/node/hooks/features/columnGrouping/useGridColumnGrouping.js +11 -16
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +65 -159
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +28 -23
- package/node/hooks/features/columns/gridColumnsInterfaces.js +11 -1
- package/node/hooks/features/columns/gridColumnsSelector.js +52 -1
- package/node/hooks/features/columns/gridColumnsUtils.js +10 -13
- package/node/hooks/features/columns/index.js +22 -61
- package/node/hooks/features/columns/useGridColumnSpanning.js +62 -61
- package/node/hooks/features/columns/useGridColumns.js +20 -22
- package/node/hooks/features/dimensions/gridDimensionsSelectors.js +8 -0
- package/node/hooks/features/dimensions/index.js +11 -0
- package/node/hooks/features/dimensions/useGridDimensions.js +215 -144
- package/node/hooks/features/editing/useGridCellEditing.js +4 -4
- package/node/hooks/features/editing/useGridRowEditing.js +4 -4
- package/node/hooks/features/export/serializers/csvSerializer.js +3 -3
- package/node/hooks/features/export/useGridPrintExport.js +1 -1
- package/node/hooks/features/filter/gridFilterUtils.js +5 -5
- package/node/hooks/features/filter/useGridFilter.js +2 -2
- package/node/hooks/features/focus/gridFocusStateSelector.js +3 -7
- package/node/hooks/features/focus/useGridFocus.js +2 -2
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -15
- package/node/hooks/features/pagination/gridPaginationUtils.js +2 -2
- package/node/hooks/features/pagination/useGridPagination.js +3 -5
- package/node/hooks/features/rowSelection/useGridRowSelection.js +1 -1
- package/node/hooks/features/rows/gridRowsSelector.js +2 -2
- package/node/hooks/features/rows/gridRowsUtils.js +6 -6
- package/node/hooks/features/rows/useGridRows.js +7 -7
- package/node/hooks/features/rows/useGridRowsMeta.js +7 -5
- package/node/hooks/features/scroll/useGridScroll.js +8 -9
- package/node/hooks/features/sorting/gridSortingUtils.js +5 -3
- package/node/hooks/features/sorting/useGridSorting.js +15 -10
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +22 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +434 -431
- package/node/hooks/features/virtualization/useGridVirtualization.js +9 -1
- package/node/hooks/utils/index.js +36 -0
- package/node/hooks/utils/useGridApiContext.js +1 -1
- package/node/hooks/utils/useGridAriaAttributes.js +1 -1
- package/node/hooks/utils/useGridNativeEventListener.js +3 -9
- package/node/hooks/utils/useGridPrivateApiContext.js +1 -1
- package/node/hooks/utils/useGridRootProps.js +1 -1
- package/node/hooks/utils/useGridSelector.js +1 -1
- package/node/hooks/utils/useResizeObserver.js +44 -0
- package/node/hooks/utils/useRunOnce.js +27 -0
- package/node/index.js +1 -13
- package/node/internals/index.js +86 -71
- package/node/internals/utils/index.js +11 -0
- package/node/internals/utils/propValidation.js +26 -0
- package/node/locales/hrHR.js +155 -0
- package/node/locales/index.js +33 -0
- package/node/locales/ptPT.js +155 -0
- package/node/locales/zhHK.js +155 -0
- package/node/models/index.js +0 -11
- package/node/models/params/index.js +0 -11
- package/node/utils/createSelector.js +1 -1
- package/node/utils/exportAs.js +1 -1
- package/node/utils/utils.js +11 -1
- package/package.json +6 -6
- package/utils/createSelector.js +1 -1
- package/utils/exportAs.js +1 -1
- package/utils/utils.d.ts +6 -0
- package/utils/utils.js +10 -1
- package/components/DataGridVirtualScroller.d.ts +0 -3
- package/components/DataGridVirtualScroller.js +0 -35
- package/components/containers/GridMainContainer.js +0 -43
- package/legacy/components/DataGridVirtualScroller.js +0 -32
- package/legacy/components/containers/GridMainContainer.js +0 -45
- package/legacy/models/gridRootContainerRef.js +0 -1
- package/legacy/models/params/gridRenderedRowsIntervalChangeParams.js +0 -1
- package/models/gridRootContainerRef.d.ts +0 -5
- package/models/gridRootContainerRef.js +0 -1
- package/models/params/gridRenderedRowsIntervalChangeParams.d.ts +0 -10
- package/models/params/gridRenderedRowsIntervalChangeParams.js +0 -1
- package/modern/components/DataGridVirtualScroller.js +0 -35
- package/modern/components/containers/GridMainContainer.js +0 -42
- package/modern/models/gridRootContainerRef.js +0 -1
- package/modern/models/params/gridRenderedRowsIntervalChangeParams.js +0 -1
- package/node/components/DataGridVirtualScroller.js +0 -42
- package/node/models/gridRootContainerRef.js +0 -5
- package/node/models/params/gridRenderedRowsIntervalChangeParams.js +0 -5
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["
|
|
4
|
-
_excluded2 = ["
|
|
5
|
-
_excluded3 = ["column", "rowId", "editCellState", "align", "children", "colIndex", "height", "width", "className", "showRightBorder", "extendRowFullWidth", "row", "colSpan", "disableDragEvents", "isNotVisible", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
|
|
6
|
-
_excluded4 = ["changeReason", "unstable_updateValueOnRender"];
|
|
3
|
+
const _excluded = ["column", "rowId", "editCellState", "align", "children", "colIndex", "height", "width", "className", "style", "gridHasScrollX", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "sectionIndex", "sectionLength", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
|
|
4
|
+
_excluded2 = ["changeReason", "unstable_updateValueOnRender"];
|
|
7
5
|
import * as React from 'react';
|
|
8
6
|
import PropTypes from 'prop-types';
|
|
9
7
|
import clsx from 'clsx';
|
|
@@ -18,6 +16,12 @@ import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
|
18
16
|
import { gridFocusCellSelector } from '../../hooks/features/focus/gridFocusStateSelector';
|
|
19
17
|
import { MissingRowIdError } from '../../hooks/features/rows/useGridParamsApi';
|
|
20
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
export let PinnedPosition = /*#__PURE__*/function (PinnedPosition) {
|
|
20
|
+
PinnedPosition[PinnedPosition["NONE"] = 0] = "NONE";
|
|
21
|
+
PinnedPosition[PinnedPosition["LEFT"] = 1] = "LEFT";
|
|
22
|
+
PinnedPosition[PinnedPosition["RIGHT"] = 2] = "RIGHT";
|
|
23
|
+
return PinnedPosition;
|
|
24
|
+
}({});
|
|
21
25
|
const EMPTY_CELL_PARAMS = {
|
|
22
26
|
id: -1,
|
|
23
27
|
field: '__unset__',
|
|
@@ -45,345 +49,25 @@ const EMPTY_CELL_PARAMS = {
|
|
|
45
49
|
const useUtilityClasses = ownerState => {
|
|
46
50
|
const {
|
|
47
51
|
align,
|
|
52
|
+
showLeftBorder,
|
|
48
53
|
showRightBorder,
|
|
54
|
+
pinnedPosition,
|
|
49
55
|
isEditable,
|
|
50
56
|
isSelected,
|
|
51
57
|
isSelectionMode,
|
|
52
58
|
classes
|
|
53
59
|
} = ownerState;
|
|
54
60
|
const slots = {
|
|
55
|
-
root: ['cell', `cell--text${capitalize(align)}`, isEditable && 'cell--editable',
|
|
61
|
+
root: ['cell', `cell--text${capitalize(align)}`, isSelected && 'selected', isEditable && 'cell--editable', showLeftBorder && 'cell--withLeftBorder', showRightBorder && 'cell--withRightBorder', pinnedPosition === PinnedPosition.LEFT && 'cell--pinnedLeft', pinnedPosition === PinnedPosition.RIGHT && 'cell--pinnedRight', isSelectionMode && !isEditable && 'cell--selectionMode'],
|
|
56
62
|
content: ['cellContent']
|
|
57
63
|
};
|
|
58
64
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
59
65
|
};
|
|
60
66
|
let warnedOnce = false;
|
|
61
67
|
|
|
62
|
-
// GridCellWrapper is a compatibility layer for the V6 cell slot. If we can use the more efficient
|
|
63
|
-
// `GridCellV7`, we should. That component is a merge of `GridCellWrapper` and `GridCell`.
|
|
64
|
-
// TODO(v7): Remove the wrapper & cellV6 and use the cellV7 exclusively.
|
|
65
68
|
// TODO(v7): Removing the wrapper will break the docs performance visualization demo.
|
|
66
|
-
const GridCellWrapper = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
67
|
-
const {
|
|
68
|
-
column,
|
|
69
|
-
rowId,
|
|
70
|
-
editCellState
|
|
71
|
-
} = props;
|
|
72
|
-
const apiRef = useGridApiContext();
|
|
73
|
-
const rootProps = useGridRootProps();
|
|
74
|
-
const field = column.field;
|
|
75
|
-
const cellParamsWithAPI = useGridSelector(apiRef, () => {
|
|
76
|
-
// This is required because `.getCellParams` tries to get the `state.rows.tree` entry
|
|
77
|
-
// associated with `rowId`/`fieldId`, but this selector runs after the state has been
|
|
78
|
-
// updated, while `rowId`/`fieldId` reference an entry in the old state.
|
|
79
|
-
try {
|
|
80
|
-
const cellParams = apiRef.current.getCellParams(rowId, field);
|
|
81
|
-
const result = cellParams;
|
|
82
|
-
result.api = apiRef.current;
|
|
83
|
-
return result;
|
|
84
|
-
} catch (e) {
|
|
85
|
-
if (e instanceof MissingRowIdError) {
|
|
86
|
-
return EMPTY_CELL_PARAMS;
|
|
87
|
-
}
|
|
88
|
-
throw e;
|
|
89
|
-
}
|
|
90
|
-
}, objectShallowCompare);
|
|
91
|
-
const isSelected = useGridSelector(apiRef, () => apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {
|
|
92
|
-
id: rowId,
|
|
93
|
-
field
|
|
94
|
-
}));
|
|
95
|
-
if (cellParamsWithAPI === EMPTY_CELL_PARAMS) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
const {
|
|
99
|
-
cellMode,
|
|
100
|
-
hasFocus,
|
|
101
|
-
isEditable,
|
|
102
|
-
value,
|
|
103
|
-
formattedValue
|
|
104
|
-
} = cellParamsWithAPI;
|
|
105
|
-
const managesOwnFocus = column.type === 'actions';
|
|
106
|
-
const tabIndex = (cellMode === 'view' || !isEditable) && !managesOwnFocus ? cellParamsWithAPI.tabIndex : -1;
|
|
107
|
-
const {
|
|
108
|
-
classes: rootClasses,
|
|
109
|
-
getCellClassName
|
|
110
|
-
} = rootProps;
|
|
111
|
-
const classNames = apiRef.current.unstable_applyPipeProcessors('cellClassName', [], {
|
|
112
|
-
id: rowId,
|
|
113
|
-
field
|
|
114
|
-
});
|
|
115
|
-
if (column.cellClassName) {
|
|
116
|
-
classNames.push(typeof column.cellClassName === 'function' ? column.cellClassName(cellParamsWithAPI) : column.cellClassName);
|
|
117
|
-
}
|
|
118
|
-
if (getCellClassName) {
|
|
119
|
-
classNames.push(getCellClassName(cellParamsWithAPI));
|
|
120
|
-
}
|
|
121
|
-
let children;
|
|
122
|
-
if (editCellState == null && column.renderCell) {
|
|
123
|
-
children = column.renderCell(cellParamsWithAPI);
|
|
124
|
-
classNames.push(gridClasses['cell--withRenderer']);
|
|
125
|
-
classNames.push(rootClasses?.['cell--withRenderer']);
|
|
126
|
-
}
|
|
127
|
-
if (editCellState != null && column.renderEditCell) {
|
|
128
|
-
const updatedRow = apiRef.current.getRowWithUpdatedValues(rowId, column.field);
|
|
129
69
|
|
|
130
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
131
|
-
const editCellStateRest = _objectWithoutPropertiesLoose(editCellState, _excluded);
|
|
132
|
-
const params = _extends({}, cellParamsWithAPI, {
|
|
133
|
-
row: updatedRow
|
|
134
|
-
}, editCellStateRest);
|
|
135
|
-
children = column.renderEditCell(params);
|
|
136
|
-
classNames.push(gridClasses['cell--editing']);
|
|
137
|
-
classNames.push(rootClasses?.['cell--editing']);
|
|
138
|
-
}
|
|
139
|
-
const {
|
|
140
|
-
slots
|
|
141
|
-
} = rootProps;
|
|
142
|
-
const CellComponent = slots.cell;
|
|
143
|
-
const cellProps = _extends({}, props, {
|
|
144
|
-
ref,
|
|
145
|
-
field,
|
|
146
|
-
formattedValue,
|
|
147
|
-
hasFocus,
|
|
148
|
-
isEditable,
|
|
149
|
-
isSelected,
|
|
150
|
-
value,
|
|
151
|
-
cellMode,
|
|
152
|
-
children,
|
|
153
|
-
tabIndex,
|
|
154
|
-
className: clsx(classNames)
|
|
155
|
-
});
|
|
156
|
-
return /*#__PURE__*/React.createElement(CellComponent, cellProps);
|
|
157
|
-
});
|
|
158
70
|
const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
159
|
-
const {
|
|
160
|
-
align,
|
|
161
|
-
children: childrenProp,
|
|
162
|
-
colIndex,
|
|
163
|
-
column,
|
|
164
|
-
cellMode,
|
|
165
|
-
field,
|
|
166
|
-
formattedValue,
|
|
167
|
-
hasFocus,
|
|
168
|
-
height,
|
|
169
|
-
isEditable,
|
|
170
|
-
isSelected,
|
|
171
|
-
rowId,
|
|
172
|
-
tabIndex,
|
|
173
|
-
value,
|
|
174
|
-
width,
|
|
175
|
-
className,
|
|
176
|
-
showRightBorder,
|
|
177
|
-
colSpan,
|
|
178
|
-
disableDragEvents,
|
|
179
|
-
isNotVisible,
|
|
180
|
-
onClick,
|
|
181
|
-
onDoubleClick,
|
|
182
|
-
onMouseDown,
|
|
183
|
-
onMouseUp,
|
|
184
|
-
onMouseOver,
|
|
185
|
-
onKeyDown,
|
|
186
|
-
onKeyUp,
|
|
187
|
-
onDragEnter,
|
|
188
|
-
onDragOver
|
|
189
|
-
} = props,
|
|
190
|
-
other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
191
|
-
const valueToRender = formattedValue == null ? value : formattedValue;
|
|
192
|
-
const cellRef = React.useRef(null);
|
|
193
|
-
const handleRef = useForkRef(ref, cellRef);
|
|
194
|
-
const focusElementRef = React.useRef(null);
|
|
195
|
-
const apiRef = useGridApiContext();
|
|
196
|
-
const rootProps = useGridRootProps();
|
|
197
|
-
const ownerState = {
|
|
198
|
-
align,
|
|
199
|
-
showRightBorder,
|
|
200
|
-
isEditable,
|
|
201
|
-
classes: rootProps.classes,
|
|
202
|
-
isSelected
|
|
203
|
-
};
|
|
204
|
-
const classes = useUtilityClasses(ownerState);
|
|
205
|
-
const publishMouseUp = React.useCallback(eventName => event => {
|
|
206
|
-
const params = apiRef.current.getCellParams(rowId, field || '');
|
|
207
|
-
apiRef.current.publishEvent(eventName, params, event);
|
|
208
|
-
if (onMouseUp) {
|
|
209
|
-
onMouseUp(event);
|
|
210
|
-
}
|
|
211
|
-
}, [apiRef, field, onMouseUp, rowId]);
|
|
212
|
-
const publishMouseDown = React.useCallback(eventName => event => {
|
|
213
|
-
const params = apiRef.current.getCellParams(rowId, field || '');
|
|
214
|
-
apiRef.current.publishEvent(eventName, params, event);
|
|
215
|
-
if (onMouseDown) {
|
|
216
|
-
onMouseDown(event);
|
|
217
|
-
}
|
|
218
|
-
}, [apiRef, field, onMouseDown, rowId]);
|
|
219
|
-
const publish = React.useCallback((eventName, propHandler) => event => {
|
|
220
|
-
// The row might have been deleted during the click
|
|
221
|
-
if (!apiRef.current.getRow(rowId)) {
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
const params = apiRef.current.getCellParams(rowId, field || '');
|
|
225
|
-
apiRef.current.publishEvent(eventName, params, event);
|
|
226
|
-
if (propHandler) {
|
|
227
|
-
propHandler(event);
|
|
228
|
-
}
|
|
229
|
-
}, [apiRef, field, rowId]);
|
|
230
|
-
const style = React.useMemo(() => {
|
|
231
|
-
if (isNotVisible) {
|
|
232
|
-
return {
|
|
233
|
-
padding: 0,
|
|
234
|
-
opacity: 0,
|
|
235
|
-
width: 0,
|
|
236
|
-
border: 0
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
const cellStyle = {
|
|
240
|
-
minWidth: width,
|
|
241
|
-
maxWidth: width,
|
|
242
|
-
minHeight: height,
|
|
243
|
-
maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
|
|
244
|
-
};
|
|
245
|
-
return cellStyle;
|
|
246
|
-
}, [width, height, isNotVisible]);
|
|
247
|
-
React.useEffect(() => {
|
|
248
|
-
if (!hasFocus || cellMode === GridCellModes.Edit) {
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
const doc = ownerDocument(apiRef.current.rootElementRef.current);
|
|
252
|
-
if (cellRef.current && !cellRef.current.contains(doc.activeElement)) {
|
|
253
|
-
const focusableElement = cellRef.current.querySelector('[tabindex="0"]');
|
|
254
|
-
const elementToFocus = focusElementRef.current || focusableElement || cellRef.current;
|
|
255
|
-
if (doesSupportPreventScroll()) {
|
|
256
|
-
elementToFocus.focus({
|
|
257
|
-
preventScroll: true
|
|
258
|
-
});
|
|
259
|
-
} else {
|
|
260
|
-
const scrollPosition = apiRef.current.getScrollPosition();
|
|
261
|
-
elementToFocus.focus();
|
|
262
|
-
apiRef.current.scroll(scrollPosition);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}, [hasFocus, cellMode, apiRef]);
|
|
266
|
-
let handleFocus = other.onFocus;
|
|
267
|
-
if (process.env.NODE_ENV === 'test' && rootProps.experimentalFeatures?.warnIfFocusStateIsNotSynced) {
|
|
268
|
-
handleFocus = event => {
|
|
269
|
-
const focusedCell = gridFocusCellSelector(apiRef);
|
|
270
|
-
if (focusedCell?.id === rowId && focusedCell.field === field) {
|
|
271
|
-
if (typeof other.onFocus === 'function') {
|
|
272
|
-
other.onFocus(event);
|
|
273
|
-
}
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
if (!warnedOnce) {
|
|
277
|
-
console.warn([`MUI: The cell with id=${rowId} and field=${field} received focus.`, `According to the state, the focus should be at id=${focusedCell?.id}, field=${focusedCell?.field}.`, "Not syncing the state may cause unwanted behaviors since the `cellFocusIn` event won't be fired.", 'Call `fireEvent.mouseUp` before the `fireEvent.click` to sync the focus with the state.'].join('\n'));
|
|
278
|
-
warnedOnce = true;
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
const managesOwnFocus = column.type === 'actions';
|
|
283
|
-
let children = childrenProp;
|
|
284
|
-
if (children === undefined) {
|
|
285
|
-
const valueString = valueToRender?.toString();
|
|
286
|
-
children = /*#__PURE__*/_jsx("div", {
|
|
287
|
-
className: classes.content,
|
|
288
|
-
title: valueString,
|
|
289
|
-
role: "presentation",
|
|
290
|
-
children: valueString
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
if ( /*#__PURE__*/React.isValidElement(children) && managesOwnFocus) {
|
|
294
|
-
children = /*#__PURE__*/React.cloneElement(children, {
|
|
295
|
-
focusElementRef
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
const draggableEventHandlers = disableDragEvents ? null : {
|
|
299
|
-
onDragEnter: publish('cellDragEnter', onDragEnter),
|
|
300
|
-
onDragOver: publish('cellDragOver', onDragOver)
|
|
301
|
-
};
|
|
302
|
-
const ariaV7 = rootProps.experimentalFeatures?.ariaV7;
|
|
303
|
-
return (
|
|
304
|
-
/*#__PURE__*/
|
|
305
|
-
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
306
|
-
_jsx("div", _extends({
|
|
307
|
-
ref: handleRef,
|
|
308
|
-
className: clsx(className, classes.root),
|
|
309
|
-
role: ariaV7 ? 'gridcell' : 'cell',
|
|
310
|
-
"data-field": field,
|
|
311
|
-
"data-colindex": colIndex,
|
|
312
|
-
"aria-colindex": colIndex + 1,
|
|
313
|
-
"aria-colspan": colSpan,
|
|
314
|
-
style: style,
|
|
315
|
-
tabIndex: tabIndex,
|
|
316
|
-
onClick: publish('cellClick', onClick),
|
|
317
|
-
onDoubleClick: publish('cellDoubleClick', onDoubleClick),
|
|
318
|
-
onMouseOver: publish('cellMouseOver', onMouseOver),
|
|
319
|
-
onMouseDown: publishMouseDown('cellMouseDown'),
|
|
320
|
-
onMouseUp: publishMouseUp('cellMouseUp'),
|
|
321
|
-
onKeyDown: publish('cellKeyDown', onKeyDown),
|
|
322
|
-
onKeyUp: publish('cellKeyUp', onKeyUp)
|
|
323
|
-
}, draggableEventHandlers, other, {
|
|
324
|
-
onFocus: handleFocus,
|
|
325
|
-
children: children
|
|
326
|
-
}))
|
|
327
|
-
);
|
|
328
|
-
});
|
|
329
|
-
const MemoizedCellWrapper = fastMemo(GridCellWrapper);
|
|
330
|
-
process.env.NODE_ENV !== "production" ? GridCellWrapper.propTypes = {
|
|
331
|
-
// ----------------------------- Warning --------------------------------
|
|
332
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
333
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
334
|
-
// ----------------------------------------------------------------------
|
|
335
|
-
align: PropTypes.oneOf(['center', 'left', 'right']),
|
|
336
|
-
className: PropTypes.string,
|
|
337
|
-
colIndex: PropTypes.number,
|
|
338
|
-
colSpan: PropTypes.number,
|
|
339
|
-
column: PropTypes.object,
|
|
340
|
-
disableDragEvents: PropTypes.bool,
|
|
341
|
-
height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
|
|
342
|
-
onClick: PropTypes.func,
|
|
343
|
-
onDoubleClick: PropTypes.func,
|
|
344
|
-
onDragEnter: PropTypes.func,
|
|
345
|
-
onDragOver: PropTypes.func,
|
|
346
|
-
onKeyDown: PropTypes.func,
|
|
347
|
-
onMouseDown: PropTypes.func,
|
|
348
|
-
onMouseUp: PropTypes.func,
|
|
349
|
-
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
350
|
-
showRightBorder: PropTypes.bool,
|
|
351
|
-
width: PropTypes.number
|
|
352
|
-
} : void 0;
|
|
353
|
-
process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
354
|
-
// ----------------------------- Warning --------------------------------
|
|
355
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
356
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
357
|
-
// ----------------------------------------------------------------------
|
|
358
|
-
align: PropTypes.oneOf(['center', 'left', 'right']),
|
|
359
|
-
cellMode: PropTypes.oneOf(['edit', 'view']),
|
|
360
|
-
children: PropTypes.node,
|
|
361
|
-
className: PropTypes.string,
|
|
362
|
-
colIndex: PropTypes.number,
|
|
363
|
-
colSpan: PropTypes.number,
|
|
364
|
-
column: PropTypes.object,
|
|
365
|
-
disableDragEvents: PropTypes.bool,
|
|
366
|
-
editCellState: PropTypes.shape({
|
|
367
|
-
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
368
|
-
isProcessingProps: PropTypes.bool,
|
|
369
|
-
isValidating: PropTypes.bool,
|
|
370
|
-
value: PropTypes.any
|
|
371
|
-
}),
|
|
372
|
-
isNotVisible: PropTypes.bool,
|
|
373
|
-
height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
|
|
374
|
-
onClick: PropTypes.func,
|
|
375
|
-
onDoubleClick: PropTypes.func,
|
|
376
|
-
onDragEnter: PropTypes.func,
|
|
377
|
-
onDragOver: PropTypes.func,
|
|
378
|
-
onKeyDown: PropTypes.func,
|
|
379
|
-
onMouseDown: PropTypes.func,
|
|
380
|
-
onMouseUp: PropTypes.func,
|
|
381
|
-
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
382
|
-
showRightBorder: PropTypes.bool,
|
|
383
|
-
width: PropTypes.number
|
|
384
|
-
} : void 0;
|
|
385
|
-
export { MemoizedCellWrapper as GridCellWrapper, GridCell };
|
|
386
|
-
const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
387
71
|
const {
|
|
388
72
|
column,
|
|
389
73
|
rowId,
|
|
@@ -393,10 +77,14 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
393
77
|
height,
|
|
394
78
|
width,
|
|
395
79
|
className,
|
|
396
|
-
|
|
80
|
+
style: styleProp,
|
|
397
81
|
colSpan,
|
|
398
82
|
disableDragEvents,
|
|
399
83
|
isNotVisible,
|
|
84
|
+
pinnedOffset,
|
|
85
|
+
pinnedPosition,
|
|
86
|
+
sectionIndex,
|
|
87
|
+
sectionLength,
|
|
400
88
|
onClick,
|
|
401
89
|
onDoubleClick,
|
|
402
90
|
onMouseDown,
|
|
@@ -407,7 +95,7 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
407
95
|
onDragEnter,
|
|
408
96
|
onDragOver
|
|
409
97
|
} = props,
|
|
410
|
-
other = _objectWithoutPropertiesLoose(props,
|
|
98
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
411
99
|
const apiRef = useGridApiContext();
|
|
412
100
|
const rootProps = useGridRootProps();
|
|
413
101
|
const field = column.field;
|
|
@@ -434,7 +122,7 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
434
122
|
const {
|
|
435
123
|
cellMode,
|
|
436
124
|
hasFocus,
|
|
437
|
-
isEditable,
|
|
125
|
+
isEditable = false,
|
|
438
126
|
value,
|
|
439
127
|
formattedValue
|
|
440
128
|
} = cellParamsWithAPI;
|
|
@@ -460,11 +148,16 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
460
148
|
const focusElementRef = React.useRef(null);
|
|
461
149
|
// @ts-expect-error To access `cellSelection` flag as it's a `premium` feature
|
|
462
150
|
const isSelectionMode = rootProps.cellSelection ?? false;
|
|
151
|
+
const isSectionLastCell = sectionIndex === sectionLength - 1;
|
|
152
|
+
const showLeftBorder = pinnedPosition === PinnedPosition.RIGHT && sectionIndex === 0;
|
|
153
|
+
const showRightBorder = rootProps.showCellVerticalBorder && (pinnedPosition !== PinnedPosition.LEFT ? !isSectionLastCell : true) || pinnedPosition === PinnedPosition.LEFT && isSectionLastCell;
|
|
463
154
|
const ownerState = {
|
|
464
155
|
align,
|
|
156
|
+
showLeftBorder,
|
|
465
157
|
showRightBorder,
|
|
466
158
|
isEditable,
|
|
467
159
|
classes: rootProps.classes,
|
|
160
|
+
pinnedPosition,
|
|
468
161
|
isSelected,
|
|
469
162
|
isSelectionMode
|
|
470
163
|
};
|
|
@@ -503,14 +196,18 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
503
196
|
border: 0
|
|
504
197
|
};
|
|
505
198
|
}
|
|
506
|
-
const cellStyle = {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
199
|
+
const cellStyle = _extends({
|
|
200
|
+
'--width': `${width}px`,
|
|
201
|
+
'--height': typeof height === 'number' ? `${height}px` : height
|
|
202
|
+
}, styleProp);
|
|
203
|
+
if (pinnedPosition === PinnedPosition.LEFT) {
|
|
204
|
+
cellStyle.left = pinnedOffset;
|
|
205
|
+
}
|
|
206
|
+
if (pinnedPosition === PinnedPosition.RIGHT) {
|
|
207
|
+
cellStyle.right = pinnedOffset;
|
|
208
|
+
}
|
|
512
209
|
return cellStyle;
|
|
513
|
-
}, [width, height, isNotVisible]);
|
|
210
|
+
}, [width, height, isNotVisible, styleProp, pinnedOffset, pinnedPosition]);
|
|
514
211
|
React.useEffect(() => {
|
|
515
212
|
if (!hasFocus || cellMode === GridCellModes.Edit) {
|
|
516
213
|
return;
|
|
@@ -544,7 +241,7 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
544
241
|
return;
|
|
545
242
|
}
|
|
546
243
|
if (!warnedOnce) {
|
|
547
|
-
console.warn([`MUI: The cell with id=${rowId} and field=${field} received focus.`, `According to the state, the focus should be at id=${focusedCell?.id}, field=${focusedCell?.field}.`, "Not syncing the state may cause unwanted behaviors since the `cellFocusIn` event won't be fired.", 'Call `fireEvent.mouseUp` before the `fireEvent.click` to sync the focus with the state.'].join('\n'));
|
|
244
|
+
console.warn([`MUI X: The cell with id=${rowId} and field=${field} received focus.`, `According to the state, the focus should be at id=${focusedCell?.id}, field=${focusedCell?.field}.`, "Not syncing the state may cause unwanted behaviors since the `cellFocusIn` event won't be fired.", 'Call `fireEvent.mouseUp` before the `fireEvent.click` to sync the focus with the state.'].join('\n'));
|
|
548
245
|
warnedOnce = true;
|
|
549
246
|
}
|
|
550
247
|
};
|
|
@@ -559,7 +256,7 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
559
256
|
const updatedRow = apiRef.current.getRowWithUpdatedValues(rowId, column.field);
|
|
560
257
|
|
|
561
258
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
562
|
-
const editCellStateRest = _objectWithoutPropertiesLoose(editCellState,
|
|
259
|
+
const editCellStateRest = _objectWithoutPropertiesLoose(editCellState, _excluded2);
|
|
563
260
|
const params = _extends({}, cellParamsWithAPI, {
|
|
564
261
|
row: updatedRow
|
|
565
262
|
}, editCellStateRest);
|
|
@@ -585,34 +282,29 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
585
282
|
onDragEnter: publish('cellDragEnter', onDragEnter),
|
|
586
283
|
onDragOver: publish('cellDragOver', onDragOver)
|
|
587
284
|
};
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
}, draggableEventHandlers, other, {
|
|
610
|
-
onFocus: handleFocus,
|
|
611
|
-
children: children
|
|
612
|
-
}))
|
|
613
|
-
);
|
|
285
|
+
return /*#__PURE__*/_jsx("div", _extends({
|
|
286
|
+
ref: handleRef,
|
|
287
|
+
className: clsx(className, classNames, classes.root),
|
|
288
|
+
role: "gridcell",
|
|
289
|
+
"data-field": field,
|
|
290
|
+
"data-colindex": colIndex,
|
|
291
|
+
"aria-colindex": colIndex + 1,
|
|
292
|
+
"aria-colspan": colSpan,
|
|
293
|
+
style: style,
|
|
294
|
+
tabIndex: tabIndex,
|
|
295
|
+
onClick: publish('cellClick', onClick),
|
|
296
|
+
onDoubleClick: publish('cellDoubleClick', onDoubleClick),
|
|
297
|
+
onMouseOver: publish('cellMouseOver', onMouseOver),
|
|
298
|
+
onMouseDown: publishMouseDown('cellMouseDown'),
|
|
299
|
+
onMouseUp: publishMouseUp('cellMouseUp'),
|
|
300
|
+
onKeyDown: publish('cellKeyDown', onKeyDown),
|
|
301
|
+
onKeyUp: publish('cellKeyUp', onKeyUp)
|
|
302
|
+
}, draggableEventHandlers, other, {
|
|
303
|
+
onFocus: handleFocus,
|
|
304
|
+
children: children
|
|
305
|
+
}));
|
|
614
306
|
});
|
|
615
|
-
process.env.NODE_ENV !== "production" ?
|
|
307
|
+
process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
616
308
|
// ----------------------------- Warning --------------------------------
|
|
617
309
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
618
310
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
@@ -629,8 +321,9 @@ process.env.NODE_ENV !== "production" ? GridCellV7.propTypes = {
|
|
|
629
321
|
isValidating: PropTypes.bool,
|
|
630
322
|
value: PropTypes.any
|
|
631
323
|
}),
|
|
324
|
+
gridHasScrollX: PropTypes.bool.isRequired,
|
|
632
325
|
height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,
|
|
633
|
-
isNotVisible: PropTypes.bool,
|
|
326
|
+
isNotVisible: PropTypes.bool.isRequired,
|
|
634
327
|
onClick: PropTypes.func,
|
|
635
328
|
onDoubleClick: PropTypes.func,
|
|
636
329
|
onDragEnter: PropTypes.func,
|
|
@@ -638,9 +331,12 @@ process.env.NODE_ENV !== "production" ? GridCellV7.propTypes = {
|
|
|
638
331
|
onKeyDown: PropTypes.func,
|
|
639
332
|
onMouseDown: PropTypes.func,
|
|
640
333
|
onMouseUp: PropTypes.func,
|
|
334
|
+
pinnedOffset: PropTypes.number.isRequired,
|
|
335
|
+
pinnedPosition: PropTypes.oneOf([0, 1, 2]).isRequired,
|
|
641
336
|
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
642
|
-
|
|
337
|
+
sectionIndex: PropTypes.number.isRequired,
|
|
338
|
+
sectionLength: PropTypes.number.isRequired,
|
|
643
339
|
width: PropTypes.number.isRequired
|
|
644
340
|
} : void 0;
|
|
645
|
-
const
|
|
646
|
-
export {
|
|
341
|
+
const MemoizedGridCell = fastMemo(GridCell);
|
|
342
|
+
export { MemoizedGridCell as GridCell };
|
|
@@ -13,7 +13,7 @@ const useUtilityClasses = ownerState => {
|
|
|
13
13
|
classes
|
|
14
14
|
} = ownerState;
|
|
15
15
|
const slots = {
|
|
16
|
-
root: ['columnHeaders'
|
|
16
|
+
root: ['columnHeaders']
|
|
17
17
|
};
|
|
18
18
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
19
19
|
};
|
|
@@ -22,12 +22,7 @@ const GridColumnHeadersRoot = styled('div', {
|
|
|
22
22
|
slot: 'ColumnHeaders',
|
|
23
23
|
overridesResolver: (props, styles) => styles.columnHeaders
|
|
24
24
|
})({
|
|
25
|
-
position: 'relative',
|
|
26
|
-
overflow: 'hidden',
|
|
27
25
|
display: 'flex',
|
|
28
|
-
alignItems: 'center',
|
|
29
|
-
boxSizing: 'border-box',
|
|
30
|
-
borderBottom: '1px solid',
|
|
31
26
|
borderTopLeftRadius: 'var(--unstable_DataGrid-radius)',
|
|
32
27
|
borderTopRightRadius: 'var(--unstable_DataGrid-radius)'
|
|
33
28
|
});
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils';
|
|
5
|
+
import { fastMemo } from '../../utils/fastMemo';
|
|
5
6
|
import { useGridPrivateApiContext } from '../../hooks/utils/useGridPrivateApiContext';
|
|
6
7
|
import { GridColumnHeaderSortIcon } from './GridColumnHeaderSortIcon';
|
|
7
8
|
import { ColumnHeaderMenuIcon } from './ColumnHeaderMenuIcon';
|
|
@@ -124,14 +125,16 @@ function GridColumnHeaderItem(props) {
|
|
|
124
125
|
onExited: handleExited
|
|
125
126
|
});
|
|
126
127
|
const sortingOrder = colDef.sortingOrder ?? rootProps.sortingOrder;
|
|
128
|
+
const showSortIcon = (colDef.sortable || sortDirection != null) && !colDef.hideSortIcons && !rootProps.disableColumnSorting;
|
|
127
129
|
const columnTitleIconButtons = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
128
130
|
children: [!rootProps.disableColumnFilter && /*#__PURE__*/_jsx(rootProps.slots.columnHeaderFilterIconButton, _extends({
|
|
129
131
|
field: colDef.field,
|
|
130
132
|
counter: filterItemsCounter
|
|
131
|
-
}, rootProps.slotProps?.columnHeaderFilterIconButton)),
|
|
133
|
+
}, rootProps.slotProps?.columnHeaderFilterIconButton)), showSortIcon && /*#__PURE__*/_jsx(GridColumnHeaderSortIcon, {
|
|
132
134
|
direction: sortDirection,
|
|
133
135
|
index: sortIndex,
|
|
134
|
-
sortingOrder: sortingOrder
|
|
136
|
+
sortingOrder: sortingOrder,
|
|
137
|
+
disabled: !colDef.sortable
|
|
135
138
|
})]
|
|
136
139
|
});
|
|
137
140
|
React.useLayoutEffect(() => {
|
|
@@ -194,4 +197,5 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaderItem.propTypes = {
|
|
|
194
197
|
sortIndex: PropTypes.number,
|
|
195
198
|
tabIndex: PropTypes.oneOf([-1, 0]).isRequired
|
|
196
199
|
} : void 0;
|
|
197
|
-
|
|
200
|
+
const Memoized = fastMemo(GridColumnHeaderItem);
|
|
201
|
+
export { Memoized as GridColumnHeaderItem };
|
|
@@ -38,7 +38,8 @@ function GridColumnHeaderSortIconRaw(props) {
|
|
|
38
38
|
const {
|
|
39
39
|
direction,
|
|
40
40
|
index,
|
|
41
|
-
sortingOrder
|
|
41
|
+
sortingOrder,
|
|
42
|
+
disabled
|
|
42
43
|
} = props;
|
|
43
44
|
const apiRef = useGridApiContext();
|
|
44
45
|
const rootProps = useGridRootProps();
|
|
@@ -54,7 +55,8 @@ function GridColumnHeaderSortIconRaw(props) {
|
|
|
54
55
|
tabIndex: -1,
|
|
55
56
|
"aria-label": apiRef.current.getLocaleText('columnHeaderSortIconLabel'),
|
|
56
57
|
title: apiRef.current.getLocaleText('columnHeaderSortIconLabel'),
|
|
57
|
-
size: "small"
|
|
58
|
+
size: "small",
|
|
59
|
+
disabled: disabled
|
|
58
60
|
}, rootProps.slotProps?.baseIconButton, {
|
|
59
61
|
children: iconElement
|
|
60
62
|
}));
|
|
@@ -73,6 +75,7 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaderSortIconRaw.propTypes =
|
|
|
73
75
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
74
76
|
// ----------------------------------------------------------------------
|
|
75
77
|
direction: PropTypes.oneOf(['asc', 'desc']),
|
|
78
|
+
disabled: PropTypes.bool,
|
|
76
79
|
index: PropTypes.number,
|
|
77
80
|
sortingOrder: PropTypes.arrayOf(PropTypes.oneOf(['asc', 'desc'])).isRequired
|
|
78
81
|
} : void 0;
|
|
@@ -47,7 +47,7 @@ export const GridColumnHeadersInner = /*#__PURE__*/React.forwardRef(function Gri
|
|
|
47
47
|
const rootProps = useGridRootProps();
|
|
48
48
|
const ownerState = _extends({}, rootProps, {
|
|
49
49
|
isDragging,
|
|
50
|
-
hasScrollX: apiRef.current.getRootDimensions()
|
|
50
|
+
hasScrollX: apiRef.current.getRootDimensions().hasScrollX
|
|
51
51
|
});
|
|
52
52
|
const classes = useUtilityClasses(ownerState);
|
|
53
53
|
return /*#__PURE__*/_jsx(GridColumnHeadersInnerRoot, _extends({
|