@mui/x-data-grid 5.12.3 → 5.14.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 +147 -1
- package/DataGrid/DataGrid.js +4 -4
- package/DataGrid/useDataGridComponent.js +1 -1
- package/colDef/gridActionsColDef.js +2 -0
- package/colDef/gridBooleanColDef.js +3 -1
- package/colDef/gridCheckboxSelectionColDef.js +2 -0
- package/colDef/gridDateOperators.d.ts +1 -1
- package/colDef/gridDateOperators.js +4 -2
- package/colDef/gridNumericOperators.js +4 -2
- package/colDef/gridStringColDef.d.ts +3 -0
- package/colDef/gridStringColDef.js +6 -0
- package/colDef/gridStringOperators.d.ts +1 -1
- package/colDef/gridStringOperators.js +15 -8
- package/components/GridRow.js +1 -1
- package/components/base/GridOverlays.js +4 -1
- package/components/cell/GridActionsCellItem.d.ts +2 -2
- package/components/cell/GridBooleanCell.d.ts +5 -2
- package/components/cell/GridBooleanCell.js +93 -2
- package/components/cell/GridEditDateCell.js +5 -1
- package/components/cell/index.d.ts +1 -0
- package/components/cell/index.js +1 -0
- package/components/columnSelection/GridCellCheckboxRenderer.js +7 -1
- package/components/containers/GridRootStyles.js +10 -0
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +11 -4
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +4 -2
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +3 -8
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +30 -14
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +3 -7
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +32 -14
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
- package/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +6 -3
- package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
- package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
- package/components/toolbar/GridToolbarExport.js +20 -10
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/constants/gridClasses.d.ts +25 -1
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +8 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +2 -1
- package/hooks/features/columns/useGridColumnSpanning.js +9 -7
- package/hooks/features/columns/useGridColumns.d.ts +1 -1
- package/hooks/features/columns/useGridColumns.js +13 -6
- package/hooks/features/dimensions/useGridDimensions.js +28 -15
- package/hooks/features/editRows/useGridCellEditing.new.js +7 -1
- package/hooks/features/editRows/useGridCellEditing.old.js +6 -0
- package/hooks/features/editRows/useGridRowEditing.new.js +7 -1
- package/hooks/features/editRows/useGridRowEditing.old.js +6 -0
- package/hooks/features/export/utils.d.ts +1 -1
- package/hooks/features/export/utils.js +9 -2
- package/hooks/features/filter/gridFilterUtils.js +6 -0
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/filter/useGridFilter.js +30 -5
- package/hooks/features/pagination/useGridPage.js +4 -3
- package/hooks/features/pagination/useGridPageSize.js +4 -3
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +12 -4
- package/hooks/features/rows/gridRowsUtils.d.ts +1 -1
- package/hooks/features/rows/useGridRows.js +1 -1
- package/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/hooks/features/selection/useGridSelection.js +24 -10
- package/hooks/features/sorting/gridSortingUtils.d.ts +1 -0
- package/hooks/features/sorting/gridSortingUtils.js +10 -11
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/features/sorting/useGridSorting.js +34 -6
- package/hooks/features/statePersistence/gridStatePersistenceInterface.d.ts +12 -1
- package/hooks/features/statePersistence/index.d.ts +1 -1
- package/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/hooks/features/virtualization/useGridVirtualScroller.js +17 -7
- package/hooks/utils/useGridApiContext.js +1 -1
- package/hooks/utils/useGridApiEventHandler.d.ts +2 -2
- package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
- package/hooks/utils/useGridNativeEventListener.js +1 -1
- package/hooks/utils/useGridRootProps.js +1 -1
- package/index.js +1 -1
- package/internals/index.d.ts +2 -2
- package/internals/index.js +2 -2
- package/legacy/DataGrid/DataGrid.js +4 -4
- package/legacy/DataGrid/useDataGridComponent.js +1 -1
- package/legacy/colDef/gridActionsColDef.js +2 -0
- package/legacy/colDef/gridBooleanColDef.js +3 -1
- package/legacy/colDef/gridCheckboxSelectionColDef.js +2 -0
- package/legacy/colDef/gridDateOperators.js +4 -2
- package/legacy/colDef/gridNumericOperators.js +4 -2
- package/legacy/colDef/gridStringColDef.js +6 -0
- package/legacy/colDef/gridStringOperators.js +17 -7
- package/legacy/components/GridRow.js +1 -1
- package/legacy/components/base/GridOverlays.js +4 -1
- package/legacy/components/cell/GridBooleanCell.js +93 -2
- package/legacy/components/cell/GridEditDateCell.js +5 -1
- package/legacy/components/cell/index.js +1 -0
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +6 -1
- package/legacy/components/containers/GridRootStyles.js +3 -3
- package/legacy/components/panel/filterPanel/GridFilterForm.js +9 -4
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +4 -2
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +22 -7
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +24 -7
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/legacy/components/toolbar/GridToolbarExport.js +20 -10
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/constants/localeTextConstants.js +8 -1
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +9 -7
- package/legacy/hooks/features/columns/useGridColumns.js +13 -8
- package/legacy/hooks/features/dimensions/useGridDimensions.js +27 -15
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +7 -1
- package/legacy/hooks/features/editRows/useGridCellEditing.old.js +16 -8
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +7 -1
- package/legacy/hooks/features/editRows/useGridRowEditing.old.js +22 -14
- package/legacy/hooks/features/export/utils.js +9 -2
- package/legacy/hooks/features/filter/gridFilterUtils.js +6 -0
- package/legacy/hooks/features/filter/useGridFilter.js +30 -5
- package/legacy/hooks/features/pagination/useGridPage.js +4 -3
- package/legacy/hooks/features/pagination/useGridPageSize.js +4 -3
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +12 -4
- package/legacy/hooks/features/rows/useGridRows.js +1 -1
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/legacy/hooks/features/selection/useGridSelection.js +26 -12
- package/legacy/hooks/features/sorting/gridSortingUtils.js +11 -12
- package/legacy/hooks/features/sorting/useGridSorting.js +34 -6
- package/legacy/hooks/features/statePersistence/useGridStatePersistence.js +2 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +22 -12
- package/legacy/hooks/utils/useGridApiContext.js +1 -1
- package/legacy/hooks/utils/useGridNativeEventListener.js +1 -1
- package/legacy/hooks/utils/useGridRootProps.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +2 -2
- package/legacy/locales/arSD.js +7 -0
- package/legacy/locales/bgBG.js +7 -0
- package/legacy/locales/csCZ.js +7 -0
- package/legacy/locales/daDK.js +7 -0
- package/legacy/locales/deDE.js +12 -5
- package/legacy/locales/elGR.js +7 -0
- package/legacy/locales/esES.js +7 -0
- package/legacy/locales/faIR.js +7 -0
- package/legacy/locales/fiFI.js +7 -0
- package/legacy/locales/frFR.js +17 -10
- package/legacy/locales/heIL.js +8 -1
- package/legacy/locales/huHU.js +7 -0
- package/legacy/locales/index.js +4 -1
- package/legacy/locales/itIT.js +7 -0
- package/legacy/locales/jaJP.js +8 -1
- package/legacy/locales/koKR.js +7 -0
- package/legacy/locales/nbNO.js +8 -1
- package/legacy/locales/nlNL.js +21 -14
- package/legacy/locales/plPL.js +7 -0
- package/legacy/locales/ptBR.js +17 -10
- package/legacy/locales/roRO.js +135 -0
- package/legacy/locales/ruRU.js +7 -0
- package/legacy/locales/skSK.js +22 -15
- package/legacy/locales/svSE.js +8 -1
- package/legacy/locales/trTR.js +7 -0
- package/legacy/locales/ukUA.js +7 -0
- package/legacy/locales/viVN.js +7 -0
- package/legacy/locales/zhCN.js +7 -0
- package/legacy/locales/zhTW.js +135 -0
- package/legacy/models/events/gridEvents.js +1 -0
- package/legacy/utils/keyboardUtils.js +4 -3
- package/locales/arSD.js +7 -0
- package/locales/bgBG.js +7 -0
- package/locales/csCZ.js +7 -0
- package/locales/daDK.js +7 -0
- package/locales/deDE.js +12 -5
- package/locales/elGR.js +7 -0
- package/locales/esES.js +7 -0
- package/locales/faIR.js +7 -0
- package/locales/fiFI.js +7 -0
- package/locales/frFR.js +17 -10
- package/locales/heIL.js +8 -1
- package/locales/huHU.js +7 -0
- package/locales/index.d.ts +3 -0
- package/locales/index.js +4 -1
- package/locales/itIT.js +7 -0
- package/locales/jaJP.js +8 -1
- package/locales/koKR.js +7 -0
- package/locales/nbNO.js +8 -1
- package/locales/nlNL.js +21 -14
- package/locales/plPL.js +7 -0
- package/locales/ptBR.js +17 -10
- package/locales/roRO.d.ts +2 -0
- package/locales/roRO.js +123 -0
- package/locales/ruRU.js +7 -0
- package/locales/skSK.js +22 -15
- package/locales/svSE.js +8 -1
- package/locales/trTR.js +7 -0
- package/locales/ukUA.js +7 -0
- package/locales/viVN.js +7 -0
- package/locales/zhCN.js +7 -0
- package/locales/zhTW.d.ts +2 -0
- package/locales/zhTW.js +123 -0
- package/models/api/gridColumnSpanning.d.ts +2 -0
- package/models/api/gridLocaleTextApi.d.ts +8 -2
- package/models/api/gridSelectionApi.d.ts +6 -0
- package/models/events/gridEvents.d.ts +1 -0
- package/models/events/gridEvents.js +1 -0
- package/models/gridFilterOperator.d.ts +6 -0
- package/models/gridRows.d.ts +10 -1
- package/models/params/gridCellParams.d.ts +4 -4
- package/modern/DataGrid/DataGrid.js +4 -4
- package/modern/DataGrid/useDataGridComponent.js +1 -1
- package/modern/colDef/gridActionsColDef.js +2 -0
- package/modern/colDef/gridBooleanColDef.js +3 -1
- package/modern/colDef/gridCheckboxSelectionColDef.js +2 -0
- package/modern/colDef/gridDateOperators.js +4 -2
- package/modern/colDef/gridNumericOperators.js +4 -2
- package/modern/colDef/gridStringColDef.js +6 -0
- package/modern/colDef/gridStringOperators.js +15 -8
- package/modern/components/GridRow.js +1 -1
- package/modern/components/base/GridOverlays.js +4 -1
- package/modern/components/cell/GridBooleanCell.js +93 -2
- package/modern/components/cell/GridEditDateCell.js +5 -1
- package/modern/components/cell/index.js +1 -0
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +7 -1
- package/modern/components/containers/GridRootStyles.js +10 -0
- package/modern/components/panel/filterPanel/GridFilterForm.js +11 -4
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +4 -2
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +20 -8
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +22 -8
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/modern/components/toolbar/GridToolbarExport.js +20 -10
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +8 -1
- package/modern/hooks/features/columns/useGridColumnSpanning.js +9 -7
- package/modern/hooks/features/columns/useGridColumns.js +10 -5
- package/modern/hooks/features/dimensions/useGridDimensions.js +28 -15
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +7 -1
- package/modern/hooks/features/editRows/useGridCellEditing.old.js +6 -0
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +7 -1
- package/modern/hooks/features/editRows/useGridRowEditing.old.js +6 -0
- package/modern/hooks/features/export/utils.js +5 -2
- package/modern/hooks/features/filter/gridFilterUtils.js +6 -0
- package/modern/hooks/features/filter/useGridFilter.js +25 -4
- package/modern/hooks/features/pagination/useGridPage.js +4 -3
- package/modern/hooks/features/pagination/useGridPageSize.js +4 -3
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +8 -4
- package/modern/hooks/features/rows/useGridRows.js +1 -1
- package/modern/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/modern/hooks/features/selection/useGridSelection.js +22 -10
- package/modern/hooks/features/sorting/gridSortingUtils.js +10 -11
- package/modern/hooks/features/sorting/useGridSorting.js +30 -6
- package/modern/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +13 -7
- package/modern/hooks/utils/useGridApiContext.js +1 -1
- package/modern/hooks/utils/useGridNativeEventListener.js +1 -1
- package/modern/hooks/utils/useGridRootProps.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -2
- package/modern/locales/arSD.js +7 -0
- package/modern/locales/bgBG.js +7 -0
- package/modern/locales/csCZ.js +7 -0
- package/modern/locales/daDK.js +7 -0
- package/modern/locales/deDE.js +12 -5
- package/modern/locales/elGR.js +7 -0
- package/modern/locales/esES.js +7 -0
- package/modern/locales/faIR.js +7 -0
- package/modern/locales/fiFI.js +7 -0
- package/modern/locales/frFR.js +17 -10
- package/modern/locales/heIL.js +8 -1
- package/modern/locales/huHU.js +7 -0
- package/modern/locales/index.js +4 -1
- package/modern/locales/itIT.js +7 -0
- package/modern/locales/jaJP.js +8 -1
- package/modern/locales/koKR.js +7 -0
- package/modern/locales/nbNO.js +8 -1
- package/modern/locales/nlNL.js +21 -14
- package/modern/locales/plPL.js +7 -0
- package/modern/locales/ptBR.js +17 -10
- package/modern/locales/roRO.js +123 -0
- package/modern/locales/ruRU.js +7 -0
- package/modern/locales/skSK.js +22 -15
- package/modern/locales/svSE.js +8 -1
- package/modern/locales/trTR.js +7 -0
- package/modern/locales/ukUA.js +7 -0
- package/modern/locales/viVN.js +7 -0
- package/modern/locales/zhCN.js +7 -0
- package/modern/locales/zhTW.js +123 -0
- package/modern/models/events/gridEvents.js +1 -0
- package/modern/utils/keyboardUtils.js +4 -3
- package/node/DataGrid/DataGrid.js +4 -4
- package/node/DataGrid/useDataGridComponent.js +1 -1
- package/node/colDef/gridActionsColDef.js +2 -0
- package/node/colDef/gridBooleanColDef.js +3 -1
- package/node/colDef/gridCheckboxSelectionColDef.js +2 -0
- package/node/colDef/gridDateOperators.js +4 -2
- package/node/colDef/gridNumericOperators.js +4 -2
- package/node/colDef/gridStringColDef.js +5 -0
- package/node/colDef/gridStringOperators.js +15 -8
- package/node/components/GridRow.js +1 -1
- package/node/components/base/GridOverlays.js +4 -1
- package/node/components/cell/GridBooleanCell.js +93 -2
- package/node/components/cell/GridEditDateCell.js +7 -1
- package/node/components/cell/index.js +13 -0
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +7 -1
- package/node/components/containers/GridRootStyles.js +10 -0
- package/node/components/panel/filterPanel/GridFilterForm.js +9 -4
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputDate.js +4 -2
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +31 -15
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +33 -15
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
- package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/node/components/toolbar/GridToolbarExport.js +16 -10
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +8 -1
- package/node/hooks/features/columns/useGridColumnSpanning.js +9 -7
- package/node/hooks/features/columns/useGridColumns.js +13 -6
- package/node/hooks/features/dimensions/useGridDimensions.js +28 -15
- package/node/hooks/features/editRows/useGridCellEditing.new.js +7 -1
- package/node/hooks/features/editRows/useGridCellEditing.old.js +6 -0
- package/node/hooks/features/editRows/useGridRowEditing.new.js +7 -1
- package/node/hooks/features/editRows/useGridRowEditing.old.js +6 -0
- package/node/hooks/features/export/utils.js +10 -2
- package/node/hooks/features/filter/gridFilterUtils.js +7 -0
- package/node/hooks/features/filter/useGridFilter.js +30 -5
- package/node/hooks/features/pagination/useGridPage.js +4 -3
- package/node/hooks/features/pagination/useGridPageSize.js +4 -3
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +12 -4
- package/node/hooks/features/rows/useGridRows.js +1 -1
- package/node/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/node/hooks/features/selection/useGridSelection.js +24 -10
- package/node/hooks/features/sorting/gridSortingUtils.js +10 -11
- package/node/hooks/features/sorting/useGridSorting.js +34 -6
- package/node/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +17 -7
- package/node/hooks/utils/useGridApiContext.js +1 -1
- package/node/hooks/utils/useGridNativeEventListener.js +1 -1
- package/node/hooks/utils/useGridRootProps.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +18 -0
- package/node/locales/arSD.js +7 -0
- package/node/locales/bgBG.js +7 -0
- package/node/locales/csCZ.js +7 -0
- package/node/locales/daDK.js +7 -0
- package/node/locales/deDE.js +12 -5
- package/node/locales/elGR.js +7 -0
- package/node/locales/esES.js +7 -0
- package/node/locales/faIR.js +7 -0
- package/node/locales/fiFI.js +7 -0
- package/node/locales/frFR.js +17 -10
- package/node/locales/heIL.js +8 -1
- package/node/locales/huHU.js +7 -0
- package/node/locales/index.js +39 -0
- package/node/locales/itIT.js +7 -0
- package/node/locales/jaJP.js +8 -1
- package/node/locales/koKR.js +7 -0
- package/node/locales/nbNO.js +8 -1
- package/node/locales/nlNL.js +21 -14
- package/node/locales/plPL.js +7 -0
- package/node/locales/ptBR.js +17 -10
- package/node/locales/roRO.js +133 -0
- package/node/locales/ruRU.js +7 -0
- package/node/locales/skSK.js +22 -15
- package/node/locales/svSE.js +8 -1
- package/node/locales/trTR.js +7 -0
- package/node/locales/ukUA.js +7 -0
- package/node/locales/viVN.js +7 -0
- package/node/locales/zhCN.js +7 -0
- package/node/locales/zhTW.js +133 -0
- package/node/models/events/gridEvents.js +1 -0
- package/node/utils/keyboardUtils.js +4 -3
- package/package.json +3 -3
- package/utils/getGridLocalization.d.ts +1 -1
- package/utils/keyboardUtils.js +4 -3
|
@@ -2,4 +2,4 @@ import { generateUtilityClasses, generateUtilityClass } from '@mui/material';
|
|
|
2
2
|
export function getDataGridUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiDataGrid', slot);
|
|
4
4
|
}
|
|
5
|
-
export var gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell', 'cellContent', 'cellCheckbox', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLinkOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle']);
|
|
5
|
+
export var gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell', 'cellContent', 'cellCheckbox', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLinkOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle']);
|
|
@@ -123,5 +123,12 @@ export var GRID_DEFAULT_LOCALE_TEXT = {
|
|
|
123
123
|
// Used core components translation keys
|
|
124
124
|
MuiTablePagination: {},
|
|
125
125
|
// Row reordering text
|
|
126
|
-
rowReorderingHeaderName: 'Row reordering'
|
|
126
|
+
rowReorderingHeaderName: 'Row reordering',
|
|
127
|
+
// Aggregation
|
|
128
|
+
aggregationMenuItemHeader: 'Aggregation',
|
|
129
|
+
aggregationFunctionLabelSum: 'sum',
|
|
130
|
+
aggregationFunctionLabelAvg: 'avg',
|
|
131
|
+
aggregationFunctionLabelMin: 'min',
|
|
132
|
+
aggregationFunctionLabelMax: 'max',
|
|
133
|
+
aggregationFunctionLabelSize: 'size'
|
|
127
134
|
};
|
|
@@ -27,10 +27,10 @@ export var useGridColumnSpanning = function useGridColumnSpanning(apiRef) {
|
|
|
27
27
|
var columnIndex = params.columnIndex,
|
|
28
28
|
rowId = params.rowId,
|
|
29
29
|
minFirstColumnIndex = params.minFirstColumnIndex,
|
|
30
|
-
maxLastColumnIndex = params.maxLastColumnIndex
|
|
31
|
-
|
|
32
|
-
var columnsLength =
|
|
33
|
-
var column =
|
|
30
|
+
maxLastColumnIndex = params.maxLastColumnIndex,
|
|
31
|
+
columns = params.columns;
|
|
32
|
+
var columnsLength = columns.length;
|
|
33
|
+
var column = columns[columnIndex];
|
|
34
34
|
var colSpan = typeof column.colSpan === 'function' ? column.colSpan(apiRef.current.getCellParams(rowId, column.field)) : column.colSpan;
|
|
35
35
|
|
|
36
36
|
if (!colSpan || colSpan === 1) {
|
|
@@ -52,7 +52,7 @@ export var useGridColumnSpanning = function useGridColumnSpanning(apiRef) {
|
|
|
52
52
|
var nextColumnIndex = columnIndex + j; // Cells should be spanned only within their column section (left-pinned, right-pinned and unpinned).
|
|
53
53
|
|
|
54
54
|
if (nextColumnIndex >= minFirstColumnIndex && nextColumnIndex < maxLastColumnIndex) {
|
|
55
|
-
var nextColumn =
|
|
55
|
+
var nextColumn = columns[nextColumnIndex];
|
|
56
56
|
width += nextColumn.computedWidth;
|
|
57
57
|
setCellColSpanInfo(rowId, columnIndex + j, {
|
|
58
58
|
spannedByColSpan: true,
|
|
@@ -78,14 +78,16 @@ export var useGridColumnSpanning = function useGridColumnSpanning(apiRef) {
|
|
|
78
78
|
var calculateColSpan = React.useCallback(function (_ref) {
|
|
79
79
|
var rowId = _ref.rowId,
|
|
80
80
|
minFirstColumn = _ref.minFirstColumn,
|
|
81
|
-
maxLastColumn = _ref.maxLastColumn
|
|
81
|
+
maxLastColumn = _ref.maxLastColumn,
|
|
82
|
+
columns = _ref.columns;
|
|
82
83
|
|
|
83
84
|
for (var i = minFirstColumn; i < maxLastColumn; i += 1) {
|
|
84
85
|
var cellProps = calculateCellColSpan({
|
|
85
86
|
columnIndex: i,
|
|
86
87
|
rowId: rowId,
|
|
87
88
|
minFirstColumnIndex: minFirstColumn,
|
|
88
|
-
maxLastColumnIndex: maxLastColumn
|
|
89
|
+
maxLastColumnIndex: maxLastColumn,
|
|
90
|
+
columns: columns
|
|
89
91
|
});
|
|
90
92
|
|
|
91
93
|
if (cellProps.colSpan > 1) {
|
|
@@ -38,7 +38,7 @@ export var columnsStateInitializer = function columnsStateInitializer(state, pro
|
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
40
|
export function useGridColumns(apiRef, props) {
|
|
41
|
-
var _props$componentsProp2;
|
|
41
|
+
var _props$initialState5, _props$componentsProp2;
|
|
42
42
|
|
|
43
43
|
var logger = useGridLogger(apiRef, 'useGridColumns');
|
|
44
44
|
var columnTypes = React.useMemo(function () {
|
|
@@ -213,16 +213,21 @@ export function useGridColumns(apiRef, props) {
|
|
|
213
213
|
* PRE-PROCESSING
|
|
214
214
|
*/
|
|
215
215
|
|
|
216
|
-
var stateExportPreProcessing = React.useCallback(function (prevState) {
|
|
216
|
+
var stateExportPreProcessing = React.useCallback(function (prevState, context) {
|
|
217
217
|
var columnsStateToExport = {};
|
|
218
218
|
|
|
219
219
|
if (apiRef.current.unstable_caches.columns.isUsingColumnVisibilityModel) {
|
|
220
|
-
var
|
|
221
|
-
var hasHiddenColumns = Object.values(columnVisibilityModelToExport).some(function (value) {
|
|
222
|
-
return value === false;
|
|
223
|
-
});
|
|
220
|
+
var _props$initialState$c2, _props$initialState4, _props$initialState4$;
|
|
224
221
|
|
|
225
|
-
|
|
222
|
+
var columnVisibilityModelToExport = gridColumnVisibilityModelSelector(apiRef);
|
|
223
|
+
var shouldExportColumnVisibilityModel = // Always export if the `exportOnlyDirtyModels` property is activated
|
|
224
|
+
!context.exportOnlyDirtyModels || // Always export if the model is controlled
|
|
225
|
+
props.columnVisibilityModel != null || // Always export if the model has been initialized
|
|
226
|
+
// TODO v6 Do a nullish check instead to export even if the initial model equals "{}"
|
|
227
|
+
Object.keys((_props$initialState$c2 = (_props$initialState4 = props.initialState) == null ? void 0 : (_props$initialState4$ = _props$initialState4.columns) == null ? void 0 : _props$initialState4$.columnVisibilityModel) != null ? _props$initialState$c2 : {}).length > 0 || // Always export if the model is not empty
|
|
228
|
+
Object.keys(columnVisibilityModelToExport).length > 0;
|
|
229
|
+
|
|
230
|
+
if (shouldExportColumnVisibilityModel) {
|
|
226
231
|
columnsStateToExport.columnVisibilityModel = columnVisibilityModelToExport;
|
|
227
232
|
}
|
|
228
233
|
}
|
|
@@ -253,7 +258,7 @@ export function useGridColumns(apiRef, props) {
|
|
|
253
258
|
return _extends({}, prevState, {
|
|
254
259
|
columns: columnsStateToExport
|
|
255
260
|
});
|
|
256
|
-
}, [apiRef]);
|
|
261
|
+
}, [apiRef, props.columnVisibilityModel, (_props$initialState5 = props.initialState) == null ? void 0 : _props$initialState5.columns]);
|
|
257
262
|
var stateRestorePreProcessing = React.useCallback(function (params, context) {
|
|
258
263
|
var _context$stateToResto;
|
|
259
264
|
|
|
@@ -70,21 +70,33 @@ export function useGridDimensions(apiRef, props) {
|
|
|
70
70
|
rootElement.removeChild(scrollDiv);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
var viewportOuterSize
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
73
|
+
var viewportOuterSize;
|
|
74
|
+
var hasScrollX;
|
|
75
|
+
var hasScrollY;
|
|
76
|
+
|
|
77
|
+
if (props.autoHeight) {
|
|
78
|
+
hasScrollY = false;
|
|
79
|
+
hasScrollX = Math.round(columnsTotalWidth) > rootDimensionsRef.current.width;
|
|
80
|
+
viewportOuterSize = {
|
|
81
|
+
width: rootDimensionsRef.current.width,
|
|
82
|
+
height: rowsMeta.currentPageTotalHeight + (hasScrollX ? scrollBarSize : 0)
|
|
83
|
+
};
|
|
84
|
+
} else {
|
|
85
|
+
viewportOuterSize = {
|
|
86
|
+
width: rootDimensionsRef.current.width,
|
|
87
|
+
height: rootDimensionsRef.current.height - headerHeight
|
|
88
|
+
};
|
|
89
|
+
var scrollInformation = hasScroll({
|
|
90
|
+
content: {
|
|
91
|
+
width: Math.round(columnsTotalWidth),
|
|
92
|
+
height: rowsMeta.currentPageTotalHeight
|
|
93
|
+
},
|
|
94
|
+
container: viewportOuterSize,
|
|
95
|
+
scrollBarSize: scrollBarSize
|
|
96
|
+
});
|
|
97
|
+
hasScrollY = scrollInformation.hasScrollY;
|
|
98
|
+
hasScrollX = scrollInformation.hasScrollX;
|
|
99
|
+
}
|
|
88
100
|
|
|
89
101
|
var viewportInnerSize = {
|
|
90
102
|
width: viewportOuterSize.width - (hasScrollY ? scrollBarSize : 0),
|
|
@@ -78,6 +78,12 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
78
78
|
}, [apiRef]);
|
|
79
79
|
var handleCellKeyDown = React.useCallback(function (params, event) {
|
|
80
80
|
if (params.cellMode === GridCellModes.Edit) {
|
|
81
|
+
// Wait until IME is settled for Asian languages like Japanese and Chinese
|
|
82
|
+
// TODO: `event.which` is depricated but this is a temporary workaround
|
|
83
|
+
if (event.which === 229) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
81
87
|
var reason;
|
|
82
88
|
|
|
83
89
|
if (event.key === 'Escape') {
|
|
@@ -100,7 +106,7 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
100
106
|
var _reason;
|
|
101
107
|
|
|
102
108
|
if (isPrintableKey(event.key)) {
|
|
103
|
-
if (event.
|
|
109
|
+
if (event.ctrlKey && event.key !== 'v' || event.metaKey && event.key !== 'v' || event.altKey) {
|
|
104
110
|
return;
|
|
105
111
|
}
|
|
106
112
|
|
|
@@ -189,16 +189,24 @@ export var useCellEditing = function useCellEditing(apiRef, props) {
|
|
|
189
189
|
while (1) {
|
|
190
190
|
switch (_context.prev = _context.next) {
|
|
191
191
|
case 0:
|
|
192
|
+
if (!(event.which === 229)) {
|
|
193
|
+
_context.next = 2;
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return _context.abrupt("return");
|
|
198
|
+
|
|
199
|
+
case 2:
|
|
192
200
|
id = params.id, field = params.field, cellMode = params.cellMode, isEditable = params.isEditable;
|
|
193
201
|
|
|
194
202
|
if (isEditable) {
|
|
195
|
-
_context.next =
|
|
203
|
+
_context.next = 5;
|
|
196
204
|
break;
|
|
197
205
|
}
|
|
198
206
|
|
|
199
207
|
return _context.abrupt("return");
|
|
200
208
|
|
|
201
|
-
case
|
|
209
|
+
case 5:
|
|
202
210
|
isEditMode = cellMode === GridCellModes.Edit;
|
|
203
211
|
isModifierKeyPressed = event.ctrlKey || event.metaKey || event.altKey;
|
|
204
212
|
|
|
@@ -220,7 +228,7 @@ export var useCellEditing = function useCellEditing(apiRef, props) {
|
|
|
220
228
|
}
|
|
221
229
|
|
|
222
230
|
if (!(isEditMode && isCellEditCommitKeys(event.key))) {
|
|
223
|
-
_context.next =
|
|
231
|
+
_context.next = 16;
|
|
224
232
|
break;
|
|
225
233
|
}
|
|
226
234
|
|
|
@@ -228,25 +236,25 @@ export var useCellEditing = function useCellEditing(apiRef, props) {
|
|
|
228
236
|
id: id,
|
|
229
237
|
field: field
|
|
230
238
|
};
|
|
231
|
-
_context.next =
|
|
239
|
+
_context.next = 13;
|
|
232
240
|
return apiRef.current.commitCellChange(commitParams, event);
|
|
233
241
|
|
|
234
|
-
case
|
|
242
|
+
case 13:
|
|
235
243
|
isValid = _context.sent;
|
|
236
244
|
|
|
237
245
|
if (isValid) {
|
|
238
|
-
_context.next =
|
|
246
|
+
_context.next = 16;
|
|
239
247
|
break;
|
|
240
248
|
}
|
|
241
249
|
|
|
242
250
|
return _context.abrupt("return");
|
|
243
251
|
|
|
244
|
-
case
|
|
252
|
+
case 16:
|
|
245
253
|
if (isEditMode && isCellExitEditModeKeys(event.key)) {
|
|
246
254
|
apiRef.current.publishEvent('cellEditStop', params, event);
|
|
247
255
|
}
|
|
248
256
|
|
|
249
|
-
case
|
|
257
|
+
case 17:
|
|
250
258
|
case "end":
|
|
251
259
|
return _context.stop();
|
|
252
260
|
}
|
|
@@ -116,6 +116,12 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
|
|
|
116
116
|
}, []);
|
|
117
117
|
var handleCellKeyDown = React.useCallback(function (params, event) {
|
|
118
118
|
if (params.cellMode === GridRowModes.Edit) {
|
|
119
|
+
// Wait until IME is settled for Asian languages like Japanese and Chinese
|
|
120
|
+
// TODO: `event.which` is depricated but this is a temporary workaround
|
|
121
|
+
if (event.which === 229) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
119
125
|
var reason;
|
|
120
126
|
|
|
121
127
|
if (event.key === 'Escape') {
|
|
@@ -156,7 +162,7 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
|
|
|
156
162
|
var _reason;
|
|
157
163
|
|
|
158
164
|
if (isPrintableKey(event.key)) {
|
|
159
|
-
if (event.
|
|
165
|
+
if (event.ctrlKey && event.key !== 'v' || event.metaKey && event.key !== 'v' || event.altKey) {
|
|
160
166
|
return;
|
|
161
167
|
}
|
|
162
168
|
|
|
@@ -241,62 +241,70 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
|
|
|
241
241
|
while (1) {
|
|
242
242
|
switch (_context3.prev = _context3.next) {
|
|
243
243
|
case 0:
|
|
244
|
+
if (!(event.which === 229)) {
|
|
245
|
+
_context3.next = 2;
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return _context3.abrupt("return");
|
|
250
|
+
|
|
251
|
+
case 2:
|
|
244
252
|
cellMode = params.cellMode, isEditable = params.isEditable;
|
|
245
253
|
|
|
246
254
|
if (isEditable) {
|
|
247
|
-
_context3.next =
|
|
255
|
+
_context3.next = 5;
|
|
248
256
|
break;
|
|
249
257
|
}
|
|
250
258
|
|
|
251
259
|
return _context3.abrupt("return");
|
|
252
260
|
|
|
253
|
-
case
|
|
261
|
+
case 5:
|
|
254
262
|
isEditMode = cellMode === GridCellModes.Edit;
|
|
255
263
|
rowParams = apiRef.current.getRowParams(params.id);
|
|
256
264
|
|
|
257
265
|
if (!isEditMode) {
|
|
258
|
-
_context3.next =
|
|
266
|
+
_context3.next = 20;
|
|
259
267
|
break;
|
|
260
268
|
}
|
|
261
269
|
|
|
262
270
|
if (!(event.key === 'Enter')) {
|
|
263
|
-
_context3.next =
|
|
271
|
+
_context3.next = 17;
|
|
264
272
|
break;
|
|
265
273
|
}
|
|
266
274
|
|
|
267
|
-
_context3.next =
|
|
275
|
+
_context3.next = 11;
|
|
268
276
|
return apiRef.current.commitRowChange(params.id);
|
|
269
277
|
|
|
270
|
-
case
|
|
278
|
+
case 11:
|
|
271
279
|
isValid = _context3.sent;
|
|
272
280
|
|
|
273
281
|
if (!(!isValid && (_props$experimentalFe3 = props.experimentalFeatures) != null && _props$experimentalFe3.preventCommitWhileValidating)) {
|
|
274
|
-
_context3.next =
|
|
282
|
+
_context3.next = 14;
|
|
275
283
|
break;
|
|
276
284
|
}
|
|
277
285
|
|
|
278
286
|
return _context3.abrupt("return");
|
|
279
287
|
|
|
280
|
-
case
|
|
288
|
+
case 14:
|
|
281
289
|
apiRef.current.publishEvent('rowEditStop', rowParams, event);
|
|
282
|
-
_context3.next =
|
|
290
|
+
_context3.next = 18;
|
|
283
291
|
break;
|
|
284
292
|
|
|
285
|
-
case
|
|
293
|
+
case 17:
|
|
286
294
|
if (event.key === 'Escape') {
|
|
287
295
|
apiRef.current.publishEvent('rowEditStop', rowParams, event);
|
|
288
296
|
}
|
|
289
297
|
|
|
290
|
-
case
|
|
291
|
-
_context3.next =
|
|
298
|
+
case 18:
|
|
299
|
+
_context3.next = 21;
|
|
292
300
|
break;
|
|
293
301
|
|
|
294
|
-
case
|
|
302
|
+
case 20:
|
|
295
303
|
if (event.key === 'Enter') {
|
|
296
304
|
apiRef.current.publishEvent('rowEditStart', rowParams, event);
|
|
297
305
|
}
|
|
298
306
|
|
|
299
|
-
case
|
|
307
|
+
case 21:
|
|
300
308
|
case "end":
|
|
301
309
|
return _context3.stop();
|
|
302
310
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { gridColumnDefinitionsSelector, gridVisibleColumnDefinitionsSelector } from '../columns';
|
|
2
2
|
import { gridFilteredSortedRowIdsSelector } from '../filter';
|
|
3
|
+
import { gridRowTreeSelector } from '../rows/gridRowsSelector';
|
|
3
4
|
export var getColumnsToExport = function getColumnsToExport(_ref) {
|
|
4
5
|
var apiRef = _ref.apiRef,
|
|
5
6
|
options = _ref.options;
|
|
@@ -23,13 +24,19 @@ export var getColumnsToExport = function getColumnsToExport(_ref) {
|
|
|
23
24
|
export var defaultGetRowsToExport = function defaultGetRowsToExport(_ref2) {
|
|
24
25
|
var apiRef = _ref2.apiRef;
|
|
25
26
|
var filteredSortedRowIds = gridFilteredSortedRowIdsSelector(apiRef);
|
|
27
|
+
var rowTree = gridRowTreeSelector(apiRef);
|
|
26
28
|
var selectedRows = apiRef.current.getSelectedRows();
|
|
29
|
+
var bodyRows = filteredSortedRowIds.filter(function (id) {
|
|
30
|
+
var _rowTree$id$position;
|
|
31
|
+
|
|
32
|
+
return ((_rowTree$id$position = rowTree[id].position) != null ? _rowTree$id$position : 'body') === 'body';
|
|
33
|
+
});
|
|
27
34
|
|
|
28
35
|
if (selectedRows.size > 0) {
|
|
29
|
-
return
|
|
36
|
+
return bodyRows.filter(function (id) {
|
|
30
37
|
return selectedRows.has(id);
|
|
31
38
|
});
|
|
32
39
|
}
|
|
33
40
|
|
|
34
|
-
return
|
|
41
|
+
return bodyRows;
|
|
35
42
|
};
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import { GridLinkOperator } from '../../../models';
|
|
3
3
|
import { buildWarning } from '../../../utils/warning';
|
|
4
4
|
import { gridColumnFieldsSelector, gridColumnLookupSelector } from '../columns';
|
|
5
|
+
import { gridRowTreeSelector } from '../rows/gridRowsSelector';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Adds default values to the optional fields of a filter items.
|
|
@@ -89,6 +90,7 @@ export var buildAggregatedFilterItemsApplier = function buildAggregatedFilterIte
|
|
|
89
90
|
var items = filterModel.items,
|
|
90
91
|
_filterModel$linkOper = filterModel.linkOperator,
|
|
91
92
|
linkOperator = _filterModel$linkOper === void 0 ? GridLinkOperator.And : _filterModel$linkOper;
|
|
93
|
+
var tree = gridRowTreeSelector(apiRef);
|
|
92
94
|
|
|
93
95
|
var getFilterCallbackFromItem = function getFilterCallbackFromItem(filterItem) {
|
|
94
96
|
if (!filterItem.columnField || !filterItem.operatorValue) {
|
|
@@ -158,6 +160,10 @@ export var buildAggregatedFilterItemsApplier = function buildAggregatedFilterIte
|
|
|
158
160
|
}
|
|
159
161
|
|
|
160
162
|
return function (rowId, shouldApplyFilter) {
|
|
163
|
+
if (tree[rowId].position === 'footer') {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
|
|
161
167
|
var filteredAppliers = shouldApplyFilter ? appliers.filter(function (applier) {
|
|
162
168
|
return shouldApplyFilter(applier.item.columnField);
|
|
163
169
|
}) : appliers; // Return `false` as soon as we have a failing filter
|
|
@@ -35,7 +35,7 @@ export var filterStateInitializer = function filterStateInitializer(state, props
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
export var useGridFilter = function useGridFilter(apiRef, props) {
|
|
38
|
-
var _props$componentsProp2;
|
|
38
|
+
var _props$initialState3, _props$initialState3$, _props$componentsProp2;
|
|
39
39
|
|
|
40
40
|
var logger = useGridLogger(apiRef, 'useGridFilter');
|
|
41
41
|
apiRef.current.unstable_registerControlState({
|
|
@@ -125,7 +125,25 @@ export var useGridFilter = function useGridFilter(apiRef, props) {
|
|
|
125
125
|
if (targetColumnField) {
|
|
126
126
|
var filterModel = gridFilterModelSelector(apiRef);
|
|
127
127
|
var filterItemsWithValue = filterModel.items.filter(function (item) {
|
|
128
|
-
|
|
128
|
+
var _column$filterOperato;
|
|
129
|
+
|
|
130
|
+
if (item.value !== undefined) {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
var column = apiRef.current.getColumn(item.columnField);
|
|
135
|
+
var filterOperator = (_column$filterOperato = column.filterOperators) == null ? void 0 : _column$filterOperato.find(function (operator) {
|
|
136
|
+
return operator.value === item.operatorValue;
|
|
137
|
+
});
|
|
138
|
+
var requiresFilterValue = typeof (filterOperator == null ? void 0 : filterOperator.requiresFilterValue) === 'undefined' ? true : filterOperator == null ? void 0 : filterOperator.requiresFilterValue; // Operators like `isEmpty` don't have and don't require `item.value`.
|
|
139
|
+
// So we don't want to remove them from the filter model if `item.value === undefined`.
|
|
140
|
+
// See https://github.com/mui/mui-x/issues/5402
|
|
141
|
+
|
|
142
|
+
if (requiresFilterValue) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return true;
|
|
129
147
|
});
|
|
130
148
|
var newFilterItems;
|
|
131
149
|
var filterItemOnTarget = filterItemsWithValue.find(function (item) {
|
|
@@ -209,10 +227,17 @@ export var useGridFilter = function useGridFilter(apiRef, props) {
|
|
|
209
227
|
* PRE-PROCESSING
|
|
210
228
|
*/
|
|
211
229
|
|
|
212
|
-
var stateExportPreProcessing = React.useCallback(function (prevState) {
|
|
230
|
+
var stateExportPreProcessing = React.useCallback(function (prevState, context) {
|
|
231
|
+
var _props$initialState2, _props$initialState2$;
|
|
232
|
+
|
|
213
233
|
var filterModelToExport = gridFilterModelSelector(apiRef);
|
|
234
|
+
var shouldExportFilterModel = // Always export if the `exportOnlyDirtyModels` property is activated
|
|
235
|
+
!context.exportOnlyDirtyModels || // Always export if the model is controlled
|
|
236
|
+
props.filterModel != null || // Always export if the model has been initialized
|
|
237
|
+
((_props$initialState2 = props.initialState) == null ? void 0 : (_props$initialState2$ = _props$initialState2.filter) == null ? void 0 : _props$initialState2$.filterModel) != null || // Export if the model is not equal to the default value
|
|
238
|
+
!isDeepEqual(filterModelToExport, getDefaultGridFilterModel());
|
|
214
239
|
|
|
215
|
-
if (
|
|
240
|
+
if (!shouldExportFilterModel) {
|
|
216
241
|
return prevState;
|
|
217
242
|
}
|
|
218
243
|
|
|
@@ -221,7 +246,7 @@ export var useGridFilter = function useGridFilter(apiRef, props) {
|
|
|
221
246
|
filterModel: filterModelToExport
|
|
222
247
|
}
|
|
223
248
|
});
|
|
224
|
-
}, [apiRef]);
|
|
249
|
+
}, [apiRef, props.filterModel, (_props$initialState3 = props.initialState) == null ? void 0 : (_props$initialState3$ = _props$initialState3.filter) == null ? void 0 : _props$initialState3$.filterModel]);
|
|
225
250
|
var stateRestorePreProcessing = React.useCallback(function (params, context) {
|
|
226
251
|
var _context$stateToResto;
|
|
227
252
|
|
|
@@ -67,13 +67,14 @@ export var useGridPage = function useGridPage(apiRef, props) {
|
|
|
67
67
|
* PRE-PROCESSING
|
|
68
68
|
*/
|
|
69
69
|
|
|
70
|
-
var stateExportPreProcessing = React.useCallback(function (prevState) {
|
|
70
|
+
var stateExportPreProcessing = React.useCallback(function (prevState, context) {
|
|
71
71
|
var _props$initialState, _props$initialState$p;
|
|
72
72
|
|
|
73
73
|
var pageToExport = gridPageSelector(apiRef);
|
|
74
|
-
var shouldExportPage = // Always export if the
|
|
74
|
+
var shouldExportPage = // Always export if the `exportOnlyDirtyModels` property is activated
|
|
75
|
+
!context.exportOnlyDirtyModels || // Always export if the page is controlled
|
|
75
76
|
props.page != null || // Always export if the page has been initialized
|
|
76
|
-
((_props$initialState = props.initialState) == null ? void 0 : (_props$initialState$p = _props$initialState.pagination) == null ? void 0 : _props$initialState$p.page) != null || // Export if the page
|
|
77
|
+
((_props$initialState = props.initialState) == null ? void 0 : (_props$initialState$p = _props$initialState.pagination) == null ? void 0 : _props$initialState$p.page) != null || // Export if the page is not equal to the default value
|
|
77
78
|
pageToExport !== 0;
|
|
78
79
|
|
|
79
80
|
if (!shouldExportPage) {
|
|
@@ -55,13 +55,14 @@ export var useGridPageSize = function useGridPageSize(apiRef, props) {
|
|
|
55
55
|
* PRE-PROCESSING
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
|
-
var stateExportPreProcessing = React.useCallback(function (prevState) {
|
|
58
|
+
var stateExportPreProcessing = React.useCallback(function (prevState, context) {
|
|
59
59
|
var _props$initialState, _props$initialState$p;
|
|
60
60
|
|
|
61
61
|
var pageSizeToExport = gridPageSizeSelector(apiRef);
|
|
62
|
-
var shouldExportPageSize = // Always export if the
|
|
62
|
+
var shouldExportPageSize = // Always export if the `exportOnlyDirtyModels` property is activated
|
|
63
|
+
!context.exportOnlyDirtyModels || // Always export if the page size is controlled
|
|
63
64
|
props.pageSize != null || // Always export if the page size has been initialized
|
|
64
|
-
((_props$initialState = props.initialState) == null ? void 0 : (_props$initialState$p = _props$initialState.pagination) == null ? void 0 : _props$initialState$p.pageSize) != null || // Export if the page size
|
|
65
|
+
((_props$initialState = props.initialState) == null ? void 0 : (_props$initialState$p = _props$initialState.pagination) == null ? void 0 : _props$initialState$p.pageSize) != null || // Export if the page size is not equal to the default value
|
|
65
66
|
pageSizeToExport !== defaultPageSize(props.autoPageSize);
|
|
66
67
|
|
|
67
68
|
if (!shouldExportPageSize) {
|
|
@@ -17,7 +17,9 @@ export var preferencePanelStateInitializer = function preferencePanelStateInitia
|
|
|
17
17
|
* TODO: Add a single `setPreferencePanel` method to avoid multiple `setState`
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
export var useGridPreferencesPanel = function useGridPreferencesPanel(apiRef) {
|
|
20
|
+
export var useGridPreferencesPanel = function useGridPreferencesPanel(apiRef, props) {
|
|
21
|
+
var _props$initialState3;
|
|
22
|
+
|
|
21
23
|
var logger = useGridLogger(apiRef, 'useGridPreferencesPanel');
|
|
22
24
|
var hideTimeout = React.useRef();
|
|
23
25
|
var immediateTimeout = React.useRef();
|
|
@@ -80,17 +82,23 @@ export var useGridPreferencesPanel = function useGridPreferencesPanel(apiRef) {
|
|
|
80
82
|
* PRE-PROCESSING
|
|
81
83
|
*/
|
|
82
84
|
|
|
83
|
-
var stateExportPreProcessing = React.useCallback(function (prevState) {
|
|
85
|
+
var stateExportPreProcessing = React.useCallback(function (prevState, context) {
|
|
86
|
+
var _props$initialState2;
|
|
87
|
+
|
|
84
88
|
var preferencePanelToExport = gridPreferencePanelStateSelector(apiRef.current.state);
|
|
89
|
+
var shouldExportPreferencePanel = // Always export if the `exportOnlyDirtyModels` property is activated
|
|
90
|
+
!context.exportOnlyDirtyModels || // Always export if the panel was initialized
|
|
91
|
+
((_props$initialState2 = props.initialState) == null ? void 0 : _props$initialState2.preferencePanel) != null || // Always export if the panel is opened
|
|
92
|
+
preferencePanelToExport.open;
|
|
85
93
|
|
|
86
|
-
if (!
|
|
94
|
+
if (!shouldExportPreferencePanel) {
|
|
87
95
|
return prevState;
|
|
88
96
|
}
|
|
89
97
|
|
|
90
98
|
return _extends({}, prevState, {
|
|
91
99
|
preferencePanel: preferencePanelToExport
|
|
92
100
|
});
|
|
93
|
-
}, [apiRef]);
|
|
101
|
+
}, [apiRef, (_props$initialState3 = props.initialState) == null ? void 0 : _props$initialState3.preferencePanel]);
|
|
94
102
|
var stateRestorePreProcessing = React.useCallback(function (params, context) {
|
|
95
103
|
var preferencePanel = context.stateToRestore.preferencePanel;
|
|
96
104
|
|
|
@@ -102,7 +102,7 @@ export var useGridRows = function useGridRows(apiRef, props) {
|
|
|
102
102
|
var updateRows = React.useCallback(function (updates) {
|
|
103
103
|
if (props.signature === GridSignature.DataGrid && updates.length > 1) {
|
|
104
104
|
// TODO: Add test with direct call to `apiRef.current.updateRows` in DataGrid after enabling the `apiRef` on the free plan.
|
|
105
|
-
throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.", 'You need to upgrade to
|
|
105
|
+
throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.", 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
|
|
106
106
|
} // we remove duplicate updates. A server can batch updates, and send several updates for the same row in one fn call.
|
|
107
107
|
|
|
108
108
|
|
|
@@ -10,7 +10,7 @@ var flatRowTreeCreationMethod = function flatRowTreeCreationMethod(_ref) {
|
|
|
10
10
|
for (var i = 0; i < ids.length; i += 1) {
|
|
11
11
|
var rowId = ids[i];
|
|
12
12
|
|
|
13
|
-
if (previousTree && previousTree[rowId]) {
|
|
13
|
+
if (previousTree && previousTree[rowId] && previousTree[rowId].depth === 0 && previousTree[rowId].parent == null) {
|
|
14
14
|
tree[rowId] = previousTree[rowId];
|
|
15
15
|
} else {
|
|
16
16
|
tree[rowId] = {
|