@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
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { createSelector } from 'reselect';
|
|
3
|
+
import { createSelectorMemoized } from "../../../utils/createSelector.js";
|
|
4
|
+
import { gridVisibleColumnDefinitionsSelector } from "../columns/gridColumnsSelector.js";
|
|
5
|
+
import { gridRenderContextSelector } from "./gridVirtualizationSelectors.js";
|
|
6
|
+
import { gridFocusCellSelector } from "../focus/index.js";
|
|
7
|
+
import { gridVisibleRowsSelector } from "../pagination/index.js";
|
|
8
|
+
const gridIsFocusedCellOutOfContext = createSelector(gridFocusCellSelector, gridRenderContextSelector, gridVisibleRowsSelector, gridVisibleColumnDefinitionsSelector, (focusedCell, renderContext, currentPage, visibleColumns) => {
|
|
9
|
+
if (!focusedCell) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
const rowIndex = currentPage.rowIdToIndexMap.get(focusedCell.id);
|
|
13
|
+
const columnIndex = visibleColumns.slice(renderContext.firstColumnIndex, renderContext.lastColumnIndex).findIndex(column => column.field === focusedCell.field);
|
|
14
|
+
const isInRenderContext = rowIndex !== undefined && columnIndex !== -1 && rowIndex >= renderContext.firstRowIndex && rowIndex <= renderContext.lastRowIndex;
|
|
15
|
+
return !isInRenderContext;
|
|
16
|
+
});
|
|
17
|
+
export const gridFocusedVirtualCellSelector = createSelectorMemoized(gridIsFocusedCellOutOfContext, gridVisibleColumnDefinitionsSelector, gridVisibleRowsSelector, gridFocusCellSelector, (isFocusedCellOutOfRenderContext, visibleColumns, currentPage, focusedCell) => {
|
|
18
|
+
if (!isFocusedCellOutOfRenderContext) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const rowIndex = currentPage.rowIdToIndexMap.get(focusedCell.id);
|
|
22
|
+
if (rowIndex === undefined) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const columnIndex = visibleColumns.findIndex(column => column.field === focusedCell.field);
|
|
26
|
+
if (columnIndex === -1) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return _extends({}, focusedCell, {
|
|
30
|
+
rowIndex,
|
|
31
|
+
columnIndex
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -4,8 +4,8 @@ import * as ReactDOM from 'react-dom';
|
|
|
4
4
|
import { unstable_useEnhancedEffect as useEnhancedEffect, unstable_useEventCallback as useEventCallback } from '@mui/utils';
|
|
5
5
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
6
6
|
import useTimeout from '@mui/utils/useTimeout';
|
|
7
|
-
import { useResizeObserver } from '@mui/x-internals/useResizeObserver';
|
|
8
7
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
8
|
+
import reactMajor from '@mui/x-internals/reactMajor';
|
|
9
9
|
import { useGridPrivateApiContext } from "../../utils/useGridPrivateApiContext.js";
|
|
10
10
|
import { useGridRootProps } from "../../utils/useGridRootProps.js";
|
|
11
11
|
import { useGridSelector } from "../../utils/useGridSelector.js";
|
|
@@ -13,7 +13,6 @@ import { useRunOnce } from "../../utils/useRunOnce.js";
|
|
|
13
13
|
import { gridVisibleColumnDefinitionsSelector, gridVisiblePinnedColumnDefinitionsSelector, gridColumnPositionsSelector, gridHasColSpanSelector } from "../columns/gridColumnsSelector.js";
|
|
14
14
|
import { gridDimensionsSelector } from "../dimensions/gridDimensionsSelectors.js";
|
|
15
15
|
import { gridPinnedRowsSelector } from "../rows/gridRowsSelector.js";
|
|
16
|
-
import { gridFocusCellSelector, gridTabIndexCellSelector } from "../focus/gridFocusStateSelector.js";
|
|
17
16
|
import { useGridVisibleRows, getVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
18
17
|
import { useGridApiEventHandler } from "../../utils/index.js";
|
|
19
18
|
import * as platform from "../../../utils/platform.js";
|
|
@@ -26,6 +25,10 @@ import { EMPTY_RENDER_CONTEXT } from "./useGridVirtualization.js";
|
|
|
26
25
|
import { gridRowSpanningHiddenCellsOriginMapSelector } from "../rows/gridRowSpanningSelectors.js";
|
|
27
26
|
import { gridListColumnSelector } from "../listView/gridListViewSelectors.js";
|
|
28
27
|
import { minimalContentHeight } from "../rows/gridRowsUtils.js";
|
|
28
|
+
import { EMPTY_PINNED_COLUMN_FIELDS } from "../columns/index.js";
|
|
29
|
+
import { gridFocusedVirtualCellSelector } from "./gridFocusedVirtualCellSelector.js";
|
|
30
|
+
import { roundToDecimalPlaces } from "../../../utils/roundToDecimalPlaces.js";
|
|
31
|
+
import { isJSDOM } from "../../../utils/isJSDOM.js";
|
|
29
32
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
30
33
|
const MINIMUM_COLUMN_WIDTH = 50;
|
|
31
34
|
var ScrollDirection = /*#__PURE__*/function (ScrollDirection) {
|
|
@@ -45,14 +48,6 @@ const createScrollCache = (isRtl, rowBufferPx, columnBufferPx, verticalBuffer, h
|
|
|
45
48
|
direction: ScrollDirection.NONE,
|
|
46
49
|
buffer: bufferForDirection(isRtl, ScrollDirection.NONE, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer)
|
|
47
50
|
});
|
|
48
|
-
let isJSDOM = false;
|
|
49
|
-
try {
|
|
50
|
-
if (typeof window !== 'undefined') {
|
|
51
|
-
isJSDOM = /jsdom/.test(window.navigator.userAgent);
|
|
52
|
-
}
|
|
53
|
-
} catch (_) {
|
|
54
|
-
/* ignore */
|
|
55
|
-
}
|
|
56
51
|
export const useGridVirtualScroller = () => {
|
|
57
52
|
const apiRef = useGridPrivateApiContext();
|
|
58
53
|
const rootProps = useGridRootProps();
|
|
@@ -65,20 +60,13 @@ export const useGridVirtualScroller = () => {
|
|
|
65
60
|
const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
|
|
66
61
|
const outerSize = dimensions.viewportOuterSize;
|
|
67
62
|
const pinnedRows = useGridSelector(apiRef, gridPinnedRowsSelector);
|
|
68
|
-
const pinnedColumnDefinitions =
|
|
69
|
-
const pinnedColumns = listView ?
|
|
70
|
-
left: [],
|
|
71
|
-
right: []
|
|
72
|
-
} : pinnedColumnDefinitions;
|
|
63
|
+
const pinnedColumnDefinitions = gridVisiblePinnedColumnDefinitionsSelector(apiRef);
|
|
64
|
+
const pinnedColumns = listView ? EMPTY_PINNED_COLUMN_FIELDS : pinnedColumnDefinitions;
|
|
73
65
|
const hasBottomPinnedRows = pinnedRows.bottom.length > 0;
|
|
74
66
|
const [panels, setPanels] = React.useState(EMPTY_DETAIL_PANELS);
|
|
75
67
|
const isRtl = useRtl();
|
|
76
|
-
const cellFocus = useGridSelector(apiRef, gridFocusCellSelector);
|
|
77
|
-
const cellTabIndex = useGridSelector(apiRef, gridTabIndexCellSelector);
|
|
78
|
-
const rowsMeta = useGridSelector(apiRef, gridRowsMetaSelector);
|
|
79
68
|
const selectedRowsLookup = useGridSelector(apiRef, selectedIdsLookupSelector);
|
|
80
|
-
const currentPage = useGridVisibleRows(apiRef
|
|
81
|
-
const gridRootRef = apiRef.current.rootElementRef;
|
|
69
|
+
const currentPage = useGridVisibleRows(apiRef);
|
|
82
70
|
const mainRef = apiRef.current.mainElementRef;
|
|
83
71
|
const scrollerRef = apiRef.current.virtualScrollerRef;
|
|
84
72
|
const scrollbarVerticalRef = apiRef.current.virtualScrollbarVerticalRef;
|
|
@@ -86,7 +74,49 @@ export const useGridVirtualScroller = () => {
|
|
|
86
74
|
const contentHeight = dimensions.contentSize.height;
|
|
87
75
|
const columnsTotalWidth = dimensions.columnsTotalWidth;
|
|
88
76
|
const hasColSpan = useGridSelector(apiRef, gridHasColSpanSelector);
|
|
89
|
-
|
|
77
|
+
const isRenderContextReady = React.useRef(false);
|
|
78
|
+
const previousSize = React.useRef(null);
|
|
79
|
+
const mainRefCallback = React.useCallback(node => {
|
|
80
|
+
mainRef.current = node;
|
|
81
|
+
if (!node) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
const initialRect = node.getBoundingClientRect();
|
|
85
|
+
let lastSize = {
|
|
86
|
+
width: roundToDecimalPlaces(initialRect.width, 1),
|
|
87
|
+
height: roundToDecimalPlaces(initialRect.height, 1)
|
|
88
|
+
};
|
|
89
|
+
if (!previousSize.current || lastSize.width !== previousSize.current.width && lastSize.height !== previousSize.current.height) {
|
|
90
|
+
previousSize.current = lastSize;
|
|
91
|
+
apiRef.current.publishEvent('resize', lastSize);
|
|
92
|
+
}
|
|
93
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
const observer = new ResizeObserver(entries => {
|
|
97
|
+
const entry = entries[0];
|
|
98
|
+
if (!entry) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const newSize = {
|
|
102
|
+
width: roundToDecimalPlaces(entry.contentRect.width, 1),
|
|
103
|
+
height: roundToDecimalPlaces(entry.contentRect.height, 1)
|
|
104
|
+
};
|
|
105
|
+
if (newSize.width === lastSize.width && newSize.height === lastSize.height) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
apiRef.current.publishEvent('resize', newSize);
|
|
109
|
+
lastSize = newSize;
|
|
110
|
+
});
|
|
111
|
+
observer.observe(node);
|
|
112
|
+
if (reactMajor >= 19) {
|
|
113
|
+
return () => {
|
|
114
|
+
mainRef.current = null;
|
|
115
|
+
observer.disconnect();
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
return undefined;
|
|
119
|
+
}, [apiRef, mainRef]);
|
|
90
120
|
|
|
91
121
|
/*
|
|
92
122
|
* Scroll context logic
|
|
@@ -103,17 +133,15 @@ export const useGridVirtualScroller = () => {
|
|
|
103
133
|
* work that's not necessary. Thus we store the context at the start of the scroll in `frozenContext`, and the rows
|
|
104
134
|
* that are part of this old context will keep their same render context as to avoid re-rendering.
|
|
105
135
|
*/
|
|
106
|
-
const scrollPosition = React.useRef(EMPTY_SCROLL_POSITION);
|
|
136
|
+
const scrollPosition = React.useRef(rootProps.initialState?.scroll ?? EMPTY_SCROLL_POSITION);
|
|
137
|
+
const ignoreNextScrollEvent = React.useRef(false);
|
|
107
138
|
const previousContextScrollPosition = React.useRef(EMPTY_SCROLL_POSITION);
|
|
108
139
|
const previousRowContext = React.useRef(EMPTY_RENDER_CONTEXT);
|
|
109
140
|
const renderContext = useGridSelector(apiRef, gridRenderContextSelector);
|
|
141
|
+
const focusedVirtualCell = useGridSelector(apiRef, gridFocusedVirtualCellSelector);
|
|
110
142
|
const scrollTimeout = useTimeout();
|
|
111
143
|
const frozenContext = React.useRef(undefined);
|
|
112
144
|
const scrollCache = useLazyRef(() => createScrollCache(isRtl, rootProps.rowBufferPx, rootProps.columnBufferPx, dimensions.rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6)).current;
|
|
113
|
-
const focusedCell = {
|
|
114
|
-
rowIndex: React.useMemo(() => cellFocus ? currentPage.rows.findIndex(row => row.id === cellFocus.id) : -1, [cellFocus, currentPage.rows]),
|
|
115
|
-
columnIndex: React.useMemo(() => cellFocus ? visibleColumns.findIndex(column => column.field === cellFocus.field) : -1, [cellFocus, visibleColumns])
|
|
116
|
-
};
|
|
117
145
|
const updateRenderContext = React.useCallback(nextRenderContext => {
|
|
118
146
|
if (areRenderContextsEqual(nextRenderContext, apiRef.current.state.virtualization.renderContext)) {
|
|
119
147
|
return;
|
|
@@ -137,9 +165,17 @@ export const useGridVirtualScroller = () => {
|
|
|
137
165
|
previousContextScrollPosition.current = scrollPosition.current;
|
|
138
166
|
}, [apiRef, dimensions.isReady]);
|
|
139
167
|
const triggerUpdateRenderContext = useEventCallback(() => {
|
|
168
|
+
const scroller = scrollerRef.current;
|
|
169
|
+
if (!scroller) {
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
172
|
+
const maxScrollTop = Math.ceil(dimensions.minimumSize.height - dimensions.viewportOuterSize.height);
|
|
173
|
+
const maxScrollLeft = Math.ceil(dimensions.minimumSize.width - dimensions.viewportInnerSize.width);
|
|
174
|
+
|
|
175
|
+
// Clamp the scroll position to the viewport to avoid re-calculating the render context for scroll bounce
|
|
140
176
|
const newScroll = {
|
|
141
|
-
top:
|
|
142
|
-
left:
|
|
177
|
+
top: clamp(scroller.scrollTop, 0, maxScrollTop),
|
|
178
|
+
left: isRtl ? clamp(scroller.scrollLeft, -maxScrollLeft, 0) : clamp(scroller.scrollLeft, 0, maxScrollLeft)
|
|
143
179
|
};
|
|
144
180
|
const dx = newScroll.left - scrollPosition.current.left;
|
|
145
181
|
const dy = newScroll.top - scrollPosition.current.top;
|
|
@@ -192,30 +228,15 @@ export const useGridVirtualScroller = () => {
|
|
|
192
228
|
frozenContext.current = undefined;
|
|
193
229
|
updateRenderContext(nextRenderContext);
|
|
194
230
|
};
|
|
195
|
-
const handleScroll = useEventCallback(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
scrollLeft
|
|
199
|
-
} = event.currentTarget;
|
|
200
|
-
|
|
201
|
-
// On iOS and macOS, negative offsets are possible when swiping past the start
|
|
202
|
-
if (scrollTop < 0) {
|
|
231
|
+
const handleScroll = useEventCallback(() => {
|
|
232
|
+
if (ignoreNextScrollEvent.current) {
|
|
233
|
+
ignoreNextScrollEvent.current = false;
|
|
203
234
|
return;
|
|
204
235
|
}
|
|
205
|
-
if (!isRtl) {
|
|
206
|
-
if (scrollLeft < 0) {
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
if (isRtl) {
|
|
211
|
-
if (scrollLeft > 0) {
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
236
|
const nextRenderContext = triggerUpdateRenderContext();
|
|
216
237
|
apiRef.current.publishEvent('scrollPositionChange', {
|
|
217
|
-
top:
|
|
218
|
-
left:
|
|
238
|
+
top: scrollPosition.current.top,
|
|
239
|
+
left: scrollPosition.current.left,
|
|
219
240
|
renderContext: nextRenderContext
|
|
220
241
|
});
|
|
221
242
|
});
|
|
@@ -251,14 +272,14 @@ export const useGridVirtualScroller = () => {
|
|
|
251
272
|
const lastRowToRender = Math.min(baseRenderContext.lastRowIndex, rowModels.length);
|
|
252
273
|
const rowIndexes = params.rows ? range(0, params.rows.length) : range(firstRowToRender, lastRowToRender);
|
|
253
274
|
let virtualRowIndex = -1;
|
|
254
|
-
if (!isPinnedSection &&
|
|
255
|
-
if (
|
|
256
|
-
|
|
257
|
-
|
|
275
|
+
if (!isPinnedSection && focusedVirtualCell) {
|
|
276
|
+
if (focusedVirtualCell.rowIndex < firstRowToRender) {
|
|
277
|
+
rowIndexes.unshift(focusedVirtualCell.rowIndex);
|
|
278
|
+
virtualRowIndex = focusedVirtualCell.rowIndex;
|
|
258
279
|
}
|
|
259
|
-
if (
|
|
260
|
-
|
|
261
|
-
|
|
280
|
+
if (focusedVirtualCell.rowIndex > lastRowToRender) {
|
|
281
|
+
rowIndexes.push(focusedVirtualCell.rowIndex);
|
|
282
|
+
virtualRowIndex = focusedVirtualCell.rowIndex;
|
|
262
283
|
}
|
|
263
284
|
}
|
|
264
285
|
const rows = [];
|
|
@@ -298,7 +319,6 @@ export const useGridVirtualScroller = () => {
|
|
|
298
319
|
});
|
|
299
320
|
}
|
|
300
321
|
}
|
|
301
|
-
const hasFocus = cellFocus?.id === id;
|
|
302
322
|
const baseRowHeight = !apiRef.current.rowHasAutoHeight(id) ? apiRef.current.unstable_getRowHeight(id) : 'auto';
|
|
303
323
|
let isSelected;
|
|
304
324
|
if (selectedRowsLookup[id] == null) {
|
|
@@ -323,39 +343,37 @@ export const useGridVirtualScroller = () => {
|
|
|
323
343
|
isLastVisible = isLastVisibleInSection;
|
|
324
344
|
}
|
|
325
345
|
}
|
|
326
|
-
const isVirtualRow = rowIndexInPage === virtualRowIndex;
|
|
327
|
-
const isNotVisible = isVirtualRow;
|
|
328
|
-
let tabbableCell = null;
|
|
329
|
-
if (cellTabIndex !== null && cellTabIndex.id === id) {
|
|
330
|
-
const cellParams = apiRef.current.getCellParams(id, cellTabIndex.field);
|
|
331
|
-
tabbableCell = cellParams.cellMode === 'view' ? cellTabIndex.field : null;
|
|
332
|
-
}
|
|
333
346
|
let currentRenderContext = baseRenderContext;
|
|
334
347
|
if (!isPinnedSection && frozenContext.current && rowIndexInPage >= frozenContext.current.firstRowIndex && rowIndexInPage < frozenContext.current.lastRowIndex) {
|
|
335
348
|
currentRenderContext = frozenContext.current;
|
|
336
349
|
}
|
|
350
|
+
const isVirtualFocusRow = rowIndexInPage === virtualRowIndex;
|
|
351
|
+
const isVirtualFocusColumn = focusedVirtualCell?.rowIndex === rowIndex;
|
|
337
352
|
const offsetLeft = computeOffsetLeft(columnPositions, currentRenderContext, pinnedColumns.left.length);
|
|
338
353
|
const showBottomBorder = isLastVisibleInSection && params.position === 'top';
|
|
354
|
+
const firstColumnIndex = currentRenderContext.firstColumnIndex;
|
|
355
|
+
const lastColumnIndex = currentRenderContext.lastColumnIndex;
|
|
339
356
|
rows.push(/*#__PURE__*/_jsx(rootProps.slots.row, _extends({
|
|
340
357
|
row: model,
|
|
341
358
|
rowId: id,
|
|
342
359
|
index: rowIndex,
|
|
343
360
|
selected: isSelected,
|
|
344
|
-
offsetTop: params.rows ? undefined : rowsMeta.positions[rowIndexInPage],
|
|
345
361
|
offsetLeft: offsetLeft,
|
|
346
|
-
|
|
362
|
+
columnsTotalWidth: dimensions.columnsTotalWidth,
|
|
347
363
|
rowHeight: baseRowHeight,
|
|
348
|
-
tabbableCell: tabbableCell,
|
|
349
364
|
pinnedColumns: pinnedColumns,
|
|
350
365
|
visibleColumns: visibleColumns,
|
|
351
|
-
|
|
352
|
-
|
|
366
|
+
firstColumnIndex: firstColumnIndex,
|
|
367
|
+
lastColumnIndex: lastColumnIndex,
|
|
368
|
+
focusedColumnIndex: isVirtualFocusColumn ? focusedVirtualCell.columnIndex : undefined,
|
|
353
369
|
isFirstVisible: isFirstVisible,
|
|
354
370
|
isLastVisible: isLastVisible,
|
|
355
|
-
isNotVisible:
|
|
356
|
-
showBottomBorder: showBottomBorder
|
|
371
|
+
isNotVisible: isVirtualFocusRow,
|
|
372
|
+
showBottomBorder: showBottomBorder,
|
|
373
|
+
scrollbarWidth: dimensions.hasScrollY ? dimensions.scrollbarSize : 0,
|
|
374
|
+
gridHasFiller: dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width
|
|
357
375
|
}, rowProps), id));
|
|
358
|
-
if (
|
|
376
|
+
if (isVirtualFocusRow) {
|
|
359
377
|
return;
|
|
360
378
|
}
|
|
361
379
|
const panel = panels.get(id);
|
|
@@ -386,22 +404,21 @@ export const useGridVirtualScroller = () => {
|
|
|
386
404
|
}
|
|
387
405
|
return size;
|
|
388
406
|
}, [columnsTotalWidth, contentHeight, needsHorizontalScrollbar]);
|
|
389
|
-
React.
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
useEnhancedEffect(() => {
|
|
393
|
-
// FIXME: Is this really necessary?
|
|
394
|
-
apiRef.current.resize();
|
|
395
|
-
}, [apiRef, rowsMeta.currentPageTotalHeight]);
|
|
396
|
-
useEnhancedEffect(() => {
|
|
397
|
-
// TODO a scroll reset should not be necessary
|
|
398
|
-
if (enabledForColumns) {
|
|
399
|
-
scrollerRef.current.scrollLeft = 0;
|
|
407
|
+
const onContentSizeApplied = React.useCallback(node => {
|
|
408
|
+
if (!node) {
|
|
409
|
+
return;
|
|
400
410
|
}
|
|
401
|
-
|
|
402
|
-
|
|
411
|
+
apiRef.current.publishEvent('virtualScrollerContentSizeChange', {
|
|
412
|
+
columnsTotalWidth,
|
|
413
|
+
contentHeight
|
|
414
|
+
});
|
|
415
|
+
}, [apiRef, columnsTotalWidth, contentHeight]);
|
|
416
|
+
useEnhancedEffect(() => {
|
|
417
|
+
if (!isRenderContextReady.current) {
|
|
418
|
+
return;
|
|
403
419
|
}
|
|
404
|
-
|
|
420
|
+
apiRef.current.updateRenderContext?.();
|
|
421
|
+
}, [apiRef, enabledForColumns, enabledForRows]);
|
|
405
422
|
useEnhancedEffect(() => {
|
|
406
423
|
if (listView) {
|
|
407
424
|
scrollerRef.current.scrollLeft = 0;
|
|
@@ -416,6 +433,53 @@ export const useGridVirtualScroller = () => {
|
|
|
416
433
|
left: scrollPosition.current.left,
|
|
417
434
|
renderContext: initialRenderContext
|
|
418
435
|
});
|
|
436
|
+
isRenderContextReady.current = true;
|
|
437
|
+
if (rootProps.initialState?.scroll && scrollerRef.current) {
|
|
438
|
+
const scroller = scrollerRef.current;
|
|
439
|
+
const {
|
|
440
|
+
top,
|
|
441
|
+
left
|
|
442
|
+
} = rootProps.initialState.scroll;
|
|
443
|
+
|
|
444
|
+
// On initial mount, if we have columns available, we can restore the horizontal scroll immediately, but we need to skip the resulting scroll event, otherwise we would recalculate the render context at position top=0, left=restoredValue, but the initial render context is already calculated based on the initial value of scrollPosition ref.
|
|
445
|
+
const isScrollRestored = {
|
|
446
|
+
top: !(top > 0),
|
|
447
|
+
left: !(left > 0)
|
|
448
|
+
};
|
|
449
|
+
if (!isScrollRestored.left && columnsTotalWidth) {
|
|
450
|
+
scroller.scrollLeft = left;
|
|
451
|
+
ignoreNextScrollEvent.current = true;
|
|
452
|
+
isScrollRestored.left = true;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
// For the sake of completeness, but I'm not sure if contentHeight is ever available at this point. Maybe when virtualisation is disabled?
|
|
456
|
+
if (!isScrollRestored.top && contentHeight) {
|
|
457
|
+
scroller.scrollTop = top;
|
|
458
|
+
ignoreNextScrollEvent.current = true;
|
|
459
|
+
isScrollRestored.top = true;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// To restore the vertical scroll, we need to wait until the rows are available in the DOM (otherwise there's nowhere to scroll), but before paint to avoid reflows
|
|
463
|
+
if (!isScrollRestored.top || !isScrollRestored.left) {
|
|
464
|
+
const unsubscribeContentSizeChange = apiRef.current.subscribeEvent('virtualScrollerContentSizeChange', params => {
|
|
465
|
+
if (!isScrollRestored.left && params.columnsTotalWidth) {
|
|
466
|
+
scroller.scrollLeft = left;
|
|
467
|
+
ignoreNextScrollEvent.current = true;
|
|
468
|
+
isScrollRestored.left = true;
|
|
469
|
+
}
|
|
470
|
+
if (!isScrollRestored.top && params.contentHeight) {
|
|
471
|
+
scroller.scrollTop = top;
|
|
472
|
+
ignoreNextScrollEvent.current = true;
|
|
473
|
+
isScrollRestored.top = true;
|
|
474
|
+
}
|
|
475
|
+
if (isScrollRestored.left && isScrollRestored.top) {
|
|
476
|
+
unsubscribeContentSizeChange();
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
return unsubscribeContentSizeChange;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return undefined;
|
|
419
483
|
});
|
|
420
484
|
apiRef.current.register('private', {
|
|
421
485
|
updateRenderContext: forceUpdateRenderContext
|
|
@@ -428,7 +492,7 @@ export const useGridVirtualScroller = () => {
|
|
|
428
492
|
setPanels,
|
|
429
493
|
getRows,
|
|
430
494
|
getContainerProps: () => ({
|
|
431
|
-
ref:
|
|
495
|
+
ref: mainRefCallback
|
|
432
496
|
}),
|
|
433
497
|
getScrollerProps: () => ({
|
|
434
498
|
ref: scrollerRef,
|
|
@@ -443,18 +507,21 @@ export const useGridVirtualScroller = () => {
|
|
|
443
507
|
}),
|
|
444
508
|
getContentProps: () => ({
|
|
445
509
|
style: contentSize,
|
|
446
|
-
role: 'presentation'
|
|
510
|
+
role: 'presentation',
|
|
511
|
+
ref: onContentSizeApplied
|
|
447
512
|
}),
|
|
448
513
|
getRenderZoneProps: () => ({
|
|
449
514
|
role: 'rowgroup'
|
|
450
515
|
}),
|
|
451
516
|
getScrollbarVerticalProps: () => ({
|
|
452
517
|
ref: scrollbarVerticalRef,
|
|
453
|
-
role: 'presentation'
|
|
518
|
+
role: 'presentation',
|
|
519
|
+
scrollPosition
|
|
454
520
|
}),
|
|
455
521
|
getScrollbarHorizontalProps: () => ({
|
|
456
522
|
ref: scrollbarHorizontalRef,
|
|
457
|
-
role: 'presentation'
|
|
523
|
+
role: 'presentation',
|
|
524
|
+
scrollPosition
|
|
458
525
|
})
|
|
459
526
|
};
|
|
460
527
|
};
|
|
@@ -485,7 +552,8 @@ function inputsSelector(apiRef, rootProps, enabledForRows, enabledForColumns) {
|
|
|
485
552
|
pinnedColumns: gridVisiblePinnedColumnDefinitionsSelector(apiRef),
|
|
486
553
|
visibleColumns,
|
|
487
554
|
hiddenCellsOriginMap,
|
|
488
|
-
listView: rootProps.unstable_listView ?? false
|
|
555
|
+
listView: rootProps.unstable_listView ?? false,
|
|
556
|
+
virtualizeColumnsWithAutoRowHeight: rootProps.virtualizeColumnsWithAutoRowHeight
|
|
489
557
|
};
|
|
490
558
|
}
|
|
491
559
|
function computeRenderContext(inputs, scrollPosition, scrollCache) {
|
|
@@ -495,6 +563,11 @@ function computeRenderContext(inputs, scrollPosition, scrollCache) {
|
|
|
495
563
|
firstColumnIndex: 0,
|
|
496
564
|
lastColumnIndex: inputs.visibleColumns.length
|
|
497
565
|
};
|
|
566
|
+
if (inputs.listView) {
|
|
567
|
+
return _extends({}, renderContext, {
|
|
568
|
+
lastColumnIndex: 1
|
|
569
|
+
});
|
|
570
|
+
}
|
|
498
571
|
const {
|
|
499
572
|
top,
|
|
500
573
|
left
|
|
@@ -533,11 +606,13 @@ function computeRenderContext(inputs, scrollPosition, scrollCache) {
|
|
|
533
606
|
positions: inputs.rowsMeta.positions,
|
|
534
607
|
lastSize: inputs.lastRowHeight
|
|
535
608
|
});
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
609
|
+
if (!inputs.virtualizeColumnsWithAutoRowHeight) {
|
|
610
|
+
for (let i = firstRowToRender; i < lastRowToRender && !hasRowWithAutoHeight; i += 1) {
|
|
611
|
+
const row = inputs.rows[i];
|
|
612
|
+
hasRowWithAutoHeight = inputs.apiRef.current.rowHasAutoHeight(row.id);
|
|
613
|
+
}
|
|
539
614
|
}
|
|
540
|
-
if (!hasRowWithAutoHeight) {
|
|
615
|
+
if (!hasRowWithAutoHeight || inputs.virtualizeColumnsWithAutoRowHeight) {
|
|
541
616
|
firstColumnIndex = binarySearch(realLeft, inputs.columnPositions, {
|
|
542
617
|
atStart: true,
|
|
543
618
|
lastPosition: inputs.columnsTotalWidth
|
|
@@ -24,7 +24,7 @@ export function createUseGridApiEventHandler(registryContainer) {
|
|
|
24
24
|
}
|
|
25
25
|
const [objectRetainedByReact] = React.useState(new ObjectToBeRetainedByReact());
|
|
26
26
|
const subscription = React.useRef(null);
|
|
27
|
-
const handlerRef = React.useRef();
|
|
27
|
+
const handlerRef = React.useRef(null);
|
|
28
28
|
handlerRef.current = handler;
|
|
29
29
|
const cleanupTokenRef = React.useRef(null);
|
|
30
30
|
if (!subscription.current && handlerRef.current) {
|
|
@@ -6,20 +6,11 @@ import { useOnMount } from "./useOnMount.js";
|
|
|
6
6
|
function isOutputSelector(selector) {
|
|
7
7
|
return selector.acceptsApiRef;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
function applySelector(apiRef, selector) {
|
|
11
|
-
if (isOutputSelector(selector)) {
|
|
12
|
-
return selector(apiRef);
|
|
13
|
-
}
|
|
14
|
-
return selector(apiRef.current.state);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// TODO v8: Rename this function to `applySelector`
|
|
18
|
-
function applySelectorV8(apiRef, selector, args, instanceId) {
|
|
9
|
+
function applySelector(apiRef, selector, args, instanceId) {
|
|
19
10
|
if (isOutputSelector(selector)) {
|
|
20
11
|
return selector(apiRef, args);
|
|
21
12
|
}
|
|
22
|
-
return selector(apiRef.current.state, instanceId);
|
|
13
|
+
return selector(apiRef.current.state, args, instanceId);
|
|
23
14
|
}
|
|
24
15
|
const defaultCompare = Object.is;
|
|
25
16
|
export const objectShallowCompare = fastObjectShallowCompare;
|
|
@@ -44,36 +35,7 @@ const createRefs = () => ({
|
|
|
44
35
|
selector: null,
|
|
45
36
|
args: null
|
|
46
37
|
});
|
|
47
|
-
|
|
48
|
-
// TODO v8: Remove this function
|
|
49
|
-
export const useGridSelector = (apiRef, selector, equals = defaultCompare) => {
|
|
50
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
51
|
-
if (!apiRef.current.state) {
|
|
52
|
-
warnOnce(['MUI X: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
const refs = useLazyRef(createRefs);
|
|
56
|
-
const didInit = refs.current.selector !== null;
|
|
57
|
-
const [state, setState] = React.useState(
|
|
58
|
-
// We don't use an initialization function to avoid allocations
|
|
59
|
-
didInit ? null : applySelector(apiRef, selector));
|
|
60
|
-
refs.current.state = state;
|
|
61
|
-
refs.current.equals = equals;
|
|
62
|
-
refs.current.selector = selector;
|
|
63
|
-
useOnMount(() => {
|
|
64
|
-
return apiRef.current.store.subscribe(() => {
|
|
65
|
-
const newState = applySelector(apiRef, refs.current.selector);
|
|
66
|
-
if (!refs.current.equals(refs.current.state, newState)) {
|
|
67
|
-
refs.current.state = newState;
|
|
68
|
-
setState(newState);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
return state;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
// TODO v8: Rename this function to `useGridSelector`
|
|
76
|
-
export const useGridSelectorV8 = (apiRef, selector, args = undefined, equals = defaultCompare) => {
|
|
38
|
+
export const useGridSelector = (apiRef, selector, args = undefined, equals = defaultCompare) => {
|
|
77
39
|
if (process.env.NODE_ENV !== 'production') {
|
|
78
40
|
if (!apiRef.current.state) {
|
|
79
41
|
warnOnce(['MUI X: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);
|
|
@@ -83,14 +45,14 @@ export const useGridSelectorV8 = (apiRef, selector, args = undefined, equals = d
|
|
|
83
45
|
const didInit = refs.current.selector !== null;
|
|
84
46
|
const [state, setState] = React.useState(
|
|
85
47
|
// We don't use an initialization function to avoid allocations
|
|
86
|
-
didInit ? null :
|
|
48
|
+
didInit ? null : applySelector(apiRef, selector, args, apiRef.current.instanceId));
|
|
87
49
|
refs.current.state = state;
|
|
88
50
|
refs.current.equals = equals;
|
|
89
51
|
refs.current.selector = selector;
|
|
90
52
|
const prevArgs = refs.current.args;
|
|
91
53
|
refs.current.args = args;
|
|
92
54
|
if (didInit && !argsEqual(prevArgs, args)) {
|
|
93
|
-
const newState =
|
|
55
|
+
const newState = applySelector(apiRef, refs.current.selector, refs.current.args, apiRef.current.instanceId);
|
|
94
56
|
if (!refs.current.equals(refs.current.state, newState)) {
|
|
95
57
|
refs.current.state = newState;
|
|
96
58
|
setState(newState);
|
|
@@ -98,7 +60,7 @@ export const useGridSelectorV8 = (apiRef, selector, args = undefined, equals = d
|
|
|
98
60
|
}
|
|
99
61
|
useOnMount(() => {
|
|
100
62
|
return apiRef.current.store.subscribe(() => {
|
|
101
|
-
const newState =
|
|
63
|
+
const newState = applySelector(apiRef, refs.current.selector, refs.current.args, apiRef.current.instanceId);
|
|
102
64
|
if (!refs.current.equals(refs.current.state, newState)) {
|
|
103
65
|
refs.current.state = newState;
|
|
104
66
|
setState(newState);
|
|
@@ -1,27 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { gridExpandedSortedRowEntriesSelector } from "../features/filter/gridFilterSelector.js";
|
|
1
|
+
import { gridVisibleRowsSelector } from "../features/pagination/gridPaginationSelector.js";
|
|
2
|
+
import { useGridSelector } from "./index.js";
|
|
4
3
|
export const getVisibleRows = (apiRef, props) => {
|
|
5
|
-
|
|
6
|
-
let range;
|
|
7
|
-
if (props.pagination && props.paginationMode === 'client') {
|
|
8
|
-
range = gridPaginationRowRangeSelector(apiRef);
|
|
9
|
-
rows = gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef);
|
|
10
|
-
} else {
|
|
11
|
-
rows = gridExpandedSortedRowEntriesSelector(apiRef);
|
|
12
|
-
if (rows.length === 0) {
|
|
13
|
-
range = null;
|
|
14
|
-
} else {
|
|
15
|
-
range = {
|
|
16
|
-
firstRowIndex: 0,
|
|
17
|
-
lastRowIndex: rows.length - 1
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
rows,
|
|
23
|
-
range
|
|
24
|
-
};
|
|
4
|
+
return gridVisibleRowsSelector(apiRef);
|
|
25
5
|
};
|
|
26
6
|
|
|
27
7
|
/**
|
|
@@ -31,10 +11,7 @@ export const getVisibleRows = (apiRef, props) => {
|
|
|
31
11
|
* - If the row tree has several layers, it contains up to `state.pageSize` top level rows and all their descendants.
|
|
32
12
|
* - If the row tree is flat, it only contains up to `state.pageSize` rows.
|
|
33
13
|
*/
|
|
14
|
+
|
|
34
15
|
export const useGridVisibleRows = (apiRef, props) => {
|
|
35
|
-
|
|
36
|
-
return React.useMemo(() => ({
|
|
37
|
-
rows: response.rows,
|
|
38
|
-
range: response.range
|
|
39
|
-
}), [response.rows, response.range]);
|
|
16
|
+
return useGridSelector(apiRef, gridVisibleRowsSelector);
|
|
40
17
|
};
|
package/modern/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
export const GRID_TREE_DATA_GROUPING_FIELD = '__tree_data_group__';
|
|
2
2
|
export const GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = '__row_group_by_columns_group__';
|
|
3
|
-
export const GRID_DETAIL_PANEL_TOGGLE_FIELD = '__detail_panel_toggle__';
|
|
3
|
+
export const GRID_DETAIL_PANEL_TOGGLE_FIELD = '__detail_panel_toggle__';
|
|
4
|
+
export let PinnedColumnPosition = /*#__PURE__*/function (PinnedColumnPosition) {
|
|
5
|
+
PinnedColumnPosition[PinnedColumnPosition["NONE"] = 0] = "NONE";
|
|
6
|
+
PinnedColumnPosition[PinnedColumnPosition["LEFT"] = 1] = "LEFT";
|
|
7
|
+
PinnedColumnPosition[PinnedColumnPosition["RIGHT"] = 2] = "RIGHT";
|
|
8
|
+
PinnedColumnPosition[PinnedColumnPosition["VIRTUAL"] = 3] = "VIRTUAL";
|
|
9
|
+
return PinnedColumnPosition;
|
|
10
|
+
}({});
|