@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,11 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["field", "id", "value", "formattedValue", "row", "rowNode", "colDef", "isEditable", "cellMode", "hasFocus", "tabIndex", "getValue"];
|
|
3
|
+
const _excluded = ["field", "id", "value", "formattedValue", "row", "rowNode", "colDef", "isEditable", "cellMode", "hasFocus", "tabIndex", "getValue", "api"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
7
7
|
import { useForkRef } from '@mui/material/utils';
|
|
8
|
-
import { GridEvents } from '../../models/events';
|
|
9
8
|
import { isNavigationKey, isSpaceKey } from '../../utils/keyboardUtils';
|
|
10
9
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
11
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
@@ -48,7 +47,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
48
47
|
value: event.target.checked,
|
|
49
48
|
id
|
|
50
49
|
};
|
|
51
|
-
apiRef.current.publishEvent(
|
|
50
|
+
apiRef.current.publishEvent('rowSelectionCheckboxChange', params, event);
|
|
52
51
|
};
|
|
53
52
|
|
|
54
53
|
React.useLayoutEffect(() => {
|
|
@@ -71,7 +70,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
if (isNavigationKey(event.key) && !event.shiftKey) {
|
|
74
|
-
apiRef.current.publishEvent(
|
|
73
|
+
apiRef.current.publishEvent('cellNavigationKeyDown', props, event);
|
|
75
74
|
}
|
|
76
75
|
}, [apiRef, props]);
|
|
77
76
|
const isSelectable = !rootProps.isRowSelectable || rootProps.isRowSelectable(apiRef.current.getRowParams(id));
|
|
@@ -97,6 +96,12 @@ process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
|
97
96
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
98
97
|
// ----------------------------------------------------------------------
|
|
99
98
|
|
|
99
|
+
/**
|
|
100
|
+
* GridApi that let you manipulate the grid.
|
|
101
|
+
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
102
|
+
*/
|
|
103
|
+
api: PropTypes.any.isRequired,
|
|
104
|
+
|
|
100
105
|
/**
|
|
101
106
|
* The mode of the cell.
|
|
102
107
|
*/
|
|
@@ -112,10 +117,21 @@ process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
|
112
117
|
*/
|
|
113
118
|
field: PropTypes.string.isRequired,
|
|
114
119
|
|
|
120
|
+
/**
|
|
121
|
+
* A ref allowing to set imperative focus.
|
|
122
|
+
* It can be passed to the element that should receive focus.
|
|
123
|
+
* @ignore - do not document.
|
|
124
|
+
*/
|
|
125
|
+
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
126
|
+
current: PropTypes.shape({
|
|
127
|
+
focus: PropTypes.func.isRequired
|
|
128
|
+
})
|
|
129
|
+
})]),
|
|
130
|
+
|
|
115
131
|
/**
|
|
116
132
|
* The cell value formatted with the column valueFormatter.
|
|
117
133
|
*/
|
|
118
|
-
formattedValue: PropTypes.any
|
|
134
|
+
formattedValue: PropTypes.any,
|
|
119
135
|
|
|
120
136
|
/**
|
|
121
137
|
* Get the cell value of a row and field.
|
|
@@ -159,7 +175,7 @@ process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
|
159
175
|
/**
|
|
160
176
|
* The cell value, but if the column has valueGetter, use getValue.
|
|
161
177
|
*/
|
|
162
|
-
value: PropTypes.any
|
|
178
|
+
value: PropTypes.any
|
|
163
179
|
} : void 0;
|
|
164
180
|
export { GridCellCheckboxForwardRef };
|
|
165
181
|
export const GridCellCheckboxRenderer = /*#__PURE__*/React.memo(GridCellCheckboxForwardRef);
|
|
@@ -4,7 +4,6 @@ const _excluded = ["field", "colDef"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
7
|
-
import { GridEvents } from '../../models/events';
|
|
8
7
|
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
9
8
|
import { gridTabIndexColumnHeaderSelector } from '../../hooks/features/focus/gridFocusStateSelector';
|
|
10
9
|
import { gridSelectionStateSelector } from '../../hooks/features/selection/gridSelectionSelector';
|
|
@@ -73,7 +72,7 @@ const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderChec
|
|
|
73
72
|
const params = {
|
|
74
73
|
value: event.target.checked
|
|
75
74
|
};
|
|
76
|
-
apiRef.current.publishEvent(
|
|
75
|
+
apiRef.current.publishEvent('headerSelectionCheckboxChange', params);
|
|
77
76
|
};
|
|
78
77
|
|
|
79
78
|
const tabIndex = tabIndexState !== null && tabIndexState.field === props.field ? 0 : -1;
|
|
@@ -87,21 +86,21 @@ const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderChec
|
|
|
87
86
|
const handleKeyDown = React.useCallback(event => {
|
|
88
87
|
if (event.key === ' ') {
|
|
89
88
|
// imperative toggle the checkbox because Space is disable by some preventDefault
|
|
90
|
-
apiRef.current.publishEvent(
|
|
89
|
+
apiRef.current.publishEvent('headerSelectionCheckboxChange', {
|
|
91
90
|
value: !isChecked
|
|
92
91
|
});
|
|
93
92
|
} // TODO v6 remove columnHeaderNavigationKeyDown events which are not used internally anymore
|
|
94
93
|
|
|
95
94
|
|
|
96
95
|
if (isNavigationKey(event.key) && !event.shiftKey) {
|
|
97
|
-
apiRef.current.publishEvent(
|
|
96
|
+
apiRef.current.publishEvent('columnHeaderNavigationKeyDown', props, event);
|
|
98
97
|
}
|
|
99
98
|
}, [apiRef, props, isChecked]);
|
|
100
99
|
const handleSelectionChange = React.useCallback(() => {
|
|
101
100
|
forceUpdate(p => !p);
|
|
102
101
|
}, []);
|
|
103
102
|
React.useEffect(() => {
|
|
104
|
-
return apiRef.current.subscribeEvent(
|
|
103
|
+
return apiRef.current.subscribeEvent('selectionChange', handleSelectionChange);
|
|
105
104
|
}, [apiRef, handleSelectionChange]);
|
|
106
105
|
const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectAllRows' : 'checkboxSelectionSelectAllRows');
|
|
107
106
|
return /*#__PURE__*/_jsx(rootProps.components.BaseCheckbox, _extends({
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import clsx from 'clsx';
|
|
6
7
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
7
8
|
import { styled, alpha, lighten, darken } from '@mui/material/styles';
|
|
@@ -36,7 +37,7 @@ const GridFooterContainerRoot = styled('div', {
|
|
|
36
37
|
borderTop: `1px solid ${borderColor}`
|
|
37
38
|
};
|
|
38
39
|
});
|
|
39
|
-
|
|
40
|
+
const GridFooterContainer = /*#__PURE__*/React.forwardRef(function GridFooterContainer(props, ref) {
|
|
40
41
|
const {
|
|
41
42
|
className
|
|
42
43
|
} = props,
|
|
@@ -51,4 +52,12 @@ export const GridFooterContainer = /*#__PURE__*/React.forwardRef(function GridFo
|
|
|
51
52
|
ref: ref,
|
|
52
53
|
className: clsx(classes.root, className)
|
|
53
54
|
}, other));
|
|
54
|
-
});
|
|
55
|
+
});
|
|
56
|
+
process.env.NODE_ENV !== "production" ? GridFooterContainer.propTypes = {
|
|
57
|
+
// ----------------------------- Warning --------------------------------
|
|
58
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
59
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
60
|
+
// ----------------------------------------------------------------------
|
|
61
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
62
|
+
} : void 0;
|
|
63
|
+
export { GridFooterContainer };
|
|
@@ -73,8 +73,16 @@ export const GridRootStyles = styled('div', {
|
|
|
73
73
|
[`& .${gridClasses['row--editable']}`]: styles['row--editable']
|
|
74
74
|
}, {
|
|
75
75
|
[`& .${gridClasses['row--editing']}`]: styles['row--editing']
|
|
76
|
+
}, {
|
|
77
|
+
[`& .${gridClasses['row--dragging']}`]: styles['row--dragging']
|
|
76
78
|
}, {
|
|
77
79
|
[`& .${gridClasses.row}`]: styles.row
|
|
80
|
+
}, {
|
|
81
|
+
[`& .${gridClasses.rowReorderCellPlaceholder}`]: styles.rowReorderCellPlaceholder
|
|
82
|
+
}, {
|
|
83
|
+
[`& .${gridClasses.rowReorderCell}`]: styles.rowReorderCell
|
|
84
|
+
}, {
|
|
85
|
+
[`& .${gridClasses['rowReorderCell--draggable']}`]: styles['rowReorderCell--draggable']
|
|
78
86
|
}, {
|
|
79
87
|
[`& .${gridClasses.sortIcon}`]: styles.sortIcon
|
|
80
88
|
}, {
|
|
@@ -309,6 +317,21 @@ export const GridRootStyles = styled('div', {
|
|
|
309
317
|
alignItems: 'center',
|
|
310
318
|
gridGap: theme.spacing(1)
|
|
311
319
|
},
|
|
320
|
+
[`& .${gridClasses.rowReorderCell}`]: {
|
|
321
|
+
display: 'inline-flex',
|
|
322
|
+
flex: 1,
|
|
323
|
+
alignItems: 'center',
|
|
324
|
+
justifyContent: 'center',
|
|
325
|
+
opacity: theme.palette.action.disabledOpacity
|
|
326
|
+
},
|
|
327
|
+
[`& .${gridClasses['rowReorderCell--draggable']}`]: {
|
|
328
|
+
cursor: 'move',
|
|
329
|
+
opacity: 1
|
|
330
|
+
},
|
|
331
|
+
[`& .${gridClasses.rowReorderCellContainer}`]: {
|
|
332
|
+
padding: 0,
|
|
333
|
+
alignItems: 'stretch'
|
|
334
|
+
},
|
|
312
335
|
[`& .${gridClasses.withBorder}`]: {
|
|
313
336
|
borderRight: `1px solid ${borderColor}`
|
|
314
337
|
},
|
|
@@ -325,12 +348,24 @@ export const GridRootStyles = styled('div', {
|
|
|
325
348
|
display: 'flex',
|
|
326
349
|
width: '100%'
|
|
327
350
|
},
|
|
328
|
-
[`& .${gridClasses
|
|
351
|
+
[`& .${gridClasses.rowReorderCellPlaceholder}`]: {
|
|
352
|
+
display: 'none'
|
|
353
|
+
},
|
|
354
|
+
[`& .${gridClasses['columnHeader--dragging']}, & .${gridClasses['row--dragging']}`]: {
|
|
329
355
|
background: theme.palette.background.paper,
|
|
330
356
|
padding: '0 12px',
|
|
331
357
|
borderRadius: theme.shape.borderRadius,
|
|
332
358
|
opacity: theme.palette.action.disabledOpacity
|
|
333
359
|
},
|
|
360
|
+
[`& .${gridClasses['row--dragging']}`]: {
|
|
361
|
+
background: theme.palette.background.paper,
|
|
362
|
+
padding: '0 12px',
|
|
363
|
+
borderRadius: theme.shape.borderRadius,
|
|
364
|
+
opacity: theme.palette.action.disabledOpacity,
|
|
365
|
+
[`& .${gridClasses.rowReorderCellPlaceholder}`]: {
|
|
366
|
+
display: 'flex'
|
|
367
|
+
}
|
|
368
|
+
},
|
|
334
369
|
[`& .${gridClasses.treeDataGroupingCell}`]: {
|
|
335
370
|
display: 'flex',
|
|
336
371
|
alignItems: 'center',
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["className", "children"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import clsx from 'clsx';
|
|
6
7
|
import { styled } from '@mui/material/styles';
|
|
7
8
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
@@ -28,9 +29,10 @@ const GridToolbarContainerRoot = styled('div', {
|
|
|
28
29
|
}) => ({
|
|
29
30
|
display: 'flex',
|
|
30
31
|
alignItems: 'center',
|
|
32
|
+
flexWrap: 'wrap',
|
|
31
33
|
padding: theme.spacing(0.5, 0.5, 0)
|
|
32
34
|
}));
|
|
33
|
-
|
|
35
|
+
const GridToolbarContainer = /*#__PURE__*/React.forwardRef(function GridToolbarContainer(props, ref) {
|
|
34
36
|
const {
|
|
35
37
|
className,
|
|
36
38
|
children
|
|
@@ -53,4 +55,12 @@ export const GridToolbarContainer = /*#__PURE__*/React.forwardRef(function GridT
|
|
|
53
55
|
}, other, {
|
|
54
56
|
children: children
|
|
55
57
|
}));
|
|
56
|
-
});
|
|
58
|
+
});
|
|
59
|
+
process.env.NODE_ENV !== "production" ? GridToolbarContainer.propTypes = {
|
|
60
|
+
// ----------------------------- Warning --------------------------------
|
|
61
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
62
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
63
|
+
// ----------------------------------------------------------------------
|
|
64
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
65
|
+
} : void 0;
|
|
66
|
+
export { GridToolbarContainer };
|
|
@@ -93,6 +93,7 @@ const GridMenu = props => {
|
|
|
93
93
|
placement
|
|
94
94
|
}) => /*#__PURE__*/_jsx(ClickAwayListener, {
|
|
95
95
|
onClickAway: onClickAway,
|
|
96
|
+
mouseEvent: "onMouseDown",
|
|
96
97
|
children: /*#__PURE__*/_jsx(Grow, _extends({}, TransitionProps, {
|
|
97
98
|
style: {
|
|
98
99
|
transformOrigin: transformOrigin[placement]
|
|
@@ -80,6 +80,7 @@ const GridPanel = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
80
80
|
modifiers: modifiers
|
|
81
81
|
}, other, {
|
|
82
82
|
children: /*#__PURE__*/_jsx(ClickAwayListener, {
|
|
83
|
+
mouseEvent: "onMouseUp",
|
|
83
84
|
onClickAway: handleClickAway,
|
|
84
85
|
children: /*#__PURE__*/_jsx(GridPaperRoot, {
|
|
85
86
|
className: classes.paper,
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import clsx from 'clsx';
|
|
6
7
|
import { styled } from '@mui/material/styles';
|
|
7
8
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
@@ -30,7 +31,8 @@ const GridPanelContentRoot = styled('div', {
|
|
|
30
31
|
flex: '1 1',
|
|
31
32
|
maxHeight: 400
|
|
32
33
|
});
|
|
33
|
-
|
|
34
|
+
|
|
35
|
+
function GridPanelContent(props) {
|
|
34
36
|
const {
|
|
35
37
|
className
|
|
36
38
|
} = props,
|
|
@@ -44,4 +46,13 @@ export function GridPanelContent(props) {
|
|
|
44
46
|
return /*#__PURE__*/_jsx(GridPanelContentRoot, _extends({
|
|
45
47
|
className: clsx(className, classes.root)
|
|
46
48
|
}, other));
|
|
47
|
-
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
process.env.NODE_ENV !== "production" ? GridPanelContent.propTypes = {
|
|
52
|
+
// ----------------------------- Warning --------------------------------
|
|
53
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
54
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
55
|
+
// ----------------------------------------------------------------------
|
|
56
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
57
|
+
} : void 0;
|
|
58
|
+
export { GridPanelContent };
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import clsx from 'clsx';
|
|
6
7
|
import { styled } from '@mui/material/styles';
|
|
7
8
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
@@ -30,7 +31,8 @@ const GridPanelFooterRoot = styled('div', {
|
|
|
30
31
|
display: 'flex',
|
|
31
32
|
justifyContent: 'space-between'
|
|
32
33
|
}));
|
|
33
|
-
|
|
34
|
+
|
|
35
|
+
function GridPanelFooter(props) {
|
|
34
36
|
const {
|
|
35
37
|
className
|
|
36
38
|
} = props,
|
|
@@ -44,4 +46,13 @@ export function GridPanelFooter(props) {
|
|
|
44
46
|
return /*#__PURE__*/_jsx(GridPanelFooterRoot, _extends({
|
|
45
47
|
className: clsx(className, classes.root)
|
|
46
48
|
}, other));
|
|
47
|
-
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
process.env.NODE_ENV !== "production" ? GridPanelFooter.propTypes = {
|
|
52
|
+
// ----------------------------- Warning --------------------------------
|
|
53
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
54
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
55
|
+
// ----------------------------------------------------------------------
|
|
56
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
57
|
+
} : void 0;
|
|
58
|
+
export { GridPanelFooter };
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import clsx from 'clsx';
|
|
6
7
|
import { styled } from '@mui/material/styles';
|
|
7
8
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
@@ -28,7 +29,8 @@ const GridPanelHeaderRoot = styled('div', {
|
|
|
28
29
|
}) => ({
|
|
29
30
|
padding: theme.spacing(1)
|
|
30
31
|
}));
|
|
31
|
-
|
|
32
|
+
|
|
33
|
+
function GridPanelHeader(props) {
|
|
32
34
|
const {
|
|
33
35
|
className
|
|
34
36
|
} = props,
|
|
@@ -42,4 +44,13 @@ export function GridPanelHeader(props) {
|
|
|
42
44
|
return /*#__PURE__*/_jsx(GridPanelHeaderRoot, _extends({
|
|
43
45
|
className: clsx(className, classes.root)
|
|
44
46
|
}, other));
|
|
45
|
-
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
process.env.NODE_ENV !== "production" ? GridPanelHeader.propTypes = {
|
|
50
|
+
// ----------------------------- Warning --------------------------------
|
|
51
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
52
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
53
|
+
// ----------------------------------------------------------------------
|
|
54
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
55
|
+
} : void 0;
|
|
56
|
+
export { GridPanelHeader };
|
|
@@ -3,6 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
5
5
|
import IconButton from '@mui/material/IconButton';
|
|
6
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
6
7
|
import InputLabel from '@mui/material/InputLabel';
|
|
7
8
|
import FormControl from '@mui/material/FormControl';
|
|
8
9
|
import { capitalize, unstable_useId as useId } from '@mui/material/utils';
|
|
@@ -136,6 +137,9 @@ function GridFilterForm(props) {
|
|
|
136
137
|
const filterSelectorRef = React.useRef(null);
|
|
137
138
|
const hasLinkOperatorColumn = hasMultipleFilters && linkOperators.length > 0;
|
|
138
139
|
const baseFormControlProps = rootProps.componentsProps?.baseFormControl || {};
|
|
140
|
+
const baseSelectProps = rootProps.componentsProps?.baseSelect || {};
|
|
141
|
+
const isBaseSelectNative = baseSelectProps.native ?? true;
|
|
142
|
+
const OptionComponent = isBaseSelectNative ? 'option' : MenuItem;
|
|
139
143
|
const sortedFilterableColumns = React.useMemo(() => {
|
|
140
144
|
switch (columnsSort) {
|
|
141
145
|
case 'asc':
|
|
@@ -245,9 +249,9 @@ function GridFilterForm(props) {
|
|
|
245
249
|
value: multiFilterOperator,
|
|
246
250
|
onChange: changeLinkOperator,
|
|
247
251
|
disabled: !!disableMultiFilterOperator || linkOperators.length === 1,
|
|
248
|
-
native:
|
|
252
|
+
native: isBaseSelectNative
|
|
249
253
|
}, rootProps.componentsProps?.baseSelect, {
|
|
250
|
-
children: linkOperators.map(linkOperator => /*#__PURE__*/_jsx(
|
|
254
|
+
children: linkOperators.map(linkOperator => /*#__PURE__*/_jsx(OptionComponent, {
|
|
251
255
|
value: linkOperator.toString(),
|
|
252
256
|
children: apiRef.current.getLocaleText(getLinkOperatorLocaleKey(linkOperator))
|
|
253
257
|
}, linkOperator.toString()))
|
|
@@ -267,9 +271,9 @@ function GridFilterForm(props) {
|
|
|
267
271
|
label: apiRef.current.getLocaleText('filterPanelColumns'),
|
|
268
272
|
value: item.columnField || '',
|
|
269
273
|
onChange: changeColumn,
|
|
270
|
-
native:
|
|
274
|
+
native: isBaseSelectNative
|
|
271
275
|
}, rootProps.componentsProps?.baseSelect, {
|
|
272
|
-
children: sortedFilterableColumns.map(col => /*#__PURE__*/_jsx(
|
|
276
|
+
children: sortedFilterableColumns.map(col => /*#__PURE__*/_jsx(OptionComponent, {
|
|
273
277
|
value: col.field,
|
|
274
278
|
children: getColumnLabel(col)
|
|
275
279
|
}, col.field))
|
|
@@ -289,10 +293,10 @@ function GridFilterForm(props) {
|
|
|
289
293
|
id: operatorSelectId,
|
|
290
294
|
value: item.operatorValue,
|
|
291
295
|
onChange: changeOperator,
|
|
292
|
-
native:
|
|
296
|
+
native: isBaseSelectNative,
|
|
293
297
|
inputRef: filterSelectorRef
|
|
294
298
|
}, rootProps.componentsProps?.baseSelect, {
|
|
295
|
-
children: currentColumn?.filterOperators?.map(operator => /*#__PURE__*/_jsx(
|
|
299
|
+
children: currentColumn?.filterOperators?.map(operator => /*#__PURE__*/_jsx(OptionComponent, {
|
|
296
300
|
value: operator.value,
|
|
297
301
|
children: operator.label || apiRef.current.getLocaleText(`filterOperator${capitalize(operator.value)}`)
|
|
298
302
|
}, operator.value))
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
5
6
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -16,6 +17,9 @@ export function GridFilterInputBoolean(props) {
|
|
|
16
17
|
|
|
17
18
|
const [filterValueState, setFilterValueState] = React.useState(item.value || '');
|
|
18
19
|
const rootProps = useGridRootProps();
|
|
20
|
+
const baseSelectProps = rootProps.componentsProps?.baseSelect || {};
|
|
21
|
+
const isSelectNative = baseSelectProps.native ?? true;
|
|
22
|
+
const OptionComponent = isSelectNative ? 'option' : MenuItem;
|
|
19
23
|
const onFilterChange = React.useCallback(event => {
|
|
20
24
|
const value = event.target.value;
|
|
21
25
|
setFilterValueState(value);
|
|
@@ -32,21 +36,22 @@ export function GridFilterInputBoolean(props) {
|
|
|
32
36
|
onChange: onFilterChange,
|
|
33
37
|
variant: "standard",
|
|
34
38
|
select: true,
|
|
35
|
-
SelectProps: {
|
|
36
|
-
native:
|
|
37
|
-
|
|
39
|
+
SelectProps: _extends({
|
|
40
|
+
native: isSelectNative,
|
|
41
|
+
displayEmpty: true
|
|
42
|
+
}, rootProps.componentsProps?.baseSelect),
|
|
38
43
|
InputLabelProps: {
|
|
39
44
|
shrink: true
|
|
40
45
|
},
|
|
41
46
|
inputRef: focusElementRef
|
|
42
47
|
}, others, rootProps.componentsProps?.baseTextField, {
|
|
43
|
-
children: [/*#__PURE__*/_jsx(
|
|
48
|
+
children: [/*#__PURE__*/_jsx(OptionComponent, {
|
|
44
49
|
value: "",
|
|
45
50
|
children: apiRef.current.getLocaleText('filterValueAny')
|
|
46
|
-
}), /*#__PURE__*/_jsx(
|
|
51
|
+
}), /*#__PURE__*/_jsx(OptionComponent, {
|
|
47
52
|
value: "true",
|
|
48
53
|
children: apiRef.current.getLocaleText('filterValueTrue')
|
|
49
|
-
}), /*#__PURE__*/_jsx(
|
|
54
|
+
}), /*#__PURE__*/_jsx(OptionComponent, {
|
|
50
55
|
value: "false",
|
|
51
56
|
children: apiRef.current.getLocaleText('filterValueFalse')
|
|
52
57
|
})]
|
|
@@ -4,6 +4,7 @@ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/material/utils';
|
|
7
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
7
8
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
8
9
|
import { getValueFromValueOptions } from './filterPanelUtils';
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -12,21 +13,25 @@ const renderSingleSelectOptions = ({
|
|
|
12
13
|
valueOptions,
|
|
13
14
|
valueFormatter,
|
|
14
15
|
field
|
|
15
|
-
}, api) => {
|
|
16
|
+
}, api, OptionComponent) => {
|
|
16
17
|
const iterableColumnValues = typeof valueOptions === 'function' ? ['', ...valueOptions({
|
|
17
18
|
field
|
|
18
19
|
})] : ['', ...(valueOptions || [])];
|
|
19
|
-
return iterableColumnValues.map(option =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
children: valueFormatter && option !== '' ? valueFormatter({
|
|
20
|
+
return iterableColumnValues.map(option => {
|
|
21
|
+
const isOptionTypeObject = typeof option === 'object';
|
|
22
|
+
const key = isOptionTypeObject ? option.value : option;
|
|
23
|
+
const value = isOptionTypeObject ? option.value : option;
|
|
24
|
+
const formattedValue = valueFormatter && option !== '' ? valueFormatter({
|
|
25
25
|
value: option,
|
|
26
26
|
field,
|
|
27
27
|
api
|
|
28
|
-
}) : option
|
|
29
|
-
|
|
28
|
+
}) : option;
|
|
29
|
+
const content = isOptionTypeObject ? option.label : formattedValue;
|
|
30
|
+
return /*#__PURE__*/_jsx(OptionComponent, {
|
|
31
|
+
value: value,
|
|
32
|
+
children: content
|
|
33
|
+
}, key);
|
|
34
|
+
});
|
|
30
35
|
};
|
|
31
36
|
|
|
32
37
|
function GridFilterInputSingleSelect(props) {
|
|
@@ -42,6 +47,8 @@ function GridFilterInputSingleSelect(props) {
|
|
|
42
47
|
const [filterValueState, setFilterValueState] = React.useState(item.value ?? '');
|
|
43
48
|
const id = useId();
|
|
44
49
|
const rootProps = useGridRootProps();
|
|
50
|
+
const baseSelectProps = rootProps.componentsProps?.baseSelect || {};
|
|
51
|
+
const isSelectNative = baseSelectProps.native ?? true;
|
|
45
52
|
const currentColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
|
|
46
53
|
const currentValueOptions = React.useMemo(() => {
|
|
47
54
|
return typeof currentColumn.valueOptions === 'function' ? currentColumn.valueOptions({
|
|
@@ -90,11 +97,11 @@ function GridFilterInputSingleSelect(props) {
|
|
|
90
97
|
},
|
|
91
98
|
inputRef: focusElementRef,
|
|
92
99
|
select: true,
|
|
93
|
-
SelectProps: {
|
|
94
|
-
native:
|
|
95
|
-
}
|
|
100
|
+
SelectProps: _extends({
|
|
101
|
+
native: isSelectNative
|
|
102
|
+
}, rootProps.componentsProps?.baseSelect)
|
|
96
103
|
}, others, rootProps.componentsProps?.baseTextField, {
|
|
97
|
-
children: renderSingleSelectOptions(apiRef.current.getColumn(item.columnField), apiRef.current)
|
|
104
|
+
children: renderSingleSelectOptions(apiRef.current.getColumn(item.columnField), apiRef.current, isSelectNative ? 'option' : MenuItem)
|
|
98
105
|
}));
|
|
99
106
|
}
|
|
100
107
|
|
|
@@ -4,6 +4,7 @@ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/material/utils';
|
|
7
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
7
8
|
import { GridLoadIcon } from '../../icons';
|
|
8
9
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
9
10
|
import { getValueFromValueOptions } from './filterPanelUtils';
|
|
@@ -19,21 +20,25 @@ const renderSingleSelectOptions = ({
|
|
|
19
20
|
valueOptions,
|
|
20
21
|
valueFormatter,
|
|
21
22
|
field
|
|
22
|
-
}, api) => {
|
|
23
|
+
}, api, OptionComponent) => {
|
|
23
24
|
const iterableColumnValues = typeof valueOptions === 'function' ? ['', ...valueOptions({
|
|
24
25
|
field
|
|
25
26
|
})] : ['', ...(valueOptions || [])];
|
|
26
|
-
return iterableColumnValues.map(option =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
children: valueFormatter && option !== '' ? valueFormatter({
|
|
27
|
+
return iterableColumnValues.map(option => {
|
|
28
|
+
const isOptionTypeObject = typeof option === 'object';
|
|
29
|
+
const key = isOptionTypeObject ? option.value : option;
|
|
30
|
+
const value = isOptionTypeObject ? option.value : option;
|
|
31
|
+
const formattedValue = valueFormatter && option !== '' ? valueFormatter({
|
|
32
32
|
value: option,
|
|
33
33
|
field,
|
|
34
34
|
api
|
|
35
|
-
}) : option
|
|
36
|
-
|
|
35
|
+
}) : option;
|
|
36
|
+
const content = isOptionTypeObject ? option.label : formattedValue;
|
|
37
|
+
return /*#__PURE__*/_jsx(OptionComponent, {
|
|
38
|
+
value: value,
|
|
39
|
+
children: content
|
|
40
|
+
}, key);
|
|
41
|
+
});
|
|
37
42
|
};
|
|
38
43
|
|
|
39
44
|
export const SUBMIT_FILTER_STROKE_TIME = 500;
|
|
@@ -57,12 +62,14 @@ function GridFilterInputValue(props) {
|
|
|
57
62
|
const [applying, setIsApplying] = React.useState(false);
|
|
58
63
|
const id = useId();
|
|
59
64
|
const rootProps = useGridRootProps();
|
|
65
|
+
const baseSelectProps = rootProps.componentsProps?.baseSelect || {};
|
|
66
|
+
const isSelectNative = baseSelectProps.native ?? true;
|
|
60
67
|
const singleSelectProps = type === 'singleSelect' ? {
|
|
61
68
|
select: true,
|
|
62
|
-
SelectProps: {
|
|
63
|
-
native:
|
|
64
|
-
},
|
|
65
|
-
children: renderSingleSelectOptions(apiRef.current.getColumn(item.columnField), apiRef.current)
|
|
69
|
+
SelectProps: _extends({
|
|
70
|
+
native: isSelectNative
|
|
71
|
+
}, rootProps.componentsProps?.baseSelect),
|
|
72
|
+
children: renderSingleSelectOptions(apiRef.current.getColumn(item.columnField), apiRef.current, isSelectNative ? 'option' : MenuItem)
|
|
66
73
|
} : {};
|
|
67
74
|
const onFilterChange = React.useCallback(event => {
|
|
68
75
|
let value = event.target.value; // NativeSelect casts the value to a string.
|