@mui/x-data-grid 5.7.0 → 5.10.0
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 +241 -53
- package/DataGrid/DataGrid.d.ts +8 -3
- package/DataGrid/DataGrid.js +28 -5
- package/DataGrid/useDataGridComponent.js +5 -5
- package/DataGrid/useDataGridProps.d.ts +2 -1
- package/LICENSE +21 -0
- package/README.md +6 -4
- package/colDef/gridBooleanColDef.d.ts +1 -1
- package/colDef/gridBooleanOperators.d.ts +1 -1
- package/colDef/gridDateColDef.d.ts +5 -9
- package/colDef/gridDateColDef.js +2 -2
- package/colDef/gridDateOperators.d.ts +1 -1
- package/{models/colDef → colDef}/gridDefaultColumnTypes.d.ts +1 -1
- package/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
- package/colDef/gridNumericColDef.d.ts +1 -1
- package/colDef/gridNumericOperators.d.ts +2 -2
- package/colDef/gridStringColDef.d.ts +1 -1
- package/colDef/gridStringOperators.d.ts +1 -1
- package/colDef/index.d.ts +1 -0
- package/colDef/index.js +2 -1
- package/components/GridRow.d.ts +4 -0
- package/components/GridRow.js +55 -24
- package/components/base/GridOverlays.js +4 -3
- package/components/cell/GridActionsCell.d.ts +5 -1
- package/components/cell/GridActionsCell.js +170 -21
- package/components/cell/GridActionsCellItem.d.ts +66 -4
- package/components/cell/GridActionsCellItem.js +7 -5
- package/components/cell/GridCell.d.ts +5 -4
- package/components/cell/GridCell.js +30 -9
- package/components/cell/GridEditInputCell.js +3 -3
- package/components/cell/GridEditSingleSelectCell.js +24 -15
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +12 -0
- package/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +22 -4
- package/components/columnHeaders/GridColumnHeaderItem.js +9 -12
- package/components/columnHeaders/GridColumnHeaders.d.ts +0 -1
- package/components/columnHeaders/GridColumnHeaders.js +1 -1
- package/components/columnHeaders/index.d.ts +1 -0
- package/components/columnHeaders/index.js +1 -0
- package/components/columnSelection/GridCellCheckboxRenderer.d.ts +3 -3
- package/components/columnSelection/GridCellCheckboxRenderer.js +22 -5
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/containers/GridRoot.js +29 -17
- package/components/containers/GridRootStyles.js +36 -1
- package/components/menu/GridMenu.js +1 -0
- package/components/menu/columnMenu/GridColumnMenu.js +1 -1
- package/components/panel/GridPanel.d.ts +2 -2
- package/components/panel/GridPanel.js +1 -0
- package/components/panel/GridPreferencesPanel.js +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +14 -10
- package/components/panel/filterPanel/GridFilterInputBoolean.js +13 -8
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +22 -15
- package/components/panel/filterPanel/GridFilterInputValue.js +22 -15
- package/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/components/virtualization/GridVirtualScroller.js +2 -0
- package/components/virtualization/GridVirtualScrollerContent.js +1 -3
- package/constants/defaultGridSlotsComponents.js +4 -2
- package/constants/gridClasses.d.ts +35 -3
- package/constants/gridClasses.js +1 -1
- package/constants/gridDetailPanelToggleField.d.ts +1 -0
- package/constants/gridDetailPanelToggleField.js +2 -0
- package/constants/localeTextConstants.js +3 -1
- package/hooks/core/index.d.ts +1 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +85 -0
- package/hooks/core/{preProcessing/gridPreProcessingApi.js → pipeProcessing/gridPipeProcessingApi.js} +0 -0
- package/hooks/core/pipeProcessing/index.d.ts +4 -0
- package/hooks/core/pipeProcessing/index.js +4 -0
- package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +32 -0
- package/hooks/core/pipeProcessing/useGridPipeProcessing.js +108 -0
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +3 -0
- package/{modern/hooks/core/preProcessing/useGridRegisterPreProcessor.js → hooks/core/pipeProcessing/useGridRegisterPipeApplier.js} +2 -6
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +4 -0
- package/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeProcessor.js} +2 -6
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +27 -16
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +26 -15
- package/hooks/core/useGridInitialization.js +2 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +0 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +77 -11
- package/hooks/features/columnMenu/useGridColumnMenu.js +2 -1
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +3 -1
- package/hooks/features/columns/gridColumnsSelector.d.ts +6 -6
- package/hooks/features/columns/gridColumnsUtils.d.ts +22 -4
- package/hooks/features/columns/gridColumnsUtils.js +105 -20
- package/hooks/features/columns/useGridColumnSpanning.d.ts +7 -0
- package/hooks/features/columns/useGridColumnSpanning.js +109 -0
- package/hooks/features/columns/useGridColumns.d.ts +1 -1
- package/hooks/features/columns/useGridColumns.js +55 -40
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +5 -0
- package/hooks/features/dimensions/useGridDimensions.js +5 -4
- package/hooks/features/editRows/useGridCellEditing.new.d.ts +1 -1
- package/hooks/features/editRows/useGridCellEditing.new.js +40 -17
- package/hooks/features/editRows/useGridEditing.new.js +7 -3
- package/hooks/features/editRows/useGridRowEditing.new.d.ts +1 -1
- package/hooks/features/editRows/useGridRowEditing.new.js +44 -21
- package/hooks/features/events/useGridEvents.d.ts +1 -1
- package/hooks/features/events/useGridEvents.js +2 -0
- package/hooks/features/filter/gridFilterSelector.d.ts +3 -9
- package/hooks/features/filter/useGridFilter.js +18 -13
- package/hooks/features/focus/useGridFocus.js +19 -9
- package/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.d.ts +3 -5
- package/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +66 -13
- package/hooks/features/pagination/gridPaginationSelector.d.ts +1 -3
- package/hooks/features/pagination/useGridPage.js +9 -4
- package/hooks/features/pagination/useGridPageSize.js +3 -3
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +18 -5
- package/hooks/features/rows/gridRowsSelector.d.ts +2 -1
- package/hooks/features/rows/gridRowsSelector.js +1 -0
- package/hooks/features/rows/gridRowsState.d.ts +4 -0
- package/hooks/features/rows/gridRowsUtils.d.ts +8 -0
- package/hooks/features/rows/gridRowsUtils.js +11 -0
- package/hooks/features/rows/index.d.ts +1 -0
- package/hooks/features/rows/index.js +1 -1
- package/hooks/features/rows/useGridRows.d.ts +2 -2
- package/hooks/features/rows/useGridRows.js +27 -7
- package/hooks/features/rows/useGridRowsMeta.js +7 -14
- package/hooks/features/scroll/useGridScroll.d.ts +2 -0
- package/hooks/features/scroll/useGridScroll.js +27 -14
- package/hooks/features/selection/gridSelectionSelector.d.ts +1 -3
- package/hooks/features/selection/useGridSelection.d.ts +4 -2
- package/hooks/features/selection/useGridSelection.js +75 -27
- package/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
- package/hooks/features/sorting/gridSortingSelector.d.ts +1 -3
- package/hooks/features/sorting/gridSortingUtils.d.ts +1 -2
- package/hooks/features/sorting/useGridSorting.js +13 -13
- package/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +9 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +64 -27
- package/hooks/utils/useGridRootProps.d.ts +1 -1
- package/hooks/utils/useGridVisibleRows.d.ts +2 -2
- package/index.js +1 -1
- package/internals/index.d.ts +4 -6
- package/internals/index.js +3 -3
- package/legacy/DataGrid/DataGrid.js +28 -5
- package/legacy/DataGrid/useDataGridComponent.js +5 -5
- package/legacy/colDef/gridDateColDef.js +2 -2
- package/legacy/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
- package/legacy/colDef/index.js +2 -1
- package/legacy/components/GridRow.js +53 -24
- package/legacy/components/base/GridOverlays.js +4 -3
- package/legacy/components/cell/GridActionsCell.js +188 -27
- package/legacy/components/cell/GridActionsCellItem.js +7 -5
- package/legacy/components/cell/GridCell.js +31 -9
- package/legacy/components/cell/GridEditInputCell.js +3 -3
- package/legacy/components/cell/GridEditSingleSelectCell.js +35 -26
- package/legacy/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +22 -4
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +9 -12
- package/legacy/components/columnHeaders/GridColumnHeaders.js +2 -3
- package/legacy/components/columnHeaders/index.js +1 -0
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +23 -5
- package/legacy/components/containers/GridRoot.js +34 -17
- package/legacy/components/containers/GridRootStyles.js +26 -5
- package/legacy/components/menu/GridMenu.js +1 -0
- package/legacy/components/menu/columnMenu/GridColumnMenu.js +1 -1
- package/legacy/components/panel/GridPanel.js +1 -0
- package/legacy/components/panel/GridPreferencesPanel.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterForm.js +14 -10
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +13 -8
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +22 -17
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +22 -17
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/legacy/components/virtualization/GridVirtualScroller.js +2 -0
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +1 -3
- package/legacy/constants/defaultGridSlotsComponents.js +4 -2
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/constants/gridDetailPanelToggleField.js +2 -0
- package/legacy/constants/localeTextConstants.js +3 -1
- package/legacy/hooks/core/{preProcessing/gridPreProcessingApi.js → pipeProcessing/gridPipeProcessingApi.js} +0 -0
- package/legacy/hooks/core/pipeProcessing/index.js +4 -0
- package/legacy/hooks/core/pipeProcessing/useGridPipeProcessing.js +119 -0
- package/legacy/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeApplier.js} +2 -6
- package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +27 -0
- package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +26 -15
- package/legacy/hooks/core/useGridInitialization.js +2 -2
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +90 -11
- package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +2 -1
- package/legacy/hooks/features/columns/gridColumnsUtils.js +120 -32
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +107 -0
- package/legacy/hooks/features/columns/useGridColumns.js +55 -40
- package/legacy/hooks/features/dimensions/useGridDimensions.js +5 -4
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +36 -15
- package/legacy/hooks/features/editRows/useGridEditing.new.js +7 -3
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +53 -30
- package/legacy/hooks/features/events/useGridEvents.js +2 -0
- package/legacy/hooks/features/filter/useGridFilter.js +18 -13
- package/legacy/hooks/features/focus/useGridFocus.js +19 -9
- package/legacy/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +66 -12
- package/legacy/hooks/features/pagination/useGridPage.js +11 -4
- package/legacy/hooks/features/pagination/useGridPageSize.js +3 -3
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +18 -5
- package/legacy/hooks/features/rows/gridRowsSelector.js +3 -0
- package/legacy/hooks/features/rows/gridRowsUtils.js +13 -0
- package/legacy/hooks/features/rows/index.js +1 -1
- package/legacy/hooks/features/rows/useGridRows.js +35 -9
- package/legacy/hooks/features/rows/useGridRowsMeta.js +7 -14
- package/legacy/hooks/features/scroll/useGridScroll.js +27 -14
- package/legacy/hooks/features/selection/useGridSelection.js +77 -27
- package/legacy/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
- package/legacy/hooks/features/sorting/useGridSorting.js +8 -10
- package/legacy/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +75 -37
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +3 -3
- package/legacy/locales/arSD.js +3 -1
- package/legacy/locales/bgBG.js +3 -1
- package/legacy/locales/csCZ.js +2 -0
- package/legacy/locales/daDK.js +37 -31
- package/legacy/locales/deDE.js +3 -1
- package/legacy/locales/elGR.js +2 -0
- package/legacy/locales/esES.js +2 -0
- package/legacy/locales/faIR.js +3 -1
- package/legacy/locales/fiFI.js +2 -0
- package/legacy/locales/frFR.js +2 -0
- package/legacy/locales/heIL.js +3 -1
- package/legacy/locales/huHU.js +122 -0
- package/legacy/locales/index.js +1 -0
- package/legacy/locales/itIT.js +2 -0
- package/legacy/locales/jaJP.js +2 -0
- package/legacy/locales/koKR.js +2 -0
- package/legacy/locales/nlNL.js +2 -0
- package/legacy/locales/plPL.js +3 -1
- package/legacy/locales/ptBR.js +3 -1
- package/legacy/locales/ruRU.js +2 -0
- package/legacy/locales/skSK.js +2 -0
- package/legacy/locales/trTR.js +3 -1
- package/legacy/locales/ukUA.js +2 -0
- package/legacy/locales/viVN.js +2 -0
- package/legacy/locales/zhCN.js +2 -0
- package/{modern/hooks/core/preProcessing/gridPreProcessingApi.js → legacy/models/api/gridColumnSpanning.js} +0 -0
- package/legacy/models/colDef/index.js +1 -2
- package/legacy/models/events/gridEvents.js +10 -3
- package/legacy/models/gridColumnSpanning.js +1 -0
- package/legacy/models/gridRows.js +1 -33
- package/legacy/models/index.js +2 -2
- package/legacy/models/params/gridPreferencePanelParams.js +1 -0
- package/legacy/models/params/index.js +2 -1
- package/locales/arSD.js +3 -1
- package/locales/bgBG.js +3 -1
- package/locales/csCZ.js +2 -0
- package/locales/daDK.js +33 -31
- package/locales/deDE.js +3 -1
- package/locales/elGR.js +2 -0
- package/locales/esES.js +2 -0
- package/locales/faIR.js +3 -1
- package/locales/fiFI.js +2 -0
- package/locales/frFR.js +2 -0
- package/locales/heIL.js +3 -1
- package/locales/huHU.d.ts +2 -0
- package/locales/huHU.js +110 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/itIT.js +2 -0
- package/locales/jaJP.js +2 -0
- package/locales/koKR.js +2 -0
- package/locales/nlNL.js +2 -0
- package/locales/plPL.js +3 -1
- package/locales/ptBR.js +3 -1
- package/locales/ruRU.js +2 -0
- package/locales/skSK.js +2 -0
- package/locales/trTR.js +3 -1
- package/locales/ukUA.js +2 -0
- package/locales/viVN.js +2 -0
- package/locales/zhCN.js +2 -0
- package/models/api/gridApiCommon.d.ts +3 -2
- package/models/api/gridColumnSpanning.d.ts +28 -0
- package/models/api/gridColumnSpanning.js +1 -0
- package/models/api/gridEditingApi.d.ts +51 -5
- package/models/api/gridLocaleTextApi.d.ts +1 -0
- package/models/api/gridParamsApi.d.ts +5 -5
- package/models/api/gridRowApi.d.ts +8 -2
- package/models/colDef/gridColDef.d.ts +38 -28
- package/models/colDef/index.d.ts +0 -1
- package/models/colDef/index.js +1 -2
- package/models/events/gridEventLookup.d.ts +30 -9
- package/models/events/gridEvents.d.ts +50 -17
- package/models/events/gridEvents.js +10 -3
- package/models/gridCell.d.ts +1 -0
- package/models/gridColumnSpanning.d.ts +12 -0
- package/models/gridColumnSpanning.js +1 -0
- package/models/gridEditRowModel.d.ts +1 -1
- package/models/gridFilterOperator.d.ts +3 -2
- package/models/gridIconSlotsComponent.d.ts +5 -0
- package/models/gridRows.d.ts +10 -18
- package/models/gridRows.js +1 -31
- package/models/gridSlotsComponent.d.ts +5 -0
- package/models/gridSlotsComponentsProps.d.ts +1 -0
- package/models/gridSortModel.d.ts +3 -4
- package/models/index.d.ts +1 -1
- package/models/index.js +2 -2
- package/models/params/gridCellParams.d.ts +25 -15
- package/models/params/gridColumnHeaderParams.d.ts +3 -2
- package/models/params/gridEditCellParams.d.ts +2 -3
- package/models/params/gridPreferencePanelParams.d.ts +3 -0
- package/models/params/gridPreferencePanelParams.js +1 -0
- package/models/params/gridRowParams.d.ts +12 -8
- package/models/params/gridValueOptionsParams.d.ts +3 -3
- package/models/params/index.d.ts +1 -0
- package/models/params/index.js +2 -1
- package/models/props/DataGridProps.d.ts +37 -17
- package/modern/DataGrid/DataGrid.js +28 -5
- package/modern/DataGrid/useDataGridComponent.js +5 -5
- package/modern/colDef/gridDateColDef.js +2 -2
- package/modern/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
- package/modern/colDef/index.js +2 -1
- package/modern/components/GridRow.js +53 -22
- package/modern/components/base/GridOverlays.js +4 -3
- package/modern/components/cell/GridActionsCell.js +168 -21
- package/modern/components/cell/GridActionsCellItem.js +7 -5
- package/modern/components/cell/GridCell.js +30 -9
- package/modern/components/cell/GridEditInputCell.js +3 -3
- package/modern/components/cell/GridEditSingleSelectCell.js +22 -13
- package/modern/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +22 -4
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +7 -10
- package/modern/components/columnHeaders/GridColumnHeaders.js +1 -1
- package/modern/components/columnHeaders/index.js +1 -0
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +22 -5
- package/modern/components/containers/GridRoot.js +29 -17
- package/modern/components/containers/GridRootStyles.js +36 -1
- package/modern/components/menu/GridMenu.js +1 -0
- package/modern/components/menu/columnMenu/GridColumnMenu.js +1 -1
- package/modern/components/panel/GridPanel.js +1 -0
- package/modern/components/panel/GridPreferencesPanel.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterForm.js +10 -6
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +11 -6
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +20 -13
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +20 -13
- package/modern/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/modern/components/virtualization/GridVirtualScroller.js +2 -0
- package/modern/components/virtualization/GridVirtualScrollerContent.js +1 -3
- package/modern/constants/defaultGridSlotsComponents.js +4 -2
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/gridDetailPanelToggleField.js +2 -0
- package/modern/constants/localeTextConstants.js +3 -1
- package/modern/hooks/core/pipeProcessing/gridPipeProcessingApi.js +1 -0
- package/modern/hooks/core/pipeProcessing/index.js +4 -0
- package/modern/hooks/core/pipeProcessing/useGridPipeProcessing.js +108 -0
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +27 -0
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +27 -0
- package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +26 -15
- package/modern/hooks/core/useGridInitialization.js +2 -2
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +77 -11
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +2 -1
- package/modern/hooks/features/columns/gridColumnsUtils.js +105 -20
- package/modern/hooks/features/columns/useGridColumnSpanning.js +107 -0
- package/modern/hooks/features/columns/useGridColumns.js +55 -40
- package/modern/hooks/features/dimensions/useGridDimensions.js +5 -4
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +40 -17
- package/modern/hooks/features/editRows/useGridEditing.new.js +7 -3
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +44 -21
- package/modern/hooks/features/events/useGridEvents.js +2 -0
- package/modern/hooks/features/filter/useGridFilter.js +18 -13
- package/modern/hooks/features/focus/useGridFocus.js +19 -9
- package/modern/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +64 -13
- package/modern/hooks/features/pagination/useGridPage.js +9 -4
- package/modern/hooks/features/pagination/useGridPageSize.js +3 -3
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +18 -5
- package/modern/hooks/features/rows/gridRowsSelector.js +1 -0
- package/modern/hooks/features/rows/gridRowsUtils.js +11 -0
- package/modern/hooks/features/rows/index.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +25 -5
- package/modern/hooks/features/rows/useGridRowsMeta.js +7 -14
- package/modern/hooks/features/scroll/useGridScroll.js +25 -10
- package/modern/hooks/features/selection/useGridSelection.js +75 -27
- package/modern/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
- package/modern/hooks/features/sorting/useGridSorting.js +13 -13
- package/modern/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +64 -23
- package/modern/index.js +1 -1
- package/modern/internals/index.js +3 -3
- package/modern/locales/arSD.js +3 -1
- package/modern/locales/bgBG.js +3 -1
- package/modern/locales/csCZ.js +2 -0
- package/modern/locales/daDK.js +33 -31
- package/modern/locales/deDE.js +3 -1
- package/modern/locales/elGR.js +2 -0
- package/modern/locales/esES.js +2 -0
- package/modern/locales/faIR.js +3 -1
- package/modern/locales/fiFI.js +2 -0
- package/modern/locales/frFR.js +2 -0
- package/modern/locales/heIL.js +3 -1
- package/modern/locales/huHU.js +110 -0
- package/modern/locales/index.js +1 -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/nlNL.js +2 -0
- package/modern/locales/plPL.js +3 -1
- package/modern/locales/ptBR.js +3 -1
- package/modern/locales/ruRU.js +2 -0
- package/modern/locales/skSK.js +2 -0
- package/modern/locales/trTR.js +3 -1
- package/modern/locales/ukUA.js +2 -0
- package/modern/locales/viVN.js +2 -0
- package/modern/locales/zhCN.js +2 -0
- package/modern/models/api/gridColumnSpanning.js +1 -0
- package/modern/models/colDef/index.js +1 -2
- package/modern/models/events/gridEvents.js +10 -3
- package/modern/models/gridColumnSpanning.js +1 -0
- package/modern/models/gridRows.js +1 -31
- package/modern/models/index.js +2 -2
- package/modern/models/params/gridPreferencePanelParams.js +1 -0
- package/modern/models/params/index.js +2 -1
- package/node/DataGrid/DataGrid.js +28 -5
- package/node/DataGrid/useDataGridComponent.js +6 -6
- package/node/colDef/gridDateColDef.js +2 -2
- package/node/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
- package/node/colDef/index.js +13 -0
- package/node/components/GridRow.js +56 -24
- package/node/components/base/GridOverlays.js +3 -2
- package/node/components/cell/GridActionsCell.js +172 -21
- package/node/components/cell/GridActionsCellItem.js +7 -4
- package/node/components/cell/GridCell.js +30 -9
- package/node/components/cell/GridEditInputCell.js +3 -3
- package/node/components/cell/GridEditSingleSelectCell.js +25 -15
- package/node/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +23 -5
- package/node/components/columnHeaders/GridColumnHeaderItem.js +9 -13
- package/node/components/columnHeaders/GridColumnHeaders.js +1 -1
- package/node/components/columnHeaders/index.js +13 -0
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +22 -5
- package/node/components/containers/GridRoot.js +28 -17
- package/node/components/containers/GridRootStyles.js +36 -1
- package/node/components/menu/GridMenu.js +1 -0
- package/node/components/menu/columnMenu/GridColumnMenu.js +1 -1
- package/node/components/panel/GridPanel.js +1 -0
- package/node/components/panel/GridPreferencesPanel.js +1 -1
- package/node/components/panel/filterPanel/GridFilterForm.js +15 -10
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +14 -8
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +23 -15
- package/node/components/panel/filterPanel/GridFilterInputValue.js +23 -15
- package/node/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/node/components/virtualization/GridVirtualScroller.js +2 -0
- package/node/components/virtualization/GridVirtualScrollerContent.js +1 -3
- package/node/constants/defaultGridSlotsComponents.js +3 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/gridDetailPanelToggleField.js +9 -0
- package/node/constants/localeTextConstants.js +3 -1
- package/node/hooks/core/{preProcessing/gridPreProcessingApi.js → pipeProcessing/gridPipeProcessingApi.js} +0 -0
- package/node/hooks/core/pipeProcessing/index.js +57 -0
- package/node/hooks/core/pipeProcessing/useGridPipeProcessing.js +124 -0
- package/node/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeApplier.js} +4 -7
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +42 -0
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +26 -15
- package/node/hooks/core/useGridInitialization.js +2 -2
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +81 -11
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +2 -1
- package/node/hooks/features/columns/gridColumnsUtils.js +114 -25
- package/node/hooks/features/columns/useGridColumnSpanning.js +130 -0
- package/node/hooks/features/columns/useGridColumns.js +55 -40
- package/node/hooks/features/dimensions/useGridDimensions.js +5 -4
- package/node/hooks/features/editRows/useGridCellEditing.new.js +42 -17
- package/node/hooks/features/editRows/useGridEditing.new.js +6 -2
- package/node/hooks/features/editRows/useGridRowEditing.new.js +45 -21
- package/node/hooks/features/events/useGridEvents.js +2 -0
- package/node/hooks/features/filter/useGridFilter.js +18 -13
- package/node/hooks/features/focus/useGridFocus.js +19 -9
- package/node/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +69 -13
- package/node/hooks/features/pagination/useGridPage.js +8 -3
- package/node/hooks/features/pagination/useGridPageSize.js +3 -3
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +20 -5
- package/node/hooks/features/rows/gridRowsSelector.js +3 -1
- package/node/hooks/features/rows/gridRowsUtils.js +18 -0
- package/node/hooks/features/rows/index.js +15 -1
- package/node/hooks/features/rows/useGridRows.js +29 -9
- package/node/hooks/features/rows/useGridRowsMeta.js +7 -15
- package/node/hooks/features/scroll/useGridScroll.js +28 -14
- package/node/hooks/features/selection/useGridSelection.js +75 -26
- package/node/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
- package/node/hooks/features/sorting/useGridSorting.js +13 -13
- package/node/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +69 -27
- package/node/index.js +1 -1
- package/node/internals/index.js +12 -12
- package/node/locales/arSD.js +3 -1
- package/node/locales/bgBG.js +3 -1
- package/node/locales/csCZ.js +2 -0
- package/node/locales/daDK.js +33 -31
- package/node/locales/deDE.js +3 -1
- package/node/locales/elGR.js +2 -0
- package/node/locales/esES.js +2 -0
- package/node/locales/faIR.js +3 -1
- package/node/locales/fiFI.js +2 -0
- package/node/locales/frFR.js +2 -0
- package/node/locales/heIL.js +3 -1
- package/node/locales/huHU.js +120 -0
- package/node/locales/index.js +13 -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/nlNL.js +2 -0
- package/node/locales/plPL.js +3 -1
- package/node/locales/ptBR.js +3 -1
- package/node/locales/ruRU.js +2 -0
- package/node/locales/skSK.js +2 -0
- package/node/locales/trTR.js +3 -1
- package/node/locales/ukUA.js +2 -0
- package/node/locales/viVN.js +2 -0
- package/node/locales/zhCN.js +2 -0
- package/node/models/api/gridColumnSpanning.js +5 -0
- package/node/models/colDef/index.js +0 -13
- package/node/models/events/gridEvents.js +10 -3
- package/node/models/gridColumnSpanning.js +5 -0
- package/node/models/gridRows.js +1 -34
- package/node/models/index.js +13 -13
- package/node/models/params/gridPreferencePanelParams.js +5 -0
- package/node/models/params/index.js +13 -0
- package/package.json +4 -4
- package/utils/domUtils.d.ts +2 -2
- package/components/columnHeaders/ColumnHeaderFilterIcon.d.ts +0 -5
- package/hooks/core/preProcessing/gridPreProcessingApi.d.ts +0 -67
- package/hooks/core/preProcessing/index.d.ts +0 -3
- package/hooks/core/preProcessing/index.js +0 -3
- package/hooks/core/preProcessing/useGridPreProcessing.d.ts +0 -6
- package/hooks/core/preProcessing/useGridPreProcessing.js +0 -53
- package/hooks/core/preProcessing/useGridRegisterPreProcessor.d.ts +0 -7
- package/hooks/features/keyboard/useGridKeyboard.d.ts +0 -10
- package/hooks/features/keyboard/useGridKeyboard.js +0 -70
- package/legacy/hooks/core/preProcessing/index.js +0 -3
- package/legacy/hooks/core/preProcessing/useGridPreProcessing.js +0 -62
- package/legacy/hooks/features/keyboard/useGridKeyboard.js +0 -70
- package/modern/hooks/core/preProcessing/index.js +0 -3
- package/modern/hooks/core/preProcessing/useGridPreProcessing.js +0 -53
- package/modern/hooks/features/keyboard/useGridKeyboard.js +0 -70
- package/node/hooks/core/preProcessing/index.js +0 -44
- package/node/hooks/core/preProcessing/useGridPreProcessing.js +0 -72
- package/node/hooks/features/keyboard/useGridKeyboard.js +0 -91
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { GridCellValue } from './gridCell';
|
|
2
1
|
import { GridRowId, GridRowTreeNodeConfig } from './gridRows';
|
|
3
2
|
export declare type GridSortDirection = 'asc' | 'desc' | null | undefined;
|
|
4
|
-
export interface GridSortCellParams {
|
|
3
|
+
export interface GridSortCellParams<V = any> {
|
|
5
4
|
id: GridRowId;
|
|
6
5
|
field: string;
|
|
7
|
-
value:
|
|
6
|
+
value: V;
|
|
8
7
|
rowNode: GridRowTreeNodeConfig;
|
|
9
8
|
/**
|
|
10
9
|
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
@@ -14,7 +13,7 @@ export interface GridSortCellParams {
|
|
|
14
13
|
/**
|
|
15
14
|
* The type of the sort comparison function.
|
|
16
15
|
*/
|
|
17
|
-
export declare type GridComparatorFn = (v1:
|
|
16
|
+
export declare type GridComparatorFn<V = any> = (v1: V, v2: V, cellParams1: GridSortCellParams<V>, cellParams2: GridSortCellParams<V>) => number;
|
|
18
17
|
/**
|
|
19
18
|
* Object that represents the column sorted data, part of the [[GridSortModel]].
|
|
20
19
|
*/
|
package/models/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export * from './gridEditRowModel';
|
|
|
5
5
|
export * from './gridFeatureMode';
|
|
6
6
|
export * from './gridFilterItem';
|
|
7
7
|
export * from './gridFilterModel';
|
|
8
|
-
export * from './gridFilterOperator';
|
|
9
8
|
export * from './gridRootContainerRef';
|
|
10
9
|
export * from './gridRenderContextProps';
|
|
11
10
|
export * from './gridRows';
|
|
@@ -24,3 +23,4 @@ export * from './logger';
|
|
|
24
23
|
export * from './muiEvent';
|
|
25
24
|
export * from './events';
|
|
26
25
|
export * from './gridSortModel';
|
|
26
|
+
export * from './gridFilterOperator';
|
package/models/index.js
CHANGED
|
@@ -5,7 +5,6 @@ export * from './gridEditRowModel';
|
|
|
5
5
|
export * from './gridFeatureMode';
|
|
6
6
|
export * from './gridFilterItem';
|
|
7
7
|
export * from './gridFilterModel';
|
|
8
|
-
export * from './gridFilterOperator';
|
|
9
8
|
export * from './gridRootContainerRef';
|
|
10
9
|
export * from './gridRenderContextProps';
|
|
11
10
|
export * from './gridRows';
|
|
@@ -23,4 +22,5 @@ export * from './gridExport';
|
|
|
23
22
|
export * from './logger';
|
|
24
23
|
export * from './muiEvent';
|
|
25
24
|
export * from './events';
|
|
26
|
-
export * from './gridSortModel';
|
|
25
|
+
export * from './gridSortModel';
|
|
26
|
+
export * from './gridFilterOperator';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GridCellMode } from '../gridCell';
|
|
3
|
+
import { GridRowId, GridRowModel, GridRowTreeNodeConfig, GridValidRowModel } from '../gridRows';
|
|
3
4
|
import type { GridStateColDef } from '../colDef/gridColDef';
|
|
4
5
|
import { GridEditCellProps } from '../gridEditRowModel';
|
|
5
6
|
/**
|
|
6
7
|
* Object passed as parameter in the column [[GridColDef]] cell renderer.
|
|
7
8
|
*/
|
|
8
|
-
export interface GridCellParams<V = any, R = any, F = V> {
|
|
9
|
+
export interface GridCellParams<V = any, R extends GridValidRowModel = any, F = V> {
|
|
9
10
|
/**
|
|
10
11
|
* The grid row id.
|
|
11
12
|
*/
|
|
@@ -17,11 +18,11 @@ export interface GridCellParams<V = any, R = any, F = V> {
|
|
|
17
18
|
/**
|
|
18
19
|
* The cell value, but if the column has valueGetter, use getValue.
|
|
19
20
|
*/
|
|
20
|
-
value
|
|
21
|
+
value?: V | undefined;
|
|
21
22
|
/**
|
|
22
23
|
* The cell value formatted with the column valueFormatter.
|
|
23
24
|
*/
|
|
24
|
-
formattedValue
|
|
25
|
+
formattedValue?: F | undefined;
|
|
25
26
|
/**
|
|
26
27
|
* The row model of the row that the current cell belongs to.
|
|
27
28
|
*/
|
|
@@ -54,25 +55,34 @@ export interface GridCellParams<V = any, R = any, F = V> {
|
|
|
54
55
|
* Get the cell value of a row and field.
|
|
55
56
|
* @param {GridRowId} id The row id.
|
|
56
57
|
* @param {string} field The field.
|
|
57
|
-
* @returns {
|
|
58
|
+
* @returns {any} The cell value.
|
|
58
59
|
* @deprecated Use `params.row` to directly access the fields you want instead.
|
|
59
60
|
*/
|
|
60
|
-
getValue: (id: GridRowId, field: string) =>
|
|
61
|
+
getValue: (id: GridRowId, field: string) => any;
|
|
62
|
+
}
|
|
63
|
+
export interface FocusElement {
|
|
64
|
+
focus(): void;
|
|
61
65
|
}
|
|
62
66
|
/**
|
|
63
67
|
* GridCellParams containing api.
|
|
64
68
|
*/
|
|
65
|
-
export interface GridRenderCellParams<V = any, R = any, F = V> extends GridCellParams<V, R, F> {
|
|
69
|
+
export interface GridRenderCellParams<V = any, R extends GridValidRowModel = any, F = V> extends GridCellParams<V, R, F> {
|
|
66
70
|
/**
|
|
67
71
|
* GridApi that let you manipulate the grid.
|
|
68
72
|
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
69
73
|
*/
|
|
70
74
|
api: any;
|
|
75
|
+
/**
|
|
76
|
+
* A ref allowing to set imperative focus.
|
|
77
|
+
* It can be passed to the element that should receive focus.
|
|
78
|
+
* @ignore - do not document.
|
|
79
|
+
*/
|
|
80
|
+
focusElementRef?: React.Ref<FocusElement>;
|
|
71
81
|
}
|
|
72
82
|
/**
|
|
73
83
|
* GridEditCellProps containing api.
|
|
74
84
|
*/
|
|
75
|
-
export interface GridRenderEditCellParams<V = any, R = any, F = V> extends GridCellParams<V, R, F>, GridEditCellProps<V> {
|
|
85
|
+
export interface GridRenderEditCellParams<V = any, R extends GridValidRowModel = any, F = V> extends GridCellParams<V, R, F>, GridEditCellProps<V> {
|
|
76
86
|
/**
|
|
77
87
|
* GridApi that let you manipulate the grid.
|
|
78
88
|
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
@@ -92,24 +102,24 @@ export interface GridValueGetterParams<V = any, R = any> extends Omit<GridCellPa
|
|
|
92
102
|
/**
|
|
93
103
|
* @deprecated Use `GridValueGetterParams` instead.
|
|
94
104
|
*/
|
|
95
|
-
export declare type GridValueGetterFullParams<V = any, R = any> = GridValueGetterParams<V, R>;
|
|
105
|
+
export declare type GridValueGetterFullParams<V = any, R extends GridValidRowModel = any> = GridValueGetterParams<V, R>;
|
|
96
106
|
/**
|
|
97
107
|
* Object passed as parameter in the column [[GridColDef]] value setter callback.
|
|
98
108
|
*/
|
|
99
|
-
export interface GridValueSetterParams {
|
|
109
|
+
export interface GridValueSetterParams<R extends GridValidRowModel = any, V = any> {
|
|
100
110
|
/**
|
|
101
111
|
* The new cell value.
|
|
102
112
|
*/
|
|
103
|
-
value:
|
|
113
|
+
value: V;
|
|
104
114
|
/**
|
|
105
115
|
* The row that is being edited.
|
|
106
116
|
*/
|
|
107
|
-
row:
|
|
117
|
+
row: R;
|
|
108
118
|
}
|
|
109
119
|
/**
|
|
110
120
|
* Object passed as parameter in the column [[GridColDef]] value formatter callback.
|
|
111
121
|
*/
|
|
112
|
-
export interface GridValueFormatterParams {
|
|
122
|
+
export interface GridValueFormatterParams<V = any> {
|
|
113
123
|
/**
|
|
114
124
|
* The grid row id.
|
|
115
125
|
* It is not available when the value formatter is called by the filter panel.
|
|
@@ -122,7 +132,7 @@ export interface GridValueFormatterParams {
|
|
|
122
132
|
/**
|
|
123
133
|
* The cell value, if the column has valueGetter it is the value returned by it.
|
|
124
134
|
*/
|
|
125
|
-
value:
|
|
135
|
+
value: V;
|
|
126
136
|
/**
|
|
127
137
|
* GridApi that let you manipulate the grid.
|
|
128
138
|
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { GridStateColDef } from '../colDef/gridColDef';
|
|
2
|
+
import { GridValidRowModel } from '../gridRows';
|
|
2
3
|
/**
|
|
3
4
|
* Object passed as parameter in the column [[GridColDef]] header renderer.
|
|
4
5
|
*/
|
|
5
|
-
export interface GridColumnHeaderParams {
|
|
6
|
+
export interface GridColumnHeaderParams<V = any, R extends GridValidRowModel = GridValidRowModel, F = V> {
|
|
6
7
|
/**
|
|
7
8
|
* The column field of the column that triggered the event
|
|
8
9
|
*/
|
|
@@ -10,5 +11,5 @@ export interface GridColumnHeaderParams {
|
|
|
10
11
|
/**
|
|
11
12
|
* The column of the current header component.
|
|
12
13
|
*/
|
|
13
|
-
colDef: GridStateColDef
|
|
14
|
+
colDef: GridStateColDef<R, V, F>;
|
|
14
15
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { GridCellValue } from '../gridCell';
|
|
2
1
|
import { GridEditCellProps } from '../gridEditRowModel';
|
|
3
2
|
import { GridRowId } from '../gridRows';
|
|
4
3
|
import { GridCellParams } from './gridCellParams';
|
|
@@ -22,7 +21,7 @@ export interface GridEditCellValueParams {
|
|
|
22
21
|
/**
|
|
23
22
|
* The new value for the cell.
|
|
24
23
|
*/
|
|
25
|
-
value:
|
|
24
|
+
value: any;
|
|
26
25
|
/**
|
|
27
26
|
* The debounce time in milliseconds.
|
|
28
27
|
*/
|
|
@@ -35,7 +34,7 @@ export interface GridCommitCellChangeParams {
|
|
|
35
34
|
export interface GridCellEditCommitParams {
|
|
36
35
|
id: GridRowId;
|
|
37
36
|
field: string;
|
|
38
|
-
value:
|
|
37
|
+
value: any;
|
|
39
38
|
}
|
|
40
39
|
declare enum GridCellEditStartReasons {
|
|
41
40
|
enterKeyDown = "enterKeyDown",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GridRowEntry, GridRowId, GridRowModel } from '../gridRows';
|
|
1
|
+
import { GridValidRowModel, GridRowEntry, GridRowId } from '../gridRows';
|
|
3
2
|
import type { GridColumns } from '../colDef/gridColDef';
|
|
4
3
|
/**
|
|
5
4
|
* Object passed as parameter in the row callbacks.
|
|
6
5
|
*/
|
|
7
|
-
export interface GridRowParams<R extends
|
|
6
|
+
export interface GridRowParams<R extends GridValidRowModel = any> {
|
|
8
7
|
/**
|
|
9
8
|
* The grid row id.
|
|
10
9
|
*/
|
|
@@ -21,10 +20,10 @@ export interface GridRowParams<R extends GridRowModel = GridRowModel> {
|
|
|
21
20
|
* Get the cell value of a row and field.
|
|
22
21
|
* @param {GridRowId} id The row id.
|
|
23
22
|
* @param {string} field The field.
|
|
24
|
-
* @returns {
|
|
23
|
+
* @returns {any} The cell value.
|
|
25
24
|
* @deprecated Use `params.row` to directly access the fields you want instead.
|
|
26
25
|
*/
|
|
27
|
-
getValue: (id: GridRowId, field: string) =>
|
|
26
|
+
getValue: (id: GridRowId, field: string) => any;
|
|
28
27
|
}
|
|
29
28
|
interface GridRowVisibilityParams {
|
|
30
29
|
/**
|
|
@@ -35,11 +34,16 @@ interface GridRowVisibilityParams {
|
|
|
35
34
|
* Whether this row is the last visible or not.
|
|
36
35
|
*/
|
|
37
36
|
isLastVisible: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Index of the row in the current page.
|
|
39
|
+
* If the pagination is disabled, it will be the index relative to all filtered rows.
|
|
40
|
+
*/
|
|
41
|
+
indexRelativeToCurrentPage: number;
|
|
38
42
|
}
|
|
39
43
|
/**
|
|
40
44
|
* Object passed as parameter in the row `getRowClassName` callback prop.
|
|
41
45
|
*/
|
|
42
|
-
export interface GridRowClassNameParams extends GridRowParams
|
|
46
|
+
export interface GridRowClassNameParams<R extends GridValidRowModel = any> extends GridRowParams<R>, GridRowVisibilityParams {
|
|
43
47
|
}
|
|
44
48
|
/**
|
|
45
49
|
* Object passed as parameter in the row `getRowHeight` callback prop.
|
|
@@ -63,7 +67,7 @@ declare enum GridRowEditStartReasons {
|
|
|
63
67
|
/**
|
|
64
68
|
* Params passed to the `rowEditStart` event.
|
|
65
69
|
*/
|
|
66
|
-
export interface GridRowEditStartParams<R extends
|
|
70
|
+
export interface GridRowEditStartParams<R extends GridValidRowModel = any> extends GridRowParams<R> {
|
|
67
71
|
/**
|
|
68
72
|
* Which field triggered this event.
|
|
69
73
|
* Only applied if `props.experimentalFeatures.newEditingApi: true`.
|
|
@@ -82,7 +86,7 @@ declare enum GridRowEditStopReasons {
|
|
|
82
86
|
tabKeyDown = "tabKeyDown",
|
|
83
87
|
shiftTabKeyDown = "shiftTabKeyDown"
|
|
84
88
|
}
|
|
85
|
-
export interface GridRowEditStopParams<R extends
|
|
89
|
+
export interface GridRowEditStopParams<R extends GridValidRowModel = any> extends GridRowParams<R> {
|
|
86
90
|
/**
|
|
87
91
|
* Which field triggered this event.
|
|
88
92
|
* Only applied if `props.experimentalFeatures.newEditingApi: true`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GridRowId, GridValidRowModel } from '../gridRows';
|
|
2
2
|
/**
|
|
3
3
|
* Object passed as parameter of the valueOptions function for singleSelect column.
|
|
4
4
|
*/
|
|
5
|
-
export interface GridValueOptionsParams {
|
|
5
|
+
export interface GridValueOptionsParams<R extends GridValidRowModel = any> {
|
|
6
6
|
/**
|
|
7
7
|
* The field of the column to which options will be provided
|
|
8
8
|
*/
|
|
@@ -14,5 +14,5 @@ export interface GridValueOptionsParams {
|
|
|
14
14
|
/**
|
|
15
15
|
* The row model of the row that the current cell belongs to.
|
|
16
16
|
*/
|
|
17
|
-
row?:
|
|
17
|
+
row?: R;
|
|
18
18
|
}
|
package/models/params/index.d.ts
CHANGED
package/models/params/index.js
CHANGED
|
@@ -9,4 +9,5 @@ export * from './gridRowSelectionCheckboxParams';
|
|
|
9
9
|
export * from './gridHeaderSelectionCheckboxParams';
|
|
10
10
|
export * from './gridValueOptionsParams';
|
|
11
11
|
export * from './gridCellParams';
|
|
12
|
-
export * from './gridSortModelParams';
|
|
12
|
+
export * from './gridSortModelParams';
|
|
13
|
+
export * from './gridPreferencePanelParams';
|
|
@@ -8,7 +8,7 @@ import { GridFeatureMode } from '../gridFeatureMode';
|
|
|
8
8
|
import { Logger } from '../logger';
|
|
9
9
|
import { GridSortDirection, GridSortModel } from '../gridSortModel';
|
|
10
10
|
import { GridSlotsComponent } from '../gridSlotsComponent';
|
|
11
|
-
import { GridRowIdGetter, GridRowsProp,
|
|
11
|
+
import { GridRowIdGetter, GridRowsProp, GridValidRowModel } from '../gridRows';
|
|
12
12
|
import { GridEventListener, GridEvents } from '../events';
|
|
13
13
|
import { GridCallbackDetails, GridLocaleText } from '../api';
|
|
14
14
|
import { GridApiCommunity } from '../api/gridApiCommunity';
|
|
@@ -40,13 +40,13 @@ export interface GridExperimentalFeatures {
|
|
|
40
40
|
/**
|
|
41
41
|
* The props users can give to the `DataGrid` component.
|
|
42
42
|
*/
|
|
43
|
-
export declare type DataGridProps = Omit<Partial<DataGridPropsWithDefaultValues> & DataGridPropsWithComplexDefaultValueBeforeProcessing & DataGridPropsWithoutDefaultValue
|
|
43
|
+
export declare type DataGridProps<R extends GridValidRowModel = any> = Omit<Partial<DataGridPropsWithDefaultValues> & DataGridPropsWithComplexDefaultValueBeforeProcessing & DataGridPropsWithoutDefaultValue<R>, DataGridForcedPropsKey> & {
|
|
44
44
|
pagination?: true;
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
47
47
|
* The props of the `DataGrid` component after the pre-processing phase.
|
|
48
48
|
*/
|
|
49
|
-
export interface DataGridProcessedProps extends DataGridPropsWithDefaultValues, DataGridPropsWithComplexDefaultValueAfterProcessing, DataGridPropsWithoutDefaultValue {
|
|
49
|
+
export interface DataGridProcessedProps<R extends GridValidRowModel = any> extends DataGridPropsWithDefaultValues, DataGridPropsWithComplexDefaultValueAfterProcessing, DataGridPropsWithoutDefaultValue<R> {
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* The props of the `DataGrid` component after the pre-processing phase that the user should not be able to override.
|
|
@@ -293,7 +293,7 @@ export interface DataGridPropsWithDefaultValues {
|
|
|
293
293
|
/**
|
|
294
294
|
* The `DataGrid` props with no default value.
|
|
295
295
|
*/
|
|
296
|
-
export interface DataGridPropsWithoutDefaultValue extends CommonProps {
|
|
296
|
+
export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel = any> extends CommonProps {
|
|
297
297
|
/**
|
|
298
298
|
* The ref object that allows grid manipulation. Can be instantiated with [[useGridApiRef()]].
|
|
299
299
|
* TODO: Remove `@internal` when opening `apiRef` to Community plan
|
|
@@ -328,13 +328,13 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
|
|
|
328
328
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
329
329
|
* @returns {string} The CSS class to apply to the cell.
|
|
330
330
|
*/
|
|
331
|
-
getCellClassName?: (params: GridCellParams) => string;
|
|
331
|
+
getCellClassName?: (params: GridCellParams<any, R>) => string;
|
|
332
332
|
/**
|
|
333
333
|
* Function that applies CSS classes dynamically on rows.
|
|
334
334
|
* @param {GridRowClassNameParams} params With all properties from [[GridRowClassNameParams]].
|
|
335
335
|
* @returns {string} The CSS class to apply to the row.
|
|
336
336
|
*/
|
|
337
|
-
getRowClassName?: (params: GridRowClassNameParams) => string;
|
|
337
|
+
getRowClassName?: (params: GridRowClassNameParams<R>) => string;
|
|
338
338
|
/**
|
|
339
339
|
* Function that sets the row height per row.
|
|
340
340
|
* @param {GridRowHeightParams} params With all properties from [[GridRowHeightParams]].
|
|
@@ -352,25 +352,25 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
|
|
|
352
352
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
353
353
|
* @returns {JSX.Element} The row detail element.
|
|
354
354
|
*/
|
|
355
|
-
getDetailPanelContent?: (params: GridRowParams) => React.ReactNode;
|
|
355
|
+
getDetailPanelContent?: (params: GridRowParams<R>) => React.ReactNode;
|
|
356
356
|
/**
|
|
357
357
|
* Callback fired when a cell is rendered, returns true if the cell is editable.
|
|
358
358
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
359
359
|
* @returns {boolean} A boolean indicating if the cell is editable.
|
|
360
360
|
*/
|
|
361
|
-
isCellEditable?: (params: GridCellParams) => boolean;
|
|
361
|
+
isCellEditable?: (params: GridCellParams<any, R>) => boolean;
|
|
362
362
|
/**
|
|
363
363
|
* Determines if a row can be selected.
|
|
364
364
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
365
365
|
* @returns {boolean} A boolean indicating if the cell is selectable.
|
|
366
366
|
*/
|
|
367
|
-
isRowSelectable?: (params: GridRowParams) => boolean;
|
|
367
|
+
isRowSelectable?: (params: GridRowParams<R>) => boolean;
|
|
368
368
|
/**
|
|
369
369
|
* Callback fired when the edit cell value changes.
|
|
370
370
|
* @param {GridEditCellPropsParams} params With all properties from [[GridEditCellPropsParams]].
|
|
371
371
|
* @param {MuiEvent<React.SyntheticEvent>} event The event that caused this prop to be called.
|
|
372
372
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
373
|
-
* @deprecated use `preProcessEditCellProps` from the [`GridColDef`](/api/data-grid/grid-col-def/)
|
|
373
|
+
* @deprecated use `preProcessEditCellProps` from the [`GridColDef`](/x/api/data-grid/grid-col-def/)
|
|
374
374
|
*/
|
|
375
375
|
onEditCellPropsChange?: GridEventListener<GridEvents.editCellPropsChange>;
|
|
376
376
|
/**
|
|
@@ -556,6 +556,20 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
|
|
|
556
556
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
557
557
|
*/
|
|
558
558
|
onPageSizeChange?: (pageSize: number, details: GridCallbackDetails) => void;
|
|
559
|
+
/**
|
|
560
|
+
* Callback fired when the preferences panel is closed.
|
|
561
|
+
* @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
|
|
562
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
563
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
564
|
+
*/
|
|
565
|
+
onPreferencePanelClose?: GridEventListener<GridEvents.preferencePanelClose>;
|
|
566
|
+
/**
|
|
567
|
+
* Callback fired when the preferences panel is opened.
|
|
568
|
+
* @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
|
|
569
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
570
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
571
|
+
*/
|
|
572
|
+
onPreferencePanelOpen?: GridEventListener<GridEvents.preferencePanelOpen>;
|
|
559
573
|
/**
|
|
560
574
|
* Set the edit rows model of the grid.
|
|
561
575
|
*/
|
|
@@ -618,7 +632,7 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
|
|
|
618
632
|
/**
|
|
619
633
|
* Set of columns of type [[GridColumns]].
|
|
620
634
|
*/
|
|
621
|
-
columns: GridColumns
|
|
635
|
+
columns: GridColumns<R>;
|
|
622
636
|
/**
|
|
623
637
|
* An error that will turn the grid into its error state and display the error component.
|
|
624
638
|
*/
|
|
@@ -626,7 +640,7 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
|
|
|
626
640
|
/**
|
|
627
641
|
* Return the id of a given [[GridRowModel]].
|
|
628
642
|
*/
|
|
629
|
-
getRowId?: GridRowIdGetter
|
|
643
|
+
getRowId?: GridRowIdGetter<R>;
|
|
630
644
|
/**
|
|
631
645
|
* If `true`, a loading overlay is displayed.
|
|
632
646
|
*/
|
|
@@ -638,7 +652,7 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
|
|
|
638
652
|
/**
|
|
639
653
|
* Set of rows of type [[GridRowsProp]].
|
|
640
654
|
*/
|
|
641
|
-
rows: GridRowsProp
|
|
655
|
+
rows: GridRowsProp<R>;
|
|
642
656
|
/**
|
|
643
657
|
* The initial state of the DataGrid.
|
|
644
658
|
* The data in it will be set in the state on initialization but will not be controlled.
|
|
@@ -661,9 +675,15 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
|
|
|
661
675
|
/**
|
|
662
676
|
* Callback called before updating a row with new values in the row and cell editing.
|
|
663
677
|
* Only applied if `props.experimentalFeatures.newEditingApi: true`.
|
|
664
|
-
* @
|
|
665
|
-
* @param {
|
|
666
|
-
* @
|
|
678
|
+
* @template R
|
|
679
|
+
* @param {R} newRow Row object with the new values.
|
|
680
|
+
* @param {R} oldRow Row object with the old values.
|
|
681
|
+
* @returns {Promise<R> | R} The final values to update the row.
|
|
682
|
+
*/
|
|
683
|
+
processRowUpdate?: (newRow: R, oldRow: R) => Promise<R> | R;
|
|
684
|
+
/**
|
|
685
|
+
* Callback called when `processRowUpdate` throws an error or rejects.
|
|
686
|
+
* @param {any} error The error thrown.
|
|
667
687
|
*/
|
|
668
|
-
|
|
688
|
+
onProcessRowUpdateError?: (error: any) => void;
|
|
669
689
|
}
|
|
@@ -458,7 +458,7 @@ DataGridRaw.propTypes = {
|
|
|
458
458
|
* @param {GridEditCellPropsParams} params With all properties from [[GridEditCellPropsParams]].
|
|
459
459
|
* @param {MuiEvent<React.SyntheticEvent>} event The event that caused this prop to be called.
|
|
460
460
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
461
|
-
* @deprecated use `preProcessEditCellProps` from the [`GridColDef`](/api/data-grid/grid-col-def/)
|
|
461
|
+
* @deprecated use `preProcessEditCellProps` from the [`GridColDef`](/x/api/data-grid/grid-col-def/)
|
|
462
462
|
*/
|
|
463
463
|
onEditCellPropsChange: PropTypes.func,
|
|
464
464
|
|
|
@@ -498,6 +498,28 @@ DataGridRaw.propTypes = {
|
|
|
498
498
|
*/
|
|
499
499
|
onPageSizeChange: PropTypes.func,
|
|
500
500
|
|
|
501
|
+
/**
|
|
502
|
+
* Callback fired when the preferences panel is closed.
|
|
503
|
+
* @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
|
|
504
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
505
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
506
|
+
*/
|
|
507
|
+
onPreferencePanelClose: PropTypes.func,
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Callback fired when the preferences panel is opened.
|
|
511
|
+
* @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
|
|
512
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
513
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
514
|
+
*/
|
|
515
|
+
onPreferencePanelOpen: PropTypes.func,
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Callback called when `processRowUpdate` throws an error or rejects.
|
|
519
|
+
* @param {any} error The error thrown.
|
|
520
|
+
*/
|
|
521
|
+
onProcessRowUpdateError: PropTypes.func,
|
|
522
|
+
|
|
501
523
|
/**
|
|
502
524
|
* Callback fired when the grid is resized.
|
|
503
525
|
* @param {ElementSize} containerSize With all properties from [[ElementSize]].
|
|
@@ -604,9 +626,10 @@ DataGridRaw.propTypes = {
|
|
|
604
626
|
/**
|
|
605
627
|
* Callback called before updating a row with new values in the row and cell editing.
|
|
606
628
|
* Only applied if `props.experimentalFeatures.newEditingApi: true`.
|
|
607
|
-
* @
|
|
608
|
-
* @param {
|
|
609
|
-
* @
|
|
629
|
+
* @template R
|
|
630
|
+
* @param {R} newRow Row object with the new values.
|
|
631
|
+
* @param {R} oldRow Row object with the old values.
|
|
632
|
+
* @returns {Promise<R> | R} The final values to update the row.
|
|
610
633
|
*/
|
|
611
634
|
processRowUpdate: PropTypes.func,
|
|
612
635
|
|
|
@@ -631,7 +654,7 @@ DataGridRaw.propTypes = {
|
|
|
631
654
|
/**
|
|
632
655
|
* Set of rows of type [[GridRowsProp]].
|
|
633
656
|
*/
|
|
634
|
-
rows: PropTypes.
|
|
657
|
+
rows: PropTypes.array.isRequired,
|
|
635
658
|
|
|
636
659
|
/**
|
|
637
660
|
* Sets the type of space between rows added by `getRowSpacing`.
|
|
@@ -8,8 +8,7 @@ import { useGridCsvExport } from '../hooks/features/export/useGridCsvExport';
|
|
|
8
8
|
import { useGridPrintExport } from '../hooks/features/export/useGridPrintExport';
|
|
9
9
|
import { useGridFilter, filterStateInitializer } from '../hooks/features/filter/useGridFilter';
|
|
10
10
|
import { focusStateInitializer, useGridFocus } from '../hooks/features/focus/useGridFocus';
|
|
11
|
-
import {
|
|
12
|
-
import { useGridKeyboardNavigation } from '../hooks/features/keyboard/useGridKeyboardNavigation';
|
|
11
|
+
import { useGridKeyboardNavigation } from '../hooks/features/keyboardNavigation/useGridKeyboardNavigation';
|
|
13
12
|
import { useGridPagination, paginationStateInitializer } from '../hooks/features/pagination/useGridPagination';
|
|
14
13
|
import { useGridPreferencesPanel, preferencePanelStateInitializer } from '../hooks/features/preferencesPanel/useGridPreferencesPanel';
|
|
15
14
|
import { useGridEditing as useGridEditing_old, editingStateInitializer as editingStateInitializer_old } from '../hooks/features/editRows/useGridEditing.old';
|
|
@@ -25,6 +24,7 @@ import { useGridEvents } from '../hooks/features/events/useGridEvents';
|
|
|
25
24
|
import { useGridDimensions } from '../hooks/features/dimensions/useGridDimensions';
|
|
26
25
|
import { rowsMetaStateInitializer, useGridRowsMeta } from '../hooks/features/rows/useGridRowsMeta';
|
|
27
26
|
import { useGridStatePersistence } from '../hooks/features/statePersistence/useGridStatePersistence';
|
|
27
|
+
import { useGridColumnSpanning } from '../hooks/features/columns/useGridColumnSpanning';
|
|
28
28
|
export const useDataGridComponent = props => {
|
|
29
29
|
const apiRef = useGridInitialization(undefined, props);
|
|
30
30
|
/**
|
|
@@ -49,23 +49,23 @@ export const useDataGridComponent = props => {
|
|
|
49
49
|
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
50
50
|
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
51
51
|
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
52
|
+
useGridKeyboardNavigation(apiRef, props);
|
|
52
53
|
useGridSelection(apiRef, props);
|
|
53
54
|
useGridColumns(apiRef, props);
|
|
54
55
|
useGridRows(apiRef, props);
|
|
55
56
|
useGridParamsApi(apiRef);
|
|
57
|
+
useGridColumnSpanning(apiRef);
|
|
56
58
|
const useGridEditing = props.experimentalFeatures?.newEditingApi ? useGridEditing_new : useGridEditing_old;
|
|
57
59
|
useGridEditing(apiRef, props);
|
|
58
60
|
useGridFocus(apiRef, props);
|
|
59
|
-
useGridSorting(apiRef, props);
|
|
60
61
|
useGridPreferencesPanel(apiRef);
|
|
61
62
|
useGridFilter(apiRef, props);
|
|
63
|
+
useGridSorting(apiRef, props);
|
|
62
64
|
useGridDensity(apiRef, props);
|
|
63
65
|
useGridPagination(apiRef, props);
|
|
64
66
|
useGridRowsMeta(apiRef, props);
|
|
65
67
|
useGridScroll(apiRef, props);
|
|
66
68
|
useGridColumnMenu(apiRef);
|
|
67
|
-
useGridKeyboard(apiRef);
|
|
68
|
-
useGridKeyboardNavigation(apiRef, props);
|
|
69
69
|
useGridCsvExport(apiRef);
|
|
70
70
|
useGridPrintExport(apiRef, props);
|
|
71
71
|
useGridClipboard(apiRef);
|
|
@@ -10,7 +10,7 @@ export function gridDateFormatter({
|
|
|
10
10
|
return value.toLocaleDateString();
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
return value;
|
|
13
|
+
return value ?? '';
|
|
14
14
|
}
|
|
15
15
|
export function gridDateTimeFormatter({
|
|
16
16
|
value
|
|
@@ -19,7 +19,7 @@ export function gridDateTimeFormatter({
|
|
|
19
19
|
return value.toLocaleString();
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
return value;
|
|
22
|
+
return value ?? '';
|
|
23
23
|
}
|
|
24
24
|
export const GRID_DATE_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
25
25
|
type: 'date',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { GRID_STRING_COL_DEF } from '
|
|
2
|
-
import { GRID_NUMERIC_COL_DEF } from '
|
|
3
|
-
import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from '
|
|
4
|
-
import { GRID_BOOLEAN_COL_DEF } from '
|
|
5
|
-
import { GRID_SINGLE_SELECT_COL_DEF } from '
|
|
6
|
-
import { GRID_ACTIONS_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from '
|
|
1
|
+
import { GRID_STRING_COL_DEF } from './gridStringColDef';
|
|
2
|
+
import { GRID_NUMERIC_COL_DEF } from './gridNumericColDef';
|
|
3
|
+
import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from './gridDateColDef';
|
|
4
|
+
import { GRID_BOOLEAN_COL_DEF } from './gridBooleanColDef';
|
|
5
|
+
import { GRID_SINGLE_SELECT_COL_DEF } from './gridSingleSelectColDef';
|
|
6
|
+
import { GRID_ACTIONS_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from './gridActionsColDef';
|
|
7
7
|
export const DEFAULT_GRID_COL_TYPE_KEY = '__default__';
|
|
8
8
|
export const getGridDefaultColumnTypes = () => {
|
|
9
9
|
const nativeColumnTypes = {
|
package/modern/colDef/index.js
CHANGED
|
@@ -9,4 +9,5 @@ export * from './gridBooleanOperators';
|
|
|
9
9
|
export * from './gridDateOperators';
|
|
10
10
|
export * from './gridNumericOperators';
|
|
11
11
|
export * from './gridSingleSelectOperators';
|
|
12
|
-
export * from './gridStringOperators';
|
|
12
|
+
export * from './gridStringOperators';
|
|
13
|
+
export * from './gridDefaultColumnTypes';
|