@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
|
@@ -14,6 +14,8 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
14
14
|
|
|
15
15
|
var React = _interopRequireWildcard(require("react"));
|
|
16
16
|
|
|
17
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
|
+
|
|
17
19
|
var _material = require("@mui/material");
|
|
18
20
|
|
|
19
21
|
var _utils = require("@mui/material/utils");
|
|
@@ -26,7 +28,7 @@ var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
|
26
28
|
|
|
27
29
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
30
|
|
|
29
|
-
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "inputProps", "isValidating", "isProcessingProps"];
|
|
31
|
+
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "inputProps", "isValidating", "isProcessingProps", "onValueChange"];
|
|
30
32
|
|
|
31
33
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
32
34
|
|
|
@@ -50,7 +52,8 @@ function GridEditDateCell(props) {
|
|
|
50
52
|
field,
|
|
51
53
|
colDef,
|
|
52
54
|
hasFocus,
|
|
53
|
-
inputProps
|
|
55
|
+
inputProps,
|
|
56
|
+
onValueChange
|
|
54
57
|
} = props,
|
|
55
58
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
56
59
|
const isDateTime = colDef.type === 'dateTime';
|
|
@@ -86,7 +89,7 @@ function GridEditDateCell(props) {
|
|
|
86
89
|
classes: rootProps.classes
|
|
87
90
|
};
|
|
88
91
|
const classes = useUtilityClasses(ownerState);
|
|
89
|
-
const handleChange = React.useCallback(event => {
|
|
92
|
+
const handleChange = React.useCallback(async event => {
|
|
90
93
|
const newFormattedDate = event.target.value;
|
|
91
94
|
let newParsedDate;
|
|
92
95
|
|
|
@@ -105,6 +108,10 @@ function GridEditDateCell(props) {
|
|
|
105
108
|
}
|
|
106
109
|
}
|
|
107
110
|
|
|
111
|
+
if (onValueChange) {
|
|
112
|
+
await onValueChange(event, newParsedDate);
|
|
113
|
+
}
|
|
114
|
+
|
|
108
115
|
setValueState({
|
|
109
116
|
parsed: newParsedDate,
|
|
110
117
|
formatted: newFormattedDate
|
|
@@ -114,7 +121,7 @@ function GridEditDateCell(props) {
|
|
|
114
121
|
field,
|
|
115
122
|
value: newParsedDate
|
|
116
123
|
}, event);
|
|
117
|
-
}, [api, field, id]);
|
|
124
|
+
}, [api, field, id, onValueChange]);
|
|
118
125
|
React.useEffect(() => {
|
|
119
126
|
setValueState(state => {
|
|
120
127
|
var _valueTransformed$par, _state$parsed;
|
|
@@ -144,6 +151,93 @@ function GridEditDateCell(props) {
|
|
|
144
151
|
}, other));
|
|
145
152
|
}
|
|
146
153
|
|
|
154
|
+
process.env.NODE_ENV !== "production" ? GridEditDateCell.propTypes = {
|
|
155
|
+
// ----------------------------- Warning --------------------------------
|
|
156
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
157
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
158
|
+
// ----------------------------------------------------------------------
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* GridApi that let you manipulate the grid.
|
|
162
|
+
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
163
|
+
*/
|
|
164
|
+
api: _propTypes.default.any.isRequired,
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* The mode of the cell.
|
|
168
|
+
*/
|
|
169
|
+
cellMode: _propTypes.default.oneOf(['edit', 'view']).isRequired,
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The column of the row that the current cell belongs to.
|
|
173
|
+
*/
|
|
174
|
+
colDef: _propTypes.default.object.isRequired,
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The column field of the cell that triggered the event.
|
|
178
|
+
*/
|
|
179
|
+
field: _propTypes.default.string.isRequired,
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* The cell value formatted with the column valueFormatter.
|
|
183
|
+
*/
|
|
184
|
+
formattedValue: _propTypes.default.any,
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Get the cell value of a row and field.
|
|
188
|
+
* @param {GridRowId} id The row id.
|
|
189
|
+
* @param {string} field The field.
|
|
190
|
+
* @returns {any} The cell value.
|
|
191
|
+
* @deprecated Use `params.row` to directly access the fields you want instead.
|
|
192
|
+
*/
|
|
193
|
+
getValue: _propTypes.default.func.isRequired,
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* If true, the cell is the active element.
|
|
197
|
+
*/
|
|
198
|
+
hasFocus: _propTypes.default.bool.isRequired,
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The grid row id.
|
|
202
|
+
*/
|
|
203
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* If true, the cell is editable.
|
|
207
|
+
*/
|
|
208
|
+
isEditable: _propTypes.default.bool,
|
|
209
|
+
isProcessingProps: _propTypes.default.bool,
|
|
210
|
+
isValidating: _propTypes.default.bool,
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Callback called when the value is changed by the user.
|
|
214
|
+
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
215
|
+
* @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
|
|
216
|
+
* @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
|
|
217
|
+
*/
|
|
218
|
+
onValueChange: _propTypes.default.func,
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* The row model of the row that the current cell belongs to.
|
|
222
|
+
*/
|
|
223
|
+
row: _propTypes.default.object.isRequired,
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* The node of the row that the current cell belongs to.
|
|
227
|
+
*/
|
|
228
|
+
rowNode: _propTypes.default.object.isRequired,
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* the tabIndex value.
|
|
232
|
+
*/
|
|
233
|
+
tabIndex: _propTypes.default.oneOf([-1, 0]).isRequired,
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The cell value, but if the column has valueGetter, use getValue.
|
|
237
|
+
*/
|
|
238
|
+
value: _propTypes.default.any
|
|
239
|
+
} : void 0;
|
|
240
|
+
|
|
147
241
|
const renderEditDateCell = params => /*#__PURE__*/(0, _jsxRuntime.jsx)(GridEditDateCell, (0, _extends2.default)({}, params));
|
|
148
242
|
|
|
149
243
|
exports.renderEditDateCell = renderEditDateCell;
|
|
@@ -34,7 +34,7 @@ var _GridFilterInputValue = require("../panel/filterPanel/GridFilterInputValue")
|
|
|
34
34
|
|
|
35
35
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
36
36
|
|
|
37
|
-
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "isValidating", "debounceMs", "isProcessingProps"];
|
|
37
|
+
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "isValidating", "debounceMs", "isProcessingProps", "onValueChange"];
|
|
38
38
|
|
|
39
39
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
40
40
|
|
|
@@ -76,7 +76,8 @@ function GridEditInputCell(props) {
|
|
|
76
76
|
colDef,
|
|
77
77
|
hasFocus,
|
|
78
78
|
debounceMs = (_rootProps$experiment = rootProps.experimentalFeatures) != null && _rootProps$experiment.newEditingApi ? 200 : _GridFilterInputValue.SUBMIT_FILTER_STROKE_TIME,
|
|
79
|
-
isProcessingProps
|
|
79
|
+
isProcessingProps,
|
|
80
|
+
onValueChange
|
|
80
81
|
} = props,
|
|
81
82
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
82
83
|
const inputRef = React.useRef();
|
|
@@ -85,8 +86,13 @@ function GridEditInputCell(props) {
|
|
|
85
86
|
classes: rootProps.classes
|
|
86
87
|
};
|
|
87
88
|
const classes = useUtilityClasses(ownerState);
|
|
88
|
-
const handleChange = React.useCallback(event => {
|
|
89
|
+
const handleChange = React.useCallback(async event => {
|
|
89
90
|
const newValue = event.target.value;
|
|
91
|
+
|
|
92
|
+
if (onValueChange) {
|
|
93
|
+
await onValueChange(event, newValue);
|
|
94
|
+
}
|
|
95
|
+
|
|
90
96
|
setValueState(newValue);
|
|
91
97
|
api.setEditCellValue({
|
|
92
98
|
id,
|
|
@@ -94,7 +100,7 @@ function GridEditInputCell(props) {
|
|
|
94
100
|
value: newValue,
|
|
95
101
|
debounceMs
|
|
96
102
|
}, event);
|
|
97
|
-
}, [api, debounceMs, field, id]);
|
|
103
|
+
}, [api, debounceMs, field, id, onValueChange]);
|
|
98
104
|
React.useEffect(() => {
|
|
99
105
|
setValueState(value);
|
|
100
106
|
}, [value]);
|
|
@@ -145,7 +151,7 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
145
151
|
/**
|
|
146
152
|
* The cell value formatted with the column valueFormatter.
|
|
147
153
|
*/
|
|
148
|
-
formattedValue: _propTypes.default.any
|
|
154
|
+
formattedValue: _propTypes.default.any,
|
|
149
155
|
|
|
150
156
|
/**
|
|
151
157
|
* Get the cell value of a row and field.
|
|
@@ -173,6 +179,14 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
173
179
|
isProcessingProps: _propTypes.default.bool,
|
|
174
180
|
isValidating: _propTypes.default.bool,
|
|
175
181
|
|
|
182
|
+
/**
|
|
183
|
+
* Callback called when the value is changed by the user.
|
|
184
|
+
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
185
|
+
* @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
|
|
186
|
+
* @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
|
|
187
|
+
*/
|
|
188
|
+
onValueChange: _propTypes.default.func,
|
|
189
|
+
|
|
176
190
|
/**
|
|
177
191
|
* The row model of the row that the current cell belongs to.
|
|
178
192
|
*/
|
|
@@ -181,7 +195,17 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
181
195
|
/**
|
|
182
196
|
* The node of the row that the current cell belongs to.
|
|
183
197
|
*/
|
|
184
|
-
rowNode: _propTypes.default.object.isRequired
|
|
198
|
+
rowNode: _propTypes.default.object.isRequired,
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* the tabIndex value.
|
|
202
|
+
*/
|
|
203
|
+
tabIndex: _propTypes.default.oneOf([-1, 0]).isRequired,
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The cell value, but if the column has valueGetter, use getValue.
|
|
207
|
+
*/
|
|
208
|
+
value: _propTypes.default.any
|
|
185
209
|
} : void 0;
|
|
186
210
|
|
|
187
211
|
const renderEditInputCell = params => /*#__PURE__*/(0, _jsxRuntime.jsx)(GridEditInputCell, (0, _extends2.default)({}, params));
|
|
@@ -26,26 +26,29 @@ var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
|
26
26
|
|
|
27
27
|
var _gridEditRowModel = require("../../models/gridEditRowModel");
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _filterPanelUtils = require("../panel/filterPanel/filterPanelUtils");
|
|
30
30
|
|
|
31
31
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
32
32
|
|
|
33
|
-
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error"];
|
|
33
|
+
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange"];
|
|
34
34
|
|
|
35
35
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
36
36
|
|
|
37
37
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
38
38
|
|
|
39
|
-
const renderSingleSelectOptions = option
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
const renderSingleSelectOptions = (option, OptionComponent) => {
|
|
40
|
+
const isOptionTypeObject = typeof option === 'object';
|
|
41
|
+
const key = isOptionTypeObject ? option.value : option;
|
|
42
|
+
const value = isOptionTypeObject ? option.value : option;
|
|
43
|
+
const content = isOptionTypeObject ? option.label : option;
|
|
44
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionComponent, {
|
|
45
|
+
value: value,
|
|
46
|
+
children: content
|
|
47
|
+
}, key);
|
|
48
|
+
};
|
|
46
49
|
|
|
47
50
|
function GridEditSingleSelectCell(props) {
|
|
48
|
-
var _rootProps$components;
|
|
51
|
+
var _rootProps$components, _baseSelectProps$nati, _rootProps$components2;
|
|
49
52
|
|
|
50
53
|
const {
|
|
51
54
|
id,
|
|
@@ -55,13 +58,16 @@ function GridEditSingleSelectCell(props) {
|
|
|
55
58
|
row,
|
|
56
59
|
colDef,
|
|
57
60
|
hasFocus,
|
|
58
|
-
error
|
|
61
|
+
error,
|
|
62
|
+
onValueChange
|
|
59
63
|
} = props,
|
|
60
64
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
61
65
|
const ref = React.useRef();
|
|
62
66
|
const inputRef = React.useRef();
|
|
63
67
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
64
68
|
const [open, setOpen] = React.useState(rootProps.editMode === 'cell');
|
|
69
|
+
const baseSelectProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseSelect) || {};
|
|
70
|
+
const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : false;
|
|
65
71
|
let valueOptionsFormatted;
|
|
66
72
|
|
|
67
73
|
if (typeof colDef.valueOptions === 'function') {
|
|
@@ -96,11 +102,18 @@ function GridEditSingleSelectCell(props) {
|
|
|
96
102
|
var _rootProps$experiment;
|
|
97
103
|
|
|
98
104
|
setOpen(false);
|
|
99
|
-
const target = event.target;
|
|
105
|
+
const target = event.target; // NativeSelect casts the value to a string.
|
|
106
|
+
|
|
107
|
+
const formattedTargetValue = (0, _filterPanelUtils.getValueFromValueOptions)(target.value, valueOptionsFormatted);
|
|
108
|
+
|
|
109
|
+
if (onValueChange) {
|
|
110
|
+
await onValueChange(event, formattedTargetValue);
|
|
111
|
+
}
|
|
112
|
+
|
|
100
113
|
const isValid = await api.setEditCellValue({
|
|
101
114
|
id,
|
|
102
115
|
field,
|
|
103
|
-
value:
|
|
116
|
+
value: formattedTargetValue
|
|
104
117
|
}, event);
|
|
105
118
|
|
|
106
119
|
if ((_rootProps$experiment = rootProps.experimentalFeatures) != null && _rootProps$experiment.newEditingApi) {
|
|
@@ -123,7 +136,7 @@ function GridEditSingleSelectCell(props) {
|
|
|
123
136
|
if (event.key) {
|
|
124
137
|
// TODO v6: remove once we stop ignoring events fired from portals
|
|
125
138
|
const params = api.getCellParams(id, field);
|
|
126
|
-
api.publishEvent(
|
|
139
|
+
api.publishEvent('cellNavigationKeyDown', params, event);
|
|
127
140
|
}
|
|
128
141
|
}
|
|
129
142
|
};
|
|
@@ -169,9 +182,10 @@ function GridEditSingleSelectCell(props) {
|
|
|
169
182
|
onClose: handleClose
|
|
170
183
|
},
|
|
171
184
|
error: error,
|
|
185
|
+
native: isSelectNative,
|
|
172
186
|
fullWidth: true
|
|
173
|
-
}, other, (_rootProps$
|
|
174
|
-
children: valueOptionsFormatted.map(renderSingleSelectOptions)
|
|
187
|
+
}, other, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect, {
|
|
188
|
+
children: valueOptionsFormatted.map(valueOptions => renderSingleSelectOptions(valueOptions, isSelectNative ? 'option' : _MenuItem.default))
|
|
175
189
|
}));
|
|
176
190
|
}
|
|
177
191
|
|
|
@@ -205,7 +219,7 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
|
|
|
205
219
|
/**
|
|
206
220
|
* The cell value formatted with the column valueFormatter.
|
|
207
221
|
*/
|
|
208
|
-
formattedValue: _propTypes.default.any
|
|
222
|
+
formattedValue: _propTypes.default.any,
|
|
209
223
|
|
|
210
224
|
/**
|
|
211
225
|
* Get the cell value of a row and field.
|
|
@@ -233,6 +247,14 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
|
|
|
233
247
|
isProcessingProps: _propTypes.default.bool,
|
|
234
248
|
isValidating: _propTypes.default.bool,
|
|
235
249
|
|
|
250
|
+
/**
|
|
251
|
+
* Callback called when the value is changed by the user.
|
|
252
|
+
* @param {SelectChangeEvent<any>} event The event source of the callback.
|
|
253
|
+
* @param {any} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
|
|
254
|
+
* @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
|
|
255
|
+
*/
|
|
256
|
+
onValueChange: _propTypes.default.func,
|
|
257
|
+
|
|
236
258
|
/**
|
|
237
259
|
* The row model of the row that the current cell belongs to.
|
|
238
260
|
*/
|
|
@@ -241,7 +263,17 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
|
|
|
241
263
|
/**
|
|
242
264
|
* The node of the row that the current cell belongs to.
|
|
243
265
|
*/
|
|
244
|
-
rowNode: _propTypes.default.object.isRequired
|
|
266
|
+
rowNode: _propTypes.default.object.isRequired,
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* the tabIndex value.
|
|
270
|
+
*/
|
|
271
|
+
tabIndex: _propTypes.default.oneOf([-1, 0]).isRequired,
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* The cell value, but if the column has valueGetter, use getValue.
|
|
275
|
+
*/
|
|
276
|
+
value: _propTypes.default.any
|
|
245
277
|
} : void 0;
|
|
246
278
|
|
|
247
279
|
const renderEditSingleSelectCell = params => /*#__PURE__*/(0, _jsxRuntime.jsx)(GridEditSingleSelectCell, (0, _extends2.default)({}, params));
|
|
@@ -17,6 +17,32 @@ Object.keys(_GridCell).forEach(function (key) {
|
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
var _GridEditBooleanCell = require("./GridEditBooleanCell");
|
|
21
|
+
|
|
22
|
+
Object.keys(_GridEditBooleanCell).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _GridEditBooleanCell[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _GridEditBooleanCell[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _GridEditDateCell = require("./GridEditDateCell");
|
|
34
|
+
|
|
35
|
+
Object.keys(_GridEditDateCell).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _GridEditDateCell[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _GridEditDateCell[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
20
46
|
var _GridEditInputCell = require("./GridEditInputCell");
|
|
21
47
|
|
|
22
48
|
Object.keys(_GridEditInputCell).forEach(function (key) {
|
|
@@ -19,8 +19,6 @@ var _material = require("@mui/material");
|
|
|
19
19
|
|
|
20
20
|
var _utils = require("@mui/material/utils");
|
|
21
21
|
|
|
22
|
-
var _events = require("../../models/events");
|
|
23
|
-
|
|
24
22
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
25
23
|
|
|
26
24
|
var _GridColumnHeaderSortIcon = require("./GridColumnHeaderSortIcon");
|
|
@@ -114,25 +112,25 @@ function GridColumnHeaderItem(props) {
|
|
|
114
112
|
apiRef.current.publishEvent(eventName, apiRef.current.getColumnHeaderParams(column.field), event);
|
|
115
113
|
}, [apiRef, column.field]);
|
|
116
114
|
const mouseEventsHandlers = {
|
|
117
|
-
onClick: publish(
|
|
118
|
-
onDoubleClick: publish(
|
|
119
|
-
onMouseOver: publish(
|
|
115
|
+
onClick: publish('columnHeaderClick'),
|
|
116
|
+
onDoubleClick: publish('columnHeaderDoubleClick'),
|
|
117
|
+
onMouseOver: publish('columnHeaderOver'),
|
|
120
118
|
// TODO remove as it's not used
|
|
121
|
-
onMouseOut: publish(
|
|
119
|
+
onMouseOut: publish('columnHeaderOut'),
|
|
122
120
|
// TODO remove as it's not used
|
|
123
|
-
onMouseEnter: publish(
|
|
121
|
+
onMouseEnter: publish('columnHeaderEnter'),
|
|
124
122
|
// TODO remove as it's not used
|
|
125
|
-
onMouseLeave: publish(
|
|
123
|
+
onMouseLeave: publish('columnHeaderLeave'),
|
|
126
124
|
// TODO remove as it's not used
|
|
127
|
-
onKeyDown: publish(
|
|
128
|
-
onFocus: publish(
|
|
129
|
-
onBlur: publish(
|
|
125
|
+
onKeyDown: publish('columnHeaderKeyDown'),
|
|
126
|
+
onFocus: publish('columnHeaderFocus'),
|
|
127
|
+
onBlur: publish('columnHeaderBlur')
|
|
130
128
|
};
|
|
131
129
|
const draggableEventHandlers = {
|
|
132
|
-
onDragStart: publish(
|
|
133
|
-
onDragEnter: publish(
|
|
134
|
-
onDragOver: publish(
|
|
135
|
-
onDragEnd: publish(
|
|
130
|
+
onDragStart: publish('columnHeaderDragStart'),
|
|
131
|
+
onDragEnter: publish('columnHeaderDragEnter'),
|
|
132
|
+
onDragOver: publish('columnHeaderDragOver'),
|
|
133
|
+
onDragEnd: publish('columnHeaderDragEnd')
|
|
136
134
|
};
|
|
137
135
|
const removeLastBorderRight = isLastColumn && hasScrollX && !hasScrollY;
|
|
138
136
|
const showRightBorder = !isLastColumn ? rootProps.showColumnRightBorder : !removeLastBorderRight && !extendRowFullWidth;
|
|
@@ -142,7 +140,7 @@ function GridColumnHeaderItem(props) {
|
|
|
142
140
|
});
|
|
143
141
|
const classes = useUtilityClasses(ownerState);
|
|
144
142
|
const width = column.computedWidth;
|
|
145
|
-
let ariaSort;
|
|
143
|
+
let ariaSort = 'none';
|
|
146
144
|
|
|
147
145
|
if (sortDirection != null) {
|
|
148
146
|
ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';
|
|
@@ -179,14 +177,11 @@ function GridColumnHeaderItem(props) {
|
|
|
179
177
|
|
|
180
178
|
if (hasFocus && !columnMenuState.open) {
|
|
181
179
|
const focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
} else {
|
|
186
|
-
headerCellRef.current.focus();
|
|
187
|
-
}
|
|
180
|
+
const elementToFocus = focusableElement || headerCellRef.current;
|
|
181
|
+
elementToFocus == null ? void 0 : elementToFocus.focus();
|
|
182
|
+
apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
|
|
188
183
|
}
|
|
189
|
-
});
|
|
184
|
+
}, [apiRef, hasFocus]);
|
|
190
185
|
const headerClassName = typeof column.headerClassName === 'function' ? column.headerClassName({
|
|
191
186
|
field: column.field,
|
|
192
187
|
colDef: column
|
|
@@ -224,7 +219,7 @@ function GridColumnHeaderItem(props) {
|
|
|
224
219
|
resizable: !rootProps.disableColumnResize && !!column.resizable,
|
|
225
220
|
resizing: isResizing,
|
|
226
221
|
height: headerHeight,
|
|
227
|
-
onMouseDown: publish(
|
|
222
|
+
onMouseDown: publish('columnSeparatorMouseDown'),
|
|
228
223
|
side: separatorSide
|
|
229
224
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridColumnHeaderMenu.GridColumnHeaderMenu, {
|
|
230
225
|
columnMenuId: columnMenuId,
|
|
@@ -25,7 +25,7 @@ var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
|
25
25
|
|
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
27
|
|
|
28
|
-
const _excluded = ["
|
|
28
|
+
const _excluded = ["className"];
|
|
29
29
|
|
|
30
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
31
|
|
|
@@ -19,8 +19,6 @@ var _material = require("@mui/material");
|
|
|
19
19
|
|
|
20
20
|
var _utils = require("@mui/material/utils");
|
|
21
21
|
|
|
22
|
-
var _events = require("../../models/events");
|
|
23
|
-
|
|
24
22
|
var _keyboardUtils = require("../../utils/keyboardUtils");
|
|
25
23
|
|
|
26
24
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
@@ -31,7 +29,7 @@ var _gridClasses = require("../../constants/gridClasses");
|
|
|
31
29
|
|
|
32
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
31
|
|
|
34
|
-
const _excluded = ["field", "id", "value", "formattedValue", "row", "rowNode", "colDef", "isEditable", "cellMode", "hasFocus", "tabIndex", "getValue"];
|
|
32
|
+
const _excluded = ["field", "id", "value", "formattedValue", "row", "rowNode", "colDef", "isEditable", "cellMode", "hasFocus", "tabIndex", "getValue", "api"];
|
|
35
33
|
|
|
36
34
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
35
|
|
|
@@ -74,7 +72,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
74
72
|
value: event.target.checked,
|
|
75
73
|
id
|
|
76
74
|
};
|
|
77
|
-
apiRef.current.publishEvent(
|
|
75
|
+
apiRef.current.publishEvent('rowSelectionCheckboxChange', params, event);
|
|
78
76
|
};
|
|
79
77
|
|
|
80
78
|
React.useLayoutEffect(() => {
|
|
@@ -99,7 +97,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
if ((0, _keyboardUtils.isNavigationKey)(event.key) && !event.shiftKey) {
|
|
102
|
-
apiRef.current.publishEvent(
|
|
100
|
+
apiRef.current.publishEvent('cellNavigationKeyDown', props, event);
|
|
103
101
|
}
|
|
104
102
|
}, [apiRef, props]);
|
|
105
103
|
const isSelectable = !rootProps.isRowSelectable || rootProps.isRowSelectable(apiRef.current.getRowParams(id));
|
|
@@ -126,6 +124,12 @@ process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
|
126
124
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
127
125
|
// ----------------------------------------------------------------------
|
|
128
126
|
|
|
127
|
+
/**
|
|
128
|
+
* GridApi that let you manipulate the grid.
|
|
129
|
+
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
130
|
+
*/
|
|
131
|
+
api: _propTypes.default.any.isRequired,
|
|
132
|
+
|
|
129
133
|
/**
|
|
130
134
|
* The mode of the cell.
|
|
131
135
|
*/
|
|
@@ -141,10 +145,21 @@ process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
|
141
145
|
*/
|
|
142
146
|
field: _propTypes.default.string.isRequired,
|
|
143
147
|
|
|
148
|
+
/**
|
|
149
|
+
* A ref allowing to set imperative focus.
|
|
150
|
+
* It can be passed to the element that should receive focus.
|
|
151
|
+
* @ignore - do not document.
|
|
152
|
+
*/
|
|
153
|
+
focusElementRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
154
|
+
current: _propTypes.default.shape({
|
|
155
|
+
focus: _propTypes.default.func.isRequired
|
|
156
|
+
})
|
|
157
|
+
})]),
|
|
158
|
+
|
|
144
159
|
/**
|
|
145
160
|
* The cell value formatted with the column valueFormatter.
|
|
146
161
|
*/
|
|
147
|
-
formattedValue: _propTypes.default.any
|
|
162
|
+
formattedValue: _propTypes.default.any,
|
|
148
163
|
|
|
149
164
|
/**
|
|
150
165
|
* Get the cell value of a row and field.
|
|
@@ -188,7 +203,7 @@ process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
|
188
203
|
/**
|
|
189
204
|
* The cell value, but if the column has valueGetter, use getValue.
|
|
190
205
|
*/
|
|
191
|
-
value: _propTypes.default.any
|
|
206
|
+
value: _propTypes.default.any
|
|
192
207
|
} : void 0;
|
|
193
208
|
const GridCellCheckboxRenderer = /*#__PURE__*/React.memo(GridCellCheckboxForwardRef);
|
|
194
209
|
exports.GridCellCheckboxRenderer = GridCellCheckboxRenderer;
|
|
@@ -17,8 +17,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
17
17
|
|
|
18
18
|
var _material = require("@mui/material");
|
|
19
19
|
|
|
20
|
-
var _events = require("../../models/events");
|
|
21
|
-
|
|
22
20
|
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
23
21
|
|
|
24
22
|
var _gridFocusStateSelector = require("../../hooks/features/focus/gridFocusStateSelector");
|
|
@@ -103,7 +101,7 @@ const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderChec
|
|
|
103
101
|
const params = {
|
|
104
102
|
value: event.target.checked
|
|
105
103
|
};
|
|
106
|
-
apiRef.current.publishEvent(
|
|
104
|
+
apiRef.current.publishEvent('headerSelectionCheckboxChange', params);
|
|
107
105
|
};
|
|
108
106
|
|
|
109
107
|
const tabIndex = tabIndexState !== null && tabIndexState.field === props.field ? 0 : -1;
|
|
@@ -117,21 +115,21 @@ const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderChec
|
|
|
117
115
|
const handleKeyDown = React.useCallback(event => {
|
|
118
116
|
if (event.key === ' ') {
|
|
119
117
|
// imperative toggle the checkbox because Space is disable by some preventDefault
|
|
120
|
-
apiRef.current.publishEvent(
|
|
118
|
+
apiRef.current.publishEvent('headerSelectionCheckboxChange', {
|
|
121
119
|
value: !isChecked
|
|
122
120
|
});
|
|
123
121
|
} // TODO v6 remove columnHeaderNavigationKeyDown events which are not used internally anymore
|
|
124
122
|
|
|
125
123
|
|
|
126
124
|
if ((0, _keyboardUtils.isNavigationKey)(event.key) && !event.shiftKey) {
|
|
127
|
-
apiRef.current.publishEvent(
|
|
125
|
+
apiRef.current.publishEvent('columnHeaderNavigationKeyDown', props, event);
|
|
128
126
|
}
|
|
129
127
|
}, [apiRef, props, isChecked]);
|
|
130
128
|
const handleSelectionChange = React.useCallback(() => {
|
|
131
129
|
forceUpdate(p => !p);
|
|
132
130
|
}, []);
|
|
133
131
|
React.useEffect(() => {
|
|
134
|
-
return apiRef.current.subscribeEvent(
|
|
132
|
+
return apiRef.current.subscribeEvent('selectionChange', handleSelectionChange);
|
|
135
133
|
}, [apiRef, handleSelectionChange]);
|
|
136
134
|
const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectAllRows' : 'checkboxSelectionSelectAllRows');
|
|
137
135
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseCheckbox, (0, _extends2.default)({
|
|
@@ -13,6 +13,8 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
13
13
|
|
|
14
14
|
var React = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
|
|
16
18
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
17
19
|
|
|
18
20
|
var _material = require("@mui/material");
|
|
@@ -73,4 +75,11 @@ const GridFooterContainer = /*#__PURE__*/React.forwardRef(function GridFooterCon
|
|
|
73
75
|
className: (0, _clsx.default)(classes.root, className)
|
|
74
76
|
}, other));
|
|
75
77
|
});
|
|
76
|
-
exports.GridFooterContainer = GridFooterContainer;
|
|
78
|
+
exports.GridFooterContainer = GridFooterContainer;
|
|
79
|
+
process.env.NODE_ENV !== "production" ? GridFooterContainer.propTypes = {
|
|
80
|
+
// ----------------------------- Warning --------------------------------
|
|
81
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
82
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
83
|
+
// ----------------------------------------------------------------------
|
|
84
|
+
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
85
|
+
} : void 0;
|