@mui/x-data-grid 5.9.0 → 5.11.1
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 +284 -10
- package/DataGrid/DataGrid.js +35 -1
- package/DataGrid/useDataGridProps.js +2 -1
- package/README.md +5 -4
- 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.js +9 -5
- 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 +2 -3
- package/components/cell/GridActionsCell.js +13 -4
- package/components/cell/GridCell.js +8 -8
- 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 +29 -5
- package/components/cell/GridEditSingleSelectCell.d.ts +12 -4
- package/components/cell/GridEditSingleSelectCell.js +28 -5
- package/components/cell/index.d.ts +2 -0
- package/components/cell/index.js +2 -0
- package/components/columnHeaders/GridColumnHeaderItem.js +15 -16
- package/components/columnHeaders/GridColumnHeaders.d.ts +2 -0
- package/components/columnHeaders/GridColumnHeadersInner.d.ts +2 -0
- package/components/columnSelection/GridCellCheckboxRenderer.js +2 -3
- 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/GridRoot.js +25 -5
- 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/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/toolbar/GridToolbar.d.ts +12 -2
- package/components/toolbar/GridToolbar.js +30 -7
- 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 +87 -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/GridVirtualScrollerContent.d.ts +4 -1
- package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +4 -1
- package/constants/defaultGridSlotsComponents.js +4 -2
- package/constants/gridClasses.d.ts +32 -0
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +8 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +11 -0
- package/hooks/core/pipeProcessing/useGridPipeProcessing.js +10 -9
- 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.js +5 -6
- package/hooks/features/columnMenu/useGridColumnMenu.js +3 -3
- package/hooks/features/columns/useGridColumnSpanning.js +1 -2
- package/hooks/features/columns/useGridColumns.d.ts +1 -1
- package/hooks/features/columns/useGridColumns.js +8 -9
- package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +8 -9
- package/hooks/features/editRows/useGridCellEditing.new.d.ts +1 -1
- package/hooks/features/editRows/useGridCellEditing.new.js +133 -32
- package/hooks/features/editRows/useGridCellEditing.old.js +20 -21
- 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 +122 -42
- 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 +20 -8
- package/hooks/features/focus/useGridFocus.d.ts +1 -1
- package/hooks/features/focus/useGridFocus.js +29 -33
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +4 -5
- 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 +1 -0
- package/hooks/features/rows/gridRowsSelector.js +1 -0
- package/hooks/features/rows/gridRowsState.d.ts +16 -11
- package/hooks/features/rows/gridRowsUtils.d.ts +14 -1
- package/hooks/features/rows/gridRowsUtils.js +79 -1
- package/hooks/features/rows/useGridRows.js +148 -128
- package/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
- package/hooks/features/scroll/useGridScroll.js +6 -1
- package/hooks/features/selection/useGridSelection.d.ts +1 -1
- package/hooks/features/selection/useGridSelection.js +13 -10
- package/hooks/features/sorting/useGridSorting.js +8 -9
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +2 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +14 -5
- 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 +4 -1
- package/internals/index.js +5 -2
- package/legacy/DataGrid/DataGrid.js +35 -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 +9 -5
- 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 +2 -3
- package/legacy/components/cell/GridActionsCell.js +13 -4
- package/legacy/components/cell/GridCell.js +8 -8
- package/legacy/components/cell/GridEditBooleanCell.js +132 -11
- package/legacy/components/cell/GridEditDateCell.js +148 -42
- package/legacy/components/cell/GridEditInputCell.js +61 -12
- package/legacy/components/cell/GridEditSingleSelectCell.js +41 -13
- package/legacy/components/cell/index.js +2 -0
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +15 -16
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +2 -3
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +4 -5
- package/legacy/components/containers/GridFooterContainer.js +11 -2
- package/legacy/components/containers/GridRoot.js +23 -5
- 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/GridPanelContent.js +13 -2
- package/legacy/components/panel/GridPanelFooter.js +13 -2
- package/legacy/components/panel/GridPanelHeader.js +13 -2
- package/legacy/components/toolbar/GridToolbar.js +31 -6
- package/legacy/components/toolbar/GridToolbarExport.js +18 -19
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +102 -0
- package/legacy/components/toolbar/index.js +3 -2
- package/legacy/constants/defaultGridSlotsComponents.js +4 -2
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/constants/localeTextConstants.js +8 -1
- package/legacy/hooks/core/pipeProcessing/useGridPipeProcessing.js +10 -10
- 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 +5 -6
- package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +3 -3
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +1 -2
- package/legacy/hooks/features/columns/useGridColumns.js +8 -9
- package/legacy/hooks/features/dimensions/useGridDimensions.js +8 -9
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +213 -83
- package/legacy/hooks/features/editRows/useGridCellEditing.old.js +20 -21
- package/legacy/hooks/features/editRows/useGridEditing.old.js +4 -5
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +126 -42
- 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 +20 -8
- package/legacy/hooks/features/focus/useGridFocus.js +31 -35
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +4 -5
- 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 +3 -0
- package/legacy/hooks/features/rows/gridRowsUtils.js +82 -1
- package/legacy/hooks/features/rows/useGridRows.js +164 -131
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
- package/legacy/hooks/features/scroll/useGridScroll.js +6 -1
- package/legacy/hooks/features/selection/useGridSelection.js +13 -10
- package/legacy/hooks/features/sorting/useGridSorting.js +8 -9
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +14 -5
- 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 +5 -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 +8 -1
- 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/events/gridEvents.js +8 -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.js +8 -1
- 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/gridCoreApi.d.ts +10 -0
- package/models/api/gridEditingApi.d.ts +23 -4
- 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 +13 -0
- package/models/events/gridEventLookup.d.ts +293 -3
- package/models/events/gridEvents.d.ts +8 -251
- package/models/events/gridEvents.js +8 -0
- 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 +10 -0
- package/models/gridStateCommunity.d.ts +0 -2
- package/models/index.d.ts +1 -1
- package/models/index.js +4 -3
- package/models/props/DataGridProps.d.ts +56 -28
- package/modern/DataGrid/DataGrid.js +35 -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 +9 -5
- 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 +2 -3
- package/modern/components/cell/GridActionsCell.js +14 -3
- package/modern/components/cell/GridCell.js +8 -8
- package/modern/components/cell/GridEditBooleanCell.js +101 -6
- package/modern/components/cell/GridEditDateCell.js +99 -5
- package/modern/components/cell/GridEditInputCell.js +29 -5
- package/modern/components/cell/GridEditSingleSelectCell.js +28 -5
- package/modern/components/cell/index.js +2 -0
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +15 -16
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -3
- package/modern/components/columnSelection/GridHeaderCheckbox.js +4 -5
- package/modern/components/containers/GridFooterContainer.js +11 -2
- package/modern/components/containers/GridRoot.js +25 -3
- 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/GridPanelContent.js +13 -2
- package/modern/components/panel/GridPanelFooter.js +13 -2
- package/modern/components/panel/GridPanelHeader.js +13 -2
- package/modern/components/toolbar/GridToolbar.js +30 -7
- package/modern/components/toolbar/GridToolbarExport.js +15 -20
- package/modern/components/toolbar/GridToolbarQuickFilter.js +85 -0
- package/modern/components/toolbar/index.js +3 -2
- package/modern/constants/defaultGridSlotsComponents.js +4 -2
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +8 -1
- package/modern/hooks/core/pipeProcessing/useGridPipeProcessing.js +10 -9
- 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 +5 -6
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +3 -3
- package/modern/hooks/features/columns/useGridColumnSpanning.js +1 -2
- package/modern/hooks/features/columns/useGridColumns.js +8 -9
- package/modern/hooks/features/dimensions/useGridDimensions.js +8 -9
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +131 -32
- package/modern/hooks/features/editRows/useGridCellEditing.old.js +20 -21
- package/modern/hooks/features/editRows/useGridEditing.old.js +4 -5
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +120 -42
- 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 +20 -8
- package/modern/hooks/features/focus/useGridFocus.js +29 -33
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +4 -5
- 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 +1 -0
- package/modern/hooks/features/rows/gridRowsUtils.js +77 -1
- package/modern/hooks/features/rows/useGridRows.js +148 -128
- package/modern/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
- package/modern/hooks/features/scroll/useGridScroll.js +6 -1
- package/modern/hooks/features/selection/useGridSelection.js +13 -10
- package/modern/hooks/features/sorting/useGridSorting.js +8 -9
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +14 -5
- 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 +5 -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 +8 -1
- 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/events/gridEvents.js +8 -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 +35 -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 +9 -6
- 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 +2 -4
- package/node/components/cell/GridActionsCell.js +13 -4
- package/node/components/cell/GridCell.js +7 -7
- package/node/components/cell/GridEditBooleanCell.js +100 -5
- package/node/components/cell/GridEditDateCell.js +98 -4
- package/node/components/cell/GridEditInputCell.js +29 -5
- package/node/components/cell/GridEditSingleSelectCell.js +28 -6
- package/node/components/cell/index.js +26 -0
- package/node/components/columnHeaders/GridColumnHeaderItem.js +15 -17
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +2 -4
- package/node/components/columnSelection/GridHeaderCheckbox.js +4 -6
- package/node/components/containers/GridFooterContainer.js +10 -1
- package/node/components/containers/GridRoot.js +24 -3
- 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/GridPanelContent.js +11 -1
- package/node/components/panel/GridPanelFooter.js +11 -1
- package/node/components/panel/GridPanelHeader.js +11 -1
- package/node/components/toolbar/GridToolbar.js +32 -7
- package/node/components/toolbar/GridToolbarExport.js +14 -19
- package/node/components/toolbar/GridToolbarQuickFilter.js +109 -0
- package/node/components/toolbar/index.js +42 -11
- package/node/constants/defaultGridSlotsComponents.js +3 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +8 -1
- package/node/hooks/core/pipeProcessing/useGridPipeProcessing.js +10 -8
- 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 +5 -7
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +3 -4
- package/node/hooks/features/columns/useGridColumnSpanning.js +1 -3
- package/node/hooks/features/columns/useGridColumns.js +8 -10
- package/node/hooks/features/dimensions/useGridDimensions.js +8 -10
- package/node/hooks/features/editRows/useGridCellEditing.new.js +133 -32
- package/node/hooks/features/editRows/useGridCellEditing.old.js +20 -22
- package/node/hooks/features/editRows/useGridEditing.old.js +4 -6
- package/node/hooks/features/editRows/useGridRowEditing.new.js +122 -43
- 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 +21 -9
- package/node/hooks/features/focus/useGridFocus.js +29 -34
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +4 -6
- 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 +3 -1
- package/node/hooks/features/rows/gridRowsUtils.js +95 -1
- package/node/hooks/features/rows/useGridRows.js +150 -126
- package/node/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
- package/node/hooks/features/scroll/useGridScroll.js +6 -1
- package/node/hooks/features/selection/useGridSelection.js +13 -11
- package/node/hooks/features/sorting/useGridSorting.js +8 -10
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +14 -6
- 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 +39 -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 +8 -1
- 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/events/gridEvents.js +8 -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 +3 -2
- package/utils/createSelector.d.ts +2 -1
- package/utils/createSelector.js +20 -2
- package/utils/exportAs.d.ts +2 -2
- package/utils/exportAs.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,280 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## v5.11.1
|
|
7
|
+
|
|
8
|
+
_May 20, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Support localization on the date and time picker components (#4517) @alexfauquette
|
|
13
|
+
|
|
14
|
+
Texts can be translated in the pickers components, similar to what can be done in the data grid component. Check the [documentation](https://mui.com/x/react-date-pickers/localization/) for more information.
|
|
15
|
+
|
|
16
|
+
- 📃 Add support for column spanning when exporting to Excel (#4830) @cherniavskii
|
|
17
|
+
|
|
18
|
+
<img src="https://user-images.githubusercontent.com/13808724/167691417-bf6baeb9-d409-4134-acb6-aadaf6434de9.png" width="800">
|
|
19
|
+
|
|
20
|
+
- 🐞 Bugs fixes
|
|
21
|
+
|
|
22
|
+
### `@mui/x-data-grid@v5.11.1` / `@mui/x-data-grid-pro@v5.11.1` / `@mui/x-data-grid-premium@v5.11.1`
|
|
23
|
+
|
|
24
|
+
#### Changes
|
|
25
|
+
|
|
26
|
+
- [DataGrid] Add a CSS class corresponding to current density (#4858) @m4theushw
|
|
27
|
+
- [DataGrid] Execute the pipe-processors in their initialization order (#4913) @flaviendelangle
|
|
28
|
+
- [DataGrid] Fix rendering of the no rows overlay when the `loading` prop is changed (#4910) @m4theushw
|
|
29
|
+
- [DataGridPremium] Add `exceljs` to the dependencies (#4939) @alexfauquette
|
|
30
|
+
- [DataGridPremium] Support column spanning in the Excel export (#4830) @cherniavskii
|
|
31
|
+
- [l10n] Improve Russian (ru-RU) locale (#4864) @arvkonstantin
|
|
32
|
+
|
|
33
|
+
### `@mui/x-date-pickers@5.0.0-alpha.4` / `@mui/x-date-pickers-pro@5.0.0-alpha.4`
|
|
34
|
+
|
|
35
|
+
#### Breaking changes
|
|
36
|
+
|
|
37
|
+
- The props related to the action bar buttons have been removed (`clearable`, `showTodayButton`, `cancelText`, `okText`)
|
|
38
|
+
|
|
39
|
+
To decide which button must be displayed and in which order, you can now use the `actions` prop of the `actionBar` component slot props.
|
|
40
|
+
|
|
41
|
+
```jsx
|
|
42
|
+
<DatePicker
|
|
43
|
+
componentsProps={{
|
|
44
|
+
actionBar: {
|
|
45
|
+
// The actions will be the same between desktop and mobile
|
|
46
|
+
actions: ['clear'],
|
|
47
|
+
|
|
48
|
+
// The actions will be different between desktop and mobile
|
|
49
|
+
actions: (variant) => variant === 'desktop' ? [] : ['clear'],
|
|
50
|
+
}
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The build-in `ActionBar` component supports 4 different actions: `'clear'`, `'cancel'`, `'accept'`, and `'today'`.
|
|
56
|
+
By default, the pickers will render the cancel and accept button on mobile and no action on desktop.
|
|
57
|
+
|
|
58
|
+
If you need other actions, you can provide your own component to the `ActionBar` component slot
|
|
59
|
+
|
|
60
|
+
```jsx
|
|
61
|
+
<DatePicker
|
|
62
|
+
components={{ ActionBar: CustomActionBar }}
|
|
63
|
+
/>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Changes
|
|
67
|
+
|
|
68
|
+
- [DatePicker] Fix keyboard accessibility for first and last year (#4807) @alexfauquette
|
|
69
|
+
- [pickers] Add component slot for action bar (#4778) @alexfauquette
|
|
70
|
+
- [pickers] Add l10n support (#4517) @alexfauquette
|
|
71
|
+
- [pickers] Close Popper when pressing <kbd>Esc</kbd> inside a modal (#4499) @alexfauquette
|
|
72
|
+
- [pickers] Support class slots on toolbar components (#4855) @flaviendelangle
|
|
73
|
+
- [TimePicker] Fix time validation when current date is `null` (#4867) @flaviendelangle
|
|
74
|
+
|
|
75
|
+
### Docs
|
|
76
|
+
|
|
77
|
+
- [docs] Add 301 redirect for columns page (#4940) @alexfauquette
|
|
78
|
+
- [docs] Avoid confusion with license key installation (#4891) @oliviertassinari
|
|
79
|
+
- [docs] Complete the instructions for pickers installation in readme (#4852) @alexfauquette
|
|
80
|
+
- [docs] Disable ads on paid-only pages (#4842) @flaviendelangle
|
|
81
|
+
- [docs] Don't redirect to localized doc on deploy preview (#4818) @m4theushw
|
|
82
|
+
- [docs] Limit `LICENSE` file to 80 char per line (#4873) @oliviertassinari
|
|
83
|
+
- [docs] Typo on OrderId @oliviertassinari
|
|
84
|
+
- [docs] Update feature comparison table (#4918) @cherniavskii
|
|
85
|
+
|
|
86
|
+
### Core
|
|
87
|
+
|
|
88
|
+
- [core] Add new script to generate tree data rows from file tree (#4902) @flaviendelangle
|
|
89
|
+
- [core] Fix code style (#4874) @oliviertassinari
|
|
90
|
+
- [core] Fix React 18 peer dependency (#4908) @oliviertassinari
|
|
91
|
+
- [core] Fix link to the LICENSE file (#4875) @oliviertassinari
|
|
92
|
+
- [core] Fix transitive babel dependency (#4793) @oliviertassinari
|
|
93
|
+
- [core] New pipe processing `rowHydration` (#4896) @flaviendelangle
|
|
94
|
+
- [core] Remove dead code for the docs (#4791) @oliviertassinari
|
|
95
|
+
- [core] Run `yarn prettier` @oliviertassinari
|
|
96
|
+
- [core] Polishes on `CHANGELOG.md` (#4876) @oliviertassinari
|
|
97
|
+
- [core] Simplify rows cache management (#4933) @flaviendelangle
|
|
98
|
+
- [core] Use internal icons for quick filter (#4912) @alexfauquette
|
|
99
|
+
|
|
100
|
+
## v5.11.0
|
|
101
|
+
|
|
102
|
+
_May 13, 2022_
|
|
103
|
+
|
|
104
|
+
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
105
|
+
|
|
106
|
+
- 🚀 **Premium plan release**. We're happy to announce that the Premium plan is [finally out](https://mui.com/blog/premium-plan-release/)! With it, MUI X officially steps up to the next level, supporting the most advanced use cases for UI components.
|
|
107
|
+
|
|
108
|
+
This plan is available through the new `@mui/x-data-grid-premium` package, which contains the row grouping and the Excel export features.
|
|
109
|
+
|
|
110
|
+
If you were already using the row grouping feature, you can upgrade by [installing](https://mui.com/x/react-data-grid/getting-started/#installation) `@mui/x-data-grid-premium` and replace `DataGridPro` with `DataGridPremium`, as follows. Note that the experimental flag is not required anymore to use the row grouping.
|
|
111
|
+
|
|
112
|
+
```diff
|
|
113
|
+
-import { DataGridPro } from '@mui/x-data-grid-pro';
|
|
114
|
+
+import { DataGridPremium } from '@mui/x-data-grid-premium';
|
|
115
|
+
|
|
116
|
+
-<DataGridPro experimentalFeatures={{ rowGrouping: true }} />
|
|
117
|
+
+<DataGridPremium />
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
For more information about the revised pricing model please have a look at the [blog post](https://mui.com/blog/premium-plan-release/#the-new-licensing-model).
|
|
121
|
+
|
|
122
|
+
- 👔 **Excel export**. You can find this new Premium feature at: https://mui.com/x/react-data-grid/export/#excel-export.
|
|
123
|
+
|
|
124
|
+
- 🔎 **Quick filtering**. You can now add a quick filtering search bar to your grid. To do so, either pass `showQuickFilter` prop to the `<GridToolbar />` or use the `<GridToolbarQuickFilter />` component in your custom toolbar. More information about how to customize the filtering logic is in the [documentation]( https://mui.com/x/react-data-grid/filtering/#quick-filter).
|
|
125
|
+
|
|
126
|
+
<img src="https://user-images.githubusercontent.com/13808724/167700105-5a5acc7c-5463-4871-8514-3d09e2f365ae.png" width="724">
|
|
127
|
+
|
|
128
|
+
- 🐞 Bugs fixes
|
|
129
|
+
|
|
130
|
+
### `@mui/x-data-grid@v5.11.0` / `@mui/x-data-grid-pro@v5.11.0` / `@mui/x-data-grid-premium@v5.11.0`
|
|
131
|
+
|
|
132
|
+
#### Breaking changes
|
|
133
|
+
|
|
134
|
+
- Move row grouping to the premium package (#4223) @flaviendelangle
|
|
135
|
+
|
|
136
|
+
The use of `rowGrouping` in the `@mui/x-data-grid-pro` package is deprecated. The experimental flag will be removed in an upcoming release.
|
|
137
|
+
|
|
138
|
+
#### Changes
|
|
139
|
+
|
|
140
|
+
- [DataGrid] Add TypeScript support to the `sx` prop in inner components (#4743) @lindapaiste
|
|
141
|
+
- [DataGrid] Add props to control cell mode (#4210) @m4theushw
|
|
142
|
+
- [DataGrid] Add quick filtering engine (#4317) @alexfauquette
|
|
143
|
+
- [DataGrid] Check focus validity whenever the rows in state changes (#4683) @flaviendelangle
|
|
144
|
+
- [DataGrid] Fix infinite scroll when dragging column header cell over row cell (#4735) @DjoSmer
|
|
145
|
+
- [DataGrid] Fix scroll jump when using keyboard navigation (#4515) @cherniavskii
|
|
146
|
+
- [DataGrid] Improve sorting accessibility (#4379) @cherniavskii
|
|
147
|
+
- [DataGrid] New `getRowGroupChildren` API method (#4304) @flaviendelangle
|
|
148
|
+
- [DataGrid] Publish `preferencePanelClose` event only once when clicking on another panel button (#4810) @flaviendelangle
|
|
149
|
+
- [DataGrid] Update focused action if the currently focused one is removed (#4694) @m4theushw
|
|
150
|
+
- [DataGrid] Add `onChange` callback to edit components (#4621) @m4theushw
|
|
151
|
+
- [DataGrid] Add `keepNonExistentRowsSelected` prop (#4786) @willsoto
|
|
152
|
+
- [DataGrid] Prevent crash if row is removed with click (#4831) @m4theushw
|
|
153
|
+
- [DataGridPro] Fix detail panel not taking full width (#4610) @cherniavskii
|
|
154
|
+
- [DataGridPremium] Add Excel export (#3981) @alexfauquette
|
|
155
|
+
- [DataGridPremium] Bootstrap `@mui/x-data-grid-premium` (#4223) @flaviendelangle
|
|
156
|
+
- [DataGridPremium] Fix Excel date serialization when row grouping is enabled (#4774) @cherniavskii
|
|
157
|
+
- [l10n] Improve German (de-DE) locale (#4748) @sebastianfrey
|
|
158
|
+
- [l10n] Improve German (de-DE) locale (#4668) @izu-co
|
|
159
|
+
|
|
160
|
+
### `@mui/x-date-pickers@5.0.0-alpha.3` / `@mui/x-date-pickers-pro@5.0.0-alpha.3`
|
|
161
|
+
|
|
162
|
+
#### Breaking changes
|
|
163
|
+
|
|
164
|
+
- Rework the auto-closing behavior of the pickers (#4408) @flaviendelangle
|
|
165
|
+
|
|
166
|
+
The `disableCloseOnSelect` prop has been replaced by a new `closeOnSelect` prop which has the opposite behavior.
|
|
167
|
+
The default behavior remains the same (close after the last step on desktop but not on mobile).
|
|
168
|
+
|
|
169
|
+
```diff
|
|
170
|
+
// If you don't want to close after the last step
|
|
171
|
+
-<DatePicker disableCloseOnSelect={false} />
|
|
172
|
+
+<DatePicker closeOnSelect />
|
|
173
|
+
|
|
174
|
+
// If you want to close after the last step
|
|
175
|
+
-<DatePicker disableCloseOnSelect />
|
|
176
|
+
+<DatePicker closeOnSelect={false} />
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
#### Changes
|
|
180
|
+
|
|
181
|
+
- [DatePicker] Ignore <kbd>Escape</kbd> when the picker is already closed (#4770) @mikewolfd
|
|
182
|
+
- [DatePicker] Make month year order changeable in header (#4695) @gky360
|
|
183
|
+
- [DateRangePicker] Open view on click, <kbd>Enter</kbd> or <kbd>Space</kbd> instead of focus (#4747) @alexfauquette
|
|
184
|
+
- [DateRangePicker] Refactor tests (#4745) @flaviendelangle
|
|
185
|
+
- [DateRangePicker] Remove `orientation` prop (#4665) @m4theushw
|
|
186
|
+
- [DateTimePicker] `Toolbar` should be visible by default on mobile (#4833) @flaviendelangle
|
|
187
|
+
- [MonthPicker] New prop `shouldDisableMonth` (#4708) @someone635
|
|
188
|
+
- [TimePicker] Disable and invalidate date with minutes not matching `minutesStep` (#4726) @flaviendelangle
|
|
189
|
+
- [TimePicker] Don't merge with previous value when new value is not valid (#4847) @flaviendelangle
|
|
190
|
+
- [TimePicker] Refactor `isTimeDisabled` method (#4688) @flaviendelangle
|
|
191
|
+
- [pickers] Add details in invalid mask error (#4501) @alexfauquette
|
|
192
|
+
- [pickers] Add explicit interfaces for components slots and components slots props (#4589) @flaviendelangle
|
|
193
|
+
- [pickers] Add missing `peerDependencies` for `yarn pnp` users (#4763) @nate-summercook
|
|
194
|
+
- [pickers] Add overrides to `PickersArrowSwitcher` (#4672) @m4theushw
|
|
195
|
+
- [pickers] Clean component interfaces and remove non-implemented props (#4758) @flaviendelangle
|
|
196
|
+
- [pickers] Do not apply the current time when no date provided in `DayPicker` (#4649) @flaviendelangle
|
|
197
|
+
- [pickers] Document and refacto the value manager (#4701) @flaviendelangle
|
|
198
|
+
- [pickers] Drop `allowSameDateSelection` prop (#4808) @flaviendelangle
|
|
199
|
+
- [pickers] Enable mask by default when using `ampm=true` (#4731) @alexfauquette
|
|
200
|
+
- [pickers] Fix `disabled` and `readOnly` behavior on calendar and clock (#4645) @alexfauquette
|
|
201
|
+
- [pickers] Invalid character does not delete last digit (#4839) @alexfauquette
|
|
202
|
+
- [pickers] Rename prop `date` into `parsedValue` when it can contain a range (#4736) @flaviendelangle
|
|
203
|
+
- [pickers] Rework `TDate`, `TInputDate`, `TValue` and `TInputValue` generics (#4617) @flaviendelangle
|
|
204
|
+
- [pickers] Rework the date lifecycle in `usePickerState` (#4408) @flaviendelangle
|
|
205
|
+
|
|
206
|
+
### Docs
|
|
207
|
+
|
|
208
|
+
- [docs] Add `scopePathNames` property to column page (#4811) @flaviendelangle
|
|
209
|
+
- [docs] Add label to each demo (#4667) @m4theushw
|
|
210
|
+
- [docs] Correctly capitalize <kbd>Ctrl</kbd> (#4707) @oliviertassinari
|
|
211
|
+
- [docs] Fix documentation on `ampm` prop (#4846) @alexfauquette
|
|
212
|
+
- [docs] Generate the event documentation from `GridEventLookup` (#4725) @flaviendelangle
|
|
213
|
+
- [docs] Keep columns section expanded when switching between pages (#4816) @cherniavskii
|
|
214
|
+
- [docs] Move `useKeepGroupingColumnsHidden` on `@mui/x-data-grid-premium` (#4319) @flaviendelangle
|
|
215
|
+
- [docs] Remove legacy pages for old URLs (#4575) @m4theushw
|
|
216
|
+
- [docs] Remove remaining pages in `docs/pages/api-docs` folder (#4709) @m4theushw
|
|
217
|
+
- [docs] SEO fixes (#4711) @oliviertassinari
|
|
218
|
+
- [docs] Set type number to movie column year (#4753) @flaviendelangle
|
|
219
|
+
- [docs] Simplify server examples (#4186) @alexfauquette
|
|
220
|
+
- [docs] Small typo (#4670) @flaviendelangle
|
|
221
|
+
- [docs] Split the 'Columns' page (#4600) @flaviendelangle
|
|
222
|
+
- [docs] Stop using `GridEvents` enum in documentation (#4699) @flaviendelangle
|
|
223
|
+
- [docs] Update mono repo to get copy code block (#4691) @siriwatknp
|
|
224
|
+
- [docs] Update the feature table in the Getting Started page of the data grid (#4619) @flaviendelangle
|
|
225
|
+
- [docs] Add demo for Premium (#4750) @m4theushw
|
|
226
|
+
|
|
227
|
+
### Core
|
|
228
|
+
|
|
229
|
+
- [core] Check if `process` is available (#4193) @m4theushw
|
|
230
|
+
- [core] Fix naming collision (#4853) @alexfauquette
|
|
231
|
+
- [core] Prevent out-of-memory when type-checking in CI (#4697) @flaviendelangle
|
|
232
|
+
- [core] Remove `rowsCache` from state (#4480) @m4theushw
|
|
233
|
+
- [core] Rework `DayPicker` api (#4783) @flaviendelangle
|
|
234
|
+
- [core] Update `x-license-pro` license to handle premium package (#4315) @DanailH
|
|
235
|
+
- [core] Update monorepo & version (#4789) @oliviertassinari
|
|
236
|
+
- [core] Update monorepo (#4772) @flaviendelangle
|
|
237
|
+
- [core] Stop using `GridEvents` enum (#4698, #4696, #4685) @flaviendelangle
|
|
238
|
+
- [core] Update monorepo (#4854) @cherniavskii
|
|
239
|
+
- [license] Allow to limit some packages to a specific license plan (#4651) @flaviendelangle
|
|
240
|
+
- [test] Fix path to detect `DataGrid` tests (#4752) @m4theushw
|
|
241
|
+
- [test] Reset cleanup tracking on Karma tests (#4679) @m4theushw
|
|
242
|
+
- [test] Restore `sinon` sandbox after each `karma` test (#4689) @m4theushw
|
|
243
|
+
|
|
244
|
+
## v5.10.0
|
|
245
|
+
|
|
246
|
+
_Apr 25, 2022_
|
|
247
|
+
|
|
248
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
249
|
+
|
|
250
|
+
- 🎁 Introduce [Row reorder](https://mui.com/x/react-data-grid/rows/#row-reorder) (#4034) @DanailH
|
|
251
|
+
|
|
252
|
+
<img src="https://user-images.githubusercontent.com/5858539/165091263-23472fbb-a989-44b8-849a-d2185adfe13b.gif" width="800">
|
|
253
|
+
|
|
254
|
+
- 🐞 Bug fixes
|
|
255
|
+
|
|
256
|
+
### `@mui/x-data-grid@v5.10.0` / `@mui/x-data-grid-pro@v5.10.0`
|
|
257
|
+
|
|
258
|
+
- [DataGrid] Don't close column menu when updating rows (#4498) @m4theushw
|
|
259
|
+
- [DataGridPro] Introduce row reorder (#4034) @DanailH
|
|
260
|
+
|
|
261
|
+
### `@mui/x-date-pickers@5.0.0-alpha.2` / `@mui/x-date-pickers-pro@5.0.0-alpha.2`
|
|
262
|
+
|
|
263
|
+
- [pickers] Pass `PaperProps` to `DesktopWrapper` component (#4584) @alexfauquette
|
|
264
|
+
- [TimePicker] Fix bug when time picker clear value (#4582) @alexfauquette
|
|
265
|
+
- [DateRangePicker] Fix missing `clearable` and `clearText` props (#4511) @zigang93
|
|
266
|
+
|
|
267
|
+
### Docs
|
|
268
|
+
|
|
269
|
+
- [docs] Add plan in the nav bar for pro-only and premium-only pages (#4591) @flaviendelangle
|
|
270
|
+
- [docs] Clarify where to install the license (#4452) @oliviertassinari
|
|
271
|
+
- [docs] Fix CodeSandbox links for demo with pickers (#4570) @alexfauquette
|
|
272
|
+
- [docs] Include date-fns dependency when opening demos in CodeSandbox (#4508) @m4theushw
|
|
273
|
+
- [docs] Split the 'Group & Pivot' page (#4441) @flaviendelangle
|
|
274
|
+
|
|
275
|
+
### Core
|
|
276
|
+
|
|
277
|
+
- [core] Fix the README of the X packages (#4590) @flaviendelangle
|
|
278
|
+
- [test] Fix test to not depend on screen resolution (#4587) @m4theushw
|
|
279
|
+
|
|
6
280
|
## v5.9.0
|
|
7
281
|
|
|
8
282
|
_Apr 14, 2022_
|
|
@@ -13,7 +287,7 @@ We'd like to offer a big thanks to the 9 contributors who made this release poss
|
|
|
13
287
|
|
|
14
288
|
Now the data grid and pickers components support the concurrent mode.
|
|
15
289
|
|
|
16
|
-
- 🎁 Add support for [Column spanning](https://mui.com/x/react-data-grid/
|
|
290
|
+
- 🎁 Add support for [Column spanning](https://mui.com/x/react-data-grid/column-spanning/) (#4020) @cherniavskii
|
|
17
291
|
|
|
18
292
|
<img src="https://user-images.githubusercontent.com/13808724/162926746-93bcb180-3c9d-4eb9-afc7-c3908a5c6406.png" width="788">
|
|
19
293
|
|
|
@@ -636,7 +910,7 @@ A big thanks to the 9 contributors who made this release possible. Here are some
|
|
|
636
910
|
/>
|
|
637
911
|
```
|
|
638
912
|
|
|
639
|
-
See the [documentation](https://mui.com/x/react-data-grid/
|
|
913
|
+
See the [documentation](https://mui.com/x/react-data-grid/column-visibility/) for more details.
|
|
640
914
|
|
|
641
915
|
The `hide` property from `GridColDef` still works but has been deprecated.
|
|
642
916
|
|
|
@@ -792,7 +1066,7 @@ A big thanks to the 5 contributors who made this release possible. Here are some
|
|
|
792
1066
|
|
|
793
1067
|
### `@mui/x-data-grid@v5.2.0` / `@mui/x-data-grid-pro@v5.2.0`
|
|
794
1068
|
|
|
795
|
-
- 🚀 Introduce the [column pinning](https://mui.com/x/react-data-grid/
|
|
1069
|
+
- 🚀 Introduce the [column pinning](https://mui.com/x/react-data-grid/column-pinning/) feature (#2946) @m4theushw
|
|
796
1070
|
|
|
797
1071
|
<img src="https://user-images.githubusercontent.com/42154031/145425635-b6314fbe-2f1e-4b73-908f-33ee1fda20c7.gif" width="964" height="657">
|
|
798
1072
|
|
|
@@ -1746,7 +2020,7 @@ A big thanks to the 9 contributors who made this release possible. Here are some
|
|
|
1746
2020
|
- 📚 Migrate to the new documentation infrastructure and design (#2441) (@DanailH, @m4theushw)
|
|
1747
2021
|
- 🎁 Add `actions` column type (#2385) @m4theushw
|
|
1748
2022
|
|
|
1749
|
-
See the documentation for [more details](https://mui.com/x/react-data-grid/
|
|
2023
|
+
See the documentation for [more details](https://mui.com/x/react-data-grid/column-definition/#column-types).
|
|
1750
2024
|
|
|
1751
2025
|
- 👁 Allow to disable virtualization with the `disableVirtualization` prop (#2326) @m4theushw
|
|
1752
2026
|
- 🚀 Introduce the new `isRowSelected` api method (#2523) @flaviendelangle
|
|
@@ -2368,11 +2642,11 @@ _July 1, 2021_
|
|
|
2368
2642
|
Big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
2369
2643
|
|
|
2370
2644
|
- 🐞 As a focus of Q2, we have kept fixing bugs
|
|
2371
|
-
- 💅 End users are now allowed to copy the selected rows to the clipboard with <kbd>
|
|
2645
|
+
- 💅 End users are now allowed to copy the selected rows to the clipboard with <kbd>Ctrl</kbd> + <kbd>c</kbd> (#1929) @m4theushw
|
|
2372
2646
|
- 🐛 We have fixed the `Select all` checkbox. When triggered, it should only select the filtered rows (#1879) @ZeeshanTamboli
|
|
2373
2647
|
- ⚡️ We have added a new `singleSelect` column type (#1956) @DanailH
|
|
2374
2648
|
|
|
2375
|
-
Using the column `type: 'singleSelect'` defaults to `Select` component when the cell is in `edit` mode. You can find the documentation [following this link](https://mui.com/x/react-data-grid/
|
|
2649
|
+
Using the column `type: 'singleSelect'` defaults to `Select` component when the cell is in `edit` mode. You can find the documentation [following this link](https://mui.com/x/react-data-grid/column-definition/#column-types).
|
|
2376
2650
|
|
|
2377
2651
|
```jsx
|
|
2378
2652
|
<DataGrid
|
|
@@ -2568,7 +2842,7 @@ _June 9, 2021_
|
|
|
2568
2842
|
Big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
2569
2843
|
|
|
2570
2844
|
- 💅 Allow to customize GridToolbarExport's CSV export (#1695) @michallukowski
|
|
2571
|
-
- 🐛 Allow to deselect rows with <kbd>
|
|
2845
|
+
- 🐛 Allow to deselect rows with <kbd>Ctrl</kbd> + click (#1813) @ZeeshanTamboli
|
|
2572
2846
|
- ⚡️ Refactor scroll size detector (#1703) @dtassone
|
|
2573
2847
|
- 📖 Add [documentation](https://mui.com/x/api/data-grid/) for interfaces and events (#1529) @m4theushw
|
|
2574
2848
|
- 🐞 Bugfixes
|
|
@@ -2595,7 +2869,7 @@ Big thanks to the 6 contributors who made this release possible. Here are some h
|
|
|
2595
2869
|
|
|
2596
2870
|
- [DataGrid] Add `valueParser` to parse values entered by the user (#1785) @m4theushw
|
|
2597
2871
|
- [DataGrid] Allow to customize GridToolbarExport's CSV export (#1695) @michallukowski
|
|
2598
|
-
- [DataGrid] Allow to deselect rows with <kbd>
|
|
2872
|
+
- [DataGrid] Allow to deselect rows with <kbd>Ctrl</kbd> + click (#1813) @ZeeshanTamboli
|
|
2599
2873
|
- [DataGrid] Improve general architecture to better isolate hooks (#1720) @dtassone
|
|
2600
2874
|
- [DataGrid] Fix cell height after changing grid density (#1819) @DanailH
|
|
2601
2875
|
- [DataGrid] Fix fluid columns width when available `viewportWidth` < 0 (#1816) @DanailH
|
|
@@ -3117,7 +3391,7 @@ Big thanks to the 8 contributors who made this release possible. Here are some h
|
|
|
3117
3391
|
- [DataGrid] Rename `useGridBaseComponentProps` hook to `useGridSlotComponentProps` (#1252) @DanailH
|
|
3118
3392
|
- [DataGrid] Rename modules (#1292) @DanailH
|
|
3119
3393
|
- [DataGrid] Rename all events related to column reordering, e.g. `GRID_COL_REORDER_START` -> `GRID_COLUMN_REORDER_START` (#1299) @m4theushw
|
|
3120
|
-
- [DataGrid] Methods `onColItemDragStart`, `onColHeaderDragOver`, `onColItemDragOver`, `onColItemDragEnter` removed from the grid API. Prefer listening to [column reordering events](https://mui.com/x/react-data-grid/
|
|
3394
|
+
- [DataGrid] Methods `onColItemDragStart`, `onColHeaderDragOver`, `onColItemDragOver`, `onColItemDragEnter` removed from the grid API. Prefer listening to [column reordering events](https://mui.com/x/react-data-grid/column-ordering/) (#1299) @m4theushw
|
|
3121
3395
|
- [DataGrid] Calling `apiRef.current.getColumnHeaderParams` returns a `GridColumnHeaderParams` instead of `GridColParams` (#1299) @m4theushw
|
|
3122
3396
|
- [DataGrid] Events that follow the pattern `GRID_COLUMN_HEADER_xxx` will be called with a `GridColumnHeaderParams` instead of `GridColParams` (#1299) @m4theushw
|
|
3123
3397
|
- [DataGrid] The `renderHeader` will be called with a `GridColumnHeaderParams` instead of `GridColParams` (#1299) @m4theushw
|
|
@@ -3485,7 +3759,7 @@ _Jan 14, 2021_
|
|
|
3485
3759
|
Big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
|
|
3486
3760
|
|
|
3487
3761
|
- 🎛 Add support for Column selector (#837) @DanailH @dtassone.
|
|
3488
|
-
The feature can be triggered from the toolbar or the column menu. Check [the documentation](https://mui.com/x/react-data-grid/
|
|
3762
|
+
The feature can be triggered from the toolbar or the column menu. Check [the documentation](https://mui.com/x/react-data-grid/column-definition/#column-selector).
|
|
3489
3763
|
|
|
3490
3764
|

|
|
3491
3765
|
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -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]].
|
|
@@ -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
|
*/
|
|
@@ -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) {
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @mui/x-data-grid
|
|
2
2
|
|
|
3
|
-
This package is the
|
|
3
|
+
This package is the Community Plan edition of the data grid component.
|
|
4
4
|
It's part of MUI X, an open core extension of MUI, with advanced components.
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
@@ -15,12 +15,13 @@ npm install @mui/x-data-grid
|
|
|
15
15
|
yarn add @mui/x-data-grid
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
This component has
|
|
18
|
+
This component has the following peer dependencies that you will need to install as well.
|
|
19
19
|
|
|
20
20
|
```json
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@mui/material": "^5.
|
|
23
|
-
"
|
|
22
|
+
"@mui/material": "^5.2.8",
|
|
23
|
+
"@mui/system": "^5.2.8",
|
|
24
|
+
"react": "^17.0.2 || ^18.0.0"
|
|
24
25
|
},
|
|
25
26
|
```
|
|
26
27
|
|
|
@@ -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;
|
package/colDef/gridDateColDef.js
CHANGED
|
@@ -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
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { GridFilterOperator } from '../models/gridFilterOperator';
|
|
2
|
+
import { GridCellParams } from '../models';
|
|
3
|
+
export declare const getGridNumericQuickFilterFn: (value: any) => (({ value: columnValue }: GridCellParams) => boolean) | null;
|
|
2
4
|
export declare const getGridNumericOperators: () => GridFilterOperator<any, number | string | null, any>[];
|
|
3
5
|
/**
|
|
4
6
|
* @deprecated Use `getGridNumericOperators` instead.
|
|
@@ -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
|
});
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import { GridFilterOperator } from '../models/gridFilterOperator';
|
|
2
|
+
import { GridCellParams, GridColDef } from '../models';
|
|
3
|
+
import { GridApiCommunity } from '../models/api/gridApiCommunity';
|
|
4
|
+
export declare const getGridSingleSelectQuickFilterFn: (value: any, column: GridColDef, apiRef: React.MutableRefObject<GridApiCommunity>) => (({ value: columnValue }: GridCellParams) => boolean) | null;
|
|
2
5
|
export declare const getGridSingleSelectOperators: () => GridFilterOperator[];
|
|
@@ -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
|
};
|