@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
package/DataGrid/DataGrid.js
CHANGED
|
@@ -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
|
var _props$experimentalFe, _props$experimentalFe2;
|
|
30
30
|
|
|
@@ -51,23 +51,23 @@ export const useDataGridComponent = props => {
|
|
|
51
51
|
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
52
52
|
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
53
53
|
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
54
|
+
useGridKeyboardNavigation(apiRef, props);
|
|
54
55
|
useGridSelection(apiRef, props);
|
|
55
56
|
useGridColumns(apiRef, props);
|
|
56
57
|
useGridRows(apiRef, props);
|
|
57
58
|
useGridParamsApi(apiRef);
|
|
59
|
+
useGridColumnSpanning(apiRef);
|
|
58
60
|
const useGridEditing = (_props$experimentalFe2 = props.experimentalFeatures) != null && _props$experimentalFe2.newEditingApi ? useGridEditing_new : useGridEditing_old;
|
|
59
61
|
useGridEditing(apiRef, props);
|
|
60
62
|
useGridFocus(apiRef, props);
|
|
61
|
-
useGridSorting(apiRef, props);
|
|
62
63
|
useGridPreferencesPanel(apiRef);
|
|
63
64
|
useGridFilter(apiRef, props);
|
|
65
|
+
useGridSorting(apiRef, props);
|
|
64
66
|
useGridDensity(apiRef, props);
|
|
65
67
|
useGridPagination(apiRef, props);
|
|
66
68
|
useGridRowsMeta(apiRef, props);
|
|
67
69
|
useGridScroll(apiRef, props);
|
|
68
70
|
useGridColumnMenu(apiRef);
|
|
69
|
-
useGridKeyboard(apiRef);
|
|
70
|
-
useGridKeyboardNavigation(apiRef, props);
|
|
71
71
|
useGridCsvExport(apiRef);
|
|
72
72
|
useGridPrintExport(apiRef, props);
|
|
73
73
|
useGridClipboard(apiRef);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { DataGridProcessedProps, DataGridProps, DataGridPropsWithDefaultValues } from '../models/props/DataGridProps';
|
|
2
|
+
import { GridValidRowModel } from '../models';
|
|
2
3
|
export declare const MAX_PAGE_SIZE = 100;
|
|
3
4
|
/**
|
|
4
5
|
* The default values of `DataGridPropsWithDefaultValues` to inject in the props of DataGrid.
|
|
5
6
|
*/
|
|
6
7
|
export declare const DATA_GRID_PROPS_DEFAULT_VALUES: DataGridPropsWithDefaultValues;
|
|
7
|
-
export declare const useDataGridProps: (inProps: DataGridProps) => DataGridProcessedProps
|
|
8
|
+
export declare const useDataGridProps: <R extends GridValidRowModel>(inProps: DataGridProps<R>) => DataGridProcessedProps<R>;
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Material-UI SAS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -15,15 +15,17 @@ npm install @mui/x-data-grid
|
|
|
15
15
|
yarn add @mui/x-data-grid
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
This component has
|
|
18
|
+
This component has the following peer dependencies that you will need to install as well.
|
|
19
19
|
|
|
20
20
|
```json
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@mui/material": "^5.
|
|
23
|
-
"
|
|
22
|
+
"@mui/material": "^5.2.8",
|
|
23
|
+
"@mui/system": "^5.2.8",
|
|
24
|
+
"react": "^17.0.2 || ^18.0.0",
|
|
25
|
+
"react-dom": "^17.0.2 || ^18.0.0"
|
|
24
26
|
},
|
|
25
27
|
```
|
|
26
28
|
|
|
27
29
|
## Documentation
|
|
28
30
|
|
|
29
|
-
[The documentation](https://mui.com/
|
|
31
|
+
[The documentation](https://mui.com/x/react-data-grid/)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GridColTypeDef } from '../models/colDef/gridColDef';
|
|
2
|
-
export declare const GRID_BOOLEAN_COL_DEF: GridColTypeDef
|
|
2
|
+
export declare const GRID_BOOLEAN_COL_DEF: GridColTypeDef<boolean | null, any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GridFilterOperator } from '../models/gridFilterOperator';
|
|
2
|
-
export declare const getGridBooleanOperators: () => GridFilterOperator[];
|
|
2
|
+
export declare const getGridBooleanOperators: () => GridFilterOperator<any, boolean | null, any>[];
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { GridCellValue } from '../models/gridCell';
|
|
2
1
|
import { GridColTypeDef } from '../models/colDef/gridColDef';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare
|
|
7
|
-
|
|
8
|
-
}): string | number | boolean | object | null | undefined;
|
|
9
|
-
export declare const GRID_DATE_COL_DEF: GridColTypeDef;
|
|
10
|
-
export declare const GRID_DATETIME_COL_DEF: GridColTypeDef;
|
|
2
|
+
import { GridValueFormatterParams } from '../models/params/gridCellParams';
|
|
3
|
+
export declare function gridDateFormatter({ value }: GridValueFormatterParams<Date | string>): string;
|
|
4
|
+
export declare function gridDateTimeFormatter({ value }: GridValueFormatterParams<Date | string>): string;
|
|
5
|
+
export declare const GRID_DATE_COL_DEF: GridColTypeDef<Date | string, string>;
|
|
6
|
+
export declare const GRID_DATETIME_COL_DEF: GridColTypeDef<Date | string, string>;
|
package/colDef/gridDateColDef.js
CHANGED
|
@@ -10,7 +10,7 @@ export function gridDateFormatter({
|
|
|
10
10
|
return value.toLocaleDateString();
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
return value;
|
|
13
|
+
return value != null ? 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 != null ? value : '';
|
|
23
23
|
}
|
|
24
24
|
export const GRID_DATE_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
25
25
|
type: 'date',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GridFilterOperator } from '../models/gridFilterOperator';
|
|
2
|
-
export declare const getGridDateOperators: (showTime?: boolean | undefined) => GridFilterOperator[];
|
|
2
|
+
export declare const getGridDateOperators: (showTime?: boolean | undefined) => GridFilterOperator<any, string | number | Date, any>[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { GridColumnTypesRecord } from '
|
|
1
|
+
import { GridColumnTypesRecord } from '../models/colDef/gridColumnTypesRecord';
|
|
2
2
|
export declare const DEFAULT_GRID_COL_TYPE_KEY = "__default__";
|
|
3
3
|
export declare const getGridDefaultColumnTypes: () => GridColumnTypesRecord;
|
|
@@ -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 = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GridColTypeDef } from '../models/colDef/gridColDef';
|
|
2
|
-
export declare const GRID_NUMERIC_COL_DEF: GridColTypeDef
|
|
2
|
+
export declare const GRID_NUMERIC_COL_DEF: GridColTypeDef<number | string | null, string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GridFilterOperator } from '../models/gridFilterOperator';
|
|
2
|
-
export declare const getGridNumericOperators: () => GridFilterOperator[];
|
|
2
|
+
export declare const getGridNumericOperators: () => GridFilterOperator<any, number | string | null, any>[];
|
|
3
3
|
/**
|
|
4
4
|
* @deprecated Use `getGridNumericOperators` instead.
|
|
5
5
|
*/
|
|
6
|
-
export declare const getGridNumericColumnOperators: (() => GridFilterOperator[]) | ((...args: any[]) => any);
|
|
6
|
+
export declare const getGridNumericColumnOperators: (() => GridFilterOperator<any, number | string | null, any>[]) | ((...args: any[]) => any);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GridColTypeDef } from '../models/colDef/gridColDef';
|
|
2
|
-
export declare const GRID_STRING_COL_DEF: GridColTypeDef
|
|
2
|
+
export declare const GRID_STRING_COL_DEF: GridColTypeDef<any, any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GridFilterOperator } from '../models/gridFilterOperator';
|
|
2
|
-
export declare const getGridStringOperators: () => GridFilterOperator[];
|
|
2
|
+
export declare const getGridStringOperators: () => GridFilterOperator<any, number | string | null, any>[];
|
package/colDef/index.d.ts
CHANGED
package/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';
|
package/components/GridRow.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ import { GridCellIdentifier } from '../hooks/features/focus/gridFocusState';
|
|
|
6
6
|
export interface GridRowProps {
|
|
7
7
|
rowId: GridRowId;
|
|
8
8
|
selected: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Index of the row in the whole sorted and filtered dataset.
|
|
11
|
+
* If some rows above have expanded children, this index also take those children into account.
|
|
12
|
+
*/
|
|
9
13
|
index: number;
|
|
10
14
|
rowHeight: number;
|
|
11
15
|
containerWidth: number;
|
package/components/GridRow.js
CHANGED
|
@@ -20,6 +20,7 @@ import { useGridVisibleRows } from '../hooks/utils/useGridVisibleRows';
|
|
|
20
20
|
import { findParentElementFromClassName } from '../utils/domUtils';
|
|
21
21
|
import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../colDef/gridCheckboxSelectionColDef';
|
|
22
22
|
import { GRID_ACTIONS_COLUMN_TYPE } from '../colDef/gridActionsColDef';
|
|
23
|
+
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../constants/gridDetailPanelToggleField';
|
|
23
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
25
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
26
|
|
|
@@ -61,6 +62,7 @@ function GridRow(props) {
|
|
|
61
62
|
const {
|
|
62
63
|
selected,
|
|
63
64
|
rowId,
|
|
65
|
+
row,
|
|
64
66
|
index,
|
|
65
67
|
style: styleProp,
|
|
66
68
|
rowHeight,
|
|
@@ -132,7 +134,12 @@ function GridRow(props) {
|
|
|
132
134
|
} // User opened a detail panel
|
|
133
135
|
|
|
134
136
|
|
|
135
|
-
if (field ===
|
|
137
|
+
if (field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {
|
|
138
|
+
return;
|
|
139
|
+
} // User reorders a row
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
if (field === '__reorder__') {
|
|
136
143
|
return;
|
|
137
144
|
} // User is editing a cell
|
|
138
145
|
|
|
@@ -176,7 +183,8 @@ function GridRow(props) {
|
|
|
176
183
|
|
|
177
184
|
const rowParams = _extends({}, apiRef.current.getRowParams(rowId), {
|
|
178
185
|
isFirstVisible: indexRelativeToCurrentPage === 0,
|
|
179
|
-
isLastVisible: indexRelativeToCurrentPage === currentPage.rows.length - 1
|
|
186
|
+
isLastVisible: indexRelativeToCurrentPage === currentPage.rows.length - 1,
|
|
187
|
+
indexRelativeToCurrentPage
|
|
180
188
|
});
|
|
181
189
|
|
|
182
190
|
rowClassName = rootProps.getRowClassName(rowParams);
|
|
@@ -185,8 +193,6 @@ function GridRow(props) {
|
|
|
185
193
|
const cells = [];
|
|
186
194
|
|
|
187
195
|
for (let i = 0; i < renderedColumns.length; i += 1) {
|
|
188
|
-
var _rootProps$components;
|
|
189
|
-
|
|
190
196
|
const column = renderedColumns[i];
|
|
191
197
|
const indexRelativeToAllColumns = firstColumnToRender + i;
|
|
192
198
|
const isLastColumn = indexRelativeToAllColumns === visibleColumns.length - 1;
|
|
@@ -215,7 +221,16 @@ function GridRow(props) {
|
|
|
215
221
|
if (editCellState != null && column.renderEditCell) {
|
|
216
222
|
var _rootProps$classes2;
|
|
217
223
|
|
|
218
|
-
|
|
224
|
+
let updatedRow = row;
|
|
225
|
+
|
|
226
|
+
if (apiRef.current.unstable_getRowWithUpdatedValues) {
|
|
227
|
+
// Only the new editing API has this method
|
|
228
|
+
updatedRow = apiRef.current.unstable_getRowWithUpdatedValues(rowId, column.field);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const params = _extends({}, cellParams, {
|
|
232
|
+
row: updatedRow
|
|
233
|
+
}, editCellState, {
|
|
219
234
|
api: apiRef.current
|
|
220
235
|
});
|
|
221
236
|
|
|
@@ -231,24 +246,35 @@ function GridRow(props) {
|
|
|
231
246
|
|
|
232
247
|
const hasFocus = cellFocus !== null && cellFocus.id === rowId && cellFocus.field === column.field;
|
|
233
248
|
const tabIndex = cellTabIndex !== null && cellTabIndex.id === rowId && cellTabIndex.field === column.field && cellParams.cellMode === 'view' ? 0 : -1;
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, indexRelativeToAllColumns);
|
|
250
|
+
|
|
251
|
+
if (cellColSpanInfo && !cellColSpanInfo.spannedByColSpan) {
|
|
252
|
+
var _rootProps$components;
|
|
253
|
+
|
|
254
|
+
const {
|
|
255
|
+
colSpan,
|
|
256
|
+
width
|
|
257
|
+
} = cellColSpanInfo.cellProps;
|
|
258
|
+
cells.push( /*#__PURE__*/_jsx(rootProps.components.Cell, _extends({
|
|
259
|
+
value: cellParams.value,
|
|
260
|
+
field: column.field,
|
|
261
|
+
width: width,
|
|
262
|
+
rowId: rowId,
|
|
263
|
+
height: rowHeight,
|
|
264
|
+
showRightBorder: showRightBorder,
|
|
265
|
+
formattedValue: cellParams.formattedValue,
|
|
266
|
+
align: column.align || 'left',
|
|
267
|
+
cellMode: cellParams.cellMode,
|
|
268
|
+
colIndex: indexRelativeToAllColumns,
|
|
269
|
+
isEditable: cellParams.isEditable,
|
|
270
|
+
hasFocus: hasFocus,
|
|
271
|
+
tabIndex: tabIndex,
|
|
272
|
+
className: clsx(classNames),
|
|
273
|
+
colSpan: colSpan
|
|
274
|
+
}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.cell, {
|
|
275
|
+
children: content
|
|
276
|
+
}), column.field));
|
|
277
|
+
}
|
|
252
278
|
}
|
|
253
279
|
|
|
254
280
|
const emptyCellWidth = containerWidth - columnsTotalWidth;
|
|
@@ -282,11 +308,16 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
282
308
|
containerWidth: PropTypes.number.isRequired,
|
|
283
309
|
editRowsState: PropTypes.object.isRequired,
|
|
284
310
|
firstColumnToRender: PropTypes.number.isRequired,
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Index of the row in the whole sorted and filtered dataset.
|
|
314
|
+
* If some rows above have expanded children, this index also take those children into account.
|
|
315
|
+
*/
|
|
285
316
|
index: PropTypes.number.isRequired,
|
|
286
317
|
isLastVisible: PropTypes.bool,
|
|
287
318
|
lastColumnToRender: PropTypes.number.isRequired,
|
|
288
319
|
renderedColumns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
289
|
-
row: PropTypes.
|
|
320
|
+
row: PropTypes.any.isRequired,
|
|
290
321
|
rowHeight: PropTypes.number.isRequired,
|
|
291
322
|
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
292
323
|
selected: PropTypes.bool.isRequired,
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
|
|
4
4
|
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
5
5
|
import { gridVisibleRowCountSelector } from '../../hooks/features/filter/gridFilterSelector';
|
|
6
|
-
import { gridRowCountSelector } from '../../hooks/features/rows/gridRowsSelector';
|
|
6
|
+
import { gridRowCountSelector, gridRowsLoadingSelector } from '../../hooks/features/rows/gridRowsSelector';
|
|
7
7
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
8
8
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
9
9
|
import { gridDensityHeaderHeightSelector } from '../../hooks/features/density/densitySelector';
|
|
@@ -55,8 +55,9 @@ export function GridOverlays() {
|
|
|
55
55
|
const rootProps = useGridRootProps();
|
|
56
56
|
const totalRowCount = useGridSelector(apiRef, gridRowCountSelector);
|
|
57
57
|
const visibleRowCount = useGridSelector(apiRef, gridVisibleRowCountSelector);
|
|
58
|
-
const
|
|
59
|
-
const
|
|
58
|
+
const loading = useGridSelector(apiRef, gridRowsLoadingSelector);
|
|
59
|
+
const showNoRowsOverlay = !loading && totalRowCount === 0;
|
|
60
|
+
const showNoResultsOverlay = !loading && totalRowCount > 0 && visibleRowCount === 0;
|
|
60
61
|
let overlay = null;
|
|
61
62
|
|
|
62
63
|
if (showNoRowsOverlay) {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { GridRenderCellParams } from '../../models/params/gridCellParams';
|
|
3
3
|
import { GridMenuProps } from '../menu/GridMenu';
|
|
4
|
-
|
|
4
|
+
interface GridActionsCellProps extends Omit<GridRenderCellParams, 'value' | 'formattedValue'> {
|
|
5
|
+
value?: GridRenderCellParams['value'];
|
|
6
|
+
formattedValue?: GridRenderCellParams['formattedValue'];
|
|
7
|
+
position?: GridMenuProps['position'];
|
|
8
|
+
}
|
|
5
9
|
declare const GridActionsCell: {
|
|
6
10
|
(props: GridActionsCellProps): JSX.Element;
|
|
7
11
|
propTypes: any;
|