@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
|
@@ -26,11 +26,12 @@ var _gridDetailPanelToggleField = require("../constants/gridDetailPanelToggleFie
|
|
|
26
26
|
var _gridSortingSelector = require("../hooks/features/sorting/gridSortingSelector");
|
|
27
27
|
var _gridRowsSelector = require("../hooks/features/rows/gridRowsSelector");
|
|
28
28
|
var _gridColumnGroupsSelector = require("../hooks/features/columnGrouping/gridColumnGroupsSelector");
|
|
29
|
+
var _gridEditingSelectors = require("../hooks/features/editing/gridEditingSelectors");
|
|
29
30
|
var _utils2 = require("../utils/utils");
|
|
30
31
|
var _GridCell = require("./cell/GridCell");
|
|
31
|
-
var
|
|
32
|
+
var _GridScrollbarFillerCell = require("./GridScrollbarFillerCell");
|
|
32
33
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
|
-
const _excluded = ["selected", "
|
|
34
|
+
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "renderedColumns", "pinnedColumns", "dimensions", "firstColumnToRender", "lastColumnToRender", "isFirstVisible", "isLastVisible", "focusedCellColumnIndexNotInRange", "isNotVisible", "focusedCell", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave", "onMouseOut", "onMouseOver"];
|
|
34
35
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
35
36
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
36
37
|
const useUtilityClasses = ownerState => {
|
|
@@ -38,12 +39,15 @@ const useUtilityClasses = ownerState => {
|
|
|
38
39
|
editable,
|
|
39
40
|
editing,
|
|
40
41
|
selected,
|
|
42
|
+
isFirstVisible,
|
|
41
43
|
isLastVisible,
|
|
42
44
|
rowHeight,
|
|
43
45
|
classes
|
|
44
46
|
} = ownerState;
|
|
45
47
|
const slots = {
|
|
46
|
-
root: ['row', selected && 'selected', editable && 'row--editable', editing && 'row--editing', isLastVisible && 'row--lastVisible', rowHeight === 'auto' && 'row--dynamicHeight']
|
|
48
|
+
root: ['row', selected && 'selected', editable && 'row--editable', editing && 'row--editing', isFirstVisible && 'row--firstVisible', isLastVisible && 'row--lastVisible', rowHeight === 'auto' && 'row--dynamicHeight'],
|
|
49
|
+
pinnedLeft: ['pinnedLeft'],
|
|
50
|
+
pinnedRight: ['pinnedRight']
|
|
47
51
|
};
|
|
48
52
|
return (0, _utils.unstable_composeClasses)(slots, _gridClasses.getDataGridUtilityClass, classes);
|
|
49
53
|
};
|
|
@@ -53,30 +57,30 @@ function EmptyCell({
|
|
|
53
57
|
if (!width) {
|
|
54
58
|
return null;
|
|
55
59
|
}
|
|
56
|
-
const style = {
|
|
57
|
-
width
|
|
58
|
-
};
|
|
59
60
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
role: "presentation",
|
|
62
|
+
className: (0, _clsx.default)(_gridClasses.gridClasses.cell, _gridClasses.gridClasses.cellEmpty),
|
|
63
|
+
style: {
|
|
64
|
+
'--width': `${width}px`
|
|
65
|
+
}
|
|
66
|
+
});
|
|
63
67
|
}
|
|
64
68
|
const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
65
69
|
const {
|
|
66
70
|
selected,
|
|
67
|
-
hovered,
|
|
68
71
|
rowId,
|
|
69
72
|
row,
|
|
70
73
|
index,
|
|
71
74
|
style: styleProp,
|
|
72
|
-
position,
|
|
73
75
|
rowHeight,
|
|
74
76
|
className,
|
|
75
77
|
visibleColumns,
|
|
76
78
|
renderedColumns,
|
|
77
|
-
|
|
79
|
+
pinnedColumns,
|
|
80
|
+
dimensions,
|
|
78
81
|
firstColumnToRender,
|
|
79
|
-
|
|
82
|
+
isFirstVisible,
|
|
83
|
+
isLastVisible,
|
|
80
84
|
focusedCellColumnIndexNotInRange,
|
|
81
85
|
isNotVisible,
|
|
82
86
|
focusedCell,
|
|
@@ -92,17 +96,19 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
92
96
|
const ref = React.useRef(null);
|
|
93
97
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
94
98
|
const currentPage = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef, rootProps);
|
|
95
|
-
const columnsTotalWidth = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridColumnsTotalWidthSelector);
|
|
96
99
|
const sortModel = (0, _useGridSelector.useGridSelector)(apiRef, _gridSortingSelector.gridSortModelSelector);
|
|
97
100
|
const treeDepth = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridRowMaximumTreeDepthSelector);
|
|
98
101
|
const headerGroupingMaxDepth = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnGroupsSelector.gridColumnGroupsHeaderMaxDepthSelector);
|
|
102
|
+
const columnPositions = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridColumnPositionsSelector);
|
|
99
103
|
const editRowsState = (0, _useGridSelector.useGridSelector)(apiRef, _gridEditingSelectors.gridEditRowsStateSelector);
|
|
100
104
|
const handleRef = (0, _utils.unstable_useForkRef)(ref, refProp);
|
|
105
|
+
const rowNode = apiRef.current.getRowNode(rowId);
|
|
106
|
+
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
101
107
|
const ariaRowIndex = index + headerGroupingMaxDepth + 2; // 1 for the header row and 1 as it's 1-based
|
|
102
108
|
|
|
103
109
|
const ownerState = {
|
|
104
110
|
selected,
|
|
105
|
-
|
|
111
|
+
isFirstVisible,
|
|
106
112
|
isLastVisible,
|
|
107
113
|
classes: rootProps.classes,
|
|
108
114
|
editing: apiRef.current.getRowMode(rowId) === _gridEditRowModel.GridRowModes.Edit,
|
|
@@ -113,9 +119,9 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
113
119
|
React.useLayoutEffect(() => {
|
|
114
120
|
if (rowHeight === 'auto' && ref.current && typeof ResizeObserver === 'undefined') {
|
|
115
121
|
// Fallback for IE
|
|
116
|
-
apiRef.current.unstable_storeRowHeightMeasurement(rowId, ref.current.clientHeight
|
|
122
|
+
apiRef.current.unstable_storeRowHeightMeasurement(rowId, ref.current.clientHeight);
|
|
117
123
|
}
|
|
118
|
-
}, [apiRef, rowHeight, rowId
|
|
124
|
+
}, [apiRef, rowHeight, rowId]);
|
|
119
125
|
React.useLayoutEffect(() => {
|
|
120
126
|
if (currentPage.range) {
|
|
121
127
|
// The index prop is relative to the rows from all pages. As example, the index prop of the
|
|
@@ -137,11 +143,11 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
137
143
|
const resizeObserver = new ResizeObserver(entries => {
|
|
138
144
|
const [entry] = entries;
|
|
139
145
|
const height = entry.borderBoxSize && entry.borderBoxSize.length > 0 ? entry.borderBoxSize[0].blockSize : entry.contentRect.height;
|
|
140
|
-
apiRef.current.unstable_storeRowHeightMeasurement(rowId, height
|
|
146
|
+
apiRef.current.unstable_storeRowHeightMeasurement(rowId, height);
|
|
141
147
|
});
|
|
142
148
|
resizeObserver.observe(rootElement);
|
|
143
149
|
return () => resizeObserver.disconnect();
|
|
144
|
-
}, [apiRef, currentPage.range, index, rowHeight, rowId
|
|
150
|
+
}, [apiRef, currentPage.range, index, rowHeight, rowId]);
|
|
145
151
|
const publish = React.useCallback((eventName, propHandler) => event => {
|
|
146
152
|
// Ignore portal
|
|
147
153
|
if ((0, _domUtils.isEventTargetInPortal)(event)) {
|
|
@@ -197,50 +203,12 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
197
203
|
slotProps,
|
|
198
204
|
disableColumnReorder
|
|
199
205
|
} = rootProps;
|
|
200
|
-
const CellComponent = slots.cell === _GridCell.GridCellV7 ? _GridCell.GridCellV7 : _GridCell.GridCellWrapper;
|
|
201
206
|
const rowReordering = rootProps.rowReordering;
|
|
202
|
-
const getCell = (column, cellProps) => {
|
|
203
|
-
// when the cell is a reorder cell we are not allowing to reorder the col
|
|
204
|
-
// fixes https://github.com/mui/mui-x/issues/11126
|
|
205
|
-
const isReorderCell = column.field === '__reorder__';
|
|
206
|
-
const isEditingRows = Object.keys(editRowsState).length > 0;
|
|
207
|
-
const canReorderColumn = !(disableColumnReorder || column.disableReorder);
|
|
208
|
-
const canReorderRow = rowReordering && !sortModel.length && treeDepth <= 1 && !isEditingRows;
|
|
209
|
-
const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
|
|
210
|
-
const editCellState = editRowsState[rowId]?.[column.field] ?? null;
|
|
211
|
-
let cellIsNotVisible = false;
|
|
212
|
-
if (focusedCellColumnIndexNotInRange !== undefined && visibleColumns[focusedCellColumnIndexNotInRange].field === column.field) {
|
|
213
|
-
cellIsNotVisible = true;
|
|
214
|
-
}
|
|
215
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CellComponent, (0, _extends2.default)({
|
|
216
|
-
column: column,
|
|
217
|
-
width: cellProps.width,
|
|
218
|
-
rowId: rowId,
|
|
219
|
-
height: rowHeight,
|
|
220
|
-
showRightBorder: cellProps.showRightBorder,
|
|
221
|
-
align: column.align || 'left',
|
|
222
|
-
colIndex: cellProps.indexRelativeToAllColumns,
|
|
223
|
-
colSpan: cellProps.colSpan,
|
|
224
|
-
disableDragEvents: disableDragEvents,
|
|
225
|
-
editCellState: editCellState,
|
|
226
|
-
isNotVisible: cellIsNotVisible
|
|
227
|
-
}, slotProps?.cell), column.field);
|
|
228
|
-
};
|
|
229
207
|
const sizes = (0, _useGridSelector.useGridSelector)(apiRef, () => (0, _extends2.default)({}, apiRef.current.unstable_getRowInternalSizes(rowId)), _useGridSelector.objectShallowCompare);
|
|
230
208
|
let minHeight = rowHeight;
|
|
231
209
|
if (minHeight === 'auto' && sizes) {
|
|
232
|
-
|
|
233
|
-
const maximumSize =
|
|
234
|
-
const isBaseHeight = /^base[A-Z]/.test(key);
|
|
235
|
-
if (!isBaseHeight) {
|
|
236
|
-
return acc;
|
|
237
|
-
}
|
|
238
|
-
numberOfBaseSizes += 1;
|
|
239
|
-
if (size > acc) {
|
|
240
|
-
return size;
|
|
241
|
-
}
|
|
242
|
-
return acc;
|
|
243
|
-
}, 0);
|
|
210
|
+
const numberOfBaseSizes = 1;
|
|
211
|
+
const maximumSize = sizes.baseCenter ?? 0;
|
|
244
212
|
if (maximumSize > 0 && numberOfBaseSizes > 1) {
|
|
245
213
|
minHeight = maximumSize;
|
|
246
214
|
}
|
|
@@ -285,11 +253,88 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
285
253
|
rowClassNames.push(rootProps.getRowClassName(rowParams));
|
|
286
254
|
}
|
|
287
255
|
const randomNumber = (0, _utils2.randomNumberBetween)(10000, 20, 80);
|
|
288
|
-
const
|
|
256
|
+
const getCell = (column, indexInSection, indexRelativeToAllColumns, sectionLength, pinnedPosition = _GridCell.PinnedPosition.NONE) => {
|
|
257
|
+
const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, indexRelativeToAllColumns);
|
|
258
|
+
if (!cellColSpanInfo || cellColSpanInfo.spannedByColSpan) {
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
let pinnedOffset;
|
|
262
|
+
// FIXME: Why is the switch check exhaustiveness not validated with typescript-eslint?
|
|
263
|
+
// eslint-disable-next-line default-case
|
|
264
|
+
switch (pinnedPosition) {
|
|
265
|
+
case _GridCell.PinnedPosition.LEFT:
|
|
266
|
+
pinnedOffset = columnPositions[indexRelativeToAllColumns];
|
|
267
|
+
break;
|
|
268
|
+
case _GridCell.PinnedPosition.RIGHT:
|
|
269
|
+
pinnedOffset = dimensions.columnsTotalWidth - columnPositions[indexRelativeToAllColumns] - column.computedWidth + scrollbarWidth;
|
|
270
|
+
break;
|
|
271
|
+
case _GridCell.PinnedPosition.NONE:
|
|
272
|
+
pinnedOffset = 0;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
if (rowNode?.type === 'skeletonRow') {
|
|
276
|
+
const {
|
|
277
|
+
width
|
|
278
|
+
} = cellColSpanInfo.cellProps;
|
|
279
|
+
const contentWidth = Math.round(randomNumber());
|
|
280
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(slots.skeletonCell, {
|
|
281
|
+
width: width,
|
|
282
|
+
contentWidth: contentWidth,
|
|
283
|
+
field: column.field,
|
|
284
|
+
align: column.align
|
|
285
|
+
}, column.field);
|
|
286
|
+
}
|
|
287
|
+
const {
|
|
288
|
+
colSpan,
|
|
289
|
+
width
|
|
290
|
+
} = cellColSpanInfo.cellProps;
|
|
291
|
+
const editCellState = editRowsState[rowId]?.[column.field] ?? null;
|
|
292
|
+
|
|
293
|
+
// when the cell is a reorder cell we are not allowing to reorder the col
|
|
294
|
+
// fixes https://github.com/mui/mui-x/issues/11126
|
|
295
|
+
const isReorderCell = column.field === '__reorder__';
|
|
296
|
+
const isEditingRows = Object.keys(editRowsState).length > 0;
|
|
297
|
+
const canReorderColumn = !(disableColumnReorder || column.disableReorder);
|
|
298
|
+
const canReorderRow = rowReordering && !sortModel.length && treeDepth <= 1 && !isEditingRows;
|
|
299
|
+
const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
|
|
300
|
+
let cellIsNotVisible = false;
|
|
301
|
+
if (focusedCellColumnIndexNotInRange !== undefined && visibleColumns[focusedCellColumnIndexNotInRange].field === column.field) {
|
|
302
|
+
cellIsNotVisible = true;
|
|
303
|
+
}
|
|
304
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(slots.cell, (0, _extends2.default)({
|
|
305
|
+
column: column,
|
|
306
|
+
width: width,
|
|
307
|
+
rowId: rowId,
|
|
308
|
+
height: rowHeight,
|
|
309
|
+
align: column.align || 'left',
|
|
310
|
+
colIndex: indexRelativeToAllColumns,
|
|
311
|
+
colSpan: colSpan,
|
|
312
|
+
disableDragEvents: disableDragEvents,
|
|
313
|
+
editCellState: editCellState,
|
|
314
|
+
isNotVisible: cellIsNotVisible
|
|
315
|
+
}, slotProps?.cell, {
|
|
316
|
+
pinnedOffset: pinnedOffset,
|
|
317
|
+
pinnedPosition: pinnedPosition,
|
|
318
|
+
sectionIndex: indexInSection,
|
|
319
|
+
sectionLength: sectionLength,
|
|
320
|
+
gridHasScrollX: dimensions.hasScrollX
|
|
321
|
+
}), column.field);
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
/* Start of rendering */
|
|
325
|
+
|
|
289
326
|
if (!rowNode) {
|
|
290
327
|
return null;
|
|
291
328
|
}
|
|
292
|
-
const
|
|
329
|
+
const leftCells = pinnedColumns.left.map((column, i) => {
|
|
330
|
+
const indexRelativeToAllColumns = i;
|
|
331
|
+
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.left.length, _GridCell.PinnedPosition.LEFT);
|
|
332
|
+
});
|
|
333
|
+
const rightCells = pinnedColumns.right.map((column, i) => {
|
|
334
|
+
const indexRelativeToAllColumns = visibleColumns.length - pinnedColumns.right.length + i;
|
|
335
|
+
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.right.length, _GridCell.PinnedPosition.RIGHT);
|
|
336
|
+
});
|
|
337
|
+
const middleColumnsLength = visibleColumns.length - pinnedColumns.left.length - pinnedColumns.right.length;
|
|
293
338
|
const cells = [];
|
|
294
339
|
for (let i = 0; i < renderedColumns.length; i += 1) {
|
|
295
340
|
const column = renderedColumns[i];
|
|
@@ -301,35 +346,9 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
301
346
|
indexRelativeToAllColumns -= 1;
|
|
302
347
|
}
|
|
303
348
|
}
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
if (rowType !== 'skeletonRow') {
|
|
307
|
-
const {
|
|
308
|
-
colSpan,
|
|
309
|
-
width
|
|
310
|
-
} = cellColSpanInfo.cellProps;
|
|
311
|
-
const cellProps = {
|
|
312
|
-
width,
|
|
313
|
-
colSpan,
|
|
314
|
-
showRightBorder: rootProps.showCellVerticalBorder,
|
|
315
|
-
indexRelativeToAllColumns
|
|
316
|
-
};
|
|
317
|
-
cells.push(getCell(column, cellProps));
|
|
318
|
-
} else {
|
|
319
|
-
const {
|
|
320
|
-
width
|
|
321
|
-
} = cellColSpanInfo.cellProps;
|
|
322
|
-
const contentWidth = Math.round(randomNumber());
|
|
323
|
-
cells.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(slots.skeletonCell, {
|
|
324
|
-
width: width,
|
|
325
|
-
contentWidth: contentWidth,
|
|
326
|
-
field: column.field,
|
|
327
|
-
align: column.align
|
|
328
|
-
}, column.field));
|
|
329
|
-
}
|
|
330
|
-
}
|
|
349
|
+
const indexInSection = indexRelativeToAllColumns - pinnedColumns.left.length;
|
|
350
|
+
cells.push(getCell(column, indexInSection, indexRelativeToAllColumns, middleColumnsLength));
|
|
331
351
|
}
|
|
332
|
-
const emptyCellWidth = containerWidth - columnsTotalWidth;
|
|
333
352
|
const eventHandlers = row ? {
|
|
334
353
|
onClick: publishClick,
|
|
335
354
|
onDoubleClick: publish('rowDoubleClick', onDoubleClick),
|
|
@@ -338,18 +357,27 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
338
357
|
onMouseOut: publish('rowMouseOut', onMouseOut),
|
|
339
358
|
onMouseOver: publish('rowMouseOver', onMouseOver)
|
|
340
359
|
} : null;
|
|
360
|
+
const expandedWidth = dimensions.viewportOuterSize.width - dimensions.columnsTotalWidth - scrollbarWidth;
|
|
361
|
+
const emptyCellWidth = Math.max(0, expandedWidth);
|
|
341
362
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _extends2.default)({
|
|
342
363
|
ref: handleRef,
|
|
343
364
|
"data-id": rowId,
|
|
344
365
|
"data-rowindex": index,
|
|
345
366
|
role: "row",
|
|
346
|
-
className: (0, _clsx.default)(...rowClassNames, classes.root, className
|
|
367
|
+
className: (0, _clsx.default)(...rowClassNames, classes.root, className),
|
|
347
368
|
"aria-rowindex": ariaRowIndex,
|
|
348
369
|
"aria-selected": selected,
|
|
349
370
|
style: style
|
|
350
371
|
}, eventHandlers, other, {
|
|
351
|
-
children: [cells, emptyCellWidth > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(EmptyCell, {
|
|
372
|
+
children: [leftCells, cells, emptyCellWidth > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(EmptyCell, {
|
|
352
373
|
width: emptyCellWidth
|
|
374
|
+
}), rightCells.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
375
|
+
role: "presentation",
|
|
376
|
+
style: {
|
|
377
|
+
flex: '1'
|
|
378
|
+
}
|
|
379
|
+
}), rightCells, scrollbarWidth !== 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridScrollbarFillerCell.GridScrollbarFillerCell, {
|
|
380
|
+
pinnedRight: pinnedColumns.right.length > 0
|
|
353
381
|
})]
|
|
354
382
|
}));
|
|
355
383
|
});
|
|
@@ -358,7 +386,41 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
358
386
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
359
387
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
360
388
|
// ----------------------------------------------------------------------
|
|
361
|
-
|
|
389
|
+
dimensions: _propTypes.default.shape({
|
|
390
|
+
bottomContainerHeight: _propTypes.default.number.isRequired,
|
|
391
|
+
columnsTotalWidth: _propTypes.default.number.isRequired,
|
|
392
|
+
contentSize: _propTypes.default.shape({
|
|
393
|
+
height: _propTypes.default.number.isRequired,
|
|
394
|
+
width: _propTypes.default.number.isRequired
|
|
395
|
+
}).isRequired,
|
|
396
|
+
hasScrollX: _propTypes.default.bool.isRequired,
|
|
397
|
+
hasScrollY: _propTypes.default.bool.isRequired,
|
|
398
|
+
headerHeight: _propTypes.default.number.isRequired,
|
|
399
|
+
headersTotalHeight: _propTypes.default.number.isRequired,
|
|
400
|
+
isReady: _propTypes.default.bool.isRequired,
|
|
401
|
+
leftPinnedWidth: _propTypes.default.number.isRequired,
|
|
402
|
+
minimumSize: _propTypes.default.shape({
|
|
403
|
+
height: _propTypes.default.number.isRequired,
|
|
404
|
+
width: _propTypes.default.number.isRequired
|
|
405
|
+
}).isRequired,
|
|
406
|
+
rightPinnedWidth: _propTypes.default.number.isRequired,
|
|
407
|
+
root: _propTypes.default.shape({
|
|
408
|
+
height: _propTypes.default.number.isRequired,
|
|
409
|
+
width: _propTypes.default.number.isRequired
|
|
410
|
+
}).isRequired,
|
|
411
|
+
rowHeight: _propTypes.default.number.isRequired,
|
|
412
|
+
rowWidth: _propTypes.default.number.isRequired,
|
|
413
|
+
scrollbarSize: _propTypes.default.number.isRequired,
|
|
414
|
+
topContainerHeight: _propTypes.default.number.isRequired,
|
|
415
|
+
viewportInnerSize: _propTypes.default.shape({
|
|
416
|
+
height: _propTypes.default.number.isRequired,
|
|
417
|
+
width: _propTypes.default.number.isRequired
|
|
418
|
+
}).isRequired,
|
|
419
|
+
viewportOuterSize: _propTypes.default.shape({
|
|
420
|
+
height: _propTypes.default.number.isRequired,
|
|
421
|
+
width: _propTypes.default.number.isRequired
|
|
422
|
+
}).isRequired
|
|
423
|
+
}).isRequired,
|
|
362
424
|
firstColumnToRender: _propTypes.default.number.isRequired,
|
|
363
425
|
/**
|
|
364
426
|
* Determines which cell has focus.
|
|
@@ -371,14 +433,114 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
371
433
|
* If some rows above have expanded children, this index also take those children into account.
|
|
372
434
|
*/
|
|
373
435
|
index: _propTypes.default.number.isRequired,
|
|
374
|
-
|
|
436
|
+
isFirstVisible: _propTypes.default.bool.isRequired,
|
|
437
|
+
isLastVisible: _propTypes.default.bool.isRequired,
|
|
375
438
|
isNotVisible: _propTypes.default.bool,
|
|
376
439
|
lastColumnToRender: _propTypes.default.number.isRequired,
|
|
377
440
|
onClick: _propTypes.default.func,
|
|
378
441
|
onDoubleClick: _propTypes.default.func,
|
|
379
442
|
onMouseEnter: _propTypes.default.func,
|
|
380
443
|
onMouseLeave: _propTypes.default.func,
|
|
381
|
-
|
|
444
|
+
pinnedColumns: _propTypes.default.shape({
|
|
445
|
+
left: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
446
|
+
align: _propTypes.default.oneOf(['center', 'left', 'right']),
|
|
447
|
+
cellClassName: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
|
|
448
|
+
colSpan: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.number]),
|
|
449
|
+
computedWidth: _propTypes.default.number.isRequired,
|
|
450
|
+
description: _propTypes.default.string,
|
|
451
|
+
disableColumnMenu: _propTypes.default.bool,
|
|
452
|
+
disableExport: _propTypes.default.bool,
|
|
453
|
+
disableReorder: _propTypes.default.bool,
|
|
454
|
+
editable: _propTypes.default.bool,
|
|
455
|
+
field: _propTypes.default.string.isRequired,
|
|
456
|
+
filterable: _propTypes.default.bool,
|
|
457
|
+
filterOperators: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
458
|
+
getApplyFilterFn: _propTypes.default.func.isRequired,
|
|
459
|
+
getValueAsString: _propTypes.default.func,
|
|
460
|
+
headerLabel: _propTypes.default.string,
|
|
461
|
+
InputComponent: _propTypes.default.elementType,
|
|
462
|
+
InputComponentProps: _propTypes.default.object,
|
|
463
|
+
label: _propTypes.default.string,
|
|
464
|
+
requiresFilterValue: _propTypes.default.bool,
|
|
465
|
+
value: _propTypes.default.string.isRequired
|
|
466
|
+
})),
|
|
467
|
+
flex: _propTypes.default.number,
|
|
468
|
+
getApplyQuickFilterFn: _propTypes.default.func,
|
|
469
|
+
groupable: _propTypes.default.bool,
|
|
470
|
+
hasBeenResized: _propTypes.default.bool,
|
|
471
|
+
headerAlign: _propTypes.default.oneOf(['center', 'left', 'right']),
|
|
472
|
+
headerClassName: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
|
|
473
|
+
headerName: _propTypes.default.string,
|
|
474
|
+
hideable: _propTypes.default.bool,
|
|
475
|
+
hideSortIcons: _propTypes.default.bool,
|
|
476
|
+
maxWidth: _propTypes.default.number,
|
|
477
|
+
minWidth: _propTypes.default.number,
|
|
478
|
+
pinnable: _propTypes.default.bool,
|
|
479
|
+
preProcessEditCellProps: _propTypes.default.func,
|
|
480
|
+
renderCell: _propTypes.default.func,
|
|
481
|
+
renderEditCell: _propTypes.default.func,
|
|
482
|
+
renderHeader: _propTypes.default.func,
|
|
483
|
+
resizable: _propTypes.default.bool,
|
|
484
|
+
sortable: _propTypes.default.bool,
|
|
485
|
+
sortComparator: _propTypes.default.func,
|
|
486
|
+
sortingOrder: _propTypes.default.arrayOf(_propTypes.default.oneOf(['asc', 'desc'])),
|
|
487
|
+
type: _propTypes.default.oneOf(['actions', 'boolean', 'custom', 'date', 'dateTime', 'number', 'singleSelect', 'string']),
|
|
488
|
+
valueFormatter: _propTypes.default.func,
|
|
489
|
+
valueGetter: _propTypes.default.func,
|
|
490
|
+
valueParser: _propTypes.default.func,
|
|
491
|
+
valueSetter: _propTypes.default.func,
|
|
492
|
+
width: _propTypes.default.number
|
|
493
|
+
})).isRequired,
|
|
494
|
+
right: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
495
|
+
align: _propTypes.default.oneOf(['center', 'left', 'right']),
|
|
496
|
+
cellClassName: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
|
|
497
|
+
colSpan: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.number]),
|
|
498
|
+
computedWidth: _propTypes.default.number.isRequired,
|
|
499
|
+
description: _propTypes.default.string,
|
|
500
|
+
disableColumnMenu: _propTypes.default.bool,
|
|
501
|
+
disableExport: _propTypes.default.bool,
|
|
502
|
+
disableReorder: _propTypes.default.bool,
|
|
503
|
+
editable: _propTypes.default.bool,
|
|
504
|
+
field: _propTypes.default.string.isRequired,
|
|
505
|
+
filterable: _propTypes.default.bool,
|
|
506
|
+
filterOperators: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
507
|
+
getApplyFilterFn: _propTypes.default.func.isRequired,
|
|
508
|
+
getValueAsString: _propTypes.default.func,
|
|
509
|
+
headerLabel: _propTypes.default.string,
|
|
510
|
+
InputComponent: _propTypes.default.elementType,
|
|
511
|
+
InputComponentProps: _propTypes.default.object,
|
|
512
|
+
label: _propTypes.default.string,
|
|
513
|
+
requiresFilterValue: _propTypes.default.bool,
|
|
514
|
+
value: _propTypes.default.string.isRequired
|
|
515
|
+
})),
|
|
516
|
+
flex: _propTypes.default.number,
|
|
517
|
+
getApplyQuickFilterFn: _propTypes.default.func,
|
|
518
|
+
groupable: _propTypes.default.bool,
|
|
519
|
+
hasBeenResized: _propTypes.default.bool,
|
|
520
|
+
headerAlign: _propTypes.default.oneOf(['center', 'left', 'right']),
|
|
521
|
+
headerClassName: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
|
|
522
|
+
headerName: _propTypes.default.string,
|
|
523
|
+
hideable: _propTypes.default.bool,
|
|
524
|
+
hideSortIcons: _propTypes.default.bool,
|
|
525
|
+
maxWidth: _propTypes.default.number,
|
|
526
|
+
minWidth: _propTypes.default.number,
|
|
527
|
+
pinnable: _propTypes.default.bool,
|
|
528
|
+
preProcessEditCellProps: _propTypes.default.func,
|
|
529
|
+
renderCell: _propTypes.default.func,
|
|
530
|
+
renderEditCell: _propTypes.default.func,
|
|
531
|
+
renderHeader: _propTypes.default.func,
|
|
532
|
+
resizable: _propTypes.default.bool,
|
|
533
|
+
sortable: _propTypes.default.bool,
|
|
534
|
+
sortComparator: _propTypes.default.func,
|
|
535
|
+
sortingOrder: _propTypes.default.arrayOf(_propTypes.default.oneOf(['asc', 'desc'])),
|
|
536
|
+
type: _propTypes.default.oneOf(['actions', 'boolean', 'custom', 'date', 'dateTime', 'number', 'singleSelect', 'string']),
|
|
537
|
+
valueFormatter: _propTypes.default.func,
|
|
538
|
+
valueGetter: _propTypes.default.func,
|
|
539
|
+
valueParser: _propTypes.default.func,
|
|
540
|
+
valueSetter: _propTypes.default.func,
|
|
541
|
+
width: _propTypes.default.number
|
|
542
|
+
})).isRequired
|
|
543
|
+
}).isRequired,
|
|
382
544
|
renderedColumns: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
383
545
|
row: _propTypes.default.object,
|
|
384
546
|
rowHeight: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]).isRequired,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.GridScrollbarFillerCell = GridScrollbarFillerCell;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
|
+
var _styles = require("@mui/material/styles");
|
|
11
|
+
var _constants = require("../constants");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
const classes = {
|
|
16
|
+
root: (0, _constants.getDataGridUtilityClass)('scrollbarFiller'),
|
|
17
|
+
header: (0, _constants.getDataGridUtilityClass)('scrollbarFiller--header'),
|
|
18
|
+
borderTop: (0, _constants.getDataGridUtilityClass)('scrollbarFiller--borderTop'),
|
|
19
|
+
pinnedRight: (0, _constants.getDataGridUtilityClass)('scrollbarFiller--pinnedRight')
|
|
20
|
+
};
|
|
21
|
+
const Style = (0, _styles.styled)('div')({
|
|
22
|
+
minWidth: 'calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))',
|
|
23
|
+
alignSelf: 'stretch',
|
|
24
|
+
[`&.${classes.borderTop}`]: {
|
|
25
|
+
borderTop: '1px solid var(--DataGrid-rowBorderColor)'
|
|
26
|
+
},
|
|
27
|
+
[`&.${classes.pinnedRight}`]: {
|
|
28
|
+
backgroundColor: 'var(--DataGrid-pinnedBackground)'
|
|
29
|
+
},
|
|
30
|
+
[`&.${classes.pinnedRight}:not(.${classes.header})`]: {
|
|
31
|
+
position: 'sticky',
|
|
32
|
+
right: 0
|
|
33
|
+
},
|
|
34
|
+
[`&:not(.${classes.header}):not(.${classes.pinnedRight})`]: {
|
|
35
|
+
transform: 'translate3d(var(--DataGrid-offsetLeft), 0, 0)'
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
function GridScrollbarFillerCell({
|
|
39
|
+
header,
|
|
40
|
+
borderTop = true,
|
|
41
|
+
pinnedRight
|
|
42
|
+
}) {
|
|
43
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Style, {
|
|
44
|
+
role: "presentation",
|
|
45
|
+
className: (0, _clsx.default)(classes.root, header && classes.header, borderTop && classes.borderTop, pinnedRight && classes.pinnedRight)
|
|
46
|
+
});
|
|
47
|
+
}
|