@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,347 +49,26 @@ 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 == null ? void 0 : 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 == null ? void 0 : 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
|
-
var _rootProps$
|
|
160
|
-
const {
|
|
161
|
-
align,
|
|
162
|
-
children: childrenProp,
|
|
163
|
-
colIndex,
|
|
164
|
-
column,
|
|
165
|
-
cellMode,
|
|
166
|
-
field,
|
|
167
|
-
formattedValue,
|
|
168
|
-
hasFocus,
|
|
169
|
-
height,
|
|
170
|
-
isEditable,
|
|
171
|
-
isSelected,
|
|
172
|
-
rowId,
|
|
173
|
-
tabIndex,
|
|
174
|
-
value,
|
|
175
|
-
width,
|
|
176
|
-
className,
|
|
177
|
-
showRightBorder,
|
|
178
|
-
colSpan,
|
|
179
|
-
disableDragEvents,
|
|
180
|
-
isNotVisible,
|
|
181
|
-
onClick,
|
|
182
|
-
onDoubleClick,
|
|
183
|
-
onMouseDown,
|
|
184
|
-
onMouseUp,
|
|
185
|
-
onMouseOver,
|
|
186
|
-
onKeyDown,
|
|
187
|
-
onKeyUp,
|
|
188
|
-
onDragEnter,
|
|
189
|
-
onDragOver
|
|
190
|
-
} = props,
|
|
191
|
-
other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
192
|
-
const valueToRender = formattedValue == null ? value : formattedValue;
|
|
193
|
-
const cellRef = React.useRef(null);
|
|
194
|
-
const handleRef = useForkRef(ref, cellRef);
|
|
195
|
-
const focusElementRef = React.useRef(null);
|
|
196
|
-
const apiRef = useGridApiContext();
|
|
197
|
-
const rootProps = useGridRootProps();
|
|
198
|
-
const ownerState = {
|
|
199
|
-
align,
|
|
200
|
-
showRightBorder,
|
|
201
|
-
isEditable,
|
|
202
|
-
classes: rootProps.classes,
|
|
203
|
-
isSelected
|
|
204
|
-
};
|
|
205
|
-
const classes = useUtilityClasses(ownerState);
|
|
206
|
-
const publishMouseUp = React.useCallback(eventName => event => {
|
|
207
|
-
const params = apiRef.current.getCellParams(rowId, field || '');
|
|
208
|
-
apiRef.current.publishEvent(eventName, params, event);
|
|
209
|
-
if (onMouseUp) {
|
|
210
|
-
onMouseUp(event);
|
|
211
|
-
}
|
|
212
|
-
}, [apiRef, field, onMouseUp, rowId]);
|
|
213
|
-
const publishMouseDown = React.useCallback(eventName => event => {
|
|
214
|
-
const params = apiRef.current.getCellParams(rowId, field || '');
|
|
215
|
-
apiRef.current.publishEvent(eventName, params, event);
|
|
216
|
-
if (onMouseDown) {
|
|
217
|
-
onMouseDown(event);
|
|
218
|
-
}
|
|
219
|
-
}, [apiRef, field, onMouseDown, rowId]);
|
|
220
|
-
const publish = React.useCallback((eventName, propHandler) => event => {
|
|
221
|
-
// The row might have been deleted during the click
|
|
222
|
-
if (!apiRef.current.getRow(rowId)) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
const params = apiRef.current.getCellParams(rowId, field || '');
|
|
226
|
-
apiRef.current.publishEvent(eventName, params, event);
|
|
227
|
-
if (propHandler) {
|
|
228
|
-
propHandler(event);
|
|
229
|
-
}
|
|
230
|
-
}, [apiRef, field, rowId]);
|
|
231
|
-
const style = React.useMemo(() => {
|
|
232
|
-
if (isNotVisible) {
|
|
233
|
-
return {
|
|
234
|
-
padding: 0,
|
|
235
|
-
opacity: 0,
|
|
236
|
-
width: 0,
|
|
237
|
-
border: 0
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
const cellStyle = {
|
|
241
|
-
minWidth: width,
|
|
242
|
-
maxWidth: width,
|
|
243
|
-
minHeight: height,
|
|
244
|
-
maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
|
|
245
|
-
};
|
|
246
|
-
return cellStyle;
|
|
247
|
-
}, [width, height, isNotVisible]);
|
|
248
|
-
React.useEffect(() => {
|
|
249
|
-
if (!hasFocus || cellMode === GridCellModes.Edit) {
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
const doc = ownerDocument(apiRef.current.rootElementRef.current);
|
|
253
|
-
if (cellRef.current && !cellRef.current.contains(doc.activeElement)) {
|
|
254
|
-
const focusableElement = cellRef.current.querySelector('[tabindex="0"]');
|
|
255
|
-
const elementToFocus = focusElementRef.current || focusableElement || cellRef.current;
|
|
256
|
-
if (doesSupportPreventScroll()) {
|
|
257
|
-
elementToFocus.focus({
|
|
258
|
-
preventScroll: true
|
|
259
|
-
});
|
|
260
|
-
} else {
|
|
261
|
-
const scrollPosition = apiRef.current.getScrollPosition();
|
|
262
|
-
elementToFocus.focus();
|
|
263
|
-
apiRef.current.scroll(scrollPosition);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}, [hasFocus, cellMode, apiRef]);
|
|
267
|
-
let handleFocus = other.onFocus;
|
|
268
|
-
if (process.env.NODE_ENV === 'test' && (_rootProps$experiment = rootProps.experimentalFeatures) != null && _rootProps$experiment.warnIfFocusStateIsNotSynced) {
|
|
269
|
-
handleFocus = event => {
|
|
270
|
-
const focusedCell = gridFocusCellSelector(apiRef);
|
|
271
|
-
if ((focusedCell == null ? void 0 : focusedCell.id) === rowId && focusedCell.field === field) {
|
|
272
|
-
if (typeof other.onFocus === 'function') {
|
|
273
|
-
other.onFocus(event);
|
|
274
|
-
}
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
if (!warnedOnce) {
|
|
278
|
-
console.warn([`MUI: The cell with id=${rowId} and field=${field} received focus.`, `According to the state, the focus should be at id=${focusedCell == null ? void 0 : focusedCell.id}, field=${focusedCell == null ? void 0 : 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'));
|
|
279
|
-
warnedOnce = true;
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
const managesOwnFocus = column.type === 'actions';
|
|
284
|
-
let children = childrenProp;
|
|
285
|
-
if (children === undefined) {
|
|
286
|
-
const valueString = valueToRender == null ? void 0 : valueToRender.toString();
|
|
287
|
-
children = /*#__PURE__*/_jsx("div", {
|
|
288
|
-
className: classes.content,
|
|
289
|
-
title: valueString,
|
|
290
|
-
role: "presentation",
|
|
291
|
-
children: valueString
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
if ( /*#__PURE__*/React.isValidElement(children) && managesOwnFocus) {
|
|
295
|
-
children = /*#__PURE__*/React.cloneElement(children, {
|
|
296
|
-
focusElementRef
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
const draggableEventHandlers = disableDragEvents ? null : {
|
|
300
|
-
onDragEnter: publish('cellDragEnter', onDragEnter),
|
|
301
|
-
onDragOver: publish('cellDragOver', onDragOver)
|
|
302
|
-
};
|
|
303
|
-
const ariaV7 = (_rootProps$experiment2 = rootProps.experimentalFeatures) == null ? void 0 : _rootProps$experiment2.ariaV7;
|
|
304
|
-
return (
|
|
305
|
-
/*#__PURE__*/
|
|
306
|
-
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
307
|
-
_jsx("div", _extends({
|
|
308
|
-
ref: handleRef,
|
|
309
|
-
className: clsx(className, classes.root),
|
|
310
|
-
role: ariaV7 ? 'gridcell' : 'cell',
|
|
311
|
-
"data-field": field,
|
|
312
|
-
"data-colindex": colIndex,
|
|
313
|
-
"aria-colindex": colIndex + 1,
|
|
314
|
-
"aria-colspan": colSpan,
|
|
315
|
-
style: style,
|
|
316
|
-
tabIndex: tabIndex,
|
|
317
|
-
onClick: publish('cellClick', onClick),
|
|
318
|
-
onDoubleClick: publish('cellDoubleClick', onDoubleClick),
|
|
319
|
-
onMouseOver: publish('cellMouseOver', onMouseOver),
|
|
320
|
-
onMouseDown: publishMouseDown('cellMouseDown'),
|
|
321
|
-
onMouseUp: publishMouseUp('cellMouseUp'),
|
|
322
|
-
onKeyDown: publish('cellKeyDown', onKeyDown),
|
|
323
|
-
onKeyUp: publish('cellKeyUp', onKeyUp)
|
|
324
|
-
}, draggableEventHandlers, other, {
|
|
325
|
-
onFocus: handleFocus,
|
|
326
|
-
children: children
|
|
327
|
-
}))
|
|
328
|
-
);
|
|
329
|
-
});
|
|
330
|
-
const MemoizedCellWrapper = fastMemo(GridCellWrapper);
|
|
331
|
-
process.env.NODE_ENV !== "production" ? GridCellWrapper.propTypes = {
|
|
332
|
-
// ----------------------------- Warning --------------------------------
|
|
333
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
334
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
335
|
-
// ----------------------------------------------------------------------
|
|
336
|
-
align: PropTypes.oneOf(['center', 'left', 'right']),
|
|
337
|
-
className: PropTypes.string,
|
|
338
|
-
colIndex: PropTypes.number,
|
|
339
|
-
colSpan: PropTypes.number,
|
|
340
|
-
column: PropTypes.object,
|
|
341
|
-
disableDragEvents: PropTypes.bool,
|
|
342
|
-
height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
|
|
343
|
-
onClick: PropTypes.func,
|
|
344
|
-
onDoubleClick: PropTypes.func,
|
|
345
|
-
onDragEnter: PropTypes.func,
|
|
346
|
-
onDragOver: PropTypes.func,
|
|
347
|
-
onKeyDown: PropTypes.func,
|
|
348
|
-
onMouseDown: PropTypes.func,
|
|
349
|
-
onMouseUp: PropTypes.func,
|
|
350
|
-
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
351
|
-
showRightBorder: PropTypes.bool,
|
|
352
|
-
width: PropTypes.number
|
|
353
|
-
} : void 0;
|
|
354
|
-
process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
355
|
-
// ----------------------------- Warning --------------------------------
|
|
356
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
357
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
358
|
-
// ----------------------------------------------------------------------
|
|
359
|
-
align: PropTypes.oneOf(['center', 'left', 'right']),
|
|
360
|
-
cellMode: PropTypes.oneOf(['edit', 'view']),
|
|
361
|
-
children: PropTypes.node,
|
|
362
|
-
className: PropTypes.string,
|
|
363
|
-
colIndex: PropTypes.number,
|
|
364
|
-
colSpan: PropTypes.number,
|
|
365
|
-
column: PropTypes.object,
|
|
366
|
-
disableDragEvents: PropTypes.bool,
|
|
367
|
-
editCellState: PropTypes.shape({
|
|
368
|
-
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
369
|
-
isProcessingProps: PropTypes.bool,
|
|
370
|
-
isValidating: PropTypes.bool,
|
|
371
|
-
value: PropTypes.any
|
|
372
|
-
}),
|
|
373
|
-
isNotVisible: PropTypes.bool,
|
|
374
|
-
height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
|
|
375
|
-
onClick: PropTypes.func,
|
|
376
|
-
onDoubleClick: PropTypes.func,
|
|
377
|
-
onDragEnter: PropTypes.func,
|
|
378
|
-
onDragOver: PropTypes.func,
|
|
379
|
-
onKeyDown: PropTypes.func,
|
|
380
|
-
onMouseDown: PropTypes.func,
|
|
381
|
-
onMouseUp: PropTypes.func,
|
|
382
|
-
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
383
|
-
showRightBorder: PropTypes.bool,
|
|
384
|
-
width: PropTypes.number
|
|
385
|
-
} : void 0;
|
|
386
|
-
export { MemoizedCellWrapper as GridCellWrapper, GridCell };
|
|
387
|
-
const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
388
|
-
var _getActions, _ref, _rootProps$cellSelect, _rootProps$experiment3, _rootProps$experiment4;
|
|
71
|
+
var _getActions, _ref, _rootProps$cellSelect, _rootProps$experiment;
|
|
389
72
|
const {
|
|
390
73
|
column,
|
|
391
74
|
rowId,
|
|
@@ -395,10 +78,14 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
395
78
|
height,
|
|
396
79
|
width,
|
|
397
80
|
className,
|
|
398
|
-
|
|
81
|
+
style: styleProp,
|
|
399
82
|
colSpan,
|
|
400
83
|
disableDragEvents,
|
|
401
84
|
isNotVisible,
|
|
85
|
+
pinnedOffset,
|
|
86
|
+
pinnedPosition,
|
|
87
|
+
sectionIndex,
|
|
88
|
+
sectionLength,
|
|
402
89
|
onClick,
|
|
403
90
|
onDoubleClick,
|
|
404
91
|
onMouseDown,
|
|
@@ -409,7 +96,7 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
409
96
|
onDragEnter,
|
|
410
97
|
onDragOver
|
|
411
98
|
} = props,
|
|
412
|
-
other = _objectWithoutPropertiesLoose(props,
|
|
99
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
413
100
|
const apiRef = useGridApiContext();
|
|
414
101
|
const rootProps = useGridRootProps();
|
|
415
102
|
const field = column.field;
|
|
@@ -436,7 +123,7 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
436
123
|
const {
|
|
437
124
|
cellMode,
|
|
438
125
|
hasFocus,
|
|
439
|
-
isEditable,
|
|
126
|
+
isEditable = false,
|
|
440
127
|
value,
|
|
441
128
|
formattedValue
|
|
442
129
|
} = cellParamsWithAPI;
|
|
@@ -462,11 +149,16 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
462
149
|
const focusElementRef = React.useRef(null);
|
|
463
150
|
// @ts-expect-error To access `cellSelection` flag as it's a `premium` feature
|
|
464
151
|
const isSelectionMode = (_rootProps$cellSelect = rootProps.cellSelection) != null ? _rootProps$cellSelect : false;
|
|
152
|
+
const isSectionLastCell = sectionIndex === sectionLength - 1;
|
|
153
|
+
const showLeftBorder = pinnedPosition === PinnedPosition.RIGHT && sectionIndex === 0;
|
|
154
|
+
const showRightBorder = rootProps.showCellVerticalBorder && (pinnedPosition !== PinnedPosition.LEFT ? !isSectionLastCell : true) || pinnedPosition === PinnedPosition.LEFT && isSectionLastCell;
|
|
465
155
|
const ownerState = {
|
|
466
156
|
align,
|
|
157
|
+
showLeftBorder,
|
|
467
158
|
showRightBorder,
|
|
468
159
|
isEditable,
|
|
469
160
|
classes: rootProps.classes,
|
|
161
|
+
pinnedPosition,
|
|
470
162
|
isSelected,
|
|
471
163
|
isSelectionMode
|
|
472
164
|
};
|
|
@@ -505,14 +197,18 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
505
197
|
border: 0
|
|
506
198
|
};
|
|
507
199
|
}
|
|
508
|
-
const cellStyle = {
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
200
|
+
const cellStyle = _extends({
|
|
201
|
+
'--width': `${width}px`,
|
|
202
|
+
'--height': typeof height === 'number' ? `${height}px` : height
|
|
203
|
+
}, styleProp);
|
|
204
|
+
if (pinnedPosition === PinnedPosition.LEFT) {
|
|
205
|
+
cellStyle.left = pinnedOffset;
|
|
206
|
+
}
|
|
207
|
+
if (pinnedPosition === PinnedPosition.RIGHT) {
|
|
208
|
+
cellStyle.right = pinnedOffset;
|
|
209
|
+
}
|
|
514
210
|
return cellStyle;
|
|
515
|
-
}, [width, height, isNotVisible]);
|
|
211
|
+
}, [width, height, isNotVisible, styleProp, pinnedOffset, pinnedPosition]);
|
|
516
212
|
React.useEffect(() => {
|
|
517
213
|
if (!hasFocus || cellMode === GridCellModes.Edit) {
|
|
518
214
|
return;
|
|
@@ -536,7 +232,7 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
536
232
|
return null;
|
|
537
233
|
}
|
|
538
234
|
let handleFocus = other.onFocus;
|
|
539
|
-
if (process.env.NODE_ENV === 'test' && (_rootProps$
|
|
235
|
+
if (process.env.NODE_ENV === 'test' && (_rootProps$experiment = rootProps.experimentalFeatures) != null && _rootProps$experiment.warnIfFocusStateIsNotSynced) {
|
|
540
236
|
handleFocus = event => {
|
|
541
237
|
const focusedCell = gridFocusCellSelector(apiRef);
|
|
542
238
|
if ((focusedCell == null ? void 0 : focusedCell.id) === rowId && focusedCell.field === field) {
|
|
@@ -546,7 +242,7 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
546
242
|
return;
|
|
547
243
|
}
|
|
548
244
|
if (!warnedOnce) {
|
|
549
|
-
console.warn([`MUI: The cell with id=${rowId} and field=${field} received focus.`, `According to the state, the focus should be at id=${focusedCell == null ? void 0 : focusedCell.id}, field=${focusedCell == null ? void 0 : 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'));
|
|
245
|
+
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 == null ? void 0 : focusedCell.id}, field=${focusedCell == null ? void 0 : 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'));
|
|
550
246
|
warnedOnce = true;
|
|
551
247
|
}
|
|
552
248
|
};
|
|
@@ -561,7 +257,7 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
561
257
|
const updatedRow = apiRef.current.getRowWithUpdatedValues(rowId, column.field);
|
|
562
258
|
|
|
563
259
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
564
|
-
const editCellStateRest = _objectWithoutPropertiesLoose(editCellState,
|
|
260
|
+
const editCellStateRest = _objectWithoutPropertiesLoose(editCellState, _excluded2);
|
|
565
261
|
const params = _extends({}, cellParamsWithAPI, {
|
|
566
262
|
row: updatedRow
|
|
567
263
|
}, editCellStateRest);
|
|
@@ -587,34 +283,29 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
587
283
|
onDragEnter: publish('cellDragEnter', onDragEnter),
|
|
588
284
|
onDragOver: publish('cellDragOver', onDragOver)
|
|
589
285
|
};
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
}, draggableEventHandlers, other, {
|
|
612
|
-
onFocus: handleFocus,
|
|
613
|
-
children: children
|
|
614
|
-
}))
|
|
615
|
-
);
|
|
286
|
+
return /*#__PURE__*/_jsx("div", _extends({
|
|
287
|
+
ref: handleRef,
|
|
288
|
+
className: clsx(className, classNames, classes.root),
|
|
289
|
+
role: "gridcell",
|
|
290
|
+
"data-field": field,
|
|
291
|
+
"data-colindex": colIndex,
|
|
292
|
+
"aria-colindex": colIndex + 1,
|
|
293
|
+
"aria-colspan": colSpan,
|
|
294
|
+
style: style,
|
|
295
|
+
tabIndex: tabIndex,
|
|
296
|
+
onClick: publish('cellClick', onClick),
|
|
297
|
+
onDoubleClick: publish('cellDoubleClick', onDoubleClick),
|
|
298
|
+
onMouseOver: publish('cellMouseOver', onMouseOver),
|
|
299
|
+
onMouseDown: publishMouseDown('cellMouseDown'),
|
|
300
|
+
onMouseUp: publishMouseUp('cellMouseUp'),
|
|
301
|
+
onKeyDown: publish('cellKeyDown', onKeyDown),
|
|
302
|
+
onKeyUp: publish('cellKeyUp', onKeyUp)
|
|
303
|
+
}, draggableEventHandlers, other, {
|
|
304
|
+
onFocus: handleFocus,
|
|
305
|
+
children: children
|
|
306
|
+
}));
|
|
616
307
|
});
|
|
617
|
-
process.env.NODE_ENV !== "production" ?
|
|
308
|
+
process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
618
309
|
// ----------------------------- Warning --------------------------------
|
|
619
310
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
620
311
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
@@ -631,8 +322,9 @@ process.env.NODE_ENV !== "production" ? GridCellV7.propTypes = {
|
|
|
631
322
|
isValidating: PropTypes.bool,
|
|
632
323
|
value: PropTypes.any
|
|
633
324
|
}),
|
|
325
|
+
gridHasScrollX: PropTypes.bool.isRequired,
|
|
634
326
|
height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,
|
|
635
|
-
isNotVisible: PropTypes.bool,
|
|
327
|
+
isNotVisible: PropTypes.bool.isRequired,
|
|
636
328
|
onClick: PropTypes.func,
|
|
637
329
|
onDoubleClick: PropTypes.func,
|
|
638
330
|
onDragEnter: PropTypes.func,
|
|
@@ -640,9 +332,12 @@ process.env.NODE_ENV !== "production" ? GridCellV7.propTypes = {
|
|
|
640
332
|
onKeyDown: PropTypes.func,
|
|
641
333
|
onMouseDown: PropTypes.func,
|
|
642
334
|
onMouseUp: PropTypes.func,
|
|
335
|
+
pinnedOffset: PropTypes.number.isRequired,
|
|
336
|
+
pinnedPosition: PropTypes.oneOf([0, 1, 2]).isRequired,
|
|
643
337
|
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
644
|
-
|
|
338
|
+
sectionIndex: PropTypes.number.isRequired,
|
|
339
|
+
sectionLength: PropTypes.number.isRequired,
|
|
645
340
|
width: PropTypes.number.isRequired
|
|
646
341
|
} : void 0;
|
|
647
|
-
const
|
|
648
|
-
export {
|
|
342
|
+
const MemoizedGridCell = fastMemo(GridCell);
|
|
343
|
+
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
|
});
|
|
@@ -21,4 +21,5 @@ declare function GridColumnHeaderItem(props: GridColumnHeaderItemProps): React.J
|
|
|
21
21
|
declare namespace GridColumnHeaderItem {
|
|
22
22
|
var propTypes: any;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
declare const Memoized: typeof GridColumnHeaderItem;
|
|
25
|
+
export { Memoized as GridColumnHeaderItem };
|
|
@@ -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';
|
|
@@ -125,14 +126,16 @@ function GridColumnHeaderItem(props) {
|
|
|
125
126
|
onExited: handleExited
|
|
126
127
|
});
|
|
127
128
|
const sortingOrder = (_colDef$sortingOrder = colDef.sortingOrder) != null ? _colDef$sortingOrder : rootProps.sortingOrder;
|
|
129
|
+
const showSortIcon = (colDef.sortable || sortDirection != null) && !colDef.hideSortIcons && !rootProps.disableColumnSorting;
|
|
128
130
|
const columnTitleIconButtons = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
129
131
|
children: [!rootProps.disableColumnFilter && /*#__PURE__*/_jsx(rootProps.slots.columnHeaderFilterIconButton, _extends({
|
|
130
132
|
field: colDef.field,
|
|
131
133
|
counter: filterItemsCounter
|
|
132
|
-
}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.columnHeaderFilterIconButton)),
|
|
134
|
+
}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.columnHeaderFilterIconButton)), showSortIcon && /*#__PURE__*/_jsx(GridColumnHeaderSortIcon, {
|
|
133
135
|
direction: sortDirection,
|
|
134
136
|
index: sortIndex,
|
|
135
|
-
sortingOrder: sortingOrder
|
|
137
|
+
sortingOrder: sortingOrder,
|
|
138
|
+
disabled: !colDef.sortable
|
|
136
139
|
})]
|
|
137
140
|
});
|
|
138
141
|
React.useLayoutEffect(() => {
|
|
@@ -195,4 +198,5 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaderItem.propTypes = {
|
|
|
195
198
|
sortIndex: PropTypes.number,
|
|
196
199
|
tabIndex: PropTypes.oneOf([-1, 0]).isRequired
|
|
197
200
|
} : void 0;
|
|
198
|
-
|
|
201
|
+
const Memoized = fastMemo(GridColumnHeaderItem);
|
|
202
|
+
export { Memoized as GridColumnHeaderItem };
|
|
@@ -4,6 +4,7 @@ export interface GridColumnHeaderSortIconProps {
|
|
|
4
4
|
direction: GridSortDirection;
|
|
5
5
|
index: number | undefined;
|
|
6
6
|
sortingOrder: readonly GridSortDirection[];
|
|
7
|
+
disabled?: boolean;
|
|
7
8
|
}
|
|
8
9
|
declare function GridColumnHeaderSortIconRaw(props: GridColumnHeaderSortIconProps): React.JSX.Element | null;
|
|
9
10
|
declare namespace GridColumnHeaderSortIconRaw {
|
|
@@ -39,7 +39,8 @@ function GridColumnHeaderSortIconRaw(props) {
|
|
|
39
39
|
const {
|
|
40
40
|
direction,
|
|
41
41
|
index,
|
|
42
|
-
sortingOrder
|
|
42
|
+
sortingOrder,
|
|
43
|
+
disabled
|
|
43
44
|
} = props;
|
|
44
45
|
const apiRef = useGridApiContext();
|
|
45
46
|
const rootProps = useGridRootProps();
|
|
@@ -55,7 +56,8 @@ function GridColumnHeaderSortIconRaw(props) {
|
|
|
55
56
|
tabIndex: -1,
|
|
56
57
|
"aria-label": apiRef.current.getLocaleText('columnHeaderSortIconLabel'),
|
|
57
58
|
title: apiRef.current.getLocaleText('columnHeaderSortIconLabel'),
|
|
58
|
-
size: "small"
|
|
59
|
+
size: "small",
|
|
60
|
+
disabled: disabled
|
|
59
61
|
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
60
62
|
children: iconElement
|
|
61
63
|
}));
|
|
@@ -74,6 +76,7 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaderSortIconRaw.propTypes =
|
|
|
74
76
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
75
77
|
// ----------------------------------------------------------------------
|
|
76
78
|
direction: PropTypes.oneOf(['asc', 'desc']),
|
|
79
|
+
disabled: PropTypes.bool,
|
|
77
80
|
index: PropTypes.number,
|
|
78
81
|
sortingOrder: PropTypes.arrayOf(PropTypes.oneOf(['asc', 'desc'])).isRequired
|
|
79
82
|
} : void 0;
|