@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
|
@@ -15,8 +15,8 @@ var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
|
15
15
|
var _utils = require("@mui/utils");
|
|
16
16
|
var _useLazyRef = _interopRequireDefault(require("@mui/utils/useLazyRef"));
|
|
17
17
|
var _useTimeout = _interopRequireDefault(require("@mui/utils/useTimeout"));
|
|
18
|
-
var _useResizeObserver = require("@mui/x-internals/useResizeObserver");
|
|
19
18
|
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
19
|
+
var _reactMajor = _interopRequireDefault(require("@mui/x-internals/reactMajor"));
|
|
20
20
|
var _useGridPrivateApiContext = require("../../utils/useGridPrivateApiContext");
|
|
21
21
|
var _useGridRootProps = require("../../utils/useGridRootProps");
|
|
22
22
|
var _useGridSelector = require("../../utils/useGridSelector");
|
|
@@ -24,7 +24,6 @@ var _useRunOnce = require("../../utils/useRunOnce");
|
|
|
24
24
|
var _gridColumnsSelector = require("../columns/gridColumnsSelector");
|
|
25
25
|
var _gridDimensionsSelectors = require("../dimensions/gridDimensionsSelectors");
|
|
26
26
|
var _gridRowsSelector = require("../rows/gridRowsSelector");
|
|
27
|
-
var _gridFocusStateSelector = require("../focus/gridFocusStateSelector");
|
|
28
27
|
var _useGridVisibleRows = require("../../utils/useGridVisibleRows");
|
|
29
28
|
var _utils2 = require("../../utils");
|
|
30
29
|
var platform = _interopRequireWildcard(require("../../../utils/platform"));
|
|
@@ -37,6 +36,10 @@ var _useGridVirtualization = require("./useGridVirtualization");
|
|
|
37
36
|
var _gridRowSpanningSelectors = require("../rows/gridRowSpanningSelectors");
|
|
38
37
|
var _gridListViewSelectors = require("../listView/gridListViewSelectors");
|
|
39
38
|
var _gridRowsUtils = require("../rows/gridRowsUtils");
|
|
39
|
+
var _columns = require("../columns");
|
|
40
|
+
var _gridFocusedVirtualCellSelector = require("./gridFocusedVirtualCellSelector");
|
|
41
|
+
var _roundToDecimalPlaces = require("../../../utils/roundToDecimalPlaces");
|
|
42
|
+
var _isJSDOM = require("../../../utils/isJSDOM");
|
|
40
43
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
41
44
|
const MINIMUM_COLUMN_WIDTH = 50;
|
|
42
45
|
var ScrollDirection = /*#__PURE__*/function (ScrollDirection) {
|
|
@@ -56,14 +59,6 @@ const createScrollCache = (isRtl, rowBufferPx, columnBufferPx, verticalBuffer, h
|
|
|
56
59
|
direction: ScrollDirection.NONE,
|
|
57
60
|
buffer: bufferForDirection(isRtl, ScrollDirection.NONE, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer)
|
|
58
61
|
});
|
|
59
|
-
let isJSDOM = false;
|
|
60
|
-
try {
|
|
61
|
-
if (typeof window !== 'undefined') {
|
|
62
|
-
isJSDOM = /jsdom/.test(window.navigator.userAgent);
|
|
63
|
-
}
|
|
64
|
-
} catch (_) {
|
|
65
|
-
/* ignore */
|
|
66
|
-
}
|
|
67
62
|
const useGridVirtualScroller = () => {
|
|
68
63
|
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
69
64
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
@@ -71,25 +66,18 @@ const useGridVirtualScroller = () => {
|
|
|
71
66
|
unstable_listView: listView
|
|
72
67
|
} = rootProps;
|
|
73
68
|
const visibleColumns = (0, _useGridSelector.useGridSelector)(apiRef, () => listView ? [(0, _gridListViewSelectors.gridListColumnSelector)(apiRef.current.state)] : (0, _gridColumnsSelector.gridVisibleColumnDefinitionsSelector)(apiRef));
|
|
74
|
-
const enabledForRows = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridVirtualizationRowEnabledSelector) && !isJSDOM;
|
|
75
|
-
const enabledForColumns = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridVirtualizationColumnEnabledSelector) && !isJSDOM;
|
|
69
|
+
const enabledForRows = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridVirtualizationRowEnabledSelector) && !_isJSDOM.isJSDOM;
|
|
70
|
+
const enabledForColumns = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridVirtualizationColumnEnabledSelector) && !_isJSDOM.isJSDOM;
|
|
76
71
|
const dimensions = (0, _useGridSelector.useGridSelector)(apiRef, _gridDimensionsSelectors.gridDimensionsSelector);
|
|
77
72
|
const outerSize = dimensions.viewportOuterSize;
|
|
78
73
|
const pinnedRows = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridPinnedRowsSelector);
|
|
79
|
-
const pinnedColumnDefinitions = (0,
|
|
80
|
-
const pinnedColumns = listView ?
|
|
81
|
-
left: [],
|
|
82
|
-
right: []
|
|
83
|
-
} : pinnedColumnDefinitions;
|
|
74
|
+
const pinnedColumnDefinitions = (0, _gridColumnsSelector.gridVisiblePinnedColumnDefinitionsSelector)(apiRef);
|
|
75
|
+
const pinnedColumns = listView ? _columns.EMPTY_PINNED_COLUMN_FIELDS : pinnedColumnDefinitions;
|
|
84
76
|
const hasBottomPinnedRows = pinnedRows.bottom.length > 0;
|
|
85
77
|
const [panels, setPanels] = React.useState(EMPTY_DETAIL_PANELS);
|
|
86
78
|
const isRtl = (0, _RtlProvider.useRtl)();
|
|
87
|
-
const cellFocus = (0, _useGridSelector.useGridSelector)(apiRef, _gridFocusStateSelector.gridFocusCellSelector);
|
|
88
|
-
const cellTabIndex = (0, _useGridSelector.useGridSelector)(apiRef, _gridFocusStateSelector.gridTabIndexCellSelector);
|
|
89
|
-
const rowsMeta = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsMetaSelector.gridRowsMetaSelector);
|
|
90
79
|
const selectedRowsLookup = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowSelectionSelector.selectedIdsLookupSelector);
|
|
91
|
-
const currentPage = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef
|
|
92
|
-
const gridRootRef = apiRef.current.rootElementRef;
|
|
80
|
+
const currentPage = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef);
|
|
93
81
|
const mainRef = apiRef.current.mainElementRef;
|
|
94
82
|
const scrollerRef = apiRef.current.virtualScrollerRef;
|
|
95
83
|
const scrollbarVerticalRef = apiRef.current.virtualScrollbarVerticalRef;
|
|
@@ -97,7 +85,49 @@ const useGridVirtualScroller = () => {
|
|
|
97
85
|
const contentHeight = dimensions.contentSize.height;
|
|
98
86
|
const columnsTotalWidth = dimensions.columnsTotalWidth;
|
|
99
87
|
const hasColSpan = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridHasColSpanSelector);
|
|
100
|
-
|
|
88
|
+
const isRenderContextReady = React.useRef(false);
|
|
89
|
+
const previousSize = React.useRef(null);
|
|
90
|
+
const mainRefCallback = React.useCallback(node => {
|
|
91
|
+
mainRef.current = node;
|
|
92
|
+
if (!node) {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
const initialRect = node.getBoundingClientRect();
|
|
96
|
+
let lastSize = {
|
|
97
|
+
width: (0, _roundToDecimalPlaces.roundToDecimalPlaces)(initialRect.width, 1),
|
|
98
|
+
height: (0, _roundToDecimalPlaces.roundToDecimalPlaces)(initialRect.height, 1)
|
|
99
|
+
};
|
|
100
|
+
if (!previousSize.current || lastSize.width !== previousSize.current.width && lastSize.height !== previousSize.current.height) {
|
|
101
|
+
previousSize.current = lastSize;
|
|
102
|
+
apiRef.current.publishEvent('resize', lastSize);
|
|
103
|
+
}
|
|
104
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
const observer = new ResizeObserver(entries => {
|
|
108
|
+
const entry = entries[0];
|
|
109
|
+
if (!entry) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const newSize = {
|
|
113
|
+
width: (0, _roundToDecimalPlaces.roundToDecimalPlaces)(entry.contentRect.width, 1),
|
|
114
|
+
height: (0, _roundToDecimalPlaces.roundToDecimalPlaces)(entry.contentRect.height, 1)
|
|
115
|
+
};
|
|
116
|
+
if (newSize.width === lastSize.width && newSize.height === lastSize.height) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
apiRef.current.publishEvent('resize', newSize);
|
|
120
|
+
lastSize = newSize;
|
|
121
|
+
});
|
|
122
|
+
observer.observe(node);
|
|
123
|
+
if (_reactMajor.default >= 19) {
|
|
124
|
+
return () => {
|
|
125
|
+
mainRef.current = null;
|
|
126
|
+
observer.disconnect();
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
return undefined;
|
|
130
|
+
}, [apiRef, mainRef]);
|
|
101
131
|
|
|
102
132
|
/*
|
|
103
133
|
* Scroll context logic
|
|
@@ -114,17 +144,15 @@ const useGridVirtualScroller = () => {
|
|
|
114
144
|
* work that's not necessary. Thus we store the context at the start of the scroll in `frozenContext`, and the rows
|
|
115
145
|
* that are part of this old context will keep their same render context as to avoid re-rendering.
|
|
116
146
|
*/
|
|
117
|
-
const scrollPosition = React.useRef(EMPTY_SCROLL_POSITION);
|
|
147
|
+
const scrollPosition = React.useRef(rootProps.initialState?.scroll ?? EMPTY_SCROLL_POSITION);
|
|
148
|
+
const ignoreNextScrollEvent = React.useRef(false);
|
|
118
149
|
const previousContextScrollPosition = React.useRef(EMPTY_SCROLL_POSITION);
|
|
119
150
|
const previousRowContext = React.useRef(_useGridVirtualization.EMPTY_RENDER_CONTEXT);
|
|
120
151
|
const renderContext = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridRenderContextSelector);
|
|
152
|
+
const focusedVirtualCell = (0, _useGridSelector.useGridSelector)(apiRef, _gridFocusedVirtualCellSelector.gridFocusedVirtualCellSelector);
|
|
121
153
|
const scrollTimeout = (0, _useTimeout.default)();
|
|
122
154
|
const frozenContext = React.useRef(undefined);
|
|
123
155
|
const scrollCache = (0, _useLazyRef.default)(() => createScrollCache(isRtl, rootProps.rowBufferPx, rootProps.columnBufferPx, dimensions.rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6)).current;
|
|
124
|
-
const focusedCell = {
|
|
125
|
-
rowIndex: React.useMemo(() => cellFocus ? currentPage.rows.findIndex(row => row.id === cellFocus.id) : -1, [cellFocus, currentPage.rows]),
|
|
126
|
-
columnIndex: React.useMemo(() => cellFocus ? visibleColumns.findIndex(column => column.field === cellFocus.field) : -1, [cellFocus, visibleColumns])
|
|
127
|
-
};
|
|
128
156
|
const updateRenderContext = React.useCallback(nextRenderContext => {
|
|
129
157
|
if (areRenderContextsEqual(nextRenderContext, apiRef.current.state.virtualization.renderContext)) {
|
|
130
158
|
return;
|
|
@@ -148,9 +176,17 @@ const useGridVirtualScroller = () => {
|
|
|
148
176
|
previousContextScrollPosition.current = scrollPosition.current;
|
|
149
177
|
}, [apiRef, dimensions.isReady]);
|
|
150
178
|
const triggerUpdateRenderContext = (0, _utils.unstable_useEventCallback)(() => {
|
|
179
|
+
const scroller = scrollerRef.current;
|
|
180
|
+
if (!scroller) {
|
|
181
|
+
return undefined;
|
|
182
|
+
}
|
|
183
|
+
const maxScrollTop = Math.ceil(dimensions.minimumSize.height - dimensions.viewportOuterSize.height);
|
|
184
|
+
const maxScrollLeft = Math.ceil(dimensions.minimumSize.width - dimensions.viewportInnerSize.width);
|
|
185
|
+
|
|
186
|
+
// Clamp the scroll position to the viewport to avoid re-calculating the render context for scroll bounce
|
|
151
187
|
const newScroll = {
|
|
152
|
-
top:
|
|
153
|
-
left:
|
|
188
|
+
top: (0, _utils3.clamp)(scroller.scrollTop, 0, maxScrollTop),
|
|
189
|
+
left: isRtl ? (0, _utils3.clamp)(scroller.scrollLeft, -maxScrollLeft, 0) : (0, _utils3.clamp)(scroller.scrollLeft, 0, maxScrollLeft)
|
|
154
190
|
};
|
|
155
191
|
const dx = newScroll.left - scrollPosition.current.left;
|
|
156
192
|
const dy = newScroll.top - scrollPosition.current.top;
|
|
@@ -203,30 +239,15 @@ const useGridVirtualScroller = () => {
|
|
|
203
239
|
frozenContext.current = undefined;
|
|
204
240
|
updateRenderContext(nextRenderContext);
|
|
205
241
|
};
|
|
206
|
-
const handleScroll = (0, _utils.unstable_useEventCallback)(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
scrollLeft
|
|
210
|
-
} = event.currentTarget;
|
|
211
|
-
|
|
212
|
-
// On iOS and macOS, negative offsets are possible when swiping past the start
|
|
213
|
-
if (scrollTop < 0) {
|
|
242
|
+
const handleScroll = (0, _utils.unstable_useEventCallback)(() => {
|
|
243
|
+
if (ignoreNextScrollEvent.current) {
|
|
244
|
+
ignoreNextScrollEvent.current = false;
|
|
214
245
|
return;
|
|
215
246
|
}
|
|
216
|
-
if (!isRtl) {
|
|
217
|
-
if (scrollLeft < 0) {
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
if (isRtl) {
|
|
222
|
-
if (scrollLeft > 0) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
247
|
const nextRenderContext = triggerUpdateRenderContext();
|
|
227
248
|
apiRef.current.publishEvent('scrollPositionChange', {
|
|
228
|
-
top:
|
|
229
|
-
left:
|
|
249
|
+
top: scrollPosition.current.top,
|
|
250
|
+
left: scrollPosition.current.left,
|
|
230
251
|
renderContext: nextRenderContext
|
|
231
252
|
});
|
|
232
253
|
});
|
|
@@ -262,14 +283,14 @@ const useGridVirtualScroller = () => {
|
|
|
262
283
|
const lastRowToRender = Math.min(baseRenderContext.lastRowIndex, rowModels.length);
|
|
263
284
|
const rowIndexes = params.rows ? (0, _utils3.range)(0, params.rows.length) : (0, _utils3.range)(firstRowToRender, lastRowToRender);
|
|
264
285
|
let virtualRowIndex = -1;
|
|
265
|
-
if (!isPinnedSection &&
|
|
266
|
-
if (
|
|
267
|
-
|
|
268
|
-
|
|
286
|
+
if (!isPinnedSection && focusedVirtualCell) {
|
|
287
|
+
if (focusedVirtualCell.rowIndex < firstRowToRender) {
|
|
288
|
+
rowIndexes.unshift(focusedVirtualCell.rowIndex);
|
|
289
|
+
virtualRowIndex = focusedVirtualCell.rowIndex;
|
|
269
290
|
}
|
|
270
|
-
if (
|
|
271
|
-
|
|
272
|
-
|
|
291
|
+
if (focusedVirtualCell.rowIndex > lastRowToRender) {
|
|
292
|
+
rowIndexes.push(focusedVirtualCell.rowIndex);
|
|
293
|
+
virtualRowIndex = focusedVirtualCell.rowIndex;
|
|
273
294
|
}
|
|
274
295
|
}
|
|
275
296
|
const rows = [];
|
|
@@ -309,7 +330,6 @@ const useGridVirtualScroller = () => {
|
|
|
309
330
|
});
|
|
310
331
|
}
|
|
311
332
|
}
|
|
312
|
-
const hasFocus = cellFocus?.id === id;
|
|
313
333
|
const baseRowHeight = !apiRef.current.rowHasAutoHeight(id) ? apiRef.current.unstable_getRowHeight(id) : 'auto';
|
|
314
334
|
let isSelected;
|
|
315
335
|
if (selectedRowsLookup[id] == null) {
|
|
@@ -334,39 +354,37 @@ const useGridVirtualScroller = () => {
|
|
|
334
354
|
isLastVisible = isLastVisibleInSection;
|
|
335
355
|
}
|
|
336
356
|
}
|
|
337
|
-
const isVirtualRow = rowIndexInPage === virtualRowIndex;
|
|
338
|
-
const isNotVisible = isVirtualRow;
|
|
339
|
-
let tabbableCell = null;
|
|
340
|
-
if (cellTabIndex !== null && cellTabIndex.id === id) {
|
|
341
|
-
const cellParams = apiRef.current.getCellParams(id, cellTabIndex.field);
|
|
342
|
-
tabbableCell = cellParams.cellMode === 'view' ? cellTabIndex.field : null;
|
|
343
|
-
}
|
|
344
357
|
let currentRenderContext = baseRenderContext;
|
|
345
358
|
if (!isPinnedSection && frozenContext.current && rowIndexInPage >= frozenContext.current.firstRowIndex && rowIndexInPage < frozenContext.current.lastRowIndex) {
|
|
346
359
|
currentRenderContext = frozenContext.current;
|
|
347
360
|
}
|
|
361
|
+
const isVirtualFocusRow = rowIndexInPage === virtualRowIndex;
|
|
362
|
+
const isVirtualFocusColumn = focusedVirtualCell?.rowIndex === rowIndex;
|
|
348
363
|
const offsetLeft = computeOffsetLeft(columnPositions, currentRenderContext, pinnedColumns.left.length);
|
|
349
364
|
const showBottomBorder = isLastVisibleInSection && params.position === 'top';
|
|
365
|
+
const firstColumnIndex = currentRenderContext.firstColumnIndex;
|
|
366
|
+
const lastColumnIndex = currentRenderContext.lastColumnIndex;
|
|
350
367
|
rows.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.row, (0, _extends2.default)({
|
|
351
368
|
row: model,
|
|
352
369
|
rowId: id,
|
|
353
370
|
index: rowIndex,
|
|
354
371
|
selected: isSelected,
|
|
355
|
-
offsetTop: params.rows ? undefined : rowsMeta.positions[rowIndexInPage],
|
|
356
372
|
offsetLeft: offsetLeft,
|
|
357
|
-
|
|
373
|
+
columnsTotalWidth: dimensions.columnsTotalWidth,
|
|
358
374
|
rowHeight: baseRowHeight,
|
|
359
|
-
tabbableCell: tabbableCell,
|
|
360
375
|
pinnedColumns: pinnedColumns,
|
|
361
376
|
visibleColumns: visibleColumns,
|
|
362
|
-
|
|
363
|
-
|
|
377
|
+
firstColumnIndex: firstColumnIndex,
|
|
378
|
+
lastColumnIndex: lastColumnIndex,
|
|
379
|
+
focusedColumnIndex: isVirtualFocusColumn ? focusedVirtualCell.columnIndex : undefined,
|
|
364
380
|
isFirstVisible: isFirstVisible,
|
|
365
381
|
isLastVisible: isLastVisible,
|
|
366
|
-
isNotVisible:
|
|
367
|
-
showBottomBorder: showBottomBorder
|
|
382
|
+
isNotVisible: isVirtualFocusRow,
|
|
383
|
+
showBottomBorder: showBottomBorder,
|
|
384
|
+
scrollbarWidth: dimensions.hasScrollY ? dimensions.scrollbarSize : 0,
|
|
385
|
+
gridHasFiller: dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width
|
|
368
386
|
}, rowProps), id));
|
|
369
|
-
if (
|
|
387
|
+
if (isVirtualFocusRow) {
|
|
370
388
|
return;
|
|
371
389
|
}
|
|
372
390
|
const panel = panels.get(id);
|
|
@@ -397,22 +415,21 @@ const useGridVirtualScroller = () => {
|
|
|
397
415
|
}
|
|
398
416
|
return size;
|
|
399
417
|
}, [columnsTotalWidth, contentHeight, needsHorizontalScrollbar]);
|
|
400
|
-
React.
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
404
|
-
// FIXME: Is this really necessary?
|
|
405
|
-
apiRef.current.resize();
|
|
406
|
-
}, [apiRef, rowsMeta.currentPageTotalHeight]);
|
|
407
|
-
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
408
|
-
// TODO a scroll reset should not be necessary
|
|
409
|
-
if (enabledForColumns) {
|
|
410
|
-
scrollerRef.current.scrollLeft = 0;
|
|
418
|
+
const onContentSizeApplied = React.useCallback(node => {
|
|
419
|
+
if (!node) {
|
|
420
|
+
return;
|
|
411
421
|
}
|
|
412
|
-
|
|
413
|
-
|
|
422
|
+
apiRef.current.publishEvent('virtualScrollerContentSizeChange', {
|
|
423
|
+
columnsTotalWidth,
|
|
424
|
+
contentHeight
|
|
425
|
+
});
|
|
426
|
+
}, [apiRef, columnsTotalWidth, contentHeight]);
|
|
427
|
+
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
428
|
+
if (!isRenderContextReady.current) {
|
|
429
|
+
return;
|
|
414
430
|
}
|
|
415
|
-
|
|
431
|
+
apiRef.current.updateRenderContext?.();
|
|
432
|
+
}, [apiRef, enabledForColumns, enabledForRows]);
|
|
416
433
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
417
434
|
if (listView) {
|
|
418
435
|
scrollerRef.current.scrollLeft = 0;
|
|
@@ -427,6 +444,53 @@ const useGridVirtualScroller = () => {
|
|
|
427
444
|
left: scrollPosition.current.left,
|
|
428
445
|
renderContext: initialRenderContext
|
|
429
446
|
});
|
|
447
|
+
isRenderContextReady.current = true;
|
|
448
|
+
if (rootProps.initialState?.scroll && scrollerRef.current) {
|
|
449
|
+
const scroller = scrollerRef.current;
|
|
450
|
+
const {
|
|
451
|
+
top,
|
|
452
|
+
left
|
|
453
|
+
} = rootProps.initialState.scroll;
|
|
454
|
+
|
|
455
|
+
// 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.
|
|
456
|
+
const isScrollRestored = {
|
|
457
|
+
top: !(top > 0),
|
|
458
|
+
left: !(left > 0)
|
|
459
|
+
};
|
|
460
|
+
if (!isScrollRestored.left && columnsTotalWidth) {
|
|
461
|
+
scroller.scrollLeft = left;
|
|
462
|
+
ignoreNextScrollEvent.current = true;
|
|
463
|
+
isScrollRestored.left = true;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// For the sake of completeness, but I'm not sure if contentHeight is ever available at this point. Maybe when virtualisation is disabled?
|
|
467
|
+
if (!isScrollRestored.top && contentHeight) {
|
|
468
|
+
scroller.scrollTop = top;
|
|
469
|
+
ignoreNextScrollEvent.current = true;
|
|
470
|
+
isScrollRestored.top = true;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// 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
|
|
474
|
+
if (!isScrollRestored.top || !isScrollRestored.left) {
|
|
475
|
+
const unsubscribeContentSizeChange = apiRef.current.subscribeEvent('virtualScrollerContentSizeChange', params => {
|
|
476
|
+
if (!isScrollRestored.left && params.columnsTotalWidth) {
|
|
477
|
+
scroller.scrollLeft = left;
|
|
478
|
+
ignoreNextScrollEvent.current = true;
|
|
479
|
+
isScrollRestored.left = true;
|
|
480
|
+
}
|
|
481
|
+
if (!isScrollRestored.top && params.contentHeight) {
|
|
482
|
+
scroller.scrollTop = top;
|
|
483
|
+
ignoreNextScrollEvent.current = true;
|
|
484
|
+
isScrollRestored.top = true;
|
|
485
|
+
}
|
|
486
|
+
if (isScrollRestored.left && isScrollRestored.top) {
|
|
487
|
+
unsubscribeContentSizeChange();
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
return unsubscribeContentSizeChange;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
return undefined;
|
|
430
494
|
});
|
|
431
495
|
apiRef.current.register('private', {
|
|
432
496
|
updateRenderContext: forceUpdateRenderContext
|
|
@@ -439,7 +503,7 @@ const useGridVirtualScroller = () => {
|
|
|
439
503
|
setPanels,
|
|
440
504
|
getRows,
|
|
441
505
|
getContainerProps: () => ({
|
|
442
|
-
ref:
|
|
506
|
+
ref: mainRefCallback
|
|
443
507
|
}),
|
|
444
508
|
getScrollerProps: () => ({
|
|
445
509
|
ref: scrollerRef,
|
|
@@ -454,18 +518,21 @@ const useGridVirtualScroller = () => {
|
|
|
454
518
|
}),
|
|
455
519
|
getContentProps: () => ({
|
|
456
520
|
style: contentSize,
|
|
457
|
-
role: 'presentation'
|
|
521
|
+
role: 'presentation',
|
|
522
|
+
ref: onContentSizeApplied
|
|
458
523
|
}),
|
|
459
524
|
getRenderZoneProps: () => ({
|
|
460
525
|
role: 'rowgroup'
|
|
461
526
|
}),
|
|
462
527
|
getScrollbarVerticalProps: () => ({
|
|
463
528
|
ref: scrollbarVerticalRef,
|
|
464
|
-
role: 'presentation'
|
|
529
|
+
role: 'presentation',
|
|
530
|
+
scrollPosition
|
|
465
531
|
}),
|
|
466
532
|
getScrollbarHorizontalProps: () => ({
|
|
467
533
|
ref: scrollbarHorizontalRef,
|
|
468
|
-
role: 'presentation'
|
|
534
|
+
role: 'presentation',
|
|
535
|
+
scrollPosition
|
|
469
536
|
})
|
|
470
537
|
};
|
|
471
538
|
};
|
|
@@ -497,7 +564,8 @@ function inputsSelector(apiRef, rootProps, enabledForRows, enabledForColumns) {
|
|
|
497
564
|
pinnedColumns: (0, _gridColumnsSelector.gridVisiblePinnedColumnDefinitionsSelector)(apiRef),
|
|
498
565
|
visibleColumns,
|
|
499
566
|
hiddenCellsOriginMap,
|
|
500
|
-
listView: rootProps.unstable_listView ?? false
|
|
567
|
+
listView: rootProps.unstable_listView ?? false,
|
|
568
|
+
virtualizeColumnsWithAutoRowHeight: rootProps.virtualizeColumnsWithAutoRowHeight
|
|
501
569
|
};
|
|
502
570
|
}
|
|
503
571
|
function computeRenderContext(inputs, scrollPosition, scrollCache) {
|
|
@@ -507,6 +575,11 @@ function computeRenderContext(inputs, scrollPosition, scrollCache) {
|
|
|
507
575
|
firstColumnIndex: 0,
|
|
508
576
|
lastColumnIndex: inputs.visibleColumns.length
|
|
509
577
|
};
|
|
578
|
+
if (inputs.listView) {
|
|
579
|
+
return (0, _extends2.default)({}, renderContext, {
|
|
580
|
+
lastColumnIndex: 1
|
|
581
|
+
});
|
|
582
|
+
}
|
|
510
583
|
const {
|
|
511
584
|
top,
|
|
512
585
|
left
|
|
@@ -545,11 +618,13 @@ function computeRenderContext(inputs, scrollPosition, scrollCache) {
|
|
|
545
618
|
positions: inputs.rowsMeta.positions,
|
|
546
619
|
lastSize: inputs.lastRowHeight
|
|
547
620
|
});
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
621
|
+
if (!inputs.virtualizeColumnsWithAutoRowHeight) {
|
|
622
|
+
for (let i = firstRowToRender; i < lastRowToRender && !hasRowWithAutoHeight; i += 1) {
|
|
623
|
+
const row = inputs.rows[i];
|
|
624
|
+
hasRowWithAutoHeight = inputs.apiRef.current.rowHasAutoHeight(row.id);
|
|
625
|
+
}
|
|
551
626
|
}
|
|
552
|
-
if (!hasRowWithAutoHeight) {
|
|
627
|
+
if (!hasRowWithAutoHeight || inputs.virtualizeColumnsWithAutoRowHeight) {
|
|
553
628
|
firstColumnIndex = binarySearch(realLeft, inputs.columnPositions, {
|
|
554
629
|
atStart: true,
|
|
555
630
|
lastPosition: inputs.columnsTotalWidth
|
|
@@ -34,7 +34,7 @@ function createUseGridApiEventHandler(registryContainer) {
|
|
|
34
34
|
}
|
|
35
35
|
const [objectRetainedByReact] = React.useState(new ObjectToBeRetainedByReact());
|
|
36
36
|
const subscription = React.useRef(null);
|
|
37
|
-
const handlerRef = React.useRef();
|
|
37
|
+
const handlerRef = React.useRef(null);
|
|
38
38
|
handlerRef.current = handler;
|
|
39
39
|
const cleanupTokenRef = React.useRef(null);
|
|
40
40
|
if (!subscription.current && handlerRef.current) {
|
|
@@ -4,7 +4,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.useGridSelector = exports.objectShallowCompare = exports.argsEqual = void 0;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _fastObjectShallowCompare = require("@mui/x-internals/fastObjectShallowCompare");
|
|
10
10
|
var _warning = require("@mui/x-internals/warning");
|
|
@@ -13,20 +13,11 @@ var _useOnMount = require("./useOnMount");
|
|
|
13
13
|
function isOutputSelector(selector) {
|
|
14
14
|
return selector.acceptsApiRef;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
function applySelector(apiRef, selector) {
|
|
18
|
-
if (isOutputSelector(selector)) {
|
|
19
|
-
return selector(apiRef);
|
|
20
|
-
}
|
|
21
|
-
return selector(apiRef.current.state);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// TODO v8: Rename this function to `applySelector`
|
|
25
|
-
function applySelectorV8(apiRef, selector, args, instanceId) {
|
|
16
|
+
function applySelector(apiRef, selector, args, instanceId) {
|
|
26
17
|
if (isOutputSelector(selector)) {
|
|
27
18
|
return selector(apiRef, args);
|
|
28
19
|
}
|
|
29
|
-
return selector(apiRef.current.state, instanceId);
|
|
20
|
+
return selector(apiRef.current.state, args, instanceId);
|
|
30
21
|
}
|
|
31
22
|
const defaultCompare = Object.is;
|
|
32
23
|
const objectShallowCompare = exports.objectShallowCompare = _fastObjectShallowCompare.fastObjectShallowCompare;
|
|
@@ -52,37 +43,7 @@ const createRefs = () => ({
|
|
|
52
43
|
selector: null,
|
|
53
44
|
args: null
|
|
54
45
|
});
|
|
55
|
-
|
|
56
|
-
// TODO v8: Remove this function
|
|
57
|
-
const useGridSelector = (apiRef, selector, equals = defaultCompare) => {
|
|
58
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
59
|
-
if (!apiRef.current.state) {
|
|
60
|
-
(0, _warning.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.']);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
const refs = (0, _useLazyRef.useLazyRef)(createRefs);
|
|
64
|
-
const didInit = refs.current.selector !== null;
|
|
65
|
-
const [state, setState] = React.useState(
|
|
66
|
-
// We don't use an initialization function to avoid allocations
|
|
67
|
-
didInit ? null : applySelector(apiRef, selector));
|
|
68
|
-
refs.current.state = state;
|
|
69
|
-
refs.current.equals = equals;
|
|
70
|
-
refs.current.selector = selector;
|
|
71
|
-
(0, _useOnMount.useOnMount)(() => {
|
|
72
|
-
return apiRef.current.store.subscribe(() => {
|
|
73
|
-
const newState = applySelector(apiRef, refs.current.selector);
|
|
74
|
-
if (!refs.current.equals(refs.current.state, newState)) {
|
|
75
|
-
refs.current.state = newState;
|
|
76
|
-
setState(newState);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
return state;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
// TODO v8: Rename this function to `useGridSelector`
|
|
84
|
-
exports.useGridSelector = useGridSelector;
|
|
85
|
-
const useGridSelectorV8 = (apiRef, selector, args = undefined, equals = defaultCompare) => {
|
|
46
|
+
const useGridSelector = (apiRef, selector, args = undefined, equals = defaultCompare) => {
|
|
86
47
|
if (process.env.NODE_ENV !== 'production') {
|
|
87
48
|
if (!apiRef.current.state) {
|
|
88
49
|
(0, _warning.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.']);
|
|
@@ -92,14 +53,14 @@ const useGridSelectorV8 = (apiRef, selector, args = undefined, equals = defaultC
|
|
|
92
53
|
const didInit = refs.current.selector !== null;
|
|
93
54
|
const [state, setState] = React.useState(
|
|
94
55
|
// We don't use an initialization function to avoid allocations
|
|
95
|
-
didInit ? null :
|
|
56
|
+
didInit ? null : applySelector(apiRef, selector, args, apiRef.current.instanceId));
|
|
96
57
|
refs.current.state = state;
|
|
97
58
|
refs.current.equals = equals;
|
|
98
59
|
refs.current.selector = selector;
|
|
99
60
|
const prevArgs = refs.current.args;
|
|
100
61
|
refs.current.args = args;
|
|
101
62
|
if (didInit && !argsEqual(prevArgs, args)) {
|
|
102
|
-
const newState =
|
|
63
|
+
const newState = applySelector(apiRef, refs.current.selector, refs.current.args, apiRef.current.instanceId);
|
|
103
64
|
if (!refs.current.equals(refs.current.state, newState)) {
|
|
104
65
|
refs.current.state = newState;
|
|
105
66
|
setState(newState);
|
|
@@ -107,7 +68,7 @@ const useGridSelectorV8 = (apiRef, selector, args = undefined, equals = defaultC
|
|
|
107
68
|
}
|
|
108
69
|
(0, _useOnMount.useOnMount)(() => {
|
|
109
70
|
return apiRef.current.store.subscribe(() => {
|
|
110
|
-
const newState =
|
|
71
|
+
const newState = applySelector(apiRef, refs.current.selector, refs.current.args, apiRef.current.instanceId);
|
|
111
72
|
if (!refs.current.equals(refs.current.state, newState)) {
|
|
112
73
|
refs.current.state = newState;
|
|
113
74
|
setState(newState);
|
|
@@ -116,4 +77,4 @@ const useGridSelectorV8 = (apiRef, selector, args = undefined, equals = defaultC
|
|
|
116
77
|
});
|
|
117
78
|
return state;
|
|
118
79
|
};
|
|
119
|
-
exports.
|
|
80
|
+
exports.useGridSelector = useGridSelector;
|
|
@@ -1,34 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.useGridVisibleRows = exports.getVisibleRows = void 0;
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
7
|
var _gridPaginationSelector = require("../features/pagination/gridPaginationSelector");
|
|
10
|
-
var
|
|
8
|
+
var _ = require(".");
|
|
11
9
|
const getVisibleRows = (apiRef, props) => {
|
|
12
|
-
|
|
13
|
-
let range;
|
|
14
|
-
if (props.pagination && props.paginationMode === 'client') {
|
|
15
|
-
range = (0, _gridPaginationSelector.gridPaginationRowRangeSelector)(apiRef);
|
|
16
|
-
rows = (0, _gridPaginationSelector.gridPaginatedVisibleSortedGridRowEntriesSelector)(apiRef);
|
|
17
|
-
} else {
|
|
18
|
-
rows = (0, _gridFilterSelector.gridExpandedSortedRowEntriesSelector)(apiRef);
|
|
19
|
-
if (rows.length === 0) {
|
|
20
|
-
range = null;
|
|
21
|
-
} else {
|
|
22
|
-
range = {
|
|
23
|
-
firstRowIndex: 0,
|
|
24
|
-
lastRowIndex: rows.length - 1
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
rows,
|
|
30
|
-
range
|
|
31
|
-
};
|
|
10
|
+
return (0, _gridPaginationSelector.gridVisibleRowsSelector)(apiRef);
|
|
32
11
|
};
|
|
33
12
|
|
|
34
13
|
/**
|
|
@@ -40,10 +19,6 @@ const getVisibleRows = (apiRef, props) => {
|
|
|
40
19
|
*/
|
|
41
20
|
exports.getVisibleRows = getVisibleRows;
|
|
42
21
|
const useGridVisibleRows = (apiRef, props) => {
|
|
43
|
-
|
|
44
|
-
return React.useMemo(() => ({
|
|
45
|
-
rows: response.rows,
|
|
46
|
-
range: response.range
|
|
47
|
-
}), [response.rows, response.range]);
|
|
22
|
+
return (0, _.useGridSelector)(apiRef, _gridPaginationSelector.gridVisibleRowsSelector);
|
|
48
23
|
};
|
|
49
24
|
exports.useGridVisibleRows = useGridVisibleRows;
|
package/node/index.js
CHANGED
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.GRID_TREE_DATA_GROUPING_FIELD = exports.GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = exports.GRID_DETAIL_PANEL_TOGGLE_FIELD = void 0;
|
|
6
|
+
exports.PinnedColumnPosition = exports.GRID_TREE_DATA_GROUPING_FIELD = exports.GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = exports.GRID_DETAIL_PANEL_TOGGLE_FIELD = void 0;
|
|
7
7
|
const GRID_TREE_DATA_GROUPING_FIELD = exports.GRID_TREE_DATA_GROUPING_FIELD = '__tree_data_group__';
|
|
8
8
|
const GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = exports.GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = '__row_group_by_columns_group__';
|
|
9
|
-
const GRID_DETAIL_PANEL_TOGGLE_FIELD = exports.GRID_DETAIL_PANEL_TOGGLE_FIELD = '__detail_panel_toggle__';
|
|
9
|
+
const GRID_DETAIL_PANEL_TOGGLE_FIELD = exports.GRID_DETAIL_PANEL_TOGGLE_FIELD = '__detail_panel_toggle__';
|
|
10
|
+
let PinnedColumnPosition = exports.PinnedColumnPosition = /*#__PURE__*/function (PinnedColumnPosition) {
|
|
11
|
+
PinnedColumnPosition[PinnedColumnPosition["NONE"] = 0] = "NONE";
|
|
12
|
+
PinnedColumnPosition[PinnedColumnPosition["LEFT"] = 1] = "LEFT";
|
|
13
|
+
PinnedColumnPosition[PinnedColumnPosition["RIGHT"] = 2] = "RIGHT";
|
|
14
|
+
PinnedColumnPosition[PinnedColumnPosition["VIRTUAL"] = 3] = "VIRTUAL";
|
|
15
|
+
return PinnedColumnPosition;
|
|
16
|
+
}({});
|