@mui/x-data-grid 6.0.0-beta.4 → 6.0.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 +204 -29
- package/DataGrid/DataGrid.js +10 -2
- package/DataGrid/useDataGridProps.js +25 -18
- package/colDef/gridSingleSelectColDef.js +13 -4
- package/components/GridColumnHeaders.d.ts +7 -0
- package/components/GridColumnHeaders.js +108 -0
- package/components/GridFooter.d.ts +1 -1
- package/components/GridFooter.js +2 -2
- package/components/GridHeader.js +2 -2
- package/components/GridLoadingOverlay.d.ts +1 -1
- package/components/GridNoResultsOverlay.d.ts +1 -1
- package/components/GridNoRowsOverlay.d.ts +1 -1
- package/components/GridRow.d.ts +13 -7
- package/components/GridRow.js +49 -31
- package/components/GridRowCount.d.ts +1 -1
- package/components/GridRowCount.js +4 -6
- package/components/GridScrollArea.js +4 -3
- package/components/GridSelectedRowCount.d.ts +1 -1
- package/components/GridSelectedRowCount.js +4 -6
- package/components/base/GridBody.d.ts +1 -4
- package/components/base/GridBody.js +43 -5
- package/components/base/GridFooterPlaceholder.js +2 -2
- package/components/base/GridOverlays.js +7 -7
- package/components/cell/GridActionsCell.js +4 -4
- package/components/cell/GridActionsCellItem.js +3 -3
- package/components/cell/GridBooleanCell.js +1 -1
- package/components/cell/GridCell.d.ts +2 -5
- package/components/cell/GridCell.js +14 -12
- package/components/cell/GridEditBooleanCell.js +3 -3
- package/components/cell/GridEditInputCell.js +3 -6
- package/components/cell/GridEditSingleSelectCell.d.ts +2 -8
- package/components/cell/GridEditSingleSelectCell.js +32 -16
- package/components/columnHeaders/ColumnHeaderMenuIcon.js +4 -4
- package/components/columnHeaders/GridBaseColumnHeaders.d.ts +7 -0
- package/{modern/components/columnHeaders/GridColumnHeaders.js → components/columnHeaders/GridBaseColumnHeaders.js} +14 -20
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +6 -6
- package/components/columnHeaders/GridColumnHeaderItem.js +5 -5
- package/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +7 -7
- package/components/columnHeaders/GridColumnHeaderTitle.js +10 -14
- package/components/columnHeaders/GridColumnHeadersInner.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeadersInner.js +6 -6
- package/components/columnHeaders/GridIconButtonContainer.js +4 -6
- package/components/columnSelection/GridCellCheckboxRenderer.js +3 -3
- package/components/columnSelection/GridHeaderCheckbox.js +3 -3
- package/components/containers/GridFooterContainer.d.ts +1 -1
- package/components/containers/GridFooterContainer.js +10 -15
- package/components/containers/GridMainContainer.js +3 -5
- package/components/containers/GridOverlay.d.ts +1 -2
- package/components/containers/GridOverlay.js +7 -11
- package/components/containers/GridRoot.js +4 -5
- package/components/containers/GridRootStyles.d.ts +5 -1
- package/components/containers/GridRootStyles.js +7 -3
- package/components/containers/GridToolbarContainer.d.ts +1 -1
- package/components/containers/GridToolbarContainer.js +4 -6
- package/components/index.d.ts +1 -1
- package/components/index.js +1 -1
- package/components/menu/GridMenu.js +5 -7
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
- package/components/panel/GridColumnsPanel.js +16 -18
- package/components/panel/GridPanel.d.ts +6 -2
- package/components/panel/GridPanel.js +4 -0
- package/components/panel/GridPanelContent.d.ts +1 -1
- package/components/panel/GridPanelContent.js +4 -6
- package/components/panel/GridPanelFooter.d.ts +1 -1
- package/components/panel/GridPanelFooter.js +4 -6
- package/components/panel/GridPanelHeader.d.ts +1 -1
- package/components/panel/GridPanelHeader.js +4 -6
- package/components/panel/GridPanelWrapper.js +3 -5
- package/components/panel/GridPreferencesPanel.js +4 -4
- package/components/panel/filterPanel/GridFilterForm.js +50 -45
- package/components/panel/filterPanel/GridFilterInputBoolean.js +14 -11
- package/components/panel/filterPanel/GridFilterInputDate.js +4 -5
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -8
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +28 -20
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +3 -3
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +2 -8
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +53 -25
- package/components/panel/filterPanel/GridFilterInputValue.js +4 -5
- package/components/panel/filterPanel/GridFilterPanel.d.ts +5 -3
- package/components/panel/filterPanel/GridFilterPanel.js +35 -11
- package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -2
- package/components/panel/filterPanel/filterPanelUtils.js +3 -9
- package/components/toolbar/GridToolbarColumnsButton.js +4 -4
- package/components/toolbar/GridToolbarDensitySelector.js +9 -9
- package/components/toolbar/GridToolbarExportContainer.js +4 -4
- package/components/toolbar/GridToolbarFilterButton.js +9 -11
- package/components/toolbar/GridToolbarQuickFilter.js +8 -7
- package/components/virtualization/GridVirtualScroller.d.ts +1 -1
- package/components/virtualization/GridVirtualScroller.js +4 -6
- package/components/virtualization/GridVirtualScrollerContent.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollerContent.js +4 -4
- package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollerRenderZone.js +4 -6
- package/constants/defaultGridSlotsComponents.js +5 -54
- package/constants/localeTextConstants.js +1 -0
- package/hooks/core/useGridLocaleText.js +2 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +22 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +19 -26
- package/hooks/features/columns/useGridColumns.d.ts +1 -1
- package/hooks/features/columns/useGridColumns.js +5 -5
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/filter/useGridFilter.js +5 -5
- package/hooks/features/statePersistence/gridStatePersistenceInterface.d.ts +2 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +36 -19
- package/index.d.ts +3 -0
- package/index.js +5 -1
- package/internals/index.d.ts +4 -1
- package/internals/index.js +3 -2
- package/internals/utils/computeSlots.d.ts +6 -0
- package/internals/utils/computeSlots.js +17 -0
- package/internals/utils/index.d.ts +2 -0
- package/internals/utils/index.js +2 -0
- package/internals/utils/slotsMigration.d.ts +4 -0
- package/internals/utils/slotsMigration.js +13 -0
- package/legacy/DataGrid/DataGrid.js +10 -2
- package/legacy/DataGrid/useDataGridProps.js +21 -20
- package/legacy/colDef/gridSingleSelectColDef.js +13 -4
- package/legacy/components/GridColumnHeaders.js +106 -0
- package/legacy/components/GridFooter.js +2 -2
- package/legacy/components/GridHeader.js +2 -2
- package/legacy/components/GridRow.js +47 -31
- package/legacy/components/GridRowCount.js +4 -6
- package/legacy/components/GridScrollArea.js +4 -3
- package/legacy/components/GridSelectedRowCount.js +4 -6
- package/legacy/components/base/GridBody.js +43 -5
- package/legacy/components/base/GridFooterPlaceholder.js +2 -2
- package/legacy/components/base/GridOverlays.js +7 -7
- package/legacy/components/cell/GridActionsCell.js +4 -4
- package/legacy/components/cell/GridActionsCellItem.js +3 -3
- package/legacy/components/cell/GridBooleanCell.js +2 -2
- package/legacy/components/cell/GridCell.js +14 -12
- package/legacy/components/cell/GridEditBooleanCell.js +3 -3
- package/legacy/components/cell/GridEditInputCell.js +3 -6
- package/legacy/components/cell/GridEditSingleSelectCell.js +40 -23
- package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +4 -4
- package/legacy/components/columnHeaders/{GridColumnHeaders.js → GridBaseColumnHeaders.js} +14 -19
- package/legacy/components/columnHeaders/GridColumnHeaderFilterIconButton.js +6 -6
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +5 -5
- package/legacy/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
- package/legacy/components/columnHeaders/GridColumnHeaderSortIcon.js +7 -7
- package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +12 -17
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +6 -6
- package/legacy/components/columnHeaders/GridIconButtonContainer.js +4 -6
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +3 -3
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +3 -3
- package/legacy/components/containers/GridFooterContainer.js +10 -15
- package/legacy/components/containers/GridMainContainer.js +3 -5
- package/legacy/components/containers/GridOverlay.js +12 -17
- package/legacy/components/containers/GridRoot.js +5 -6
- package/legacy/components/containers/GridRootStyles.js +7 -3
- package/legacy/components/containers/GridToolbarContainer.js +4 -6
- package/legacy/components/index.js +1 -1
- package/legacy/components/menu/GridMenu.js +5 -7
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
- package/legacy/components/panel/GridColumnsPanel.js +16 -20
- package/legacy/components/panel/GridPanel.js +4 -0
- package/legacy/components/panel/GridPanelContent.js +4 -6
- package/legacy/components/panel/GridPanelFooter.js +4 -6
- package/legacy/components/panel/GridPanelHeader.js +4 -6
- package/legacy/components/panel/GridPanelWrapper.js +3 -5
- package/legacy/components/panel/GridPreferencesPanel.js +4 -4
- package/legacy/components/panel/filterPanel/GridFilterForm.js +50 -45
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +14 -11
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +4 -5
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +32 -26
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +3 -3
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +52 -27
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -5
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +36 -10
- package/legacy/components/panel/filterPanel/filterPanelUtils.js +3 -9
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +4 -4
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +9 -9
- package/legacy/components/toolbar/GridToolbarExportContainer.js +4 -4
- package/legacy/components/toolbar/GridToolbarFilterButton.js +9 -11
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +8 -7
- package/legacy/components/virtualization/GridVirtualScroller.js +4 -6
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +4 -4
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +4 -6
- package/legacy/constants/defaultGridSlotsComponents.js +5 -54
- package/legacy/constants/localeTextConstants.js +1 -0
- package/legacy/hooks/core/useGridLocaleText.js +2 -4
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +19 -26
- package/legacy/hooks/features/columns/useGridColumns.js +5 -5
- package/legacy/hooks/features/filter/useGridFilter.js +5 -5
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +34 -17
- package/legacy/index.js +5 -1
- package/legacy/internals/index.js +3 -2
- package/legacy/internals/utils/computeSlots.js +16 -0
- package/legacy/internals/utils/index.js +2 -0
- package/legacy/internals/utils/slotsMigration.js +14 -0
- package/legacy/locales/arSD.js +15 -19
- package/legacy/locales/beBY.js +1 -0
- package/legacy/locales/bgBG.js +1 -0
- package/legacy/locales/csCZ.js +25 -32
- package/legacy/locales/daDK.js +1 -0
- package/legacy/locales/deDE.js +1 -0
- package/legacy/locales/elGR.js +1 -0
- package/legacy/locales/esES.js +2 -1
- package/legacy/locales/faIR.js +1 -0
- package/legacy/locales/fiFI.js +1 -0
- package/legacy/locales/frFR.js +1 -0
- package/legacy/locales/heIL.js +1 -0
- package/legacy/locales/huHU.js +1 -0
- package/legacy/locales/itIT.js +1 -0
- package/legacy/locales/jaJP.js +1 -0
- package/legacy/locales/koKR.js +1 -0
- package/legacy/locales/nbNO.js +1 -0
- package/legacy/locales/nlNL.js +1 -0
- package/legacy/locales/plPL.js +1 -0
- package/legacy/locales/ptBR.js +1 -0
- package/legacy/locales/roRO.js +1 -0
- package/legacy/locales/ruRU.js +1 -0
- package/legacy/locales/skSK.js +1 -0
- package/legacy/locales/svSE.js +1 -0
- package/legacy/locales/trTR.js +1 -0
- package/legacy/locales/ukUA.js +1 -0
- package/legacy/locales/urPK.js +1 -0
- package/legacy/locales/viVN.js +1 -0
- package/legacy/locales/zhCN.js +1 -0
- package/legacy/locales/zhTW.js +1 -0
- package/legacy/material/components/MUISelectOption.js +14 -0
- package/legacy/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +1 -1
- package/legacy/{components → material}/icons/index.js +7 -1
- package/legacy/material/index.js +65 -0
- package/legacy/models/gridFilterItem.js +2 -0
- package/legacy/models/params/gridRowParams.js +4 -0
- package/locales/arSD.js +15 -19
- package/locales/beBY.js +1 -0
- package/locales/bgBG.js +1 -0
- package/locales/csCZ.js +24 -31
- package/locales/daDK.js +1 -0
- package/locales/deDE.js +1 -0
- package/locales/elGR.js +1 -0
- package/locales/esES.js +2 -1
- package/locales/faIR.js +1 -0
- package/locales/fiFI.js +1 -0
- package/locales/frFR.js +1 -0
- package/locales/heIL.js +1 -0
- package/locales/huHU.js +1 -0
- package/locales/itIT.js +1 -0
- package/locales/jaJP.js +1 -0
- package/locales/koKR.js +1 -0
- package/locales/nbNO.js +1 -0
- package/locales/nlNL.js +1 -0
- package/locales/plPL.js +1 -0
- package/locales/ptBR.js +1 -0
- package/locales/roRO.js +1 -0
- package/locales/ruRU.js +1 -0
- package/locales/skSK.js +1 -0
- package/locales/svSE.js +1 -0
- package/locales/trTR.js +1 -0
- package/locales/ukUA.js +1 -0
- package/locales/urPK.js +1 -0
- package/locales/viVN.js +1 -0
- package/locales/zhCN.js +1 -0
- package/locales/zhTW.js +1 -0
- package/material/components/MUISelectOption.d.ts +3 -0
- package/material/components/MUISelectOption.js +16 -0
- package/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +1 -1
- package/{components → material}/icons/index.d.ts +6 -0
- package/{components → material}/icons/index.js +7 -1
- package/material/index.d.ts +57 -0
- package/material/index.js +65 -0
- package/material/package.json +6 -0
- package/models/api/gridLocaleTextApi.d.ts +1 -0
- package/models/colDef/gridColDef.d.ts +19 -1
- package/models/gridExport.d.ts +4 -0
- package/models/gridFilterItem.d.ts +2 -0
- package/models/gridFilterItem.js +2 -0
- package/models/gridFilterModel.d.ts +2 -0
- package/models/gridFilterOperator.d.ts +2 -0
- package/models/gridIconSlotsComponent.d.ts +22 -2
- package/models/gridSlotsComponent.d.ts +18 -1
- package/models/gridSlotsComponentsProps.d.ts +103 -23
- package/models/params/gridRowParams.d.ts +6 -0
- package/models/params/gridRowParams.js +4 -0
- package/models/props/DataGridProps.d.ts +13 -2
- package/modern/DataGrid/DataGrid.js +10 -2
- package/modern/DataGrid/useDataGridProps.js +21 -17
- package/modern/colDef/gridSingleSelectColDef.js +13 -4
- package/modern/components/GridColumnHeaders.js +108 -0
- package/modern/components/GridFooter.js +1 -1
- package/modern/components/GridHeader.js +1 -1
- package/modern/components/GridRow.js +49 -28
- package/modern/components/GridRowCount.js +4 -6
- package/modern/components/GridScrollArea.js +4 -3
- package/modern/components/GridSelectedRowCount.js +4 -6
- package/modern/components/base/GridBody.js +43 -5
- package/modern/components/base/GridFooterPlaceholder.js +1 -1
- package/modern/components/base/GridOverlays.js +4 -4
- package/modern/components/cell/GridActionsCell.js +3 -3
- package/modern/components/cell/GridActionsCellItem.js +2 -2
- package/modern/components/cell/GridBooleanCell.js +1 -1
- package/modern/components/cell/GridCell.js +14 -12
- package/modern/components/cell/GridEditBooleanCell.js +2 -2
- package/modern/components/cell/GridEditInputCell.js +3 -6
- package/modern/components/cell/GridEditSingleSelectCell.js +30 -15
- package/modern/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/{components/columnHeaders/GridColumnHeaders.js → modern/components/columnHeaders/GridBaseColumnHeaders.js} +14 -20
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +5 -5
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +4 -4
- package/modern/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
- package/modern/components/columnHeaders/GridColumnHeaderSortIcon.js +6 -6
- package/modern/components/columnHeaders/GridColumnHeaderTitle.js +9 -13
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +6 -6
- package/modern/components/columnHeaders/GridIconButtonContainer.js +4 -6
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
- package/modern/components/columnSelection/GridHeaderCheckbox.js +2 -2
- package/modern/components/containers/GridFooterContainer.js +10 -15
- package/modern/components/containers/GridMainContainer.js +3 -5
- package/modern/components/containers/GridOverlay.js +7 -11
- package/modern/components/containers/GridRoot.js +4 -5
- package/modern/components/containers/GridRootStyles.js +7 -3
- package/modern/components/containers/GridToolbarContainer.js +4 -6
- package/modern/components/index.js +1 -1
- package/modern/components/menu/GridMenu.js +4 -6
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
- package/modern/components/panel/GridColumnsPanel.js +14 -16
- package/modern/components/panel/GridPanel.js +4 -0
- package/modern/components/panel/GridPanelContent.js +4 -6
- package/modern/components/panel/GridPanelFooter.js +4 -6
- package/modern/components/panel/GridPanelHeader.js +4 -6
- package/modern/components/panel/GridPanelWrapper.js +3 -5
- package/modern/components/panel/GridPreferencesPanel.js +3 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +49 -44
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +13 -10
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +3 -4
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +24 -17
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +52 -24
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +3 -4
- package/modern/components/panel/filterPanel/GridFilterPanel.js +34 -10
- package/modern/components/panel/filterPanel/filterPanelUtils.js +3 -9
- package/modern/components/toolbar/GridToolbarColumnsButton.js +3 -3
- package/modern/components/toolbar/GridToolbarDensitySelector.js +8 -8
- package/modern/components/toolbar/GridToolbarExportContainer.js +3 -3
- package/modern/components/toolbar/GridToolbarFilterButton.js +8 -10
- package/modern/components/toolbar/GridToolbarQuickFilter.js +7 -6
- package/modern/components/virtualization/GridVirtualScroller.js +4 -6
- package/modern/components/virtualization/GridVirtualScrollerContent.js +4 -4
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +4 -6
- package/modern/constants/defaultGridSlotsComponents.js +5 -54
- package/modern/constants/localeTextConstants.js +1 -0
- package/modern/hooks/core/useGridLocaleText.js +2 -4
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +19 -26
- package/modern/hooks/features/columns/useGridColumns.js +3 -3
- package/modern/hooks/features/filter/useGridFilter.js +3 -3
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +34 -18
- package/modern/index.js +5 -1
- package/modern/internals/index.js +3 -2
- package/modern/internals/utils/computeSlots.js +17 -0
- package/modern/internals/utils/index.js +2 -0
- package/modern/internals/utils/slotsMigration.js +13 -0
- package/modern/locales/arSD.js +15 -19
- package/modern/locales/beBY.js +1 -0
- package/modern/locales/bgBG.js +1 -0
- package/modern/locales/csCZ.js +24 -31
- package/modern/locales/daDK.js +1 -0
- package/modern/locales/deDE.js +1 -0
- package/modern/locales/elGR.js +1 -0
- package/modern/locales/esES.js +2 -1
- package/modern/locales/faIR.js +1 -0
- package/modern/locales/fiFI.js +1 -0
- package/modern/locales/frFR.js +1 -0
- package/modern/locales/heIL.js +1 -0
- package/modern/locales/huHU.js +1 -0
- package/modern/locales/itIT.js +1 -0
- package/modern/locales/jaJP.js +1 -0
- package/modern/locales/koKR.js +1 -0
- package/modern/locales/nbNO.js +1 -0
- package/modern/locales/nlNL.js +1 -0
- package/modern/locales/plPL.js +1 -0
- package/modern/locales/ptBR.js +1 -0
- package/modern/locales/roRO.js +1 -0
- package/modern/locales/ruRU.js +1 -0
- package/modern/locales/skSK.js +1 -0
- package/modern/locales/svSE.js +1 -0
- package/modern/locales/trTR.js +1 -0
- package/modern/locales/ukUA.js +1 -0
- package/modern/locales/urPK.js +1 -0
- package/modern/locales/viVN.js +1 -0
- package/modern/locales/zhCN.js +1 -0
- package/modern/locales/zhTW.js +1 -0
- package/modern/material/components/MUISelectOption.js +16 -0
- package/modern/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +1 -1
- package/modern/{components → material}/icons/index.js +7 -1
- package/modern/material/index.js +65 -0
- package/modern/models/gridFilterItem.js +2 -0
- package/modern/models/params/gridRowParams.js +4 -0
- package/node/DataGrid/DataGrid.js +10 -2
- package/node/DataGrid/useDataGridProps.js +21 -17
- package/node/colDef/gridSingleSelectColDef.js +12 -3
- package/node/components/GridColumnHeaders.js +116 -0
- package/node/components/GridFooter.js +1 -1
- package/node/components/GridHeader.js +1 -1
- package/node/components/GridRow.js +49 -28
- package/node/components/GridRowCount.js +5 -7
- package/node/components/GridScrollArea.js +5 -4
- package/node/components/GridSelectedRowCount.js +5 -7
- package/node/components/base/GridBody.js +43 -5
- package/node/components/base/GridFooterPlaceholder.js +1 -1
- package/node/components/base/GridOverlays.js +6 -6
- package/node/components/cell/GridActionsCell.js +3 -3
- package/node/components/cell/GridActionsCellItem.js +2 -2
- package/node/components/cell/GridBooleanCell.js +1 -1
- package/node/components/cell/GridCell.js +14 -11
- package/node/components/cell/GridEditBooleanCell.js +2 -2
- package/node/components/cell/GridEditInputCell.js +3 -6
- package/node/components/cell/GridEditSingleSelectCell.js +28 -14
- package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/node/components/columnHeaders/{GridColumnHeaders.js → GridBaseColumnHeaders.js} +17 -23
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +5 -5
- package/node/components/columnHeaders/GridColumnHeaderItem.js +4 -4
- package/node/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
- package/node/components/columnHeaders/GridColumnHeaderSortIcon.js +6 -6
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +10 -14
- package/node/components/columnHeaders/GridColumnHeadersInner.js +7 -7
- package/node/components/columnHeaders/GridIconButtonContainer.js +5 -7
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
- package/node/components/columnSelection/GridHeaderCheckbox.js +2 -2
- package/node/components/containers/GridFooterContainer.js +11 -16
- package/node/components/containers/GridMainContainer.js +4 -6
- package/node/components/containers/GridOverlay.js +8 -12
- package/node/components/containers/GridRoot.js +4 -5
- package/node/components/containers/GridRootStyles.js +7 -3
- package/node/components/containers/GridToolbarContainer.js +5 -7
- package/node/components/index.js +1 -1
- package/node/components/menu/GridMenu.js +4 -6
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
- package/node/components/panel/GridColumnsPanel.js +14 -16
- package/node/components/panel/GridPanel.js +4 -0
- package/node/components/panel/GridPanelContent.js +5 -7
- package/node/components/panel/GridPanelFooter.js +5 -7
- package/node/components/panel/GridPanelHeader.js +5 -7
- package/node/components/panel/GridPanelWrapper.js +3 -5
- package/node/components/panel/GridPreferencesPanel.js +3 -3
- package/node/components/panel/filterPanel/GridFilterForm.js +48 -44
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +13 -10
- package/node/components/panel/filterPanel/GridFilterInputDate.js +3 -4
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +23 -16
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +50 -23
- package/node/components/panel/filterPanel/GridFilterInputValue.js +3 -4
- package/node/components/panel/filterPanel/GridFilterPanel.js +34 -10
- package/node/components/panel/filterPanel/filterPanelUtils.js +3 -10
- package/node/components/toolbar/GridToolbarColumnsButton.js +3 -3
- package/node/components/toolbar/GridToolbarDensitySelector.js +8 -8
- package/node/components/toolbar/GridToolbarExportContainer.js +3 -3
- package/node/components/toolbar/GridToolbarFilterButton.js +8 -10
- package/node/components/toolbar/GridToolbarQuickFilter.js +7 -6
- package/node/components/virtualization/GridVirtualScroller.js +5 -7
- package/node/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +5 -7
- package/node/constants/defaultGridSlotsComponents.js +4 -53
- package/node/constants/localeTextConstants.js +1 -0
- package/node/hooks/core/useGridLocaleText.js +2 -4
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +21 -28
- package/node/hooks/features/columns/useGridColumns.js +3 -3
- package/node/hooks/features/filter/useGridFilter.js +3 -3
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +33 -16
- package/node/index.js +9 -1
- package/node/internals/index.js +94 -4
- package/node/internals/utils/computeSlots.js +23 -0
- package/node/internals/utils/index.js +27 -0
- package/node/internals/utils/slotsMigration.js +21 -0
- package/node/locales/arSD.js +15 -19
- package/node/locales/beBY.js +1 -0
- package/node/locales/bgBG.js +1 -0
- package/node/locales/csCZ.js +24 -31
- package/node/locales/daDK.js +1 -0
- package/node/locales/deDE.js +1 -0
- package/node/locales/elGR.js +1 -0
- package/node/locales/esES.js +2 -1
- package/node/locales/faIR.js +1 -0
- package/node/locales/fiFI.js +1 -0
- package/node/locales/frFR.js +1 -0
- package/node/locales/heIL.js +1 -0
- package/node/locales/huHU.js +1 -0
- package/node/locales/itIT.js +1 -0
- package/node/locales/jaJP.js +1 -0
- package/node/locales/koKR.js +1 -0
- package/node/locales/nbNO.js +1 -0
- package/node/locales/nlNL.js +1 -0
- package/node/locales/plPL.js +1 -0
- package/node/locales/ptBR.js +1 -0
- package/node/locales/roRO.js +1 -0
- package/node/locales/ruRU.js +1 -0
- package/node/locales/skSK.js +1 -0
- package/node/locales/svSE.js +1 -0
- package/node/locales/trTR.js +1 -0
- package/node/locales/ukUA.js +1 -0
- package/node/locales/urPK.js +1 -0
- package/node/locales/viVN.js +1 -0
- package/node/locales/zhCN.js +1 -0
- package/node/locales/zhTW.js +1 -0
- package/node/{components/DataGridColumnHeaders.js → material/components/MUISelectOption.js} +13 -35
- package/node/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +1 -1
- package/node/{components → material}/icons/index.js +10 -2
- package/node/material/index.js +73 -0
- package/node/models/gridFilterItem.js +2 -0
- package/node/models/params/gridRowParams.js +4 -0
- package/package.json +1 -1
- package/components/DataGridColumnHeaders.d.ts +0 -6
- package/components/DataGridColumnHeaders.js +0 -38
- package/components/columnHeaders/GridColumnHeaders.d.ts +0 -7
- package/legacy/components/DataGridColumnHeaders.js +0 -36
- package/modern/components/DataGridColumnHeaders.js +0 -38
- /package/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.d.ts +0 -0
package/models/gridFilterItem.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { GridFilterItem, GridLogicOperator } from './gridFilterItem';
|
|
2
2
|
/**
|
|
3
3
|
* Model describing the filters to apply to the grid.
|
|
4
|
+
* @demos
|
|
5
|
+
* - [Pass filters to the grid](/x/react-data-grid/filtering/#pass-filters-to-the-data-grid)
|
|
4
6
|
*/
|
|
5
7
|
export interface GridFilterModel {
|
|
6
8
|
/**
|
|
@@ -5,6 +5,8 @@ import type { GridColDef } from './colDef/gridColDef';
|
|
|
5
5
|
import type { GridValidRowModel } from './gridRows';
|
|
6
6
|
/**
|
|
7
7
|
* Filter operator definition interface.
|
|
8
|
+
* @demos
|
|
9
|
+
* - [Custom filter operator](/x/react-data-grid/filtering/#create-a-custom-operator)
|
|
8
10
|
*/
|
|
9
11
|
export interface GridFilterOperator<R extends GridValidRowModel = any, V = any, F = V> {
|
|
10
12
|
/**
|
|
@@ -110,10 +110,20 @@ export interface GridIconSlotsComponent {
|
|
|
110
110
|
*/
|
|
111
111
|
DetailPanelCollapseIcon: React.JSXElementConstructor<any>;
|
|
112
112
|
/**
|
|
113
|
-
* Icon displayed for deleting the filter from filter
|
|
114
|
-
* @default
|
|
113
|
+
* Icon displayed for deleting the filter from filter panel.
|
|
114
|
+
* @default GridAddIcon
|
|
115
|
+
*/
|
|
116
|
+
FilterPanelAddIcon: React.JSXElementConstructor<any>;
|
|
117
|
+
/**
|
|
118
|
+
* Icon displayed for deleting the filter from filter panel.
|
|
119
|
+
* @default GridDeleteIcon
|
|
115
120
|
*/
|
|
116
121
|
FilterPanelDeleteIcon: React.JSXElementConstructor<any>;
|
|
122
|
+
/**
|
|
123
|
+
* Icon displayed for deleting all the active filters from filter panel.
|
|
124
|
+
* @default GridDeleteForeverIcon
|
|
125
|
+
*/
|
|
126
|
+
FilterPanelRemoveAllIcon: React.JSXElementConstructor<any>;
|
|
117
127
|
/**
|
|
118
128
|
* Icon displayed on the `reorder` column type to reorder a row.
|
|
119
129
|
* @default GridDragIcon
|
|
@@ -159,4 +169,14 @@ export interface GridIconSlotsComponent {
|
|
|
159
169
|
* @default GridClearIcon
|
|
160
170
|
*/
|
|
161
171
|
ColumnMenuClearIcon: React.JSXElementConstructor<any>;
|
|
172
|
+
/**
|
|
173
|
+
* Icon displayed on the input while processing.
|
|
174
|
+
* @default GridLoadIcon
|
|
175
|
+
*/
|
|
176
|
+
LoadIcon: React.JSXElementConstructor<any>;
|
|
177
|
+
/**
|
|
178
|
+
* Icon displayed on the column reorder button.
|
|
179
|
+
* @default GridDragIcon
|
|
180
|
+
*/
|
|
181
|
+
ColumnReorderIcon: React.JSXElementConstructor<any>;
|
|
162
182
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { UncapitalizeObjectKeys } from '../internals/utils';
|
|
2
3
|
import { GridIconSlotsComponent } from './gridIconSlotsComponent';
|
|
3
4
|
/**
|
|
4
5
|
* Grid components React prop interface containing all the overridable components.
|
|
5
|
-
* TODO: Differentiate community and pro interface
|
|
6
6
|
*/
|
|
7
7
|
export interface GridSlotsComponent extends GridIconSlotsComponent {
|
|
8
8
|
/**
|
|
@@ -50,6 +50,16 @@ export interface GridSlotsComponent extends GridIconSlotsComponent {
|
|
|
50
50
|
* @default Popper
|
|
51
51
|
*/
|
|
52
52
|
BasePopper: React.JSXElementConstructor<any>;
|
|
53
|
+
/**
|
|
54
|
+
* The custom InputLabel component used in the grid.
|
|
55
|
+
* @default InputLabel
|
|
56
|
+
*/
|
|
57
|
+
BaseInputLabel: React.JSXElementConstructor<any>;
|
|
58
|
+
/**
|
|
59
|
+
* The custom SelectOption component used in the grid.
|
|
60
|
+
* @default MenuItem
|
|
61
|
+
*/
|
|
62
|
+
BaseSelectOption: React.JSXElementConstructor<any>;
|
|
53
63
|
/**
|
|
54
64
|
* Component rendered for each cell.
|
|
55
65
|
* @default GridCell
|
|
@@ -70,6 +80,11 @@ export interface GridSlotsComponent extends GridIconSlotsComponent {
|
|
|
70
80
|
* @default GridColumnMenu
|
|
71
81
|
*/
|
|
72
82
|
ColumnMenu: React.JSXElementConstructor<any>;
|
|
83
|
+
/**
|
|
84
|
+
* Component responsible for rendering the column headers.
|
|
85
|
+
* @default DataGridColumnHeaders
|
|
86
|
+
*/
|
|
87
|
+
ColumnHeaders: React.JSXElementConstructor<any>;
|
|
73
88
|
/**
|
|
74
89
|
* Footer component rendered at the bottom of the grid viewport.
|
|
75
90
|
* @default GridFooter
|
|
@@ -126,3 +141,5 @@ export interface GridSlotsComponent extends GridIconSlotsComponent {
|
|
|
126
141
|
*/
|
|
127
142
|
Row: React.JSXElementConstructor<any>;
|
|
128
143
|
}
|
|
144
|
+
export interface UncapitalizedGridSlotsComponent extends UncapitalizeObjectKeys<GridSlotsComponent> {
|
|
145
|
+
}
|
|
@@ -1,28 +1,108 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CheckboxProps } from '@mui/material/Checkbox';
|
|
3
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
|
4
|
+
import { FormControlProps } from '@mui/material/FormControl';
|
|
5
|
+
import { SelectProps } from '@mui/material/Select';
|
|
6
|
+
import { SwitchProps } from '@mui/material/Switch';
|
|
7
|
+
import { ButtonProps } from '@mui/material/Button';
|
|
8
|
+
import { IconButtonProps } from '@mui/material/IconButton';
|
|
9
|
+
import { TooltipProps } from '@mui/material/Tooltip';
|
|
10
|
+
import type { InputLabelProps } from '@mui/material/InputLabel';
|
|
11
|
+
import { PopperProps } from '@mui/material/Popper';
|
|
12
|
+
import { TablePaginationProps } from '@mui/material/TablePagination';
|
|
13
|
+
import { GridToolbarProps } from '../components/toolbar/GridToolbar';
|
|
14
|
+
import { ColumnHeaderFilterIconButtonProps } from '../components/columnHeaders/GridColumnHeaderFilterIconButton';
|
|
15
|
+
import { GridColumnMenuProps } from '../components/menu/columnMenu/GridColumnMenuProps';
|
|
16
|
+
import { GridColumnsPanelProps } from '../components/panel/GridColumnsPanel';
|
|
17
|
+
import { GridFilterPanelProps } from '../components/panel/filterPanel/GridFilterPanel';
|
|
18
|
+
import { GridFooterContainerProps } from '../components/containers/GridFooterContainer';
|
|
19
|
+
import { GridOverlayProps } from '../components/containers/GridOverlay';
|
|
20
|
+
import { GridPanelProps } from '../components/panel/GridPanel';
|
|
21
|
+
import type { GridRowProps } from '../components/GridRow';
|
|
22
|
+
import type { GridCellProps } from '../components/cell/GridCell';
|
|
23
|
+
export interface BaseCheckboxPropsOverrides {
|
|
24
|
+
}
|
|
25
|
+
export interface BaseTextFieldPropsOverrides {
|
|
26
|
+
}
|
|
27
|
+
export interface BaseFormControlPropsOverrides {
|
|
28
|
+
}
|
|
29
|
+
export interface BaseSelectPropsOverrides {
|
|
30
|
+
}
|
|
31
|
+
export interface BaseSwitchPropsOverrides {
|
|
32
|
+
}
|
|
33
|
+
export interface BaseButtonPropsOverrides {
|
|
34
|
+
}
|
|
35
|
+
export interface BaseIconButtonPropsOverrides {
|
|
36
|
+
}
|
|
37
|
+
export interface BaseTooltipPropsOverrides {
|
|
38
|
+
}
|
|
39
|
+
export interface BasePopperPropsOverrides {
|
|
40
|
+
}
|
|
41
|
+
export interface BaseInputLabelPropsOverrides {
|
|
42
|
+
}
|
|
43
|
+
export interface BaseSelectOptionPropsOverrides {
|
|
44
|
+
}
|
|
45
|
+
export interface CellPropsOverrides {
|
|
46
|
+
}
|
|
47
|
+
export interface ToolbarPropsOverrides {
|
|
48
|
+
}
|
|
49
|
+
export interface ColumnHeaderFilterIconButtonPropsOverrides {
|
|
50
|
+
}
|
|
51
|
+
export interface ColumnMenuPropsOverrides {
|
|
52
|
+
}
|
|
53
|
+
export interface ColumnsPanelPropsOverrides {
|
|
54
|
+
}
|
|
55
|
+
export interface FilterPanelPropsOverrides {
|
|
56
|
+
}
|
|
57
|
+
export interface FooterPropsOverrides {
|
|
58
|
+
}
|
|
59
|
+
export interface PaginationPropsOverrides {
|
|
60
|
+
}
|
|
61
|
+
export interface LoadingOverlayPropsOverrides {
|
|
62
|
+
}
|
|
63
|
+
export interface NoResultsOverlayPropsOverrides {
|
|
64
|
+
}
|
|
65
|
+
export interface NoRowsOverlayPropsOverrides {
|
|
66
|
+
}
|
|
67
|
+
export interface PanelPropsOverrides {
|
|
68
|
+
}
|
|
69
|
+
export interface PreferencesPanelPropsOverrides {
|
|
70
|
+
}
|
|
71
|
+
export interface RowPropsOverrides {
|
|
72
|
+
}
|
|
73
|
+
type SlotProps<Props, Overrides> = Partial<Props & Overrides>;
|
|
1
74
|
/**
|
|
2
75
|
* Overrideable components props dynamically passed to the component at rendering.
|
|
3
76
|
*/
|
|
4
77
|
export interface GridSlotsComponentsProps {
|
|
5
|
-
baseCheckbox?:
|
|
6
|
-
baseTextField?:
|
|
7
|
-
baseFormControl?:
|
|
8
|
-
baseSelect?:
|
|
9
|
-
baseSwitch?:
|
|
10
|
-
baseButton?:
|
|
11
|
-
baseIconButton?:
|
|
12
|
-
basePopper?:
|
|
13
|
-
baseTooltip?:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
78
|
+
baseCheckbox?: SlotProps<CheckboxProps, BaseCheckboxPropsOverrides>;
|
|
79
|
+
baseTextField?: SlotProps<TextFieldProps, BaseTextFieldPropsOverrides>;
|
|
80
|
+
baseFormControl?: SlotProps<FormControlProps, BaseFormControlPropsOverrides>;
|
|
81
|
+
baseSelect?: SlotProps<SelectProps, BaseSelectPropsOverrides>;
|
|
82
|
+
baseSwitch?: SlotProps<SwitchProps, BaseSwitchPropsOverrides>;
|
|
83
|
+
baseButton?: SlotProps<ButtonProps, BaseButtonPropsOverrides>;
|
|
84
|
+
baseIconButton?: SlotProps<IconButtonProps, BaseIconButtonPropsOverrides>;
|
|
85
|
+
basePopper?: SlotProps<PopperProps, BasePopperPropsOverrides>;
|
|
86
|
+
baseTooltip?: SlotProps<TooltipProps, BaseTooltipPropsOverrides>;
|
|
87
|
+
baseInputLabel?: SlotProps<InputLabelProps, BaseInputLabelPropsOverrides>;
|
|
88
|
+
baseSelectOption?: SlotProps<{
|
|
89
|
+
native: boolean;
|
|
90
|
+
value: any;
|
|
91
|
+
children?: React.ReactNode;
|
|
92
|
+
}, BaseSelectOptionPropsOverrides>;
|
|
93
|
+
cell?: SlotProps<GridCellProps, CellPropsOverrides>;
|
|
94
|
+
columnHeaderFilterIconButton?: SlotProps<ColumnHeaderFilterIconButtonProps, ColumnHeaderFilterIconButtonPropsOverrides>;
|
|
95
|
+
columnMenu?: SlotProps<GridColumnMenuProps, ColumnMenuPropsOverrides>;
|
|
96
|
+
columnsPanel?: SlotProps<GridColumnsPanelProps, ColumnsPanelPropsOverrides>;
|
|
97
|
+
filterPanel?: SlotProps<GridFilterPanelProps, FilterPanelPropsOverrides>;
|
|
98
|
+
footer?: SlotProps<GridFooterContainerProps, FooterPropsOverrides>;
|
|
99
|
+
loadingOverlay?: SlotProps<GridOverlayProps, LoadingOverlayPropsOverrides>;
|
|
100
|
+
noResultsOverlay?: SlotProps<GridOverlayProps, NoResultsOverlayPropsOverrides>;
|
|
101
|
+
noRowsOverlay?: SlotProps<GridOverlayProps, NoRowsOverlayPropsOverrides>;
|
|
102
|
+
pagination?: SlotProps<TablePaginationProps, PaginationPropsOverrides>;
|
|
103
|
+
panel?: SlotProps<GridPanelProps, PanelPropsOverrides>;
|
|
104
|
+
preferencesPanel?: SlotProps<React.HTMLAttributes<HTMLDivElement>, PreferencesPanelPropsOverrides>;
|
|
105
|
+
row?: SlotProps<GridRowProps, RowPropsOverrides>;
|
|
106
|
+
toolbar?: SlotProps<GridToolbarProps, ToolbarPropsOverrides>;
|
|
28
107
|
}
|
|
108
|
+
export {};
|
|
@@ -2,6 +2,8 @@ import { GridValidRowModel, GridRowEntry, GridRowId } from '../gridRows';
|
|
|
2
2
|
import type { GridColDef } from '../colDef/gridColDef';
|
|
3
3
|
/**
|
|
4
4
|
* Object passed as parameter in the row callbacks.
|
|
5
|
+
* @demos
|
|
6
|
+
* - [Master detail](/x/react-data-grid/master-detail/)
|
|
5
7
|
*/
|
|
6
8
|
export interface GridRowParams<R extends GridValidRowModel = any> {
|
|
7
9
|
/**
|
|
@@ -34,6 +36,8 @@ interface GridRowVisibilityParams {
|
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
38
|
* Object passed as parameter in the row `getRowClassName` callback prop.
|
|
39
|
+
* @demos
|
|
40
|
+
* - [Styling rows](/x/react-data-grid/style/#styling-rows)
|
|
37
41
|
*/
|
|
38
42
|
export interface GridRowClassNameParams<R extends GridValidRowModel = any> extends GridRowParams<R>, GridRowVisibilityParams {
|
|
39
43
|
}
|
|
@@ -92,6 +96,8 @@ export interface GridRowEditStopParams<R extends GridValidRowModel = any> extend
|
|
|
92
96
|
}
|
|
93
97
|
/**
|
|
94
98
|
* Object passed as parameter in the row `getRowSpacing` callback prop.
|
|
99
|
+
* @demos
|
|
100
|
+
* - [Row spacing](/x/react-data-grid/row-height/#row-spacing)
|
|
95
101
|
*/
|
|
96
102
|
export interface GridRowSpacingParams extends GridRowEntry, GridRowVisibilityParams {
|
|
97
103
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Object passed as parameter in the row callbacks.
|
|
3
|
+
* @demos
|
|
4
|
+
* - [Master detail](/x/react-data-grid/master-detail/)
|
|
3
5
|
*/
|
|
4
6
|
/**
|
|
5
7
|
* Object passed as parameter in the row `getRowClassName` callback prop.
|
|
8
|
+
* @demos
|
|
9
|
+
* - [Styling rows](/x/react-data-grid/style/#styling-rows)
|
|
6
10
|
*/
|
|
7
11
|
/**
|
|
8
12
|
* Object passed as parameter in the row `getRowHeight` callback prop.
|
|
@@ -24,6 +24,7 @@ import { GridColumnVisibilityModel } from '../../hooks/features/columns/gridColu
|
|
|
24
24
|
import { GridCellModesModel, GridRowModesModel } from '../api/gridEditingApi';
|
|
25
25
|
import { GridColumnGroupingModel } from '../gridColumnGrouping';
|
|
26
26
|
import { GridPaginationModel } from '../gridPaginationProps';
|
|
27
|
+
import { UncapitalizeObjectKeys } from '../../internals/utils';
|
|
27
28
|
export interface GridExperimentalFeatures {
|
|
28
29
|
/**
|
|
29
30
|
* Enables the column grouping.
|
|
@@ -44,7 +45,7 @@ export type DataGridProps<R extends GridValidRowModel = any> = Omit<Partial<Data
|
|
|
44
45
|
/**
|
|
45
46
|
* The props of the `DataGrid` component after the pre-processing phase.
|
|
46
47
|
*/
|
|
47
|
-
export interface DataGridProcessedProps<R extends GridValidRowModel = any> extends DataGridPropsWithDefaultValues, DataGridPropsWithComplexDefaultValueAfterProcessing, DataGridPropsWithoutDefaultValue<R> {
|
|
48
|
+
export interface DataGridProcessedProps<R extends GridValidRowModel = any> extends DataGridPropsWithDefaultValues, DataGridPropsWithComplexDefaultValueAfterProcessing, Omit<DataGridPropsWithoutDefaultValue<R>, 'componentsProps'> {
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
50
51
|
* The props of the `DataGrid` component after the pre-processing phase that the user should not be able to override.
|
|
@@ -55,7 +56,7 @@ export type DataGridForcedPropsKey = 'checkboxSelectionVisibleOnly' | 'disableMu
|
|
|
55
56
|
* The `DataGrid` options with a default value that must be merged with the value given through props.
|
|
56
57
|
*/
|
|
57
58
|
export interface DataGridPropsWithComplexDefaultValueAfterProcessing {
|
|
58
|
-
|
|
59
|
+
slots: UncapitalizeObjectKeys<GridSlotsComponent>;
|
|
59
60
|
localeText: GridLocaleText;
|
|
60
61
|
}
|
|
61
62
|
/**
|
|
@@ -64,8 +65,13 @@ export interface DataGridPropsWithComplexDefaultValueAfterProcessing {
|
|
|
64
65
|
export interface DataGridPropsWithComplexDefaultValueBeforeProcessing {
|
|
65
66
|
/**
|
|
66
67
|
* Overrideable components.
|
|
68
|
+
* @deprecated Use `slots` instead.
|
|
67
69
|
*/
|
|
68
70
|
components?: Partial<GridSlotsComponent>;
|
|
71
|
+
/**
|
|
72
|
+
* Overrideable components.
|
|
73
|
+
*/
|
|
74
|
+
slots?: UncapitalizeObjectKeys<Partial<GridSlotsComponent>>;
|
|
69
75
|
/**
|
|
70
76
|
* Set the locale text of the grid.
|
|
71
77
|
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/HEAD/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
|
|
@@ -644,6 +650,11 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
644
650
|
/**
|
|
645
651
|
* Overrideable components props dynamically passed to the component at rendering.
|
|
646
652
|
*/
|
|
653
|
+
slotProps?: GridSlotsComponentsProps;
|
|
654
|
+
/**
|
|
655
|
+
* Overrideable components props dynamically passed to the component at rendering.
|
|
656
|
+
* @deprecated Use the `slotProps` prop instead.
|
|
657
|
+
*/
|
|
647
658
|
componentsProps?: GridSlotsComponentsProps;
|
|
648
659
|
/**
|
|
649
660
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
@@ -6,7 +6,6 @@ import { GridContextProvider } from '../context/GridContextProvider';
|
|
|
6
6
|
import { useDataGridComponent } from './useDataGridComponent';
|
|
7
7
|
import { useDataGridProps } from './useDataGridProps';
|
|
8
8
|
import { DataGridVirtualScroller } from '../components/DataGridVirtualScroller';
|
|
9
|
-
import { DataGridColumnHeaders } from '../components/DataGridColumnHeaders';
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
11
|
const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref) {
|
|
@@ -21,7 +20,6 @@ const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref
|
|
|
21
20
|
sx: props.sx,
|
|
22
21
|
ref: ref,
|
|
23
22
|
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
|
|
24
|
-
ColumnHeadersComponent: DataGridColumnHeaders,
|
|
25
23
|
VirtualScrollerComponent: DataGridVirtualScroller
|
|
26
24
|
}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
27
25
|
})
|
|
@@ -103,10 +101,12 @@ DataGridRaw.propTypes = {
|
|
|
103
101
|
columnVisibilityModel: PropTypes.object,
|
|
104
102
|
/**
|
|
105
103
|
* Overrideable components.
|
|
104
|
+
* @deprecated Use `slots` instead.
|
|
106
105
|
*/
|
|
107
106
|
components: PropTypes.object,
|
|
108
107
|
/**
|
|
109
108
|
* Overrideable components props dynamically passed to the component at rendering.
|
|
109
|
+
* @deprecated Use the `slotProps` prop instead.
|
|
110
110
|
*/
|
|
111
111
|
componentsProps: PropTypes.object,
|
|
112
112
|
/**
|
|
@@ -581,6 +581,14 @@ DataGridRaw.propTypes = {
|
|
|
581
581
|
* @default false
|
|
582
582
|
*/
|
|
583
583
|
showColumnVerticalBorder: PropTypes.bool,
|
|
584
|
+
/**
|
|
585
|
+
* Overrideable components props dynamically passed to the component at rendering.
|
|
586
|
+
*/
|
|
587
|
+
slotProps: PropTypes.object,
|
|
588
|
+
/**
|
|
589
|
+
* Overrideable components.
|
|
590
|
+
*/
|
|
591
|
+
slots: PropTypes.object,
|
|
584
592
|
/**
|
|
585
593
|
* Sorting can be processed on the server or client-side.
|
|
586
594
|
* Set it to 'client' if you would like to handle sorting on the client-side.
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["components", "componentsProps"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
6
|
import { GRID_DEFAULT_LOCALE_TEXT } from '../constants';
|
|
5
7
|
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '../constants/defaultGridSlotsComponents';
|
|
6
8
|
import { GridEditModes } from '../models';
|
|
9
|
+
import { computeSlots, uncapitalizeObjectKeys } from '../internals/utils';
|
|
7
10
|
const DATA_GRID_FORCED_PROPS = {
|
|
8
11
|
disableMultipleColumnsFiltering: true,
|
|
9
12
|
disableMultipleColumnsSorting: true,
|
|
@@ -65,25 +68,26 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
65
68
|
keepNonExistentRowsSelected: false,
|
|
66
69
|
keepColumnPositionIfDraggedOutside: false
|
|
67
70
|
};
|
|
71
|
+
const defaultSlots = uncapitalizeObjectKeys(DATA_GRID_DEFAULT_SLOTS_COMPONENTS);
|
|
68
72
|
export const useDataGridProps = inProps => {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
const _useThemeProps = useThemeProps({
|
|
74
|
+
props: inProps,
|
|
75
|
+
name: 'MuiDataGrid'
|
|
76
|
+
}),
|
|
77
|
+
{
|
|
78
|
+
components,
|
|
79
|
+
componentsProps
|
|
80
|
+
} = _useThemeProps,
|
|
81
|
+
themedProps = _objectWithoutPropertiesLoose(_useThemeProps, _excluded);
|
|
73
82
|
const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const mergedComponents = {};
|
|
80
|
-
Object.entries(DATA_GRID_DEFAULT_SLOTS_COMPONENTS).forEach(([key, defaultComponent]) => {
|
|
81
|
-
mergedComponents[key] = overrides[key] === undefined ? defaultComponent : overrides[key];
|
|
82
|
-
});
|
|
83
|
-
return mergedComponents;
|
|
84
|
-
}, [themedProps.components]);
|
|
83
|
+
const slots = React.useMemo(() => computeSlots({
|
|
84
|
+
defaultSlots,
|
|
85
|
+
slots: themedProps.slots,
|
|
86
|
+
components
|
|
87
|
+
}), [components, themedProps.slots]);
|
|
85
88
|
return React.useMemo(() => _extends({}, DATA_GRID_PROPS_DEFAULT_VALUES, themedProps, {
|
|
86
89
|
localeText,
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
slots,
|
|
91
|
+
slotProps: themedProps.slotProps ?? componentsProps
|
|
92
|
+
}, DATA_GRID_FORCED_PROPS), [themedProps, localeText, slots, componentsProps]);
|
|
89
93
|
};
|
|
@@ -2,12 +2,21 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import { GRID_STRING_COL_DEF } from './gridStringColDef';
|
|
3
3
|
import { renderEditSingleSelectCell } from '../components/cell/GridEditSingleSelectCell';
|
|
4
4
|
import { getGridSingleSelectOperators } from './gridSingleSelectOperators';
|
|
5
|
-
import {
|
|
5
|
+
import { isSingleSelectColDef } from '../components/panel/filterPanel/filterPanelUtils';
|
|
6
|
+
import { isObject } from '../utils/utils';
|
|
6
7
|
const isArrayOfObjects = options => {
|
|
7
8
|
return typeof options[0] === 'object';
|
|
8
9
|
};
|
|
10
|
+
const defaultGetOptionValue = value => {
|
|
11
|
+
return isObject(value) ? value.value : value;
|
|
12
|
+
};
|
|
13
|
+
const defaultGetOptionLabel = value => {
|
|
14
|
+
return isObject(value) ? value.label : String(value);
|
|
15
|
+
};
|
|
9
16
|
export const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
10
17
|
type: 'singleSelect',
|
|
18
|
+
getOptionLabel: defaultGetOptionLabel,
|
|
19
|
+
getOptionValue: defaultGetOptionValue,
|
|
11
20
|
valueFormatter(params) {
|
|
12
21
|
const {
|
|
13
22
|
id,
|
|
@@ -36,10 +45,10 @@ export const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
36
45
|
return value;
|
|
37
46
|
}
|
|
38
47
|
if (!isArrayOfObjects(valueOptions)) {
|
|
39
|
-
return
|
|
48
|
+
return colDef.getOptionLabel(value);
|
|
40
49
|
}
|
|
41
|
-
const valueOption = valueOptions.find(option => option
|
|
42
|
-
return valueOption ?
|
|
50
|
+
const valueOption = valueOptions.find(option => colDef.getOptionValue(option) === value);
|
|
51
|
+
return valueOption ? colDef.getOptionLabel(valueOption) : '';
|
|
43
52
|
},
|
|
44
53
|
renderEditCell: renderEditSingleSelectCell,
|
|
45
54
|
filterOperators: getGridSingleSelectOperators()
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["innerRef", "className", "visibleColumns", "sortColumnLookup", "filterColumnLookup", "columnPositions", "columnHeaderTabIndexState", "columnGroupHeaderTabIndexState", "columnHeaderFocus", "columnGroupHeaderFocus", "densityFactor", "headerGroupingMaxDepth", "columnMenuState", "columnVisibility", "columnGroupsHeaderStructure", "hasOtherElementInTabSequence"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { useGridColumnHeaders } from '../hooks/features/columnHeaders/useGridColumnHeaders';
|
|
7
|
+
import { GridScrollArea } from './GridScrollArea';
|
|
8
|
+
import { GridBaseColumnHeaders } from './columnHeaders/GridBaseColumnHeaders';
|
|
9
|
+
import { GridColumnHeadersInner } from './columnHeaders/GridColumnHeadersInner';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnsHeaders(props, ref) {
|
|
13
|
+
const {
|
|
14
|
+
innerRef,
|
|
15
|
+
visibleColumns,
|
|
16
|
+
sortColumnLookup,
|
|
17
|
+
filterColumnLookup,
|
|
18
|
+
columnPositions,
|
|
19
|
+
columnHeaderTabIndexState,
|
|
20
|
+
columnGroupHeaderTabIndexState,
|
|
21
|
+
columnHeaderFocus,
|
|
22
|
+
columnGroupHeaderFocus,
|
|
23
|
+
densityFactor,
|
|
24
|
+
headerGroupingMaxDepth,
|
|
25
|
+
columnMenuState,
|
|
26
|
+
columnVisibility,
|
|
27
|
+
columnGroupsHeaderStructure,
|
|
28
|
+
hasOtherElementInTabSequence
|
|
29
|
+
} = props,
|
|
30
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
31
|
+
const {
|
|
32
|
+
isDragging,
|
|
33
|
+
getRootProps,
|
|
34
|
+
getInnerProps,
|
|
35
|
+
getColumnHeaders,
|
|
36
|
+
getColumnGroupHeaders
|
|
37
|
+
} = useGridColumnHeaders({
|
|
38
|
+
innerRef,
|
|
39
|
+
visibleColumns,
|
|
40
|
+
sortColumnLookup,
|
|
41
|
+
filterColumnLookup,
|
|
42
|
+
columnPositions,
|
|
43
|
+
columnHeaderTabIndexState,
|
|
44
|
+
columnGroupHeaderTabIndexState,
|
|
45
|
+
columnHeaderFocus,
|
|
46
|
+
columnGroupHeaderFocus,
|
|
47
|
+
densityFactor,
|
|
48
|
+
headerGroupingMaxDepth,
|
|
49
|
+
columnMenuState,
|
|
50
|
+
columnVisibility,
|
|
51
|
+
columnGroupsHeaderStructure,
|
|
52
|
+
hasOtherElementInTabSequence
|
|
53
|
+
});
|
|
54
|
+
return /*#__PURE__*/_jsxs(GridBaseColumnHeaders, _extends({
|
|
55
|
+
ref: ref
|
|
56
|
+
}, getRootProps(other), {
|
|
57
|
+
children: [/*#__PURE__*/_jsx(GridScrollArea, {
|
|
58
|
+
scrollDirection: "left"
|
|
59
|
+
}), /*#__PURE__*/_jsxs(GridColumnHeadersInner, _extends({
|
|
60
|
+
isDragging: isDragging
|
|
61
|
+
}, getInnerProps(), {
|
|
62
|
+
children: [getColumnGroupHeaders(), getColumnHeaders()]
|
|
63
|
+
})), /*#__PURE__*/_jsx(GridScrollArea, {
|
|
64
|
+
scrollDirection: "right"
|
|
65
|
+
})]
|
|
66
|
+
}));
|
|
67
|
+
});
|
|
68
|
+
process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes = {
|
|
69
|
+
// ----------------------------- Warning --------------------------------
|
|
70
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
71
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
72
|
+
// ----------------------------------------------------------------------
|
|
73
|
+
columnGroupHeaderFocus: PropTypes.shape({
|
|
74
|
+
depth: PropTypes.number.isRequired,
|
|
75
|
+
field: PropTypes.string.isRequired
|
|
76
|
+
}),
|
|
77
|
+
columnGroupHeaderTabIndexState: PropTypes.shape({
|
|
78
|
+
depth: PropTypes.number.isRequired,
|
|
79
|
+
field: PropTypes.string.isRequired
|
|
80
|
+
}),
|
|
81
|
+
columnGroupsHeaderStructure: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.shape({
|
|
82
|
+
columnFields: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
83
|
+
groupId: PropTypes.string
|
|
84
|
+
}))).isRequired,
|
|
85
|
+
columnHeaderFocus: PropTypes.shape({
|
|
86
|
+
field: PropTypes.string.isRequired
|
|
87
|
+
}),
|
|
88
|
+
columnHeaderTabIndexState: PropTypes.shape({
|
|
89
|
+
field: PropTypes.string.isRequired
|
|
90
|
+
}),
|
|
91
|
+
columnMenuState: PropTypes.shape({
|
|
92
|
+
field: PropTypes.string,
|
|
93
|
+
open: PropTypes.bool.isRequired
|
|
94
|
+
}).isRequired,
|
|
95
|
+
columnPositions: PropTypes.arrayOf(PropTypes.number).isRequired,
|
|
96
|
+
columnVisibility: PropTypes.object.isRequired,
|
|
97
|
+
densityFactor: PropTypes.number.isRequired,
|
|
98
|
+
filterColumnLookup: PropTypes.object.isRequired,
|
|
99
|
+
hasOtherElementInTabSequence: PropTypes.bool.isRequired,
|
|
100
|
+
headerGroupingMaxDepth: PropTypes.number.isRequired,
|
|
101
|
+
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
102
|
+
current: PropTypes.object
|
|
103
|
+
})]),
|
|
104
|
+
minColumnIndex: PropTypes.number,
|
|
105
|
+
sortColumnLookup: PropTypes.object.isRequired,
|
|
106
|
+
visibleColumns: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
107
|
+
} : void 0;
|
|
108
|
+
export { GridColumnHeaders };
|
|
@@ -25,7 +25,7 @@ const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref)
|
|
|
25
25
|
rowCount: totalTopLevelRowCount,
|
|
26
26
|
visibleRowCount: visibleTopLevelRowCount
|
|
27
27
|
}) : null;
|
|
28
|
-
const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.
|
|
28
|
+
const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.slots.pagination && /*#__PURE__*/_jsx(rootProps.slots.pagination, _extends({}, rootProps.slotProps?.pagination));
|
|
29
29
|
return /*#__PURE__*/_jsxs(GridFooterContainer, _extends({
|
|
30
30
|
ref: ref
|
|
31
31
|
}, props, {
|
|
@@ -8,6 +8,6 @@ export const GridHeader = /*#__PURE__*/React.forwardRef(function GridHeader(prop
|
|
|
8
8
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
9
9
|
ref: ref
|
|
10
10
|
}, props, {
|
|
11
|
-
children: [/*#__PURE__*/_jsx(rootProps.
|
|
11
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.preferencesPanel, _extends({}, rootProps.slotProps?.preferencesPanel)), rootProps.slots.toolbar && /*#__PURE__*/_jsx(rootProps.slots.toolbar, _extends({}, rootProps.slotProps?.toolbar))]
|
|
12
12
|
}));
|
|
13
13
|
});
|