@mui/x-data-grid 7.0.0-beta.3 → 7.0.0-beta.5
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 +357 -22
- package/DataGrid/DataGrid.js +2 -0
- package/colDef/gridActionsColDef.js +1 -0
- package/colDef/gridBooleanColDef.js +1 -0
- package/colDef/gridBooleanOperators.js +1 -1
- package/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/components/GridRow.d.ts +7 -9
- package/components/GridRow.js +36 -47
- package/components/GridScrollbarFillerCell.js +6 -21
- package/components/cell/GridCell.d.ts +2 -1
- package/components/cell/GridCell.js +17 -15
- package/components/cell/GridSkeletonCell.d.ts +3 -2
- package/components/cell/GridSkeletonCell.js +14 -6
- package/components/columnSelection/GridCellCheckboxRenderer.js +7 -6
- package/components/columnsManagement/GridColumnsManagement.js +1 -1
- package/components/containers/GridRootStyles.js +59 -21
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/components/virtualization/GridBottomContainer.js +1 -1
- package/components/virtualization/GridTopContainer.js +1 -1
- package/components/virtualization/GridVirtualScroller.js +2 -2
- package/components/virtualization/GridVirtualScrollerRenderZone.js +9 -3
- package/constants/gridClasses.d.ts +24 -8
- package/constants/gridClasses.js +1 -1
- package/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +11 -8
- package/hooks/features/columns/gridColumnsSelector.d.ts +6 -0
- package/hooks/features/columns/gridColumnsSelector.js +8 -1
- package/hooks/features/columns/useGridColumns.js +4 -0
- package/hooks/features/editing/useGridCellEditing.js +3 -4
- package/hooks/features/editing/useGridRowEditing.js +4 -6
- package/hooks/features/filter/useGridFilter.js +2 -2
- package/hooks/features/rows/useGridRows.js +8 -4
- package/hooks/features/rows/useGridRowsMeta.js +5 -13
- package/hooks/features/sorting/gridSortingUtils.js +9 -1
- package/hooks/features/sorting/useGridSorting.js +1 -2
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +0 -9
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -7
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +82 -138
- package/hooks/features/virtualization/useGridVirtualization.d.ts +0 -8
- package/hooks/features/virtualization/useGridVirtualization.js +1 -6
- package/hooks/utils/useTimeout.d.ts +5 -3
- package/hooks/utils/useTimeout.js +13 -5
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/models/colDef/gridColDef.d.ts +13 -0
- package/modern/DataGrid/DataGrid.js +2 -0
- package/modern/colDef/gridActionsColDef.js +1 -0
- package/modern/colDef/gridBooleanColDef.js +1 -0
- package/modern/colDef/gridBooleanOperators.js +1 -1
- package/modern/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/modern/components/GridRow.js +35 -46
- package/modern/components/GridScrollbarFillerCell.js +6 -21
- package/modern/components/cell/GridCell.js +17 -15
- package/modern/components/cell/GridSkeletonCell.js +14 -6
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +7 -6
- package/modern/components/columnsManagement/GridColumnsManagement.js +1 -1
- package/modern/components/containers/GridRootStyles.js +59 -21
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/modern/components/virtualization/GridBottomContainer.js +1 -1
- package/modern/components/virtualization/GridTopContainer.js +1 -1
- package/modern/components/virtualization/GridVirtualScroller.js +2 -2
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +8 -3
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +11 -8
- package/modern/hooks/features/columns/gridColumnsSelector.js +8 -1
- package/modern/hooks/features/columns/useGridColumns.js +2 -0
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -4
- package/modern/hooks/features/editing/useGridRowEditing.js +4 -6
- package/modern/hooks/features/filter/useGridFilter.js +2 -2
- package/modern/hooks/features/rows/useGridRows.js +8 -4
- package/modern/hooks/features/rows/useGridRowsMeta.js +5 -13
- package/modern/hooks/features/sorting/gridSortingUtils.js +9 -1
- package/modern/hooks/features/sorting/useGridSorting.js +1 -2
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -7
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +80 -136
- package/modern/hooks/features/virtualization/useGridVirtualization.js +1 -6
- package/modern/hooks/utils/useTimeout.js +13 -5
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/utils/keyboardUtils.js +20 -11
- package/modern/utils/utils.js +9 -0
- package/node/DataGrid/DataGrid.js +1 -0
- package/node/colDef/gridActionsColDef.js +1 -0
- package/node/colDef/gridBooleanColDef.js +1 -0
- package/node/colDef/gridBooleanOperators.js +1 -1
- package/node/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/node/components/GridRow.js +35 -46
- package/node/components/GridScrollbarFillerCell.js +5 -20
- package/node/components/cell/GridCell.js +17 -15
- package/node/components/cell/GridSkeletonCell.js +15 -7
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +7 -6
- package/node/components/columnsManagement/GridColumnsManagement.js +1 -1
- package/node/components/containers/GridRootStyles.js +59 -21
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/node/components/virtualization/GridBottomContainer.js +1 -1
- package/node/components/virtualization/GridTopContainer.js +1 -1
- package/node/components/virtualization/GridVirtualScroller.js +2 -2
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +7 -2
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +8 -5
- package/node/hooks/features/columns/gridColumnsSelector.js +9 -2
- package/node/hooks/features/columns/useGridColumns.js +2 -0
- package/node/hooks/features/editing/useGridCellEditing.js +2 -3
- package/node/hooks/features/editing/useGridRowEditing.js +3 -5
- package/node/hooks/features/filter/useGridFilter.js +2 -2
- package/node/hooks/features/rows/useGridRows.js +8 -4
- package/node/hooks/features/rows/useGridRowsMeta.js +5 -13
- package/node/hooks/features/sorting/gridSortingUtils.js +9 -1
- package/node/hooks/features/sorting/useGridSorting.js +1 -2
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +1 -8
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +81 -136
- package/node/hooks/features/virtualization/useGridVirtualization.js +2 -7
- package/node/hooks/utils/useTimeout.js +13 -4
- package/node/index.js +1 -1
- package/node/internals/index.js +7 -0
- package/node/utils/keyboardUtils.js +25 -20
- package/node/utils/utils.js +12 -1
- package/package.json +1 -1
- package/utils/keyboardUtils.d.ts +7 -6
- package/utils/keyboardUtils.js +20 -11
- package/utils/utils.d.ts +4 -0
- package/utils/utils.js +9 -0
- package/legacy/DataGrid/DataGrid.js +0 -664
- package/legacy/DataGrid/index.js +0 -2
- package/legacy/DataGrid/useDataGridComponent.js +0 -81
- package/legacy/DataGrid/useDataGridProps.js +0 -98
- package/legacy/colDef/gridActionsColDef.js +0 -18
- package/legacy/colDef/gridBooleanColDef.js +0 -42
- package/legacy/colDef/gridBooleanOperators.js +0 -16
- package/legacy/colDef/gridCheckboxSelectionColDef.js +0 -33
- package/legacy/colDef/gridDateColDef.js +0 -62
- package/legacy/colDef/gridDateOperators.js +0 -115
- package/legacy/colDef/gridDefaultColumnTypes.js +0 -19
- package/legacy/colDef/gridNumericColDef.js +0 -19
- package/legacy/colDef/gridNumericOperators.js +0 -145
- package/legacy/colDef/gridSingleSelectColDef.js +0 -64
- package/legacy/colDef/gridSingleSelectOperators.js +0 -46
- package/legacy/colDef/gridStringColDef.js +0 -27
- package/legacy/colDef/gridStringOperators.js +0 -112
- package/legacy/colDef/index.js +0 -13
- package/legacy/components/GridApiContext.js +0 -5
- package/legacy/components/GridColumnHeaders.js +0 -94
- package/legacy/components/GridDetailPanels.js +0 -4
- package/legacy/components/GridFooter.js +0 -42
- package/legacy/components/GridHeader.js +0 -13
- package/legacy/components/GridHeaders.js +0 -53
- package/legacy/components/GridLoadingOverlay.js +0 -21
- package/legacy/components/GridNoResultsOverlay.js +0 -14
- package/legacy/components/GridNoRowsOverlay.js +0 -23
- package/legacy/components/GridPagination.js +0 -85
- package/legacy/components/GridPinnedRows.js +0 -4
- package/legacy/components/GridRow.js +0 -465
- package/legacy/components/GridRowCount.js +0 -63
- package/legacy/components/GridScrollbarFillerCell.js +0 -34
- package/legacy/components/GridSelectedRowCount.js +0 -66
- package/legacy/components/base/GridBody.js +0 -2
- package/legacy/components/base/GridFooterPlaceholder.js +0 -12
- package/legacy/components/base/GridOverlays.js +0 -122
- package/legacy/components/base/index.js +0 -3
- package/legacy/components/cell/GridActionsCell.js +0 -294
- package/legacy/components/cell/GridActionsCellItem.js +0 -69
- package/legacy/components/cell/GridBooleanCell.js +0 -121
- package/legacy/components/cell/GridCell.js +0 -350
- package/legacy/components/cell/GridEditBooleanCell.js +0 -174
- package/legacy/components/cell/GridEditDateCell.js +0 -230
- package/legacy/components/cell/GridEditInputCell.js +0 -198
- package/legacy/components/cell/GridEditSingleSelectCell.js +0 -231
- package/legacy/components/cell/GridSkeletonCell.js +0 -52
- package/legacy/components/cell/index.js +0 -9
- package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +0 -59
- package/legacy/components/columnHeaders/GridBaseColumnHeaders.js +0 -41
- package/legacy/components/columnHeaders/GridColumnGroupHeader.js +0 -132
- package/legacy/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -93
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +0 -212
- package/legacy/components/columnHeaders/GridColumnHeaderSeparator.js +0 -71
- package/legacy/components/columnHeaders/GridColumnHeaderSortIcon.js +0 -79
- package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +0 -84
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +0 -55
- package/legacy/components/columnHeaders/GridGenericColumnHeaderItem.js +0 -107
- package/legacy/components/columnHeaders/GridIconButtonContainer.js +0 -41
- package/legacy/components/columnHeaders/index.js +0 -5
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +0 -160
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +0 -134
- package/legacy/components/columnSelection/index.js +0 -2
- package/legacy/components/columnsManagement/GridColumnsManagement.js +0 -307
- package/legacy/components/columnsManagement/index.js +0 -1
- package/legacy/components/columnsManagement/utils.js +0 -22
- package/legacy/components/containers/GridFooterContainer.js +0 -50
- package/legacy/components/containers/GridOverlay.js +0 -52
- package/legacy/components/containers/GridRoot.js +0 -79
- package/legacy/components/containers/GridRootStyles.js +0 -395
- package/legacy/components/containers/GridToolbarContainer.js +0 -59
- package/legacy/components/containers/index.js +0 -4
- package/legacy/components/index.js +0 -19
- package/legacy/components/menu/GridMenu.js +0 -132
- package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +0 -61
- package/legacy/components/menu/columnMenu/GridColumnMenu.js +0 -81
- package/legacy/components/menu/columnMenu/GridColumnMenuContainer.js +0 -56
- package/legacy/components/menu/columnMenu/GridColumnMenuItemProps.js +0 -1
- package/legacy/components/menu/columnMenu/GridColumnMenuProps.js +0 -1
- package/legacy/components/menu/columnMenu/index.js +0 -9
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.js +0 -21
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +0 -41
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +0 -60
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +0 -41
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +0 -80
- package/legacy/components/menu/columnMenu/menuItems/index.js +0 -5
- package/legacy/components/menu/index.js +0 -2
- package/legacy/components/panel/GridColumnsPanel.js +0 -22
- package/legacy/components/panel/GridPanel.js +0 -137
- package/legacy/components/panel/GridPanelContent.js +0 -49
- package/legacy/components/panel/GridPanelFooter.js +0 -50
- package/legacy/components/panel/GridPanelHeader.js +0 -48
- package/legacy/components/panel/GridPanelWrapper.js +0 -64
- package/legacy/components/panel/GridPreferencesPanel.js +0 -26
- package/legacy/components/panel/filterPanel/GridFilterForm.js +0 -528
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +0 -118
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +0 -121
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -116
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +0 -102
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +0 -149
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +0 -106
- package/legacy/components/panel/filterPanel/GridFilterInputValueProps.js +0 -1
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +0 -264
- package/legacy/components/panel/filterPanel/filterPanelUtils.js +0 -22
- package/legacy/components/panel/filterPanel/index.js +0 -9
- package/legacy/components/panel/index.js +0 -7
- package/legacy/components/reexportable.js +0 -1
- package/legacy/components/toolbar/GridToolbar.js +0 -64
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +0 -68
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +0 -142
- package/legacy/components/toolbar/GridToolbarExport.js +0 -80
- package/legacy/components/toolbar/GridToolbarExportContainer.js +0 -105
- package/legacy/components/toolbar/GridToolbarFilterButton.js +0 -136
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +0 -164
- package/legacy/components/toolbar/index.js +0 -7
- package/legacy/components/virtualization/GridBottomContainer.js +0 -25
- package/legacy/components/virtualization/GridMainContainer.js +0 -20
- package/legacy/components/virtualization/GridTopContainer.js +0 -35
- package/legacy/components/virtualization/GridVirtualScrollbar.js +0 -129
- package/legacy/components/virtualization/GridVirtualScroller.js +0 -93
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +0 -35
- package/legacy/components/virtualization/GridVirtualScrollerFiller.js +0 -70
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +0 -49
- package/legacy/constants/defaultGridSlotsComponents.js +0 -33
- package/legacy/constants/envConstants.js +0 -19
- package/legacy/constants/gridClasses.js +0 -5
- package/legacy/constants/gridDetailPanelToggleField.js +0 -2
- package/legacy/constants/index.js +0 -3
- package/legacy/constants/localeTextConstants.js +0 -158
- package/legacy/context/GridContextProvider.js +0 -21
- package/legacy/context/GridRootPropsContext.js +0 -6
- package/legacy/context/index.js +0 -1
- package/legacy/hooks/core/gridCoreSelector.js +0 -7
- package/legacy/hooks/core/index.js +0 -1
- package/legacy/hooks/core/pipeProcessing/gridPipeProcessingApi.js +0 -1
- package/legacy/hooks/core/pipeProcessing/index.js +0 -4
- package/legacy/hooks/core/pipeProcessing/useGridPipeProcessing.js +0 -114
- package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +0 -26
- package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +0 -26
- package/legacy/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +0 -1
- package/legacy/hooks/core/strategyProcessing/index.js +0 -3
- package/legacy/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +0 -18
- package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +0 -116
- package/legacy/hooks/core/useGridApiInitialization.js +0 -124
- package/legacy/hooks/core/useGridInitialization.js +0 -26
- package/legacy/hooks/core/useGridLocaleText.js +0 -12
- package/legacy/hooks/core/useGridLoggerFactory.js +0 -51
- package/legacy/hooks/core/useGridRefs.js +0 -13
- package/legacy/hooks/core/useGridStateInitialization.js +0 -106
- package/legacy/hooks/core/useGridTheme.js +0 -21
- package/legacy/hooks/features/clipboard/useGridClipboard.js +0 -92
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsInterfaces.js +0 -1
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsSelector.js +0 -24
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsUtils.js +0 -92
- package/legacy/hooks/features/columnGrouping/index.js +0 -2
- package/legacy/hooks/features/columnGrouping/useGridColumnGrouping.js +0 -140
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +0 -272
- package/legacy/hooks/features/columnMenu/columnMenuInterfaces.js +0 -1
- package/legacy/hooks/features/columnMenu/columnMenuSelector.js +0 -3
- package/legacy/hooks/features/columnMenu/index.js +0 -2
- package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +0 -108
- package/legacy/hooks/features/columnMenu/useGridColumnMenuSlots.js +0 -71
- package/legacy/hooks/features/columns/gridColumnsInterfaces.js +0 -9
- package/legacy/hooks/features/columns/gridColumnsSelector.js +0 -174
- package/legacy/hooks/features/columns/gridColumnsUtils.js +0 -338
- package/legacy/hooks/features/columns/index.js +0 -2
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +0 -105
- package/legacy/hooks/features/columns/useGridColumns.js +0 -319
- package/legacy/hooks/features/density/densitySelector.js +0 -10
- package/legacy/hooks/features/density/densityState.js +0 -1
- package/legacy/hooks/features/density/index.js +0 -2
- package/legacy/hooks/features/density/useGridDensity.js +0 -48
- package/legacy/hooks/features/dimensions/gridDimensionsApi.js +0 -1
- package/legacy/hooks/features/dimensions/gridDimensionsSelectors.js +0 -3
- package/legacy/hooks/features/dimensions/index.js +0 -2
- package/legacy/hooks/features/dimensions/useGridDimensions.js +0 -302
- package/legacy/hooks/features/editing/gridEditingSelectors.js +0 -4
- package/legacy/hooks/features/editing/useGridCellEditing.js +0 -456
- package/legacy/hooks/features/editing/useGridEditing.js +0 -145
- package/legacy/hooks/features/editing/useGridRowEditing.js +0 -567
- package/legacy/hooks/features/events/useGridEvents.js +0 -23
- package/legacy/hooks/features/export/serializers/csvSerializer.js +0 -155
- package/legacy/hooks/features/export/useGridCsvExport.js +0 -75
- package/legacy/hooks/features/export/useGridPrintExport.js +0 -313
- package/legacy/hooks/features/export/utils.js +0 -49
- package/legacy/hooks/features/filter/gridFilterSelector.js +0 -165
- package/legacy/hooks/features/filter/gridFilterState.js +0 -20
- package/legacy/hooks/features/filter/gridFilterUtils.js +0 -330
- package/legacy/hooks/features/filter/index.js +0 -2
- package/legacy/hooks/features/filter/useGridFilter.js +0 -378
- package/legacy/hooks/features/focus/gridFocusState.js +0 -1
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +0 -31
- package/legacy/hooks/features/focus/index.js +0 -2
- package/legacy/hooks/features/focus/useGridFocus.js +0 -408
- package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +0 -10
- package/legacy/hooks/features/headerFiltering/index.js +0 -1
- package/legacy/hooks/features/headerFiltering/useGridHeaderFiltering.js +0 -93
- package/legacy/hooks/features/index.js +0 -16
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +0 -565
- package/legacy/hooks/features/pagination/gridPaginationInterfaces.js +0 -1
- package/legacy/hooks/features/pagination/gridPaginationSelector.js +0 -115
- package/legacy/hooks/features/pagination/gridPaginationUtils.js +0 -31
- package/legacy/hooks/features/pagination/index.js +0 -2
- package/legacy/hooks/features/pagination/useGridPagination.js +0 -175
- package/legacy/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +0 -3
- package/legacy/hooks/features/preferencesPanel/gridPreferencePanelState.js +0 -1
- package/legacy/hooks/features/preferencesPanel/gridPreferencePanelsValue.js +0 -6
- package/legacy/hooks/features/preferencesPanel/index.js +0 -3
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +0 -125
- package/legacy/hooks/features/rowSelection/gridRowSelectionSelector.js +0 -19
- package/legacy/hooks/features/rowSelection/index.js +0 -1
- package/legacy/hooks/features/rowSelection/useGridRowSelection.js +0 -419
- package/legacy/hooks/features/rowSelection/useGridRowSelectionPreProcessors.js +0 -45
- package/legacy/hooks/features/rowSelection/utils.js +0 -8
- package/legacy/hooks/features/rows/gridRowsInterfaces.js +0 -1
- package/legacy/hooks/features/rows/gridRowsMetaSelector.js +0 -3
- package/legacy/hooks/features/rows/gridRowsMetaState.js +0 -1
- package/legacy/hooks/features/rows/gridRowsSelector.js +0 -90
- package/legacy/hooks/features/rows/gridRowsUtils.js +0 -294
- package/legacy/hooks/features/rows/index.js +0 -4
- package/legacy/hooks/features/rows/useGridParamsApi.js +0 -142
- package/legacy/hooks/features/rows/useGridRows.js +0 -466
- package/legacy/hooks/features/rows/useGridRowsMeta.js +0 -236
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +0 -82
- package/legacy/hooks/features/scroll/useGridScroll.js +0 -133
- package/legacy/hooks/features/sorting/gridSortingSelector.js +0 -56
- package/legacy/hooks/features/sorting/gridSortingState.js +0 -1
- package/legacy/hooks/features/sorting/gridSortingUtils.js +0 -154
- package/legacy/hooks/features/sorting/index.js +0 -2
- package/legacy/hooks/features/sorting/useGridSorting.js +0 -276
- package/legacy/hooks/features/statePersistence/gridStatePersistenceInterface.js +0 -1
- package/legacy/hooks/features/statePersistence/index.js +0 -1
- package/legacy/hooks/features/statePersistence/useGridStatePersistence.js +0 -25
- package/legacy/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -61
- package/legacy/hooks/features/virtualization/index.js +0 -2
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +0 -646
- package/legacy/hooks/features/virtualization/useGridVirtualization.js +0 -63
- package/legacy/hooks/index.js +0 -3
- package/legacy/hooks/utils/index.js +0 -9
- package/legacy/hooks/utils/useFirstRender.js +0 -8
- package/legacy/hooks/utils/useGridApiContext.js +0 -9
- package/legacy/hooks/utils/useGridApiEventHandler.js +0 -105
- package/legacy/hooks/utils/useGridApiMethod.js +0 -11
- package/legacy/hooks/utils/useGridApiRef.js +0 -7
- package/legacy/hooks/utils/useGridAriaAttributes.js +0 -25
- package/legacy/hooks/utils/useGridInitializeState.js +0 -8
- package/legacy/hooks/utils/useGridLogger.js +0 -10
- package/legacy/hooks/utils/useGridNativeEventListener.js +0 -32
- package/legacy/hooks/utils/useGridPrivateApiContext.js +0 -12
- package/legacy/hooks/utils/useGridRootProps.js +0 -9
- package/legacy/hooks/utils/useGridSelector.js +0 -54
- package/legacy/hooks/utils/useGridVisibleRows.js +0 -42
- package/legacy/hooks/utils/useLazyRef.js +0 -11
- package/legacy/hooks/utils/useOnMount.js +0 -7
- package/legacy/hooks/utils/useResizeObserver.js +0 -36
- package/legacy/hooks/utils/useRunOnce.js +0 -18
- package/legacy/hooks/utils/useTimeout.js +0 -38
- package/legacy/index.js +0 -38
- package/legacy/internals/index.js +0 -68
- package/legacy/internals/utils/computeSlots.js +0 -17
- package/legacy/internals/utils/index.js +0 -3
- package/legacy/internals/utils/propValidation.js +0 -21
- package/legacy/internals/utils/useProps.js +0 -32
- package/legacy/joy/icons.js +0 -432
- package/legacy/joy/index.js +0 -2
- package/legacy/joy/joySlots.js +0 -420
- package/legacy/locales/arSD.js +0 -160
- package/legacy/locales/beBY.js +0 -184
- package/legacy/locales/bgBG.js +0 -160
- package/legacy/locales/coreLocales.js +0 -62
- package/legacy/locales/csCZ.js +0 -181
- package/legacy/locales/daDK.js +0 -160
- package/legacy/locales/deDE.js +0 -160
- package/legacy/locales/elGR.js +0 -160
- package/legacy/locales/enUS.js +0 -4
- package/legacy/locales/esES.js +0 -160
- package/legacy/locales/faIR.js +0 -160
- package/legacy/locales/fiFI.js +0 -160
- package/legacy/locales/frFR.js +0 -160
- package/legacy/locales/heIL.js +0 -160
- package/legacy/locales/hrHR.js +0 -160
- package/legacy/locales/huHU.js +0 -160
- package/legacy/locales/index.js +0 -35
- package/legacy/locales/itIT.js +0 -160
- package/legacy/locales/jaJP.js +0 -160
- package/legacy/locales/koKR.js +0 -162
- package/legacy/locales/nbNO.js +0 -162
- package/legacy/locales/nlNL.js +0 -160
- package/legacy/locales/plPL.js +0 -163
- package/legacy/locales/ptBR.js +0 -160
- package/legacy/locales/ptPT.js +0 -160
- package/legacy/locales/roRO.js +0 -160
- package/legacy/locales/ruRU.js +0 -181
- package/legacy/locales/skSK.js +0 -181
- package/legacy/locales/svSE.js +0 -160
- package/legacy/locales/trTR.js +0 -161
- package/legacy/locales/ukUA.js +0 -182
- package/legacy/locales/urPK.js +0 -160
- package/legacy/locales/viVN.js +0 -160
- package/legacy/locales/zhCN.js +0 -160
- package/legacy/locales/zhHK.js +0 -160
- package/legacy/locales/zhTW.js +0 -160
- package/legacy/material/components/MUISelectOption.js +0 -14
- package/legacy/material/icons/GridColumnUnsortedIcon.js +0 -16
- package/legacy/material/icons/index.js +0 -89
- package/legacy/material/index.js +0 -69
- package/legacy/models/api/gridApiCommon.js +0 -1
- package/legacy/models/api/gridApiCommunity.js +0 -1
- package/legacy/models/api/gridCallbackDetails.js +0 -1
- package/legacy/models/api/gridColumnApi.js +0 -1
- package/legacy/models/api/gridColumnGroupingApi.js +0 -1
- package/legacy/models/api/gridColumnMenuApi.js +0 -1
- package/legacy/models/api/gridColumnSpanning.js +0 -1
- package/legacy/models/api/gridCoreApi.js +0 -1
- package/legacy/models/api/gridCsvExportApi.js +0 -1
- package/legacy/models/api/gridDensityApi.js +0 -1
- package/legacy/models/api/gridEditingApi.js +0 -1
- package/legacy/models/api/gridFilterApi.js +0 -1
- package/legacy/models/api/gridFocusApi.js +0 -1
- package/legacy/models/api/gridHeaderFilteringApi.js +0 -1
- package/legacy/models/api/gridLocaleTextApi.js +0 -1
- package/legacy/models/api/gridLoggerApi.js +0 -1
- package/legacy/models/api/gridParamsApi.js +0 -1
- package/legacy/models/api/gridPreferencesPanelApi.js +0 -1
- package/legacy/models/api/gridPrintExportApi.js +0 -1
- package/legacy/models/api/gridRowApi.js +0 -1
- package/legacy/models/api/gridRowSelectionApi.js +0 -1
- package/legacy/models/api/gridRowsMetaApi.js +0 -1
- package/legacy/models/api/gridScrollApi.js +0 -1
- package/legacy/models/api/gridSortApi.js +0 -1
- package/legacy/models/api/gridStateApi.js +0 -1
- package/legacy/models/api/gridVirtualizationApi.js +0 -1
- package/legacy/models/api/index.js +0 -16
- package/legacy/models/colDef/gridColDef.js +0 -1
- package/legacy/models/colDef/gridColType.js +0 -1
- package/legacy/models/colDef/gridColumnTypesRecord.js +0 -1
- package/legacy/models/colDef/index.js +0 -6
- package/legacy/models/controlStateItem.js +0 -1
- package/legacy/models/cursorCoordinates.js +0 -1
- package/legacy/models/elementSize.js +0 -1
- package/legacy/models/events/gridEventListener.js +0 -1
- package/legacy/models/events/gridEventLookup.js +0 -1
- package/legacy/models/events/gridEventPublisher.js +0 -1
- package/legacy/models/events/index.js +0 -3
- package/legacy/models/gridApiCaches.js +0 -1
- package/legacy/models/gridCell.js +0 -1
- package/legacy/models/gridCellClass.js +0 -1
- package/legacy/models/gridColumnGrouping.js +0 -11
- package/legacy/models/gridColumnHeaderClass.js +0 -1
- package/legacy/models/gridColumnSpanning.js +0 -1
- package/legacy/models/gridDensity.js +0 -1
- package/legacy/models/gridEditRowModel.js +0 -16
- package/legacy/models/gridExport.js +0 -1
- package/legacy/models/gridFeatureMode.js +0 -1
- package/legacy/models/gridFilterItem.js +0 -11
- package/legacy/models/gridFilterModel.js +0 -1
- package/legacy/models/gridFilterOperator.js +0 -1
- package/legacy/models/gridHeaderFilteringModel.js +0 -1
- package/legacy/models/gridIconSlotsComponent.js +0 -1
- package/legacy/models/gridPaginationProps.js +0 -1
- package/legacy/models/gridRenderContextProps.js +0 -1
- package/legacy/models/gridRowSelectionModel.js +0 -1
- package/legacy/models/gridRows.js +0 -1
- package/legacy/models/gridSlotsComponent.js +0 -1
- package/legacy/models/gridSlotsComponentsProps.js +0 -1
- package/legacy/models/gridSortModel.js +0 -1
- package/legacy/models/gridStateCommunity.js +0 -1
- package/legacy/models/index.js +0 -29
- package/legacy/models/logger.js +0 -1
- package/legacy/models/muiEvent.js +0 -1
- package/legacy/models/params/gridCellParams.js +0 -1
- package/legacy/models/params/gridColumnGroupHeaderParams.js +0 -1
- package/legacy/models/params/gridColumnHeaderParams.js +0 -1
- package/legacy/models/params/gridColumnOrderChangeParams.js +0 -1
- package/legacy/models/params/gridColumnResizeParams.js +0 -1
- package/legacy/models/params/gridEditCellParams.js +0 -27
- package/legacy/models/params/gridHeaderSelectionCheckboxParams.js +0 -1
- package/legacy/models/params/gridMenuParams.js +0 -1
- package/legacy/models/params/gridPreferencePanelParams.js +0 -1
- package/legacy/models/params/gridRowParams.js +0 -44
- package/legacy/models/params/gridRowSelectionCheckboxParams.js +0 -1
- package/legacy/models/params/gridScrollParams.js +0 -1
- package/legacy/models/params/gridValueOptionsParams.js +0 -1
- package/legacy/models/params/index.js +0 -13
- package/legacy/models/props/DataGridProps.js +0 -1
- package/legacy/themeAugmentation/index.js +0 -4
- package/legacy/themeAugmentation/overrides.js +0 -1
- package/legacy/themeAugmentation/props.js +0 -1
- package/legacy/utils/EventManager.js +0 -91
- package/legacy/utils/Store.js +0 -34
- package/legacy/utils/cleanupTracking/CleanupTracking.js +0 -1
- package/legacy/utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.js +0 -29
- package/legacy/utils/cleanupTracking/TimerBasedCleanupTracking.js +0 -52
- package/legacy/utils/createControllablePromise.js +0 -11
- package/legacy/utils/createSelector.js +0 -120
- package/legacy/utils/doesSupportPreventScroll.js +0 -13
- package/legacy/utils/domUtils.js +0 -49
- package/legacy/utils/exportAs.js +0 -40
- package/legacy/utils/fastMemo.js +0 -5
- package/legacy/utils/fastObjectShallowCompare.js +0 -32
- package/legacy/utils/getGridLocalization.js +0 -15
- package/legacy/utils/getPublicApiRef.js +0 -5
- package/legacy/utils/index.js +0 -1
- package/legacy/utils/keyboardUtils.js +0 -60
- package/legacy/utils/utils.js +0 -189
- package/legacy/utils/warning.js +0 -25
package/components/GridRow.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "
|
|
3
|
+
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "offsetTop", "offsetLeft", "dimensions", "renderContext", "focusedColumnIndex", "isFirstVisible", "isLastVisible", "isNotVisible", "focusedCell", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave", "onMouseOut", "onMouseOver"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -21,7 +21,6 @@ import { gridSortModelSelector } from '../hooks/features/sorting/gridSortingSele
|
|
|
21
21
|
import { gridRowMaximumTreeDepthSelector } from '../hooks/features/rows/gridRowsSelector';
|
|
22
22
|
import { gridColumnGroupsHeaderMaxDepthSelector } from '../hooks/features/columnGrouping/gridColumnGroupsSelector';
|
|
23
23
|
import { gridEditRowsStateSelector } from '../hooks/features/editing/gridEditingSelectors';
|
|
24
|
-
import { randomNumberBetween } from '../utils/utils';
|
|
25
24
|
import { PinnedPosition } from './cell/GridCell';
|
|
26
25
|
import { GridScrollbarFillerCell as ScrollbarFiller } from './GridScrollbarFillerCell';
|
|
27
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -65,16 +64,14 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
65
64
|
rowHeight,
|
|
66
65
|
className,
|
|
67
66
|
visibleColumns,
|
|
68
|
-
renderedColumns,
|
|
69
67
|
pinnedColumns,
|
|
70
|
-
|
|
68
|
+
offsetLeft,
|
|
71
69
|
dimensions,
|
|
72
|
-
|
|
70
|
+
renderContext,
|
|
71
|
+
focusedColumnIndex,
|
|
73
72
|
isFirstVisible,
|
|
74
73
|
isLastVisible,
|
|
75
|
-
focusedCellColumnIndexNotInRange,
|
|
76
74
|
isNotVisible,
|
|
77
|
-
focusedCell,
|
|
78
75
|
onClick,
|
|
79
76
|
onDoubleClick,
|
|
80
77
|
onMouseEnter,
|
|
@@ -95,6 +92,9 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
95
92
|
const handleRef = useForkRef(ref, refProp);
|
|
96
93
|
const rowNode = apiRef.current.getRowNode(rowId);
|
|
97
94
|
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
95
|
+
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
96
|
+
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < renderContext.firstColumnIndex;
|
|
97
|
+
const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >= renderContext.lastColumnIndex;
|
|
98
98
|
const ariaRowIndex = index + headerGroupingMaxDepth + 2; // 1 for the header row and 1 as it's 1-based
|
|
99
99
|
|
|
100
100
|
const ownerState = {
|
|
@@ -245,13 +245,14 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
245
245
|
});
|
|
246
246
|
rowClassNames.push(rootProps.getRowClassName(rowParams));
|
|
247
247
|
}
|
|
248
|
-
const randomNumber = randomNumberBetween(10000, 20, 80);
|
|
249
248
|
const getCell = (column, indexInSection, indexRelativeToAllColumns, sectionLength, pinnedPosition = PinnedPosition.NONE) => {
|
|
250
|
-
var _editRowsState$rowId$, _editRowsState$rowId;
|
|
249
|
+
var _cellColSpanInfo$cell, _cellColSpanInfo$cell2, _editRowsState$rowId$, _editRowsState$rowId;
|
|
251
250
|
const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, indexRelativeToAllColumns);
|
|
252
|
-
if (
|
|
251
|
+
if (cellColSpanInfo != null && cellColSpanInfo.spannedByColSpan) {
|
|
253
252
|
return null;
|
|
254
253
|
}
|
|
254
|
+
const width = (_cellColSpanInfo$cell = cellColSpanInfo == null ? void 0 : cellColSpanInfo.cellProps.width) != null ? _cellColSpanInfo$cell : column.computedWidth;
|
|
255
|
+
const colSpan = (_cellColSpanInfo$cell2 = cellColSpanInfo == null ? void 0 : cellColSpanInfo.cellProps.colSpan) != null ? _cellColSpanInfo$cell2 : 1;
|
|
255
256
|
let pinnedOffset;
|
|
256
257
|
// FIXME: Why is the switch check exhaustiveness not validated with typescript-eslint?
|
|
257
258
|
// eslint-disable-next-line default-case
|
|
@@ -263,26 +264,19 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
263
264
|
pinnedOffset = dimensions.columnsTotalWidth - columnPositions[indexRelativeToAllColumns] - column.computedWidth + scrollbarWidth;
|
|
264
265
|
break;
|
|
265
266
|
case PinnedPosition.NONE:
|
|
267
|
+
case PinnedPosition.VIRTUAL:
|
|
266
268
|
pinnedOffset = 0;
|
|
267
269
|
break;
|
|
268
270
|
}
|
|
269
271
|
if ((rowNode == null ? void 0 : rowNode.type) === 'skeletonRow') {
|
|
270
272
|
var _column$align;
|
|
271
|
-
const {
|
|
272
|
-
width
|
|
273
|
-
} = cellColSpanInfo.cellProps;
|
|
274
|
-
const contentWidth = Math.round(randomNumber());
|
|
275
273
|
return /*#__PURE__*/_jsx(slots.skeletonCell, {
|
|
276
274
|
width: width,
|
|
277
|
-
|
|
275
|
+
height: rowHeight,
|
|
278
276
|
field: column.field,
|
|
279
277
|
align: (_column$align = column.align) != null ? _column$align : 'left'
|
|
280
278
|
}, column.field);
|
|
281
279
|
}
|
|
282
|
-
const {
|
|
283
|
-
colSpan,
|
|
284
|
-
width
|
|
285
|
-
} = cellColSpanInfo.cellProps;
|
|
286
280
|
const editCellState = (_editRowsState$rowId$ = (_editRowsState$rowId = editRowsState[rowId]) == null ? void 0 : _editRowsState$rowId[column.field]) != null ? _editRowsState$rowId$ : null;
|
|
287
281
|
|
|
288
282
|
// when the cell is a reorder cell we are not allowing to reorder the col
|
|
@@ -292,10 +286,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
292
286
|
const canReorderColumn = !(disableColumnReorder || column.disableReorder);
|
|
293
287
|
const canReorderRow = rowReordering && !sortModel.length && treeDepth <= 1 && !isEditingRows;
|
|
294
288
|
const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
|
|
295
|
-
|
|
296
|
-
if (focusedCellColumnIndexNotInRange !== undefined && visibleColumns[focusedCellColumnIndexNotInRange].field === column.field) {
|
|
297
|
-
cellIsNotVisible = true;
|
|
298
|
-
}
|
|
289
|
+
const cellIsNotVisible = pinnedPosition === PinnedPosition.VIRTUAL;
|
|
299
290
|
return /*#__PURE__*/_jsx(slots.cell, _extends({
|
|
300
291
|
column: column,
|
|
301
292
|
width: width,
|
|
@@ -331,18 +322,16 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
331
322
|
});
|
|
332
323
|
const middleColumnsLength = visibleColumns.length - pinnedColumns.left.length - pinnedColumns.right.length;
|
|
333
324
|
const cells = [];
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
const indexInSection = indexRelativeToAllColumns - pinnedColumns.left.length;
|
|
345
|
-
cells.push(getCell(column, indexInSection, indexRelativeToAllColumns, middleColumnsLength));
|
|
325
|
+
if (hasVirtualFocusCellLeft) {
|
|
326
|
+
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength, PinnedPosition.VIRTUAL));
|
|
327
|
+
}
|
|
328
|
+
for (let i = renderContext.firstColumnIndex; i < renderContext.lastColumnIndex; i += 1) {
|
|
329
|
+
const column = visibleColumns[i];
|
|
330
|
+
const indexInSection = i - pinnedColumns.left.length;
|
|
331
|
+
cells.push(getCell(column, indexInSection, i, middleColumnsLength));
|
|
332
|
+
}
|
|
333
|
+
if (hasVirtualFocusCellRight) {
|
|
334
|
+
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength, PinnedPosition.VIRTUAL));
|
|
346
335
|
}
|
|
347
336
|
const eventHandlers = row ? {
|
|
348
337
|
onClick: publishClick,
|
|
@@ -368,7 +357,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
368
357
|
role: "presentation",
|
|
369
358
|
className: gridClasses.cellOffsetLeft,
|
|
370
359
|
style: {
|
|
371
|
-
width:
|
|
360
|
+
width: offsetLeft
|
|
372
361
|
}
|
|
373
362
|
}), cells, emptyCellWidth > 0 && /*#__PURE__*/_jsx(EmptyCell, {
|
|
374
363
|
width: emptyCellWidth
|
|
@@ -422,13 +411,11 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
422
411
|
width: PropTypes.number.isRequired
|
|
423
412
|
}).isRequired
|
|
424
413
|
}).isRequired,
|
|
425
|
-
firstColumnToRender: PropTypes.number.isRequired,
|
|
426
414
|
/**
|
|
427
415
|
* Determines which cell has focus.
|
|
428
416
|
* If `null`, no cell in this row has focus.
|
|
429
417
|
*/
|
|
430
|
-
|
|
431
|
-
focusedCellColumnIndexNotInRange: PropTypes.number,
|
|
418
|
+
focusedColumnIndex: PropTypes.number,
|
|
432
419
|
/**
|
|
433
420
|
* Index of the row in the whole sorted and filtered dataset.
|
|
434
421
|
* If some rows above have expanded children, this index also take those children into account.
|
|
@@ -436,19 +423,21 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
436
423
|
index: PropTypes.number.isRequired,
|
|
437
424
|
isFirstVisible: PropTypes.bool.isRequired,
|
|
438
425
|
isLastVisible: PropTypes.bool.isRequired,
|
|
439
|
-
isNotVisible: PropTypes.bool,
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
left: PropTypes.number.isRequired,
|
|
443
|
-
top: PropTypes.number.isRequired
|
|
444
|
-
}).isRequired,
|
|
426
|
+
isNotVisible: PropTypes.bool.isRequired,
|
|
427
|
+
offsetLeft: PropTypes.number.isRequired,
|
|
428
|
+
offsetTop: PropTypes.number,
|
|
445
429
|
onClick: PropTypes.func,
|
|
446
430
|
onDoubleClick: PropTypes.func,
|
|
447
431
|
onMouseEnter: PropTypes.func,
|
|
448
432
|
onMouseLeave: PropTypes.func,
|
|
449
433
|
pinnedColumns: PropTypes.object.isRequired,
|
|
450
|
-
|
|
451
|
-
|
|
434
|
+
renderContext: PropTypes.shape({
|
|
435
|
+
firstColumnIndex: PropTypes.number.isRequired,
|
|
436
|
+
firstRowIndex: PropTypes.number.isRequired,
|
|
437
|
+
lastColumnIndex: PropTypes.number.isRequired,
|
|
438
|
+
lastRowIndex: PropTypes.number.isRequired
|
|
439
|
+
}).isRequired,
|
|
440
|
+
row: PropTypes.object.isRequired,
|
|
452
441
|
rowHeight: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,
|
|
453
442
|
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
454
443
|
selected: PropTypes.bool.isRequired,
|
|
@@ -1,34 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import {
|
|
4
|
-
import { getDataGridUtilityClass as getClassName } from '../constants';
|
|
3
|
+
import { gridClasses } from '../constants';
|
|
5
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
5
|
const classes = {
|
|
7
|
-
root:
|
|
8
|
-
header:
|
|
9
|
-
borderTop:
|
|
10
|
-
pinnedRight:
|
|
6
|
+
root: gridClasses.scrollbarFiller,
|
|
7
|
+
header: gridClasses['scrollbarFiller--header'],
|
|
8
|
+
borderTop: gridClasses['scrollbarFiller--borderTop'],
|
|
9
|
+
pinnedRight: gridClasses['scrollbarFiller--pinnedRight']
|
|
11
10
|
};
|
|
12
|
-
const Style = styled('div')({
|
|
13
|
-
minWidth: 'calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))',
|
|
14
|
-
alignSelf: 'stretch',
|
|
15
|
-
[`&.${classes.borderTop}`]: {
|
|
16
|
-
borderTop: '1px solid var(--DataGrid-rowBorderColor)'
|
|
17
|
-
},
|
|
18
|
-
[`&.${classes.pinnedRight}`]: {
|
|
19
|
-
backgroundColor: 'var(--DataGrid-pinnedBackground)'
|
|
20
|
-
},
|
|
21
|
-
[`&.${classes.pinnedRight}:not(.${classes.header})`]: {
|
|
22
|
-
position: 'sticky',
|
|
23
|
-
right: 0
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
11
|
function GridScrollbarFillerCell({
|
|
27
12
|
header,
|
|
28
13
|
borderTop = true,
|
|
29
14
|
pinnedRight
|
|
30
15
|
}) {
|
|
31
|
-
return /*#__PURE__*/_jsx(
|
|
16
|
+
return /*#__PURE__*/_jsx("div", {
|
|
32
17
|
role: "presentation",
|
|
33
18
|
className: clsx(classes.root, header && classes.header, borderTop && classes.borderTop, pinnedRight && classes.pinnedRight)
|
|
34
19
|
});
|
|
@@ -20,6 +20,7 @@ export let PinnedPosition = /*#__PURE__*/function (PinnedPosition) {
|
|
|
20
20
|
PinnedPosition[PinnedPosition["NONE"] = 0] = "NONE";
|
|
21
21
|
PinnedPosition[PinnedPosition["LEFT"] = 1] = "LEFT";
|
|
22
22
|
PinnedPosition[PinnedPosition["RIGHT"] = 2] = "RIGHT";
|
|
23
|
+
PinnedPosition[PinnedPosition["VIRTUAL"] = 3] = "VIRTUAL";
|
|
23
24
|
return PinnedPosition;
|
|
24
25
|
}({});
|
|
25
26
|
const EMPTY_CELL_PARAMS = {
|
|
@@ -58,8 +59,7 @@ const useUtilityClasses = ownerState => {
|
|
|
58
59
|
classes
|
|
59
60
|
} = ownerState;
|
|
60
61
|
const slots = {
|
|
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']
|
|
62
|
-
content: ['cellContent']
|
|
62
|
+
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']
|
|
63
63
|
};
|
|
64
64
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
65
65
|
};
|
|
@@ -133,13 +133,19 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
133
133
|
classes: rootClasses,
|
|
134
134
|
getCellClassName
|
|
135
135
|
} = rootProps;
|
|
136
|
-
|
|
136
|
+
|
|
137
|
+
// There is a hidden grid state access in `applyPipeProcessor('cellClassName', ...)`
|
|
138
|
+
const pipesClassName = useGridSelector(apiRef, () => apiRef.current.unstable_applyPipeProcessors('cellClassName', [], {
|
|
137
139
|
id: rowId,
|
|
138
140
|
field
|
|
139
|
-
});
|
|
141
|
+
}).filter(Boolean).join(' '));
|
|
142
|
+
const classNames = [pipesClassName];
|
|
140
143
|
if (column.cellClassName) {
|
|
141
144
|
classNames.push(typeof column.cellClassName === 'function' ? column.cellClassName(cellParamsWithAPI) : column.cellClassName);
|
|
142
145
|
}
|
|
146
|
+
if (column.display === 'flex') {
|
|
147
|
+
classNames.push(gridClasses['cell--flex']);
|
|
148
|
+
}
|
|
143
149
|
if (getCellClassName) {
|
|
144
150
|
classNames.push(getCellClassName(cellParamsWithAPI));
|
|
145
151
|
}
|
|
@@ -248,12 +254,11 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
248
254
|
};
|
|
249
255
|
}
|
|
250
256
|
let children;
|
|
251
|
-
|
|
257
|
+
let title;
|
|
258
|
+
if (editCellState === null && column.renderCell) {
|
|
252
259
|
children = column.renderCell(cellParamsWithAPI);
|
|
253
|
-
classNames.push(gridClasses['cell--withRenderer']);
|
|
254
|
-
classNames.push(rootClasses == null ? void 0 : rootClasses['cell--withRenderer']);
|
|
255
260
|
}
|
|
256
|
-
if (editCellState
|
|
261
|
+
if (editCellState !== null && column.renderEditCell) {
|
|
257
262
|
const updatedRow = apiRef.current.getRowWithUpdatedValues(rowId, column.field);
|
|
258
263
|
|
|
259
264
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -267,12 +272,8 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
267
272
|
}
|
|
268
273
|
if (children === undefined) {
|
|
269
274
|
const valueString = valueToRender == null ? void 0 : valueToRender.toString();
|
|
270
|
-
children =
|
|
271
|
-
|
|
272
|
-
title: valueString,
|
|
273
|
-
role: "presentation",
|
|
274
|
-
children: valueString
|
|
275
|
-
});
|
|
275
|
+
children = valueString;
|
|
276
|
+
title = valueString;
|
|
276
277
|
}
|
|
277
278
|
if ( /*#__PURE__*/React.isValidElement(children) && canManageOwnFocus) {
|
|
278
279
|
children = /*#__PURE__*/React.cloneElement(children, {
|
|
@@ -292,6 +293,7 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
292
293
|
"aria-colindex": colIndex + 1,
|
|
293
294
|
"aria-colspan": colSpan,
|
|
294
295
|
style: style,
|
|
296
|
+
title: title,
|
|
295
297
|
tabIndex: tabIndex,
|
|
296
298
|
onClick: publish('cellClick', onClick),
|
|
297
299
|
onDoubleClick: publish('cellDoubleClick', onDoubleClick),
|
|
@@ -333,7 +335,7 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
333
335
|
onMouseDown: PropTypes.func,
|
|
334
336
|
onMouseUp: PropTypes.func,
|
|
335
337
|
pinnedOffset: PropTypes.number.isRequired,
|
|
336
|
-
pinnedPosition: PropTypes.oneOf([0, 1, 2]).isRequired,
|
|
338
|
+
pinnedPosition: PropTypes.oneOf([0, 1, 2, 3]).isRequired,
|
|
337
339
|
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
338
340
|
sectionIndex: PropTypes.number.isRequired,
|
|
339
341
|
sectionLength: PropTypes.number.isRequired,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface GridSkeletonCellProps {
|
|
3
3
|
width: number;
|
|
4
|
-
|
|
4
|
+
height: number | 'auto';
|
|
5
5
|
field: string;
|
|
6
6
|
align: string;
|
|
7
7
|
}
|
|
@@ -9,4 +9,5 @@ declare function GridSkeletonCell(props: React.HTMLAttributes<HTMLDivElement> &
|
|
|
9
9
|
declare namespace GridSkeletonCell {
|
|
10
10
|
var propTypes: any;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
declare const Memoized: typeof GridSkeletonCell;
|
|
13
|
+
export { Memoized as GridSkeletonCell };
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["field", "align", "width", "
|
|
3
|
+
const _excluded = ["field", "align", "width", "height"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import Skeleton from '@mui/material/Skeleton';
|
|
7
7
|
import { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize } from '@mui/utils';
|
|
8
|
+
import { fastMemo } from '../../utils/fastMemo';
|
|
9
|
+
import { randomNumberBetween } from '../../utils/utils';
|
|
8
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
9
11
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const randomWidth = randomNumberBetween(10000, 20, 80);
|
|
11
14
|
const useUtilityClasses = ownerState => {
|
|
12
15
|
const {
|
|
13
16
|
align,
|
|
@@ -22,7 +25,7 @@ function GridSkeletonCell(props) {
|
|
|
22
25
|
const {
|
|
23
26
|
align,
|
|
24
27
|
width,
|
|
25
|
-
|
|
28
|
+
height
|
|
26
29
|
} = props,
|
|
27
30
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
28
31
|
const rootProps = useGridRootProps();
|
|
@@ -31,14 +34,18 @@ function GridSkeletonCell(props) {
|
|
|
31
34
|
align
|
|
32
35
|
};
|
|
33
36
|
const classes = useUtilityClasses(ownerState);
|
|
37
|
+
const contentWidth = Math.round(randomWidth());
|
|
34
38
|
return /*#__PURE__*/_jsx("div", _extends({
|
|
35
39
|
className: classes.root,
|
|
36
40
|
style: {
|
|
37
|
-
|
|
41
|
+
height,
|
|
42
|
+
maxWidth: width,
|
|
43
|
+
minWidth: width
|
|
38
44
|
}
|
|
39
45
|
}, other, {
|
|
40
46
|
children: /*#__PURE__*/_jsx(Skeleton, {
|
|
41
|
-
width: `${contentWidth}
|
|
47
|
+
width: `${contentWidth}%`,
|
|
48
|
+
height: 25
|
|
42
49
|
})
|
|
43
50
|
}));
|
|
44
51
|
}
|
|
@@ -48,8 +55,9 @@ process.env.NODE_ENV !== "production" ? GridSkeletonCell.propTypes = {
|
|
|
48
55
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
49
56
|
// ----------------------------------------------------------------------
|
|
50
57
|
align: PropTypes.string.isRequired,
|
|
51
|
-
contentWidth: PropTypes.number.isRequired,
|
|
52
58
|
field: PropTypes.string.isRequired,
|
|
59
|
+
height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,
|
|
53
60
|
width: PropTypes.number.isRequired
|
|
54
61
|
} : void 0;
|
|
55
|
-
|
|
62
|
+
const Memoized = fastMemo(GridSkeletonCell);
|
|
63
|
+
export { Memoized as GridSkeletonCell };
|
|
@@ -4,7 +4,6 @@ const _excluded = ["field", "id", "value", "formattedValue", "row", "rowNode", "
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_composeClasses as composeClasses, unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
7
|
-
import { isSpaceKey } from '../../utils/keyboardUtils';
|
|
8
7
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
9
8
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
@@ -38,7 +37,6 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
38
37
|
const checkboxElement = React.useRef(null);
|
|
39
38
|
const rippleRef = React.useRef(null);
|
|
40
39
|
const handleRef = useForkRef(checkboxElement, ref);
|
|
41
|
-
const element = apiRef.current.getCellElement(id, field);
|
|
42
40
|
const handleChange = event => {
|
|
43
41
|
const params = {
|
|
44
42
|
value: event.target.checked,
|
|
@@ -47,10 +45,13 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
47
45
|
apiRef.current.publishEvent('rowSelectionCheckboxChange', params, event);
|
|
48
46
|
};
|
|
49
47
|
React.useLayoutEffect(() => {
|
|
50
|
-
if (tabIndex === 0
|
|
51
|
-
element
|
|
48
|
+
if (tabIndex === 0) {
|
|
49
|
+
const element = apiRef.current.getCellElement(id, field);
|
|
50
|
+
if (element) {
|
|
51
|
+
element.tabIndex = -1;
|
|
52
|
+
}
|
|
52
53
|
}
|
|
53
|
-
}, [
|
|
54
|
+
}, [apiRef, tabIndex, id, field]);
|
|
54
55
|
React.useEffect(() => {
|
|
55
56
|
if (hasFocus) {
|
|
56
57
|
var _checkboxElement$curr;
|
|
@@ -64,7 +65,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
64
65
|
}
|
|
65
66
|
}, [hasFocus]);
|
|
66
67
|
const handleKeyDown = React.useCallback(event => {
|
|
67
|
-
if (
|
|
68
|
+
if (event.key === ' ') {
|
|
68
69
|
// We call event.stopPropagation to avoid selecting the row and also scrolling to bottom
|
|
69
70
|
// TODO: Remove and add a check inside useGridKeyboardNavigation
|
|
70
71
|
event.stopPropagation();
|
|
@@ -156,7 +156,7 @@ function GridColumnsManagement(props) {
|
|
|
156
156
|
ownerState: rootProps,
|
|
157
157
|
children: apiRef.current.getLocaleText('columnsManagementNoColumns')
|
|
158
158
|
})]
|
|
159
|
-
}), !disableShowHideToggle
|
|
159
|
+
}), (!disableShowHideToggle || !disableResetButton) && currentColumns.length > 0 ? /*#__PURE__*/_jsxs(GridColumnsManagementFooter, {
|
|
160
160
|
ownerState: rootProps,
|
|
161
161
|
className: classes.footer,
|
|
162
162
|
children: [!disableShowHideToggle ? /*#__PURE__*/_jsx(FormControlLabel, {
|
|
@@ -47,6 +47,8 @@ export const GridRootStyles = styled('div', {
|
|
|
47
47
|
[`&.${c.autosizing}`]: styles.autosizing
|
|
48
48
|
}, {
|
|
49
49
|
[`& .${c.editBooleanCell}`]: styles.editBooleanCell
|
|
50
|
+
}, {
|
|
51
|
+
[`& .${c.cell}`]: styles.cell
|
|
50
52
|
}, {
|
|
51
53
|
[`& .${c['cell--editing']}`]: styles['cell--editing']
|
|
52
54
|
}, {
|
|
@@ -55,12 +57,6 @@ export const GridRootStyles = styled('div', {
|
|
|
55
57
|
[`& .${c['cell--textLeft']}`]: styles['cell--textLeft']
|
|
56
58
|
}, {
|
|
57
59
|
[`& .${c['cell--textRight']}`]: styles['cell--textRight']
|
|
58
|
-
},
|
|
59
|
-
// TODO v6: Remove
|
|
60
|
-
{
|
|
61
|
-
[`& .${c['cell--withRenderer']}`]: styles['cell--withRenderer']
|
|
62
|
-
}, {
|
|
63
|
-
[`& .${c.cell}`]: styles.cell
|
|
64
60
|
}, {
|
|
65
61
|
[`& .${c['cell--rangeTop']}`]: styles['cell--rangeTop']
|
|
66
62
|
}, {
|
|
@@ -71,8 +67,6 @@ export const GridRootStyles = styled('div', {
|
|
|
71
67
|
[`& .${c['cell--rangeRight']}`]: styles['cell--rangeRight']
|
|
72
68
|
}, {
|
|
73
69
|
[`& .${c['cell--withRightBorder']}`]: styles['cell--withRightBorder']
|
|
74
|
-
}, {
|
|
75
|
-
[`& .${c.cellContent}`]: styles.cellContent
|
|
76
70
|
}, {
|
|
77
71
|
[`& .${c.cellCheckbox}`]: styles.cellCheckbox
|
|
78
72
|
}, {
|
|
@@ -235,9 +229,21 @@ export const GridRootStyles = styled('div', {
|
|
|
235
229
|
[`& .${c.columnHeaderTitleContainerContent} > *`]: {
|
|
236
230
|
overflow: 'visible !important'
|
|
237
231
|
},
|
|
238
|
-
|
|
232
|
+
'@media (hover: hover)': {
|
|
233
|
+
[`& .${c.iconButtonContainer}`]: {
|
|
234
|
+
width: '0 !important',
|
|
235
|
+
visibility: 'hidden !important'
|
|
236
|
+
},
|
|
237
|
+
[`& .${c.menuIcon}`]: {
|
|
238
|
+
width: '0 !important',
|
|
239
|
+
visibility: 'hidden !important'
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
[`& .${c.cell}`]: {
|
|
239
243
|
overflow: 'visible !important',
|
|
240
|
-
whiteSpace: 'nowrap'
|
|
244
|
+
whiteSpace: 'nowrap',
|
|
245
|
+
minWidth: 'max-content !important',
|
|
246
|
+
maxWidth: 'max-content !important'
|
|
241
247
|
},
|
|
242
248
|
[`& .${c.groupingCriteriaCell}`]: {
|
|
243
249
|
width: 'unset'
|
|
@@ -335,7 +341,7 @@ export const GridRootStyles = styled('div', {
|
|
|
335
341
|
[`& .${c.columnSeparator}`]: {
|
|
336
342
|
visibility: 'hidden',
|
|
337
343
|
position: 'absolute',
|
|
338
|
-
zIndex:
|
|
344
|
+
zIndex: 3,
|
|
339
345
|
display: 'flex',
|
|
340
346
|
flexDirection: 'column',
|
|
341
347
|
justifyContent: 'center',
|
|
@@ -429,15 +435,19 @@ export const GridRootStyles = styled('div', {
|
|
|
429
435
|
},
|
|
430
436
|
/* Cell styles */
|
|
431
437
|
[`& .${c.cell}`]: {
|
|
432
|
-
display: 'flex',
|
|
433
|
-
alignItems: 'center',
|
|
434
438
|
height: 'var(--height)',
|
|
435
439
|
minWidth: 'var(--width)',
|
|
436
440
|
maxWidth: 'var(--width)',
|
|
441
|
+
lineHeight: 'calc(var(--height) - 1px)',
|
|
442
|
+
// -1px for the border
|
|
443
|
+
|
|
437
444
|
'--width': '0px',
|
|
438
445
|
'--height': '0px',
|
|
439
446
|
boxSizing: 'border-box',
|
|
440
447
|
borderTop: `1px solid var(--rowBorderColor)`,
|
|
448
|
+
overflow: 'hidden',
|
|
449
|
+
whiteSpace: 'nowrap',
|
|
450
|
+
textOverflow: 'ellipsis',
|
|
441
451
|
'&.Mui-selected': selectedStyles
|
|
442
452
|
},
|
|
443
453
|
[`& .${c['virtualScrollerContent--overflowed']} .${c['row--lastVisible']} .${c.cell}`]: {
|
|
@@ -446,12 +456,14 @@ export const GridRootStyles = styled('div', {
|
|
|
446
456
|
[`&.${c['root--disableUserSelection']} .${c.cell}`]: {
|
|
447
457
|
userSelect: 'none'
|
|
448
458
|
},
|
|
449
|
-
[`& .${c
|
|
450
|
-
overflow: '
|
|
451
|
-
whiteSpace: '
|
|
459
|
+
[`& .${c['row--dynamicHeight']} > .${c.cell}`]: {
|
|
460
|
+
overflow: 'initial',
|
|
461
|
+
whiteSpace: 'initial',
|
|
462
|
+
lineHeight: 'inherit'
|
|
452
463
|
},
|
|
453
464
|
[`& .${c.cellEmpty}`]: {
|
|
454
|
-
padding: 0
|
|
465
|
+
padding: 0,
|
|
466
|
+
height: 'unset'
|
|
455
467
|
},
|
|
456
468
|
[`& .${c.cell}.${c['cell--selectionMode']}`]: {
|
|
457
469
|
cursor: 'default'
|
|
@@ -466,10 +478,6 @@ export const GridRootStyles = styled('div', {
|
|
|
466
478
|
outlineOffset: '-1px'
|
|
467
479
|
}
|
|
468
480
|
},
|
|
469
|
-
[`& .${c.cellContent}`]: {
|
|
470
|
-
overflow: 'hidden',
|
|
471
|
-
textOverflow: 'ellipsis'
|
|
472
|
-
},
|
|
473
481
|
[`& .${c['row--editing']}`]: {
|
|
474
482
|
boxShadow: t.shadows[2]
|
|
475
483
|
},
|
|
@@ -508,6 +516,7 @@ export const GridRootStyles = styled('div', {
|
|
|
508
516
|
},
|
|
509
517
|
[`& .${c.rowReorderCellContainer}`]: {
|
|
510
518
|
padding: 0,
|
|
519
|
+
display: 'flex',
|
|
511
520
|
alignItems: 'stretch'
|
|
512
521
|
},
|
|
513
522
|
[`.${c.withBorderColor}`]: {
|
|
@@ -527,13 +536,21 @@ export const GridRootStyles = styled('div', {
|
|
|
527
536
|
borderRightWidth: '1px',
|
|
528
537
|
borderRightStyle: 'solid'
|
|
529
538
|
},
|
|
539
|
+
[`& .${c['cell--flex']}`]: {
|
|
540
|
+
display: 'flex',
|
|
541
|
+
alignItems: 'center',
|
|
542
|
+
lineHeight: 'inherit'
|
|
543
|
+
},
|
|
530
544
|
[`& .${c['cell--textLeft']}`]: {
|
|
545
|
+
textAlign: 'left',
|
|
531
546
|
justifyContent: 'flex-start'
|
|
532
547
|
},
|
|
533
548
|
[`& .${c['cell--textRight']}`]: {
|
|
549
|
+
textAlign: 'right',
|
|
534
550
|
justifyContent: 'flex-end'
|
|
535
551
|
},
|
|
536
552
|
[`& .${c['cell--textCenter']}`]: {
|
|
553
|
+
textAlign: 'center',
|
|
537
554
|
justifyContent: 'center'
|
|
538
555
|
},
|
|
539
556
|
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
@@ -562,6 +579,12 @@ export const GridRootStyles = styled('div', {
|
|
|
562
579
|
flex: '0 0 auto',
|
|
563
580
|
display: 'inline-block'
|
|
564
581
|
},
|
|
582
|
+
[`& .${c.cellSkeleton}`]: {
|
|
583
|
+
flex: '0 0 auto',
|
|
584
|
+
height: '100%',
|
|
585
|
+
display: 'inline-flex',
|
|
586
|
+
alignItems: 'center'
|
|
587
|
+
},
|
|
565
588
|
[`& .${c.columnHeaderDraggableContainer}`]: {
|
|
566
589
|
display: 'flex',
|
|
567
590
|
width: '100%',
|
|
@@ -604,6 +627,21 @@ export const GridRootStyles = styled('div', {
|
|
|
604
627
|
flex: '0 0 28px',
|
|
605
628
|
alignSelf: 'stretch',
|
|
606
629
|
marginRight: t.spacing(2)
|
|
630
|
+
},
|
|
631
|
+
/* ScrollbarFiller styles */
|
|
632
|
+
[`.${c.scrollbarFiller}`]: {
|
|
633
|
+
minWidth: 'calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))',
|
|
634
|
+
alignSelf: 'stretch',
|
|
635
|
+
[`&.${c['scrollbarFiller--borderTop']}`]: {
|
|
636
|
+
borderTop: '1px solid var(--DataGrid-rowBorderColor)'
|
|
637
|
+
},
|
|
638
|
+
[`&.${c['scrollbarFiller--pinnedRight']}`]: {
|
|
639
|
+
backgroundColor: 'var(--DataGrid-pinnedBackground)'
|
|
640
|
+
},
|
|
641
|
+
[`&.${c['scrollbarFiller--pinnedRight']}:not(.${c['scrollbarFiller--header']})`]: {
|
|
642
|
+
position: 'sticky',
|
|
643
|
+
right: 0
|
|
644
|
+
}
|
|
607
645
|
}
|
|
608
646
|
});
|
|
609
647
|
return gridStyle;
|
|
@@ -52,8 +52,14 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
52
52
|
if (!Array.isArray(item.value)) {
|
|
53
53
|
return [];
|
|
54
54
|
}
|
|
55
|
-
return item.value
|
|
56
|
-
|
|
55
|
+
return item.value.reduce((acc, value) => {
|
|
56
|
+
const resolvedValue = resolvedValueOptions.find(v => getOptionValue(v) === value);
|
|
57
|
+
if (resolvedValue != null) {
|
|
58
|
+
acc.push(resolvedValue);
|
|
59
|
+
}
|
|
60
|
+
return acc;
|
|
61
|
+
}, []);
|
|
62
|
+
}, [getOptionValue, item.value, resolvedValueOptions]);
|
|
57
63
|
const handleChange = React.useCallback((event, value) => {
|
|
58
64
|
applyValue(_extends({}, item, {
|
|
59
65
|
value: value.map(getOptionValue)
|