@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
|
@@ -6,7 +6,6 @@ import { gridVisibleColumnDefinitionsSelector, gridVisibleColumnFieldsSelector }
|
|
|
6
6
|
import { useGridLogger } from "../../utils/useGridLogger.js";
|
|
7
7
|
import { useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
|
|
8
8
|
import { gridExpandedSortedRowEntriesSelector } from "../filter/gridFilterSelector.js";
|
|
9
|
-
import { useGridVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
10
9
|
import { GRID_CHECKBOX_SELECTION_COL_DEF } from "../../../colDef/gridCheckboxSelectionColDef.js";
|
|
11
10
|
import { gridClasses } from "../../../constants/gridClasses.js";
|
|
12
11
|
import { GridCellModes } from "../../../models/gridEditRowModel.js";
|
|
@@ -16,8 +15,14 @@ import { gridColumnGroupsHeaderMaxDepthSelector } from "../columnGrouping/gridCo
|
|
|
16
15
|
import { gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector } from "../headerFiltering/gridHeaderFilteringSelectors.js";
|
|
17
16
|
import { useGridRegisterPipeProcessor } from "../../core/pipeProcessing/index.js";
|
|
18
17
|
import { isEventTargetInPortal } from "../../../utils/domUtils.js";
|
|
19
|
-
import {
|
|
18
|
+
import { getLeftColumnIndex, getRightColumnIndex, findNonRowSpannedCell } from "./utils.js";
|
|
20
19
|
import { gridListColumnSelector } from "../listView/gridListViewSelectors.js";
|
|
20
|
+
import { createSelectorMemoized } from "../../../utils/createSelector.js";
|
|
21
|
+
import { gridVisibleRowsSelector } from "../pagination/index.js";
|
|
22
|
+
import { gridPinnedRowsSelector } from "../rows/gridRowsSelector.js";
|
|
23
|
+
const gridVisibleRowsWithPinnedRowsSelector = createSelectorMemoized(gridVisibleRowsSelector, gridPinnedRowsSelector, (visibleRows, pinnedRows) => {
|
|
24
|
+
return (pinnedRows.top || []).concat(visibleRows.rows, pinnedRows.bottom || []);
|
|
25
|
+
});
|
|
21
26
|
|
|
22
27
|
/**
|
|
23
28
|
* @requires useGridSorting (method) - can be after
|
|
@@ -30,10 +35,11 @@ import { gridListColumnSelector } from "../listView/gridListViewSelectors.js";
|
|
|
30
35
|
*/
|
|
31
36
|
export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
32
37
|
const logger = useGridLogger(apiRef, 'useGridKeyboardNavigation');
|
|
33
|
-
const initialCurrentPageRows = useGridVisibleRows(apiRef, props).rows;
|
|
34
38
|
const isRtl = useRtl();
|
|
35
39
|
const listView = props.unstable_listView;
|
|
36
|
-
const
|
|
40
|
+
const getCurrentPageRows = React.useCallback(() => {
|
|
41
|
+
return gridVisibleRowsWithPinnedRowsSelector(apiRef);
|
|
42
|
+
}, [apiRef]);
|
|
37
43
|
const headerFilteringEnabled = props.signature !== 'DataGrid' && props.headerFilters;
|
|
38
44
|
|
|
39
45
|
/**
|
|
@@ -92,8 +98,8 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
92
98
|
apiRef.current.setColumnGroupHeaderFocus(field, depth, event);
|
|
93
99
|
}, [apiRef, logger]);
|
|
94
100
|
const getRowIdFromIndex = React.useCallback(rowIndex => {
|
|
95
|
-
return
|
|
96
|
-
}, [
|
|
101
|
+
return getCurrentPageRows()[rowIndex]?.id;
|
|
102
|
+
}, [getCurrentPageRows]);
|
|
97
103
|
const handleColumnHeaderKeyDown = React.useCallback((params, event) => {
|
|
98
104
|
const headerTitleNode = event.currentTarget.querySelector(`.${gridClasses.columnHeaderTitleContainerContent}`);
|
|
99
105
|
const isFromInsideContent = !!headerTitleNode && headerTitleNode.contains(event.target);
|
|
@@ -102,6 +108,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
102
108
|
// There is one exception for the checkBoxHeader
|
|
103
109
|
return;
|
|
104
110
|
}
|
|
111
|
+
const currentPageRows = getCurrentPageRows();
|
|
105
112
|
const viewportPageSize = apiRef.current.getViewportPageSize();
|
|
106
113
|
const colIndexBefore = params.field ? apiRef.current.getColumnIndex(params.field) : 0;
|
|
107
114
|
const firstRowIndexInPage = currentPageRows.length > 0 ? 0 : null;
|
|
@@ -113,12 +120,10 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
113
120
|
switch (event.key) {
|
|
114
121
|
case 'ArrowDown':
|
|
115
122
|
{
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
goToCell(colIndexBefore, getRowIdFromIndex(firstRowIndexInPage));
|
|
121
|
-
}
|
|
123
|
+
if (headerFilteringEnabled) {
|
|
124
|
+
goToHeaderFilter(colIndexBefore, event);
|
|
125
|
+
} else if (firstRowIndexInPage !== null) {
|
|
126
|
+
goToCell(colIndexBefore, getRowIdFromIndex(firstRowIndexInPage));
|
|
122
127
|
}
|
|
123
128
|
break;
|
|
124
129
|
}
|
|
@@ -192,13 +197,14 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
192
197
|
if (shouldPreventDefault) {
|
|
193
198
|
event.preventDefault();
|
|
194
199
|
}
|
|
195
|
-
}, [apiRef,
|
|
200
|
+
}, [apiRef, getCurrentPageRows, headerFilteringEnabled, goToHeaderFilter, goToCell, getRowIdFromIndex, isRtl, goToHeader, goToGroupHeader]);
|
|
196
201
|
const handleHeaderFilterKeyDown = React.useCallback((params, event) => {
|
|
197
202
|
const isEditing = gridHeaderFilteringEditFieldSelector(apiRef) === params.field;
|
|
198
203
|
const isHeaderMenuOpen = gridHeaderFilteringMenuSelector(apiRef) === params.field;
|
|
199
204
|
if (isEditing || isHeaderMenuOpen || !isNavigationKey(event.key)) {
|
|
200
205
|
return;
|
|
201
206
|
}
|
|
207
|
+
const currentPageRows = getCurrentPageRows();
|
|
202
208
|
const viewportPageSize = apiRef.current.getViewportPageSize();
|
|
203
209
|
const colIndexBefore = params.field ? apiRef.current.getColumnIndex(params.field) : 0;
|
|
204
210
|
const firstRowIndexInPage = 0;
|
|
@@ -278,7 +284,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
278
284
|
if (shouldPreventDefault) {
|
|
279
285
|
event.preventDefault();
|
|
280
286
|
}
|
|
281
|
-
}, [apiRef,
|
|
287
|
+
}, [apiRef, getCurrentPageRows, goToHeaderFilter, isRtl, goToHeader, goToCell, getRowIdFromIndex]);
|
|
282
288
|
const handleColumnGroupHeaderKeyDown = React.useCallback((params, event) => {
|
|
283
289
|
const focusedColumnGroup = gridFocusColumnGroupHeaderSelector(apiRef);
|
|
284
290
|
if (focusedColumnGroup === null) {
|
|
@@ -293,6 +299,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
293
299
|
depth,
|
|
294
300
|
maxDepth
|
|
295
301
|
} = params;
|
|
302
|
+
const currentPageRows = getCurrentPageRows();
|
|
296
303
|
const viewportPageSize = apiRef.current.getViewportPageSize();
|
|
297
304
|
const currentColIndex = apiRef.current.getColumnIndex(currentField);
|
|
298
305
|
const colIndexBefore = currentField ? apiRef.current.getColumnIndex(currentField) : 0;
|
|
@@ -364,7 +371,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
364
371
|
if (shouldPreventDefault) {
|
|
365
372
|
event.preventDefault();
|
|
366
373
|
}
|
|
367
|
-
}, [apiRef,
|
|
374
|
+
}, [apiRef, getCurrentPageRows, goToHeader, goToGroupHeader, goToCell, getRowIdFromIndex]);
|
|
368
375
|
const handleCellKeyDown = React.useCallback((params, event) => {
|
|
369
376
|
// Ignore portal
|
|
370
377
|
if (isEventTargetInPortal(event)) {
|
|
@@ -383,6 +390,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
383
390
|
if (!canUpdateFocus) {
|
|
384
391
|
return;
|
|
385
392
|
}
|
|
393
|
+
const currentPageRows = getCurrentPageRows();
|
|
386
394
|
if (currentPageRows.length === 0) {
|
|
387
395
|
return;
|
|
388
396
|
}
|
|
@@ -511,7 +519,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
511
519
|
if (shouldPreventDefault) {
|
|
512
520
|
event.preventDefault();
|
|
513
521
|
}
|
|
514
|
-
}, [apiRef,
|
|
522
|
+
}, [apiRef, getCurrentPageRows, isRtl, goToCell, getRowIdFromIndex, headerFilteringEnabled, goToHeaderFilter, goToHeader, listView]);
|
|
515
523
|
const checkIfCanStartEditing = React.useCallback((initialValue, {
|
|
516
524
|
event
|
|
517
525
|
}) => {
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { gridFilteredSortedRowIdsSelector } from "../filter/gridFilterSelector.js";
|
|
2
2
|
import { gridRowSpanningHiddenCellsSelector } from "../rows/gridRowSpanningSelectors.js";
|
|
3
|
-
import { gridPinnedRowsSelector } from "../rows/gridRowsSelector.js";
|
|
4
|
-
export function enrichPageRowsWithPinnedRows(apiRef, rows) {
|
|
5
|
-
const pinnedRows = gridPinnedRowsSelector(apiRef) || {};
|
|
6
|
-
return [...(pinnedRows.top || []), ...rows, ...(pinnedRows.bottom || [])];
|
|
7
|
-
}
|
|
8
3
|
export const getLeftColumnIndex = ({
|
|
9
4
|
currentColIndex,
|
|
10
5
|
firstColIndex,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./gridListViewSelectors.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
3
4
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
4
5
|
import { gridDimensionsSelector } from "../dimensions/index.js";
|
|
5
6
|
import { useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
|
|
@@ -37,7 +38,7 @@ export function useGridListView(apiRef, props) {
|
|
|
37
38
|
/*
|
|
38
39
|
* EFFECTS
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
+
useEnhancedEffect(() => {
|
|
41
42
|
const listColumn = props.unstable_listColumn;
|
|
42
43
|
if (listColumn) {
|
|
43
44
|
apiRef.current.setState(state => {
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
1
3
|
import { useGridSelector } from "../../utils/index.js";
|
|
2
4
|
import { useGridApiContext } from "../../utils/useGridApiContext.js";
|
|
3
5
|
import { useGridRootProps } from "../../utils/useGridRootProps.js";
|
|
4
6
|
import { gridExpandedRowCountSelector } from "../filter/index.js";
|
|
5
7
|
import { gridRowCountSelector, gridRowsLoadingSelector } from "../rows/index.js";
|
|
8
|
+
import { gridPinnedRowsCountSelector } from "../rows/gridRowsSelector.js";
|
|
9
|
+
import { GridOverlayWrapper } from "../../../components/base/GridOverlays.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
11
|
/**
|
|
7
12
|
* Uses the grid state to determine which overlay to display.
|
|
8
13
|
* Returns the active overlay type and the active loading overlay variant.
|
|
@@ -12,7 +17,8 @@ export const useGridOverlays = () => {
|
|
|
12
17
|
const rootProps = useGridRootProps();
|
|
13
18
|
const totalRowCount = useGridSelector(apiRef, gridRowCountSelector);
|
|
14
19
|
const visibleRowCount = useGridSelector(apiRef, gridExpandedRowCountSelector);
|
|
15
|
-
const
|
|
20
|
+
const pinnedRowsCount = useGridSelector(apiRef, gridPinnedRowsCountSelector);
|
|
21
|
+
const noRows = totalRowCount === 0 && pinnedRowsCount === 0;
|
|
16
22
|
const loading = useGridSelector(apiRef, gridRowsLoadingSelector);
|
|
17
23
|
const showNoRowsOverlay = !loading && noRows;
|
|
18
24
|
const showNoResultsOverlay = !loading && totalRowCount > 0 && visibleRowCount === 0;
|
|
@@ -26,10 +32,24 @@ export const useGridOverlays = () => {
|
|
|
26
32
|
}
|
|
27
33
|
if (loading) {
|
|
28
34
|
overlayType = 'loadingOverlay';
|
|
29
|
-
loadingOverlayVariant = rootProps.slotProps?.loadingOverlay?.[noRows ? 'noRowsVariant' : 'variant']
|
|
35
|
+
loadingOverlayVariant = rootProps.slotProps?.loadingOverlay?.[noRows ? 'noRowsVariant' : 'variant'] ?? (noRows ? 'skeleton' : 'linear-progress');
|
|
30
36
|
}
|
|
31
|
-
|
|
37
|
+
const overlaysProps = {
|
|
32
38
|
overlayType,
|
|
33
39
|
loadingOverlayVariant
|
|
34
40
|
};
|
|
41
|
+
const getOverlay = () => {
|
|
42
|
+
if (!overlayType) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const Overlay = rootProps.slots?.[overlayType];
|
|
46
|
+
const overlayProps = rootProps.slotProps?.[overlayType];
|
|
47
|
+
return /*#__PURE__*/_jsx(GridOverlayWrapper, _extends({}, overlaysProps, {
|
|
48
|
+
children: /*#__PURE__*/_jsx(Overlay, _extends({}, overlayProps))
|
|
49
|
+
}));
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
getOverlay,
|
|
53
|
+
overlaysProps
|
|
54
|
+
};
|
|
35
55
|
};
|
|
@@ -10,6 +10,12 @@ const ALL_RESULTS_PAGE_VALUE = -1;
|
|
|
10
10
|
*/
|
|
11
11
|
export const gridPaginationSelector = state => state.pagination;
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* @category Pagination
|
|
15
|
+
* @ignore - do not document.
|
|
16
|
+
*/
|
|
17
|
+
export const gridPaginationEnabledClientSideSelector = createSelector(gridPaginationSelector, pagination => pagination.enabled && pagination.paginationMode === 'client');
|
|
18
|
+
|
|
13
19
|
/**
|
|
14
20
|
* Get the pagination model
|
|
15
21
|
* @category Pagination
|
|
@@ -50,7 +56,10 @@ export const gridPageCountSelector = createSelector(gridPaginationModelSelector,
|
|
|
50
56
|
* Get the index of the first and the last row to include in the current page if the pagination is enabled.
|
|
51
57
|
* @category Pagination
|
|
52
58
|
*/
|
|
53
|
-
export const gridPaginationRowRangeSelector = createSelectorMemoized(gridPaginationModelSelector, gridRowTreeSelector, gridRowMaximumTreeDepthSelector, gridExpandedSortedRowEntriesSelector, gridFilteredSortedTopLevelRowEntriesSelector, (paginationModel, rowTree, rowTreeDepth, visibleSortedRowEntries, visibleSortedTopLevelRowEntries) => {
|
|
59
|
+
export const gridPaginationRowRangeSelector = createSelectorMemoized(gridPaginationEnabledClientSideSelector, gridPaginationModelSelector, gridRowTreeSelector, gridRowMaximumTreeDepthSelector, gridExpandedSortedRowEntriesSelector, gridFilteredSortedTopLevelRowEntriesSelector, (clientSidePaginationEnabled, paginationModel, rowTree, rowTreeDepth, visibleSortedRowEntries, visibleSortedTopLevelRowEntries) => {
|
|
60
|
+
if (!clientSidePaginationEnabled) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
54
63
|
const visibleTopLevelRowCount = visibleSortedTopLevelRowEntries.length;
|
|
55
64
|
const topLevelFirstRowIndex = Math.min(paginationModel.pageSize * paginationModel.page, visibleTopLevelRowCount - 1);
|
|
56
65
|
const topLevelLastRowIndex = paginationModel.pageSize === ALL_RESULTS_PAGE_VALUE ? visibleTopLevelRowCount - 1 : Math.min(topLevelFirstRowIndex + paginationModel.pageSize - 1, visibleTopLevelRowCount - 1);
|
|
@@ -112,4 +121,33 @@ export const gridPaginatedVisibleSortedGridRowIdsSelector = createSelectorMemoiz
|
|
|
112
121
|
return [];
|
|
113
122
|
}
|
|
114
123
|
return visibleSortedRowIds.slice(paginationRange.firstRowIndex, paginationRange.lastRowIndex + 1);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Get the rows, range and rowIndex lookup map after filtering and sorting.
|
|
128
|
+
* Does not contain the collapsed children.
|
|
129
|
+
* @category Pagination
|
|
130
|
+
*/
|
|
131
|
+
export const gridVisibleRowsSelector = createSelectorMemoized(gridPaginationEnabledClientSideSelector, gridPaginationRowRangeSelector, gridPaginatedVisibleSortedGridRowEntriesSelector, gridExpandedSortedRowEntriesSelector, (clientPaginationEnabled, paginationRowRange, paginationRows, expandedSortedRowEntries) => {
|
|
132
|
+
if (clientPaginationEnabled) {
|
|
133
|
+
return {
|
|
134
|
+
rows: paginationRows,
|
|
135
|
+
range: paginationRowRange,
|
|
136
|
+
rowIdToIndexMap: paginationRows.reduce((lookup, row, index) => {
|
|
137
|
+
lookup.set(row.id, index);
|
|
138
|
+
return lookup;
|
|
139
|
+
}, new Map())
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
rows: expandedSortedRowEntries,
|
|
144
|
+
range: expandedSortedRowEntries.length === 0 ? null : {
|
|
145
|
+
firstRowIndex: 0,
|
|
146
|
+
lastRowIndex: expandedSortedRowEntries.length - 1
|
|
147
|
+
},
|
|
148
|
+
rowIdToIndexMap: expandedSortedRowEntries.reduce((lookup, row, index) => {
|
|
149
|
+
lookup.set(row.id, index);
|
|
150
|
+
return lookup;
|
|
151
|
+
}, new Map())
|
|
152
|
+
};
|
|
115
153
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridSignature } from "
|
|
1
|
+
import { GridSignature } from "../../../constants/signature.js";
|
|
2
2
|
const MAX_PAGE_SIZE = 100;
|
|
3
3
|
export const defaultPageSize = autoPageSize => autoPageSize ? 0 : 100;
|
|
4
4
|
export const getPageCount = (rowCount, pageSize, page) => {
|
|
@@ -6,14 +6,16 @@ import { useGridPaginationMeta } from "./useGridPaginationMeta.js";
|
|
|
6
6
|
export const paginationStateInitializer = (state, props) => {
|
|
7
7
|
const paginationModel = _extends({}, getDefaultGridPaginationModel(props.autoPageSize), props.paginationModel ?? props.initialState?.pagination?.paginationModel);
|
|
8
8
|
throwIfPageSizeExceedsTheLimit(paginationModel.pageSize, props.signature);
|
|
9
|
-
const rowCount = props.rowCount ?? props.initialState?.pagination?.rowCount;
|
|
9
|
+
const rowCount = props.rowCount ?? props.initialState?.pagination?.rowCount ?? (props.paginationMode === 'client' ? state.rows?.totalRowCount : undefined);
|
|
10
10
|
const meta = props.paginationMeta ?? props.initialState?.pagination?.meta ?? {};
|
|
11
11
|
return _extends({}, state, {
|
|
12
|
-
pagination: {
|
|
12
|
+
pagination: _extends({}, state.pagination, {
|
|
13
13
|
paginationModel,
|
|
14
14
|
rowCount,
|
|
15
|
-
meta
|
|
16
|
-
|
|
15
|
+
meta,
|
|
16
|
+
enabled: props.pagination === true,
|
|
17
|
+
paginationMode: props.paginationMode
|
|
18
|
+
})
|
|
17
19
|
});
|
|
18
20
|
};
|
|
19
21
|
|
|
@@ -155,12 +155,34 @@ export const useGridPaginationModel = (apiRef, props) => {
|
|
|
155
155
|
/**
|
|
156
156
|
* EFFECTS
|
|
157
157
|
*/
|
|
158
|
+
const isFirstRender = React.useRef(true);
|
|
158
159
|
React.useEffect(() => {
|
|
160
|
+
if (isFirstRender.current) {
|
|
161
|
+
isFirstRender.current = false;
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (!props.pagination) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
159
167
|
apiRef.current.setState(state => _extends({}, state, {
|
|
160
168
|
pagination: _extends({}, state.pagination, {
|
|
161
169
|
paginationModel: getDerivedPaginationModel(state.pagination, props.signature, props.paginationModel)
|
|
162
170
|
})
|
|
163
171
|
}));
|
|
164
|
-
}, [apiRef, props.paginationModel, props.
|
|
172
|
+
}, [apiRef, props.paginationModel, props.signature, props.pagination]);
|
|
173
|
+
React.useEffect(() => {
|
|
174
|
+
apiRef.current.setState(state => {
|
|
175
|
+
const isEnabled = props.pagination === true;
|
|
176
|
+
if (state.pagination.paginationMode === props.paginationMode || state.pagination.enabled === isEnabled) {
|
|
177
|
+
return state;
|
|
178
|
+
}
|
|
179
|
+
return _extends({}, state, {
|
|
180
|
+
pagination: _extends({}, state.pagination, {
|
|
181
|
+
paginationMode: props.paginationMode,
|
|
182
|
+
enabled: props.pagination === true
|
|
183
|
+
})
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
}, [apiRef, props.paginationMode, props.pagination]);
|
|
165
187
|
React.useEffect(handleUpdateAutoPageSize, [handleUpdateAutoPageSize]);
|
|
166
188
|
};
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { createSelector } from "../../../utils/createSelector.js";
|
|
2
|
+
export const gridPreferencePanelStateSelector = state => state.preferencePanel;
|
|
3
|
+
export const gridPreferencePanelSelectorWithLabel = createSelector(gridPreferencePanelStateSelector, (panel, labelId) => {
|
|
4
|
+
if (panel.open && panel.labelId === labelId) {
|
|
5
|
+
return true;
|
|
6
|
+
}
|
|
7
|
+
return false;
|
|
8
|
+
});
|
|
@@ -15,42 +15,29 @@ export const preferencePanelStateInitializer = (state, props) => _extends({}, st
|
|
|
15
15
|
*/
|
|
16
16
|
export const useGridPreferencesPanel = (apiRef, props) => {
|
|
17
17
|
const logger = useGridLogger(apiRef, 'useGridPreferencesPanel');
|
|
18
|
-
const hideTimeout = React.useRef();
|
|
19
|
-
const immediateTimeout = React.useRef();
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
20
|
* API METHODS
|
|
23
21
|
*/
|
|
24
22
|
const hidePreferences = React.useCallback(() => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
apiRef.current.setState(state => {
|
|
24
|
+
if (!state.preferencePanel.open) {
|
|
25
|
+
return state;
|
|
26
|
+
}
|
|
27
|
+
logger.debug('Hiding Preferences Panel');
|
|
28
|
+
const preferencePanelState = gridPreferencePanelStateSelector(state);
|
|
28
29
|
apiRef.current.publishEvent('preferencePanelClose', {
|
|
29
30
|
openedPanelValue: preferencePanelState.openedPanelValue
|
|
30
31
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
apiRef.current.forceUpdate();
|
|
32
|
+
return _extends({}, state, {
|
|
33
|
+
preferencePanel: {
|
|
34
|
+
open: false
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
38
|
}, [apiRef, logger]);
|
|
39
|
-
|
|
40
|
-
// This is to prevent the preferences from closing when you open a select box or another panel,
|
|
41
|
-
// The issue is in MUI core V4 => Fixed in V5
|
|
42
|
-
const doNotHidePanel = React.useCallback(() => {
|
|
43
|
-
immediateTimeout.current = setTimeout(() => clearTimeout(hideTimeout.current), 0);
|
|
44
|
-
}, []);
|
|
45
|
-
|
|
46
|
-
// This is a hack for the issue with Core V4, by delaying hiding the panel on the clickAwayListener,
|
|
47
|
-
// we can cancel the action if the trigger element still need the panel...
|
|
48
|
-
const hidePreferencesDelayed = React.useCallback(() => {
|
|
49
|
-
hideTimeout.current = setTimeout(hidePreferences, 100);
|
|
50
|
-
}, [hidePreferences]);
|
|
51
39
|
const showPreferences = React.useCallback((newValue, panelId, labelId) => {
|
|
52
40
|
logger.debug('Opening Preferences Panel');
|
|
53
|
-
doNotHidePanel();
|
|
54
41
|
apiRef.current.setState(state => _extends({}, state, {
|
|
55
42
|
preferencePanel: _extends({}, state.preferencePanel, {
|
|
56
43
|
open: true,
|
|
@@ -62,11 +49,10 @@ export const useGridPreferencesPanel = (apiRef, props) => {
|
|
|
62
49
|
apiRef.current.publishEvent('preferencePanelOpen', {
|
|
63
50
|
openedPanelValue: newValue
|
|
64
51
|
});
|
|
65
|
-
|
|
66
|
-
}, [logger, doNotHidePanel, apiRef]);
|
|
52
|
+
}, [logger, apiRef]);
|
|
67
53
|
useGridApiMethod(apiRef, {
|
|
68
54
|
showPreferences,
|
|
69
|
-
hidePreferences
|
|
55
|
+
hidePreferences
|
|
70
56
|
}, 'public');
|
|
71
57
|
|
|
72
58
|
/**
|
|
@@ -99,14 +85,4 @@ export const useGridPreferencesPanel = (apiRef, props) => {
|
|
|
99
85
|
}, [apiRef]);
|
|
100
86
|
useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
|
|
101
87
|
useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* EFFECTS
|
|
105
|
-
*/
|
|
106
|
-
React.useEffect(() => {
|
|
107
|
-
return () => {
|
|
108
|
-
clearTimeout(hideTimeout.current);
|
|
109
|
-
clearTimeout(immediateTimeout.current);
|
|
110
|
-
};
|
|
111
|
-
}, []);
|
|
112
88
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { GridSignature
|
|
3
|
+
import { GridSignature } from "../../../constants/signature.js";
|
|
4
|
+
import { useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
|
|
4
5
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
|
|
5
6
|
import { useGridLogger } from "../../utils/useGridLogger.js";
|
|
6
7
|
import { useGridSelector } from "../../utils/useGridSelector.js";
|
|
@@ -12,7 +13,7 @@ import { gridExpandedSortedRowIdsSelector, gridFilteredRowsLookupSelector } from
|
|
|
12
13
|
import { GRID_CHECKBOX_SELECTION_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from "../../../colDef/index.js";
|
|
13
14
|
import { GridCellModes } from "../../../models/gridEditRowModel.js";
|
|
14
15
|
import { isKeyboardEvent, isNavigationKey } from "../../../utils/keyboardUtils.js";
|
|
15
|
-
import {
|
|
16
|
+
import { getVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
16
17
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../../../internals/constants.js";
|
|
17
18
|
import { gridClasses } from "../../../constants/gridClasses.js";
|
|
18
19
|
import { isEventTargetInPortal } from "../../../utils/domUtils.js";
|
|
@@ -64,7 +65,6 @@ export const useGridRowSelection = (apiRef, props) => {
|
|
|
64
65
|
isRowSelectable: propIsRowSelectable
|
|
65
66
|
} = props;
|
|
66
67
|
const canHaveMultipleSelection = isMultipleRowSelectionEnabled(props);
|
|
67
|
-
const visibleRows = useGridVisibleRows(apiRef, props);
|
|
68
68
|
const tree = useGridSelector(apiRef, gridRowTreeSelector);
|
|
69
69
|
const isNestedData = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector) > 1;
|
|
70
70
|
const expandMouseRowRangeSelection = React.useCallback(id => {
|
|
@@ -248,11 +248,7 @@ export const useGridRowSelection = (apiRef, props) => {
|
|
|
248
248
|
/*
|
|
249
249
|
* EVENTS
|
|
250
250
|
*/
|
|
251
|
-
const isFirstRender = React.useRef(true);
|
|
252
251
|
const removeOutdatedSelection = React.useCallback((sortModelUpdated = false) => {
|
|
253
|
-
if (isFirstRender.current) {
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
252
|
const currentSelection = gridRowSelectionStateSelector(apiRef.current.state);
|
|
257
253
|
const rowsLookup = gridRowsLookupSelector(apiRef);
|
|
258
254
|
const filteredRowsLookup = gridFilteredRowsLookupSelector(apiRef);
|
|
@@ -263,7 +259,7 @@ export const useGridRowSelection = (apiRef, props) => {
|
|
|
263
259
|
if (props.filterMode === 'server') {
|
|
264
260
|
return !rowsLookup[id];
|
|
265
261
|
}
|
|
266
|
-
return filteredRowsLookup[id]
|
|
262
|
+
return !rowsLookup[id] || filteredRowsLookup[id] === false;
|
|
267
263
|
};
|
|
268
264
|
let hasChanged = false;
|
|
269
265
|
currentSelection.forEach(id => {
|
|
@@ -317,11 +313,12 @@ export const useGridRowSelection = (apiRef, props) => {
|
|
|
317
313
|
|
|
318
314
|
const isMultipleSelectionDisabled = !checkboxSelection && !hasCtrlKey && !isKeyboardEvent(event);
|
|
319
315
|
const resetSelection = !canHaveMultipleSelection || isMultipleSelectionDisabled;
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
apiRef.current.selectRow(id,
|
|
316
|
+
const selectedRowsCount = apiRef.current.getSelectedRows().size;
|
|
317
|
+
if (canHaveMultipleSelection && selectedRowsCount > 1 && !hasCtrlKey) {
|
|
318
|
+
apiRef.current.selectRow(id, true, resetSelection);
|
|
323
319
|
} else {
|
|
324
|
-
apiRef.current.
|
|
320
|
+
const isSelected = apiRef.current.isRowSelected(id);
|
|
321
|
+
apiRef.current.selectRow(id, !isSelected, resetSelection);
|
|
325
322
|
}
|
|
326
323
|
}, [apiRef, canHaveMultipleSelection, checkboxSelection]);
|
|
327
324
|
const handleRowClick = React.useCallback((params, event) => {
|
|
@@ -416,6 +413,7 @@ export const useGridRowSelection = (apiRef, props) => {
|
|
|
416
413
|
end = previousRowIndex;
|
|
417
414
|
}
|
|
418
415
|
}
|
|
416
|
+
const visibleRows = getVisibleRows(apiRef);
|
|
419
417
|
const rowsBetweenStartAndEnd = visibleRows.rows.slice(start, end + 1).map(row => row.id);
|
|
420
418
|
apiRef.current.selectRows(rowsBetweenStartAndEnd, !isNextRowSelected);
|
|
421
419
|
return;
|
|
@@ -430,7 +428,7 @@ export const useGridRowSelection = (apiRef, props) => {
|
|
|
430
428
|
event.preventDefault();
|
|
431
429
|
selectRows(apiRef.current.getAllRowIds(), true);
|
|
432
430
|
}
|
|
433
|
-
}, [apiRef, handleSingleRowSelection, selectRows,
|
|
431
|
+
}, [apiRef, handleSingleRowSelection, selectRows, canHaveMultipleSelection]);
|
|
434
432
|
useGridApiEventHandler(apiRef, 'sortedRowsSet', runIfRowSelectionIsEnabled(() => removeOutdatedSelection(true)));
|
|
435
433
|
useGridApiEventHandler(apiRef, 'filteredRowsSet', runIfRowSelectionIsEnabled(removeOutdatedSelection));
|
|
436
434
|
useGridApiEventHandler(apiRef, 'rowClick', runIfRowSelectionIsEnabled(handleRowClick));
|
|
@@ -480,9 +478,4 @@ export const useGridRowSelection = (apiRef, props) => {
|
|
|
480
478
|
React.useEffect(() => {
|
|
481
479
|
runIfRowSelectionIsEnabled(removeOutdatedSelection);
|
|
482
480
|
}, [removeOutdatedSelection, runIfRowSelectionIsEnabled]);
|
|
483
|
-
React.useEffect(() => {
|
|
484
|
-
if (isFirstRender.current) {
|
|
485
|
-
isFirstRender.current = false;
|
|
486
|
-
}
|
|
487
|
-
}, []);
|
|
488
481
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridSignature } from "
|
|
1
|
+
import { GridSignature } from "../../../constants/signature.js";
|
|
2
2
|
import { GRID_ROOT_GROUP_ID } from "../rows/gridRowsUtils.js";
|
|
3
3
|
import { gridFilteredRowsLookupSelector } from "../filter/gridFilterSelector.js";
|
|
4
4
|
import { gridSortedRowIdsSelector } from "../sorting/gridSortingSelector.js";
|
|
@@ -6,8 +6,8 @@ import { selectedIdsLookupSelector } from "./gridRowSelectionSelector.js";
|
|
|
6
6
|
import { gridRowTreeSelector } from "../rows/gridRowsSelector.js";
|
|
7
7
|
import { createSelector } from "../../../utils/createSelector.js";
|
|
8
8
|
export const ROW_SELECTION_PROPAGATION_DEFAULT = {
|
|
9
|
-
parents:
|
|
10
|
-
descendants:
|
|
9
|
+
parents: true,
|
|
10
|
+
descendants: true
|
|
11
11
|
};
|
|
12
12
|
function getGridRowGroupSelectableDescendants(apiRef, groupId) {
|
|
13
13
|
const rowTree = gridRowTreeSelector(apiRef);
|
|
@@ -92,7 +92,7 @@ const getFilteredRowNodeSiblings = (tree, filteredRows, id) => {
|
|
|
92
92
|
return [];
|
|
93
93
|
}
|
|
94
94
|
const parentNode = tree[parent];
|
|
95
|
-
return parentNode.children.filter(childId => childId !== id && filteredRows[childId]);
|
|
95
|
+
return parentNode.children.filter(childId => childId !== id && filteredRows[childId] !== false);
|
|
96
96
|
};
|
|
97
97
|
export const findRowsToSelect = (apiRef, tree, selectedRow, autoSelectDescendants, autoSelectParents, addRow) => {
|
|
98
98
|
const filteredRows = gridFilteredRowsLookupSelector(apiRef);
|
|
@@ -6,7 +6,6 @@ export const gridTopLevelRowCountSelector = createSelector(gridRowsStateSelector
|
|
|
6
6
|
|
|
7
7
|
// TODO rows v6: Rename
|
|
8
8
|
export const gridRowsLookupSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIdToModelLookup);
|
|
9
|
-
export const gridRowsDataRowIdToIdLookupSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIdToIdLookup);
|
|
10
9
|
export const gridRowTreeSelector = createSelector(gridRowsStateSelector, rows => rows.tree);
|
|
11
10
|
export const gridRowGroupsToFetchSelector = createSelector(gridRowsStateSelector, rows => rows.groupsToFetch);
|
|
12
11
|
export const gridRowGroupingNameSelector = createSelector(gridRowsStateSelector, rows => rows.groupingName);
|
|
@@ -16,7 +15,7 @@ export const gridRowMaximumTreeDepthSelector = createSelectorMemoized(gridRowsSt
|
|
|
16
15
|
if (entries.length === 0) {
|
|
17
16
|
return 1;
|
|
18
17
|
}
|
|
19
|
-
return entries.filter(([, nodeCount]) => nodeCount > 0).map(([depth]) => Number(depth)).sort((a, b) => b - a)[0] + 1;
|
|
18
|
+
return (entries.filter(([, nodeCount]) => nodeCount > 0).map(([depth]) => Number(depth)).sort((a, b) => b - a)[0] ?? 0) + 1;
|
|
20
19
|
});
|
|
21
20
|
export const gridDataRowIdsSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIds);
|
|
22
21
|
|