@mui/x-data-grid 6.0.0-beta.4 → 6.0.0-beta.5
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 +74 -0
- package/DataGrid/DataGrid.js +10 -0
- package/DataGrid/useDataGridProps.js +25 -18
- package/colDef/gridSingleSelectColDef.js +13 -4
- package/components/GridFooter.js +2 -2
- package/components/GridHeader.js +2 -2
- package/components/GridRow.js +4 -4
- package/components/GridRowCount.js +3 -5
- package/components/GridScrollArea.js +3 -2
- package/components/GridSelectedRowCount.js +3 -5
- package/components/base/GridFooterPlaceholder.js +2 -2
- package/components/base/GridOverlays.js +6 -6
- package/components/cell/GridActionsCell.js +4 -4
- package/components/cell/GridActionsCellItem.js +3 -3
- package/components/cell/GridBooleanCell.js +1 -1
- package/components/cell/GridEditBooleanCell.js +3 -3
- package/components/cell/GridEditInputCell.js +2 -4
- package/components/cell/GridEditSingleSelectCell.d.ts +2 -8
- package/components/cell/GridEditSingleSelectCell.js +25 -10
- package/components/columnHeaders/ColumnHeaderMenuIcon.js +4 -4
- 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 +6 -8
- package/components/columnHeaders/GridColumnHeaders.js +3 -5
- package/components/columnHeaders/GridColumnHeadersInner.js +5 -5
- package/components/columnHeaders/GridColumnUnsortedIcon.js +1 -1
- package/components/columnHeaders/GridIconButtonContainer.js +3 -5
- package/components/columnSelection/GridCellCheckboxRenderer.js +3 -3
- package/components/columnSelection/GridHeaderCheckbox.js +3 -3
- package/components/containers/GridFooterContainer.js +3 -5
- package/components/containers/GridMainContainer.js +2 -4
- package/components/containers/GridOverlay.js +3 -5
- package/components/containers/GridRoot.js +4 -5
- package/components/containers/GridRootStyles.d.ts +5 -1
- package/components/containers/GridToolbarContainer.js +3 -5
- package/components/icons/index.d.ts +6 -0
- package/components/icons/index.js +7 -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 +15 -16
- package/components/panel/GridPanel.d.ts +6 -2
- package/components/panel/GridPanel.js +4 -0
- package/components/panel/GridPanelContent.js +3 -5
- package/components/panel/GridPanelFooter.js +3 -5
- package/components/panel/GridPanelHeader.js +3 -5
- package/components/panel/GridPanelWrapper.js +3 -5
- package/components/panel/GridPreferencesPanel.js +4 -4
- package/components/panel/filterPanel/GridFilterForm.js +25 -22
- package/components/panel/filterPanel/GridFilterInputBoolean.js +5 -5
- package/components/panel/filterPanel/GridFilterInputDate.js +3 -3
- 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 +28 -17
- package/components/panel/filterPanel/GridFilterInputValue.js +3 -3
- package/components/panel/filterPanel/GridFilterPanel.d.ts +2 -0
- package/components/panel/filterPanel/GridFilterPanel.js +27 -10
- 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.js +3 -5
- package/components/virtualization/GridVirtualScrollerContent.js +3 -3
- package/components/virtualization/GridVirtualScrollerRenderZone.js +3 -5
- package/constants/defaultGridSlotsComponents.js +4 -2
- package/constants/localeTextConstants.js +1 -0
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -0
- 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/virtualization/useGridVirtualScroller.js +3 -3
- package/index.js +1 -1
- package/internals/index.d.ts +2 -0
- package/internals/index.js +2 -1
- 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 -0
- package/legacy/DataGrid/useDataGridProps.js +21 -20
- package/legacy/colDef/gridSingleSelectColDef.js +13 -4
- package/legacy/components/GridFooter.js +2 -2
- package/legacy/components/GridHeader.js +2 -2
- package/legacy/components/GridRow.js +4 -4
- package/legacy/components/GridRowCount.js +3 -5
- package/legacy/components/GridScrollArea.js +3 -2
- package/legacy/components/GridSelectedRowCount.js +3 -5
- package/legacy/components/base/GridFooterPlaceholder.js +2 -2
- package/legacy/components/base/GridOverlays.js +6 -6
- 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/GridEditBooleanCell.js +3 -3
- package/legacy/components/cell/GridEditInputCell.js +2 -4
- package/legacy/components/cell/GridEditSingleSelectCell.js +33 -17
- package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +4 -4
- 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 +6 -8
- package/legacy/components/columnHeaders/GridColumnHeaders.js +3 -5
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +5 -5
- package/legacy/components/columnHeaders/GridColumnUnsortedIcon.js +1 -1
- package/legacy/components/columnHeaders/GridIconButtonContainer.js +3 -5
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +3 -3
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +3 -3
- package/legacy/components/containers/GridFooterContainer.js +3 -5
- package/legacy/components/containers/GridMainContainer.js +2 -4
- package/legacy/components/containers/GridOverlay.js +3 -5
- package/legacy/components/containers/GridRoot.js +5 -6
- package/legacy/components/containers/GridToolbarContainer.js +3 -5
- package/legacy/components/icons/index.js +7 -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 +15 -18
- package/legacy/components/panel/GridPanel.js +4 -0
- package/legacy/components/panel/GridPanelContent.js +3 -5
- package/legacy/components/panel/GridPanelFooter.js +3 -5
- package/legacy/components/panel/GridPanelHeader.js +3 -5
- package/legacy/components/panel/GridPanelWrapper.js +3 -5
- package/legacy/components/panel/GridPreferencesPanel.js +4 -4
- package/legacy/components/panel/filterPanel/GridFilterForm.js +25 -22
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +5 -5
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +3 -3
- 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 +28 -19
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +3 -3
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +28 -9
- 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 +3 -5
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +3 -3
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +3 -5
- package/legacy/constants/defaultGridSlotsComponents.js +4 -2
- package/legacy/constants/localeTextConstants.js +1 -0
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -0
- 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 +3 -3
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +2 -1
- 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 +1 -0
- package/legacy/locales/beBY.js +1 -0
- package/legacy/locales/bgBG.js +1 -0
- package/legacy/locales/csCZ.js +1 -0
- 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 +1 -0
- 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/locales/arSD.js +1 -0
- package/locales/beBY.js +1 -0
- package/locales/bgBG.js +1 -0
- package/locales/csCZ.js +1 -0
- package/locales/daDK.js +1 -0
- package/locales/deDE.js +1 -0
- package/locales/elGR.js +1 -0
- package/locales/esES.js +1 -0
- 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/models/api/gridLocaleTextApi.d.ts +1 -0
- package/models/colDef/gridColDef.d.ts +13 -1
- package/models/gridIconSlotsComponent.d.ts +12 -2
- package/models/gridSlotsComponent.d.ts +3 -1
- package/models/props/DataGridProps.d.ts +13 -2
- package/modern/DataGrid/DataGrid.js +10 -0
- package/modern/DataGrid/useDataGridProps.js +21 -17
- package/modern/colDef/gridSingleSelectColDef.js +13 -4
- package/modern/components/GridFooter.js +1 -1
- package/modern/components/GridHeader.js +1 -1
- package/modern/components/GridRow.js +3 -3
- package/modern/components/GridRowCount.js +3 -5
- package/modern/components/GridScrollArea.js +3 -2
- package/modern/components/GridSelectedRowCount.js +3 -5
- package/modern/components/base/GridFooterPlaceholder.js +1 -1
- package/modern/components/base/GridOverlays.js +3 -3
- 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/GridEditBooleanCell.js +2 -2
- package/modern/components/cell/GridEditInputCell.js +2 -4
- package/modern/components/cell/GridEditSingleSelectCell.js +24 -9
- package/modern/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- 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 +5 -7
- package/modern/components/columnHeaders/GridColumnHeaders.js +3 -5
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +5 -5
- package/modern/components/columnHeaders/GridColumnUnsortedIcon.js +1 -1
- package/modern/components/columnHeaders/GridIconButtonContainer.js +3 -5
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
- package/modern/components/columnSelection/GridHeaderCheckbox.js +2 -2
- package/modern/components/containers/GridFooterContainer.js +3 -5
- package/modern/components/containers/GridMainContainer.js +2 -4
- package/modern/components/containers/GridOverlay.js +3 -5
- package/modern/components/containers/GridRoot.js +4 -5
- package/modern/components/containers/GridToolbarContainer.js +3 -5
- package/modern/components/icons/index.js +7 -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 +13 -14
- package/modern/components/panel/GridPanel.js +4 -0
- package/modern/components/panel/GridPanelContent.js +3 -5
- package/modern/components/panel/GridPanelFooter.js +3 -5
- package/modern/components/panel/GridPanelHeader.js +3 -5
- package/modern/components/panel/GridPanelWrapper.js +3 -5
- package/modern/components/panel/GridPreferencesPanel.js +3 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +24 -21
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +4 -4
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +2 -2
- 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 +27 -16
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +2 -2
- package/modern/components/panel/filterPanel/GridFilterPanel.js +26 -9
- 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 +3 -5
- package/modern/components/virtualization/GridVirtualScrollerContent.js +3 -3
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +3 -5
- package/modern/constants/defaultGridSlotsComponents.js +4 -2
- package/modern/constants/localeTextConstants.js +1 -0
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -0
- 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 +2 -2
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -1
- 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 +1 -0
- package/modern/locales/beBY.js +1 -0
- package/modern/locales/bgBG.js +1 -0
- package/modern/locales/csCZ.js +1 -0
- 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 +1 -0
- 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/node/DataGrid/DataGrid.js +10 -0
- package/node/DataGrid/useDataGridProps.js +21 -17
- package/node/colDef/gridSingleSelectColDef.js +12 -3
- package/node/components/GridFooter.js +1 -1
- package/node/components/GridHeader.js +1 -1
- package/node/components/GridRow.js +3 -3
- package/node/components/GridRowCount.js +3 -5
- package/node/components/GridScrollArea.js +3 -2
- package/node/components/GridSelectedRowCount.js +3 -5
- package/node/components/base/GridFooterPlaceholder.js +1 -1
- package/node/components/base/GridOverlays.js +3 -3
- 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/GridEditBooleanCell.js +2 -2
- package/node/components/cell/GridEditInputCell.js +2 -4
- package/node/components/cell/GridEditSingleSelectCell.js +23 -8
- package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- 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 +5 -7
- package/node/components/columnHeaders/GridColumnHeaders.js +3 -5
- package/node/components/columnHeaders/GridColumnHeadersInner.js +5 -5
- package/node/components/columnHeaders/GridColumnUnsortedIcon.js +1 -1
- package/node/components/columnHeaders/GridIconButtonContainer.js +3 -5
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
- package/node/components/columnSelection/GridHeaderCheckbox.js +2 -2
- package/node/components/containers/GridFooterContainer.js +3 -5
- package/node/components/containers/GridMainContainer.js +2 -4
- package/node/components/containers/GridOverlay.js +3 -5
- package/node/components/containers/GridRoot.js +4 -5
- package/node/components/containers/GridToolbarContainer.js +3 -5
- package/node/components/icons/index.js +10 -2
- 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 +13 -14
- package/node/components/panel/GridPanel.js +4 -0
- package/node/components/panel/GridPanelContent.js +3 -5
- package/node/components/panel/GridPanelFooter.js +3 -5
- package/node/components/panel/GridPanelHeader.js +3 -5
- package/node/components/panel/GridPanelWrapper.js +3 -5
- package/node/components/panel/GridPreferencesPanel.js +3 -3
- package/node/components/panel/filterPanel/GridFilterForm.js +24 -21
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +4 -4
- package/node/components/panel/filterPanel/GridFilterInputDate.js +2 -2
- 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 +26 -15
- package/node/components/panel/filterPanel/GridFilterInputValue.js +2 -2
- package/node/components/panel/filterPanel/GridFilterPanel.js +26 -9
- 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 +3 -5
- package/node/components/virtualization/GridVirtualScrollerContent.js +3 -3
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +3 -5
- package/node/constants/defaultGridSlotsComponents.js +3 -1
- package/node/constants/localeTextConstants.js +1 -0
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -0
- 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 +2 -2
- package/node/index.js +1 -1
- package/node/internals/index.js +91 -1
- 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 +1 -0
- package/node/locales/beBY.js +1 -0
- package/node/locales/bgBG.js +1 -0
- package/node/locales/csCZ.js +1 -0
- 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 +1 -0
- 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/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,60 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.0.0-beta.5
|
|
7
|
+
|
|
8
|
+
_Feb 23, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- ⚡️ Add web worker support for Excel export (#7770) @m4theushw
|
|
13
|
+
- 🎁 Add a button to remove all filters on the data grid filter panel (#7326) @MBilalShafi
|
|
14
|
+
- ⚙️ Allow to customize options label and value in the data grid `singleSelect` column (#7684) @m4theushw
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
|
|
18
|
+
### `@mui/x-data-grid@v6.0.0-beta.5` / `@mui/x-data-grid-pro@v6.0.0-beta.5` / `@mui/x-data-grid-premium@v6.0.0-beta.5`
|
|
19
|
+
|
|
20
|
+
#### Changes
|
|
21
|
+
|
|
22
|
+
- [DataGrid] Allow to customize label and value for `singleSelect` (#7684) @m4theushw
|
|
23
|
+
- [DataGrid] Fix `ownerState` being `undefined` in theme style overrides (#7964) @lolaignatova
|
|
24
|
+
- [DataGrid] Introduce `slots` and deprecate `components` (#7882) @MBilalShafi
|
|
25
|
+
- [DataGridPro] Add `Remove All` option in filter panel (#7326) @MBilalShafi
|
|
26
|
+
- [DataGridPremium] Add web worker support for Excel export (#7770) @m4theushw
|
|
27
|
+
|
|
28
|
+
### `@mui/x-date-pickers@v6.0.0-beta.5` / `@mui/x-date-pickers-pro@v6.0.0-beta.5`
|
|
29
|
+
|
|
30
|
+
#### Breaking changes
|
|
31
|
+
|
|
32
|
+
- The `MuiDateSectionName` type was renamed to `FieldSectionType`
|
|
33
|
+
|
|
34
|
+
#### Changes
|
|
35
|
+
|
|
36
|
+
- [fields] Fix multi input range fields validation when uncontrolled (#8002) @LukasTy
|
|
37
|
+
- [fields] Fix single input time range fields slot props (#7988) @LukasTy
|
|
38
|
+
- [fields] Make the `ArrowUp` / `ArrowDown` edition only impact the active section (#7993) @flaviendelangle
|
|
39
|
+
- [fields] Fix single input range fields clearing (#7995) @flaviendelangle
|
|
40
|
+
- [fields] Clean the section object (#8009) @flaviendelangle
|
|
41
|
+
- [pickers] Fix `textField` slot `error` prop propagation (#7987) @LukasTy
|
|
42
|
+
|
|
43
|
+
### `@mui/x-codemod@v6.0.0-beta.5`
|
|
44
|
+
|
|
45
|
+
#### Changes
|
|
46
|
+
|
|
47
|
+
- [codemod] Add `apiRef.current.getRowIndex` to `DataGrid` renaming codemod (#8001) @MBilalShafi
|
|
48
|
+
|
|
49
|
+
### Docs
|
|
50
|
+
|
|
51
|
+
- [docs] Fine tune range fields demos (#7992) @LukasTy
|
|
52
|
+
- [docs] Fix a few scroll issues on mobile (#7900) @oliviertassinari
|
|
53
|
+
- [docs] Fix inconsistency in the data grid migration guide (#7963) @MBilalShafi
|
|
54
|
+
|
|
55
|
+
### Core
|
|
56
|
+
|
|
57
|
+
- [core] Fix `moment` locale on adapter tests (#8020) @flaviendelangle
|
|
58
|
+
- [test] Support all adapters on the field tests about the formats (#7996) @flaviendelangle
|
|
59
|
+
|
|
6
60
|
## 6.0.0-beta.4
|
|
7
61
|
|
|
8
62
|
_Feb 16, 2023_
|
|
@@ -2179,6 +2233,26 @@ You can find more information about the new api, including how to set those tran
|
|
|
2179
2233
|
- [test] Skip tests for column pinning and dynamic row height (#5997) @m4theushw
|
|
2180
2234
|
- [website] Improve security header @oliviertassinari
|
|
2181
2235
|
|
|
2236
|
+
## 5.17.25
|
|
2237
|
+
|
|
2238
|
+
_Feb 23, 2023_
|
|
2239
|
+
|
|
2240
|
+
We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
|
|
2241
|
+
|
|
2242
|
+
- 🐞 Bugfixes
|
|
2243
|
+
|
|
2244
|
+
### `@mui/x-data-grid@v5.17.25` / `@mui/x-data-grid-pro@v5.17.25` / `@mui/x-data-grid-premium@v5.17.25`
|
|
2245
|
+
|
|
2246
|
+
#### Changes
|
|
2247
|
+
|
|
2248
|
+
- [DataGrid] Fix `ownerState` being `undefined` in theme style overrides (#7757) @lolaignatova
|
|
2249
|
+
|
|
2250
|
+
### `@mui/x-date-pickers@v5.0.20` / `@mui/x-date-pickers-pro@v5.0.20`
|
|
2251
|
+
|
|
2252
|
+
#### Changes
|
|
2253
|
+
|
|
2254
|
+
- [DateTimePicker] Ensure toolbar `viewType` is correctly updated (#7942) @LukasTy
|
|
2255
|
+
|
|
2182
2256
|
## 5.17.24
|
|
2183
2257
|
|
|
2184
2258
|
_Feb 16, 2023_
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -103,10 +103,12 @@ DataGridRaw.propTypes = {
|
|
|
103
103
|
columnVisibilityModel: PropTypes.object,
|
|
104
104
|
/**
|
|
105
105
|
* Overrideable components.
|
|
106
|
+
* @deprecated Use `slots` instead.
|
|
106
107
|
*/
|
|
107
108
|
components: PropTypes.object,
|
|
108
109
|
/**
|
|
109
110
|
* Overrideable components props dynamically passed to the component at rendering.
|
|
111
|
+
* @deprecated Use the `slotProps` prop instead.
|
|
110
112
|
*/
|
|
111
113
|
componentsProps: PropTypes.object,
|
|
112
114
|
/**
|
|
@@ -581,6 +583,14 @@ DataGridRaw.propTypes = {
|
|
|
581
583
|
* @default false
|
|
582
584
|
*/
|
|
583
585
|
showColumnVerticalBorder: PropTypes.bool,
|
|
586
|
+
/**
|
|
587
|
+
* Overrideable components props dynamically passed to the component at rendering.
|
|
588
|
+
*/
|
|
589
|
+
slotProps: PropTypes.object,
|
|
590
|
+
/**
|
|
591
|
+
* Overrideable components.
|
|
592
|
+
*/
|
|
593
|
+
slots: PropTypes.object,
|
|
584
594
|
/**
|
|
585
595
|
* Sorting can be processed on the server or client-side.
|
|
586
596
|
* 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,29 @@ 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
|
-
return _extends({}, DATA_GRID_DEFAULT_SLOTS_COMPONENTS);
|
|
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]);
|
|
85
|
-
return React.useMemo(() => _extends({}, DATA_GRID_PROPS_DEFAULT_VALUES, themedProps, {
|
|
86
|
-
localeText,
|
|
83
|
+
const slots = React.useMemo(() => computeSlots({
|
|
84
|
+
defaultSlots,
|
|
85
|
+
slots: themedProps.slots,
|
|
87
86
|
components
|
|
88
|
-
}
|
|
87
|
+
}), [components, themedProps.slots]);
|
|
88
|
+
return React.useMemo(() => {
|
|
89
|
+
var _themedProps$slotProp;
|
|
90
|
+
return _extends({}, DATA_GRID_PROPS_DEFAULT_VALUES, themedProps, {
|
|
91
|
+
localeText,
|
|
92
|
+
slots,
|
|
93
|
+
slotProps: (_themedProps$slotProp = themedProps.slotProps) != null ? _themedProps$slotProp : componentsProps
|
|
94
|
+
}, DATA_GRID_FORCED_PROPS);
|
|
95
|
+
}, [themedProps, localeText, slots, componentsProps]);
|
|
89
96
|
};
|
|
@@ -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()
|
package/components/GridFooter.js
CHANGED
|
@@ -13,7 +13,7 @@ import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref) {
|
|
16
|
-
var _rootProps$
|
|
16
|
+
var _rootProps$slotProps;
|
|
17
17
|
const apiRef = useGridApiContext();
|
|
18
18
|
const rootProps = useGridRootProps();
|
|
19
19
|
const totalTopLevelRowCount = useGridSelector(apiRef, gridTopLevelRowCountSelector);
|
|
@@ -26,7 +26,7 @@ const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref)
|
|
|
26
26
|
rowCount: totalTopLevelRowCount,
|
|
27
27
|
visibleRowCount: visibleTopLevelRowCount
|
|
28
28
|
}) : null;
|
|
29
|
-
const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.
|
|
29
|
+
const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.slots.pagination && /*#__PURE__*/_jsx(rootProps.slots.pagination, _extends({}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.pagination));
|
|
30
30
|
return /*#__PURE__*/_jsxs(GridFooterContainer, _extends({
|
|
31
31
|
ref: ref
|
|
32
32
|
}, props, {
|
package/components/GridHeader.js
CHANGED
|
@@ -4,11 +4,11 @@ import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
export const GridHeader = /*#__PURE__*/React.forwardRef(function GridHeader(props, ref) {
|
|
7
|
-
var _rootProps$
|
|
7
|
+
var _rootProps$slotProps, _rootProps$slotProps2;
|
|
8
8
|
const rootProps = useGridRootProps();
|
|
9
9
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
10
10
|
ref: ref
|
|
11
11
|
}, props, {
|
|
12
|
-
children: [/*#__PURE__*/_jsx(rootProps.
|
|
12
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.preferencesPanel, _extends({}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.preferencesPanel)), rootProps.slots.toolbar && /*#__PURE__*/_jsx(rootProps.slots.toolbar, _extends({}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.toolbar))]
|
|
13
13
|
}));
|
|
14
14
|
});
|
package/components/GridRow.js
CHANGED
|
@@ -180,7 +180,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
180
180
|
publish('rowClick', onClick)(event);
|
|
181
181
|
}, [apiRef, onClick, publish, rowId]);
|
|
182
182
|
const getCell = React.useCallback((column, cellProps) => {
|
|
183
|
-
var _rootProps$
|
|
183
|
+
var _rootProps$slotProps;
|
|
184
184
|
const cellParams = apiRef.current.getCellParams(rowId, column.field);
|
|
185
185
|
const classNames = apiRef.current.unstable_applyPipeProcessors('cellClassName', [], {
|
|
186
186
|
id: rowId,
|
|
@@ -223,7 +223,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
223
223
|
id: rowId,
|
|
224
224
|
field: column.field
|
|
225
225
|
});
|
|
226
|
-
return /*#__PURE__*/_jsx(rootProps.
|
|
226
|
+
return /*#__PURE__*/_jsx(rootProps.slots.cell, _extends({
|
|
227
227
|
value: cellParams.value,
|
|
228
228
|
field: column.field,
|
|
229
229
|
width: cellProps.width,
|
|
@@ -241,7 +241,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
241
241
|
className: clsx(classNames),
|
|
242
242
|
colSpan: cellProps.colSpan,
|
|
243
243
|
disableDragEvents: disableDragEvents
|
|
244
|
-
}, (_rootProps$
|
|
244
|
+
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.cell, {
|
|
245
245
|
children: content
|
|
246
246
|
}), column.field);
|
|
247
247
|
}, [apiRef, cellTabIndex, editRowsState, cellFocus, rootProps, rowHeight, rowId, treeDepth, sortModel.length]);
|
|
@@ -319,7 +319,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
319
319
|
width
|
|
320
320
|
} = cellColSpanInfo.cellProps;
|
|
321
321
|
const contentWidth = Math.round(randomNumber());
|
|
322
|
-
cells.push( /*#__PURE__*/_jsx(rootProps.
|
|
322
|
+
cells.push( /*#__PURE__*/_jsx(rootProps.slots.skeletonCell, {
|
|
323
323
|
width: width,
|
|
324
324
|
contentWidth: contentWidth,
|
|
325
325
|
field: column.field,
|
|
@@ -38,10 +38,7 @@ const GridRowCount = /*#__PURE__*/React.forwardRef(function GridRowCount(props,
|
|
|
38
38
|
} = props,
|
|
39
39
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
40
|
const apiRef = useGridApiContext();
|
|
41
|
-
const
|
|
42
|
-
const ownerState = {
|
|
43
|
-
classes: rootProps.classes
|
|
44
|
-
};
|
|
41
|
+
const ownerState = useGridRootProps();
|
|
45
42
|
const classes = useUtilityClasses(ownerState);
|
|
46
43
|
if (rowCount === 0) {
|
|
47
44
|
return null;
|
|
@@ -49,7 +46,8 @@ const GridRowCount = /*#__PURE__*/React.forwardRef(function GridRowCount(props,
|
|
|
49
46
|
const text = visibleRowCount < rowCount ? apiRef.current.getLocaleText('footerTotalVisibleRows')(visibleRowCount, rowCount) : rowCount.toLocaleString();
|
|
50
47
|
return /*#__PURE__*/_jsxs(GridRowCountRoot, _extends({
|
|
51
48
|
ref: ref,
|
|
52
|
-
className: clsx(classes.root, className)
|
|
49
|
+
className: clsx(classes.root, className),
|
|
50
|
+
ownerState: ownerState
|
|
53
51
|
}, other, {
|
|
54
52
|
children: [apiRef.current.getLocaleText('footerTotalRows'), " ", text]
|
|
55
53
|
}));
|
|
@@ -58,8 +58,8 @@ function GridScrollAreaRaw(props) {
|
|
|
58
58
|
top: 0
|
|
59
59
|
});
|
|
60
60
|
const rootProps = useGridRootProps();
|
|
61
|
-
const ownerState = _extends({},
|
|
62
|
-
|
|
61
|
+
const ownerState = _extends({}, rootProps, {
|
|
62
|
+
scrollDirection
|
|
63
63
|
});
|
|
64
64
|
const classes = useUtilityClasses(ownerState);
|
|
65
65
|
const headerHeight = Math.floor(rootProps.columnHeaderHeight * densityFactor);
|
|
@@ -99,6 +99,7 @@ function GridScrollAreaRaw(props) {
|
|
|
99
99
|
return dragging ? /*#__PURE__*/_jsx(GridScrollAreaRawRoot, {
|
|
100
100
|
ref: rootRef,
|
|
101
101
|
className: clsx(classes.root),
|
|
102
|
+
ownerState: ownerState,
|
|
102
103
|
onDragOver: handleDragOver,
|
|
103
104
|
style: {
|
|
104
105
|
height: headerHeight
|
|
@@ -45,15 +45,13 @@ const GridSelectedRowCount = /*#__PURE__*/React.forwardRef(function GridSelected
|
|
|
45
45
|
} = props,
|
|
46
46
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
47
47
|
const apiRef = useGridApiContext();
|
|
48
|
-
const
|
|
49
|
-
const ownerState = {
|
|
50
|
-
classes: rootProps.classes
|
|
51
|
-
};
|
|
48
|
+
const ownerState = useGridRootProps();
|
|
52
49
|
const classes = useUtilityClasses(ownerState);
|
|
53
50
|
const rowSelectedText = apiRef.current.getLocaleText('footerRowSelected')(selectedRowCount);
|
|
54
51
|
return /*#__PURE__*/_jsx(GridSelectedRowCountRoot, _extends({
|
|
55
52
|
ref: ref,
|
|
56
|
-
className: clsx(classes.root, className)
|
|
53
|
+
className: clsx(classes.root, className),
|
|
54
|
+
ownerState: ownerState
|
|
57
55
|
}, other, {
|
|
58
56
|
children: rowSelectedText
|
|
59
57
|
}));
|
|
@@ -3,10 +3,10 @@ import * as React from 'react';
|
|
|
3
3
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
export function GridFooterPlaceholder() {
|
|
6
|
-
var _rootProps$
|
|
6
|
+
var _rootProps$slotProps;
|
|
7
7
|
const rootProps = useGridRootProps();
|
|
8
8
|
if (rootProps.hideFooter) {
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
|
-
return /*#__PURE__*/_jsx(rootProps.
|
|
11
|
+
return /*#__PURE__*/_jsx(rootProps.slots.footer, _extends({}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.footer));
|
|
12
12
|
}
|
|
@@ -89,16 +89,16 @@ export function GridOverlays() {
|
|
|
89
89
|
const showNoResultsOverlay = !loading && totalRowCount > 0 && visibleRowCount === 0;
|
|
90
90
|
let overlay = null;
|
|
91
91
|
if (showNoRowsOverlay) {
|
|
92
|
-
var _rootProps$
|
|
93
|
-
overlay = /*#__PURE__*/_jsx(rootProps.
|
|
92
|
+
var _rootProps$slotProps;
|
|
93
|
+
overlay = /*#__PURE__*/_jsx(rootProps.slots.noRowsOverlay, _extends({}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.noRowsOverlay));
|
|
94
94
|
}
|
|
95
95
|
if (showNoResultsOverlay) {
|
|
96
|
-
var _rootProps$
|
|
97
|
-
overlay = /*#__PURE__*/_jsx(rootProps.
|
|
96
|
+
var _rootProps$slotProps2;
|
|
97
|
+
overlay = /*#__PURE__*/_jsx(rootProps.slots.noResultsOverlay, _extends({}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.noResultsOverlay));
|
|
98
98
|
}
|
|
99
99
|
if (loading) {
|
|
100
|
-
var _rootProps$
|
|
101
|
-
overlay = /*#__PURE__*/_jsx(rootProps.
|
|
100
|
+
var _rootProps$slotProps3;
|
|
101
|
+
overlay = /*#__PURE__*/_jsx(rootProps.slots.loadingOverlay, _extends({}, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.loadingOverlay));
|
|
102
102
|
}
|
|
103
103
|
if (overlay === null) {
|
|
104
104
|
return null;
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
14
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
const hasActions = colDef => typeof colDef.getActions === 'function';
|
|
16
16
|
function GridActionsCell(props) {
|
|
17
|
-
var _rootProps$
|
|
17
|
+
var _rootProps$slotProps;
|
|
18
18
|
const {
|
|
19
19
|
colDef,
|
|
20
20
|
id,
|
|
@@ -148,7 +148,7 @@ function GridActionsCell(props) {
|
|
|
148
148
|
touchRippleRef: handleTouchRippleRef(index),
|
|
149
149
|
onClick: handleButtonClick(index, button.props.onClick),
|
|
150
150
|
tabIndex: focusedButtonIndex === index ? tabIndex : -1
|
|
151
|
-
})), menuButtons.length > 0 && buttonId && /*#__PURE__*/_jsx(rootProps.
|
|
151
|
+
})), menuButtons.length > 0 && buttonId && /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
152
152
|
ref: buttonRef,
|
|
153
153
|
id: buttonId,
|
|
154
154
|
"aria-label": apiRef.current.getLocaleText('actionsCellMore'),
|
|
@@ -160,8 +160,8 @@ function GridActionsCell(props) {
|
|
|
160
160
|
onClick: showMenu,
|
|
161
161
|
touchRippleRef: handleTouchRippleRef(buttonId),
|
|
162
162
|
tabIndex: focusedButtonIndex === iconButtons.length ? tabIndex : -1
|
|
163
|
-
}, (_rootProps$
|
|
164
|
-
children: /*#__PURE__*/_jsx(rootProps.
|
|
163
|
+
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
164
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.moreActionsIcon, {
|
|
165
165
|
fontSize: "small"
|
|
166
166
|
})
|
|
167
167
|
})), menuButtons.length > 0 && /*#__PURE__*/_jsx(GridMenu, {
|
|
@@ -23,15 +23,15 @@ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
if (!showInMenu) {
|
|
26
|
-
var _rootProps$
|
|
27
|
-
return /*#__PURE__*/_jsx(rootProps.
|
|
26
|
+
var _rootProps$slotProps;
|
|
27
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
28
28
|
ref: ref,
|
|
29
29
|
size: "small",
|
|
30
30
|
role: "menuitem",
|
|
31
31
|
"aria-label": label
|
|
32
32
|
}, other, {
|
|
33
33
|
onClick: handleClick
|
|
34
|
-
}, (_rootProps$
|
|
34
|
+
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
35
35
|
children: /*#__PURE__*/React.cloneElement(icon, {
|
|
36
36
|
fontSize: 'small'
|
|
37
37
|
})
|
|
@@ -29,7 +29,7 @@ function GridBooleanCellRaw(props) {
|
|
|
29
29
|
classes: rootProps.classes
|
|
30
30
|
};
|
|
31
31
|
const classes = useUtilityClasses(ownerState);
|
|
32
|
-
const Icon = React.useMemo(() => value ? rootProps.
|
|
32
|
+
const Icon = React.useMemo(() => value ? rootProps.slots.booleanCellTrueIcon : rootProps.slots.booleanCellFalseIcon, [rootProps.slots.booleanCellFalseIcon, rootProps.slots.booleanCellTrueIcon, value]);
|
|
33
33
|
return /*#__PURE__*/_jsx(Icon, _extends({
|
|
34
34
|
fontSize: "small",
|
|
35
35
|
className: classes.root,
|
|
@@ -19,7 +19,7 @@ const useUtilityClasses = ownerState => {
|
|
|
19
19
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
20
20
|
};
|
|
21
21
|
function GridEditBooleanCell(props) {
|
|
22
|
-
var _rootProps$
|
|
22
|
+
var _rootProps$slotProps;
|
|
23
23
|
const {
|
|
24
24
|
id: idProp,
|
|
25
25
|
value,
|
|
@@ -62,13 +62,13 @@ function GridEditBooleanCell(props) {
|
|
|
62
62
|
htmlFor: id,
|
|
63
63
|
className: clsx(classes.root, className)
|
|
64
64
|
}, other, {
|
|
65
|
-
children: /*#__PURE__*/_jsx(rootProps.
|
|
65
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({
|
|
66
66
|
id: id,
|
|
67
67
|
inputRef: inputRef,
|
|
68
68
|
checked: Boolean(valueState),
|
|
69
69
|
onChange: handleChange,
|
|
70
70
|
size: "small"
|
|
71
|
-
}, (_rootProps$
|
|
71
|
+
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseCheckbox))
|
|
72
72
|
}));
|
|
73
73
|
}
|
|
74
74
|
process.env.NODE_ENV !== "production" ? GridEditBooleanCell.propTypes = {
|
|
@@ -49,10 +49,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
49
49
|
const apiRef = useGridApiContext();
|
|
50
50
|
const inputRef = React.useRef();
|
|
51
51
|
const [valueState, setValueState] = React.useState(value);
|
|
52
|
-
const
|
|
53
|
-
classes: rootProps.classes
|
|
54
|
-
};
|
|
55
|
-
const classes = useUtilityClasses(ownerState);
|
|
52
|
+
const classes = useUtilityClasses(rootProps);
|
|
56
53
|
const handleChange = React.useCallback(async event => {
|
|
57
54
|
const newValue = event.target.value;
|
|
58
55
|
if (onValueChange) {
|
|
@@ -87,6 +84,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
87
84
|
ref: ref,
|
|
88
85
|
inputRef: inputRef,
|
|
89
86
|
className: classes.root,
|
|
87
|
+
ownerState: rootProps,
|
|
90
88
|
fullWidth: true,
|
|
91
89
|
type: colDef.type === 'number' ? colDef.type : 'text',
|
|
92
90
|
value: valueState != null ? valueState : '',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SelectProps, SelectChangeEvent } from '@mui/material/Select';
|
|
3
3
|
import { GridRenderEditCellParams } from '../../models/params/gridCellParams';
|
|
4
|
-
import {
|
|
5
|
-
export interface GridEditSingleSelectCellProps extends GridRenderEditCellParams, Omit<SelectProps, 'id' | 'tabIndex' | 'value'> {
|
|
4
|
+
import { GridSingleSelectColDef } from '../../models/colDef/gridColDef';
|
|
5
|
+
export interface GridEditSingleSelectCellProps extends GridRenderEditCellParams, Omit<SelectProps, 'id' | 'tabIndex' | 'value'>, Pick<GridSingleSelectColDef, 'getOptionLabel' | 'getOptionValue'> {
|
|
6
6
|
/**
|
|
7
7
|
* Callback called when the value is changed by the user.
|
|
8
8
|
* @param {SelectChangeEvent<any>} event The event source of the callback.
|
|
@@ -14,12 +14,6 @@ export interface GridEditSingleSelectCellProps extends GridRenderEditCellParams,
|
|
|
14
14
|
* If true, the select opens by default.
|
|
15
15
|
*/
|
|
16
16
|
initialOpen?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Used to determine the text displayed for a given value option.
|
|
19
|
-
* @param {ValueOptions} value The current value option.
|
|
20
|
-
* @returns {string} The text to be displayed.
|
|
21
|
-
*/
|
|
22
|
-
getOptionLabel?: (value: ValueOptions) => string;
|
|
23
17
|
}
|
|
24
18
|
declare function GridEditSingleSelectCell(props: GridEditSingleSelectCellProps): JSX.Element | null;
|
|
25
19
|
declare namespace GridEditSingleSelectCell {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange", "initialOpen", "getOptionLabel"];
|
|
3
|
+
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange", "initialOpen", "getOptionLabel", "getOptionValue"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
@@ -8,14 +8,14 @@ import MenuItem from '@mui/material/MenuItem';
|
|
|
8
8
|
import { isEscapeKey } from '../../utils/keyboardUtils';
|
|
9
9
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
10
|
import { GridEditModes } from '../../models/gridEditRowModel';
|
|
11
|
-
import {
|
|
11
|
+
import { getValueFromValueOptions, isSingleSelectColDef } from '../panel/filterPanel/filterPanelUtils';
|
|
12
12
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
function isKeyboardEvent(event) {
|
|
15
15
|
return !!event.key;
|
|
16
16
|
}
|
|
17
17
|
function GridEditSingleSelectCell(props) {
|
|
18
|
-
var _rootProps$
|
|
18
|
+
var _rootProps$slotProps, _baseSelectProps$nati, _rootProps$slotProps2;
|
|
19
19
|
const rootProps = useGridRootProps();
|
|
20
20
|
const {
|
|
21
21
|
id,
|
|
@@ -27,14 +27,15 @@ function GridEditSingleSelectCell(props) {
|
|
|
27
27
|
error,
|
|
28
28
|
onValueChange,
|
|
29
29
|
initialOpen = rootProps.editMode === GridEditModes.Cell,
|
|
30
|
-
getOptionLabel
|
|
30
|
+
getOptionLabel: getOptionLabelProp,
|
|
31
|
+
getOptionValue: getOptionValueProp
|
|
31
32
|
} = props,
|
|
32
33
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
33
34
|
const apiRef = useGridApiContext();
|
|
34
35
|
const ref = React.useRef();
|
|
35
36
|
const inputRef = React.useRef();
|
|
36
37
|
const [open, setOpen] = React.useState(initialOpen);
|
|
37
|
-
const baseSelectProps = ((_rootProps$
|
|
38
|
+
const baseSelectProps = ((_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseSelect) || {};
|
|
38
39
|
const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : false;
|
|
39
40
|
useEnhancedEffect(() => {
|
|
40
41
|
if (hasFocus) {
|
|
@@ -58,11 +59,16 @@ function GridEditSingleSelectCell(props) {
|
|
|
58
59
|
if (!valueOptions) {
|
|
59
60
|
return null;
|
|
60
61
|
}
|
|
62
|
+
const getOptionValue = getOptionValueProp || colDef.getOptionValue;
|
|
63
|
+
const getOptionLabel = getOptionLabelProp || colDef.getOptionLabel;
|
|
61
64
|
const handleChange = async event => {
|
|
65
|
+
if (!isSingleSelectColDef(colDef) || !valueOptions) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
62
68
|
setOpen(false);
|
|
63
69
|
const target = event.target;
|
|
64
70
|
// NativeSelect casts the value to a string.
|
|
65
|
-
const formattedTargetValue = getValueFromValueOptions(target.value, valueOptions);
|
|
71
|
+
const formattedTargetValue = getValueFromValueOptions(target.value, valueOptions, getOptionValue);
|
|
66
72
|
if (onValueChange) {
|
|
67
73
|
await onValueChange(event, formattedTargetValue);
|
|
68
74
|
}
|
|
@@ -92,7 +98,10 @@ function GridEditSingleSelectCell(props) {
|
|
|
92
98
|
setOpen(true);
|
|
93
99
|
};
|
|
94
100
|
const OptionComponent = isSelectNative ? 'option' : MenuItem;
|
|
95
|
-
|
|
101
|
+
if (!valueOptions || !colDef) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
96
105
|
ref: ref,
|
|
97
106
|
inputRef: inputRef,
|
|
98
107
|
value: valueProp,
|
|
@@ -105,9 +114,9 @@ function GridEditSingleSelectCell(props) {
|
|
|
105
114
|
error: error,
|
|
106
115
|
native: isSelectNative,
|
|
107
116
|
fullWidth: true
|
|
108
|
-
}, other, (_rootProps$
|
|
117
|
+
}, other, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseSelect, {
|
|
109
118
|
children: valueOptions.map(valueOption => {
|
|
110
|
-
const value =
|
|
119
|
+
const value = getOptionValue(valueOption);
|
|
111
120
|
return /*#__PURE__*/_jsx(OptionComponent, {
|
|
112
121
|
value: value,
|
|
113
122
|
children: getOptionLabel(valueOption)
|
|
@@ -142,11 +151,17 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
|
|
|
142
151
|
*/
|
|
143
152
|
formattedValue: PropTypes.any,
|
|
144
153
|
/**
|
|
145
|
-
* Used to determine the
|
|
154
|
+
* Used to determine the label displayed for a given value option.
|
|
146
155
|
* @param {ValueOptions} value The current value option.
|
|
147
156
|
* @returns {string} The text to be displayed.
|
|
148
157
|
*/
|
|
149
158
|
getOptionLabel: PropTypes.func,
|
|
159
|
+
/**
|
|
160
|
+
* Used to determine the value used for a value option.
|
|
161
|
+
* @param {ValueOptions} value The current value option.
|
|
162
|
+
* @returns {string} The value to be used.
|
|
163
|
+
*/
|
|
164
|
+
getOptionValue: PropTypes.func,
|
|
150
165
|
/**
|
|
151
166
|
* If true, the cell is the active element.
|
|
152
167
|
*/
|
|
@@ -17,7 +17,7 @@ const useUtilityClasses = ownerState => {
|
|
|
17
17
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
18
18
|
};
|
|
19
19
|
export const ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(props => {
|
|
20
|
-
var _rootProps$
|
|
20
|
+
var _rootProps$slotProps;
|
|
21
21
|
const {
|
|
22
22
|
colDef,
|
|
23
23
|
open,
|
|
@@ -38,7 +38,7 @@ export const ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(props => {
|
|
|
38
38
|
}, [apiRef, colDef.field]);
|
|
39
39
|
return /*#__PURE__*/_jsx("div", {
|
|
40
40
|
className: classes.root,
|
|
41
|
-
children: /*#__PURE__*/_jsx(rootProps.
|
|
41
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
42
42
|
ref: iconButtonRef,
|
|
43
43
|
tabIndex: -1,
|
|
44
44
|
className: classes.button,
|
|
@@ -50,8 +50,8 @@ export const ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(props => {
|
|
|
50
50
|
"aria-haspopup": "true",
|
|
51
51
|
"aria-controls": columnMenuId,
|
|
52
52
|
id: columnMenuButtonId
|
|
53
|
-
}, (_rootProps$
|
|
54
|
-
children: /*#__PURE__*/_jsx(rootProps.
|
|
53
|
+
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
54
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuIcon, {
|
|
55
55
|
fontSize: "small"
|
|
56
56
|
})
|
|
57
57
|
}))
|