@mui/x-data-grid 8.0.0-alpha.1 → 8.0.0-alpha.10
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 +1903 -231
- package/DataGrid/DataGrid.js +20 -38
- package/DataGrid/useDataGridComponent.d.ts +2 -1
- package/DataGrid/useDataGridComponent.js +1 -1
- package/DataGrid/useDataGridProps.js +3 -3
- package/README.md +1 -1
- package/colDef/gridDateOperators.d.ts +2 -1
- package/colDef/gridNumericOperators.d.ts +4 -1
- package/components/GridApiContext.js +2 -0
- package/components/GridColumnHeaders.d.ts +1 -1
- package/components/GridColumnHeaders.js +4 -4
- package/components/GridConfigurationContext.js +2 -0
- package/components/GridFooter.d.ts +2 -1
- package/components/GridFooter.js +4 -4
- package/components/GridHeaders.js +2 -2
- package/components/GridLoadingOverlay.d.ts +1 -1
- package/components/GridLoadingOverlay.js +10 -8
- package/components/GridNoResultsOverlay.d.ts +2 -1
- package/components/GridNoResultsOverlay.js +4 -4
- package/components/GridNoRowsOverlay.d.ts +2 -1
- package/components/GridNoRowsOverlay.js +4 -4
- package/components/GridPagination.d.ts +1 -1
- package/components/GridPagination.js +7 -4
- package/components/GridRow.d.ts +6 -11
- package/components/GridRow.js +55 -87
- package/components/GridRowCount.d.ts +1 -1
- package/components/GridRowCount.js +3 -2
- package/components/GridScrollArea.js +2 -0
- package/components/GridSelectedRowCount.d.ts +4 -1
- package/components/GridSelectedRowCount.js +3 -2
- package/components/GridSkeletonLoadingOverlay.d.ts +1 -1
- package/components/GridSkeletonLoadingOverlay.js +22 -21
- package/components/base/GridOverlays.d.ts +4 -3
- package/components/base/GridOverlays.js +2 -24
- package/components/base/index.d.ts +0 -1
- package/components/base/index.js +1 -2
- package/components/cell/GridActionsCell.js +8 -1
- package/components/cell/GridActionsCellItem.d.ts +17 -10
- package/components/cell/GridActionsCellItem.js +9 -8
- package/components/cell/GridCell.d.ts +19 -23
- package/components/cell/GridCell.js +49 -92
- package/components/cell/GridEditDateCell.js +1 -1
- package/components/cell/GridEditInputCell.d.ts +1 -1
- package/components/cell/GridEditInputCell.js +73 -4
- package/components/cell/GridEditSingleSelectCell.js +2 -2
- package/components/cell/GridSkeletonCell.js +1 -2
- package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
- package/components/columnHeaders/GridBaseColumnHeaders.d.ts +1 -1
- package/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -5
- package/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +3 -3
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +20 -7
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -5
- package/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -1
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/components/columnHeaders/GridIconButtonContainer.d.ts +1 -1
- package/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/components/columnSelection/GridCellCheckboxRenderer.d.ts +2 -2
- package/components/columnSelection/GridCellCheckboxRenderer.js +11 -9
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/columnSelection/GridHeaderCheckbox.js +17 -9
- package/components/columnsManagement/GridColumnsManagement.d.ts +1 -1
- package/components/columnsManagement/GridColumnsManagement.js +50 -27
- package/components/containers/GridFooterContainer.d.ts +1 -1
- package/components/containers/GridFooterContainer.js +5 -3
- package/components/containers/GridOverlay.d.ts +1 -1
- package/components/containers/GridOverlay.js +5 -3
- package/components/containers/GridRoot.d.ts +2 -2
- package/components/containers/GridRoot.js +18 -8
- package/components/containers/GridRootStyles.js +160 -50
- package/components/containers/GridToolbarContainer.d.ts +1 -1
- package/components/containers/GridToolbarContainer.js +3 -2
- package/components/menu/columnMenu/GridColumnMenu.d.ts +2 -2
- package/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/components/menu/columnMenu/GridColumnMenuContainer.d.ts +1 -1
- package/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/components/panel/GridColumnsPanel.js +1 -2
- package/components/panel/GridPanel.d.ts +2 -2
- package/components/panel/GridPanel.js +5 -3
- package/components/panel/GridPanelContent.js +7 -3
- package/components/panel/GridPanelFooter.d.ts +1 -1
- package/components/panel/GridPanelFooter.js +4 -3
- package/components/panel/GridPanelWrapper.d.ts +1 -1
- package/components/panel/GridPanelWrapper.js +5 -3
- package/components/panel/filterPanel/GridFilterForm.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +22 -18
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +4 -11
- package/components/panel/filterPanel/GridFilterInputBoolean.js +41 -31
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +3 -9
- package/components/panel/filterPanel/GridFilterInputDate.js +50 -31
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +3 -3
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +49 -24
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +3 -3
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +55 -33
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +3 -9
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +34 -25
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +3 -9
- package/components/panel/filterPanel/GridFilterInputValue.js +63 -38
- package/components/panel/filterPanel/GridFilterPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/components/panel/filterPanel/index.d.ts +2 -2
- package/components/panel/filterPanel/index.js +1 -2
- package/components/toolbar/GridToolbar.d.ts +1 -1
- package/components/toolbar/GridToolbar.js +11 -5
- package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
- package/components/toolbar/GridToolbarColumnsButton.js +12 -6
- package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.js +9 -11
- package/components/toolbar/GridToolbarExport.d.ts +1 -1
- package/components/toolbar/GridToolbarExport.js +2 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/components/toolbar/GridToolbarExportContainer.js +6 -6
- package/components/toolbar/GridToolbarFilterButton.d.ts +3 -1
- package/components/toolbar/GridToolbarFilterButton.js +20 -9
- package/components/toolbar/GridToolbarQuickFilter.d.ts +6 -2
- package/components/toolbar/GridToolbarQuickFilter.js +39 -31
- package/components/virtualization/GridMainContainer.d.ts +13 -1
- package/components/virtualization/GridMainContainer.js +14 -5
- package/components/virtualization/GridVirtualScrollbar.d.ts +5 -1
- package/components/virtualization/GridVirtualScrollbar.js +17 -17
- package/components/virtualization/GridVirtualScroller.js +27 -12
- package/components/virtualization/GridVirtualScrollerContent.d.ts +2 -0
- package/components/virtualization/GridVirtualScrollerContent.js +15 -6
- package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +2 -0
- package/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/constants/dataGridPropsDefaultValues.js +2 -4
- package/constants/gridClasses.d.ts +12 -12
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +1 -1
- package/context/GridContextProvider.d.ts +2 -1
- package/context/GridRootPropsContext.js +2 -0
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +9 -2
- package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +25 -9
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +5 -1
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +2 -2
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +5 -8
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/hooks/core/useGridApiInitialization.d.ts +2 -2
- package/hooks/core/useGridApiInitialization.js +2 -2
- package/hooks/core/useGridInitialization.d.ts +2 -2
- package/hooks/core/useGridIsRtl.d.ts +2 -2
- package/hooks/core/useGridLocaleText.d.ts +2 -2
- package/hooks/core/useGridLoggerFactory.d.ts +2 -2
- package/hooks/core/useGridRefs.d.ts +2 -2
- package/hooks/core/useGridStateInitialization.d.ts +2 -2
- package/hooks/core/useGridStateInitialization.js +3 -3
- package/hooks/features/clipboard/useGridClipboard.d.ts +2 -2
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +4 -4
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +2 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +5 -7
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +33 -68
- package/hooks/features/columnMenu/useGridColumnMenu.d.ts +2 -2
- package/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/hooks/features/columnResize/columnResizeSelector.d.ts +1 -1
- package/hooks/features/columnResize/gridColumnResizeApi.d.ts +6 -0
- package/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/hooks/features/columnResize/useGridColumnResize.d.ts +2 -2
- package/hooks/features/columnResize/useGridColumnResize.js +17 -10
- package/hooks/features/columns/gridColumnsSelector.d.ts +12 -12
- package/hooks/features/columns/gridColumnsUtils.d.ts +4 -4
- package/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/hooks/features/columns/useGridColumnSpanning.d.ts +2 -2
- package/hooks/features/columns/useGridColumns.d.ts +2 -2
- package/hooks/features/columns/useGridColumns.js +7 -3
- package/hooks/features/density/densitySelector.d.ts +1 -1
- package/hooks/features/density/useGridDensity.d.ts +2 -2
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +0 -4
- package/hooks/features/dimensions/useGridDimensions.d.ts +2 -2
- package/hooks/features/dimensions/useGridDimensions.js +11 -32
- package/hooks/features/editing/gridEditingSelectors.d.ts +6 -0
- package/hooks/features/editing/gridEditingSelectors.js +7 -1
- package/hooks/features/editing/useGridCellEditing.d.ts +2 -2
- package/hooks/features/editing/useGridCellEditing.js +4 -4
- package/hooks/features/editing/useGridEditing.d.ts +2 -2
- package/hooks/features/editing/useGridRowEditing.d.ts +2 -2
- package/hooks/features/editing/useGridRowEditing.js +7 -8
- package/hooks/features/events/useGridEvents.d.ts +2 -2
- package/hooks/features/export/serializers/csvSerializer.d.ts +2 -1
- package/hooks/features/export/useGridCsvExport.d.ts +2 -2
- package/hooks/features/export/useGridPrintExport.d.ts +2 -2
- package/hooks/features/export/useGridPrintExport.js +1 -1
- package/hooks/features/export/utils.d.ts +2 -2
- package/hooks/features/filter/gridFilterSelector.d.ts +17 -17
- package/hooks/features/filter/gridFilterSelector.js +6 -1
- package/hooks/features/filter/gridFilterUtils.d.ts +7 -7
- package/hooks/features/filter/gridFilterUtils.js +3 -3
- package/hooks/features/filter/useGridFilter.d.ts +2 -2
- package/hooks/features/filter/useGridFilter.js +1 -1
- package/hooks/features/focus/gridFocusStateSelector.d.ts +8 -8
- package/hooks/features/focus/useGridFocus.d.ts +2 -2
- package/hooks/features/focus/useGridFocus.js +3 -2
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +2 -2
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +1 -0
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +2 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -16
- package/hooks/features/keyboardNavigation/utils.d.ts +3 -4
- package/hooks/features/keyboardNavigation/utils.js +0 -5
- package/hooks/features/listView/gridListViewSelectors.d.ts +3 -1
- package/hooks/features/listView/gridListViewSelectors.js +3 -1
- package/hooks/features/listView/index.d.ts +1 -0
- package/hooks/features/listView/index.js +1 -0
- package/hooks/features/listView/useGridListView.d.ts +2 -2
- package/hooks/features/listView/useGridListView.js +2 -1
- package/hooks/features/overlays/useGridOverlays.d.ts +7 -4
- package/hooks/features/overlays/useGridOverlays.js +22 -2
- package/hooks/features/pagination/gridPaginationInterfaces.d.ts +3 -0
- package/hooks/features/pagination/gridPaginationSelector.d.ts +34 -9
- package/hooks/features/pagination/gridPaginationSelector.js +39 -1
- package/hooks/features/pagination/useGridPagination.d.ts +3 -3
- package/hooks/features/pagination/useGridPagination.js +5 -3
- package/hooks/features/pagination/useGridPaginationMeta.d.ts +2 -2
- package/hooks/features/pagination/useGridPaginationModel.d.ts +2 -2
- package/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/hooks/features/pagination/useGridRowCount.d.ts +2 -2
- package/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +1 -0
- package/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
- package/hooks/features/preferencesPanel/index.d.ts +1 -1
- package/hooks/features/preferencesPanel/index.js +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +2 -2
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +2 -2
- package/hooks/features/rowSelection/useGridRowSelection.js +8 -16
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +2 -2
- package/hooks/features/rowSelection/utils.d.ts +4 -3
- package/hooks/features/rowSelection/utils.js +2 -2
- package/hooks/features/rows/gridRowSpanningSelectors.d.ts +3 -3
- package/hooks/features/rows/gridRowSpanningUtils.d.ts +2 -2
- package/hooks/features/rows/gridRowsInterfaces.d.ts +1 -8
- package/hooks/features/rows/gridRowsSelector.d.ts +23 -13
- package/hooks/features/rows/gridRowsSelector.js +1 -2
- package/hooks/features/rows/gridRowsUtils.d.ts +4 -4
- package/hooks/features/rows/gridRowsUtils.js +0 -9
- package/hooks/features/rows/index.d.ts +1 -1
- package/hooks/features/rows/index.js +1 -1
- package/hooks/features/rows/useGridParamsApi.d.ts +2 -2
- package/hooks/features/rows/useGridParamsApi.js +33 -14
- package/hooks/features/rows/useGridRowSpanning.d.ts +2 -2
- package/hooks/features/rows/useGridRowSpanning.js +97 -86
- package/hooks/features/rows/useGridRows.d.ts +2 -2
- package/hooks/features/rows/useGridRows.js +23 -27
- package/hooks/features/rows/useGridRowsMeta.d.ts +2 -2
- package/hooks/features/rows/useGridRowsMeta.js +3 -2
- package/hooks/features/rows/useGridRowsPreProcessors.d.ts +2 -2
- package/hooks/features/scroll/useGridScroll.d.ts +2 -2
- package/hooks/features/sorting/gridSortingSelector.d.ts +10 -5
- package/hooks/features/sorting/gridSortingSelector.js +11 -0
- package/hooks/features/sorting/gridSortingUtils.d.ts +3 -3
- package/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/hooks/features/sorting/index.d.ts +2 -1
- package/hooks/features/sorting/index.js +1 -1
- package/hooks/features/sorting/useGridSorting.d.ts +2 -2
- package/hooks/features/sorting/useGridSorting.js +1 -1
- package/hooks/features/statePersistence/useGridStatePersistence.d.ts +2 -2
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +6 -0
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +33 -0
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +5 -5
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +15 -6
- package/hooks/features/virtualization/useGridVirtualScroller.js +169 -94
- package/hooks/features/virtualization/useGridVirtualization.d.ts +2 -2
- package/hooks/utils/useGridApiContext.d.ts +2 -2
- package/hooks/utils/useGridApiEventHandler.d.ts +4 -4
- package/hooks/utils/useGridApiEventHandler.js +1 -1
- package/hooks/utils/useGridApiMethod.d.ts +2 -2
- package/hooks/utils/useGridApiRef.d.ts +2 -2
- package/hooks/utils/useGridApiRef.js +1 -1
- package/hooks/utils/useGridInitializeState.d.ts +3 -3
- package/hooks/utils/useGridLogger.d.ts +2 -2
- package/hooks/utils/useGridNativeEventListener.d.ts +2 -1
- package/hooks/utils/useGridPrivateApiContext.d.ts +2 -1
- package/hooks/utils/useGridSelector.d.ts +5 -7
- package/hooks/utils/useGridSelector.js +6 -44
- package/hooks/utils/useGridVisibleRows.d.ts +8 -6
- package/hooks/utils/useGridVisibleRows.js +5 -28
- package/index.js +1 -1
- package/internals/constants.d.ts +6 -0
- package/internals/constants.js +8 -1
- package/internals/index.d.ts +6 -4
- package/internals/index.js +4 -3
- package/internals/utils/attachPinnedStyle.d.ts +2 -0
- package/internals/utils/attachPinnedStyle.js +9 -0
- package/internals/utils/getPinnedCellOffset.d.ts +3 -3
- package/internals/utils/getPinnedCellOffset.js +6 -7
- package/internals/utils/index.d.ts +1 -1
- package/internals/utils/index.js +2 -2
- package/locales/arSD.js +2 -1
- package/locales/beBY.js +1 -1
- package/locales/bgBG.js +2 -1
- package/locales/csCZ.js +2 -1
- package/locales/daDK.js +2 -1
- package/locales/deDE.js +12 -13
- package/locales/elGR.js +2 -1
- package/locales/esES.js +12 -13
- package/locales/faIR.js +7 -7
- package/locales/fiFI.js +2 -1
- package/locales/frFR.js +2 -1
- package/locales/heIL.js +16 -17
- package/locales/hrHR.js +2 -1
- package/locales/huHU.js +2 -1
- package/locales/isIS.js +2 -1
- package/locales/itIT.js +2 -1
- package/locales/jaJP.js +2 -1
- package/locales/koKR.js +46 -49
- package/locales/nbNO.js +2 -1
- package/locales/nlNL.js +7 -7
- package/locales/nnNO.js +2 -1
- package/locales/plPL.js +2 -1
- package/locales/ptBR.js +12 -13
- package/locales/ptPT.js +12 -13
- package/locales/roRO.js +20 -21
- package/locales/ruRU.js +2 -1
- package/locales/skSK.js +2 -1
- package/locales/svSE.js +2 -1
- package/locales/trTR.js +14 -15
- package/locales/ukUA.js +2 -1
- package/locales/urPK.js +11 -11
- package/locales/viVN.js +2 -1
- package/locales/zhCN.js +12 -13
- package/locales/zhHK.js +2 -1
- package/locales/zhTW.js +2 -1
- package/material/index.js +58 -7
- package/models/api/gridApiCommon.d.ts +2 -2
- package/models/api/gridCoreApi.d.ts +7 -7
- package/models/api/gridDensityApi.d.ts +1 -1
- package/models/api/gridLocaleTextApi.d.ts +1 -1
- package/models/api/gridParamsApi.d.ts +29 -2
- package/models/api/gridStateApi.d.ts +1 -1
- package/models/api/index.d.ts +1 -1
- package/models/api/index.js +0 -1
- package/models/colDef/gridColDef.d.ts +34 -33
- package/models/controlStateItem.d.ts +2 -2
- package/models/events/gridEventLookup.d.ts +7 -1
- package/models/gridBaseSlots.d.ts +95 -0
- package/models/gridDataSource.d.ts +1 -1
- package/models/gridExport.d.ts +2 -2
- package/models/gridFilterInputComponent.d.ts +32 -0
- package/models/gridFilterOperator.d.ts +6 -4
- package/models/gridIconSlotsComponent.d.ts +5 -0
- package/models/gridSlotsComponent.d.ts +16 -1
- package/models/gridSlotsComponentsProps.d.ts +45 -9
- package/models/gridStateCommunity.d.ts +4 -0
- package/models/index.d.ts +1 -0
- package/models/props/DataGridProps.d.ts +12 -24
- package/modern/DataGrid/DataGrid.js +20 -38
- package/modern/DataGrid/useDataGridComponent.js +1 -1
- package/modern/DataGrid/useDataGridProps.js +3 -3
- package/modern/components/GridApiContext.js +2 -0
- package/modern/components/GridColumnHeaders.js +4 -4
- package/modern/components/GridConfigurationContext.js +2 -0
- package/modern/components/GridFooter.js +4 -4
- package/modern/components/GridHeaders.js +2 -2
- package/modern/components/GridLoadingOverlay.js +10 -8
- package/modern/components/GridNoResultsOverlay.js +4 -4
- package/modern/components/GridNoRowsOverlay.js +4 -4
- package/modern/components/GridPagination.js +7 -4
- package/modern/components/GridRow.js +55 -87
- package/modern/components/GridRowCount.js +3 -2
- package/modern/components/GridScrollArea.js +2 -0
- package/modern/components/GridSelectedRowCount.js +3 -2
- package/modern/components/GridSkeletonLoadingOverlay.js +22 -21
- package/modern/components/base/GridOverlays.js +2 -24
- package/modern/components/base/index.js +1 -2
- package/modern/components/cell/GridActionsCell.js +8 -1
- package/modern/components/cell/GridActionsCellItem.js +9 -8
- package/modern/components/cell/GridCell.js +49 -92
- package/modern/components/cell/GridEditDateCell.js +1 -1
- package/modern/components/cell/GridEditInputCell.js +73 -4
- package/modern/components/cell/GridEditSingleSelectCell.js +2 -2
- package/modern/components/cell/GridSkeletonCell.js +1 -2
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +20 -7
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/modern/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/modern/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +11 -9
- package/modern/components/columnSelection/GridHeaderCheckbox.js +17 -9
- package/modern/components/columnsManagement/GridColumnsManagement.js +50 -27
- package/modern/components/containers/GridFooterContainer.js +5 -3
- package/modern/components/containers/GridOverlay.js +5 -3
- package/modern/components/containers/GridRoot.js +18 -8
- package/modern/components/containers/GridRootStyles.js +160 -50
- package/modern/components/containers/GridToolbarContainer.js +3 -2
- package/modern/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/modern/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/modern/components/panel/GridColumnsPanel.js +1 -2
- package/modern/components/panel/GridPanel.js +5 -3
- package/modern/components/panel/GridPanelContent.js +7 -3
- package/modern/components/panel/GridPanelFooter.js +4 -3
- package/modern/components/panel/GridPanelWrapper.js +5 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +22 -18
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +41 -31
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +50 -31
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +49 -24
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +55 -33
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +34 -25
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +63 -38
- package/modern/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/modern/components/panel/filterPanel/index.js +1 -2
- package/modern/components/toolbar/GridToolbar.js +11 -5
- package/modern/components/toolbar/GridToolbarColumnsButton.js +12 -6
- package/modern/components/toolbar/GridToolbarDensitySelector.js +9 -11
- package/modern/components/toolbar/GridToolbarExport.js +2 -1
- package/modern/components/toolbar/GridToolbarExportContainer.js +6 -6
- package/modern/components/toolbar/GridToolbarFilterButton.js +20 -9
- package/modern/components/toolbar/GridToolbarQuickFilter.js +39 -31
- package/modern/components/virtualization/GridMainContainer.js +14 -5
- package/modern/components/virtualization/GridVirtualScrollbar.js +17 -17
- package/modern/components/virtualization/GridVirtualScroller.js +27 -12
- package/modern/components/virtualization/GridVirtualScrollerContent.js +15 -6
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/modern/constants/dataGridPropsDefaultValues.js +2 -4
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +1 -1
- package/modern/context/GridRootPropsContext.js +2 -0
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/modern/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +5 -1
- package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/modern/hooks/core/useGridApiInitialization.js +2 -2
- package/modern/hooks/core/useGridStateInitialization.js +3 -3
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +33 -68
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/modern/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/modern/hooks/features/columnResize/useGridColumnResize.js +17 -10
- package/modern/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/modern/hooks/features/columns/useGridColumns.js +7 -3
- package/modern/hooks/features/dimensions/useGridDimensions.js +11 -32
- package/modern/hooks/features/editing/gridEditingSelectors.js +7 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +4 -4
- package/modern/hooks/features/editing/useGridRowEditing.js +7 -8
- package/modern/hooks/features/export/useGridPrintExport.js +1 -1
- package/modern/hooks/features/filter/gridFilterSelector.js +6 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +3 -3
- package/modern/hooks/features/filter/useGridFilter.js +1 -1
- package/modern/hooks/features/focus/useGridFocus.js +3 -2
- package/modern/hooks/features/index.js +1 -0
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -16
- package/modern/hooks/features/keyboardNavigation/utils.js +0 -5
- package/modern/hooks/features/listView/gridListViewSelectors.js +3 -1
- package/modern/hooks/features/listView/index.js +1 -0
- package/modern/hooks/features/listView/useGridListView.js +2 -1
- package/modern/hooks/features/overlays/useGridOverlays.js +22 -2
- package/modern/hooks/features/pagination/gridPaginationSelector.js +39 -1
- package/modern/hooks/features/pagination/useGridPagination.js +5 -3
- package/modern/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/modern/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
- package/modern/hooks/features/preferencesPanel/index.js +1 -1
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +8 -16
- package/modern/hooks/features/rowSelection/utils.js +2 -2
- package/modern/hooks/features/rows/gridRowsSelector.js +1 -2
- package/modern/hooks/features/rows/gridRowsUtils.js +0 -9
- package/modern/hooks/features/rows/index.js +1 -1
- package/modern/hooks/features/rows/useGridParamsApi.js +33 -14
- package/modern/hooks/features/rows/useGridRowSpanning.js +97 -86
- package/modern/hooks/features/rows/useGridRows.js +23 -27
- package/modern/hooks/features/rows/useGridRowsMeta.js +3 -2
- package/modern/hooks/features/sorting/gridSortingSelector.js +11 -0
- package/modern/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/modern/hooks/features/sorting/index.js +1 -1
- package/modern/hooks/features/sorting/useGridSorting.js +1 -1
- package/modern/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +33 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +169 -94
- package/modern/hooks/utils/useGridApiEventHandler.js +1 -1
- package/modern/hooks/utils/useGridApiRef.js +1 -1
- package/modern/hooks/utils/useGridSelector.js +6 -44
- package/modern/hooks/utils/useGridVisibleRows.js +5 -28
- package/modern/index.js +1 -1
- package/modern/internals/constants.js +8 -1
- package/modern/internals/index.js +4 -3
- package/modern/internals/utils/attachPinnedStyle.js +9 -0
- package/modern/internals/utils/getPinnedCellOffset.js +6 -7
- package/modern/internals/utils/index.js +2 -2
- package/modern/locales/arSD.js +2 -1
- package/modern/locales/beBY.js +1 -1
- package/modern/locales/bgBG.js +2 -1
- package/modern/locales/csCZ.js +2 -1
- package/modern/locales/daDK.js +2 -1
- package/modern/locales/deDE.js +12 -13
- package/modern/locales/elGR.js +2 -1
- package/modern/locales/esES.js +12 -13
- package/modern/locales/faIR.js +7 -7
- package/modern/locales/fiFI.js +2 -1
- package/modern/locales/frFR.js +2 -1
- package/modern/locales/heIL.js +16 -17
- package/modern/locales/hrHR.js +2 -1
- package/modern/locales/huHU.js +2 -1
- package/modern/locales/isIS.js +2 -1
- package/modern/locales/itIT.js +2 -1
- package/modern/locales/jaJP.js +2 -1
- package/modern/locales/koKR.js +46 -49
- package/modern/locales/nbNO.js +2 -1
- package/modern/locales/nlNL.js +7 -7
- package/modern/locales/nnNO.js +2 -1
- package/modern/locales/plPL.js +2 -1
- package/modern/locales/ptBR.js +12 -13
- package/modern/locales/ptPT.js +12 -13
- package/modern/locales/roRO.js +20 -21
- package/modern/locales/ruRU.js +2 -1
- package/modern/locales/skSK.js +2 -1
- package/modern/locales/svSE.js +2 -1
- package/modern/locales/trTR.js +14 -15
- package/modern/locales/ukUA.js +2 -1
- package/modern/locales/urPK.js +11 -11
- package/modern/locales/viVN.js +2 -1
- package/modern/locales/zhCN.js +12 -13
- package/modern/locales/zhHK.js +2 -1
- package/modern/locales/zhTW.js +2 -1
- package/modern/material/index.js +58 -7
- package/modern/models/api/index.js +0 -1
- package/modern/models/gridBaseSlots.js +1 -0
- package/modern/models/gridFilterInputComponent.js +1 -0
- package/modern/utils/assert.js +3 -0
- package/modern/utils/cellBorderUtils.js +5 -5
- package/modern/utils/createSelector.js +1 -120
- package/modern/utils/domUtils.js +7 -2
- package/modern/utils/isJSDOM.js +1 -0
- package/modern/utils/roundToDecimalPlaces.js +3 -0
- package/modern/utils/rtlFlipSide.js +22 -0
- package/modern/utils/utils.js +6 -1
- package/node/DataGrid/DataGrid.js +18 -36
- package/node/DataGrid/useDataGridComponent.js +1 -1
- package/node/DataGrid/useDataGridProps.js +2 -2
- package/node/components/GridApiContext.js +1 -0
- package/node/components/GridColumnHeaders.js +4 -4
- package/node/components/GridConfigurationContext.js +1 -0
- package/node/components/GridFooter.js +4 -4
- package/node/components/GridHeaders.js +2 -2
- package/node/components/GridLoadingOverlay.js +10 -8
- package/node/components/GridNoResultsOverlay.js +4 -4
- package/node/components/GridNoRowsOverlay.js +4 -4
- package/node/components/GridPagination.js +7 -4
- package/node/components/GridRow.js +51 -84
- package/node/components/GridRowCount.js +3 -2
- package/node/components/GridScrollArea.js +1 -0
- package/node/components/GridSelectedRowCount.js +3 -2
- package/node/components/GridSkeletonLoadingOverlay.js +21 -20
- package/node/components/base/GridOverlays.js +2 -24
- package/node/components/base/index.js +0 -11
- package/node/components/cell/GridActionsCell.js +8 -1
- package/node/components/cell/GridActionsCellItem.js +7 -8
- package/node/components/cell/GridCell.js +48 -91
- package/node/components/cell/GridEditDateCell.js +1 -1
- package/node/components/cell/GridEditInputCell.js +73 -4
- package/node/components/cell/GridEditSingleSelectCell.js +2 -2
- package/node/components/cell/GridSkeletonCell.js +1 -2
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/node/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +19 -6
- package/node/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/node/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +10 -8
- package/node/components/columnSelection/GridHeaderCheckbox.js +17 -9
- package/node/components/columnsManagement/GridColumnsManagement.js +50 -27
- package/node/components/containers/GridFooterContainer.js +5 -3
- package/node/components/containers/GridOverlay.js +5 -3
- package/node/components/containers/GridRoot.js +17 -7
- package/node/components/containers/GridRootStyles.js +160 -50
- package/node/components/containers/GridToolbarContainer.js +3 -2
- package/node/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/node/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/node/components/panel/GridColumnsPanel.js +1 -2
- package/node/components/panel/GridPanel.js +5 -3
- package/node/components/panel/GridPanelContent.js +7 -3
- package/node/components/panel/GridPanelFooter.js +5 -4
- package/node/components/panel/GridPanelWrapper.js +5 -3
- package/node/components/panel/filterPanel/GridFilterForm.js +22 -18
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +42 -33
- package/node/components/panel/filterPanel/GridFilterInputDate.js +49 -30
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +49 -24
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +55 -33
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +34 -25
- package/node/components/panel/filterPanel/GridFilterInputValue.js +62 -37
- package/node/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/node/components/panel/filterPanel/index.js +7 -23
- package/node/components/toolbar/GridToolbar.js +11 -5
- package/node/components/toolbar/GridToolbarColumnsButton.js +12 -6
- package/node/components/toolbar/GridToolbarDensitySelector.js +9 -11
- package/node/components/toolbar/GridToolbarExport.js +2 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +6 -6
- package/node/components/toolbar/GridToolbarFilterButton.js +20 -9
- package/node/components/toolbar/GridToolbarQuickFilter.js +39 -31
- package/node/components/virtualization/GridMainContainer.js +14 -5
- package/node/components/virtualization/GridVirtualScrollbar.js +17 -17
- package/node/components/virtualization/GridVirtualScroller.js +27 -12
- package/node/components/virtualization/GridVirtualScrollerContent.js +15 -6
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/node/constants/dataGridPropsDefaultValues.js +2 -4
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +1 -1
- package/node/context/GridRootPropsContext.js +1 -0
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/node/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +7 -1
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/node/hooks/core/useGridApiInitialization.js +2 -2
- package/node/hooks/core/useGridStateInitialization.js +3 -3
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +31 -66
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/node/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/node/hooks/features/columnResize/useGridColumnResize.js +17 -10
- package/node/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/node/hooks/features/columns/useGridColumns.js +7 -3
- package/node/hooks/features/dimensions/useGridDimensions.js +12 -33
- package/node/hooks/features/editing/gridEditingSelectors.js +8 -2
- package/node/hooks/features/editing/useGridCellEditing.js +3 -3
- package/node/hooks/features/editing/useGridRowEditing.js +5 -6
- package/node/hooks/features/export/useGridPrintExport.js +1 -1
- package/node/hooks/features/filter/gridFilterSelector.js +6 -1
- package/node/hooks/features/filter/gridFilterUtils.js +3 -3
- package/node/hooks/features/filter/useGridFilter.js +1 -1
- package/node/hooks/features/focus/useGridFocus.js +3 -2
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -15
- package/node/hooks/features/keyboardNavigation/utils.js +0 -6
- package/node/hooks/features/listView/gridListViewSelectors.js +3 -1
- package/node/hooks/features/listView/index.js +16 -0
- package/node/hooks/features/listView/useGridListView.js +2 -1
- package/node/hooks/features/overlays/useGridOverlays.js +24 -2
- package/node/hooks/features/pagination/gridPaginationSelector.js +41 -3
- package/node/hooks/features/pagination/useGridPagination.js +5 -3
- package/node/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/node/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +9 -2
- package/node/hooks/features/preferencesPanel/index.js +11 -10
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/node/hooks/features/rowSelection/useGridRowSelection.js +7 -15
- package/node/hooks/features/rowSelection/utils.js +2 -2
- package/node/hooks/features/rows/gridRowsSelector.js +2 -3
- package/node/hooks/features/rows/gridRowsUtils.js +0 -9
- package/node/hooks/features/rows/index.js +0 -7
- package/node/hooks/features/rows/useGridParamsApi.js +33 -14
- package/node/hooks/features/rows/useGridRowSpanning.js +95 -84
- package/node/hooks/features/rows/useGridRows.js +21 -25
- package/node/hooks/features/rows/useGridRowsMeta.js +5 -4
- package/node/hooks/features/sorting/gridSortingSelector.js +12 -1
- package/node/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/node/hooks/features/sorting/index.js +24 -16
- package/node/hooks/features/sorting/useGridSorting.js +1 -1
- package/node/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +40 -0
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +171 -96
- package/node/hooks/utils/useGridApiEventHandler.js +1 -1
- package/node/hooks/utils/useGridApiRef.js +1 -1
- package/node/hooks/utils/useGridSelector.js +8 -47
- package/node/hooks/utils/useGridVisibleRows.js +3 -28
- package/node/index.js +1 -1
- package/node/internals/constants.js +9 -2
- package/node/internals/index.js +27 -22
- package/node/internals/utils/attachPinnedStyle.js +15 -0
- package/node/internals/utils/getPinnedCellOffset.js +6 -7
- package/node/internals/utils/index.js +11 -11
- package/node/locales/arSD.js +2 -1
- package/node/locales/beBY.js +1 -1
- package/node/locales/bgBG.js +2 -1
- package/node/locales/csCZ.js +2 -1
- package/node/locales/daDK.js +2 -1
- package/node/locales/deDE.js +12 -13
- package/node/locales/elGR.js +2 -1
- package/node/locales/esES.js +12 -13
- package/node/locales/faIR.js +7 -7
- package/node/locales/fiFI.js +2 -1
- package/node/locales/frFR.js +2 -1
- package/node/locales/heIL.js +16 -17
- package/node/locales/hrHR.js +2 -1
- package/node/locales/huHU.js +2 -1
- package/node/locales/isIS.js +2 -1
- package/node/locales/itIT.js +2 -1
- package/node/locales/jaJP.js +2 -1
- package/node/locales/koKR.js +46 -49
- package/node/locales/nbNO.js +2 -1
- package/node/locales/nlNL.js +7 -7
- package/node/locales/nnNO.js +2 -1
- package/node/locales/plPL.js +2 -1
- package/node/locales/ptBR.js +12 -13
- package/node/locales/ptPT.js +12 -13
- package/node/locales/roRO.js +20 -21
- package/node/locales/ruRU.js +2 -1
- package/node/locales/skSK.js +2 -1
- package/node/locales/svSE.js +2 -1
- package/node/locales/trTR.js +14 -15
- package/node/locales/ukUA.js +2 -1
- package/node/locales/urPK.js +11 -11
- package/node/locales/viVN.js +2 -1
- package/node/locales/zhCN.js +12 -13
- package/node/locales/zhHK.js +2 -1
- package/node/locales/zhTW.js +2 -1
- package/node/material/index.js +59 -7
- package/node/models/api/index.js +0 -11
- package/node/models/gridFilterInputComponent.js +5 -0
- package/node/utils/assert.js +9 -0
- package/node/utils/cellBorderUtils.js +5 -5
- package/node/utils/createSelector.js +4 -125
- package/node/utils/domUtils.js +7 -2
- package/node/utils/isJSDOM.js +7 -0
- package/node/utils/roundToDecimalPlaces.js +9 -0
- package/node/utils/rtlFlipSide.js +29 -0
- package/node/utils/utils.js +8 -1
- package/package.json +3 -3
- package/themeAugmentation/overrides.d.ts +10 -5
- package/utils/assert.d.ts +2 -0
- package/utils/assert.js +3 -0
- package/utils/cellBorderUtils.d.ts +3 -3
- package/utils/cellBorderUtils.js +5 -5
- package/utils/createSelector.d.ts +7 -19
- package/utils/createSelector.js +1 -120
- package/utils/domUtils.js +7 -2
- package/utils/getPublicApiRef.d.ts +2 -1
- package/utils/isJSDOM.d.ts +1 -0
- package/utils/isJSDOM.js +1 -0
- package/utils/keyboardUtils.d.ts +1 -1
- package/utils/roundToDecimalPlaces.d.ts +1 -0
- package/utils/roundToDecimalPlaces.js +3 -0
- package/utils/rtlFlipSide.d.ts +2 -0
- package/utils/rtlFlipSide.js +22 -0
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +6 -1
- package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +0 -11
- package/internals/utils/useProps.d.ts +0 -1
- package/internals/utils/useProps.js +0 -24
- package/joy/icons.d.ts +0 -32
- package/joy/icons.js +0 -431
- package/joy/index.d.ts +0 -2
- package/joy/index.js +0 -2
- package/joy/joySlots.d.ts +0 -3
- package/joy/joySlots.js +0 -389
- package/joy/package.json +0 -6
- package/modern/internals/utils/useProps.js +0 -24
- package/modern/joy/icons.js +0 -431
- package/modern/joy/index.js +0 -2
- package/modern/joy/joySlots.js +0 -389
- package/node/internals/utils/useProps.js +0 -30
- package/node/joy/icons.js +0 -439
- package/node/joy/index.js +0 -13
- package/node/joy/joySlots.js +0 -397
- /package/{components/panel/filterPanel/GridFilterInputValueProps.js → models/gridBaseSlots.js} +0 -0
- /package/{modern/components/panel/filterPanel/GridFilterInputValueProps.js → models/gridFilterInputComponent.js} +0 -0
- /package/node/{components/panel/filterPanel/GridFilterInputValueProps.js → models/gridBaseSlots.js} +0 -0
|
@@ -42,12 +42,10 @@ export const createRowsInternalCache = ({
|
|
|
42
42
|
rows: []
|
|
43
43
|
};
|
|
44
44
|
const dataRowIdToModelLookup = {};
|
|
45
|
-
const dataRowIdToIdLookup = {};
|
|
46
45
|
for (let i = 0; i < rows.length; i += 1) {
|
|
47
46
|
const model = rows[i];
|
|
48
47
|
const id = getRowIdFromRowModel(model, getRowId);
|
|
49
48
|
dataRowIdToModelLookup[id] = model;
|
|
50
|
-
dataRowIdToIdLookup[id] = id;
|
|
51
49
|
updates.rows.push(id);
|
|
52
50
|
}
|
|
53
51
|
return {
|
|
@@ -55,7 +53,6 @@ export const createRowsInternalCache = ({
|
|
|
55
53
|
loadingPropBeforePartialUpdates: loading,
|
|
56
54
|
rowCountPropBeforePartialUpdates: rowCount,
|
|
57
55
|
updates,
|
|
58
|
-
dataRowIdToIdLookup,
|
|
59
56
|
dataRowIdToModelLookup
|
|
60
57
|
};
|
|
61
58
|
};
|
|
@@ -87,7 +84,6 @@ export const getRowsStateFromCache = ({
|
|
|
87
84
|
previousTree,
|
|
88
85
|
previousTreeDepths,
|
|
89
86
|
updates: cache.updates,
|
|
90
|
-
dataRowIdToIdLookup: cache.dataRowIdToIdLookup,
|
|
91
87
|
dataRowIdToModelLookup: cache.dataRowIdToModelLookup,
|
|
92
88
|
previousGroupsToFetch
|
|
93
89
|
});
|
|
@@ -96,7 +92,6 @@ export const getRowsStateFromCache = ({
|
|
|
96
92
|
const groupingParamsWithHydrateRows = apiRef.current.unstable_applyPipeProcessors('hydrateRows', {
|
|
97
93
|
tree: unProcessedTree,
|
|
98
94
|
treeDepths: unProcessedTreeDepths,
|
|
99
|
-
dataRowIdToIdLookup: cache.dataRowIdToIdLookup,
|
|
100
95
|
dataRowIds: unProcessedDataRowIds,
|
|
101
96
|
dataRowIdToModelLookup: cache.dataRowIdToModelLookup
|
|
102
97
|
});
|
|
@@ -177,7 +172,6 @@ export const updateCacheWithNewRows = ({
|
|
|
177
172
|
groupKeys
|
|
178
173
|
};
|
|
179
174
|
const dataRowIdToModelLookup = _extends({}, previousCache.dataRowIdToModelLookup);
|
|
180
|
-
const dataRowIdToIdLookup = _extends({}, previousCache.dataRowIdToIdLookup);
|
|
181
175
|
const alreadyAppliedActionsToRemove = {
|
|
182
176
|
insert: {},
|
|
183
177
|
modify: {},
|
|
@@ -210,7 +204,6 @@ export const updateCacheWithNewRows = ({
|
|
|
210
204
|
// Remove the data row from the lookups and add it to the "delete" update.
|
|
211
205
|
partialUpdates.actions.remove.push(id);
|
|
212
206
|
delete dataRowIdToModelLookup[id];
|
|
213
|
-
delete dataRowIdToIdLookup[id];
|
|
214
207
|
return;
|
|
215
208
|
}
|
|
216
209
|
const oldRow = dataRowIdToModelLookup[id];
|
|
@@ -250,7 +243,6 @@ export const updateCacheWithNewRows = ({
|
|
|
250
243
|
|
|
251
244
|
// Update the data row lookups.
|
|
252
245
|
dataRowIdToModelLookup[id] = partialRow;
|
|
253
|
-
dataRowIdToIdLookup[id] = id;
|
|
254
246
|
});
|
|
255
247
|
const actionTypeWithActionsToRemove = Object.keys(alreadyAppliedActionsToRemove);
|
|
256
248
|
for (let i = 0; i < actionTypeWithActionsToRemove.length; i += 1) {
|
|
@@ -262,7 +254,6 @@ export const updateCacheWithNewRows = ({
|
|
|
262
254
|
}
|
|
263
255
|
return {
|
|
264
256
|
dataRowIdToModelLookup,
|
|
265
|
-
dataRowIdToIdLookup,
|
|
266
257
|
updates: partialUpdates,
|
|
267
258
|
rowsBeforePartialUpdates: previousCache.rowsBeforePartialUpdates,
|
|
268
259
|
loadingPropBeforePartialUpdates: previousCache.loadingPropBeforePartialUpdates,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from "./gridRowsMetaSelector.js";
|
|
2
2
|
export * from "./gridRowsMetaState.js";
|
|
3
|
-
export { gridRowCountSelector, gridRowsLoadingSelector, gridTopLevelRowCountSelector, gridRowsLookupSelector,
|
|
3
|
+
export { gridRowCountSelector, gridRowsLoadingSelector, gridTopLevelRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridRowMaximumTreeDepthSelector, gridDataRowIdsSelector } from "./gridRowsSelector.js";
|
|
4
4
|
export { GRID_ROOT_GROUP_ID, checkGridRowIdIsValid, isAutogeneratedRow } from "./gridRowsUtils.js";
|
|
@@ -30,37 +30,52 @@ export function useGridParamsApi(apiRef, props) {
|
|
|
30
30
|
};
|
|
31
31
|
return params;
|
|
32
32
|
}, [apiRef]);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
const getCellParamsForRow = React.useCallback((id, field, row, {
|
|
34
|
+
cellMode,
|
|
35
|
+
colDef,
|
|
36
|
+
hasFocus,
|
|
37
|
+
rowNode,
|
|
38
|
+
tabIndex
|
|
39
|
+
}) => {
|
|
40
40
|
const rawValue = row[field];
|
|
41
41
|
const value = colDef?.valueGetter ? colDef.valueGetter(rawValue, row, colDef, apiRef) : rawValue;
|
|
42
|
-
const cellFocus = gridFocusCellSelector(apiRef);
|
|
43
|
-
const cellTabIndex = gridTabIndexCellSelector(apiRef);
|
|
44
42
|
const params = {
|
|
45
43
|
id,
|
|
46
44
|
field,
|
|
47
45
|
row,
|
|
48
46
|
rowNode,
|
|
49
47
|
colDef,
|
|
50
|
-
cellMode
|
|
51
|
-
hasFocus
|
|
52
|
-
tabIndex
|
|
48
|
+
cellMode,
|
|
49
|
+
hasFocus,
|
|
50
|
+
tabIndex,
|
|
53
51
|
value,
|
|
54
52
|
formattedValue: value,
|
|
55
53
|
isEditable: false,
|
|
56
|
-
api:
|
|
54
|
+
api: null
|
|
57
55
|
};
|
|
58
56
|
if (colDef && colDef.valueFormatter) {
|
|
59
57
|
params.formattedValue = colDef.valueFormatter(value, row, colDef, apiRef);
|
|
60
58
|
}
|
|
61
59
|
params.isEditable = colDef && apiRef.current.isCellEditable(params);
|
|
62
60
|
return params;
|
|
63
|
-
}, [apiRef
|
|
61
|
+
}, [apiRef]);
|
|
62
|
+
const getCellParams = React.useCallback((id, field) => {
|
|
63
|
+
const row = apiRef.current.getRow(id);
|
|
64
|
+
const rowNode = apiRef.current.getRowNode(id);
|
|
65
|
+
if (!row || !rowNode) {
|
|
66
|
+
throw new MissingRowIdError(`No row with id #${id} found`);
|
|
67
|
+
}
|
|
68
|
+
const cellFocus = gridFocusCellSelector(apiRef);
|
|
69
|
+
const cellTabIndex = gridTabIndexCellSelector(apiRef);
|
|
70
|
+
const cellMode = apiRef.current.getCellMode(id, field);
|
|
71
|
+
return apiRef.current.getCellParamsForRow(id, field, row, {
|
|
72
|
+
colDef: props.unstable_listView && props.unstable_listColumn?.field === field ? gridListColumnSelector(apiRef.current.state) : apiRef.current.getColumn(field),
|
|
73
|
+
rowNode,
|
|
74
|
+
hasFocus: cellFocus !== null && cellFocus.field === field && cellFocus.id === id,
|
|
75
|
+
tabIndex: cellTabIndex && cellTabIndex.field === field && cellTabIndex.id === id ? 0 : -1,
|
|
76
|
+
cellMode
|
|
77
|
+
});
|
|
78
|
+
}, [apiRef, props.unstable_listView, props.unstable_listColumn?.field]);
|
|
64
79
|
const getCellValue = React.useCallback((id, field) => {
|
|
65
80
|
const colDef = apiRef.current.getColumn(field);
|
|
66
81
|
const row = apiRef.current.getRow(id);
|
|
@@ -119,5 +134,9 @@ export function useGridParamsApi(apiRef, props) {
|
|
|
119
134
|
getColumnHeaderParams,
|
|
120
135
|
getColumnHeaderElement
|
|
121
136
|
};
|
|
137
|
+
const paramsPrivateApi = {
|
|
138
|
+
getCellParamsForRow
|
|
139
|
+
};
|
|
122
140
|
useGridApiMethod(apiRef, paramsApi, 'public');
|
|
141
|
+
useGridApiMethod(apiRef, paramsPrivateApi, 'private');
|
|
123
142
|
}
|
|
@@ -3,11 +3,14 @@ import * as React from 'react';
|
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
4
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../../../internals/constants.js";
|
|
5
5
|
import { gridVisibleColumnDefinitionsSelector } from "../columns/gridColumnsSelector.js";
|
|
6
|
-
import {
|
|
6
|
+
import { getVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
7
7
|
import { gridRenderContextSelector } from "../virtualization/gridVirtualizationSelectors.js";
|
|
8
|
-
import {
|
|
9
|
-
import { getUnprocessedRange, isRowRangeUpdated, isRowContextInitialized, getCellValue } from "./gridRowSpanningUtils.js";
|
|
8
|
+
import { getUnprocessedRange, isRowContextInitialized, getCellValue } from "./gridRowSpanningUtils.js";
|
|
10
9
|
import { GRID_CHECKBOX_SELECTION_FIELD } from "../../../colDef/gridCheckboxSelectionColDef.js";
|
|
10
|
+
import { useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
|
|
11
|
+
import { runIf } from "../../../utils/utils.js";
|
|
12
|
+
import { gridPageSizeSelector } from "../pagination/index.js";
|
|
13
|
+
import { gridDataRowIdsSelector } from "./gridRowsSelector.js";
|
|
11
14
|
const EMPTY_STATE = {
|
|
12
15
|
spannedCells: {},
|
|
13
16
|
hiddenCells: {},
|
|
@@ -35,7 +38,7 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
35
38
|
if (skippedFields.has(colDef.field)) {
|
|
36
39
|
return;
|
|
37
40
|
}
|
|
38
|
-
for (let index = rangeToProcess.firstRowIndex; index
|
|
41
|
+
for (let index = rangeToProcess.firstRowIndex; index < rangeToProcess.lastRowIndex; index += 1) {
|
|
39
42
|
const row = visibleRows[index];
|
|
40
43
|
if (hiddenCells[row.id]?.[colDef.field]) {
|
|
41
44
|
continue;
|
|
@@ -52,8 +55,8 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
52
55
|
const backwardsHiddenCells = [];
|
|
53
56
|
if (index === rangeToProcess.firstRowIndex) {
|
|
54
57
|
let prevIndex = index - 1;
|
|
55
|
-
|
|
56
|
-
while (prevIndex >= range.firstRowIndex && getCellValue(prevRowEntry.model, colDef, apiRef) === cellValue) {
|
|
58
|
+
let prevRowEntry = visibleRows[prevIndex];
|
|
59
|
+
while (prevIndex >= range.firstRowIndex && prevRowEntry && getCellValue(prevRowEntry.model, colDef, apiRef) === cellValue) {
|
|
57
60
|
const currentRow = visibleRows[prevIndex + 1];
|
|
58
61
|
if (hiddenCells[currentRow.id]) {
|
|
59
62
|
hiddenCells[currentRow.id][colDef.field] = true;
|
|
@@ -67,6 +70,7 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
67
70
|
spannedRowId = prevRowEntry.id;
|
|
68
71
|
spannedRowIndex = prevIndex;
|
|
69
72
|
prevIndex -= 1;
|
|
73
|
+
prevRowEntry = visibleRows[prevIndex];
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
backwardsHiddenCells.forEach(hiddenCellIndex => {
|
|
@@ -122,6 +126,24 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
122
126
|
processedRange
|
|
123
127
|
};
|
|
124
128
|
};
|
|
129
|
+
const getInitialRangeToProcess = (props, apiRef) => {
|
|
130
|
+
const rowCount = gridDataRowIdsSelector(apiRef).length;
|
|
131
|
+
if (props.pagination) {
|
|
132
|
+
const pageSize = gridPageSizeSelector(apiRef);
|
|
133
|
+
let paginationLastRowIndex = DEFAULT_ROWS_TO_PROCESS;
|
|
134
|
+
if (pageSize > 0) {
|
|
135
|
+
paginationLastRowIndex = pageSize - 1;
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
firstRowIndex: 0,
|
|
139
|
+
lastRowIndex: Math.min(paginationLastRowIndex, rowCount)
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
firstRowIndex: 0,
|
|
144
|
+
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, rowCount)
|
|
145
|
+
};
|
|
146
|
+
};
|
|
125
147
|
|
|
126
148
|
/**
|
|
127
149
|
* @requires columnsStateInitializer (method) - should be initialized before
|
|
@@ -129,73 +151,52 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
129
151
|
* @requires filterStateInitializer (method) - should be initialized before
|
|
130
152
|
*/
|
|
131
153
|
export const rowSpanningStateInitializer = (state, props, apiRef) => {
|
|
132
|
-
if (props.
|
|
133
|
-
const rowIds = state.rows.dataRowIds || [];
|
|
134
|
-
const orderedFields = state.columns.orderedFields || [];
|
|
135
|
-
const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
|
|
136
|
-
const columnsLookup = state.columns.lookup;
|
|
137
|
-
const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
|
|
138
|
-
if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
|
|
139
|
-
return _extends({}, state, {
|
|
140
|
-
rowSpanning: EMPTY_STATE
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
const rangeToProcess = {
|
|
144
|
-
firstRowIndex: 0,
|
|
145
|
-
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS - 1, Math.max(rowIds.length - 1, 0))
|
|
146
|
-
};
|
|
147
|
-
const rows = rowIds.map(id => ({
|
|
148
|
-
id,
|
|
149
|
-
model: dataRowIdToModelLookup[id]
|
|
150
|
-
}));
|
|
151
|
-
const colDefs = orderedFields.map(field => columnsLookup[field]);
|
|
152
|
-
const {
|
|
153
|
-
spannedCells,
|
|
154
|
-
hiddenCells,
|
|
155
|
-
hiddenCellOriginMap
|
|
156
|
-
} = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
|
|
154
|
+
if (!props.rowSpanning) {
|
|
157
155
|
return _extends({}, state, {
|
|
158
|
-
rowSpanning:
|
|
159
|
-
spannedCells,
|
|
160
|
-
hiddenCells,
|
|
161
|
-
hiddenCellOriginMap
|
|
162
|
-
}
|
|
156
|
+
rowSpanning: EMPTY_STATE
|
|
163
157
|
});
|
|
164
158
|
}
|
|
159
|
+
const rowIds = state.rows.dataRowIds || [];
|
|
160
|
+
const orderedFields = state.columns.orderedFields || [];
|
|
161
|
+
const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
|
|
162
|
+
const columnsLookup = state.columns.lookup;
|
|
163
|
+
const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
|
|
164
|
+
if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
|
|
165
|
+
return _extends({}, state, {
|
|
166
|
+
rowSpanning: EMPTY_STATE
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
const rangeToProcess = getInitialRangeToProcess(props, apiRef);
|
|
170
|
+
const rows = rowIds.map(id => ({
|
|
171
|
+
id,
|
|
172
|
+
model: dataRowIdToModelLookup[id]
|
|
173
|
+
}));
|
|
174
|
+
const colDefs = orderedFields.map(field => columnsLookup[field]);
|
|
175
|
+
const {
|
|
176
|
+
spannedCells,
|
|
177
|
+
hiddenCells,
|
|
178
|
+
hiddenCellOriginMap
|
|
179
|
+
} = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
|
|
165
180
|
return _extends({}, state, {
|
|
166
|
-
rowSpanning:
|
|
181
|
+
rowSpanning: {
|
|
182
|
+
spannedCells,
|
|
183
|
+
hiddenCells,
|
|
184
|
+
hiddenCellOriginMap
|
|
185
|
+
}
|
|
167
186
|
});
|
|
168
187
|
};
|
|
169
188
|
export const useGridRowSpanning = (apiRef, props) => {
|
|
170
|
-
const {
|
|
171
|
-
range,
|
|
172
|
-
rows: visibleRows
|
|
173
|
-
} = useGridVisibleRows(apiRef, props);
|
|
174
|
-
const renderContext = useGridSelector(apiRef, gridRenderContextSelector);
|
|
175
|
-
const colDefs = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
|
|
176
189
|
const processedRange = useLazyRef(() => {
|
|
177
|
-
return
|
|
178
|
-
firstRowIndex: 0,
|
|
179
|
-
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS - 1, Math.max(apiRef.current.state.rows.dataRowIds.length - 1, 0))
|
|
180
|
-
} : EMPTY_RANGE;
|
|
190
|
+
return apiRef.current.state.rowSpanning !== EMPTY_STATE ? getInitialRangeToProcess(props, apiRef) : EMPTY_RANGE;
|
|
181
191
|
});
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
(resetState = true) => {
|
|
191
|
-
if (!props.unstable_rowSpanning) {
|
|
192
|
-
if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
|
|
193
|
-
apiRef.current.setState(state => _extends({}, state, {
|
|
194
|
-
rowSpanning: EMPTY_STATE
|
|
195
|
-
}));
|
|
196
|
-
}
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
192
|
+
const updateRowSpanningState = React.useCallback((renderContext, resetState = false) => {
|
|
193
|
+
const {
|
|
194
|
+
range,
|
|
195
|
+
rows: visibleRows
|
|
196
|
+
} = getVisibleRows(apiRef, {
|
|
197
|
+
pagination: props.pagination,
|
|
198
|
+
paginationMode: props.paginationMode
|
|
199
|
+
});
|
|
199
200
|
if (range === null || !isRowContextInitialized(renderContext)) {
|
|
200
201
|
return;
|
|
201
202
|
}
|
|
@@ -204,11 +205,12 @@ export const useGridRowSpanning = (apiRef, props) => {
|
|
|
204
205
|
}
|
|
205
206
|
const rangeToProcess = getUnprocessedRange({
|
|
206
207
|
firstRowIndex: renderContext.firstRowIndex,
|
|
207
|
-
lastRowIndex: Math.min(renderContext.lastRowIndex
|
|
208
|
+
lastRowIndex: Math.min(renderContext.lastRowIndex, range.lastRowIndex + 1)
|
|
208
209
|
}, processedRange.current);
|
|
209
210
|
if (rangeToProcess === null) {
|
|
210
211
|
return;
|
|
211
212
|
}
|
|
213
|
+
const colDefs = gridVisibleColumnDefinitionsSelector(apiRef);
|
|
212
214
|
const {
|
|
213
215
|
spannedCells,
|
|
214
216
|
hiddenCells,
|
|
@@ -221,7 +223,8 @@ export const useGridRowSpanning = (apiRef, props) => {
|
|
|
221
223
|
const currentSpannedCellsCount = Object.keys(apiRef.current.state.rowSpanning.spannedCells).length;
|
|
222
224
|
const currentHiddenCellsCount = Object.keys(apiRef.current.state.rowSpanning.hiddenCells).length;
|
|
223
225
|
const shouldUpdateState = resetState || newSpannedCellsCount !== currentSpannedCellsCount || newHiddenCellsCount !== currentHiddenCellsCount;
|
|
224
|
-
|
|
226
|
+
const hasNoSpannedCells = newSpannedCellsCount === 0 && currentSpannedCellsCount === 0;
|
|
227
|
+
if (!shouldUpdateState || hasNoSpannedCells) {
|
|
225
228
|
return;
|
|
226
229
|
}
|
|
227
230
|
apiRef.current.setState(state => {
|
|
@@ -233,27 +236,35 @@ export const useGridRowSpanning = (apiRef, props) => {
|
|
|
233
236
|
}
|
|
234
237
|
});
|
|
235
238
|
});
|
|
236
|
-
}, [apiRef, props.
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
239
|
+
}, [apiRef, processedRange, props.pagination, props.paginationMode]);
|
|
240
|
+
|
|
241
|
+
// Reset events trigger a full re-computation of the row spanning state:
|
|
242
|
+
// - The `unstable_rowSpanning` prop is updated (feature flag)
|
|
243
|
+
// - The filtering is applied
|
|
244
|
+
// - The sorting is applied
|
|
245
|
+
// - The `paginationModel` is updated
|
|
246
|
+
// - The rows are updated
|
|
247
|
+
const resetRowSpanningState = React.useCallback(() => {
|
|
248
|
+
const renderContext = gridRenderContextSelector(apiRef);
|
|
249
|
+
if (!isRowContextInitialized(renderContext)) {
|
|
250
|
+
return;
|
|
248
251
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
252
|
+
updateRowSpanningState(renderContext, true);
|
|
253
|
+
}, [apiRef, updateRowSpanningState]);
|
|
254
|
+
useGridApiEventHandler(apiRef, 'renderedRowsIntervalChange', runIf(props.rowSpanning, updateRowSpanningState));
|
|
255
|
+
useGridApiEventHandler(apiRef, 'sortedRowsSet', runIf(props.rowSpanning, resetRowSpanningState));
|
|
256
|
+
useGridApiEventHandler(apiRef, 'paginationModelChange', runIf(props.rowSpanning, resetRowSpanningState));
|
|
257
|
+
useGridApiEventHandler(apiRef, 'filteredRowsSet', runIf(props.rowSpanning, resetRowSpanningState));
|
|
258
|
+
useGridApiEventHandler(apiRef, 'columnsChange', runIf(props.rowSpanning, resetRowSpanningState));
|
|
259
|
+
React.useEffect(() => {
|
|
260
|
+
if (!props.rowSpanning) {
|
|
261
|
+
if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
|
|
262
|
+
apiRef.current.setState(state => _extends({}, state, {
|
|
263
|
+
rowSpanning: EMPTY_STATE
|
|
264
|
+
}));
|
|
253
265
|
}
|
|
254
|
-
|
|
255
|
-
|
|
266
|
+
} else if (apiRef.current.state.rowSpanning === EMPTY_STATE) {
|
|
267
|
+
resetRowSpanningState();
|
|
256
268
|
}
|
|
257
|
-
|
|
258
|
-
}, [updateRowSpanningState, renderContext, range, lastRange]);
|
|
269
|
+
}, [apiRef, resetRowSpanningState, props.rowSpanning]);
|
|
259
270
|
};
|
|
@@ -3,14 +3,15 @@ import * as React from 'react';
|
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
4
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
|
|
5
5
|
import { useGridLogger } from "../../utils/useGridLogger.js";
|
|
6
|
-
import { gridRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridDataRowIdsSelector,
|
|
6
|
+
import { gridRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridDataRowIdsSelector, gridRowMaximumTreeDepthSelector, gridRowGroupsToFetchSelector } from "./gridRowsSelector.js";
|
|
7
7
|
import { useTimeout } from "../../utils/useTimeout.js";
|
|
8
8
|
import { GridSignature, useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
|
|
9
|
-
import {
|
|
9
|
+
import { getVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
10
10
|
import { gridSortedRowIdsSelector } from "../sorting/gridSortingSelector.js";
|
|
11
11
|
import { gridFilteredRowsLookupSelector } from "../filter/gridFilterSelector.js";
|
|
12
12
|
import { getTreeNodeDescendants, createRowsInternalCache, getRowsStateFromCache, isAutogeneratedRowNode, GRID_ROOT_GROUP_ID, GRID_ID_AUTOGENERATED, updateCacheWithNewRows, getTopLevelRowCount, getRowIdFromRowModel, computeRowsUpdates } from "./gridRowsUtils.js";
|
|
13
13
|
import { useGridRegisterPipeApplier } from "../../core/pipeProcessing/index.js";
|
|
14
|
+
import { GridStrategyGroup } from "../../core/strategyProcessing/index.js";
|
|
14
15
|
export const rowsStateInitializer = (state, props, apiRef) => {
|
|
15
16
|
const isDataSourceAvailable = !!props.unstable_dataSource;
|
|
16
17
|
apiRef.current.caches.rows = createRowsInternalCache({
|
|
@@ -39,7 +40,6 @@ export const useGridRows = (apiRef, props) => {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
const logger = useGridLogger(apiRef, 'useGridRows');
|
|
42
|
-
const currentPage = useGridVisibleRows(apiRef, props);
|
|
43
43
|
const lastUpdateMs = React.useRef(Date.now());
|
|
44
44
|
const lastRowCount = React.useRef(props.rowCount);
|
|
45
45
|
const timeout = useTimeout();
|
|
@@ -66,12 +66,6 @@ export const useGridRows = (apiRef, props) => {
|
|
|
66
66
|
}
|
|
67
67
|
return row.id;
|
|
68
68
|
}, [getRowIdProp]);
|
|
69
|
-
const lookup = React.useMemo(() => currentPage.rows.reduce((acc, {
|
|
70
|
-
id
|
|
71
|
-
}, index) => {
|
|
72
|
-
acc[id] = index;
|
|
73
|
-
return acc;
|
|
74
|
-
}, {}), [currentPage.rows]);
|
|
75
69
|
const throttledRowsChange = React.useCallback(({
|
|
76
70
|
cache,
|
|
77
71
|
throttle
|
|
@@ -170,7 +164,12 @@ export const useGridRows = (apiRef, props) => {
|
|
|
170
164
|
}, [apiRef]);
|
|
171
165
|
const getRowsCount = React.useCallback(() => gridRowCountSelector(apiRef), [apiRef]);
|
|
172
166
|
const getAllRowIds = React.useCallback(() => gridDataRowIdsSelector(apiRef), [apiRef]);
|
|
173
|
-
const getRowIndexRelativeToVisibleRows = React.useCallback(id =>
|
|
167
|
+
const getRowIndexRelativeToVisibleRows = React.useCallback(id => {
|
|
168
|
+
const {
|
|
169
|
+
rowIdToIndexMap
|
|
170
|
+
} = getVisibleRows(apiRef);
|
|
171
|
+
return rowIdToIndexMap.get(id);
|
|
172
|
+
}, [apiRef]);
|
|
174
173
|
const setRowChildrenExpansion = React.useCallback((id, isExpanded) => {
|
|
175
174
|
const currentNode = apiRef.current.getRowNode(id);
|
|
176
175
|
if (!currentNode) {
|
|
@@ -238,7 +237,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
238
237
|
throw new Error(`MUI X: The row reordering do not support reordering of footer or grouping rows.`);
|
|
239
238
|
}
|
|
240
239
|
apiRef.current.setState(state => {
|
|
241
|
-
const group = gridRowTreeSelector(state, apiRef.current.instanceId)[GRID_ROOT_GROUP_ID];
|
|
240
|
+
const group = gridRowTreeSelector(state, undefined, apiRef.current.instanceId)[GRID_ROOT_GROUP_ID];
|
|
242
241
|
const allRows = group.children;
|
|
243
242
|
const oldIndex = allRows.findIndex(row => row === rowId);
|
|
244
243
|
if (oldIndex === -1 || oldIndex === targetIndex) {
|
|
@@ -272,7 +271,6 @@ export const useGridRows = (apiRef, props) => {
|
|
|
272
271
|
}
|
|
273
272
|
const tree = _extends({}, gridRowTreeSelector(apiRef));
|
|
274
273
|
const dataRowIdToModelLookup = _extends({}, gridRowsLookupSelector(apiRef));
|
|
275
|
-
const dataRowIdToIdLookup = _extends({}, gridRowsDataRowIdToIdLookupSelector(apiRef));
|
|
276
274
|
const rootGroup = tree[GRID_ROOT_GROUP_ID];
|
|
277
275
|
const rootGroupChildren = [...rootGroup.children];
|
|
278
276
|
const seenIds = new Set();
|
|
@@ -282,7 +280,6 @@ export const useGridRows = (apiRef, props) => {
|
|
|
282
280
|
const [removedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
|
|
283
281
|
if (!seenIds.has(removedRowId)) {
|
|
284
282
|
delete dataRowIdToModelLookup[removedRowId];
|
|
285
|
-
delete dataRowIdToIdLookup[removedRowId];
|
|
286
283
|
delete tree[removedRowId];
|
|
287
284
|
}
|
|
288
285
|
const rowTreeNodeConfig = {
|
|
@@ -293,7 +290,6 @@ export const useGridRows = (apiRef, props) => {
|
|
|
293
290
|
groupingKey: null
|
|
294
291
|
};
|
|
295
292
|
dataRowIdToModelLookup[rowId] = rowModel;
|
|
296
|
-
dataRowIdToIdLookup[rowId] = rowId;
|
|
297
293
|
tree[rowId] = rowTreeNodeConfig;
|
|
298
294
|
seenIds.add(rowId);
|
|
299
295
|
}
|
|
@@ -304,17 +300,17 @@ export const useGridRows = (apiRef, props) => {
|
|
|
304
300
|
// Removes potential remaining skeleton rows from the dataRowIds.
|
|
305
301
|
const dataRowIds = rootGroupChildren.filter(childId => tree[childId]?.type === 'leaf');
|
|
306
302
|
apiRef.current.caches.rows.dataRowIdToModelLookup = dataRowIdToModelLookup;
|
|
307
|
-
apiRef.current.caches.rows.dataRowIdToIdLookup = dataRowIdToIdLookup;
|
|
308
303
|
apiRef.current.setState(state => _extends({}, state, {
|
|
309
304
|
rows: _extends({}, state.rows, {
|
|
305
|
+
loading: props.loading,
|
|
306
|
+
totalRowCount: Math.max(props.rowCount || 0, rootGroupChildren.length),
|
|
310
307
|
dataRowIdToModelLookup,
|
|
311
|
-
dataRowIdToIdLookup,
|
|
312
308
|
dataRowIds,
|
|
313
309
|
tree
|
|
314
310
|
})
|
|
315
311
|
}));
|
|
316
312
|
apiRef.current.publishEvent('rowsSet');
|
|
317
|
-
}, [apiRef, props.signature, props.getRowId]);
|
|
313
|
+
}, [apiRef, props.signature, props.getRowId, props.loading, props.rowCount]);
|
|
318
314
|
const rowApi = {
|
|
319
315
|
getRow,
|
|
320
316
|
setLoading,
|
|
@@ -381,7 +377,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
381
377
|
const handleStrategyActivityChange = React.useCallback(() => {
|
|
382
378
|
// `rowTreeCreation` is the only processor ran when `strategyAvailabilityChange` is fired.
|
|
383
379
|
// All the other processors listen to `rowsSet` which will be published by the `groupRows` method below.
|
|
384
|
-
if (apiRef.current.getActiveStrategy(
|
|
380
|
+
if (apiRef.current.getActiveStrategy(GridStrategyGroup.RowTree) !== gridRowGroupingNameSelector(apiRef)) {
|
|
385
381
|
groupRows();
|
|
386
382
|
}
|
|
387
383
|
}, [apiRef, groupRows]);
|
|
@@ -394,11 +390,10 @@ export const useGridRows = (apiRef, props) => {
|
|
|
394
390
|
const applyHydrateRowsProcessor = React.useCallback(() => {
|
|
395
391
|
apiRef.current.setState(state => {
|
|
396
392
|
const response = apiRef.current.unstable_applyPipeProcessors('hydrateRows', {
|
|
397
|
-
tree: gridRowTreeSelector(state, apiRef.current.instanceId),
|
|
398
|
-
treeDepths: gridRowTreeDepthsSelector(state, apiRef.current.instanceId),
|
|
399
|
-
dataRowIds: gridDataRowIdsSelector(state, apiRef.current.instanceId),
|
|
400
|
-
dataRowIdToModelLookup: gridRowsLookupSelector(state, apiRef.current.instanceId)
|
|
401
|
-
dataRowIdToIdLookup: gridRowsDataRowIdToIdLookupSelector(state, apiRef.current.instanceId)
|
|
393
|
+
tree: gridRowTreeSelector(state, undefined, apiRef.current.instanceId),
|
|
394
|
+
treeDepths: gridRowTreeDepthsSelector(state, undefined, apiRef.current.instanceId),
|
|
395
|
+
dataRowIds: gridDataRowIdsSelector(state, undefined, apiRef.current.instanceId),
|
|
396
|
+
dataRowIdToModelLookup: gridRowsLookupSelector(state, undefined, apiRef.current.instanceId)
|
|
402
397
|
});
|
|
403
398
|
return _extends({}, state, {
|
|
404
399
|
rows: _extends({}, state.rows, response, {
|
|
@@ -430,7 +425,8 @@ export const useGridRows = (apiRef, props) => {
|
|
|
430
425
|
isRowCountPropUpdated = true;
|
|
431
426
|
lastRowCount.current = props.rowCount;
|
|
432
427
|
}
|
|
433
|
-
const
|
|
428
|
+
const currentRows = props.unstable_dataSource ? Array.from(apiRef.current.getRowModels().values()) : props.rows;
|
|
429
|
+
const areNewRowsAlreadyInState = apiRef.current.caches.rows.rowsBeforePartialUpdates === currentRows;
|
|
434
430
|
const isNewLoadingAlreadyInState = apiRef.current.caches.rows.loadingPropBeforePartialUpdates === props.loading;
|
|
435
431
|
const isNewRowCountAlreadyInState = apiRef.current.caches.rows.rowCountPropBeforePartialUpdates === props.rowCount;
|
|
436
432
|
|
|
@@ -460,15 +456,15 @@ export const useGridRows = (apiRef, props) => {
|
|
|
460
456
|
return;
|
|
461
457
|
}
|
|
462
458
|
}
|
|
463
|
-
logger.debug(`Updating all rows, new length ${
|
|
459
|
+
logger.debug(`Updating all rows, new length ${currentRows?.length}`);
|
|
464
460
|
throttledRowsChange({
|
|
465
461
|
cache: createRowsInternalCache({
|
|
466
|
-
rows:
|
|
462
|
+
rows: currentRows,
|
|
467
463
|
getRowId: props.getRowId,
|
|
468
464
|
loading: props.loading,
|
|
469
465
|
rowCount: props.rowCount
|
|
470
466
|
}),
|
|
471
467
|
throttle: false
|
|
472
468
|
});
|
|
473
|
-
}, [props.rows, props.rowCount, props.getRowId, props.loading, logger, throttledRowsChange, apiRef]);
|
|
469
|
+
}, [props.rows, props.rowCount, props.getRowId, props.loading, props.unstable_dataSource, logger, throttledRowsChange, apiRef]);
|
|
474
470
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
|
+
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
4
5
|
import { ResizeObserver } from "../../../utils/ResizeObserver.js";
|
|
5
6
|
import { useGridVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
6
7
|
import { eslintUseValue } from "../../../utils/utils.js";
|
|
@@ -110,7 +111,7 @@ export const useGridRowsMeta = (apiRef, props) => {
|
|
|
110
111
|
}
|
|
111
112
|
apiRef.current.unstable_applyPipeProcessors('rowHeight', entry, row);
|
|
112
113
|
return entry;
|
|
113
|
-
}, [apiRef, currentPage.rows
|
|
114
|
+
}, [apiRef, currentPage.rows, getRowHeightProp, getEstimatedRowHeight, rowHeight, getRowSpacing, densityFactor]);
|
|
114
115
|
const hydrateRowsMeta = React.useCallback(() => {
|
|
115
116
|
hasRowWithAutoHeight.current = false;
|
|
116
117
|
pinnedRows.top.forEach(processHeightEntry);
|
|
@@ -181,7 +182,7 @@ export const useGridRowsMeta = (apiRef, props) => {
|
|
|
181
182
|
|
|
182
183
|
// The effect is used to build the rows meta data - currentPageTotalHeight and positions.
|
|
183
184
|
// Because of variable row height this is needed for the virtualization
|
|
184
|
-
|
|
185
|
+
useEnhancedEffect(() => {
|
|
185
186
|
hydrateRowsMeta();
|
|
186
187
|
}, [filterModel, paginationState, sortModel, hydrateRowsMeta]);
|
|
187
188
|
const rowsMetaApi = {
|
|
@@ -55,4 +55,15 @@ export const gridSortColumnLookupSelector = createSelectorMemoized(gridSortModel
|
|
|
55
55
|
return res;
|
|
56
56
|
}, {});
|
|
57
57
|
return result;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @category Sorting
|
|
62
|
+
* @ignore - do not document.
|
|
63
|
+
*/
|
|
64
|
+
export const gridSortedRowIndexLookupSelector = createSelectorMemoized(gridSortedRowIdsSelector, sortedIds => {
|
|
65
|
+
return sortedIds.reduce((acc, id, index) => {
|
|
66
|
+
acc[id] = index;
|
|
67
|
+
return acc;
|
|
68
|
+
}, Object.create(null));
|
|
58
69
|
});
|
|
@@ -19,7 +19,7 @@ const isDesc = direction => direction === 'desc';
|
|
|
19
19
|
/**
|
|
20
20
|
* Transform an item of the sorting model into a method comparing two rows.
|
|
21
21
|
* @param {GridSortItem} sortItem The sort item we want to apply.
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
|
|
23
23
|
* @returns {GridParsedSortItem | null} The parsed sort item. Returns `null` is the sort item is not valid.
|
|
24
24
|
*/
|
|
25
25
|
const parseSortItem = (sortItem, apiRef) => {
|
|
@@ -72,7 +72,7 @@ const compareRows = (parsedSortItems, row1, row2) => {
|
|
|
72
72
|
/**
|
|
73
73
|
* Generates a method to easily sort a list of rows according to the current sort model.
|
|
74
74
|
* @param {GridSortModel} sortModel The model with which we want to sort the rows.
|
|
75
|
-
* @param {
|
|
75
|
+
* @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
|
|
76
76
|
* @returns {GridSortingModelApplier | null} A method that generates a list of sorted row ids from a list of rows according to the current sort model. If `null`, we consider that the rows should remain in the order there were provided.
|
|
77
77
|
*/
|
|
78
78
|
export const buildAggregatedSortingApplier = (sortModel, apiRef) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { gridSortedRowIdsSelector, gridSortedRowEntriesSelector, gridSortModelSelector, gridSortColumnLookupSelector } from "./gridSortingSelector.js";
|
|
2
2
|
export { gridDateComparator, gridNumberComparator, gridStringOrNumberComparator } from "./gridSortingUtils.js";
|
|
@@ -88,7 +88,7 @@ export const useGridSorting = (apiRef, props) => {
|
|
|
88
88
|
})
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
const sortModel = gridSortModelSelector(state, apiRef.current.instanceId);
|
|
91
|
+
const sortModel = gridSortModelSelector(state, undefined, apiRef.current.instanceId);
|
|
92
92
|
const sortRowList = buildAggregatedSortingApplier(sortModel, apiRef);
|
|
93
93
|
const sortedRows = apiRef.current.applyStrategyProcessor('sorting', {
|
|
94
94
|
sortRowList
|