@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
|
@@ -9,7 +9,7 @@ import { Logger } from '../logger';
|
|
|
9
9
|
import { GridSortDirection, GridSortModel } from '../gridSortModel';
|
|
10
10
|
import { GridSlotsComponent } from '../gridSlotsComponent';
|
|
11
11
|
import { GridRowIdGetter, GridRowsProp, GridValidRowModel } from '../gridRows';
|
|
12
|
-
import { GridEventListener
|
|
12
|
+
import { GridEventListener } from '../events';
|
|
13
13
|
import { GridCallbackDetails, GridLocaleText } from '../api';
|
|
14
14
|
import { GridApiCommunity } from '../api/gridApiCommunity';
|
|
15
15
|
import type { GridColumnTypesRecord } from '../colDef';
|
|
@@ -22,6 +22,7 @@ import { GridInputSelectionModel, GridSelectionModel } from '../gridSelectionMod
|
|
|
22
22
|
import { GridInitialStateCommunity } from '../gridStateCommunity';
|
|
23
23
|
import { GridSlotsComponentsProps } from '../gridSlotsComponentsProps';
|
|
24
24
|
import { GridColumnVisibilityModel } from '../../hooks/features/columns/gridColumnsInterfaces';
|
|
25
|
+
import { GridCellModesModel, GridRowModesModel } from '../api/gridEditingApi';
|
|
25
26
|
export interface GridExperimentalFeatures {
|
|
26
27
|
/**
|
|
27
28
|
* Will be part of the premium-plan when fully ready.
|
|
@@ -158,7 +159,7 @@ export interface DataGridPropsWithDefaultValues {
|
|
|
158
159
|
*/
|
|
159
160
|
disableMultipleColumnsFiltering: boolean;
|
|
160
161
|
/**
|
|
161
|
-
* If `true`, multiple selection using the
|
|
162
|
+
* If `true`, multiple selection using the Ctrl or CMD key is disabled.
|
|
162
163
|
* @default false
|
|
163
164
|
*/
|
|
164
165
|
disableMultipleSelection: boolean;
|
|
@@ -214,6 +215,13 @@ export interface DataGridPropsWithDefaultValues {
|
|
|
214
215
|
* @default false
|
|
215
216
|
*/
|
|
216
217
|
hideFooterSelectedRowCount: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* If `true`, the selection model will retain selected rows that do not exist.
|
|
220
|
+
* Useful when using server side pagination and row selections need to be retained
|
|
221
|
+
* when changing pages.
|
|
222
|
+
* @default false
|
|
223
|
+
*/
|
|
224
|
+
keepNonExistentRowsSelected: boolean;
|
|
217
225
|
/**
|
|
218
226
|
* Pass a custom logger in the components that implements the [[Logger]] interface.
|
|
219
227
|
* @default console
|
|
@@ -370,130 +378,130 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
370
378
|
* @param {GridEditCellPropsParams} params With all properties from [[GridEditCellPropsParams]].
|
|
371
379
|
* @param {MuiEvent<React.SyntheticEvent>} event The event that caused this prop to be called.
|
|
372
380
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
373
|
-
* @deprecated use `preProcessEditCellProps` from the [`GridColDef`](/api/data-grid/grid-col-def/)
|
|
381
|
+
* @deprecated use `preProcessEditCellProps` from the [`GridColDef`](/x/api/data-grid/grid-col-def/)
|
|
374
382
|
*/
|
|
375
|
-
onEditCellPropsChange?: GridEventListener<
|
|
383
|
+
onEditCellPropsChange?: GridEventListener<'editCellPropsChange'>;
|
|
376
384
|
/**
|
|
377
385
|
* Callback fired when the cell changes are committed.
|
|
378
386
|
* @param {GridCellEditCommitParams} params With all properties from [[GridCellEditCommitParams]].
|
|
379
387
|
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
380
388
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
381
389
|
*/
|
|
382
|
-
onCellEditCommit?: GridEventListener<
|
|
390
|
+
onCellEditCommit?: GridEventListener<'cellEditCommit'>;
|
|
383
391
|
/**
|
|
384
392
|
* Callback fired when the cell turns to edit mode.
|
|
385
393
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
386
394
|
* @param {MuiEvent<React.KeyboardEvent | React.MouseEvent>} event The event that caused this prop to be called.
|
|
387
395
|
*/
|
|
388
|
-
onCellEditStart?: GridEventListener<
|
|
396
|
+
onCellEditStart?: GridEventListener<'cellEditStart'>;
|
|
389
397
|
/**
|
|
390
398
|
* Callback fired when the cell turns to view mode.
|
|
391
399
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
392
400
|
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
393
401
|
*/
|
|
394
|
-
onCellEditStop?: GridEventListener<
|
|
402
|
+
onCellEditStop?: GridEventListener<'cellEditStop'>;
|
|
395
403
|
/**
|
|
396
404
|
* Callback fired when the row changes are committed.
|
|
397
405
|
* @param {GridRowId} id The row id.
|
|
398
406
|
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
399
407
|
*/
|
|
400
|
-
onRowEditCommit?: GridEventListener<
|
|
408
|
+
onRowEditCommit?: GridEventListener<'rowEditCommit'>;
|
|
401
409
|
/**
|
|
402
410
|
* Callback fired when the row turns to edit mode.
|
|
403
411
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
404
412
|
* @param {MuiEvent<React.KeyboardEvent | React.MouseEvent>} event The event that caused this prop to be called.
|
|
405
413
|
*/
|
|
406
|
-
onRowEditStart?: GridEventListener<
|
|
414
|
+
onRowEditStart?: GridEventListener<'rowEditStart'>;
|
|
407
415
|
/**
|
|
408
416
|
* Callback fired when the row turns to view mode.
|
|
409
417
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
410
418
|
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
411
419
|
*/
|
|
412
|
-
onRowEditStop?: GridEventListener<
|
|
420
|
+
onRowEditStop?: GridEventListener<'rowEditStop'>;
|
|
413
421
|
/**
|
|
414
422
|
* Callback fired when an exception is thrown in the grid.
|
|
415
423
|
* @param {any} args The arguments passed to the `showError` call.
|
|
416
424
|
* @param {MuiEvent<{}>} event The event object.
|
|
417
425
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
418
426
|
*/
|
|
419
|
-
onError?: GridEventListener<
|
|
427
|
+
onError?: GridEventListener<'componentError'>;
|
|
420
428
|
/**
|
|
421
429
|
* Callback fired when any cell is clicked.
|
|
422
430
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
423
431
|
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
424
432
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
425
433
|
*/
|
|
426
|
-
onCellClick?: GridEventListener<
|
|
434
|
+
onCellClick?: GridEventListener<'cellClick'>;
|
|
427
435
|
/**
|
|
428
436
|
* Callback fired when a double click event comes from a cell element.
|
|
429
437
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
430
438
|
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
431
439
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
432
440
|
*/
|
|
433
|
-
onCellDoubleClick?: GridEventListener<
|
|
441
|
+
onCellDoubleClick?: GridEventListener<'cellDoubleClick'>;
|
|
434
442
|
/**
|
|
435
443
|
* Callback fired when a cell loses focus.
|
|
436
444
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
437
445
|
* @param {MuiEvent<MuiBaseEvent>} event The event object.
|
|
438
446
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
439
447
|
*/
|
|
440
|
-
onCellFocusOut?: GridEventListener<
|
|
448
|
+
onCellFocusOut?: GridEventListener<'cellFocusOut'>;
|
|
441
449
|
/**
|
|
442
450
|
* Callback fired when a keydown event comes from a cell element.
|
|
443
451
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
444
452
|
* @param {MuiEvent<React.KeyboardEvent>} event The event object.
|
|
445
453
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
446
454
|
*/
|
|
447
|
-
onCellKeyDown?: GridEventListener<
|
|
455
|
+
onCellKeyDown?: GridEventListener<'cellKeyDown'>;
|
|
448
456
|
/**
|
|
449
457
|
* Callback fired when a click event comes from a column header element.
|
|
450
458
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
451
459
|
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
452
460
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
453
461
|
*/
|
|
454
|
-
onColumnHeaderClick?: GridEventListener<
|
|
462
|
+
onColumnHeaderClick?: GridEventListener<'columnHeaderClick'>;
|
|
455
463
|
/**
|
|
456
464
|
* Callback fired when a double click event comes from a column header element.
|
|
457
465
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
458
466
|
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
459
467
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
460
468
|
*/
|
|
461
|
-
onColumnHeaderDoubleClick?: GridEventListener<
|
|
469
|
+
onColumnHeaderDoubleClick?: GridEventListener<'columnHeaderDoubleClick'>;
|
|
462
470
|
/**
|
|
463
471
|
* Callback fired when a mouseover event comes from a column header element.
|
|
464
472
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
465
473
|
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
466
474
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
467
475
|
*/
|
|
468
|
-
onColumnHeaderOver?: GridEventListener<
|
|
476
|
+
onColumnHeaderOver?: GridEventListener<'columnHeaderOver'>;
|
|
469
477
|
/**
|
|
470
478
|
* Callback fired when a mouseout event comes from a column header element.
|
|
471
479
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
472
480
|
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
473
481
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
474
482
|
*/
|
|
475
|
-
onColumnHeaderOut?: GridEventListener<
|
|
483
|
+
onColumnHeaderOut?: GridEventListener<'columnHeaderOut'>;
|
|
476
484
|
/**
|
|
477
485
|
* Callback fired when a mouse enter event comes from a column header element.
|
|
478
486
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
479
487
|
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
480
488
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
481
489
|
*/
|
|
482
|
-
onColumnHeaderEnter?: GridEventListener<
|
|
490
|
+
onColumnHeaderEnter?: GridEventListener<'columnHeaderEnter'>;
|
|
483
491
|
/**
|
|
484
492
|
* Callback fired when a mouse leave event comes from a column header element.
|
|
485
493
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
486
494
|
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
487
495
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
488
496
|
*/
|
|
489
|
-
onColumnHeaderLeave?: GridEventListener<
|
|
497
|
+
onColumnHeaderLeave?: GridEventListener<'columnHeaderLeave'>;
|
|
490
498
|
/**
|
|
491
499
|
* Callback fired when a column is reordered.
|
|
492
500
|
* @param {GridColumnOrderChangeParams} params With all properties from [[GridColumnOrderChangeParams]].
|
|
493
501
|
* @param {MuiEvent<{}>} event The event object.
|
|
494
502
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
495
503
|
*/
|
|
496
|
-
onColumnOrderChange?: GridEventListener<
|
|
504
|
+
onColumnOrderChange?: GridEventListener<'columnOrderChange'>;
|
|
497
505
|
/**
|
|
498
506
|
* Callback fired when a column visibility changes.
|
|
499
507
|
* Only works when no `columnVisibilityModel` is provided and if we change the visibility of a single column at a time.
|
|
@@ -502,7 +510,7 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
502
510
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
503
511
|
* @deprecated Use `onColumnVisibilityModelChange` instead.
|
|
504
512
|
*/
|
|
505
|
-
onColumnVisibilityChange?: GridEventListener<
|
|
513
|
+
onColumnVisibilityChange?: GridEventListener<'columnVisibilityChange'>;
|
|
506
514
|
/**
|
|
507
515
|
* Callback fired when a row is clicked.
|
|
508
516
|
* Not called if the target clicked is an interactive element added by the built-in columns.
|
|
@@ -510,21 +518,21 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
510
518
|
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
511
519
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
512
520
|
*/
|
|
513
|
-
onRowClick?: GridEventListener<
|
|
521
|
+
onRowClick?: GridEventListener<'rowClick'>;
|
|
514
522
|
/**
|
|
515
523
|
* Callback fired when a double click event comes from a row container element.
|
|
516
524
|
* @param {GridRowParams} params With all properties from [[RowParams]].
|
|
517
525
|
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
518
526
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
519
527
|
*/
|
|
520
|
-
onRowDoubleClick?: GridEventListener<
|
|
528
|
+
onRowDoubleClick?: GridEventListener<'rowDoubleClick'>;
|
|
521
529
|
/**
|
|
522
530
|
* Callback fired when the grid is resized.
|
|
523
531
|
* @param {ElementSize} containerSize With all properties from [[ElementSize]].
|
|
524
532
|
* @param {MuiEvent<{}>} event The event object.
|
|
525
533
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
526
534
|
*/
|
|
527
|
-
onResize?: GridEventListener<
|
|
535
|
+
onResize?: GridEventListener<'debouncedResize'>;
|
|
528
536
|
/**
|
|
529
537
|
* Callback fired when the state of the grid is updated.
|
|
530
538
|
* @param {GridState} state The new state.
|
|
@@ -532,7 +540,7 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
532
540
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
533
541
|
* @internal
|
|
534
542
|
*/
|
|
535
|
-
onStateChange?: GridEventListener<
|
|
543
|
+
onStateChange?: GridEventListener<'stateChange'>;
|
|
536
544
|
/**
|
|
537
545
|
* The zero-based index of the current page.
|
|
538
546
|
* @default 0
|
|
@@ -562,14 +570,14 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
562
570
|
* @param {MuiEvent<{}>} event The event object.
|
|
563
571
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
564
572
|
*/
|
|
565
|
-
onPreferencePanelClose?: GridEventListener<
|
|
573
|
+
onPreferencePanelClose?: GridEventListener<'preferencePanelClose'>;
|
|
566
574
|
/**
|
|
567
575
|
* Callback fired when the preferences panel is opened.
|
|
568
576
|
* @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
|
|
569
577
|
* @param {MuiEvent<{}>} event The event object.
|
|
570
578
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
571
579
|
*/
|
|
572
|
-
onPreferencePanelOpen?: GridEventListener<
|
|
580
|
+
onPreferencePanelOpen?: GridEventListener<'preferencePanelOpen'>;
|
|
573
581
|
/**
|
|
574
582
|
* Set the edit rows model of the grid.
|
|
575
583
|
*/
|
|
@@ -580,6 +588,26 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
580
588
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
581
589
|
*/
|
|
582
590
|
onEditRowsModelChange?: (editRowsModel: GridEditRowsModel, details: GridCallbackDetails) => void;
|
|
591
|
+
/**
|
|
592
|
+
* Controls the modes of the cells.
|
|
593
|
+
*/
|
|
594
|
+
cellModesModel?: GridCellModesModel;
|
|
595
|
+
/**
|
|
596
|
+
* Callback fired when the `cellModesModel` prop changes.
|
|
597
|
+
* @param {GridCellModesModel} cellModesModel Object containig which cells are in "edit" mode.
|
|
598
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
599
|
+
*/
|
|
600
|
+
onCellModesModelChange?: (cellModesModel: GridCellModesModel, details: GridCallbackDetails) => void;
|
|
601
|
+
/**
|
|
602
|
+
* Controls the modes of the rows.
|
|
603
|
+
*/
|
|
604
|
+
rowModesModel?: GridRowModesModel;
|
|
605
|
+
/**
|
|
606
|
+
* Callback fired when the `rowModesModel` prop changes.
|
|
607
|
+
* @param {GridRowModesModel} rowModesModel Object containig which rows are in "edit" mode.
|
|
608
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
609
|
+
*/
|
|
610
|
+
onRowModesModelChange?: (rowModesModel: GridRowModesModel, details: GridCallbackDetails) => void;
|
|
583
611
|
/**
|
|
584
612
|
* Set the filter model of the grid.
|
|
585
613
|
*/
|
|
@@ -58,6 +58,11 @@ DataGridRaw.propTypes = {
|
|
|
58
58
|
*/
|
|
59
59
|
autoPageSize: PropTypes.bool,
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Controls the modes of the cells.
|
|
63
|
+
*/
|
|
64
|
+
cellModesModel: PropTypes.object,
|
|
65
|
+
|
|
61
66
|
/**
|
|
62
67
|
* If `true`, the grid get a first column with a checkbox that allows to select rows.
|
|
63
68
|
* @default false
|
|
@@ -205,7 +210,9 @@ DataGridRaw.propTypes = {
|
|
|
205
210
|
operatorValue: PropTypes.string,
|
|
206
211
|
value: PropTypes.any
|
|
207
212
|
})).isRequired,
|
|
208
|
-
linkOperator: PropTypes.oneOf(['and', 'or'])
|
|
213
|
+
linkOperator: PropTypes.oneOf(['and', 'or']),
|
|
214
|
+
quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
|
|
215
|
+
quickFilterValues: PropTypes.array
|
|
209
216
|
}),
|
|
210
217
|
|
|
211
218
|
/**
|
|
@@ -293,6 +300,14 @@ DataGridRaw.propTypes = {
|
|
|
293
300
|
*/
|
|
294
301
|
isRowSelectable: PropTypes.func,
|
|
295
302
|
|
|
303
|
+
/**
|
|
304
|
+
* If `true`, the selection model will retain selected rows that do not exist.
|
|
305
|
+
* Useful when using server side pagination and row selections need to be retained
|
|
306
|
+
* when changing pages.
|
|
307
|
+
* @default false
|
|
308
|
+
*/
|
|
309
|
+
keepNonExistentRowsSelected: PropTypes.bool,
|
|
310
|
+
|
|
296
311
|
/**
|
|
297
312
|
* If `true`, a loading overlay is displayed.
|
|
298
313
|
*/
|
|
@@ -380,6 +395,13 @@ DataGridRaw.propTypes = {
|
|
|
380
395
|
*/
|
|
381
396
|
onCellKeyDown: PropTypes.func,
|
|
382
397
|
|
|
398
|
+
/**
|
|
399
|
+
* Callback fired when the `cellModesModel` prop changes.
|
|
400
|
+
* @param {GridCellModesModel} cellModesModel Object containig which cells are in "edit" mode.
|
|
401
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
402
|
+
*/
|
|
403
|
+
onCellModesModelChange: PropTypes.func,
|
|
404
|
+
|
|
383
405
|
/**
|
|
384
406
|
* Callback fired when a click event comes from a column header element.
|
|
385
407
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
@@ -458,7 +480,7 @@ DataGridRaw.propTypes = {
|
|
|
458
480
|
* @param {GridEditCellPropsParams} params With all properties from [[GridEditCellPropsParams]].
|
|
459
481
|
* @param {MuiEvent<React.SyntheticEvent>} event The event that caused this prop to be called.
|
|
460
482
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
461
|
-
* @deprecated use `preProcessEditCellProps` from the [`GridColDef`](/api/data-grid/grid-col-def/)
|
|
483
|
+
* @deprecated use `preProcessEditCellProps` from the [`GridColDef`](/x/api/data-grid/grid-col-def/)
|
|
462
484
|
*/
|
|
463
485
|
onEditCellPropsChange: PropTypes.func,
|
|
464
486
|
|
|
@@ -566,6 +588,13 @@ DataGridRaw.propTypes = {
|
|
|
566
588
|
*/
|
|
567
589
|
onRowEditStop: PropTypes.func,
|
|
568
590
|
|
|
591
|
+
/**
|
|
592
|
+
* Callback fired when the `rowModesModel` prop changes.
|
|
593
|
+
* @param {GridRowModesModel} rowModesModel Object containig which rows are in "edit" mode.
|
|
594
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
595
|
+
*/
|
|
596
|
+
onRowModesModelChange: PropTypes.func,
|
|
597
|
+
|
|
569
598
|
/**
|
|
570
599
|
* Callback fired when the selection state of one or multiple rows changes.
|
|
571
600
|
* @param {GridSelectionModel} selectionModel With all the row ids [[GridSelectionModel]].
|
|
@@ -651,6 +680,11 @@ DataGridRaw.propTypes = {
|
|
|
651
680
|
*/
|
|
652
681
|
rowHeight: PropTypes.number,
|
|
653
682
|
|
|
683
|
+
/**
|
|
684
|
+
* Controls the modes of the rows.
|
|
685
|
+
*/
|
|
686
|
+
rowModesModel: PropTypes.object,
|
|
687
|
+
|
|
654
688
|
/**
|
|
655
689
|
* Set of rows of type [[GridRowsProp]].
|
|
656
690
|
*/
|
|
@@ -24,6 +24,7 @@ import { useGridEvents } from '../hooks/features/events/useGridEvents';
|
|
|
24
24
|
import { useGridDimensions } from '../hooks/features/dimensions/useGridDimensions';
|
|
25
25
|
import { rowsMetaStateInitializer, useGridRowsMeta } from '../hooks/features/rows/useGridRowsMeta';
|
|
26
26
|
import { useGridStatePersistence } from '../hooks/features/statePersistence/useGridStatePersistence';
|
|
27
|
+
import { useGridColumnSpanning } from '../hooks/features/columns/useGridColumnSpanning';
|
|
27
28
|
export const useDataGridComponent = props => {
|
|
28
29
|
const apiRef = useGridInitialization(undefined, props);
|
|
29
30
|
/**
|
|
@@ -53,12 +54,13 @@ export const useDataGridComponent = props => {
|
|
|
53
54
|
useGridColumns(apiRef, props);
|
|
54
55
|
useGridRows(apiRef, props);
|
|
55
56
|
useGridParamsApi(apiRef);
|
|
57
|
+
useGridColumnSpanning(apiRef);
|
|
56
58
|
const useGridEditing = props.experimentalFeatures?.newEditingApi ? useGridEditing_new : useGridEditing_old;
|
|
57
59
|
useGridEditing(apiRef, props);
|
|
58
60
|
useGridFocus(apiRef, props);
|
|
59
|
-
useGridSorting(apiRef, props);
|
|
60
61
|
useGridPreferencesPanel(apiRef);
|
|
61
62
|
useGridFilter(apiRef, props);
|
|
63
|
+
useGridSorting(apiRef, props);
|
|
62
64
|
useGridDensity(apiRef, props);
|
|
63
65
|
useGridPagination(apiRef, props);
|
|
64
66
|
useGridRowsMeta(apiRef, props);
|
|
@@ -61,7 +61,8 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
61
61
|
sortingMode: GridFeatureModeConstant.client,
|
|
62
62
|
throttleRowsMs: 0,
|
|
63
63
|
disableColumnReorder: false,
|
|
64
|
-
disableColumnResize: false
|
|
64
|
+
disableColumnResize: false,
|
|
65
|
+
keepNonExistentRowsSelected: false
|
|
65
66
|
};
|
|
66
67
|
export const useDataGridProps = inProps => {
|
|
67
68
|
if (inProps.pageSize > MAX_PAGE_SIZE) {
|
|
@@ -20,5 +20,6 @@ export const GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
20
20
|
renderEditCell: renderEditBooleanCell,
|
|
21
21
|
sortComparator: gridNumberComparator,
|
|
22
22
|
valueFormatter: gridBooleanFormatter,
|
|
23
|
-
filterOperators: getGridBooleanOperators()
|
|
23
|
+
filterOperators: getGridBooleanOperators(),
|
|
24
|
+
getApplyQuickFilterFn: undefined
|
|
24
25
|
});
|
|
@@ -15,6 +15,7 @@ export const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF
|
|
|
15
15
|
disableColumnMenu: true,
|
|
16
16
|
disableReorder: true,
|
|
17
17
|
disableExport: true,
|
|
18
|
+
getApplyQuickFilterFn: undefined,
|
|
18
19
|
valueGetter: params => {
|
|
19
20
|
const selectionLookup = selectedIdsLookupSelector(params.api.state, params.api.instanceId);
|
|
20
21
|
return selectionLookup[params.id] !== undefined;
|
|
@@ -26,12 +26,14 @@ export const GRID_DATE_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
26
26
|
sortComparator: gridDateComparator,
|
|
27
27
|
valueFormatter: gridDateFormatter,
|
|
28
28
|
filterOperators: getGridDateOperators(),
|
|
29
|
-
renderEditCell: renderEditDateCell
|
|
29
|
+
renderEditCell: renderEditDateCell,
|
|
30
|
+
getApplyQuickFilterFn: undefined
|
|
30
31
|
});
|
|
31
32
|
export const GRID_DATETIME_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
32
33
|
type: 'dateTime',
|
|
33
34
|
sortComparator: gridDateComparator,
|
|
34
35
|
valueFormatter: gridDateTimeFormatter,
|
|
35
36
|
filterOperators: getGridDateOperators(true),
|
|
36
|
-
renderEditCell: renderEditDateCell
|
|
37
|
+
renderEditCell: renderEditDateCell,
|
|
38
|
+
getApplyQuickFilterFn: undefined
|
|
37
39
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { gridNumberComparator } from '../hooks/features/sorting/gridSortingUtils';
|
|
3
3
|
import { isNumber } from '../utils/utils';
|
|
4
|
-
import { getGridNumericOperators } from './gridNumericOperators';
|
|
4
|
+
import { getGridNumericOperators, getGridNumericQuickFilterFn } from './gridNumericOperators';
|
|
5
5
|
import { GRID_STRING_COL_DEF } from './gridStringColDef';
|
|
6
6
|
export const GRID_NUMERIC_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
7
7
|
type: 'number',
|
|
@@ -12,5 +12,6 @@ export const GRID_NUMERIC_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
12
12
|
valueFormatter: ({
|
|
13
13
|
value
|
|
14
14
|
}) => value && isNumber(value) && value.toLocaleString() || value,
|
|
15
|
-
filterOperators: getGridNumericOperators()
|
|
15
|
+
filterOperators: getGridNumericOperators(),
|
|
16
|
+
getApplyQuickFilterFn: getGridNumericQuickFilterFn
|
|
16
17
|
});
|
|
@@ -10,6 +10,17 @@ const parseNumericValue = value => {
|
|
|
10
10
|
return Number(value);
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
export const getGridNumericQuickFilterFn = value => {
|
|
14
|
+
if (value == null || Number.isNaN(value) || value === '') {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return ({
|
|
19
|
+
value: columnValue
|
|
20
|
+
}) => {
|
|
21
|
+
return parseNumericValue(columnValue) === parseNumericValue(value);
|
|
22
|
+
};
|
|
23
|
+
};
|
|
13
24
|
export const getGridNumericOperators = () => [{
|
|
14
25
|
label: '=',
|
|
15
26
|
value: '=',
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { GRID_STRING_COL_DEF } from './gridStringColDef';
|
|
3
3
|
import { renderEditSingleSelectCell } from '../components/cell/GridEditSingleSelectCell';
|
|
4
|
-
import { getGridSingleSelectOperators } from './gridSingleSelectOperators';
|
|
4
|
+
import { getGridSingleSelectOperators, getGridSingleSelectQuickFilterFn } from './gridSingleSelectOperators';
|
|
5
5
|
export const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
6
6
|
type: 'singleSelect',
|
|
7
7
|
renderEditCell: renderEditSingleSelectCell,
|
|
8
|
-
filterOperators: getGridSingleSelectOperators()
|
|
8
|
+
filterOperators: getGridSingleSelectOperators(),
|
|
9
|
+
getApplyQuickFilterFn: getGridSingleSelectQuickFilterFn
|
|
9
10
|
});
|
|
@@ -9,6 +9,58 @@ const parseObjectValue = value => {
|
|
|
9
9
|
return value.value;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
export const getGridSingleSelectQuickFilterFn = (value, column, apiRef) => {
|
|
13
|
+
if (!value) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
valueOptions,
|
|
19
|
+
valueFormatter,
|
|
20
|
+
field
|
|
21
|
+
} = column;
|
|
22
|
+
const potentialValues = [parseObjectValue(value).toString()];
|
|
23
|
+
const iterableColumnValues = typeof valueOptions === 'function' ? valueOptions({
|
|
24
|
+
field
|
|
25
|
+
}) : valueOptions || [];
|
|
26
|
+
|
|
27
|
+
if (iterableColumnValues) {
|
|
28
|
+
iterableColumnValues.forEach(option => {
|
|
29
|
+
// for each valueOption, check if the formatted value
|
|
30
|
+
let optionValue;
|
|
31
|
+
let optionLabel;
|
|
32
|
+
|
|
33
|
+
if (typeof option === 'object') {
|
|
34
|
+
optionValue = option.value;
|
|
35
|
+
optionLabel = option.label;
|
|
36
|
+
} else {
|
|
37
|
+
optionValue = option;
|
|
38
|
+
|
|
39
|
+
if (valueFormatter) {
|
|
40
|
+
optionLabel = valueFormatter({
|
|
41
|
+
value: option,
|
|
42
|
+
field,
|
|
43
|
+
api: apiRef.current
|
|
44
|
+
});
|
|
45
|
+
} else {
|
|
46
|
+
optionLabel = option;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (optionLabel.slice(0, value.length).toLowerCase() === value.toLowerCase()) {
|
|
51
|
+
if (!potentialValues.includes(optionValue)) {
|
|
52
|
+
potentialValues.push(optionValue.toString());
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return ({
|
|
59
|
+
value: columnValue
|
|
60
|
+
}) => {
|
|
61
|
+
return columnValue != null ? potentialValues.includes(parseObjectValue(columnValue).toString()) : false;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
12
64
|
export const getGridSingleSelectOperators = () => [{
|
|
13
65
|
value: 'is',
|
|
14
66
|
getApplyFilterFn: filterItem => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { renderEditInputCell } from '../components/cell/GridEditInputCell';
|
|
2
2
|
import { gridStringOrNumberComparator } from '../hooks/features/sorting/gridSortingUtils';
|
|
3
|
-
import { getGridStringOperators } from './gridStringOperators';
|
|
3
|
+
import { getGridStringOperators, getGridStringQuickFilterFn } from './gridStringOperators';
|
|
4
4
|
export const GRID_STRING_COL_DEF = {
|
|
5
5
|
width: 100,
|
|
6
6
|
minWidth: 50,
|
|
@@ -17,5 +17,6 @@ export const GRID_STRING_COL_DEF = {
|
|
|
17
17
|
type: 'string',
|
|
18
18
|
align: 'left',
|
|
19
19
|
filterOperators: getGridStringOperators(),
|
|
20
|
-
renderEditCell: renderEditInputCell
|
|
20
|
+
renderEditCell: renderEditInputCell,
|
|
21
|
+
getApplyQuickFilterFn: getGridStringQuickFilterFn
|
|
21
22
|
};
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { GridFilterInputValue } from '../components/panel/filterPanel/GridFilterInputValue';
|
|
2
2
|
import { escapeRegExp } from '../utils/utils';
|
|
3
3
|
import { GridFilterInputMultipleValue } from '../components/panel/filterPanel/GridFilterInputMultipleValue';
|
|
4
|
+
export const getGridStringQuickFilterFn = value => {
|
|
5
|
+
if (!value) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const filterRegex = new RegExp(escapeRegExp(value), 'i');
|
|
10
|
+
return ({
|
|
11
|
+
value: columnValue
|
|
12
|
+
}) => {
|
|
13
|
+
return columnValue != null ? filterRegex.test(columnValue.toString()) : false;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
4
16
|
export const getGridStringOperators = () => [{
|
|
5
17
|
value: 'contains',
|
|
6
18
|
getApplyFilterFn: filterItem => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import { useGridSelector } from '../hooks/utils/useGridSelector';
|
|
4
5
|
import { gridTopLevelRowCountSelector } from '../hooks/features/rows/gridRowsSelector';
|
|
5
6
|
import { selectedGridRowsCountSelector } from '../hooks/features/selection/gridSelectionSelector';
|
|
@@ -11,7 +12,7 @@ import { GridFooterContainer } from './containers/GridFooterContainer';
|
|
|
11
12
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
|
|
15
|
+
const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref) {
|
|
15
16
|
const apiRef = useGridApiContext();
|
|
16
17
|
const rootProps = useGridRootProps();
|
|
17
18
|
const totalTopLevelRowCount = useGridSelector(apiRef, gridTopLevelRowCountSelector);
|
|
@@ -32,4 +33,12 @@ export const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(prop
|
|
|
32
33
|
}, props, {
|
|
33
34
|
children: [selectedRowCountElement, rowCountElement, paginationElement]
|
|
34
35
|
}));
|
|
35
|
-
});
|
|
36
|
+
});
|
|
37
|
+
process.env.NODE_ENV !== "production" ? GridFooter.propTypes = {
|
|
38
|
+
// ----------------------------- Warning --------------------------------
|
|
39
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
40
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
41
|
+
// ----------------------------------------------------------------------
|
|
42
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
43
|
+
} : void 0;
|
|
44
|
+
export { GridFooter };
|