@mui/x-data-grid 5.8.0 → 5.11.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 +333 -66
- package/DataGrid/DataGrid.js +36 -2
- package/DataGrid/useDataGridComponent.js +3 -1
- package/DataGrid/useDataGridProps.js +2 -1
- package/LICENSE +21 -0
- package/README.md +7 -5
- package/colDef/gridActionsColDef.js +2 -1
- package/colDef/gridBooleanColDef.js +2 -1
- package/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/colDef/gridDateColDef.js +4 -2
- package/colDef/gridNumericColDef.js +3 -2
- package/colDef/gridNumericOperators.d.ts +2 -0
- package/colDef/gridNumericOperators.js +11 -0
- package/colDef/gridSingleSelectColDef.js +3 -2
- package/colDef/gridSingleSelectOperators.d.ts +3 -0
- package/colDef/gridSingleSelectOperators.js +52 -0
- package/colDef/gridStringColDef.js +3 -2
- package/colDef/gridStringOperators.d.ts +2 -0
- package/colDef/gridStringOperators.js +12 -0
- package/components/GridFooter.d.ts +4 -2
- package/components/GridFooter.js +11 -2
- package/components/GridRow.d.ts +4 -0
- package/components/GridRow.js +58 -28
- package/components/GridRowCount.d.ts +4 -1
- package/components/GridRowCount.js +1 -0
- package/components/GridScrollArea.js +3 -4
- package/components/GridSelectedRowCount.d.ts +4 -1
- package/components/GridSelectedRowCount.js +2 -1
- package/components/base/GridBody.js +1 -2
- package/components/base/GridOverlays.js +5 -5
- package/components/cell/GridActionsCell.d.ts +5 -1
- package/components/cell/GridActionsCell.js +179 -21
- package/components/cell/GridActionsCellItem.d.ts +66 -4
- package/components/cell/GridActionsCellItem.js +7 -5
- package/components/cell/GridCell.d.ts +1 -0
- package/components/cell/GridCell.js +36 -15
- package/components/cell/GridEditBooleanCell.d.ts +15 -3
- package/components/cell/GridEditBooleanCell.js +101 -6
- package/components/cell/GridEditDateCell.d.ts +16 -4
- package/components/cell/GridEditDateCell.js +99 -5
- package/components/cell/GridEditInputCell.d.ts +11 -5
- package/components/cell/GridEditInputCell.js +30 -6
- package/components/cell/GridEditSingleSelectCell.d.ts +12 -4
- package/components/cell/GridEditSingleSelectCell.js +50 -18
- package/components/cell/index.d.ts +2 -0
- package/components/cell/index.js +2 -0
- package/components/columnHeaders/GridColumnHeaderItem.js +19 -23
- package/components/columnHeaders/GridColumnHeaders.d.ts +2 -1
- package/components/columnHeaders/GridColumnHeaders.js +1 -1
- package/components/columnHeaders/GridColumnHeadersInner.d.ts +2 -0
- package/components/columnSelection/GridCellCheckboxRenderer.d.ts +3 -3
- package/components/columnSelection/GridCellCheckboxRenderer.js +22 -6
- package/components/columnSelection/GridHeaderCheckbox.js +4 -5
- package/components/containers/GridFooterContainer.d.ts +8 -2
- package/components/containers/GridFooterContainer.js +11 -2
- package/components/containers/GridRootStyles.js +36 -1
- package/components/containers/GridToolbarContainer.d.ts +8 -2
- package/components/containers/GridToolbarContainer.js +12 -2
- package/components/menu/GridMenu.js +1 -0
- package/components/panel/GridPanel.js +1 -0
- package/components/panel/GridPanelContent.d.ts +8 -1
- package/components/panel/GridPanelContent.js +13 -2
- package/components/panel/GridPanelFooter.d.ts +8 -1
- package/components/panel/GridPanelFooter.js +13 -2
- package/components/panel/GridPanelHeader.d.ts +8 -1
- package/components/panel/GridPanelHeader.js +13 -2
- package/components/panel/filterPanel/GridFilterForm.js +14 -10
- package/components/panel/filterPanel/GridFilterInputBoolean.js +13 -8
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +22 -15
- package/components/panel/filterPanel/GridFilterInputValue.js +22 -15
- package/components/toolbar/GridToolbar.d.ts +12 -2
- package/components/toolbar/GridToolbar.js +30 -7
- package/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/components/toolbar/GridToolbarExport.d.ts +5 -4
- package/components/toolbar/GridToolbarExport.js +15 -20
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/components/toolbar/GridToolbarQuickFilter.d.ts +20 -0
- package/components/toolbar/GridToolbarQuickFilter.js +88 -0
- package/components/toolbar/index.d.ts +3 -1
- package/components/toolbar/index.js +3 -2
- package/components/virtualization/GridVirtualScroller.d.ts +4 -1
- package/components/virtualization/GridVirtualScroller.js +2 -0
- package/components/virtualization/GridVirtualScrollerContent.d.ts +4 -1
- package/components/virtualization/GridVirtualScrollerContent.js +1 -3
- package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +4 -1
- package/constants/defaultGridSlotsComponents.js +3 -2
- package/constants/gridClasses.d.ts +20 -0
- package/constants/gridClasses.js +1 -1
- package/constants/gridDetailPanelToggleField.d.ts +1 -0
- package/constants/gridDetailPanelToggleField.js +2 -0
- package/constants/localeTextConstants.js +8 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +39 -15
- package/hooks/core/pipeProcessing/index.d.ts +1 -0
- package/hooks/core/pipeProcessing/index.js +2 -1
- package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +8 -3
- package/hooks/core/pipeProcessing/useGridPipeProcessing.js +53 -19
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +3 -0
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +27 -0
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +0 -3
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +0 -4
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +4 -4
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +6 -7
- package/hooks/core/useGridApiInitialization.js +3 -3
- package/hooks/core/useGridErrorHandler.js +1 -2
- package/hooks/core/useGridStateInitialization.js +1 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +0 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +81 -16
- package/hooks/features/columnMenu/useGridColumnMenu.js +3 -3
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +3 -1
- package/hooks/features/columns/gridColumnsUtils.d.ts +19 -1
- package/hooks/features/columns/gridColumnsUtils.js +61 -8
- package/hooks/features/columns/useGridColumnSpanning.d.ts +7 -0
- package/hooks/features/columns/useGridColumnSpanning.js +108 -0
- package/hooks/features/columns/useGridColumns.d.ts +1 -1
- package/hooks/features/columns/useGridColumns.js +30 -25
- package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +10 -11
- package/hooks/features/editRows/useGridCellEditing.new.d.ts +1 -1
- package/hooks/features/editRows/useGridCellEditing.new.js +151 -42
- package/hooks/features/editRows/useGridCellEditing.old.js +20 -21
- package/hooks/features/editRows/useGridEditing.new.js +7 -3
- package/hooks/features/editRows/useGridEditing.old.js +4 -5
- package/hooks/features/editRows/useGridRowEditing.new.d.ts +1 -1
- package/hooks/features/editRows/useGridRowEditing.new.js +145 -57
- package/hooks/features/editRows/useGridRowEditing.old.js +21 -22
- package/hooks/features/events/useGridEvents.js +17 -18
- package/hooks/features/export/serializers/csvSerializer.js +5 -5
- package/hooks/features/export/useGridCsvExport.js +23 -16
- package/hooks/features/export/useGridPrintExport.js +22 -0
- package/hooks/features/export/utils.d.ts +3 -1
- package/hooks/features/export/utils.js +13 -0
- package/hooks/features/filter/gridFilterState.d.ts +1 -2
- package/hooks/features/filter/gridFilterState.js +3 -1
- package/hooks/features/filter/gridFilterUtils.d.ts +8 -0
- package/hooks/features/filter/gridFilterUtils.js +84 -2
- package/hooks/features/filter/useGridFilter.js +32 -15
- package/hooks/features/focus/useGridFocus.d.ts +1 -1
- package/hooks/features/focus/useGridFocus.js +48 -42
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -0
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +43 -12
- package/hooks/features/pagination/useGridPage.js +3 -4
- package/hooks/features/pagination/useGridPageSize.js +2 -3
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -6
- package/hooks/features/rows/gridRowsSelector.d.ts +2 -0
- package/hooks/features/rows/gridRowsSelector.js +2 -0
- package/hooks/features/rows/gridRowsState.d.ts +7 -7
- package/hooks/features/rows/gridRowsUtils.d.ts +2 -1
- package/hooks/features/rows/gridRowsUtils.js +25 -1
- package/hooks/features/rows/useGridRows.d.ts +2 -2
- package/hooks/features/rows/useGridRows.js +121 -61
- package/hooks/features/rows/useGridRowsMeta.js +6 -13
- package/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
- package/hooks/features/scroll/useGridScroll.d.ts +2 -0
- package/hooks/features/scroll/useGridScroll.js +31 -4
- package/hooks/features/selection/useGridSelection.d.ts +1 -1
- package/hooks/features/selection/useGridSelection.js +15 -11
- package/hooks/features/sorting/useGridSorting.js +17 -18
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +9 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +68 -32
- package/hooks/utils/useGridApiEventHandler.d.ts +4 -1
- package/hooks/utils/useGridApiEventHandler.js +22 -9
- package/hooks/utils/useGridNativeEventListener.js +1 -2
- package/hooks/utils/useGridSelector.js +1 -1
- package/index.d.ts +2 -0
- package/index.js +1 -1
- package/internals/index.d.ts +5 -1
- package/internals/index.js +6 -2
- package/legacy/DataGrid/DataGrid.js +36 -2
- package/legacy/DataGrid/useDataGridComponent.js +3 -1
- package/legacy/DataGrid/useDataGridProps.js +2 -1
- package/legacy/colDef/gridActionsColDef.js +2 -1
- package/legacy/colDef/gridBooleanColDef.js +2 -1
- package/legacy/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/legacy/colDef/gridDateColDef.js +4 -2
- package/legacy/colDef/gridNumericColDef.js +3 -2
- package/legacy/colDef/gridNumericOperators.js +28 -18
- package/legacy/colDef/gridSingleSelectColDef.js +3 -2
- package/legacy/colDef/gridSingleSelectOperators.js +55 -6
- package/legacy/colDef/gridStringColDef.js +3 -2
- package/legacy/colDef/gridStringOperators.js +25 -14
- package/legacy/components/GridFooter.js +11 -2
- package/legacy/components/GridRow.js +56 -28
- package/legacy/components/GridRowCount.js +1 -0
- package/legacy/components/GridScrollArea.js +3 -4
- package/legacy/components/GridSelectedRowCount.js +2 -1
- package/legacy/components/base/GridBody.js +1 -2
- package/legacy/components/base/GridOverlays.js +5 -5
- package/legacy/components/cell/GridActionsCell.js +197 -27
- package/legacy/components/cell/GridActionsCellItem.js +7 -5
- package/legacy/components/cell/GridCell.js +37 -15
- package/legacy/components/cell/GridEditBooleanCell.js +132 -11
- package/legacy/components/cell/GridEditDateCell.js +148 -42
- package/legacy/components/cell/GridEditInputCell.js +62 -13
- package/legacy/components/cell/GridEditSingleSelectCell.js +65 -28
- package/legacy/components/cell/index.js +2 -0
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +19 -23
- package/legacy/components/columnHeaders/GridColumnHeaders.js +2 -3
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +23 -6
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +4 -5
- package/legacy/components/containers/GridFooterContainer.js +11 -2
- package/legacy/components/containers/GridRootStyles.js +26 -5
- package/legacy/components/containers/GridToolbarContainer.js +12 -2
- package/legacy/components/menu/GridMenu.js +1 -0
- package/legacy/components/panel/GridPanel.js +1 -0
- package/legacy/components/panel/GridPanelContent.js +13 -2
- package/legacy/components/panel/GridPanelFooter.js +13 -2
- package/legacy/components/panel/GridPanelHeader.js +13 -2
- package/legacy/components/panel/filterPanel/GridFilterForm.js +14 -10
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +13 -8
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +22 -17
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +22 -17
- package/legacy/components/toolbar/GridToolbar.js +31 -6
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/legacy/components/toolbar/GridToolbarExport.js +18 -19
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +103 -0
- package/legacy/components/toolbar/index.js +3 -2
- package/legacy/components/virtualization/GridVirtualScroller.js +2 -0
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +1 -3
- package/legacy/constants/defaultGridSlotsComponents.js +3 -2
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/constants/gridDetailPanelToggleField.js +2 -0
- package/legacy/constants/localeTextConstants.js +8 -1
- package/legacy/hooks/core/pipeProcessing/index.js +2 -1
- package/legacy/hooks/core/pipeProcessing/useGridPipeProcessing.js +60 -24
- package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +27 -0
- package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +0 -4
- package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +6 -7
- package/legacy/hooks/core/useGridApiInitialization.js +3 -3
- package/legacy/hooks/core/useGridErrorHandler.js +1 -2
- package/legacy/hooks/core/useGridStateInitialization.js +1 -2
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +94 -16
- package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +3 -3
- package/legacy/hooks/features/columns/gridColumnsUtils.js +79 -22
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +106 -0
- package/legacy/hooks/features/columns/useGridColumns.js +30 -25
- package/legacy/hooks/features/dimensions/useGridDimensions.js +10 -11
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +225 -89
- package/legacy/hooks/features/editRows/useGridCellEditing.old.js +20 -21
- package/legacy/hooks/features/editRows/useGridEditing.new.js +7 -3
- package/legacy/hooks/features/editRows/useGridEditing.old.js +4 -5
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +157 -65
- package/legacy/hooks/features/editRows/useGridRowEditing.old.js +20 -21
- package/legacy/hooks/features/events/useGridEvents.js +17 -18
- package/legacy/hooks/features/export/serializers/csvSerializer.js +5 -5
- package/legacy/hooks/features/export/useGridCsvExport.js +24 -17
- package/legacy/hooks/features/export/useGridPrintExport.js +22 -0
- package/legacy/hooks/features/export/utils.js +14 -0
- package/legacy/hooks/features/filter/gridFilterState.js +3 -1
- package/legacy/hooks/features/filter/gridFilterUtils.js +96 -2
- package/legacy/hooks/features/filter/useGridFilter.js +32 -15
- package/legacy/hooks/features/focus/useGridFocus.js +50 -44
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +43 -11
- package/legacy/hooks/features/pagination/useGridPage.js +3 -4
- package/legacy/hooks/features/pagination/useGridPageSize.js +2 -3
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -6
- package/legacy/hooks/features/rows/gridRowsSelector.js +6 -0
- package/legacy/hooks/features/rows/gridRowsUtils.js +27 -1
- package/legacy/hooks/features/rows/useGridRows.js +131 -61
- package/legacy/hooks/features/rows/useGridRowsMeta.js +6 -13
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
- package/legacy/hooks/features/scroll/useGridScroll.js +31 -4
- package/legacy/hooks/features/selection/useGridSelection.js +15 -11
- package/legacy/hooks/features/sorting/useGridSorting.js +12 -15
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +79 -42
- package/legacy/hooks/utils/useGridApiEventHandler.js +20 -9
- package/legacy/hooks/utils/useGridNativeEventListener.js +1 -2
- package/legacy/hooks/utils/useGridSelector.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +6 -2
- package/legacy/locales/arSD.js +8 -1
- package/legacy/locales/bgBG.js +8 -1
- package/legacy/locales/csCZ.js +7 -0
- package/legacy/locales/daDK.js +8 -1
- package/legacy/locales/deDE.js +10 -3
- package/legacy/locales/elGR.js +7 -0
- package/legacy/locales/esES.js +7 -0
- package/legacy/locales/faIR.js +8 -1
- package/legacy/locales/fiFI.js +7 -0
- package/legacy/locales/frFR.js +7 -0
- package/legacy/locales/heIL.js +8 -1
- package/legacy/locales/huHU.js +127 -0
- package/legacy/locales/index.js +1 -0
- package/legacy/locales/itIT.js +7 -0
- package/legacy/locales/jaJP.js +7 -0
- package/legacy/locales/koKR.js +7 -0
- package/legacy/locales/nlNL.js +7 -0
- package/legacy/locales/plPL.js +8 -1
- package/legacy/locales/ptBR.js +8 -1
- package/legacy/locales/ruRU.js +7 -0
- package/legacy/locales/skSK.js +7 -0
- package/legacy/locales/trTR.js +8 -1
- package/legacy/locales/ukUA.js +7 -0
- package/legacy/locales/viVN.js +7 -0
- package/legacy/locales/zhCN.js +7 -0
- package/legacy/models/api/gridColumnSpanning.js +1 -0
- package/legacy/models/events/gridEvents.js +10 -3
- package/legacy/models/gridColumnSpanning.js +1 -0
- package/legacy/models/index.js +4 -3
- package/legacy/utils/createSelector.js +18 -2
- package/legacy/utils/exportAs.js +1 -1
- package/locales/arSD.js +8 -1
- package/locales/bgBG.js +8 -1
- package/locales/csCZ.js +7 -0
- package/locales/daDK.js +8 -1
- package/locales/deDE.js +10 -3
- package/locales/elGR.js +7 -0
- package/locales/esES.js +7 -0
- package/locales/faIR.js +8 -1
- package/locales/fiFI.js +7 -0
- package/locales/frFR.js +7 -0
- package/locales/heIL.js +8 -1
- package/locales/huHU.d.ts +2 -0
- package/locales/huHU.js +115 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/itIT.js +7 -0
- package/locales/jaJP.js +7 -0
- package/locales/koKR.js +7 -0
- package/locales/nlNL.js +7 -0
- package/locales/plPL.js +8 -1
- package/locales/ptBR.js +8 -1
- package/locales/ruRU.js +7 -0
- package/locales/skSK.js +7 -0
- package/locales/trTR.js +8 -1
- package/locales/ukUA.js +7 -0
- package/locales/viVN.js +7 -0
- package/locales/zhCN.js +7 -0
- package/models/api/gridApiCommon.d.ts +2 -1
- package/models/api/gridColumnSpanning.d.ts +28 -0
- package/models/api/gridColumnSpanning.js +1 -0
- package/models/api/gridCoreApi.d.ts +10 -0
- package/models/api/gridEditingApi.d.ts +72 -7
- package/models/api/gridFilterApi.d.ts +5 -0
- package/models/api/gridFocusApi.d.ts +1 -0
- package/models/api/gridLocaleTextApi.d.ts +5 -0
- package/models/api/gridRowApi.d.ts +34 -0
- package/models/api/index.d.ts +1 -1
- package/models/colDef/gridColDef.d.ts +18 -0
- package/models/events/gridEventLookup.d.ts +296 -11
- package/models/events/gridEvents.d.ts +10 -258
- package/models/events/gridEvents.js +10 -3
- package/models/gridColumnSpanning.d.ts +12 -0
- package/models/gridColumnSpanning.js +1 -0
- package/models/gridEditRowModel.d.ts +1 -1
- package/models/gridExport.d.ts +29 -2
- package/models/gridFilterModel.d.ts +11 -0
- package/models/gridFilterOperator.d.ts +1 -1
- package/models/gridIconSlotsComponent.d.ts +5 -0
- package/models/gridStateCommunity.d.ts +0 -2
- package/models/index.d.ts +1 -1
- package/models/index.js +4 -3
- package/models/params/gridCellParams.d.ts +12 -2
- package/models/params/gridRowParams.d.ts +5 -0
- package/models/props/DataGridProps.d.ts +57 -29
- package/modern/DataGrid/DataGrid.js +36 -2
- package/modern/DataGrid/useDataGridComponent.js +3 -1
- package/modern/DataGrid/useDataGridProps.js +2 -1
- package/modern/colDef/gridActionsColDef.js +2 -1
- package/modern/colDef/gridBooleanColDef.js +2 -1
- package/modern/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/modern/colDef/gridDateColDef.js +4 -2
- package/modern/colDef/gridNumericColDef.js +3 -2
- package/modern/colDef/gridNumericOperators.js +11 -0
- package/modern/colDef/gridSingleSelectColDef.js +3 -2
- package/modern/colDef/gridSingleSelectOperators.js +52 -0
- package/modern/colDef/gridStringColDef.js +3 -2
- package/modern/colDef/gridStringOperators.js +12 -0
- package/modern/components/GridFooter.js +11 -2
- package/modern/components/GridRow.js +56 -26
- package/modern/components/GridRowCount.js +1 -0
- package/modern/components/GridScrollArea.js +3 -4
- package/modern/components/GridSelectedRowCount.js +2 -1
- package/modern/components/base/GridBody.js +1 -2
- package/modern/components/base/GridOverlays.js +5 -5
- package/modern/components/cell/GridActionsCell.js +179 -21
- package/modern/components/cell/GridActionsCellItem.js +7 -5
- package/modern/components/cell/GridCell.js +36 -15
- package/modern/components/cell/GridEditBooleanCell.js +101 -6
- package/modern/components/cell/GridEditDateCell.js +99 -5
- package/modern/components/cell/GridEditInputCell.js +30 -6
- package/modern/components/cell/GridEditSingleSelectCell.js +48 -16
- package/modern/components/cell/index.js +2 -0
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +19 -23
- package/modern/components/columnHeaders/GridColumnHeaders.js +1 -1
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +22 -6
- package/modern/components/columnSelection/GridHeaderCheckbox.js +4 -5
- package/modern/components/containers/GridFooterContainer.js +11 -2
- package/modern/components/containers/GridRootStyles.js +36 -1
- package/modern/components/containers/GridToolbarContainer.js +12 -2
- package/modern/components/menu/GridMenu.js +1 -0
- package/modern/components/panel/GridPanel.js +1 -0
- package/modern/components/panel/GridPanelContent.js +13 -2
- package/modern/components/panel/GridPanelFooter.js +13 -2
- package/modern/components/panel/GridPanelHeader.js +13 -2
- package/modern/components/panel/filterPanel/GridFilterForm.js +10 -6
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +11 -6
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +20 -13
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +20 -13
- package/modern/components/toolbar/GridToolbar.js +30 -7
- package/modern/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/modern/components/toolbar/GridToolbarExport.js +15 -20
- package/modern/components/toolbar/GridToolbarQuickFilter.js +86 -0
- package/modern/components/toolbar/index.js +3 -2
- package/modern/components/virtualization/GridVirtualScroller.js +2 -0
- package/modern/components/virtualization/GridVirtualScrollerContent.js +1 -3
- package/modern/constants/defaultGridSlotsComponents.js +3 -2
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/gridDetailPanelToggleField.js +2 -0
- package/modern/constants/localeTextConstants.js +8 -1
- package/modern/hooks/core/pipeProcessing/index.js +2 -1
- package/modern/hooks/core/pipeProcessing/useGridPipeProcessing.js +53 -19
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +27 -0
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +0 -4
- package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +6 -7
- package/modern/hooks/core/useGridApiInitialization.js +3 -3
- package/modern/hooks/core/useGridErrorHandler.js +1 -2
- package/modern/hooks/core/useGridStateInitialization.js +1 -2
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +81 -16
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +3 -3
- package/modern/hooks/features/columns/gridColumnsUtils.js +61 -8
- package/modern/hooks/features/columns/useGridColumnSpanning.js +106 -0
- package/modern/hooks/features/columns/useGridColumns.js +30 -25
- package/modern/hooks/features/dimensions/useGridDimensions.js +10 -11
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +149 -42
- package/modern/hooks/features/editRows/useGridCellEditing.old.js +20 -21
- package/modern/hooks/features/editRows/useGridEditing.new.js +7 -3
- package/modern/hooks/features/editRows/useGridEditing.old.js +4 -5
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +143 -57
- package/modern/hooks/features/editRows/useGridRowEditing.old.js +21 -22
- package/modern/hooks/features/events/useGridEvents.js +17 -18
- package/modern/hooks/features/export/serializers/csvSerializer.js +5 -5
- package/modern/hooks/features/export/useGridCsvExport.js +21 -16
- package/modern/hooks/features/export/useGridPrintExport.js +20 -0
- package/modern/hooks/features/export/utils.js +13 -0
- package/modern/hooks/features/filter/gridFilterState.js +3 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +80 -2
- package/modern/hooks/features/filter/useGridFilter.js +32 -15
- package/modern/hooks/features/focus/useGridFocus.js +48 -42
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +41 -12
- package/modern/hooks/features/pagination/useGridPage.js +3 -4
- package/modern/hooks/features/pagination/useGridPageSize.js +2 -3
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -6
- package/modern/hooks/features/rows/gridRowsSelector.js +2 -0
- package/modern/hooks/features/rows/gridRowsUtils.js +23 -1
- package/modern/hooks/features/rows/useGridRows.js +121 -61
- package/modern/hooks/features/rows/useGridRowsMeta.js +6 -13
- package/modern/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
- package/modern/hooks/features/scroll/useGridScroll.js +29 -4
- package/modern/hooks/features/selection/useGridSelection.js +15 -11
- package/modern/hooks/features/sorting/useGridSorting.js +17 -18
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +68 -28
- package/modern/hooks/utils/useGridApiEventHandler.js +20 -9
- package/modern/hooks/utils/useGridNativeEventListener.js +1 -2
- package/modern/hooks/utils/useGridSelector.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +6 -2
- package/modern/locales/arSD.js +8 -1
- package/modern/locales/bgBG.js +8 -1
- package/modern/locales/csCZ.js +7 -0
- package/modern/locales/daDK.js +8 -1
- package/modern/locales/deDE.js +10 -3
- package/modern/locales/elGR.js +7 -0
- package/modern/locales/esES.js +7 -0
- package/modern/locales/faIR.js +8 -1
- package/modern/locales/fiFI.js +7 -0
- package/modern/locales/frFR.js +7 -0
- package/modern/locales/heIL.js +8 -1
- package/modern/locales/huHU.js +115 -0
- package/modern/locales/index.js +1 -0
- package/modern/locales/itIT.js +7 -0
- package/modern/locales/jaJP.js +7 -0
- package/modern/locales/koKR.js +7 -0
- package/modern/locales/nlNL.js +7 -0
- package/modern/locales/plPL.js +8 -1
- package/modern/locales/ptBR.js +8 -1
- package/modern/locales/ruRU.js +7 -0
- package/modern/locales/skSK.js +7 -0
- package/modern/locales/trTR.js +8 -1
- package/modern/locales/ukUA.js +7 -0
- package/modern/locales/viVN.js +7 -0
- package/modern/locales/zhCN.js +7 -0
- package/modern/models/api/gridColumnSpanning.js +1 -0
- package/modern/models/events/gridEvents.js +10 -3
- package/modern/models/gridColumnSpanning.js +1 -0
- package/modern/models/index.js +4 -3
- package/modern/utils/createSelector.js +20 -2
- package/modern/utils/exportAs.js +1 -1
- package/node/DataGrid/DataGrid.js +36 -2
- package/node/DataGrid/useDataGridComponent.js +4 -1
- package/node/DataGrid/useDataGridProps.js +2 -1
- package/node/colDef/gridActionsColDef.js +2 -1
- package/node/colDef/gridBooleanColDef.js +2 -1
- package/node/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/node/colDef/gridDateColDef.js +4 -2
- package/node/colDef/gridNumericColDef.js +2 -1
- package/node/colDef/gridNumericOperators.js +15 -1
- package/node/colDef/gridSingleSelectColDef.js +2 -1
- package/node/colDef/gridSingleSelectOperators.js +56 -1
- package/node/colDef/gridStringColDef.js +2 -1
- package/node/colDef/gridStringOperators.js +16 -1
- package/node/components/GridFooter.js +10 -1
- package/node/components/GridRow.js +59 -29
- package/node/components/GridRowCount.js +1 -0
- package/node/components/GridScrollArea.js +3 -5
- package/node/components/GridSelectedRowCount.js +2 -1
- package/node/components/base/GridBody.js +1 -3
- package/node/components/base/GridOverlays.js +4 -5
- package/node/components/cell/GridActionsCell.js +181 -21
- package/node/components/cell/GridActionsCellItem.js +7 -4
- package/node/components/cell/GridCell.js +35 -14
- package/node/components/cell/GridEditBooleanCell.js +100 -5
- package/node/components/cell/GridEditDateCell.js +98 -4
- package/node/components/cell/GridEditInputCell.js +30 -6
- package/node/components/cell/GridEditSingleSelectCell.js +50 -18
- package/node/components/cell/index.js +26 -0
- package/node/components/columnHeaders/GridColumnHeaderItem.js +19 -24
- package/node/components/columnHeaders/GridColumnHeaders.js +1 -1
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +22 -7
- package/node/components/columnSelection/GridHeaderCheckbox.js +4 -6
- package/node/components/containers/GridFooterContainer.js +10 -1
- package/node/components/containers/GridRootStyles.js +36 -1
- package/node/components/containers/GridToolbarContainer.js +11 -1
- package/node/components/menu/GridMenu.js +1 -0
- package/node/components/panel/GridPanel.js +1 -0
- package/node/components/panel/GridPanelContent.js +11 -1
- package/node/components/panel/GridPanelFooter.js +11 -1
- package/node/components/panel/GridPanelHeader.js +11 -1
- package/node/components/panel/filterPanel/GridFilterForm.js +15 -10
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +14 -8
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +23 -15
- package/node/components/panel/filterPanel/GridFilterInputValue.js +23 -15
- package/node/components/toolbar/GridToolbar.js +32 -7
- package/node/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/node/components/toolbar/GridToolbarExport.js +14 -19
- package/node/components/toolbar/GridToolbarQuickFilter.js +111 -0
- package/node/components/toolbar/index.js +42 -11
- package/node/components/virtualization/GridVirtualScroller.js +2 -0
- package/node/components/virtualization/GridVirtualScrollerContent.js +1 -3
- package/node/constants/defaultGridSlotsComponents.js +2 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/gridDetailPanelToggleField.js +9 -0
- package/node/constants/localeTextConstants.js +8 -1
- package/node/hooks/core/pipeProcessing/index.js +13 -0
- package/node/hooks/core/pipeProcessing/useGridPipeProcessing.js +51 -20
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +42 -0
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +0 -3
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +6 -8
- package/node/hooks/core/useGridApiInitialization.js +3 -4
- package/node/hooks/core/useGridErrorHandler.js +1 -3
- package/node/hooks/core/useGridStateInitialization.js +1 -3
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +85 -17
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +3 -4
- package/node/hooks/features/columns/gridColumnsUtils.js +65 -9
- package/node/hooks/features/columns/useGridColumnSpanning.js +128 -0
- package/node/hooks/features/columns/useGridColumns.js +29 -25
- package/node/hooks/features/dimensions/useGridDimensions.js +10 -12
- package/node/hooks/features/editRows/useGridCellEditing.new.js +151 -42
- package/node/hooks/features/editRows/useGridCellEditing.old.js +20 -22
- package/node/hooks/features/editRows/useGridEditing.new.js +6 -2
- package/node/hooks/features/editRows/useGridEditing.old.js +4 -6
- package/node/hooks/features/editRows/useGridRowEditing.new.js +143 -57
- package/node/hooks/features/editRows/useGridRowEditing.old.js +21 -23
- package/node/hooks/features/events/useGridEvents.js +17 -19
- package/node/hooks/features/export/serializers/csvSerializer.js +5 -5
- package/node/hooks/features/export/useGridCsvExport.js +26 -17
- package/node/hooks/features/export/useGridPrintExport.js +25 -0
- package/node/hooks/features/export/utils.js +19 -2
- package/node/hooks/features/filter/gridFilterState.js +3 -1
- package/node/hooks/features/filter/gridFilterUtils.js +92 -3
- package/node/hooks/features/filter/useGridFilter.js +33 -16
- package/node/hooks/features/focus/useGridFocus.js +48 -43
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +44 -13
- package/node/hooks/features/pagination/useGridPage.js +3 -5
- package/node/hooks/features/pagination/useGridPageSize.js +2 -4
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -8
- package/node/hooks/features/rows/gridRowsSelector.js +5 -1
- package/node/hooks/features/rows/gridRowsUtils.js +29 -1
- package/node/hooks/features/rows/useGridRows.js +122 -61
- package/node/hooks/features/rows/useGridRowsMeta.js +6 -14
- package/node/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
- package/node/hooks/features/scroll/useGridScroll.js +32 -3
- package/node/hooks/features/selection/useGridSelection.js +16 -12
- package/node/hooks/features/sorting/useGridSorting.js +17 -19
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +73 -33
- package/node/hooks/utils/useGridApiEventHandler.js +22 -10
- package/node/hooks/utils/useGridNativeEventListener.js +1 -3
- package/node/hooks/utils/useGridSelector.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +47 -3
- package/node/locales/arSD.js +8 -1
- package/node/locales/bgBG.js +8 -1
- package/node/locales/csCZ.js +7 -0
- package/node/locales/daDK.js +8 -1
- package/node/locales/deDE.js +10 -3
- package/node/locales/elGR.js +7 -0
- package/node/locales/esES.js +7 -0
- package/node/locales/faIR.js +8 -1
- package/node/locales/fiFI.js +7 -0
- package/node/locales/frFR.js +7 -0
- package/node/locales/heIL.js +8 -1
- package/node/locales/huHU.js +125 -0
- package/node/locales/index.js +13 -0
- package/node/locales/itIT.js +7 -0
- package/node/locales/jaJP.js +7 -0
- package/node/locales/koKR.js +7 -0
- package/node/locales/nlNL.js +7 -0
- package/node/locales/plPL.js +8 -1
- package/node/locales/ptBR.js +8 -1
- package/node/locales/ruRU.js +7 -0
- package/node/locales/skSK.js +7 -0
- package/node/locales/trTR.js +8 -1
- package/node/locales/ukUA.js +7 -0
- package/node/locales/viVN.js +7 -0
- package/node/locales/zhCN.js +7 -0
- package/node/models/api/gridColumnSpanning.js +5 -0
- package/node/models/events/gridEvents.js +10 -3
- package/node/models/gridColumnSpanning.js +5 -0
- package/node/models/index.js +0 -13
- package/node/utils/createSelector.js +25 -4
- package/node/utils/exportAs.js +1 -1
- package/package.json +4 -4
- package/utils/createSelector.d.ts +2 -1
- package/utils/createSelector.js +20 -2
- package/utils/domUtils.d.ts +2 -2
- package/utils/exportAs.d.ts +2 -2
- package/utils/exportAs.js +1 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "inputProps", "isValidating", "isProcessingProps"];
|
|
5
|
+
var _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "inputProps", "isValidating", "isProcessingProps", "onValueChange"];
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
7
|
import * as React from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
6
9
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
7
10
|
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
|
|
8
11
|
import InputBase from '@mui/material/InputBase';
|
|
@@ -18,7 +21,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
18
21
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
19
22
|
};
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
function GridEditDateCell(props) {
|
|
22
25
|
var id = props.id,
|
|
23
26
|
valueProp = props.value,
|
|
24
27
|
formattedValue = props.formattedValue,
|
|
@@ -35,6 +38,7 @@ export function GridEditDateCell(props) {
|
|
|
35
38
|
inputProps = props.inputProps,
|
|
36
39
|
isValidating = props.isValidating,
|
|
37
40
|
isProcessingProps = props.isProcessingProps,
|
|
41
|
+
onValueChange = props.onValueChange,
|
|
38
42
|
other = _objectWithoutProperties(props, _excluded);
|
|
39
43
|
|
|
40
44
|
var isDateTime = colDef.type === 'dateTime';
|
|
@@ -75,48 +79,62 @@ export function GridEditDateCell(props) {
|
|
|
75
79
|
classes: rootProps.classes
|
|
76
80
|
};
|
|
77
81
|
var classes = useUtilityClasses(ownerState);
|
|
78
|
-
var handleChange = React.useCallback(function (
|
|
79
|
-
var
|
|
80
|
-
|
|
82
|
+
var handleChange = React.useCallback( /*#__PURE__*/function () {
|
|
83
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
|
|
84
|
+
var newFormattedDate, newParsedDate, _newFormattedDate$spl, _newFormattedDate$spl2, date, time, _date$split, _date$split2, year, month, day, _time$split, _time$split2, hours, minutes;
|
|
81
85
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
date = _newFormattedDate$spl2[0],
|
|
88
|
-
time = _newFormattedDate$spl2[1];
|
|
89
|
-
|
|
90
|
-
var _date$split = date.split('-'),
|
|
91
|
-
_date$split2 = _slicedToArray(_date$split, 3),
|
|
92
|
-
year = _date$split2[0],
|
|
93
|
-
month = _date$split2[1],
|
|
94
|
-
day = _date$split2[2];
|
|
95
|
-
|
|
96
|
-
newParsedDate = new Date();
|
|
97
|
-
newParsedDate.setFullYear(year, Number(month) - 1, day);
|
|
98
|
-
newParsedDate.setHours(0, 0, 0, 0);
|
|
99
|
-
|
|
100
|
-
if (time) {
|
|
101
|
-
var _time$split = time.split(':'),
|
|
102
|
-
_time$split2 = _slicedToArray(_time$split, 2),
|
|
103
|
-
hours = _time$split2[0],
|
|
104
|
-
minutes = _time$split2[1];
|
|
105
|
-
|
|
106
|
-
newParsedDate.setHours(Number(hours), Number(minutes), 0, 0);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
86
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
87
|
+
while (1) {
|
|
88
|
+
switch (_context.prev = _context.next) {
|
|
89
|
+
case 0:
|
|
90
|
+
newFormattedDate = event.target.value;
|
|
109
91
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
92
|
+
if (newFormattedDate === '') {
|
|
93
|
+
newParsedDate = null;
|
|
94
|
+
} else {
|
|
95
|
+
_newFormattedDate$spl = newFormattedDate.split('T'), _newFormattedDate$spl2 = _slicedToArray(_newFormattedDate$spl, 2), date = _newFormattedDate$spl2[0], time = _newFormattedDate$spl2[1];
|
|
96
|
+
_date$split = date.split('-'), _date$split2 = _slicedToArray(_date$split, 3), year = _date$split2[0], month = _date$split2[1], day = _date$split2[2];
|
|
97
|
+
newParsedDate = new Date();
|
|
98
|
+
newParsedDate.setFullYear(year, Number(month) - 1, day);
|
|
99
|
+
newParsedDate.setHours(0, 0, 0, 0);
|
|
100
|
+
|
|
101
|
+
if (time) {
|
|
102
|
+
_time$split = time.split(':'), _time$split2 = _slicedToArray(_time$split, 2), hours = _time$split2[0], minutes = _time$split2[1];
|
|
103
|
+
newParsedDate.setHours(Number(hours), Number(minutes), 0, 0);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (!onValueChange) {
|
|
108
|
+
_context.next = 5;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
_context.next = 5;
|
|
113
|
+
return onValueChange(event, newParsedDate);
|
|
114
|
+
|
|
115
|
+
case 5:
|
|
116
|
+
setValueState({
|
|
117
|
+
parsed: newParsedDate,
|
|
118
|
+
formatted: newFormattedDate
|
|
119
|
+
});
|
|
120
|
+
api.setEditCellValue({
|
|
121
|
+
id: id,
|
|
122
|
+
field: field,
|
|
123
|
+
value: newParsedDate
|
|
124
|
+
}, event);
|
|
125
|
+
|
|
126
|
+
case 7:
|
|
127
|
+
case "end":
|
|
128
|
+
return _context.stop();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}, _callee);
|
|
132
|
+
}));
|
|
133
|
+
|
|
134
|
+
return function (_x) {
|
|
135
|
+
return _ref.apply(this, arguments);
|
|
136
|
+
};
|
|
137
|
+
}(), [api, field, id, onValueChange]);
|
|
120
138
|
React.useEffect(function () {
|
|
121
139
|
setValueState(function (state) {
|
|
122
140
|
var _valueTransformed$par, _state$parsed;
|
|
@@ -145,6 +163,94 @@ export function GridEditDateCell(props) {
|
|
|
145
163
|
onChange: handleChange
|
|
146
164
|
}, other));
|
|
147
165
|
}
|
|
166
|
+
|
|
167
|
+
process.env.NODE_ENV !== "production" ? GridEditDateCell.propTypes = {
|
|
168
|
+
// ----------------------------- Warning --------------------------------
|
|
169
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
170
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
171
|
+
// ----------------------------------------------------------------------
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* GridApi that let you manipulate the grid.
|
|
175
|
+
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
176
|
+
*/
|
|
177
|
+
api: PropTypes.any.isRequired,
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The mode of the cell.
|
|
181
|
+
*/
|
|
182
|
+
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The column of the row that the current cell belongs to.
|
|
186
|
+
*/
|
|
187
|
+
colDef: PropTypes.object.isRequired,
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The column field of the cell that triggered the event.
|
|
191
|
+
*/
|
|
192
|
+
field: PropTypes.string.isRequired,
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* The cell value formatted with the column valueFormatter.
|
|
196
|
+
*/
|
|
197
|
+
formattedValue: PropTypes.any,
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Get the cell value of a row and field.
|
|
201
|
+
* @param {GridRowId} id The row id.
|
|
202
|
+
* @param {string} field The field.
|
|
203
|
+
* @returns {any} The cell value.
|
|
204
|
+
* @deprecated Use `params.row` to directly access the fields you want instead.
|
|
205
|
+
*/
|
|
206
|
+
getValue: PropTypes.func.isRequired,
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* If true, the cell is the active element.
|
|
210
|
+
*/
|
|
211
|
+
hasFocus: PropTypes.bool.isRequired,
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* The grid row id.
|
|
215
|
+
*/
|
|
216
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* If true, the cell is editable.
|
|
220
|
+
*/
|
|
221
|
+
isEditable: PropTypes.bool,
|
|
222
|
+
isProcessingProps: PropTypes.bool,
|
|
223
|
+
isValidating: PropTypes.bool,
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Callback called when the value is changed by the user.
|
|
227
|
+
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
228
|
+
* @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
|
|
229
|
+
* @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
|
|
230
|
+
*/
|
|
231
|
+
onValueChange: PropTypes.func,
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* The row model of the row that the current cell belongs to.
|
|
235
|
+
*/
|
|
236
|
+
row: PropTypes.object.isRequired,
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* The node of the row that the current cell belongs to.
|
|
240
|
+
*/
|
|
241
|
+
rowNode: PropTypes.object.isRequired,
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* the tabIndex value.
|
|
245
|
+
*/
|
|
246
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* The cell value, but if the column has valueGetter, use getValue.
|
|
250
|
+
*/
|
|
251
|
+
value: PropTypes.any
|
|
252
|
+
} : void 0;
|
|
253
|
+
export { GridEditDateCell };
|
|
148
254
|
export var renderEditDateCell = function renderEditDateCell(params) {
|
|
149
255
|
return /*#__PURE__*/_jsx(GridEditDateCell, _extends({}, params));
|
|
150
256
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
var _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "isValidating", "debounceMs", "isProcessingProps"];
|
|
5
|
+
var _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "isValidating", "debounceMs", "isProcessingProps", "onValueChange"];
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
7
|
import * as React from 'react';
|
|
6
8
|
import PropTypes from 'prop-types';
|
|
7
9
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
@@ -61,6 +63,7 @@ function GridEditInputCell(props) {
|
|
|
61
63
|
_props$debounceMs = props.debounceMs,
|
|
62
64
|
debounceMs = _props$debounceMs === void 0 ? (_rootProps$experiment = rootProps.experimentalFeatures) != null && _rootProps$experiment.newEditingApi ? 200 : SUBMIT_FILTER_STROKE_TIME : _props$debounceMs,
|
|
63
65
|
isProcessingProps = props.isProcessingProps,
|
|
66
|
+
onValueChange = props.onValueChange,
|
|
64
67
|
other = _objectWithoutProperties(props, _excluded);
|
|
65
68
|
|
|
66
69
|
var inputRef = React.useRef();
|
|
@@ -74,16 +77,44 @@ function GridEditInputCell(props) {
|
|
|
74
77
|
classes: rootProps.classes
|
|
75
78
|
};
|
|
76
79
|
var classes = useUtilityClasses(ownerState);
|
|
77
|
-
var handleChange = React.useCallback(function (
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
var handleChange = React.useCallback( /*#__PURE__*/function () {
|
|
81
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
|
|
82
|
+
var newValue;
|
|
83
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
84
|
+
while (1) {
|
|
85
|
+
switch (_context.prev = _context.next) {
|
|
86
|
+
case 0:
|
|
87
|
+
newValue = event.target.value;
|
|
88
|
+
|
|
89
|
+
if (!onValueChange) {
|
|
90
|
+
_context.next = 4;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
_context.next = 4;
|
|
95
|
+
return onValueChange(event, newValue);
|
|
96
|
+
|
|
97
|
+
case 4:
|
|
98
|
+
setValueState(newValue);
|
|
99
|
+
api.setEditCellValue({
|
|
100
|
+
id: id,
|
|
101
|
+
field: field,
|
|
102
|
+
value: newValue,
|
|
103
|
+
debounceMs: debounceMs
|
|
104
|
+
}, event);
|
|
105
|
+
|
|
106
|
+
case 6:
|
|
107
|
+
case "end":
|
|
108
|
+
return _context.stop();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}, _callee);
|
|
112
|
+
}));
|
|
113
|
+
|
|
114
|
+
return function (_x) {
|
|
115
|
+
return _ref2.apply(this, arguments);
|
|
116
|
+
};
|
|
117
|
+
}(), [api, debounceMs, field, id, onValueChange]);
|
|
87
118
|
React.useEffect(function () {
|
|
88
119
|
setValueState(value);
|
|
89
120
|
}, [value]);
|
|
@@ -134,7 +165,7 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
134
165
|
/**
|
|
135
166
|
* The cell value formatted with the column valueFormatter.
|
|
136
167
|
*/
|
|
137
|
-
formattedValue: PropTypes.any
|
|
168
|
+
formattedValue: PropTypes.any,
|
|
138
169
|
|
|
139
170
|
/**
|
|
140
171
|
* Get the cell value of a row and field.
|
|
@@ -162,6 +193,14 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
162
193
|
isProcessingProps: PropTypes.bool,
|
|
163
194
|
isValidating: PropTypes.bool,
|
|
164
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Callback called when the value is changed by the user.
|
|
198
|
+
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
199
|
+
* @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
|
|
200
|
+
* @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
|
|
201
|
+
*/
|
|
202
|
+
onValueChange: PropTypes.func,
|
|
203
|
+
|
|
165
204
|
/**
|
|
166
205
|
* The row model of the row that the current cell belongs to.
|
|
167
206
|
*/
|
|
@@ -170,7 +209,17 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
170
209
|
/**
|
|
171
210
|
* The node of the row that the current cell belongs to.
|
|
172
211
|
*/
|
|
173
|
-
rowNode: PropTypes.object.isRequired
|
|
212
|
+
rowNode: PropTypes.object.isRequired,
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* the tabIndex value.
|
|
216
|
+
*/
|
|
217
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* The cell value, but if the column has valueGetter, use getValue.
|
|
221
|
+
*/
|
|
222
|
+
value: PropTypes.any
|
|
174
223
|
} : void 0;
|
|
175
224
|
export { GridEditInputCell };
|
|
176
225
|
export var renderEditInputCell = function renderEditInputCell(params) {
|
|
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
6
|
-
var _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error"];
|
|
6
|
+
var _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange"];
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
@@ -12,21 +12,22 @@ import MenuItem from '@mui/material/MenuItem';
|
|
|
12
12
|
import { isEscapeKey } from '../../utils/keyboardUtils';
|
|
13
13
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
14
14
|
import { GridEditModes } from '../../models/gridEditRowModel';
|
|
15
|
-
import {
|
|
15
|
+
import { getValueFromValueOptions } from '../panel/filterPanel/filterPanelUtils';
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
|
|
18
|
-
var renderSingleSelectOptions = function renderSingleSelectOptions(option) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
var renderSingleSelectOptions = function renderSingleSelectOptions(option, OptionComponent) {
|
|
19
|
+
var isOptionTypeObject = _typeof(option) === 'object';
|
|
20
|
+
var key = isOptionTypeObject ? option.value : option;
|
|
21
|
+
var value = isOptionTypeObject ? option.value : option;
|
|
22
|
+
var content = isOptionTypeObject ? option.label : option;
|
|
23
|
+
return /*#__PURE__*/_jsx(OptionComponent, {
|
|
24
|
+
value: value,
|
|
25
|
+
children: content
|
|
26
|
+
}, key);
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
function GridEditSingleSelectCell(props) {
|
|
29
|
-
var _rootProps$components;
|
|
30
|
+
var _rootProps$components, _baseSelectProps$nati, _rootProps$components2;
|
|
30
31
|
|
|
31
32
|
var id = props.id,
|
|
32
33
|
value = props.value,
|
|
@@ -45,6 +46,7 @@ function GridEditSingleSelectCell(props) {
|
|
|
45
46
|
isValidating = props.isValidating,
|
|
46
47
|
isProcessingProps = props.isProcessingProps,
|
|
47
48
|
error = props.error,
|
|
49
|
+
onValueChange = props.onValueChange,
|
|
48
50
|
other = _objectWithoutProperties(props, _excluded);
|
|
49
51
|
|
|
50
52
|
var ref = React.useRef();
|
|
@@ -56,6 +58,8 @@ function GridEditSingleSelectCell(props) {
|
|
|
56
58
|
open = _React$useState2[0],
|
|
57
59
|
setOpen = _React$useState2[1];
|
|
58
60
|
|
|
61
|
+
var baseSelectProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseSelect) || {};
|
|
62
|
+
var isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : false;
|
|
59
63
|
var valueOptionsFormatted;
|
|
60
64
|
|
|
61
65
|
if (typeof colDef.valueOptions === 'function') {
|
|
@@ -90,46 +94,58 @@ function GridEditSingleSelectCell(props) {
|
|
|
90
94
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
|
|
91
95
|
var _rootProps$experiment;
|
|
92
96
|
|
|
93
|
-
var target, isValid, canCommit, params;
|
|
97
|
+
var target, formattedTargetValue, isValid, canCommit, params;
|
|
94
98
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
95
99
|
while (1) {
|
|
96
100
|
switch (_context.prev = _context.next) {
|
|
97
101
|
case 0:
|
|
98
102
|
setOpen(false);
|
|
99
|
-
target = event.target;
|
|
100
|
-
|
|
103
|
+
target = event.target; // NativeSelect casts the value to a string.
|
|
104
|
+
|
|
105
|
+
formattedTargetValue = getValueFromValueOptions(target.value, valueOptionsFormatted);
|
|
106
|
+
|
|
107
|
+
if (!onValueChange) {
|
|
108
|
+
_context.next = 6;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
_context.next = 6;
|
|
113
|
+
return onValueChange(event, formattedTargetValue);
|
|
114
|
+
|
|
115
|
+
case 6:
|
|
116
|
+
_context.next = 8;
|
|
101
117
|
return api.setEditCellValue({
|
|
102
118
|
id: id,
|
|
103
119
|
field: field,
|
|
104
|
-
value:
|
|
120
|
+
value: formattedTargetValue
|
|
105
121
|
}, event);
|
|
106
122
|
|
|
107
|
-
case
|
|
123
|
+
case 8:
|
|
108
124
|
isValid = _context.sent;
|
|
109
125
|
|
|
110
126
|
if (!((_rootProps$experiment = rootProps.experimentalFeatures) != null && _rootProps$experiment.newEditingApi)) {
|
|
111
|
-
_context.next =
|
|
127
|
+
_context.next = 11;
|
|
112
128
|
break;
|
|
113
129
|
}
|
|
114
130
|
|
|
115
131
|
return _context.abrupt("return");
|
|
116
132
|
|
|
117
|
-
case
|
|
133
|
+
case 11:
|
|
118
134
|
if (!(rootProps.editMode === GridEditModes.Row || isValid === false)) {
|
|
119
|
-
_context.next =
|
|
135
|
+
_context.next = 13;
|
|
120
136
|
break;
|
|
121
137
|
}
|
|
122
138
|
|
|
123
139
|
return _context.abrupt("return");
|
|
124
140
|
|
|
125
|
-
case
|
|
126
|
-
_context.next =
|
|
141
|
+
case 13:
|
|
142
|
+
_context.next = 15;
|
|
127
143
|
return Promise.resolve(api.commitCellChange({
|
|
128
144
|
id: id,
|
|
129
145
|
field: field
|
|
130
146
|
}, event));
|
|
131
147
|
|
|
132
|
-
case
|
|
148
|
+
case 15:
|
|
133
149
|
canCommit = _context.sent;
|
|
134
150
|
|
|
135
151
|
if (canCommit) {
|
|
@@ -138,11 +154,11 @@ function GridEditSingleSelectCell(props) {
|
|
|
138
154
|
if (event.key) {
|
|
139
155
|
// TODO v6: remove once we stop ignoring events fired from portals
|
|
140
156
|
params = api.getCellParams(id, field);
|
|
141
|
-
api.publishEvent(
|
|
157
|
+
api.publishEvent('cellNavigationKeyDown', params, event);
|
|
142
158
|
}
|
|
143
159
|
}
|
|
144
160
|
|
|
145
|
-
case
|
|
161
|
+
case 17:
|
|
146
162
|
case "end":
|
|
147
163
|
return _context.stop();
|
|
148
164
|
}
|
|
@@ -196,9 +212,12 @@ function GridEditSingleSelectCell(props) {
|
|
|
196
212
|
onClose: handleClose
|
|
197
213
|
},
|
|
198
214
|
error: error,
|
|
215
|
+
native: isSelectNative,
|
|
199
216
|
fullWidth: true
|
|
200
|
-
}, other, (_rootProps$
|
|
201
|
-
children: valueOptionsFormatted.map(
|
|
217
|
+
}, other, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect, {
|
|
218
|
+
children: valueOptionsFormatted.map(function (valueOptions) {
|
|
219
|
+
return renderSingleSelectOptions(valueOptions, isSelectNative ? 'option' : MenuItem);
|
|
220
|
+
})
|
|
202
221
|
}));
|
|
203
222
|
}
|
|
204
223
|
|
|
@@ -232,7 +251,7 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
|
|
|
232
251
|
/**
|
|
233
252
|
* The cell value formatted with the column valueFormatter.
|
|
234
253
|
*/
|
|
235
|
-
formattedValue: PropTypes.any
|
|
254
|
+
formattedValue: PropTypes.any,
|
|
236
255
|
|
|
237
256
|
/**
|
|
238
257
|
* Get the cell value of a row and field.
|
|
@@ -260,6 +279,14 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
|
|
|
260
279
|
isProcessingProps: PropTypes.bool,
|
|
261
280
|
isValidating: PropTypes.bool,
|
|
262
281
|
|
|
282
|
+
/**
|
|
283
|
+
* Callback called when the value is changed by the user.
|
|
284
|
+
* @param {SelectChangeEvent<any>} event The event source of the callback.
|
|
285
|
+
* @param {any} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
|
|
286
|
+
* @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
|
|
287
|
+
*/
|
|
288
|
+
onValueChange: PropTypes.func,
|
|
289
|
+
|
|
263
290
|
/**
|
|
264
291
|
* The row model of the row that the current cell belongs to.
|
|
265
292
|
*/
|
|
@@ -268,7 +295,17 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
|
|
|
268
295
|
/**
|
|
269
296
|
* The node of the row that the current cell belongs to.
|
|
270
297
|
*/
|
|
271
|
-
rowNode: PropTypes.object.isRequired
|
|
298
|
+
rowNode: PropTypes.object.isRequired,
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* the tabIndex value.
|
|
302
|
+
*/
|
|
303
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* The cell value, but if the column has valueGetter, use getValue.
|
|
307
|
+
*/
|
|
308
|
+
value: PropTypes.any
|
|
272
309
|
} : void 0;
|
|
273
310
|
export { GridEditSingleSelectCell };
|
|
274
311
|
export var renderEditSingleSelectCell = function renderEditSingleSelectCell(params) {
|
|
@@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
7
7
|
import { unstable_useId as useId } from '@mui/material/utils';
|
|
8
|
-
import { GridEvents } from '../../models/events';
|
|
9
8
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
10
9
|
import { GridColumnHeaderSortIcon } from './GridColumnHeaderSortIcon';
|
|
11
10
|
import { GridColumnHeaderTitle } from './GridColumnHeaderTitle';
|
|
@@ -91,25 +90,25 @@ function GridColumnHeaderItem(props) {
|
|
|
91
90
|
};
|
|
92
91
|
}, [apiRef, column.field]);
|
|
93
92
|
var mouseEventsHandlers = {
|
|
94
|
-
onClick: publish(
|
|
95
|
-
onDoubleClick: publish(
|
|
96
|
-
onMouseOver: publish(
|
|
93
|
+
onClick: publish('columnHeaderClick'),
|
|
94
|
+
onDoubleClick: publish('columnHeaderDoubleClick'),
|
|
95
|
+
onMouseOver: publish('columnHeaderOver'),
|
|
97
96
|
// TODO remove as it's not used
|
|
98
|
-
onMouseOut: publish(
|
|
97
|
+
onMouseOut: publish('columnHeaderOut'),
|
|
99
98
|
// TODO remove as it's not used
|
|
100
|
-
onMouseEnter: publish(
|
|
99
|
+
onMouseEnter: publish('columnHeaderEnter'),
|
|
101
100
|
// TODO remove as it's not used
|
|
102
|
-
onMouseLeave: publish(
|
|
101
|
+
onMouseLeave: publish('columnHeaderLeave'),
|
|
103
102
|
// TODO remove as it's not used
|
|
104
|
-
onKeyDown: publish(
|
|
105
|
-
onFocus: publish(
|
|
106
|
-
onBlur: publish(
|
|
103
|
+
onKeyDown: publish('columnHeaderKeyDown'),
|
|
104
|
+
onFocus: publish('columnHeaderFocus'),
|
|
105
|
+
onBlur: publish('columnHeaderBlur')
|
|
107
106
|
};
|
|
108
107
|
var draggableEventHandlers = {
|
|
109
|
-
onDragStart: publish(
|
|
110
|
-
onDragEnter: publish(
|
|
111
|
-
onDragOver: publish(
|
|
112
|
-
onDragEnd: publish(
|
|
108
|
+
onDragStart: publish('columnHeaderDragStart'),
|
|
109
|
+
onDragEnter: publish('columnHeaderDragEnter'),
|
|
110
|
+
onDragOver: publish('columnHeaderDragOver'),
|
|
111
|
+
onDragEnd: publish('columnHeaderDragEnd')
|
|
113
112
|
};
|
|
114
113
|
var removeLastBorderRight = isLastColumn && hasScrollX && !hasScrollY;
|
|
115
114
|
var showRightBorder = !isLastColumn ? rootProps.showColumnRightBorder : !removeLastBorderRight && !extendRowFullWidth;
|
|
@@ -121,7 +120,7 @@ function GridColumnHeaderItem(props) {
|
|
|
121
120
|
|
|
122
121
|
var classes = useUtilityClasses(ownerState);
|
|
123
122
|
var width = column.computedWidth;
|
|
124
|
-
var ariaSort;
|
|
123
|
+
var ariaSort = 'none';
|
|
125
124
|
|
|
126
125
|
if (sortDirection != null) {
|
|
127
126
|
ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';
|
|
@@ -162,14 +161,11 @@ function GridColumnHeaderItem(props) {
|
|
|
162
161
|
|
|
163
162
|
if (hasFocus && !columnMenuState.open) {
|
|
164
163
|
var focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
} else {
|
|
169
|
-
headerCellRef.current.focus();
|
|
170
|
-
}
|
|
164
|
+
var elementToFocus = focusableElement || headerCellRef.current;
|
|
165
|
+
elementToFocus == null ? void 0 : elementToFocus.focus();
|
|
166
|
+
apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
|
|
171
167
|
}
|
|
172
|
-
});
|
|
168
|
+
}, [apiRef, hasFocus]);
|
|
173
169
|
var headerClassName = typeof column.headerClassName === 'function' ? column.headerClassName({
|
|
174
170
|
field: column.field,
|
|
175
171
|
colDef: column
|
|
@@ -207,7 +203,7 @@ function GridColumnHeaderItem(props) {
|
|
|
207
203
|
resizable: !rootProps.disableColumnResize && !!column.resizable,
|
|
208
204
|
resizing: isResizing,
|
|
209
205
|
height: headerHeight,
|
|
210
|
-
onMouseDown: publish(
|
|
206
|
+
onMouseDown: publish('columnSeparatorMouseDown'),
|
|
211
207
|
side: separatorSide
|
|
212
208
|
}), /*#__PURE__*/_jsx(GridColumnHeaderMenu, {
|
|
213
209
|
columnMenuId: columnMenuId,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["
|
|
3
|
+
var _excluded = ["className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
@@ -40,8 +40,7 @@ var GridColumnHeadersRoot = styled('div', {
|
|
|
40
40
|
};
|
|
41
41
|
});
|
|
42
42
|
export var GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeaders(props, ref) {
|
|
43
|
-
var
|
|
44
|
-
className = props.className,
|
|
43
|
+
var className = props.className,
|
|
45
44
|
other = _objectWithoutProperties(props, _excluded);
|
|
46
45
|
|
|
47
46
|
var rootProps = useGridRootProps();
|