@mui/x-data-grid 8.0.0-alpha.6 → 8.0.0-alpha.8
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 +242 -1
- package/DataGrid/DataGrid.js +4 -5
- package/DataGrid/useDataGridComponent.d.ts +1 -1
- package/DataGrid/useDataGridComponent.js +1 -1
- package/components/GridHeaders.js +2 -2
- package/components/GridRow.d.ts +5 -9
- package/components/GridRow.js +26 -78
- package/components/GridSkeletonLoadingOverlay.js +18 -18
- package/components/cell/GridActionsCellItem.d.ts +16 -9
- package/components/cell/GridActionsCellItem.js +2 -0
- package/components/cell/GridCell.d.ts +9 -16
- package/components/cell/GridCell.js +17 -35
- package/components/cell/GridEditDateCell.js +1 -1
- package/components/cell/GridEditInputCell.js +1 -1
- package/components/cell/GridEditSingleSelectCell.js +2 -2
- package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -5
- package/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -5
- package/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/components/columnSelection/GridCellCheckboxRenderer.js +4 -3
- package/components/columnSelection/GridHeaderCheckbox.js +6 -2
- package/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/components/containers/GridRoot.d.ts +2 -2
- package/components/containers/GridRoot.js +14 -6
- package/components/containers/GridRootStyles.js +7 -0
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +32 -29
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -0
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -0
- package/components/panel/filterPanel/GridFilterInputValue.js +40 -37
- package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +1 -1
- package/components/toolbar/GridToolbarQuickFilter.js +2 -2
- package/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/components/virtualization/GridVirtualScroller.js +4 -4
- package/constants/gridClasses.d.ts +12 -0
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +1 -0
- package/context/GridContextProvider.d.ts +1 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +9 -2
- package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +1 -1
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +1 -1
- package/hooks/core/useGridApiInitialization.d.ts +1 -1
- package/hooks/core/useGridApiInitialization.js +2 -2
- package/hooks/core/useGridInitialization.d.ts +1 -1
- package/hooks/core/useGridIsRtl.d.ts +1 -1
- package/hooks/core/useGridLocaleText.d.ts +1 -1
- package/hooks/core/useGridLoggerFactory.d.ts +1 -1
- package/hooks/core/useGridRefs.d.ts +1 -1
- package/hooks/core/useGridStateInitialization.d.ts +1 -1
- package/hooks/features/clipboard/useGridClipboard.d.ts +1 -1
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +5 -7
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
- package/hooks/features/columnMenu/useGridColumnMenu.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +4 -4
- package/hooks/features/columns/gridColumnsUtils.d.ts +3 -3
- package/hooks/features/columns/useGridColumnSpanning.d.ts +1 -1
- package/hooks/features/columns/useGridColumns.d.ts +1 -1
- package/hooks/features/density/useGridDensity.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
- package/hooks/features/editing/useGridCellEditing.d.ts +1 -1
- package/hooks/features/editing/useGridCellEditing.js +1 -1
- package/hooks/features/editing/useGridEditing.d.ts +1 -1
- package/hooks/features/editing/useGridRowEditing.d.ts +1 -1
- package/hooks/features/editing/useGridRowEditing.js +2 -2
- package/hooks/features/events/useGridEvents.d.ts +1 -1
- package/hooks/features/export/serializers/csvSerializer.d.ts +1 -1
- package/hooks/features/export/useGridCsvExport.d.ts +1 -1
- package/hooks/features/export/useGridPrintExport.d.ts +1 -1
- package/hooks/features/export/useGridPrintExport.js +1 -1
- package/hooks/features/export/utils.d.ts +1 -1
- package/hooks/features/filter/gridFilterSelector.d.ts +1 -1
- package/hooks/features/filter/gridFilterSelector.js +6 -1
- package/hooks/features/filter/gridFilterUtils.d.ts +6 -6
- package/hooks/features/filter/gridFilterUtils.js +3 -3
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/focus/useGridFocus.d.ts +1 -1
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/keyboardNavigation/utils.d.ts +2 -2
- package/hooks/features/listView/useGridListView.d.ts +1 -1
- package/hooks/features/pagination/gridPaginationInterfaces.d.ts +3 -0
- package/hooks/features/pagination/gridPaginationSelector.d.ts +21 -2
- package/hooks/features/pagination/gridPaginationSelector.js +39 -1
- package/hooks/features/pagination/useGridPagination.d.ts +2 -2
- package/hooks/features/pagination/useGridPagination.js +5 -3
- package/hooks/features/pagination/useGridPaginationMeta.d.ts +1 -1
- package/hooks/features/pagination/useGridPaginationModel.d.ts +1 -1
- package/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/hooks/features/pagination/useGridRowCount.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +1 -1
- package/hooks/features/rowSelection/utils.d.ts +2 -2
- package/hooks/features/rows/gridRowSpanningUtils.d.ts +1 -1
- package/hooks/features/rows/gridRowsSelector.js +1 -1
- package/hooks/features/rows/gridRowsUtils.d.ts +3 -3
- package/hooks/features/rows/useGridParamsApi.d.ts +1 -1
- package/hooks/features/rows/useGridRowSpanning.d.ts +1 -1
- package/hooks/features/rows/useGridRows.d.ts +1 -1
- package/hooks/features/rows/useGridRows.js +2 -2
- package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
- package/hooks/features/rows/useGridRowsPreProcessors.d.ts +1 -1
- package/hooks/features/scroll/useGridScroll.d.ts +1 -1
- package/hooks/features/sorting/gridSortingUtils.d.ts +2 -2
- package/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/features/statePersistence/useGridStatePersistence.d.ts +1 -1
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +6 -0
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +5 -4
- package/hooks/features/virtualization/useGridVirtualScroller.js +96 -43
- package/hooks/features/virtualization/useGridVirtualization.d.ts +1 -1
- package/hooks/utils/useGridApiContext.d.ts +1 -1
- package/hooks/utils/useGridApiEventHandler.d.ts +3 -3
- package/hooks/utils/useGridApiEventHandler.js +1 -1
- package/hooks/utils/useGridApiMethod.d.ts +1 -1
- package/hooks/utils/useGridApiRef.d.ts +1 -1
- package/hooks/utils/useGridInitializeState.d.ts +2 -2
- package/hooks/utils/useGridLogger.d.ts +1 -1
- package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
- package/hooks/utils/useGridPrivateApiContext.d.ts +1 -1
- package/hooks/utils/useGridSelector.d.ts +1 -1
- package/hooks/utils/useGridVisibleRows.d.ts +7 -5
- package/hooks/utils/useGridVisibleRows.js +5 -28
- package/index.js +1 -1
- package/internals/constants.d.ts +6 -0
- package/internals/constants.js +8 -1
- package/internals/index.d.ts +2 -1
- package/internals/index.js +1 -0
- 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 -0
- package/internals/utils/index.js +2 -1
- package/locales/arSD.js +2 -0
- package/locales/beBY.js +1 -0
- package/locales/bgBG.js +2 -0
- package/locales/csCZ.js +2 -0
- package/locales/daDK.js +2 -0
- package/locales/deDE.js +2 -0
- package/locales/elGR.js +2 -0
- package/locales/esES.js +2 -0
- package/locales/faIR.js +2 -0
- package/locales/fiFI.js +2 -0
- package/locales/frFR.js +2 -0
- package/locales/heIL.js +2 -0
- package/locales/hrHR.js +2 -0
- package/locales/huHU.js +2 -0
- package/locales/isIS.js +2 -0
- package/locales/itIT.js +2 -0
- package/locales/jaJP.js +2 -0
- package/locales/koKR.js +2 -0
- package/locales/nbNO.js +2 -0
- package/locales/nlNL.js +2 -0
- package/locales/nnNO.js +2 -0
- package/locales/plPL.js +2 -0
- package/locales/ptBR.js +2 -0
- package/locales/ptPT.js +2 -0
- package/locales/roRO.js +2 -0
- package/locales/ruRU.js +2 -0
- package/locales/skSK.js +2 -0
- package/locales/svSE.js +2 -0
- package/locales/trTR.js +2 -0
- package/locales/ukUA.js +2 -0
- package/locales/urPK.js +2 -0
- package/locales/viVN.js +2 -0
- package/locales/zhCN.js +2 -0
- package/locales/zhHK.js +2 -0
- package/locales/zhTW.js +2 -0
- package/material/index.js +2 -1
- package/models/api/gridCoreApi.d.ts +7 -7
- package/models/api/gridDensityApi.d.ts +1 -1
- package/models/api/gridLocaleTextApi.d.ts +1 -0
- package/models/colDef/gridColDef.d.ts +8 -8
- package/models/events/gridEventLookup.d.ts +6 -1
- package/models/gridBaseSlots.d.ts +32 -2
- package/models/gridExport.d.ts +1 -1
- package/models/gridFilterOperator.d.ts +1 -1
- package/models/gridIconSlotsComponent.d.ts +5 -0
- package/models/gridSlotsComponentsProps.d.ts +12 -8
- package/models/gridStateCommunity.d.ts +4 -0
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/DataGrid/DataGrid.js +4 -5
- package/modern/DataGrid/useDataGridComponent.js +1 -1
- package/modern/components/GridHeaders.js +2 -2
- package/modern/components/GridRow.js +26 -78
- package/modern/components/GridSkeletonLoadingOverlay.js +18 -18
- package/modern/components/cell/GridActionsCellItem.js +2 -0
- package/modern/components/cell/GridCell.js +17 -35
- package/modern/components/cell/GridEditDateCell.js +1 -1
- package/modern/components/cell/GridEditInputCell.js +1 -1
- package/modern/components/cell/GridEditSingleSelectCell.js +2 -2
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +4 -3
- package/modern/components/columnSelection/GridHeaderCheckbox.js +6 -2
- package/modern/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/modern/components/containers/GridRoot.js +14 -6
- package/modern/components/containers/GridRootStyles.js +7 -0
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +32 -29
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +40 -37
- package/modern/components/toolbar/GridToolbarQuickFilter.js +2 -2
- package/modern/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/modern/components/virtualization/GridVirtualScroller.js +4 -4
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +1 -0
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/modern/hooks/core/useGridApiInitialization.js +2 -2
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
- package/modern/hooks/features/columnResize/useGridColumnResize.js +4 -4
- package/modern/hooks/features/editing/useGridCellEditing.js +1 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +2 -2
- package/modern/hooks/features/export/useGridPrintExport.js +1 -1
- package/modern/hooks/features/filter/gridFilterSelector.js +6 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +3 -3
- package/modern/hooks/features/pagination/gridPaginationSelector.js +39 -1
- package/modern/hooks/features/pagination/useGridPagination.js +5 -3
- package/modern/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/modern/hooks/features/rows/gridRowsSelector.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +2 -2
- package/modern/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/modern/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +96 -43
- package/modern/hooks/utils/useGridApiEventHandler.js +1 -1
- package/modern/hooks/utils/useGridVisibleRows.js +5 -28
- package/modern/index.js +1 -1
- package/modern/internals/constants.js +8 -1
- package/modern/internals/index.js +1 -0
- package/modern/internals/utils/attachPinnedStyle.js +9 -0
- package/modern/internals/utils/getPinnedCellOffset.js +6 -7
- package/modern/internals/utils/index.js +2 -1
- package/modern/locales/arSD.js +2 -0
- package/modern/locales/beBY.js +1 -0
- package/modern/locales/bgBG.js +2 -0
- package/modern/locales/csCZ.js +2 -0
- package/modern/locales/daDK.js +2 -0
- package/modern/locales/deDE.js +2 -0
- package/modern/locales/elGR.js +2 -0
- package/modern/locales/esES.js +2 -0
- package/modern/locales/faIR.js +2 -0
- package/modern/locales/fiFI.js +2 -0
- package/modern/locales/frFR.js +2 -0
- package/modern/locales/heIL.js +2 -0
- package/modern/locales/hrHR.js +2 -0
- package/modern/locales/huHU.js +2 -0
- package/modern/locales/isIS.js +2 -0
- package/modern/locales/itIT.js +2 -0
- package/modern/locales/jaJP.js +2 -0
- package/modern/locales/koKR.js +2 -0
- package/modern/locales/nbNO.js +2 -0
- package/modern/locales/nlNL.js +2 -0
- package/modern/locales/nnNO.js +2 -0
- package/modern/locales/plPL.js +2 -0
- package/modern/locales/ptBR.js +2 -0
- package/modern/locales/ptPT.js +2 -0
- package/modern/locales/roRO.js +2 -0
- package/modern/locales/ruRU.js +2 -0
- package/modern/locales/skSK.js +2 -0
- package/modern/locales/svSE.js +2 -0
- package/modern/locales/trTR.js +2 -0
- package/modern/locales/ukUA.js +2 -0
- package/modern/locales/urPK.js +2 -0
- package/modern/locales/viVN.js +2 -0
- package/modern/locales/zhCN.js +2 -0
- package/modern/locales/zhHK.js +2 -0
- package/modern/locales/zhTW.js +2 -0
- package/modern/material/index.js +2 -1
- package/modern/utils/cellBorderUtils.js +5 -5
- package/modern/utils/domUtils.js +7 -2
- package/modern/utils/rtlFlipSide.js +22 -0
- package/node/DataGrid/DataGrid.js +2 -3
- package/node/DataGrid/useDataGridComponent.js +1 -1
- package/node/components/GridHeaders.js +2 -2
- package/node/components/GridRow.js +25 -77
- package/node/components/GridSkeletonLoadingOverlay.js +17 -17
- package/node/components/cell/GridActionsCellItem.js +1 -1
- package/node/components/cell/GridCell.js +18 -36
- package/node/components/cell/GridEditDateCell.js +1 -1
- package/node/components/cell/GridEditInputCell.js +1 -1
- package/node/components/cell/GridEditSingleSelectCell.js +2 -2
- package/node/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
- package/node/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +3 -2
- package/node/components/columnSelection/GridHeaderCheckbox.js +6 -2
- package/node/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/node/components/containers/GridRoot.js +14 -6
- package/node/components/containers/GridRootStyles.js +7 -0
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
- package/node/components/panel/filterPanel/GridFilterInputDate.js +31 -28
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
- package/node/components/panel/filterPanel/GridFilterInputValue.js +39 -36
- package/node/components/toolbar/GridToolbarQuickFilter.js +2 -2
- package/node/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/node/components/virtualization/GridVirtualScroller.js +4 -4
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +1 -0
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/node/hooks/core/useGridApiInitialization.js +2 -2
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +32 -74
- package/node/hooks/features/columnResize/useGridColumnResize.js +4 -4
- package/node/hooks/features/editing/useGridCellEditing.js +1 -1
- package/node/hooks/features/editing/useGridRowEditing.js +2 -2
- package/node/hooks/features/export/useGridPrintExport.js +1 -1
- package/node/hooks/features/filter/gridFilterSelector.js +6 -1
- package/node/hooks/features/filter/gridFilterUtils.js +3 -3
- package/node/hooks/features/pagination/gridPaginationSelector.js +41 -3
- package/node/hooks/features/pagination/useGridPagination.js +5 -3
- package/node/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/node/hooks/features/rows/gridRowsSelector.js +1 -1
- package/node/hooks/features/rows/useGridRows.js +1 -1
- package/node/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/node/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +49 -0
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +96 -43
- package/node/hooks/utils/useGridApiEventHandler.js +1 -1
- package/node/hooks/utils/useGridVisibleRows.js +3 -28
- package/node/index.js +1 -1
- package/node/internals/constants.js +9 -2
- package/node/internals/index.js +12 -0
- package/node/internals/utils/attachPinnedStyle.js +15 -0
- package/node/internals/utils/getPinnedCellOffset.js +6 -7
- package/node/internals/utils/index.js +11 -0
- package/node/locales/arSD.js +2 -0
- package/node/locales/beBY.js +1 -0
- package/node/locales/bgBG.js +2 -0
- package/node/locales/csCZ.js +2 -0
- package/node/locales/daDK.js +2 -0
- package/node/locales/deDE.js +2 -0
- package/node/locales/elGR.js +2 -0
- package/node/locales/esES.js +2 -0
- package/node/locales/faIR.js +2 -0
- package/node/locales/fiFI.js +2 -0
- package/node/locales/frFR.js +2 -0
- package/node/locales/heIL.js +2 -0
- package/node/locales/hrHR.js +2 -0
- package/node/locales/huHU.js +2 -0
- package/node/locales/isIS.js +2 -0
- package/node/locales/itIT.js +2 -0
- package/node/locales/jaJP.js +2 -0
- package/node/locales/koKR.js +2 -0
- package/node/locales/nbNO.js +2 -0
- package/node/locales/nlNL.js +2 -0
- package/node/locales/nnNO.js +2 -0
- package/node/locales/plPL.js +2 -0
- package/node/locales/ptBR.js +2 -0
- package/node/locales/ptPT.js +2 -0
- package/node/locales/roRO.js +2 -0
- package/node/locales/ruRU.js +2 -0
- package/node/locales/skSK.js +2 -0
- package/node/locales/svSE.js +2 -0
- package/node/locales/trTR.js +2 -0
- package/node/locales/ukUA.js +2 -0
- package/node/locales/urPK.js +2 -0
- package/node/locales/viVN.js +2 -0
- package/node/locales/zhCN.js +2 -0
- package/node/locales/zhHK.js +2 -0
- package/node/locales/zhTW.js +2 -0
- package/node/material/index.js +2 -1
- package/node/utils/cellBorderUtils.js +5 -5
- package/node/utils/domUtils.js +7 -2
- package/node/utils/rtlFlipSide.js +29 -0
- package/package.json +2 -2
- package/utils/cellBorderUtils.d.ts +3 -3
- package/utils/cellBorderUtils.js +5 -5
- package/utils/createSelector.d.ts +1 -1
- package/utils/domUtils.js +7 -2
- package/utils/getPublicApiRef.d.ts +1 -1
- package/utils/rtlFlipSide.d.ts +2 -0
- package/utils/rtlFlipSide.js +22 -0
|
@@ -1,15 +1,38 @@
|
|
|
1
|
+
type Ref<T = HTMLElement> = React.RefCallback<T | null> | React.RefObject<T | null> | null;
|
|
1
2
|
export type BadgeProps = {
|
|
2
3
|
badgeContent?: React.ReactNode;
|
|
3
4
|
children: React.ReactNode;
|
|
4
5
|
color?: 'primary' | 'default' | 'error';
|
|
6
|
+
invisible?: boolean;
|
|
5
7
|
overlap?: 'circular';
|
|
6
8
|
variant?: 'dot';
|
|
7
|
-
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
};
|
|
11
|
+
export type ButtonProps = {
|
|
12
|
+
ref?: Ref;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
id?: string;
|
|
17
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
18
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
|
|
19
|
+
role?: string;
|
|
20
|
+
size?: 'small' | 'medium' | 'large';
|
|
21
|
+
startIcon?: React.ReactNode;
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
tabIndex?: number;
|
|
24
|
+
title?: string;
|
|
25
|
+
touchRippleRef?: any;
|
|
26
|
+
};
|
|
27
|
+
export type IconButtonProps = Omit<ButtonProps, 'startIcon'> & {
|
|
28
|
+
label?: string;
|
|
29
|
+
color?: 'default' | 'inherit' | 'primary';
|
|
30
|
+
edge?: 'start' | 'end' | false;
|
|
8
31
|
};
|
|
9
32
|
export type DividerProps = {};
|
|
10
33
|
export type MenuItemProps = {
|
|
11
34
|
autoFocus?: boolean;
|
|
12
|
-
children
|
|
35
|
+
children?: React.ReactNode;
|
|
13
36
|
/** For items that aren't interactive themselves (but may contain an interactive widget) */
|
|
14
37
|
inert?: boolean;
|
|
15
38
|
disabled?: boolean;
|
|
@@ -18,6 +41,7 @@ export type MenuItemProps = {
|
|
|
18
41
|
iconEnd?: React.ReactNode;
|
|
19
42
|
selected?: boolean;
|
|
20
43
|
value?: number | string | readonly string[];
|
|
44
|
+
style?: React.CSSProperties;
|
|
21
45
|
};
|
|
22
46
|
export type CircularProgressProps = {
|
|
23
47
|
/**
|
|
@@ -34,3 +58,9 @@ export type SkeletonProps = {
|
|
|
34
58
|
width?: number | string;
|
|
35
59
|
height?: number | string;
|
|
36
60
|
};
|
|
61
|
+
export type TooltipProps = {
|
|
62
|
+
children: React.ReactElement<any, any>;
|
|
63
|
+
enterDelay?: number;
|
|
64
|
+
title: React.ReactNode;
|
|
65
|
+
};
|
|
66
|
+
export {};
|
package/models/gridExport.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export interface GridGetRowsToExportParams<Api extends GridApiCommon = GridApiCo
|
|
|
49
49
|
/**
|
|
50
50
|
* The API of the grid.
|
|
51
51
|
*/
|
|
52
|
-
apiRef: React.
|
|
52
|
+
apiRef: React.RefObject<Api>;
|
|
53
53
|
}
|
|
54
54
|
export interface GridCsvGetRowsToExportParams<Api extends GridApiCommon = GridApiCommunity> extends GridGetRowsToExportParams<Api> {
|
|
55
55
|
}
|
|
@@ -3,7 +3,7 @@ import { GridFilterItem } from './gridFilterItem';
|
|
|
3
3
|
import type { GridColDef } from './colDef/gridColDef';
|
|
4
4
|
import type { GridValidRowModel } from './gridRows';
|
|
5
5
|
import type { GridApiCommunity } from './api/gridApiCommunity';
|
|
6
|
-
type ApplyFilterFn<R extends GridValidRowModel = any, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: React.
|
|
6
|
+
type ApplyFilterFn<R extends GridValidRowModel = any, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: React.RefObject<GridApiCommunity>) => boolean;
|
|
7
7
|
export type GetApplyFilterFn<R extends GridValidRowModel = any, V = any, F = V> = (filterItem: GridFilterItem, column: GridColDef<R, V, F>) => null | ApplyFilterFn<R, V, F>;
|
|
8
8
|
/**
|
|
9
9
|
* Filter operator definition interface.
|
|
@@ -178,4 +178,9 @@ export interface GridIconSlotsComponent {
|
|
|
178
178
|
* @default GridDragIcon
|
|
179
179
|
*/
|
|
180
180
|
columnReorderIcon: React.JSXElementConstructor<any>;
|
|
181
|
+
/**
|
|
182
|
+
* Icon displayed to indicate that a menu item is selected.
|
|
183
|
+
* @default GridCheckIcon
|
|
184
|
+
*/
|
|
185
|
+
menuItemCheckIcon: React.JSXElementConstructor<any>;
|
|
181
186
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { BadgeProps as MUIBadgeProps } from '@mui/material/Badge';
|
|
3
|
+
import type { ButtonProps as MUIButtonProps } from '@mui/material/Button';
|
|
3
4
|
import type { CheckboxProps } from '@mui/material/Checkbox';
|
|
4
5
|
import type { CircularProgressProps as MUICircularProgressProps } from '@mui/material/CircularProgress';
|
|
5
6
|
import type { LinearProgressProps as MUILinearProgressProps } from '@mui/material/LinearProgress';
|
|
@@ -9,10 +10,9 @@ import type { TextFieldProps } from '@mui/material/TextField';
|
|
|
9
10
|
import type { FormControlProps } from '@mui/material/FormControl';
|
|
10
11
|
import type { SelectProps } from '@mui/material/Select';
|
|
11
12
|
import type { SwitchProps } from '@mui/material/Switch';
|
|
12
|
-
import type {
|
|
13
|
-
import type { IconButtonProps } from '@mui/material/IconButton';
|
|
13
|
+
import type { IconButtonProps as MUIIconButtonProps } from '@mui/material/IconButton';
|
|
14
14
|
import type { InputAdornmentProps } from '@mui/material/InputAdornment';
|
|
15
|
-
import type { TooltipProps } from '@mui/material/Tooltip';
|
|
15
|
+
import type { TooltipProps as MUITooltipProps } from '@mui/material/Tooltip';
|
|
16
16
|
import type { InputLabelProps } from '@mui/material/InputLabel';
|
|
17
17
|
import type { PopperProps } from '@mui/material/Popper';
|
|
18
18
|
import type { TablePaginationProps } from '@mui/material/TablePagination';
|
|
@@ -35,7 +35,7 @@ import type { GridColumnsManagementProps } from '../components/columnsManagement
|
|
|
35
35
|
import type { GridLoadingOverlayProps } from '../components/GridLoadingOverlay';
|
|
36
36
|
import type { GridRowCountProps } from '../components/GridRowCount';
|
|
37
37
|
import type { GridColumnHeaderSortIconProps } from '../components/columnHeaders/GridColumnHeaderSortIcon';
|
|
38
|
-
import type { BadgeProps, CircularProgressProps, DividerProps, LinearProgressProps, MenuItemProps, SkeletonProps } from './gridBaseSlots';
|
|
38
|
+
import type { BadgeProps, ButtonProps, CircularProgressProps, DividerProps, IconButtonProps, LinearProgressProps, MenuItemProps, SkeletonProps, TooltipProps } from './gridBaseSlots';
|
|
39
39
|
type RootProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
|
|
40
40
|
type MainProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
|
|
41
41
|
export interface BaseBadgePropsOverrides {
|
|
@@ -144,9 +144,12 @@ interface BaseSlotProps {
|
|
|
144
144
|
}
|
|
145
145
|
interface MaterialSlotProps {
|
|
146
146
|
baseBadge: MUIBadgeProps;
|
|
147
|
-
|
|
147
|
+
baseButton: MUIButtonProps;
|
|
148
|
+
baseIconButton: MUIIconButtonProps;
|
|
148
149
|
baseLinearProgress: MUILinearProgressProps;
|
|
150
|
+
baseCircularProgress: MUICircularProgressProps;
|
|
149
151
|
baseMenuItem: MUIMenuItemProps;
|
|
152
|
+
baseTooltip: MUITooltipProps;
|
|
150
153
|
}
|
|
151
154
|
interface ElementSlotProps {
|
|
152
155
|
cell: GridCellProps & CellPropsOverrides;
|
|
@@ -170,16 +173,17 @@ interface ElementSlotProps {
|
|
|
170
173
|
skeletonCell: GridSkeletonCellProps & SkeletonCellPropsOverrides;
|
|
171
174
|
toolbar: GridToolbarProps & ToolbarPropsOverrides;
|
|
172
175
|
/**
|
|
173
|
-
* Props passed to the `.main` (role="grid") element
|
|
176
|
+
* Props passed to the `.main` (role="grid") element.
|
|
174
177
|
*/
|
|
175
178
|
main: MainProps;
|
|
176
179
|
/**
|
|
177
|
-
* Props passed to the `.root` element
|
|
180
|
+
* Props passed to the `.root` element.
|
|
178
181
|
*/
|
|
179
182
|
root: RootProps;
|
|
180
183
|
}
|
|
184
|
+
type Select<A, B, K> = K extends keyof A ? A[K] : K extends keyof B ? B[K] : never;
|
|
181
185
|
type Merge<A, B> = {
|
|
182
|
-
[K in keyof A | keyof B]: K extends keyof A & keyof B ? A[K] & B[K] : K extends keyof B ? B[K] : K extends keyof A ? A[K] : never;
|
|
186
|
+
[K in keyof A | keyof B]: K extends 'ref' ? Select<A, B, 'ref'> : K extends keyof A & keyof B ? A[K] & B[K] : K extends keyof B ? B[K] : K extends keyof A ? A[K] : never;
|
|
183
187
|
};
|
|
184
188
|
export type GridSlotProps = Merge<BaseSlotProps, MaterialSlotProps> & ElementSlotProps;
|
|
185
189
|
/**
|
|
@@ -369,7 +369,7 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
369
369
|
/**
|
|
370
370
|
* The ref object that allows Data Grid manipulation. Can be instantiated with `useGridApiRef()`.
|
|
371
371
|
*/
|
|
372
|
-
apiRef?: React.
|
|
372
|
+
apiRef?: React.RefObject<GridApiCommunity>;
|
|
373
373
|
/**
|
|
374
374
|
* Signal to the underlying logic what version of the public component API
|
|
375
375
|
* of the Data Grid is exposed [[GridSignature]].
|
|
@@ -4,14 +4,14 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
|
-
import {
|
|
7
|
+
import { GridRoot } from "../components/index.js";
|
|
8
8
|
import { useGridAriaAttributes } from "../hooks/utils/useGridAriaAttributes.js";
|
|
9
9
|
import { useGridRowAriaAttributes } from "../hooks/features/rows/useGridRowAriaAttributes.js";
|
|
10
10
|
import { GridContextProvider } from "../context/GridContextProvider.js";
|
|
11
11
|
import { useDataGridComponent } from "./useDataGridComponent.js";
|
|
12
12
|
import { useDataGridProps } from "./useDataGridProps.js";
|
|
13
13
|
import { propValidatorsDataGrid, validateProps } from "../internals/utils/propValidation.js";
|
|
14
|
-
import { jsx as _jsx
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
const configuration = {
|
|
16
16
|
hooks: {
|
|
17
17
|
useGridAriaAttributes,
|
|
@@ -34,13 +34,12 @@ const DataGridRaw = forwardRef(function DataGrid(inProps, ref) {
|
|
|
34
34
|
privateApiRef: privateApiRef,
|
|
35
35
|
configuration: configuration,
|
|
36
36
|
props: props,
|
|
37
|
-
children: /*#__PURE__*/
|
|
37
|
+
children: /*#__PURE__*/_jsx(GridRoot, _extends({
|
|
38
38
|
className: props.className,
|
|
39
39
|
style: props.style,
|
|
40
40
|
sx: props.sx
|
|
41
41
|
}, props.slotProps?.root, {
|
|
42
|
-
ref: ref
|
|
43
|
-
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
42
|
+
ref: ref
|
|
44
43
|
}))
|
|
45
44
|
});
|
|
46
45
|
});
|
|
@@ -44,6 +44,7 @@ export const useDataGridComponent = (inputApiRef, props) => {
|
|
|
44
44
|
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
45
45
|
useGridInitializeState(rowSelectionStateInitializer, apiRef, props);
|
|
46
46
|
useGridInitializeState(columnsStateInitializer, apiRef, props);
|
|
47
|
+
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
47
48
|
useGridInitializeState(rowsStateInitializer, apiRef, props);
|
|
48
49
|
useGridInitializeState(editingStateInitializer, apiRef, props);
|
|
49
50
|
useGridInitializeState(focusStateInitializer, apiRef, props);
|
|
@@ -53,7 +54,6 @@ export const useDataGridComponent = (inputApiRef, props) => {
|
|
|
53
54
|
useGridInitializeState(rowSpanningStateInitializer, apiRef, props);
|
|
54
55
|
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
55
56
|
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
|
|
56
|
-
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
57
57
|
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
58
58
|
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
59
59
|
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
|
|
@@ -18,7 +18,7 @@ function GridHeaders() {
|
|
|
18
18
|
const filterColumnLookup = useGridSelector(apiRef, gridFilterActiveItemsLookupSelector);
|
|
19
19
|
const sortColumnLookup = useGridSelector(apiRef, gridSortColumnLookupSelector);
|
|
20
20
|
const columnHeaderTabIndexState = useGridSelector(apiRef, gridTabIndexColumnHeaderSelector);
|
|
21
|
-
const
|
|
21
|
+
const hasNoCellTabIndexState = useGridSelector(apiRef, () => gridTabIndexCellSelector(apiRef) === null);
|
|
22
22
|
const columnGroupHeaderTabIndexState = useGridSelector(apiRef, gridTabIndexColumnGroupHeaderSelector);
|
|
23
23
|
const columnHeaderFocus = useGridSelector(apiRef, gridFocusColumnHeaderSelector);
|
|
24
24
|
const columnGroupHeaderFocus = useGridSelector(apiRef, gridFocusColumnGroupHeaderSelector);
|
|
@@ -26,7 +26,7 @@ function GridHeaders() {
|
|
|
26
26
|
const columnMenuState = useGridSelector(apiRef, gridColumnMenuSelector);
|
|
27
27
|
const columnVisibility = useGridSelector(apiRef, gridColumnVisibilityModelSelector);
|
|
28
28
|
const columnGroupsHeaderStructure = useGridSelector(apiRef, gridColumnGroupsHeaderStructureSelector);
|
|
29
|
-
const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null &&
|
|
29
|
+
const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null && hasNoCellTabIndexState);
|
|
30
30
|
const columnsContainerRef = apiRef.current.columnHeadersContainerRef;
|
|
31
31
|
return /*#__PURE__*/_jsx(rootProps.slots.columnHeaders, _extends({
|
|
32
32
|
ref: columnsContainerRef,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "offsetTop", "offsetLeft", "
|
|
3
|
+
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "offsetTop", "offsetLeft", "columnsTotalWidth", "firstColumnIndex", "lastColumnIndex", "focusedColumnIndex", "isFirstVisible", "isLastVisible", "isNotVisible", "showBottomBorder", "scrollbarWidth", "gridHasFiller", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave", "onMouseOut", "onMouseOver"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -11,22 +11,21 @@ import { GridEditModes, GridRowModes, GridCellModes } from "../models/gridEditRo
|
|
|
11
11
|
import { gridClasses } from "../constants/gridClasses.js";
|
|
12
12
|
import { composeGridClasses } from "../utils/composeGridClasses.js";
|
|
13
13
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
14
|
+
import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from "../utils/cellBorderUtils.js";
|
|
14
15
|
import { gridColumnPositionsSelector } from "../hooks/features/columns/gridColumnsSelector.js";
|
|
15
16
|
import { useGridSelector, objectShallowCompare } from "../hooks/utils/useGridSelector.js";
|
|
16
17
|
import { useGridVisibleRows } from "../hooks/utils/useGridVisibleRows.js";
|
|
17
18
|
import { findParentElementFromClassName, isEventTargetInPortal } from "../utils/domUtils.js";
|
|
18
19
|
import { GRID_CHECKBOX_SELECTION_COL_DEF } from "../colDef/gridCheckboxSelectionColDef.js";
|
|
19
20
|
import { GRID_ACTIONS_COLUMN_TYPE } from "../colDef/gridActionsColDef.js";
|
|
20
|
-
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../internals/constants.js";
|
|
21
|
+
import { GRID_DETAIL_PANEL_TOGGLE_FIELD, PinnedColumnPosition } from "../internals/constants.js";
|
|
21
22
|
import { gridSortModelSelector } from "../hooks/features/sorting/gridSortingSelector.js";
|
|
22
23
|
import { gridRowMaximumTreeDepthSelector } from "../hooks/features/rows/gridRowsSelector.js";
|
|
23
24
|
import { gridEditRowsStateSelector } from "../hooks/features/editing/gridEditingSelectors.js";
|
|
24
|
-
import { PinnedPosition, gridPinnedColumnPositionLookup } from "./cell/GridCell.js";
|
|
25
25
|
import { GridScrollbarFillerCell as ScrollbarFiller } from "./GridScrollbarFillerCell.js";
|
|
26
26
|
import { getPinnedCellOffset } from "../internals/utils/getPinnedCellOffset.js";
|
|
27
27
|
import { useGridConfiguration } from "../hooks/utils/useGridConfiguration.js";
|
|
28
28
|
import { useGridPrivateApiContext } from "../hooks/utils/useGridPrivateApiContext.js";
|
|
29
|
-
import { gridVirtualizationColumnEnabledSelector } from "../hooks/index.js";
|
|
30
29
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
31
30
|
const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
32
31
|
const {
|
|
@@ -40,13 +39,16 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
40
39
|
visibleColumns,
|
|
41
40
|
pinnedColumns,
|
|
42
41
|
offsetLeft,
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
columnsTotalWidth,
|
|
43
|
+
firstColumnIndex,
|
|
44
|
+
lastColumnIndex,
|
|
45
45
|
focusedColumnIndex,
|
|
46
46
|
isFirstVisible,
|
|
47
47
|
isLastVisible,
|
|
48
48
|
isNotVisible,
|
|
49
49
|
showBottomBorder,
|
|
50
|
+
scrollbarWidth,
|
|
51
|
+
gridHasFiller,
|
|
50
52
|
onClick,
|
|
51
53
|
onDoubleClick,
|
|
52
54
|
onMouseEnter,
|
|
@@ -66,14 +68,11 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
66
68
|
const editRowsState = useGridSelector(apiRef, gridEditRowsStateSelector);
|
|
67
69
|
const handleRef = useForkRef(ref, refProp);
|
|
68
70
|
const rowNode = apiRef.current.getRowNode(rowId);
|
|
69
|
-
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
70
|
-
const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;
|
|
71
71
|
const editing = apiRef.current.getRowMode(rowId) === GridRowModes.Edit;
|
|
72
72
|
const editable = rootProps.editMode === GridEditModes.Row;
|
|
73
|
-
const hasColumnVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
|
|
74
73
|
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
75
|
-
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex <
|
|
76
|
-
const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >=
|
|
74
|
+
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < firstColumnIndex;
|
|
75
|
+
const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >= lastColumnIndex;
|
|
77
76
|
const classes = composeGridClasses(rootProps.classes, {
|
|
78
77
|
root: ['row', selected && 'selected', editable && 'row--editable', editing && 'row--editing', isFirstVisible && 'row--firstVisible', isLastVisible && 'row--lastVisible', showBottomBorder && 'row--borderBottom', rowHeight === 'auto' && 'row--dynamicHeight']
|
|
79
78
|
});
|
|
@@ -189,14 +188,14 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
189
188
|
});
|
|
190
189
|
rowClassNames.push(rootProps.getRowClassName(rowParams));
|
|
191
190
|
}
|
|
192
|
-
const getCell = (column, indexInSection, indexRelativeToAllColumns, sectionLength, pinnedPosition =
|
|
191
|
+
const getCell = (column, indexInSection, indexRelativeToAllColumns, sectionLength, pinnedPosition = PinnedColumnPosition.NONE) => {
|
|
193
192
|
const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, indexRelativeToAllColumns);
|
|
194
193
|
if (cellColSpanInfo?.spannedByColSpan) {
|
|
195
194
|
return null;
|
|
196
195
|
}
|
|
197
196
|
const width = cellColSpanInfo?.cellProps.width ?? column.computedWidth;
|
|
198
197
|
const colSpan = cellColSpanInfo?.cellProps.colSpan ?? 1;
|
|
199
|
-
const pinnedOffset = getPinnedCellOffset(
|
|
198
|
+
const pinnedOffset = getPinnedCellOffset(pinnedPosition, column.computedWidth, indexRelativeToAllColumns, columnPositions, columnsTotalWidth, scrollbarWidth);
|
|
200
199
|
if (rowNode?.type === 'skeletonRow') {
|
|
201
200
|
return /*#__PURE__*/_jsx(slots.skeletonCell, {
|
|
202
201
|
type: column.type,
|
|
@@ -215,7 +214,9 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
215
214
|
const canReorderColumn = !(disableColumnReorder || column.disableReorder);
|
|
216
215
|
const canReorderRow = rowReordering && !sortModel.length && treeDepth <= 1 && !isEditingRows;
|
|
217
216
|
const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
|
|
218
|
-
const cellIsNotVisible = pinnedPosition ===
|
|
217
|
+
const cellIsNotVisible = pinnedPosition === PinnedColumnPosition.VIRTUAL;
|
|
218
|
+
const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
|
|
219
|
+
const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
|
|
219
220
|
return /*#__PURE__*/_jsx(slots.cell, _extends({
|
|
220
221
|
column: column,
|
|
221
222
|
width: width,
|
|
@@ -228,9 +229,8 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
228
229
|
isNotVisible: cellIsNotVisible,
|
|
229
230
|
pinnedOffset: pinnedOffset,
|
|
230
231
|
pinnedPosition: pinnedPosition,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
gridHasFiller: gridHasFiller
|
|
232
|
+
showLeftBorder: showLeftBorder,
|
|
233
|
+
showRightBorder: showRightBorder
|
|
234
234
|
}, slotProps?.cell), column.field);
|
|
235
235
|
};
|
|
236
236
|
|
|
@@ -241,25 +241,16 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
241
241
|
}
|
|
242
242
|
const leftCells = pinnedColumns.left.map((column, i) => {
|
|
243
243
|
const indexRelativeToAllColumns = i;
|
|
244
|
-
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.left.length,
|
|
244
|
+
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.left.length, PinnedColumnPosition.LEFT);
|
|
245
245
|
});
|
|
246
246
|
const rightCells = pinnedColumns.right.map((column, i) => {
|
|
247
247
|
const indexRelativeToAllColumns = visibleColumns.length - pinnedColumns.right.length + i;
|
|
248
|
-
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.right.length,
|
|
248
|
+
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.right.length, PinnedColumnPosition.RIGHT);
|
|
249
249
|
});
|
|
250
250
|
const middleColumnsLength = visibleColumns.length - pinnedColumns.left.length - pinnedColumns.right.length;
|
|
251
251
|
const cells = [];
|
|
252
252
|
if (hasVirtualFocusCellLeft) {
|
|
253
|
-
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength,
|
|
254
|
-
}
|
|
255
|
-
let firstColumnIndex;
|
|
256
|
-
let lastColumnIndex;
|
|
257
|
-
if (!rootProps.disableVirtualization && !hasColumnVirtualization) {
|
|
258
|
-
firstColumnIndex = 0;
|
|
259
|
-
lastColumnIndex = visibleColumns.length;
|
|
260
|
-
} else {
|
|
261
|
-
firstColumnIndex = renderContext.firstColumnIndex;
|
|
262
|
-
lastColumnIndex = renderContext.lastColumnIndex;
|
|
253
|
+
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength, PinnedColumnPosition.VIRTUAL));
|
|
263
254
|
}
|
|
264
255
|
for (let i = firstColumnIndex; i < lastColumnIndex; i += 1) {
|
|
265
256
|
const column = visibleColumns[i];
|
|
@@ -270,7 +261,7 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
270
261
|
cells.push(getCell(column, indexInSection, i, middleColumnsLength));
|
|
271
262
|
}
|
|
272
263
|
if (hasVirtualFocusCellRight) {
|
|
273
|
-
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength,
|
|
264
|
+
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength, PinnedColumnPosition.VIRTUAL));
|
|
274
265
|
}
|
|
275
266
|
const eventHandlers = row ? {
|
|
276
267
|
onClick: publishClick,
|
|
@@ -307,48 +298,14 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
307
298
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
308
299
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
309
300
|
// ----------------------------------------------------------------------
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
columnsTotalWidth: PropTypes.number.isRequired,
|
|
313
|
-
contentSize: PropTypes.shape({
|
|
314
|
-
height: PropTypes.number.isRequired,
|
|
315
|
-
width: PropTypes.number.isRequired
|
|
316
|
-
}).isRequired,
|
|
317
|
-
groupHeaderHeight: PropTypes.number.isRequired,
|
|
318
|
-
hasScrollX: PropTypes.bool.isRequired,
|
|
319
|
-
hasScrollY: PropTypes.bool.isRequired,
|
|
320
|
-
headerFilterHeight: PropTypes.number.isRequired,
|
|
321
|
-
headerHeight: PropTypes.number.isRequired,
|
|
322
|
-
headersTotalHeight: PropTypes.number.isRequired,
|
|
323
|
-
isReady: PropTypes.bool.isRequired,
|
|
324
|
-
leftPinnedWidth: PropTypes.number.isRequired,
|
|
325
|
-
minimumSize: PropTypes.shape({
|
|
326
|
-
height: PropTypes.number.isRequired,
|
|
327
|
-
width: PropTypes.number.isRequired
|
|
328
|
-
}).isRequired,
|
|
329
|
-
rightPinnedWidth: PropTypes.number.isRequired,
|
|
330
|
-
root: PropTypes.shape({
|
|
331
|
-
height: PropTypes.number.isRequired,
|
|
332
|
-
width: PropTypes.number.isRequired
|
|
333
|
-
}).isRequired,
|
|
334
|
-
rowHeight: PropTypes.number.isRequired,
|
|
335
|
-
rowWidth: PropTypes.number.isRequired,
|
|
336
|
-
scrollbarSize: PropTypes.number.isRequired,
|
|
337
|
-
topContainerHeight: PropTypes.number.isRequired,
|
|
338
|
-
viewportInnerSize: PropTypes.shape({
|
|
339
|
-
height: PropTypes.number.isRequired,
|
|
340
|
-
width: PropTypes.number.isRequired
|
|
341
|
-
}).isRequired,
|
|
342
|
-
viewportOuterSize: PropTypes.shape({
|
|
343
|
-
height: PropTypes.number.isRequired,
|
|
344
|
-
width: PropTypes.number.isRequired
|
|
345
|
-
}).isRequired
|
|
346
|
-
}).isRequired,
|
|
301
|
+
columnsTotalWidth: PropTypes.number.isRequired,
|
|
302
|
+
firstColumnIndex: PropTypes.number.isRequired,
|
|
347
303
|
/**
|
|
348
304
|
* Determines which cell has focus.
|
|
349
305
|
* If `null`, no cell in this row has focus.
|
|
350
306
|
*/
|
|
351
307
|
focusedColumnIndex: PropTypes.number,
|
|
308
|
+
gridHasFiller: PropTypes.bool.isRequired,
|
|
352
309
|
/**
|
|
353
310
|
* Index of the row in the whole sorted and filtered dataset.
|
|
354
311
|
* If some rows above have expanded children, this index also take those children into account.
|
|
@@ -357,6 +314,7 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
357
314
|
isFirstVisible: PropTypes.bool.isRequired,
|
|
358
315
|
isLastVisible: PropTypes.bool.isRequired,
|
|
359
316
|
isNotVisible: PropTypes.bool.isRequired,
|
|
317
|
+
lastColumnIndex: PropTypes.number.isRequired,
|
|
360
318
|
offsetLeft: PropTypes.number.isRequired,
|
|
361
319
|
offsetTop: PropTypes.number,
|
|
362
320
|
onClick: PropTypes.func,
|
|
@@ -364,22 +322,12 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
364
322
|
onMouseEnter: PropTypes.func,
|
|
365
323
|
onMouseLeave: PropTypes.func,
|
|
366
324
|
pinnedColumns: PropTypes.object.isRequired,
|
|
367
|
-
renderContext: PropTypes.shape({
|
|
368
|
-
firstColumnIndex: PropTypes.number.isRequired,
|
|
369
|
-
firstRowIndex: PropTypes.number.isRequired,
|
|
370
|
-
lastColumnIndex: PropTypes.number.isRequired,
|
|
371
|
-
lastRowIndex: PropTypes.number.isRequired
|
|
372
|
-
}).isRequired,
|
|
373
325
|
row: PropTypes.object.isRequired,
|
|
374
326
|
rowHeight: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,
|
|
375
327
|
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
328
|
+
scrollbarWidth: PropTypes.number.isRequired,
|
|
376
329
|
selected: PropTypes.bool.isRequired,
|
|
377
330
|
showBottomBorder: PropTypes.bool.isRequired,
|
|
378
|
-
/**
|
|
379
|
-
* Determines which cell should be tabbable by having tabIndex=0.
|
|
380
|
-
* If `null`, no cell in this row is in the tab sequence.
|
|
381
|
-
*/
|
|
382
|
-
tabbableCell: PropTypes.string,
|
|
383
331
|
visibleColumns: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
384
332
|
} : void 0;
|
|
385
333
|
const MemoizedGridRow = fastMemo(GridRow);
|
|
@@ -4,15 +4,19 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { styled } from '@mui/system';
|
|
5
5
|
import useForkRef from '@mui/utils/useForkRef';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
7
8
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
8
9
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
9
10
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
10
|
-
import {
|
|
11
|
+
import { gridColumnPositionsSelector, gridColumnsTotalWidthSelector, gridDimensionsSelector, gridVisibleColumnDefinitionsSelector, gridVisiblePinnedColumnDefinitionsSelector, useGridApiEventHandler, useGridSelector } from "../hooks/index.js";
|
|
12
|
+
import { PinnedColumnPosition } from "../internals/constants.js";
|
|
11
13
|
import { getDataGridUtilityClass, gridClasses } from "../constants/gridClasses.js";
|
|
12
14
|
import { getPinnedCellOffset } from "../internals/utils/getPinnedCellOffset.js";
|
|
13
15
|
import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from "../utils/cellBorderUtils.js";
|
|
14
16
|
import { escapeOperandAttributeSelector } from "../utils/domUtils.js";
|
|
15
17
|
import { GridScrollbarFillerCell } from "./GridScrollbarFillerCell.js";
|
|
18
|
+
import { rtlFlipSide } from "../utils/rtlFlipSide.js";
|
|
19
|
+
import { attachPinnedStyle } from "../internals/utils/index.js";
|
|
16
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
21
|
const SkeletonOverlay = styled('div', {
|
|
18
22
|
name: 'MuiDataGrid',
|
|
@@ -40,6 +44,7 @@ const GridSkeletonLoadingOverlay = forwardRef(function GridSkeletonLoadingOverla
|
|
|
40
44
|
const {
|
|
41
45
|
slots
|
|
42
46
|
} = rootProps;
|
|
47
|
+
const isRtl = useRtl();
|
|
43
48
|
const classes = useUtilityClasses({
|
|
44
49
|
classes: rootProps.classes
|
|
45
50
|
});
|
|
@@ -55,18 +60,12 @@ const GridSkeletonLoadingOverlay = forwardRef(function GridSkeletonLoadingOverla
|
|
|
55
60
|
const allVisibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
|
|
56
61
|
const columns = React.useMemo(() => allVisibleColumns.slice(0, inViewportCount), [allVisibleColumns, inViewportCount]);
|
|
57
62
|
const pinnedColumns = useGridSelector(apiRef, gridVisiblePinnedColumnDefinitionsSelector);
|
|
58
|
-
const getPinnedStyle = React.useCallback((computedWidth, index, position) => {
|
|
59
|
-
const pinnedOffset = getPinnedCellOffset(position, computedWidth, index, positions, dimensions);
|
|
60
|
-
return {
|
|
61
|
-
[position]: pinnedOffset
|
|
62
|
-
};
|
|
63
|
-
}, [dimensions, positions]);
|
|
64
63
|
const getPinnedPosition = React.useCallback(field => {
|
|
65
64
|
if (pinnedColumns.left.findIndex(col => col.field === field) !== -1) {
|
|
66
|
-
return
|
|
65
|
+
return PinnedColumnPosition.LEFT;
|
|
67
66
|
}
|
|
68
67
|
if (pinnedColumns.right.findIndex(col => col.field === field) !== -1) {
|
|
69
|
-
return
|
|
68
|
+
return PinnedColumnPosition.RIGHT;
|
|
70
69
|
}
|
|
71
70
|
return undefined;
|
|
72
71
|
}, [pinnedColumns.left, pinnedColumns.right]);
|
|
@@ -77,13 +76,15 @@ const GridSkeletonLoadingOverlay = forwardRef(function GridSkeletonLoadingOverla
|
|
|
77
76
|
for (let colIndex = 0; colIndex < columns.length; colIndex += 1) {
|
|
78
77
|
const column = columns[colIndex];
|
|
79
78
|
const pinnedPosition = getPinnedPosition(column.field);
|
|
80
|
-
const isPinnedLeft = pinnedPosition ===
|
|
81
|
-
const isPinnedRight = pinnedPosition ===
|
|
82
|
-
const
|
|
79
|
+
const isPinnedLeft = pinnedPosition === PinnedColumnPosition.LEFT;
|
|
80
|
+
const isPinnedRight = pinnedPosition === PinnedColumnPosition.RIGHT;
|
|
81
|
+
const pinnedSide = rtlFlipSide(pinnedPosition, isRtl);
|
|
82
|
+
const sectionLength = pinnedSide ? pinnedColumns[pinnedSide].length // pinned section
|
|
83
83
|
: columns.length - pinnedColumns.left.length - pinnedColumns.right.length; // middle section
|
|
84
|
-
const sectionIndex =
|
|
84
|
+
const sectionIndex = pinnedSide ? pinnedColumns[pinnedSide].findIndex(col => col.field === column.field) // pinned section
|
|
85
85
|
: colIndex - pinnedColumns.left.length; // middle section
|
|
86
|
-
const
|
|
86
|
+
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
87
|
+
const pinnedStyle = attachPinnedStyle({}, isRtl, pinnedPosition, getPinnedCellOffset(pinnedPosition, column.computedWidth, colIndex, positions, dimensions.columnsTotalWidth, scrollbarWidth));
|
|
87
88
|
const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;
|
|
88
89
|
const showRightBorder = shouldCellShowRightBorder(pinnedPosition, sectionIndex, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
|
|
89
90
|
const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, sectionIndex);
|
|
@@ -97,7 +98,6 @@ const GridSkeletonLoadingOverlay = forwardRef(function GridSkeletonLoadingOverla
|
|
|
97
98
|
width: emptyCellWidth,
|
|
98
99
|
empty: true
|
|
99
100
|
}, `skeleton-filler-column-${i}`);
|
|
100
|
-
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
101
101
|
const hasScrollbarFiller = isLastColumn && scrollbarWidth !== 0;
|
|
102
102
|
if (hasFillerBefore) {
|
|
103
103
|
rowCells.push(emptyCell);
|
|
@@ -129,7 +129,7 @@ const GridSkeletonLoadingOverlay = forwardRef(function GridSkeletonLoadingOverla
|
|
|
129
129
|
}, `skeleton-row-${i}`));
|
|
130
130
|
}
|
|
131
131
|
return array;
|
|
132
|
-
}, [slots, columns, pinnedColumns, skeletonRowsCount, rootProps.showCellVerticalBorder, dimensions
|
|
132
|
+
}, [slots, columns, pinnedColumns, skeletonRowsCount, rootProps.showCellVerticalBorder, dimensions, positions, getPinnedPosition, isRtl]);
|
|
133
133
|
|
|
134
134
|
// Sync the column resize of the overlay columns with the grid
|
|
135
135
|
const handleColumnResize = params => {
|
|
@@ -143,8 +143,8 @@ const GridSkeletonLoadingOverlay = forwardRef(function GridSkeletonLoadingOverla
|
|
|
143
143
|
}
|
|
144
144
|
const resizedColIndex = columns.findIndex(col => col.field === colDef.field);
|
|
145
145
|
const pinnedPosition = getPinnedPosition(colDef.field);
|
|
146
|
-
const isPinnedLeft = pinnedPosition ===
|
|
147
|
-
const isPinnedRight = pinnedPosition ===
|
|
146
|
+
const isPinnedLeft = pinnedPosition === PinnedColumnPosition.LEFT;
|
|
147
|
+
const isPinnedRight = pinnedPosition === PinnedColumnPosition.RIGHT;
|
|
148
148
|
const currentWidth = getComputedStyle(cells[0]).getPropertyValue('--width');
|
|
149
149
|
const delta = parseInt(currentWidth, 10) - width;
|
|
150
150
|
if (cells) {
|
|
@@ -6,6 +6,8 @@ import * as React from 'react';
|
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
8
8
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
|
+
|
|
10
|
+
// FIXME(v8:romgrk): Make parametric
|
|
9
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
12
|
const GridActionsCellItem = forwardRef((props, ref) => {
|
|
11
13
|
const rootProps = useGridRootProps();
|