@mui/x-data-grid 8.0.0-alpha.0 → 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 +2215 -119
- 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 +3 -3
- 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 +3 -3
- package/components/GridLoadingOverlay.js +14 -12
- 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 +52 -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 +2 -0
- package/components/columnsManagement/GridColumnsManagement.js +81 -11
- 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 +36 -12
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +12 -0
- 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 +34 -69
- 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 +7 -4
- package/internals/index.js +5 -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 +14 -0
- package/locales/beBY.js +13 -0
- package/locales/bgBG.js +15 -0
- package/locales/csCZ.js +15 -0
- package/locales/daDK.js +15 -0
- package/locales/deDE.js +13 -0
- package/locales/elGR.js +14 -0
- package/locales/esES.js +17 -4
- package/locales/faIR.js +18 -4
- package/locales/fiFI.js +15 -0
- package/locales/frFR.js +15 -0
- package/locales/heIL.js +17 -4
- package/locales/hrHR.js +15 -0
- package/locales/huHU.js +15 -0
- package/locales/isIS.js +14 -0
- package/locales/itIT.js +15 -0
- package/locales/jaJP.js +15 -0
- package/locales/koKR.js +47 -37
- package/locales/nbNO.js +15 -0
- package/locales/nlNL.js +18 -4
- package/locales/nnNO.js +15 -0
- package/locales/plPL.js +15 -0
- package/locales/ptBR.js +13 -0
- package/locales/ptPT.js +13 -0
- package/locales/roRO.js +21 -9
- package/locales/ruRU.js +15 -0
- package/locales/skSK.js +14 -0
- package/locales/svSE.js +19 -5
- package/locales/trTR.js +15 -2
- package/locales/ukUA.js +14 -0
- package/locales/urPK.js +22 -9
- package/locales/viVN.js +15 -0
- package/locales/zhCN.js +17 -4
- package/locales/zhHK.js +14 -0
- package/locales/zhTW.js +14 -0
- 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 +11 -0
- 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 +38 -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 +13 -13
- 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 +14 -12
- 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 +52 -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 +81 -11
- 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 +12 -0
- 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 +34 -69
- 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 +5 -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 +14 -0
- package/modern/locales/beBY.js +13 -0
- package/modern/locales/bgBG.js +15 -0
- package/modern/locales/csCZ.js +15 -0
- package/modern/locales/daDK.js +15 -0
- package/modern/locales/deDE.js +13 -0
- package/modern/locales/elGR.js +14 -0
- package/modern/locales/esES.js +17 -4
- package/modern/locales/faIR.js +18 -4
- package/modern/locales/fiFI.js +15 -0
- package/modern/locales/frFR.js +15 -0
- package/modern/locales/heIL.js +17 -4
- package/modern/locales/hrHR.js +15 -0
- package/modern/locales/huHU.js +15 -0
- package/modern/locales/isIS.js +14 -0
- package/modern/locales/itIT.js +15 -0
- package/modern/locales/jaJP.js +15 -0
- package/modern/locales/koKR.js +47 -37
- package/modern/locales/nbNO.js +15 -0
- package/modern/locales/nlNL.js +18 -4
- package/modern/locales/nnNO.js +15 -0
- package/modern/locales/plPL.js +15 -0
- package/modern/locales/ptBR.js +13 -0
- package/modern/locales/ptPT.js +13 -0
- package/modern/locales/roRO.js +21 -9
- package/modern/locales/ruRU.js +15 -0
- package/modern/locales/skSK.js +14 -0
- package/modern/locales/svSE.js +19 -5
- package/modern/locales/trTR.js +15 -2
- package/modern/locales/ukUA.js +14 -0
- package/modern/locales/urPK.js +22 -9
- package/modern/locales/viVN.js +15 -0
- package/modern/locales/zhCN.js +17 -4
- package/modern/locales/zhHK.js +14 -0
- package/modern/locales/zhTW.js +14 -0
- 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 +14 -12
- 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 +51 -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 +81 -11
- 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 +12 -0
- 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 +32 -67
- 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 +36 -24
- 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 +14 -0
- package/node/locales/beBY.js +13 -0
- package/node/locales/bgBG.js +15 -0
- package/node/locales/csCZ.js +15 -0
- package/node/locales/daDK.js +15 -0
- package/node/locales/deDE.js +13 -0
- package/node/locales/elGR.js +14 -0
- package/node/locales/esES.js +17 -4
- package/node/locales/faIR.js +18 -4
- package/node/locales/fiFI.js +15 -0
- package/node/locales/frFR.js +15 -0
- package/node/locales/heIL.js +17 -4
- package/node/locales/hrHR.js +15 -0
- package/node/locales/huHU.js +15 -0
- package/node/locales/isIS.js +14 -0
- package/node/locales/itIT.js +15 -0
- package/node/locales/jaJP.js +15 -0
- package/node/locales/koKR.js +47 -37
- package/node/locales/nbNO.js +15 -0
- package/node/locales/nlNL.js +18 -4
- package/node/locales/nnNO.js +15 -0
- package/node/locales/plPL.js +15 -0
- package/node/locales/ptBR.js +13 -0
- package/node/locales/ptPT.js +13 -0
- package/node/locales/roRO.js +21 -9
- package/node/locales/ruRU.js +15 -0
- package/node/locales/skSK.js +14 -0
- package/node/locales/svSE.js +19 -5
- package/node/locales/trTR.js +15 -2
- package/node/locales/ukUA.js +14 -0
- package/node/locales/urPK.js +22 -9
- package/node/locales/viVN.js +15 -0
- package/node/locales/zhCN.js +17 -4
- package/node/locales/zhHK.js +14 -0
- package/node/locales/zhTW.js +14 -0
- 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 +5 -5
- 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 -384
- 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 -384
- 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 -392
- /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
|
+
});
|
|
@@ -10,27 +10,27 @@ export declare const gridVirtualizationSelector: (state: GridStateCommunity) =>
|
|
|
10
10
|
* @category Virtualization
|
|
11
11
|
* @deprecated Use `gridVirtualizationColumnEnabledSelector` and `gridVirtualizationRowEnabledSelector`
|
|
12
12
|
*/
|
|
13
|
-
export declare const gridVirtualizationEnabledSelector: import("../../..").OutputSelector<GridStateCommunity, boolean>;
|
|
13
|
+
export declare const gridVirtualizationEnabledSelector: import("../../..").OutputSelector<GridStateCommunity, import("./useGridVirtualization").GridVirtualizationState, boolean>;
|
|
14
14
|
/**
|
|
15
15
|
* Get the enabled state for column virtualization
|
|
16
16
|
* @category Virtualization
|
|
17
17
|
*/
|
|
18
|
-
export declare const gridVirtualizationColumnEnabledSelector: import("../../..").OutputSelector<GridStateCommunity, boolean>;
|
|
18
|
+
export declare const gridVirtualizationColumnEnabledSelector: import("../../..").OutputSelector<GridStateCommunity, import("./useGridVirtualization").GridVirtualizationState, boolean>;
|
|
19
19
|
/**
|
|
20
20
|
* Get the enabled state for row virtualization
|
|
21
21
|
* @category Virtualization
|
|
22
22
|
*/
|
|
23
|
-
export declare const gridVirtualizationRowEnabledSelector: import("../../..").OutputSelector<GridStateCommunity, boolean>;
|
|
23
|
+
export declare const gridVirtualizationRowEnabledSelector: import("../../..").OutputSelector<GridStateCommunity, import("./useGridVirtualization").GridVirtualizationState, boolean>;
|
|
24
24
|
/**
|
|
25
25
|
* Get the render context
|
|
26
26
|
* @category Virtualization
|
|
27
27
|
* @ignore - do not document.
|
|
28
28
|
*/
|
|
29
|
-
export declare const gridRenderContextSelector: import("../../..").OutputSelector<GridStateCommunity, import("../../..").GridRenderContext>;
|
|
29
|
+
export declare const gridRenderContextSelector: import("../../..").OutputSelector<GridStateCommunity, import("./useGridVirtualization").GridVirtualizationState, import("../../..").GridRenderContext>;
|
|
30
30
|
/**
|
|
31
31
|
* Get the render context, with only columns filled in.
|
|
32
32
|
* This is cached, so it can be used to only re-render when the column interval changes.
|
|
33
33
|
* @category Virtualization
|
|
34
34
|
* @ignore - do not document.
|
|
35
35
|
*/
|
|
36
|
-
export declare const gridRenderContextColumnsSelector: import("../../..").OutputSelector<GridStateCommunity, GridColumnsRenderContext>;
|
|
36
|
+
export declare const gridRenderContextColumnsSelector: import("../../..").OutputSelector<GridStateCommunity, number, GridColumnsRenderContext>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridPinnedRowsPosition } from '../rows/gridRowsInterfaces';
|
|
3
|
-
import type
|
|
3
|
+
import { type GridRenderContext, type GridColumnsRenderContext, type GridRowEntry, type GridRowId } from '../../../models';
|
|
4
4
|
export type VirtualScroller = ReturnType<typeof useGridVirtualScroller>;
|
|
5
5
|
export declare const EMPTY_DETAIL_PANELS: Readonly<Map<GridRowId, React.ReactNode>>;
|
|
6
6
|
export declare const useGridVirtualScroller: () => {
|
|
@@ -12,11 +12,11 @@ export declare const useGridVirtualScroller: () => {
|
|
|
12
12
|
renderContext?: GridRenderContext;
|
|
13
13
|
}) => React.ReactNode[];
|
|
14
14
|
getContainerProps: () => {
|
|
15
|
-
ref:
|
|
15
|
+
ref: (node: HTMLDivElement | null) => (() => void) | undefined;
|
|
16
16
|
};
|
|
17
17
|
getScrollerProps: () => {
|
|
18
|
-
ref: React.RefObject<HTMLDivElement>;
|
|
19
|
-
onScroll: (
|
|
18
|
+
ref: React.RefObject<HTMLDivElement | null>;
|
|
19
|
+
onScroll: () => void;
|
|
20
20
|
onWheel: (event: React.WheelEvent) => void;
|
|
21
21
|
onTouchMove: (event: React.TouchEvent) => void;
|
|
22
22
|
style: React.CSSProperties;
|
|
@@ -26,17 +26,26 @@ export declare const useGridVirtualScroller: () => {
|
|
|
26
26
|
getContentProps: () => {
|
|
27
27
|
style: React.CSSProperties;
|
|
28
28
|
role: string;
|
|
29
|
+
ref: (node: HTMLDivElement | null) => void;
|
|
29
30
|
};
|
|
30
31
|
getRenderZoneProps: () => {
|
|
31
32
|
role: string;
|
|
32
33
|
};
|
|
33
34
|
getScrollbarVerticalProps: () => {
|
|
34
|
-
ref: React.RefObject<HTMLDivElement>;
|
|
35
|
+
ref: React.RefObject<HTMLDivElement | null>;
|
|
35
36
|
role: string;
|
|
37
|
+
scrollPosition: React.RefObject<{
|
|
38
|
+
top: number;
|
|
39
|
+
left: number;
|
|
40
|
+
}>;
|
|
36
41
|
};
|
|
37
42
|
getScrollbarHorizontalProps: () => {
|
|
38
|
-
ref: React.RefObject<HTMLDivElement>;
|
|
43
|
+
ref: React.RefObject<HTMLDivElement | null>;
|
|
39
44
|
role: string;
|
|
45
|
+
scrollPosition: React.RefObject<{
|
|
46
|
+
top: number;
|
|
47
|
+
left: number;
|
|
48
|
+
}>;
|
|
40
49
|
};
|
|
41
50
|
};
|
|
42
51
|
export declare function areRenderContextsEqual(context1: GridRenderContext, context2: GridRenderContext): boolean;
|
|
@@ -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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridRenderContext } from '../../../models';
|
|
3
3
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
4
4
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
@@ -17,5 +17,5 @@ export declare const EMPTY_RENDER_CONTEXT: {
|
|
|
17
17
|
lastColumnIndex: number;
|
|
18
18
|
};
|
|
19
19
|
export declare const virtualizationStateInitializer: GridStateInitializer<RootProps>;
|
|
20
|
-
export declare function useGridVirtualization(apiRef:
|
|
20
|
+
export declare function useGridVirtualization(apiRef: RefObject<GridPrivateApiCommunity>, props: RootProps): void;
|
|
21
21
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridApiCommon } from '../../models/api/gridApiCommon';
|
|
3
3
|
import { GridApiCommunity } from '../../models/api/gridApiCommunity';
|
|
4
|
-
export declare function useGridApiContext<Api extends GridApiCommon = GridApiCommunity>():
|
|
4
|
+
export declare function useGridApiContext<Api extends GridApiCommon = GridApiCommunity>(): RefObject<Api>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { EventListenerOptions } from '@mui/x-internals/EventManager';
|
|
3
3
|
import { GridEventListener, GridEvents } from '../../models/events';
|
|
4
4
|
import { CleanupTracking } from '../../utils/cleanupTracking/CleanupTracking';
|
|
@@ -15,8 +15,8 @@ declare enum GridSignature {
|
|
|
15
15
|
interface RegistryContainer {
|
|
16
16
|
registry: CleanupTracking | null;
|
|
17
17
|
}
|
|
18
|
-
export declare function createUseGridApiEventHandler(registryContainer: RegistryContainer): <Api extends GridApiCommon, E extends GridEvents>(apiRef:
|
|
18
|
+
export declare function createUseGridApiEventHandler(registryContainer: RegistryContainer): <Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E>, options?: EventListenerOptions) => void;
|
|
19
19
|
export declare const unstable_resetCleanupTracking: () => void;
|
|
20
|
-
export declare const useGridApiEventHandler: <Api extends GridApiCommon, E extends GridEvents>(apiRef:
|
|
21
|
-
export declare function useGridApiOptionHandler<Api extends GridApiCommon, E extends GridEvents>(apiRef:
|
|
20
|
+
export declare const useGridApiEventHandler: <Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E>, options?: EventListenerOptions) => void;
|
|
21
|
+
export declare function useGridApiOptionHandler<Api extends GridApiCommon, E extends GridEvents>(apiRef: RefObject<Api>, eventName: E, handler?: GridEventListener<E>): void;
|
|
22
22
|
export { GridSignature };
|
|
@@ -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) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
|
|
3
3
|
type GetPublicApiType<PrivateApi> = PrivateApi extends {
|
|
4
4
|
getPublicApi: () => infer PublicApi;
|
|
5
5
|
} ? PublicApi : never;
|
|
6
|
-
export declare function useGridApiMethod<PrivateApi extends GridPrivateApiCommon, PublicApi extends GetPublicApiType<PrivateApi>, PrivateOnlyApi extends Omit<PrivateApi, keyof PublicApi>, V extends 'public' | 'private', T extends V extends 'public' ? Partial<PublicApi> : Partial<PrivateOnlyApi>>(privateApiRef:
|
|
6
|
+
export declare function useGridApiMethod<PrivateApi extends GridPrivateApiCommon, PublicApi extends GetPublicApiType<PrivateApi>, PrivateOnlyApi extends Omit<PrivateApi, keyof PublicApi>, V extends 'public' | 'private', T extends V extends 'public' ? Partial<PublicApi> : Partial<PrivateOnlyApi>>(privateApiRef: RefObject<PrivateApi>, apiMethods: T, visibility: V): void;
|
|
7
7
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridApiCommon } from '../../models';
|
|
3
3
|
import { GridApiCommunity } from '../../models/api/gridApiCommunity';
|
|
4
4
|
/**
|
|
5
5
|
* Hook that instantiate a [[GridApiRef]].
|
|
6
6
|
*/
|
|
7
|
-
export declare const useGridApiRef: <Api extends GridApiCommon = GridApiCommunity>() =>
|
|
7
|
+
export declare const useGridApiRef: <Api extends GridApiCommon = GridApiCommunity>() => RefObject<Api | null>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
|
|
3
3
|
import { GridPrivateApiCommunity } from '../../models/api/gridApiCommunity';
|
|
4
4
|
import { DataGridProcessedProps } from '../../models/props/DataGridProps';
|
|
5
5
|
type DeepPartial<T> = {
|
|
6
6
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
7
7
|
};
|
|
8
|
-
export type GridStateInitializer<P extends Partial<DataGridProcessedProps> = DataGridProcessedProps, PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity> = (state: DeepPartial<PrivateApi['state']>, props: P, privateApiRef:
|
|
9
|
-
export declare const useGridInitializeState: <P extends Partial<DataGridProcessedProps>, PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity>(initializer: GridStateInitializer<P, PrivateApi>, privateApiRef:
|
|
8
|
+
export type GridStateInitializer<P extends Partial<DataGridProcessedProps> = DataGridProcessedProps, PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity> = (state: DeepPartial<PrivateApi['state']>, props: P, privateApiRef: RefObject<PrivateApi>) => DeepPartial<PrivateApi['state']>;
|
|
9
|
+
export declare const useGridInitializeState: <P extends Partial<DataGridProcessedProps>, PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity>(initializer: GridStateInitializer<P, PrivateApi>, privateApiRef: RefObject<PrivateApi>, props: P) => void;
|
|
10
10
|
export {};
|