@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
|
@@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/material/utils';
|
|
7
|
-
import { GridEvents } from '../../models/events';
|
|
8
7
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
9
8
|
import { GridColumnHeaderSortIcon } from './GridColumnHeaderSortIcon';
|
|
10
9
|
import { GridColumnHeaderTitle } from './GridColumnHeaderTitle';
|
|
@@ -87,25 +86,25 @@ function GridColumnHeaderItem(props) {
|
|
|
87
86
|
apiRef.current.publishEvent(eventName, apiRef.current.getColumnHeaderParams(column.field), event);
|
|
88
87
|
}, [apiRef, column.field]);
|
|
89
88
|
const mouseEventsHandlers = {
|
|
90
|
-
onClick: publish(
|
|
91
|
-
onDoubleClick: publish(
|
|
92
|
-
onMouseOver: publish(
|
|
89
|
+
onClick: publish('columnHeaderClick'),
|
|
90
|
+
onDoubleClick: publish('columnHeaderDoubleClick'),
|
|
91
|
+
onMouseOver: publish('columnHeaderOver'),
|
|
93
92
|
// TODO remove as it's not used
|
|
94
|
-
onMouseOut: publish(
|
|
93
|
+
onMouseOut: publish('columnHeaderOut'),
|
|
95
94
|
// TODO remove as it's not used
|
|
96
|
-
onMouseEnter: publish(
|
|
95
|
+
onMouseEnter: publish('columnHeaderEnter'),
|
|
97
96
|
// TODO remove as it's not used
|
|
98
|
-
onMouseLeave: publish(
|
|
97
|
+
onMouseLeave: publish('columnHeaderLeave'),
|
|
99
98
|
// TODO remove as it's not used
|
|
100
|
-
onKeyDown: publish(
|
|
101
|
-
onFocus: publish(
|
|
102
|
-
onBlur: publish(
|
|
99
|
+
onKeyDown: publish('columnHeaderKeyDown'),
|
|
100
|
+
onFocus: publish('columnHeaderFocus'),
|
|
101
|
+
onBlur: publish('columnHeaderBlur')
|
|
103
102
|
};
|
|
104
103
|
const draggableEventHandlers = {
|
|
105
|
-
onDragStart: publish(
|
|
106
|
-
onDragEnter: publish(
|
|
107
|
-
onDragOver: publish(
|
|
108
|
-
onDragEnd: publish(
|
|
104
|
+
onDragStart: publish('columnHeaderDragStart'),
|
|
105
|
+
onDragEnter: publish('columnHeaderDragEnter'),
|
|
106
|
+
onDragOver: publish('columnHeaderDragOver'),
|
|
107
|
+
onDragEnd: publish('columnHeaderDragEnd')
|
|
109
108
|
};
|
|
110
109
|
const removeLastBorderRight = isLastColumn && hasScrollX && !hasScrollY;
|
|
111
110
|
const showRightBorder = !isLastColumn ? rootProps.showColumnRightBorder : !removeLastBorderRight && !extendRowFullWidth;
|
|
@@ -117,7 +116,7 @@ function GridColumnHeaderItem(props) {
|
|
|
117
116
|
|
|
118
117
|
const classes = useUtilityClasses(ownerState);
|
|
119
118
|
const width = column.computedWidth;
|
|
120
|
-
let ariaSort;
|
|
119
|
+
let ariaSort = 'none';
|
|
121
120
|
|
|
122
121
|
if (sortDirection != null) {
|
|
123
122
|
ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';
|
|
@@ -158,14 +157,11 @@ function GridColumnHeaderItem(props) {
|
|
|
158
157
|
|
|
159
158
|
if (hasFocus && !columnMenuState.open) {
|
|
160
159
|
const focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
} else {
|
|
165
|
-
headerCellRef.current.focus();
|
|
166
|
-
}
|
|
160
|
+
const elementToFocus = focusableElement || headerCellRef.current;
|
|
161
|
+
elementToFocus == null ? void 0 : elementToFocus.focus();
|
|
162
|
+
apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
|
|
167
163
|
}
|
|
168
|
-
});
|
|
164
|
+
}, [apiRef, hasFocus]);
|
|
169
165
|
const headerClassName = typeof column.headerClassName === 'function' ? column.headerClassName({
|
|
170
166
|
field: column.field,
|
|
171
167
|
colDef: column
|
|
@@ -203,7 +199,7 @@ function GridColumnHeaderItem(props) {
|
|
|
203
199
|
resizable: !rootProps.disableColumnResize && !!column.resizable,
|
|
204
200
|
resizing: isResizing,
|
|
205
201
|
height: headerHeight,
|
|
206
|
-
onMouseDown: publish(
|
|
202
|
+
onMouseDown: publish('columnSeparatorMouseDown'),
|
|
207
203
|
side: separatorSide
|
|
208
204
|
}), /*#__PURE__*/_jsx(GridColumnHeaderMenu, {
|
|
209
205
|
columnMenuId: columnMenuId,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
3
|
interface GridColumnHeadersProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
|
|
4
|
+
sx?: SxProps<Theme>;
|
|
4
5
|
}
|
|
5
6
|
export declare const GridColumnHeaders: React.ForwardRefExoticComponent<GridColumnHeadersProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
7
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["
|
|
3
|
+
const _excluded = ["className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
3
|
interface GridColumnHeadersInnerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
isDragging: boolean;
|
|
5
|
+
sx?: SxProps<Theme>;
|
|
4
6
|
}
|
|
5
7
|
export declare const GridColumnHeadersInner: React.ForwardRefExoticComponent<GridColumnHeadersInnerProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
8
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const GridCellCheckboxForwardRef: React.ForwardRefExoticComponent<
|
|
2
|
+
import { GridRenderCellParams } from '../../models/params/gridCellParams';
|
|
3
|
+
declare const GridCellCheckboxForwardRef: React.ForwardRefExoticComponent<GridRenderCellParams<any, any, any> & React.RefAttributes<HTMLInputElement>>;
|
|
4
4
|
export { GridCellCheckboxForwardRef };
|
|
5
|
-
export declare const GridCellCheckboxRenderer: React.MemoExoticComponent<React.ForwardRefExoticComponent<
|
|
5
|
+
export declare const GridCellCheckboxRenderer: React.MemoExoticComponent<React.ForwardRefExoticComponent<GridRenderCellParams<any, any, any> & React.RefAttributes<HTMLInputElement>>>;
|
|
@@ -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';
|
|
@@ -50,7 +49,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
50
49
|
value: event.target.checked,
|
|
51
50
|
id
|
|
52
51
|
};
|
|
53
|
-
apiRef.current.publishEvent(
|
|
52
|
+
apiRef.current.publishEvent('rowSelectionCheckboxChange', params, event);
|
|
54
53
|
};
|
|
55
54
|
|
|
56
55
|
React.useLayoutEffect(() => {
|
|
@@ -75,7 +74,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
if (isNavigationKey(event.key) && !event.shiftKey) {
|
|
78
|
-
apiRef.current.publishEvent(
|
|
77
|
+
apiRef.current.publishEvent('cellNavigationKeyDown', props, event);
|
|
79
78
|
}
|
|
80
79
|
}, [apiRef, props]);
|
|
81
80
|
const isSelectable = !rootProps.isRowSelectable || rootProps.isRowSelectable(apiRef.current.getRowParams(id));
|
|
@@ -101,6 +100,12 @@ process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
|
101
100
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
102
101
|
// ----------------------------------------------------------------------
|
|
103
102
|
|
|
103
|
+
/**
|
|
104
|
+
* GridApi that let you manipulate the grid.
|
|
105
|
+
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
106
|
+
*/
|
|
107
|
+
api: PropTypes.any.isRequired,
|
|
108
|
+
|
|
104
109
|
/**
|
|
105
110
|
* The mode of the cell.
|
|
106
111
|
*/
|
|
@@ -116,10 +121,21 @@ process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
|
116
121
|
*/
|
|
117
122
|
field: PropTypes.string.isRequired,
|
|
118
123
|
|
|
124
|
+
/**
|
|
125
|
+
* A ref allowing to set imperative focus.
|
|
126
|
+
* It can be passed to the element that should receive focus.
|
|
127
|
+
* @ignore - do not document.
|
|
128
|
+
*/
|
|
129
|
+
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
130
|
+
current: PropTypes.shape({
|
|
131
|
+
focus: PropTypes.func.isRequired
|
|
132
|
+
})
|
|
133
|
+
})]),
|
|
134
|
+
|
|
119
135
|
/**
|
|
120
136
|
* The cell value formatted with the column valueFormatter.
|
|
121
137
|
*/
|
|
122
|
-
formattedValue: PropTypes.any
|
|
138
|
+
formattedValue: PropTypes.any,
|
|
123
139
|
|
|
124
140
|
/**
|
|
125
141
|
* Get the cell value of a row and field.
|
|
@@ -163,7 +179,7 @@ process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
|
163
179
|
/**
|
|
164
180
|
* The cell value, but if the column has valueGetter, use getValue.
|
|
165
181
|
*/
|
|
166
|
-
value: PropTypes.any
|
|
182
|
+
value: PropTypes.any
|
|
167
183
|
} : void 0;
|
|
168
184
|
export { GridCellCheckboxForwardRef };
|
|
169
185
|
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';
|
|
@@ -75,7 +74,7 @@ const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderChec
|
|
|
75
74
|
const params = {
|
|
76
75
|
value: event.target.checked
|
|
77
76
|
};
|
|
78
|
-
apiRef.current.publishEvent(
|
|
77
|
+
apiRef.current.publishEvent('headerSelectionCheckboxChange', params);
|
|
79
78
|
};
|
|
80
79
|
|
|
81
80
|
const tabIndex = tabIndexState !== null && tabIndexState.field === props.field ? 0 : -1;
|
|
@@ -89,21 +88,21 @@ const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderChec
|
|
|
89
88
|
const handleKeyDown = React.useCallback(event => {
|
|
90
89
|
if (event.key === ' ') {
|
|
91
90
|
// imperative toggle the checkbox because Space is disable by some preventDefault
|
|
92
|
-
apiRef.current.publishEvent(
|
|
91
|
+
apiRef.current.publishEvent('headerSelectionCheckboxChange', {
|
|
93
92
|
value: !isChecked
|
|
94
93
|
});
|
|
95
94
|
} // TODO v6 remove columnHeaderNavigationKeyDown events which are not used internally anymore
|
|
96
95
|
|
|
97
96
|
|
|
98
97
|
if (isNavigationKey(event.key) && !event.shiftKey) {
|
|
99
|
-
apiRef.current.publishEvent(
|
|
98
|
+
apiRef.current.publishEvent('columnHeaderNavigationKeyDown', props, event);
|
|
100
99
|
}
|
|
101
100
|
}, [apiRef, props, isChecked]);
|
|
102
101
|
const handleSelectionChange = React.useCallback(() => {
|
|
103
102
|
forceUpdate(p => !p);
|
|
104
103
|
}, []);
|
|
105
104
|
React.useEffect(() => {
|
|
106
|
-
return apiRef.current.subscribeEvent(
|
|
105
|
+
return apiRef.current.subscribeEvent('selectionChange', handleSelectionChange);
|
|
107
106
|
}, [apiRef, handleSelectionChange]);
|
|
108
107
|
const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectAllRows' : 'checkboxSelectionSelectAllRows');
|
|
109
108
|
return /*#__PURE__*/_jsx(rootProps.components.BaseCheckbox, _extends({
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
export declare
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
export declare type GridFooterContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
sx?: SxProps<Theme>;
|
|
5
|
+
};
|
|
6
|
+
declare const GridFooterContainer: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
sx?: SxProps<Theme> | undefined;
|
|
8
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export { GridFooterContainer };
|
|
@@ -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',
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
export declare
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
export declare type GridToolbarContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
sx?: SxProps<Theme>;
|
|
5
|
+
};
|
|
6
|
+
declare const GridToolbarContainer: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
sx?: SxProps<Theme> | undefined;
|
|
8
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export { GridToolbarContainer };
|
|
@@ -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 };
|
|
@@ -95,6 +95,7 @@ const GridMenu = props => {
|
|
|
95
95
|
placement
|
|
96
96
|
}) => /*#__PURE__*/_jsx(ClickAwayListener, {
|
|
97
97
|
onClickAway: onClickAway,
|
|
98
|
+
mouseEvent: "onMouseDown",
|
|
98
99
|
children: /*#__PURE__*/_jsx(Grow, _extends({}, TransitionProps, {
|
|
99
100
|
style: {
|
|
100
101
|
transformOrigin: transformOrigin[placement]
|
|
@@ -82,6 +82,7 @@ const GridPanel = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
82
82
|
modifiers: modifiers
|
|
83
83
|
}, other, {
|
|
84
84
|
children: /*#__PURE__*/_jsx(ClickAwayListener, {
|
|
85
|
+
mouseEvent: "onMouseUp",
|
|
85
86
|
onClickAway: handleClickAway,
|
|
86
87
|
children: /*#__PURE__*/_jsx(GridPaperRoot, {
|
|
87
88
|
className: classes.paper,
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
declare function GridPanelContent(props: React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
sx?: SxProps<Theme>;
|
|
5
|
+
}): JSX.Element;
|
|
6
|
+
declare namespace GridPanelContent {
|
|
7
|
+
var propTypes: any;
|
|
8
|
+
}
|
|
9
|
+
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 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 };
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
declare function GridPanelFooter(props: React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
sx?: SxProps<Theme>;
|
|
5
|
+
}): JSX.Element;
|
|
6
|
+
declare namespace GridPanelFooter {
|
|
7
|
+
var propTypes: any;
|
|
8
|
+
}
|
|
9
|
+
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';
|
|
@@ -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 };
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
declare function GridPanelHeader(props: React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
sx?: SxProps<Theme>;
|
|
5
|
+
}): JSX.Element;
|
|
6
|
+
declare namespace GridPanelHeader {
|
|
7
|
+
var propTypes: any;
|
|
8
|
+
}
|
|
9
|
+
export { GridPanelHeader };
|
|
@@ -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';
|
|
@@ -103,7 +104,7 @@ const getColumnLabel = col => col.headerName || col.field;
|
|
|
103
104
|
const collator = new Intl.Collator();
|
|
104
105
|
|
|
105
106
|
function GridFilterForm(props) {
|
|
106
|
-
var _rootProps$components, _rootProps$components2, _rootProps$components3, _rootProps$components4, _currentColumn$filter2;
|
|
107
|
+
var _rootProps$components, _rootProps$components2, _baseSelectProps$nati, _rootProps$components3, _rootProps$components4, _rootProps$components5, _currentColumn$filter2;
|
|
107
108
|
|
|
108
109
|
const {
|
|
109
110
|
item,
|
|
@@ -138,6 +139,9 @@ function GridFilterForm(props) {
|
|
|
138
139
|
const filterSelectorRef = React.useRef(null);
|
|
139
140
|
const hasLinkOperatorColumn = hasMultipleFilters && linkOperators.length > 0;
|
|
140
141
|
const baseFormControlProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseFormControl) || {};
|
|
142
|
+
const baseSelectProps = ((_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect) || {};
|
|
143
|
+
const isBaseSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
|
|
144
|
+
const OptionComponent = isBaseSelectNative ? 'option' : MenuItem;
|
|
141
145
|
const sortedFilterableColumns = React.useMemo(() => {
|
|
142
146
|
switch (columnsSort) {
|
|
143
147
|
case 'asc':
|
|
@@ -251,9 +255,9 @@ function GridFilterForm(props) {
|
|
|
251
255
|
value: multiFilterOperator,
|
|
252
256
|
onChange: changeLinkOperator,
|
|
253
257
|
disabled: !!disableMultiFilterOperator || linkOperators.length === 1,
|
|
254
|
-
native:
|
|
255
|
-
}, (_rootProps$
|
|
256
|
-
children: linkOperators.map(linkOperator => /*#__PURE__*/_jsx(
|
|
258
|
+
native: isBaseSelectNative
|
|
259
|
+
}, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.baseSelect, {
|
|
260
|
+
children: linkOperators.map(linkOperator => /*#__PURE__*/_jsx(OptionComponent, {
|
|
257
261
|
value: linkOperator.toString(),
|
|
258
262
|
children: apiRef.current.getLocaleText(getLinkOperatorLocaleKey(linkOperator))
|
|
259
263
|
}, linkOperator.toString()))
|
|
@@ -273,9 +277,9 @@ function GridFilterForm(props) {
|
|
|
273
277
|
label: apiRef.current.getLocaleText('filterPanelColumns'),
|
|
274
278
|
value: item.columnField || '',
|
|
275
279
|
onChange: changeColumn,
|
|
276
|
-
native:
|
|
277
|
-
}, (_rootProps$
|
|
278
|
-
children: sortedFilterableColumns.map(col => /*#__PURE__*/_jsx(
|
|
280
|
+
native: isBaseSelectNative
|
|
281
|
+
}, (_rootProps$components4 = rootProps.componentsProps) == null ? void 0 : _rootProps$components4.baseSelect, {
|
|
282
|
+
children: sortedFilterableColumns.map(col => /*#__PURE__*/_jsx(OptionComponent, {
|
|
279
283
|
value: col.field,
|
|
280
284
|
children: getColumnLabel(col)
|
|
281
285
|
}, col.field))
|
|
@@ -295,10 +299,10 @@ function GridFilterForm(props) {
|
|
|
295
299
|
id: operatorSelectId,
|
|
296
300
|
value: item.operatorValue,
|
|
297
301
|
onChange: changeOperator,
|
|
298
|
-
native:
|
|
302
|
+
native: isBaseSelectNative,
|
|
299
303
|
inputRef: filterSelectorRef
|
|
300
|
-
}, (_rootProps$
|
|
301
|
-
children: currentColumn == null ? void 0 : (_currentColumn$filter2 = currentColumn.filterOperators) == null ? void 0 : _currentColumn$filter2.map(operator => /*#__PURE__*/_jsx(
|
|
304
|
+
}, (_rootProps$components5 = rootProps.componentsProps) == null ? void 0 : _rootProps$components5.baseSelect, {
|
|
305
|
+
children: currentColumn == null ? void 0 : (_currentColumn$filter2 = currentColumn.filterOperators) == null ? void 0 : _currentColumn$filter2.map(operator => /*#__PURE__*/_jsx(OptionComponent, {
|
|
302
306
|
value: operator.value,
|
|
303
307
|
children: operator.label || apiRef.current.getLocaleText(`filterOperator${capitalize(operator.value)}`)
|
|
304
308
|
}, operator.value))
|