@mui/x-data-grid 8.0.0-alpha.1 → 8.0.0-alpha.11
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 +2007 -230
- package/DataGrid/DataGrid.js +20 -38
- package/DataGrid/useDataGridComponent.d.ts +2 -1
- package/DataGrid/useDataGridComponent.js +3 -3
- 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 +60 -88
- package/components/GridRowCount.d.ts +1 -1
- package/components/GridRowCount.js +3 -2
- package/components/GridScrollArea.d.ts +5 -2
- package/components/GridScrollArea.js +33 -24
- package/components/GridSelectedRowCount.d.ts +4 -1
- package/components/GridSelectedRowCount.js +3 -2
- package/components/GridSkeletonLoadingOverlay.d.ts +1 -1
- package/components/GridSkeletonLoadingOverlay.js +23 -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 +29 -17
- package/components/containers/GridRootStyles.js +163 -53
- 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 +8 -4
- 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 +43 -21
- 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/index.d.ts +1 -0
- package/constants/index.js +2 -1
- package/constants/localeTextConstants.js +1 -1
- package/constants/signature.d.ts +9 -0
- package/constants/signature.js +10 -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 +7 -5
- 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 +3 -3
- 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 +6 -5
- 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 +39 -78
- 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 +11 -16
- package/hooks/features/columns/gridColumnsSelector.js +0 -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 +9 -4
- 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/gridDimensionsSelectors.d.ts +16 -0
- package/hooks/features/dimensions/gridDimensionsSelectors.js +26 -1
- package/hooks/features/dimensions/index.d.ts +1 -1
- package/hooks/features/dimensions/index.js +1 -2
- package/hooks/features/dimensions/useGridDimensions.d.ts +2 -2
- package/hooks/features/dimensions/useGridDimensions.js +104 -98
- package/hooks/features/editing/gridEditingSelectors.d.ts +10 -0
- package/hooks/features/editing/gridEditingSelectors.js +12 -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 +10 -11
- 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 +8 -2
- package/hooks/features/filter/gridFilterState.d.ts +8 -3
- package/hooks/features/filter/gridFilterState.js +5 -0
- 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 +10 -15
- 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 +23 -3
- 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/gridPaginationUtils.js +1 -1
- package/hooks/features/pagination/useGridPagination.d.ts +3 -3
- package/hooks/features/pagination/useGridPagination.js +6 -4
- 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 +11 -18
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +2 -2
- package/hooks/features/rowSelection/utils.d.ts +4 -3
- package/hooks/features/rowSelection/utils.js +4 -4
- 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/gridRowsMetaState.d.ts +8 -0
- package/hooks/features/rows/gridRowsSelector.d.ts +23 -13
- package/hooks/features/rows/gridRowsSelector.js +1 -2
- package/hooks/features/rows/gridRowsUtils.d.ts +3 -7
- package/hooks/features/rows/gridRowsUtils.js +0 -25
- 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 +27 -29
- package/hooks/features/rows/useGridRowsMeta.d.ts +2 -2
- package/hooks/features/rows/useGridRowsMeta.js +36 -19
- 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 +21 -9
- 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 +21 -6
- package/hooks/features/virtualization/useGridVirtualScroller.js +209 -118
- package/hooks/features/virtualization/useGridVirtualization.d.ts +2 -2
- package/hooks/utils/index.d.ts +1 -1
- package/hooks/utils/index.js +1 -1
- package/hooks/utils/useGridApiContext.d.ts +2 -2
- package/hooks/utils/useGridApiEventHandler.d.ts +9 -19
- package/hooks/utils/useGridApiEventHandler.js +68 -75
- 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 +29 -49
- package/hooks/utils/useGridVisibleRows.d.ts +8 -6
- package/hooks/utils/useGridVisibleRows.js +5 -28
- package/hooks/utils/useIsSSR.d.ts +1 -0
- package/hooks/utils/useIsSSR.js +5 -0
- package/index.js +1 -1
- package/internals/constants.d.ts +6 -0
- package/internals/constants.js +8 -1
- package/internals/index.d.ts +9 -5
- package/internals/index.js +7 -4
- 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/internals/utils/propValidation.js +1 -1
- 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 +2 -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 +13 -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 +3 -3
- 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 +60 -88
- package/modern/components/GridRowCount.js +3 -2
- package/modern/components/GridScrollArea.js +33 -24
- package/modern/components/GridSelectedRowCount.js +3 -2
- package/modern/components/GridSkeletonLoadingOverlay.js +23 -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 +29 -17
- package/modern/components/containers/GridRootStyles.js +163 -53
- package/modern/components/containers/GridToolbarContainer.js +3 -2
- package/modern/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/modern/components/menu/columnMenu/GridColumnMenuContainer.js +8 -4
- 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 +43 -21
- 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/index.js +2 -1
- package/modern/constants/localeTextConstants.js +1 -1
- package/modern/constants/signature.js +10 -0
- package/modern/context/GridRootPropsContext.js +2 -0
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +7 -5
- package/modern/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +5 -1
- package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/modern/hooks/core/useGridApiInitialization.js +3 -3
- package/modern/hooks/core/useGridStateInitialization.js +6 -5
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +39 -78
- 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/gridColumnsSelector.js +0 -12
- package/modern/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/modern/hooks/features/columns/useGridColumns.js +9 -4
- package/modern/hooks/features/dimensions/gridDimensionsSelectors.js +26 -1
- package/modern/hooks/features/dimensions/index.js +1 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +104 -98
- package/modern/hooks/features/editing/gridEditingSelectors.js +12 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +4 -4
- package/modern/hooks/features/editing/useGridRowEditing.js +10 -11
- package/modern/hooks/features/export/useGridPrintExport.js +1 -1
- package/modern/hooks/features/filter/gridFilterSelector.js +8 -2
- package/modern/hooks/features/filter/gridFilterState.js +5 -0
- package/modern/hooks/features/filter/gridFilterUtils.js +3 -3
- package/modern/hooks/features/filter/useGridFilter.js +10 -15
- 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 +23 -3
- package/modern/hooks/features/pagination/gridPaginationSelector.js +39 -1
- package/modern/hooks/features/pagination/gridPaginationUtils.js +1 -1
- package/modern/hooks/features/pagination/useGridPagination.js +6 -4
- 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 +11 -18
- package/modern/hooks/features/rowSelection/utils.js +4 -4
- package/modern/hooks/features/rows/gridRowsSelector.js +1 -2
- package/modern/hooks/features/rows/gridRowsUtils.js +0 -25
- 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 +27 -29
- package/modern/hooks/features/rows/useGridRowsMeta.js +36 -19
- package/modern/hooks/features/sorting/gridSortingSelector.js +21 -9
- 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 +209 -118
- package/modern/hooks/utils/index.js +1 -1
- package/modern/hooks/utils/useGridApiEventHandler.js +68 -75
- package/modern/hooks/utils/useGridApiRef.js +1 -1
- package/modern/hooks/utils/useGridSelector.js +29 -49
- package/modern/hooks/utils/useGridVisibleRows.js +5 -28
- package/modern/hooks/utils/useIsSSR.js +5 -0
- package/modern/index.js +1 -1
- package/modern/internals/constants.js +8 -1
- package/modern/internals/index.js +7 -4
- 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/internals/utils/propValidation.js +1 -1
- 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 +3 -3
- 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 +56 -85
- package/node/components/GridRowCount.js +3 -2
- package/node/components/GridScrollArea.js +32 -24
- package/node/components/GridSelectedRowCount.js +3 -2
- package/node/components/GridSkeletonLoadingOverlay.js +23 -21
- 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 +27 -15
- package/node/components/containers/GridRootStyles.js +163 -53
- package/node/components/containers/GridToolbarContainer.js +3 -2
- package/node/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/node/components/menu/columnMenu/GridColumnMenuContainer.js +8 -4
- 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 +43 -21
- 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/index.js +11 -0
- package/node/constants/localeTextConstants.js +1 -1
- package/node/constants/signature.js +16 -0
- package/node/context/GridRootPropsContext.js +1 -0
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +7 -5
- package/node/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +7 -1
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/node/hooks/core/useGridApiInitialization.js +4 -4
- package/node/hooks/core/useGridStateInitialization.js +6 -5
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +37 -76
- 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/gridColumnsSelector.js +1 -13
- package/node/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/node/hooks/features/columns/useGridColumns.js +9 -4
- package/node/hooks/features/dimensions/gridDimensionsSelectors.js +38 -2
- package/node/hooks/features/dimensions/index.js +13 -11
- package/node/hooks/features/dimensions/useGridDimensions.js +102 -96
- package/node/hooks/features/editing/gridEditingSelectors.js +12 -2
- package/node/hooks/features/editing/useGridCellEditing.js +3 -3
- package/node/hooks/features/editing/useGridRowEditing.js +8 -9
- package/node/hooks/features/export/useGridPrintExport.js +1 -1
- package/node/hooks/features/filter/gridFilterSelector.js +8 -2
- package/node/hooks/features/filter/gridFilterState.js +6 -1
- package/node/hooks/features/filter/gridFilterUtils.js +3 -3
- package/node/hooks/features/filter/useGridFilter.js +9 -14
- 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 +25 -3
- package/node/hooks/features/pagination/gridPaginationSelector.js +41 -3
- package/node/hooks/features/pagination/gridPaginationUtils.js +2 -2
- package/node/hooks/features/pagination/useGridPagination.js +6 -4
- 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 +12 -19
- package/node/hooks/features/rowSelection/utils.js +5 -5
- package/node/hooks/features/rows/gridRowsSelector.js +2 -3
- package/node/hooks/features/rows/gridRowsUtils.js +0 -26
- 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 +27 -29
- package/node/hooks/features/rows/useGridRowsMeta.js +36 -19
- package/node/hooks/features/sorting/gridSortingSelector.js +22 -10
- 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 +210 -119
- package/node/hooks/utils/index.js +21 -11
- package/node/hooks/utils/useGridApiEventHandler.js +71 -78
- package/node/hooks/utils/useGridApiRef.js +1 -1
- package/node/hooks/utils/useGridSelector.js +31 -52
- package/node/hooks/utils/useGridVisibleRows.js +3 -28
- package/node/hooks/utils/useIsSSR.js +12 -0
- package/node/index.js +1 -1
- package/node/internals/constants.js +9 -2
- package/node/internals/index.js +57 -27
- 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/internals/utils/propValidation.js +2 -2
- 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 +4 -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
|
@@ -3,11 +3,14 @@ import * as React from 'react';
|
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
4
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../../../internals/constants.js";
|
|
5
5
|
import { gridVisibleColumnDefinitionsSelector } from "../columns/gridColumnsSelector.js";
|
|
6
|
-
import {
|
|
6
|
+
import { getVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
7
7
|
import { gridRenderContextSelector } from "../virtualization/gridVirtualizationSelectors.js";
|
|
8
|
-
import {
|
|
9
|
-
import { getUnprocessedRange, isRowRangeUpdated, isRowContextInitialized, getCellValue } from "./gridRowSpanningUtils.js";
|
|
8
|
+
import { getUnprocessedRange, isRowContextInitialized, getCellValue } from "./gridRowSpanningUtils.js";
|
|
10
9
|
import { GRID_CHECKBOX_SELECTION_FIELD } from "../../../colDef/gridCheckboxSelectionColDef.js";
|
|
10
|
+
import { useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
|
|
11
|
+
import { runIf } from "../../../utils/utils.js";
|
|
12
|
+
import { gridPageSizeSelector } from "../pagination/index.js";
|
|
13
|
+
import { gridDataRowIdsSelector } from "./gridRowsSelector.js";
|
|
11
14
|
const EMPTY_STATE = {
|
|
12
15
|
spannedCells: {},
|
|
13
16
|
hiddenCells: {},
|
|
@@ -35,7 +38,7 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
35
38
|
if (skippedFields.has(colDef.field)) {
|
|
36
39
|
return;
|
|
37
40
|
}
|
|
38
|
-
for (let index = rangeToProcess.firstRowIndex; index
|
|
41
|
+
for (let index = rangeToProcess.firstRowIndex; index < rangeToProcess.lastRowIndex; index += 1) {
|
|
39
42
|
const row = visibleRows[index];
|
|
40
43
|
if (hiddenCells[row.id]?.[colDef.field]) {
|
|
41
44
|
continue;
|
|
@@ -52,8 +55,8 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
52
55
|
const backwardsHiddenCells = [];
|
|
53
56
|
if (index === rangeToProcess.firstRowIndex) {
|
|
54
57
|
let prevIndex = index - 1;
|
|
55
|
-
|
|
56
|
-
while (prevIndex >= range.firstRowIndex && getCellValue(prevRowEntry.model, colDef, apiRef) === cellValue) {
|
|
58
|
+
let prevRowEntry = visibleRows[prevIndex];
|
|
59
|
+
while (prevIndex >= range.firstRowIndex && prevRowEntry && getCellValue(prevRowEntry.model, colDef, apiRef) === cellValue) {
|
|
57
60
|
const currentRow = visibleRows[prevIndex + 1];
|
|
58
61
|
if (hiddenCells[currentRow.id]) {
|
|
59
62
|
hiddenCells[currentRow.id][colDef.field] = true;
|
|
@@ -67,6 +70,7 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
67
70
|
spannedRowId = prevRowEntry.id;
|
|
68
71
|
spannedRowIndex = prevIndex;
|
|
69
72
|
prevIndex -= 1;
|
|
73
|
+
prevRowEntry = visibleRows[prevIndex];
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
backwardsHiddenCells.forEach(hiddenCellIndex => {
|
|
@@ -122,6 +126,24 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
122
126
|
processedRange
|
|
123
127
|
};
|
|
124
128
|
};
|
|
129
|
+
const getInitialRangeToProcess = (props, apiRef) => {
|
|
130
|
+
const rowCount = gridDataRowIdsSelector(apiRef).length;
|
|
131
|
+
if (props.pagination) {
|
|
132
|
+
const pageSize = gridPageSizeSelector(apiRef);
|
|
133
|
+
let paginationLastRowIndex = DEFAULT_ROWS_TO_PROCESS;
|
|
134
|
+
if (pageSize > 0) {
|
|
135
|
+
paginationLastRowIndex = pageSize - 1;
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
firstRowIndex: 0,
|
|
139
|
+
lastRowIndex: Math.min(paginationLastRowIndex, rowCount)
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
firstRowIndex: 0,
|
|
144
|
+
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, rowCount)
|
|
145
|
+
};
|
|
146
|
+
};
|
|
125
147
|
|
|
126
148
|
/**
|
|
127
149
|
* @requires columnsStateInitializer (method) - should be initialized before
|
|
@@ -129,73 +151,52 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
129
151
|
* @requires filterStateInitializer (method) - should be initialized before
|
|
130
152
|
*/
|
|
131
153
|
export const rowSpanningStateInitializer = (state, props, apiRef) => {
|
|
132
|
-
if (props.
|
|
133
|
-
const rowIds = state.rows.dataRowIds || [];
|
|
134
|
-
const orderedFields = state.columns.orderedFields || [];
|
|
135
|
-
const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
|
|
136
|
-
const columnsLookup = state.columns.lookup;
|
|
137
|
-
const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
|
|
138
|
-
if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
|
|
139
|
-
return _extends({}, state, {
|
|
140
|
-
rowSpanning: EMPTY_STATE
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
const rangeToProcess = {
|
|
144
|
-
firstRowIndex: 0,
|
|
145
|
-
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS - 1, Math.max(rowIds.length - 1, 0))
|
|
146
|
-
};
|
|
147
|
-
const rows = rowIds.map(id => ({
|
|
148
|
-
id,
|
|
149
|
-
model: dataRowIdToModelLookup[id]
|
|
150
|
-
}));
|
|
151
|
-
const colDefs = orderedFields.map(field => columnsLookup[field]);
|
|
152
|
-
const {
|
|
153
|
-
spannedCells,
|
|
154
|
-
hiddenCells,
|
|
155
|
-
hiddenCellOriginMap
|
|
156
|
-
} = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
|
|
154
|
+
if (!props.rowSpanning) {
|
|
157
155
|
return _extends({}, state, {
|
|
158
|
-
rowSpanning:
|
|
159
|
-
spannedCells,
|
|
160
|
-
hiddenCells,
|
|
161
|
-
hiddenCellOriginMap
|
|
162
|
-
}
|
|
156
|
+
rowSpanning: EMPTY_STATE
|
|
163
157
|
});
|
|
164
158
|
}
|
|
159
|
+
const rowIds = state.rows.dataRowIds || [];
|
|
160
|
+
const orderedFields = state.columns.orderedFields || [];
|
|
161
|
+
const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
|
|
162
|
+
const columnsLookup = state.columns.lookup;
|
|
163
|
+
const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
|
|
164
|
+
if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
|
|
165
|
+
return _extends({}, state, {
|
|
166
|
+
rowSpanning: EMPTY_STATE
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
const rangeToProcess = getInitialRangeToProcess(props, apiRef);
|
|
170
|
+
const rows = rowIds.map(id => ({
|
|
171
|
+
id,
|
|
172
|
+
model: dataRowIdToModelLookup[id]
|
|
173
|
+
}));
|
|
174
|
+
const colDefs = orderedFields.map(field => columnsLookup[field]);
|
|
175
|
+
const {
|
|
176
|
+
spannedCells,
|
|
177
|
+
hiddenCells,
|
|
178
|
+
hiddenCellOriginMap
|
|
179
|
+
} = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
|
|
165
180
|
return _extends({}, state, {
|
|
166
|
-
rowSpanning:
|
|
181
|
+
rowSpanning: {
|
|
182
|
+
spannedCells,
|
|
183
|
+
hiddenCells,
|
|
184
|
+
hiddenCellOriginMap
|
|
185
|
+
}
|
|
167
186
|
});
|
|
168
187
|
};
|
|
169
188
|
export const useGridRowSpanning = (apiRef, props) => {
|
|
170
|
-
const {
|
|
171
|
-
range,
|
|
172
|
-
rows: visibleRows
|
|
173
|
-
} = useGridVisibleRows(apiRef, props);
|
|
174
|
-
const renderContext = useGridSelector(apiRef, gridRenderContextSelector);
|
|
175
|
-
const colDefs = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
|
|
176
189
|
const processedRange = useLazyRef(() => {
|
|
177
|
-
return
|
|
178
|
-
firstRowIndex: 0,
|
|
179
|
-
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS - 1, Math.max(apiRef.current.state.rows.dataRowIds.length - 1, 0))
|
|
180
|
-
} : EMPTY_RANGE;
|
|
190
|
+
return apiRef.current.state.rowSpanning !== EMPTY_STATE ? getInitialRangeToProcess(props, apiRef) : EMPTY_RANGE;
|
|
181
191
|
});
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
(resetState = true) => {
|
|
191
|
-
if (!props.unstable_rowSpanning) {
|
|
192
|
-
if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
|
|
193
|
-
apiRef.current.setState(state => _extends({}, state, {
|
|
194
|
-
rowSpanning: EMPTY_STATE
|
|
195
|
-
}));
|
|
196
|
-
}
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
192
|
+
const updateRowSpanningState = React.useCallback((renderContext, resetState = false) => {
|
|
193
|
+
const {
|
|
194
|
+
range,
|
|
195
|
+
rows: visibleRows
|
|
196
|
+
} = getVisibleRows(apiRef, {
|
|
197
|
+
pagination: props.pagination,
|
|
198
|
+
paginationMode: props.paginationMode
|
|
199
|
+
});
|
|
199
200
|
if (range === null || !isRowContextInitialized(renderContext)) {
|
|
200
201
|
return;
|
|
201
202
|
}
|
|
@@ -204,11 +205,12 @@ export const useGridRowSpanning = (apiRef, props) => {
|
|
|
204
205
|
}
|
|
205
206
|
const rangeToProcess = getUnprocessedRange({
|
|
206
207
|
firstRowIndex: renderContext.firstRowIndex,
|
|
207
|
-
lastRowIndex: Math.min(renderContext.lastRowIndex
|
|
208
|
+
lastRowIndex: Math.min(renderContext.lastRowIndex, range.lastRowIndex + 1)
|
|
208
209
|
}, processedRange.current);
|
|
209
210
|
if (rangeToProcess === null) {
|
|
210
211
|
return;
|
|
211
212
|
}
|
|
213
|
+
const colDefs = gridVisibleColumnDefinitionsSelector(apiRef);
|
|
212
214
|
const {
|
|
213
215
|
spannedCells,
|
|
214
216
|
hiddenCells,
|
|
@@ -221,7 +223,8 @@ export const useGridRowSpanning = (apiRef, props) => {
|
|
|
221
223
|
const currentSpannedCellsCount = Object.keys(apiRef.current.state.rowSpanning.spannedCells).length;
|
|
222
224
|
const currentHiddenCellsCount = Object.keys(apiRef.current.state.rowSpanning.hiddenCells).length;
|
|
223
225
|
const shouldUpdateState = resetState || newSpannedCellsCount !== currentSpannedCellsCount || newHiddenCellsCount !== currentHiddenCellsCount;
|
|
224
|
-
|
|
226
|
+
const hasNoSpannedCells = newSpannedCellsCount === 0 && currentSpannedCellsCount === 0;
|
|
227
|
+
if (!shouldUpdateState || hasNoSpannedCells) {
|
|
225
228
|
return;
|
|
226
229
|
}
|
|
227
230
|
apiRef.current.setState(state => {
|
|
@@ -233,27 +236,35 @@ export const useGridRowSpanning = (apiRef, props) => {
|
|
|
233
236
|
}
|
|
234
237
|
});
|
|
235
238
|
});
|
|
236
|
-
}, [apiRef, props.
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
239
|
+
}, [apiRef, processedRange, props.pagination, props.paginationMode]);
|
|
240
|
+
|
|
241
|
+
// Reset events trigger a full re-computation of the row spanning state:
|
|
242
|
+
// - The `unstable_rowSpanning` prop is updated (feature flag)
|
|
243
|
+
// - The filtering is applied
|
|
244
|
+
// - The sorting is applied
|
|
245
|
+
// - The `paginationModel` is updated
|
|
246
|
+
// - The rows are updated
|
|
247
|
+
const resetRowSpanningState = React.useCallback(() => {
|
|
248
|
+
const renderContext = gridRenderContextSelector(apiRef);
|
|
249
|
+
if (!isRowContextInitialized(renderContext)) {
|
|
250
|
+
return;
|
|
248
251
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
252
|
+
updateRowSpanningState(renderContext, true);
|
|
253
|
+
}, [apiRef, updateRowSpanningState]);
|
|
254
|
+
useGridApiEventHandler(apiRef, 'renderedRowsIntervalChange', runIf(props.rowSpanning, updateRowSpanningState));
|
|
255
|
+
useGridApiEventHandler(apiRef, 'sortedRowsSet', runIf(props.rowSpanning, resetRowSpanningState));
|
|
256
|
+
useGridApiEventHandler(apiRef, 'paginationModelChange', runIf(props.rowSpanning, resetRowSpanningState));
|
|
257
|
+
useGridApiEventHandler(apiRef, 'filteredRowsSet', runIf(props.rowSpanning, resetRowSpanningState));
|
|
258
|
+
useGridApiEventHandler(apiRef, 'columnsChange', runIf(props.rowSpanning, resetRowSpanningState));
|
|
259
|
+
React.useEffect(() => {
|
|
260
|
+
if (!props.rowSpanning) {
|
|
261
|
+
if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
|
|
262
|
+
apiRef.current.setState(state => _extends({}, state, {
|
|
263
|
+
rowSpanning: EMPTY_STATE
|
|
264
|
+
}));
|
|
253
265
|
}
|
|
254
|
-
|
|
255
|
-
|
|
266
|
+
} else if (apiRef.current.state.rowSpanning === EMPTY_STATE) {
|
|
267
|
+
resetRowSpanningState();
|
|
256
268
|
}
|
|
257
|
-
|
|
258
|
-
}, [updateRowSpanningState, renderContext, range, lastRange]);
|
|
269
|
+
}, [apiRef, resetRowSpanningState, props.rowSpanning]);
|
|
259
270
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
3
3
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
4
4
|
import { GridStateInitializer } from '../../utils/useGridInitializeState';
|
|
5
5
|
export declare const rowsStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'unstable_dataSource' | 'rows' | 'rowCount' | 'getRowId' | 'loading'>>;
|
|
6
|
-
export declare const useGridRows: (apiRef:
|
|
6
|
+
export declare const useGridRows: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rows" | "getRowId" | "rowCount" | "throttleRowsMs" | "signature" | "pagination" | "paginationMode" | "loading" | "unstable_dataSource">) => void;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
|
+
import { isObjectEmpty } from '@mui/x-internals/isObjectEmpty';
|
|
4
5
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
|
|
5
6
|
import { useGridLogger } from "../../utils/useGridLogger.js";
|
|
6
|
-
import { gridRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridDataRowIdsSelector,
|
|
7
|
+
import { gridRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridDataRowIdsSelector, gridRowMaximumTreeDepthSelector, gridRowGroupsToFetchSelector } from "./gridRowsSelector.js";
|
|
7
8
|
import { useTimeout } from "../../utils/useTimeout.js";
|
|
8
|
-
import { GridSignature
|
|
9
|
-
import {
|
|
9
|
+
import { GridSignature } from "../../../constants/signature.js";
|
|
10
|
+
import { useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
|
|
11
|
+
import { getVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
10
12
|
import { gridSortedRowIdsSelector } from "../sorting/gridSortingSelector.js";
|
|
11
13
|
import { gridFilteredRowsLookupSelector } from "../filter/gridFilterSelector.js";
|
|
12
14
|
import { getTreeNodeDescendants, createRowsInternalCache, getRowsStateFromCache, isAutogeneratedRowNode, GRID_ROOT_GROUP_ID, GRID_ID_AUTOGENERATED, updateCacheWithNewRows, getTopLevelRowCount, getRowIdFromRowModel, computeRowsUpdates } from "./gridRowsUtils.js";
|
|
13
15
|
import { useGridRegisterPipeApplier } from "../../core/pipeProcessing/index.js";
|
|
16
|
+
import { GridStrategyGroup } from "../../core/strategyProcessing/index.js";
|
|
14
17
|
export const rowsStateInitializer = (state, props, apiRef) => {
|
|
15
18
|
const isDataSourceAvailable = !!props.unstable_dataSource;
|
|
16
19
|
apiRef.current.caches.rows = createRowsInternalCache({
|
|
@@ -39,7 +42,6 @@ export const useGridRows = (apiRef, props) => {
|
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
const logger = useGridLogger(apiRef, 'useGridRows');
|
|
42
|
-
const currentPage = useGridVisibleRows(apiRef, props);
|
|
43
45
|
const lastUpdateMs = React.useRef(Date.now());
|
|
44
46
|
const lastRowCount = React.useRef(props.rowCount);
|
|
45
47
|
const timeout = useTimeout();
|
|
@@ -66,12 +68,6 @@ export const useGridRows = (apiRef, props) => {
|
|
|
66
68
|
}
|
|
67
69
|
return row.id;
|
|
68
70
|
}, [getRowIdProp]);
|
|
69
|
-
const lookup = React.useMemo(() => currentPage.rows.reduce((acc, {
|
|
70
|
-
id
|
|
71
|
-
}, index) => {
|
|
72
|
-
acc[id] = index;
|
|
73
|
-
return acc;
|
|
74
|
-
}, {}), [currentPage.rows]);
|
|
75
71
|
const throttledRowsChange = React.useCallback(({
|
|
76
72
|
cache,
|
|
77
73
|
throttle
|
|
@@ -170,7 +166,12 @@ export const useGridRows = (apiRef, props) => {
|
|
|
170
166
|
}, [apiRef]);
|
|
171
167
|
const getRowsCount = React.useCallback(() => gridRowCountSelector(apiRef), [apiRef]);
|
|
172
168
|
const getAllRowIds = React.useCallback(() => gridDataRowIdsSelector(apiRef), [apiRef]);
|
|
173
|
-
const getRowIndexRelativeToVisibleRows = React.useCallback(id =>
|
|
169
|
+
const getRowIndexRelativeToVisibleRows = React.useCallback(id => {
|
|
170
|
+
const {
|
|
171
|
+
rowIdToIndexMap
|
|
172
|
+
} = getVisibleRows(apiRef);
|
|
173
|
+
return rowIdToIndexMap.get(id);
|
|
174
|
+
}, [apiRef]);
|
|
174
175
|
const setRowChildrenExpansion = React.useCallback((id, isExpanded) => {
|
|
175
176
|
const currentNode = apiRef.current.getRowNode(id);
|
|
176
177
|
if (!currentNode) {
|
|
@@ -222,7 +223,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
222
223
|
}
|
|
223
224
|
if (applyFiltering) {
|
|
224
225
|
const filteredRowsLookup = gridFilteredRowsLookupSelector(apiRef);
|
|
225
|
-
children = children.filter(childId => filteredRowsLookup[childId] !== false);
|
|
226
|
+
children = isObjectEmpty(filteredRowsLookup) ? children : children.filter(childId => filteredRowsLookup[childId] !== false);
|
|
226
227
|
}
|
|
227
228
|
return children;
|
|
228
229
|
}, [apiRef]);
|
|
@@ -238,7 +239,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
238
239
|
throw new Error(`MUI X: The row reordering do not support reordering of footer or grouping rows.`);
|
|
239
240
|
}
|
|
240
241
|
apiRef.current.setState(state => {
|
|
241
|
-
const group = gridRowTreeSelector(state, apiRef.current.instanceId)[GRID_ROOT_GROUP_ID];
|
|
242
|
+
const group = gridRowTreeSelector(state, undefined, apiRef.current.instanceId)[GRID_ROOT_GROUP_ID];
|
|
242
243
|
const allRows = group.children;
|
|
243
244
|
const oldIndex = allRows.findIndex(row => row === rowId);
|
|
244
245
|
if (oldIndex === -1 || oldIndex === targetIndex) {
|
|
@@ -272,7 +273,6 @@ export const useGridRows = (apiRef, props) => {
|
|
|
272
273
|
}
|
|
273
274
|
const tree = _extends({}, gridRowTreeSelector(apiRef));
|
|
274
275
|
const dataRowIdToModelLookup = _extends({}, gridRowsLookupSelector(apiRef));
|
|
275
|
-
const dataRowIdToIdLookup = _extends({}, gridRowsDataRowIdToIdLookupSelector(apiRef));
|
|
276
276
|
const rootGroup = tree[GRID_ROOT_GROUP_ID];
|
|
277
277
|
const rootGroupChildren = [...rootGroup.children];
|
|
278
278
|
const seenIds = new Set();
|
|
@@ -282,7 +282,6 @@ export const useGridRows = (apiRef, props) => {
|
|
|
282
282
|
const [removedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
|
|
283
283
|
if (!seenIds.has(removedRowId)) {
|
|
284
284
|
delete dataRowIdToModelLookup[removedRowId];
|
|
285
|
-
delete dataRowIdToIdLookup[removedRowId];
|
|
286
285
|
delete tree[removedRowId];
|
|
287
286
|
}
|
|
288
287
|
const rowTreeNodeConfig = {
|
|
@@ -293,7 +292,6 @@ export const useGridRows = (apiRef, props) => {
|
|
|
293
292
|
groupingKey: null
|
|
294
293
|
};
|
|
295
294
|
dataRowIdToModelLookup[rowId] = rowModel;
|
|
296
|
-
dataRowIdToIdLookup[rowId] = rowId;
|
|
297
295
|
tree[rowId] = rowTreeNodeConfig;
|
|
298
296
|
seenIds.add(rowId);
|
|
299
297
|
}
|
|
@@ -304,17 +302,17 @@ export const useGridRows = (apiRef, props) => {
|
|
|
304
302
|
// Removes potential remaining skeleton rows from the dataRowIds.
|
|
305
303
|
const dataRowIds = rootGroupChildren.filter(childId => tree[childId]?.type === 'leaf');
|
|
306
304
|
apiRef.current.caches.rows.dataRowIdToModelLookup = dataRowIdToModelLookup;
|
|
307
|
-
apiRef.current.caches.rows.dataRowIdToIdLookup = dataRowIdToIdLookup;
|
|
308
305
|
apiRef.current.setState(state => _extends({}, state, {
|
|
309
306
|
rows: _extends({}, state.rows, {
|
|
307
|
+
loading: props.loading,
|
|
308
|
+
totalRowCount: Math.max(props.rowCount || 0, rootGroupChildren.length),
|
|
310
309
|
dataRowIdToModelLookup,
|
|
311
|
-
dataRowIdToIdLookup,
|
|
312
310
|
dataRowIds,
|
|
313
311
|
tree
|
|
314
312
|
})
|
|
315
313
|
}));
|
|
316
314
|
apiRef.current.publishEvent('rowsSet');
|
|
317
|
-
}, [apiRef, props.signature, props.getRowId]);
|
|
315
|
+
}, [apiRef, props.signature, props.getRowId, props.loading, props.rowCount]);
|
|
318
316
|
const rowApi = {
|
|
319
317
|
getRow,
|
|
320
318
|
setLoading,
|
|
@@ -381,7 +379,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
381
379
|
const handleStrategyActivityChange = React.useCallback(() => {
|
|
382
380
|
// `rowTreeCreation` is the only processor ran when `strategyAvailabilityChange` is fired.
|
|
383
381
|
// All the other processors listen to `rowsSet` which will be published by the `groupRows` method below.
|
|
384
|
-
if (apiRef.current.getActiveStrategy(
|
|
382
|
+
if (apiRef.current.getActiveStrategy(GridStrategyGroup.RowTree) !== gridRowGroupingNameSelector(apiRef)) {
|
|
385
383
|
groupRows();
|
|
386
384
|
}
|
|
387
385
|
}, [apiRef, groupRows]);
|
|
@@ -394,11 +392,10 @@ export const useGridRows = (apiRef, props) => {
|
|
|
394
392
|
const applyHydrateRowsProcessor = React.useCallback(() => {
|
|
395
393
|
apiRef.current.setState(state => {
|
|
396
394
|
const response = apiRef.current.unstable_applyPipeProcessors('hydrateRows', {
|
|
397
|
-
tree: gridRowTreeSelector(state, apiRef.current.instanceId),
|
|
398
|
-
treeDepths: gridRowTreeDepthsSelector(state, apiRef.current.instanceId),
|
|
399
|
-
dataRowIds: gridDataRowIdsSelector(state, apiRef.current.instanceId),
|
|
400
|
-
dataRowIdToModelLookup: gridRowsLookupSelector(state, apiRef.current.instanceId)
|
|
401
|
-
dataRowIdToIdLookup: gridRowsDataRowIdToIdLookupSelector(state, apiRef.current.instanceId)
|
|
395
|
+
tree: gridRowTreeSelector(state, undefined, apiRef.current.instanceId),
|
|
396
|
+
treeDepths: gridRowTreeDepthsSelector(state, undefined, apiRef.current.instanceId),
|
|
397
|
+
dataRowIds: gridDataRowIdsSelector(state, undefined, apiRef.current.instanceId),
|
|
398
|
+
dataRowIdToModelLookup: gridRowsLookupSelector(state, undefined, apiRef.current.instanceId)
|
|
402
399
|
});
|
|
403
400
|
return _extends({}, state, {
|
|
404
401
|
rows: _extends({}, state.rows, response, {
|
|
@@ -430,7 +427,8 @@ export const useGridRows = (apiRef, props) => {
|
|
|
430
427
|
isRowCountPropUpdated = true;
|
|
431
428
|
lastRowCount.current = props.rowCount;
|
|
432
429
|
}
|
|
433
|
-
const
|
|
430
|
+
const currentRows = props.unstable_dataSource ? Array.from(apiRef.current.getRowModels().values()) : props.rows;
|
|
431
|
+
const areNewRowsAlreadyInState = apiRef.current.caches.rows.rowsBeforePartialUpdates === currentRows;
|
|
434
432
|
const isNewLoadingAlreadyInState = apiRef.current.caches.rows.loadingPropBeforePartialUpdates === props.loading;
|
|
435
433
|
const isNewRowCountAlreadyInState = apiRef.current.caches.rows.rowCountPropBeforePartialUpdates === props.rowCount;
|
|
436
434
|
|
|
@@ -460,15 +458,15 @@ export const useGridRows = (apiRef, props) => {
|
|
|
460
458
|
return;
|
|
461
459
|
}
|
|
462
460
|
}
|
|
463
|
-
logger.debug(`Updating all rows, new length ${
|
|
461
|
+
logger.debug(`Updating all rows, new length ${currentRows?.length}`);
|
|
464
462
|
throttledRowsChange({
|
|
465
463
|
cache: createRowsInternalCache({
|
|
466
|
-
rows:
|
|
464
|
+
rows: currentRows,
|
|
467
465
|
getRowId: props.getRowId,
|
|
468
466
|
loading: props.loading,
|
|
469
467
|
rowCount: props.rowCount
|
|
470
468
|
}),
|
|
471
469
|
throttle: false
|
|
472
470
|
});
|
|
473
|
-
}, [props.rows, props.rowCount, props.getRowId, props.loading, logger, throttledRowsChange, apiRef]);
|
|
471
|
+
}, [props.rows, props.rowCount, props.getRowId, props.loading, props.unstable_dataSource, logger, throttledRowsChange, apiRef]);
|
|
474
472
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
import { GridStateInitializer } from '../../utils/useGridInitializeState';
|
|
@@ -7,4 +7,4 @@ export declare const rowsMetaStateInitializer: GridStateInitializer;
|
|
|
7
7
|
* @requires useGridPageSize (method)
|
|
8
8
|
* @requires useGridPage (method)
|
|
9
9
|
*/
|
|
10
|
-
export declare const useGridRowsMeta: (apiRef:
|
|
10
|
+
export declare const useGridRowsMeta: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "getRowHeight" | "getEstimatedRowHeight" | "getRowSpacing" | "pagination" | "paginationMode" | "rowHeight">) => void;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
|
+
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
4
5
|
import { ResizeObserver } from "../../../utils/ResizeObserver.js";
|
|
5
6
|
import { useGridVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
6
7
|
import { eslintUseValue } from "../../../utils/utils.js";
|
|
7
8
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
|
|
8
9
|
import { useGridSelector } from "../../utils/useGridSelector.js";
|
|
9
10
|
import { gridDensityFactorSelector } from "../density/densitySelector.js";
|
|
10
|
-
import { gridFilterModelSelector } from "../filter/gridFilterSelector.js";
|
|
11
11
|
import { gridPaginationSelector } from "../pagination/gridPaginationSelector.js";
|
|
12
|
-
import { gridSortModelSelector } from "../sorting/gridSortingSelector.js";
|
|
13
12
|
import { useGridRegisterPipeApplier } from "../../core/pipeProcessing/index.js";
|
|
14
|
-
import { gridPinnedRowsSelector } from "./gridRowsSelector.js";
|
|
15
|
-
import { gridDimensionsSelector } from "../dimensions/gridDimensionsSelectors.js";
|
|
13
|
+
import { gridPinnedRowsSelector, gridRowCountSelector } from "./gridRowsSelector.js";
|
|
14
|
+
import { gridDimensionsSelector, gridRowHeightSelector } from "../dimensions/gridDimensionsSelectors.js";
|
|
16
15
|
import { getValidRowHeight, getRowHeightWarning } from "./gridRowsUtils.js";
|
|
17
16
|
/* eslint-disable no-underscore-dangle */
|
|
18
17
|
|
|
@@ -20,10 +19,18 @@ export const rowsMetaStateInitializer = (state, props, apiRef) => {
|
|
|
20
19
|
apiRef.current.caches.rowsMeta = {
|
|
21
20
|
heights: new Map()
|
|
22
21
|
};
|
|
22
|
+
const baseRowHeight = gridRowHeightSelector(apiRef.current.state);
|
|
23
|
+
const dataRowCount = gridRowCountSelector(apiRef.current.state);
|
|
24
|
+
const pagination = gridPaginationSelector(apiRef.current.state);
|
|
25
|
+
const rowCount = Math.min(pagination.enabled ? pagination.paginationModel.pageSize : dataRowCount, dataRowCount);
|
|
23
26
|
return _extends({}, state, {
|
|
24
27
|
rowsMeta: {
|
|
25
|
-
currentPageTotalHeight:
|
|
26
|
-
positions:
|
|
28
|
+
currentPageTotalHeight: rowCount * baseRowHeight,
|
|
29
|
+
positions: Array.from({
|
|
30
|
+
length: rowCount
|
|
31
|
+
}, (_, i) => i * baseRowHeight),
|
|
32
|
+
pinnedTopRowsTotalHeight: 0,
|
|
33
|
+
pinnedBottomRowsTotalHeight: 0
|
|
27
34
|
}
|
|
28
35
|
});
|
|
29
36
|
};
|
|
@@ -43,12 +50,9 @@ export const useGridRowsMeta = (apiRef, props) => {
|
|
|
43
50
|
const hasRowWithAutoHeight = React.useRef(false);
|
|
44
51
|
const isHeightMetaValid = React.useRef(false);
|
|
45
52
|
const densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);
|
|
46
|
-
const filterModel = useGridSelector(apiRef, gridFilterModelSelector);
|
|
47
|
-
const paginationState = useGridSelector(apiRef, gridPaginationSelector);
|
|
48
|
-
const sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
49
53
|
const currentPage = useGridVisibleRows(apiRef, props);
|
|
50
54
|
const pinnedRows = useGridSelector(apiRef, gridPinnedRowsSelector);
|
|
51
|
-
const rowHeight = useGridSelector(apiRef,
|
|
55
|
+
const rowHeight = useGridSelector(apiRef, gridRowHeightSelector);
|
|
52
56
|
const getRowHeightEntry = rowId => {
|
|
53
57
|
let entry = heightCache.get(rowId);
|
|
54
58
|
if (entry === undefined) {
|
|
@@ -110,11 +114,17 @@ export const useGridRowsMeta = (apiRef, props) => {
|
|
|
110
114
|
}
|
|
111
115
|
apiRef.current.unstable_applyPipeProcessors('rowHeight', entry, row);
|
|
112
116
|
return entry;
|
|
113
|
-
}, [apiRef, currentPage.rows
|
|
117
|
+
}, [apiRef, currentPage.rows, getRowHeightProp, getEstimatedRowHeight, rowHeight, getRowSpacing, densityFactor]);
|
|
114
118
|
const hydrateRowsMeta = React.useCallback(() => {
|
|
115
119
|
hasRowWithAutoHeight.current = false;
|
|
116
|
-
pinnedRows.top.
|
|
117
|
-
|
|
120
|
+
const pinnedTopRowsTotalHeight = pinnedRows.top.reduce((acc, row) => {
|
|
121
|
+
const entry = processHeightEntry(row);
|
|
122
|
+
return acc + entry.content + entry.spacingTop + entry.spacingBottom + entry.detail;
|
|
123
|
+
}, 0);
|
|
124
|
+
const pinnedBottomRowsTotalHeight = pinnedRows.bottom.reduce((acc, row) => {
|
|
125
|
+
const entry = processHeightEntry(row);
|
|
126
|
+
return acc + entry.content + entry.spacingTop + entry.spacingBottom + entry.detail;
|
|
127
|
+
}, 0);
|
|
118
128
|
const positions = [];
|
|
119
129
|
const currentPageTotalHeight = currentPage.rows.reduce((acc, row) => {
|
|
120
130
|
positions.push(acc);
|
|
@@ -126,14 +136,21 @@ export const useGridRowsMeta = (apiRef, props) => {
|
|
|
126
136
|
// No row has height=auto, so all rows are already measured
|
|
127
137
|
lastMeasuredRowIndex.current = Infinity;
|
|
128
138
|
}
|
|
139
|
+
const didHeightsChange = pinnedTopRowsTotalHeight !== apiRef.current.state.rowsMeta.pinnedTopRowsTotalHeight || pinnedBottomRowsTotalHeight !== apiRef.current.state.rowsMeta.pinnedBottomRowsTotalHeight || currentPageTotalHeight !== apiRef.current.state.rowsMeta.currentPageTotalHeight;
|
|
140
|
+
const rowsMeta = {
|
|
141
|
+
currentPageTotalHeight,
|
|
142
|
+
positions,
|
|
143
|
+
pinnedTopRowsTotalHeight,
|
|
144
|
+
pinnedBottomRowsTotalHeight
|
|
145
|
+
};
|
|
129
146
|
apiRef.current.setState(state => {
|
|
130
147
|
return _extends({}, state, {
|
|
131
|
-
rowsMeta
|
|
132
|
-
currentPageTotalHeight,
|
|
133
|
-
positions
|
|
134
|
-
}
|
|
148
|
+
rowsMeta
|
|
135
149
|
});
|
|
136
150
|
});
|
|
151
|
+
if (didHeightsChange) {
|
|
152
|
+
apiRef.current.updateDimensions();
|
|
153
|
+
}
|
|
137
154
|
isHeightMetaValid.current = true;
|
|
138
155
|
}, [apiRef, pinnedRows, currentPage.rows, processHeightEntry]);
|
|
139
156
|
const getRowHeight = rowId => {
|
|
@@ -181,9 +198,9 @@ export const useGridRowsMeta = (apiRef, props) => {
|
|
|
181
198
|
|
|
182
199
|
// The effect is used to build the rows meta data - currentPageTotalHeight and positions.
|
|
183
200
|
// Because of variable row height this is needed for the virtualization
|
|
184
|
-
|
|
201
|
+
useEnhancedEffect(() => {
|
|
185
202
|
hydrateRowsMeta();
|
|
186
|
-
}, [
|
|
203
|
+
}, [hydrateRowsMeta]);
|
|
187
204
|
const rowsMetaApi = {
|
|
188
205
|
unstable_getRowHeight: getRowHeight,
|
|
189
206
|
unstable_setLastMeasuredRowIndex: setLastMeasuredRowIndex,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
|
-
export declare const useGridRowsPreProcessors: (apiRef:
|
|
3
|
+
export declare const useGridRowsPreProcessors: (apiRef: RefObject<GridPrivateApiCommunity>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
3
3
|
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
4
4
|
/**
|
|
@@ -9,4 +9,4 @@ import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
|
9
9
|
* @requires useGridFilter (state)
|
|
10
10
|
* @requires useGridColumnSpanning (method)
|
|
11
11
|
*/
|
|
12
|
-
export declare const useGridScroll: (apiRef:
|
|
12
|
+
export declare const useGridScroll: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "pagination" | "unstable_listView">) => void;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { GridSortDirection, GridSortModel } from '../../../models/gridSortModel';
|
|
2
2
|
import type { GridStateCommunity } from '../../../models/gridStateCommunity';
|
|
3
|
-
import type { GridValidRowModel, GridRowEntry } from '../../../models/gridRows';
|
|
3
|
+
import type { GridValidRowModel, GridRowEntry, GridRowId } from '../../../models/gridRows';
|
|
4
4
|
/**
|
|
5
5
|
* Get the id of the rows after the sorting process.
|
|
6
6
|
* @category Sorting
|
|
7
7
|
*/
|
|
8
|
-
export declare const gridSortedRowIdsSelector: import("../../..").OutputSelector<GridStateCommunity, import("
|
|
8
|
+
export declare const gridSortedRowIdsSelector: import("../../..").OutputSelector<GridStateCommunity, import("./gridSortingState").GridSortingState, GridRowId[]>;
|
|
9
9
|
/**
|
|
10
10
|
* Get the id and the model of the rows after the sorting process.
|
|
11
11
|
* @category Sorting
|
|
12
12
|
*/
|
|
13
|
-
export declare const gridSortedRowEntriesSelector: import("../../..").OutputSelector<GridStateCommunity, GridRowEntry<GridValidRowModel>[]>;
|
|
13
|
+
export declare const gridSortedRowEntriesSelector: import("../../..").OutputSelector<GridStateCommunity, import("../../..").GridRowTreeConfig, GridRowEntry<GridValidRowModel>[]>;
|
|
14
14
|
/**
|
|
15
15
|
* Get the current sorting model.
|
|
16
16
|
* @category Sorting
|
|
17
17
|
*/
|
|
18
|
-
export declare const gridSortModelSelector: import("../../..").OutputSelector<GridStateCommunity, GridSortModel>;
|
|
18
|
+
export declare const gridSortModelSelector: import("../../..").OutputSelector<GridStateCommunity, import("./gridSortingState").GridSortingState, GridSortModel>;
|
|
19
19
|
export type GridSortColumnLookup = Record<string, {
|
|
20
20
|
sortDirection: GridSortDirection;
|
|
21
21
|
sortIndex?: number;
|
|
@@ -24,4 +24,9 @@ export type GridSortColumnLookup = Record<string, {
|
|
|
24
24
|
* @category Sorting
|
|
25
25
|
* @ignore - do not document.
|
|
26
26
|
*/
|
|
27
|
-
export declare const gridSortColumnLookupSelector: import("../../..").OutputSelector<GridStateCommunity, GridSortColumnLookup>;
|
|
27
|
+
export declare const gridSortColumnLookupSelector: import("../../..").OutputSelector<GridStateCommunity, GridSortModel, GridSortColumnLookup>;
|
|
28
|
+
/**
|
|
29
|
+
* @category Sorting
|
|
30
|
+
* @ignore - do not document.
|
|
31
|
+
*/
|
|
32
|
+
export declare const gridSortedRowIndexLookupSelector: import("../../..").OutputSelector<GridStateCommunity, GridRowId[], Record<GridRowId, number>>;
|