@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
|
@@ -2,11 +2,12 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
5
6
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
9
|
export function GridFilterInputBoolean(props) {
|
|
9
|
-
var _rootProps$components;
|
|
10
|
+
var _rootProps$components, _baseSelectProps$nati, _rootProps$components2, _rootProps$components3;
|
|
10
11
|
|
|
11
12
|
const {
|
|
12
13
|
item,
|
|
@@ -18,6 +19,9 @@ export function GridFilterInputBoolean(props) {
|
|
|
18
19
|
|
|
19
20
|
const [filterValueState, setFilterValueState] = React.useState(item.value || '');
|
|
20
21
|
const rootProps = useGridRootProps();
|
|
22
|
+
const baseSelectProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseSelect) || {};
|
|
23
|
+
const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
|
|
24
|
+
const OptionComponent = isSelectNative ? 'option' : MenuItem;
|
|
21
25
|
const onFilterChange = React.useCallback(event => {
|
|
22
26
|
const value = event.target.value;
|
|
23
27
|
setFilterValueState(value);
|
|
@@ -34,21 +38,22 @@ export function GridFilterInputBoolean(props) {
|
|
|
34
38
|
onChange: onFilterChange,
|
|
35
39
|
variant: "standard",
|
|
36
40
|
select: true,
|
|
37
|
-
SelectProps: {
|
|
38
|
-
native:
|
|
39
|
-
|
|
41
|
+
SelectProps: _extends({
|
|
42
|
+
native: isSelectNative,
|
|
43
|
+
displayEmpty: true
|
|
44
|
+
}, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect),
|
|
40
45
|
InputLabelProps: {
|
|
41
46
|
shrink: true
|
|
42
47
|
},
|
|
43
48
|
inputRef: focusElementRef
|
|
44
|
-
}, others, (_rootProps$
|
|
45
|
-
children: [/*#__PURE__*/_jsx(
|
|
49
|
+
}, others, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.baseTextField, {
|
|
50
|
+
children: [/*#__PURE__*/_jsx(OptionComponent, {
|
|
46
51
|
value: "",
|
|
47
52
|
children: apiRef.current.getLocaleText('filterValueAny')
|
|
48
|
-
}), /*#__PURE__*/_jsx(
|
|
53
|
+
}), /*#__PURE__*/_jsx(OptionComponent, {
|
|
49
54
|
value: "true",
|
|
50
55
|
children: apiRef.current.getLocaleText('filterValueTrue')
|
|
51
|
-
}), /*#__PURE__*/_jsx(
|
|
56
|
+
}), /*#__PURE__*/_jsx(OptionComponent, {
|
|
52
57
|
value: "false",
|
|
53
58
|
children: apiRef.current.getLocaleText('filterValueFalse')
|
|
54
59
|
})]
|
|
@@ -4,6 +4,7 @@ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/material/utils';
|
|
7
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
7
8
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
8
9
|
import { getValueFromValueOptions } from './filterPanelUtils';
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -12,25 +13,29 @@ const renderSingleSelectOptions = ({
|
|
|
12
13
|
valueOptions,
|
|
13
14
|
valueFormatter,
|
|
14
15
|
field
|
|
15
|
-
}, api) => {
|
|
16
|
+
}, api, OptionComponent) => {
|
|
16
17
|
const iterableColumnValues = typeof valueOptions === 'function' ? ['', ...valueOptions({
|
|
17
18
|
field
|
|
18
19
|
})] : ['', ...(valueOptions || [])];
|
|
19
|
-
return iterableColumnValues.map(option =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
children: valueFormatter && option !== '' ? valueFormatter({
|
|
20
|
+
return iterableColumnValues.map(option => {
|
|
21
|
+
const isOptionTypeObject = typeof option === 'object';
|
|
22
|
+
const key = isOptionTypeObject ? option.value : option;
|
|
23
|
+
const value = isOptionTypeObject ? option.value : option;
|
|
24
|
+
const formattedValue = valueFormatter && option !== '' ? valueFormatter({
|
|
25
25
|
value: option,
|
|
26
26
|
field,
|
|
27
27
|
api
|
|
28
|
-
}) : option
|
|
29
|
-
|
|
28
|
+
}) : option;
|
|
29
|
+
const content = isOptionTypeObject ? option.label : formattedValue;
|
|
30
|
+
return /*#__PURE__*/_jsx(OptionComponent, {
|
|
31
|
+
value: value,
|
|
32
|
+
children: content
|
|
33
|
+
}, key);
|
|
34
|
+
});
|
|
30
35
|
};
|
|
31
36
|
|
|
32
37
|
function GridFilterInputSingleSelect(props) {
|
|
33
|
-
var _item$value, _rootProps$components;
|
|
38
|
+
var _item$value, _rootProps$components, _baseSelectProps$nati, _rootProps$components2, _rootProps$components3;
|
|
34
39
|
|
|
35
40
|
const {
|
|
36
41
|
item,
|
|
@@ -44,6 +49,8 @@ function GridFilterInputSingleSelect(props) {
|
|
|
44
49
|
const [filterValueState, setFilterValueState] = React.useState((_item$value = item.value) != null ? _item$value : '');
|
|
45
50
|
const id = useId();
|
|
46
51
|
const rootProps = useGridRootProps();
|
|
52
|
+
const baseSelectProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseSelect) || {};
|
|
53
|
+
const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
|
|
47
54
|
const currentColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
|
|
48
55
|
const currentValueOptions = React.useMemo(() => {
|
|
49
56
|
return typeof currentColumn.valueOptions === 'function' ? currentColumn.valueOptions({
|
|
@@ -94,11 +101,11 @@ function GridFilterInputSingleSelect(props) {
|
|
|
94
101
|
},
|
|
95
102
|
inputRef: focusElementRef,
|
|
96
103
|
select: true,
|
|
97
|
-
SelectProps: {
|
|
98
|
-
native:
|
|
99
|
-
}
|
|
100
|
-
}, others, (_rootProps$
|
|
101
|
-
children: renderSingleSelectOptions(apiRef.current.getColumn(item.columnField), apiRef.current)
|
|
104
|
+
SelectProps: _extends({
|
|
105
|
+
native: isSelectNative
|
|
106
|
+
}, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect)
|
|
107
|
+
}, others, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.baseTextField, {
|
|
108
|
+
children: renderSingleSelectOptions(apiRef.current.getColumn(item.columnField), apiRef.current, isSelectNative ? 'option' : MenuItem)
|
|
102
109
|
}));
|
|
103
110
|
}
|
|
104
111
|
|
|
@@ -4,6 +4,7 @@ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/material/utils';
|
|
7
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
7
8
|
import { GridLoadIcon } from '../../icons';
|
|
8
9
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
9
10
|
import { getValueFromValueOptions } from './filterPanelUtils';
|
|
@@ -19,27 +20,31 @@ const renderSingleSelectOptions = ({
|
|
|
19
20
|
valueOptions,
|
|
20
21
|
valueFormatter,
|
|
21
22
|
field
|
|
22
|
-
}, api) => {
|
|
23
|
+
}, api, OptionComponent) => {
|
|
23
24
|
const iterableColumnValues = typeof valueOptions === 'function' ? ['', ...valueOptions({
|
|
24
25
|
field
|
|
25
26
|
})] : ['', ...(valueOptions || [])];
|
|
26
|
-
return iterableColumnValues.map(option =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
children: valueFormatter && option !== '' ? valueFormatter({
|
|
27
|
+
return iterableColumnValues.map(option => {
|
|
28
|
+
const isOptionTypeObject = typeof option === 'object';
|
|
29
|
+
const key = isOptionTypeObject ? option.value : option;
|
|
30
|
+
const value = isOptionTypeObject ? option.value : option;
|
|
31
|
+
const formattedValue = valueFormatter && option !== '' ? valueFormatter({
|
|
32
32
|
value: option,
|
|
33
33
|
field,
|
|
34
34
|
api
|
|
35
|
-
}) : option
|
|
36
|
-
|
|
35
|
+
}) : option;
|
|
36
|
+
const content = isOptionTypeObject ? option.label : formattedValue;
|
|
37
|
+
return /*#__PURE__*/_jsx(OptionComponent, {
|
|
38
|
+
value: value,
|
|
39
|
+
children: content
|
|
40
|
+
}, key);
|
|
41
|
+
});
|
|
37
42
|
};
|
|
38
43
|
|
|
39
44
|
export const SUBMIT_FILTER_STROKE_TIME = 500;
|
|
40
45
|
|
|
41
46
|
function GridFilterInputValue(props) {
|
|
42
|
-
var _item$value, _rootProps$components;
|
|
47
|
+
var _item$value, _rootProps$components, _baseSelectProps$nati, _rootProps$components2, _rootProps$components3;
|
|
43
48
|
|
|
44
49
|
const {
|
|
45
50
|
item,
|
|
@@ -59,12 +64,14 @@ function GridFilterInputValue(props) {
|
|
|
59
64
|
const [applying, setIsApplying] = React.useState(false);
|
|
60
65
|
const id = useId();
|
|
61
66
|
const rootProps = useGridRootProps();
|
|
67
|
+
const baseSelectProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseSelect) || {};
|
|
68
|
+
const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
|
|
62
69
|
const singleSelectProps = type === 'singleSelect' ? {
|
|
63
70
|
select: true,
|
|
64
|
-
SelectProps: {
|
|
65
|
-
native:
|
|
66
|
-
},
|
|
67
|
-
children: renderSingleSelectOptions(apiRef.current.getColumn(item.columnField), apiRef.current)
|
|
71
|
+
SelectProps: _extends({
|
|
72
|
+
native: isSelectNative
|
|
73
|
+
}, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect),
|
|
74
|
+
children: renderSingleSelectOptions(apiRef.current.getColumn(item.columnField), apiRef.current, isSelectNative ? 'option' : MenuItem)
|
|
68
75
|
} : {};
|
|
69
76
|
const onFilterChange = React.useCallback(event => {
|
|
70
77
|
let value = event.target.value; // NativeSelect casts the value to a string.
|
|
@@ -115,7 +122,7 @@ function GridFilterInputValue(props) {
|
|
|
115
122
|
shrink: true
|
|
116
123
|
},
|
|
117
124
|
inputRef: focusElementRef
|
|
118
|
-
}, singleSelectProps, others, (_rootProps$
|
|
125
|
+
}, singleSelectProps, others, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.baseTextField));
|
|
119
126
|
}
|
|
120
127
|
|
|
121
128
|
process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridToolbarContainerProps } from '../containers/GridToolbarContainer';
|
|
3
3
|
import { GridToolbarExportProps } from './GridToolbarExport';
|
|
4
|
-
|
|
4
|
+
import { GridToolbarQuickFilterProps } from './GridToolbarQuickFilter';
|
|
5
|
+
export interface GridToolbarProps extends GridToolbarContainerProps, Omit<GridToolbarExportProps, 'color'> {
|
|
6
|
+
/**
|
|
7
|
+
* Show the quick filter component.
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
showQuickFilter?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Props passed to the quick filter component.
|
|
13
|
+
*/
|
|
14
|
+
quickFilterProps?: GridToolbarQuickFilterProps;
|
|
5
15
|
}
|
|
6
|
-
declare const GridToolbar: React.ForwardRefExoticComponent<GridToolbarProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const GridToolbar: React.ForwardRefExoticComponent<Pick<GridToolbarProps, keyof GridToolbarProps> & React.RefAttributes<HTMLDivElement>>;
|
|
7
17
|
export { GridToolbar };
|
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["className", "csvOptions", "printOptions"];
|
|
3
|
+
const _excluded = ["className", "csvOptions", "printOptions", "excelOptions", "showQuickFilter", "quickFilterProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import Box from '@mui/material/Box';
|
|
6
7
|
import { GridToolbarContainer } from '../containers/GridToolbarContainer';
|
|
7
8
|
import { GridToolbarColumnsButton } from './GridToolbarColumnsButton';
|
|
8
9
|
import { GridToolbarDensitySelector } from './GridToolbarDensitySelector';
|
|
9
10
|
import { GridToolbarFilterButton } from './GridToolbarFilterButton';
|
|
10
11
|
import { GridToolbarExport } from './GridToolbarExport';
|
|
11
12
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
13
|
+
import { GridToolbarQuickFilter } from './GridToolbarQuickFilter';
|
|
12
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
16
|
const GridToolbar = /*#__PURE__*/React.forwardRef(function GridToolbar(props, ref) {
|
|
17
|
+
// TODO v6: think about where export option should be passed.
|
|
18
|
+
// from componentProps={{ toolbarExport: { ...exportOption} }} seems to be more appropriate
|
|
15
19
|
const {
|
|
16
20
|
csvOptions,
|
|
17
|
-
printOptions
|
|
21
|
+
printOptions,
|
|
22
|
+
excelOptions,
|
|
23
|
+
showQuickFilter = false,
|
|
24
|
+
quickFilterProps = {}
|
|
18
25
|
} = props,
|
|
19
26
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
20
27
|
|
|
21
28
|
const rootProps = useGridRootProps();
|
|
22
29
|
|
|
23
|
-
if (rootProps.disableColumnFilter && rootProps.disableColumnSelector && rootProps.disableDensitySelector) {
|
|
30
|
+
if (rootProps.disableColumnFilter && rootProps.disableColumnSelector && rootProps.disableDensitySelector && !showQuickFilter) {
|
|
24
31
|
return null;
|
|
25
32
|
}
|
|
26
33
|
|
|
@@ -29,8 +36,14 @@ const GridToolbar = /*#__PURE__*/React.forwardRef(function GridToolbar(props, re
|
|
|
29
36
|
}, other, {
|
|
30
37
|
children: [/*#__PURE__*/_jsx(GridToolbarColumnsButton, {}), /*#__PURE__*/_jsx(GridToolbarFilterButton, {}), /*#__PURE__*/_jsx(GridToolbarDensitySelector, {}), /*#__PURE__*/_jsx(GridToolbarExport, {
|
|
31
38
|
csvOptions: csvOptions,
|
|
32
|
-
printOptions: printOptions
|
|
33
|
-
|
|
39
|
+
printOptions: printOptions // TODO: remove the reference to excelOptions in community package
|
|
40
|
+
,
|
|
41
|
+
excelOptions: excelOptions
|
|
42
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
43
|
+
sx: {
|
|
44
|
+
flex: 1
|
|
45
|
+
}
|
|
46
|
+
}), showQuickFilter && /*#__PURE__*/_jsx(GridToolbarQuickFilter, _extends({}, quickFilterProps))]
|
|
34
47
|
}));
|
|
35
48
|
});
|
|
36
49
|
process.env.NODE_ENV !== "production" ? GridToolbar.propTypes = {
|
|
@@ -38,7 +51,17 @@ process.env.NODE_ENV !== "production" ? GridToolbar.propTypes = {
|
|
|
38
51
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
39
52
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
40
53
|
// ----------------------------------------------------------------------
|
|
41
|
-
|
|
42
|
-
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Props passed to the quick filter component.
|
|
57
|
+
*/
|
|
58
|
+
quickFilterProps: PropTypes.object,
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Show the quick filter component.
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
showQuickFilter: PropTypes.bool,
|
|
65
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
43
66
|
} : void 0;
|
|
44
67
|
export { GridToolbar };
|
|
@@ -101,7 +101,7 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
101
101
|
"aria-label": apiRef.current.getLocaleText('toolbarDensityLabel'),
|
|
102
102
|
"aria-expanded": open ? 'true' : undefined,
|
|
103
103
|
"aria-haspopup": "menu",
|
|
104
|
-
"aria-
|
|
104
|
+
"aria-controls": densityMenuId,
|
|
105
105
|
id: densityButtonId
|
|
106
106
|
}, other, {
|
|
107
107
|
onClick: handleDensitySelectorOpen
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '@mui/material/Button';
|
|
3
3
|
import { GridCsvExportOptions, GridPrintExportOptions } from '../../models/gridExport';
|
|
4
|
-
interface GridExportDisplayOptions {
|
|
4
|
+
export interface GridExportDisplayOptions {
|
|
5
5
|
/**
|
|
6
6
|
* If `true`, this export option will be removed from the GridToolbarExport menu.
|
|
7
7
|
* @default false
|
|
@@ -17,8 +17,9 @@ export declare type GridPrintExportMenuItemProps = GridExportMenuItemProps<GridP
|
|
|
17
17
|
export interface GridToolbarExportProps extends ButtonProps {
|
|
18
18
|
csvOptions?: GridCsvExportOptions & GridExportDisplayOptions;
|
|
19
19
|
printOptions?: GridPrintExportOptions & GridExportDisplayOptions;
|
|
20
|
+
[key: string]: any;
|
|
20
21
|
}
|
|
21
|
-
export declare const GridCsvExportMenuItem: (props: GridCsvExportMenuItemProps) => JSX.Element
|
|
22
|
-
export declare const GridPrintExportMenuItem: (props: GridPrintExportMenuItemProps) => JSX.Element
|
|
23
|
-
declare const GridToolbarExport: React.ForwardRefExoticComponent<Pick<GridToolbarExportProps,
|
|
22
|
+
export declare const GridCsvExportMenuItem: (props: GridCsvExportMenuItemProps) => JSX.Element;
|
|
23
|
+
export declare const GridPrintExportMenuItem: (props: GridPrintExportMenuItemProps) => JSX.Element;
|
|
24
|
+
declare const GridToolbarExport: React.ForwardRefExoticComponent<Pick<GridToolbarExportProps, keyof GridToolbarExportProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
24
25
|
export { GridToolbarExport };
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["csvOptions", "printOptions"];
|
|
3
|
+
const _excluded = ["csvOptions", "printOptions", "excelOptions"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import MenuItem from '@mui/material/MenuItem';
|
|
7
7
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
8
8
|
import { GridToolbarExportContainer } from './GridToolbarExportContainer';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
10
|
export const GridCsvExportMenuItem = props => {
|
|
12
11
|
const apiRef = useGridApiContext();
|
|
13
12
|
const {
|
|
14
13
|
hideMenu,
|
|
15
14
|
options
|
|
16
15
|
} = props;
|
|
17
|
-
|
|
18
|
-
if (options != null && options.disableToolbarButton) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
16
|
return /*#__PURE__*/_jsx(MenuItem, {
|
|
23
17
|
onClick: () => {
|
|
24
18
|
apiRef.current.exportDataAsCsv(options);
|
|
@@ -33,11 +27,6 @@ export const GridPrintExportMenuItem = props => {
|
|
|
33
27
|
hideMenu,
|
|
34
28
|
options
|
|
35
29
|
} = props;
|
|
36
|
-
|
|
37
|
-
if (options != null && options.disableToolbarButton) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
30
|
return /*#__PURE__*/_jsx(MenuItem, {
|
|
42
31
|
onClick: () => {
|
|
43
32
|
apiRef.current.exportDataAsPrint(options);
|
|
@@ -49,21 +38,27 @@ export const GridPrintExportMenuItem = props => {
|
|
|
49
38
|
const GridToolbarExport = /*#__PURE__*/React.forwardRef(function GridToolbarExport(props, ref) {
|
|
50
39
|
const {
|
|
51
40
|
csvOptions = {},
|
|
52
|
-
printOptions = {}
|
|
41
|
+
printOptions = {},
|
|
42
|
+
excelOptions
|
|
53
43
|
} = props,
|
|
54
44
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
55
45
|
|
|
56
|
-
|
|
46
|
+
const apiRef = useGridApiContext();
|
|
47
|
+
const preProcessedButtons = apiRef.current.unstable_applyPipeProcessors('exportMenu', [], {
|
|
48
|
+
excelOptions,
|
|
49
|
+
csvOptions,
|
|
50
|
+
printOptions
|
|
51
|
+
}).sort((a, b) => a.componentName > b.componentName ? 1 : -1);
|
|
52
|
+
|
|
53
|
+
if (preProcessedButtons.length === 0) {
|
|
57
54
|
return null;
|
|
58
55
|
}
|
|
59
56
|
|
|
60
|
-
return /*#__PURE__*/
|
|
57
|
+
return /*#__PURE__*/_jsx(GridToolbarExportContainer, _extends({}, other, {
|
|
61
58
|
ref: ref,
|
|
62
|
-
children:
|
|
63
|
-
|
|
64
|
-
})
|
|
65
|
-
options: printOptions
|
|
66
|
-
})]
|
|
59
|
+
children: preProcessedButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button.component, {
|
|
60
|
+
key: index
|
|
61
|
+
}))
|
|
67
62
|
}));
|
|
68
63
|
});
|
|
69
64
|
process.env.NODE_ENV !== "production" ? GridToolbarExport.propTypes = {
|
|
@@ -10,5 +10,5 @@ export interface GridToolbarFilterButtonProps extends Omit<TooltipProps, 'title'
|
|
|
10
10
|
button?: ButtonProps;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
declare const GridToolbarFilterButton: React.ForwardRefExoticComponent<Pick<GridToolbarFilterButtonProps, "hidden" | "color" | "style" | "open" | "translate" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "classes" | "
|
|
13
|
+
declare const GridToolbarFilterButton: React.ForwardRefExoticComponent<Pick<GridToolbarFilterButtonProps, "hidden" | "color" | "style" | "open" | "translate" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "classes" | "componentsProps" | "components" | "onClose" | "TransitionComponent" | "TransitionProps" | "onOpen" | "placement" | "arrow" | "describeChild" | "disableFocusListener" | "disableHoverListener" | "disableInteractive" | "disableTouchListener" | "enterDelay" | "enterNextDelay" | "enterTouchDelay" | "followCursor" | "leaveDelay" | "leaveTouchDelay" | "PopperComponent" | "PopperProps"> & React.RefAttributes<HTMLButtonElement>>;
|
|
14
14
|
export { GridToolbarFilterButton };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
|
3
|
+
export declare type GridToolbarQuickFilterProps = TextFieldProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Function responsible for parsing text input in an array of independent values for quick filtering.
|
|
6
|
+
* @param {string} input The value entered by the user
|
|
7
|
+
* @returns {any[]} The array of value on which quick filter is applied
|
|
8
|
+
*/
|
|
9
|
+
quickFilterParser?: (input: string) => any[];
|
|
10
|
+
/**
|
|
11
|
+
* The debounce time in milliseconds.
|
|
12
|
+
* @default 500
|
|
13
|
+
*/
|
|
14
|
+
debounceMs?: number;
|
|
15
|
+
};
|
|
16
|
+
declare function GridToolbarQuickFilter(props: GridToolbarQuickFilterProps): JSX.Element;
|
|
17
|
+
declare namespace GridToolbarQuickFilter {
|
|
18
|
+
var propTypes: any;
|
|
19
|
+
}
|
|
20
|
+
export { GridToolbarQuickFilter };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["quickFilterParser", "debounceMs"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import TextField from '@mui/material/TextField';
|
|
7
|
+
import SearchIcon from '@mui/icons-material/Search';
|
|
8
|
+
import { styled } from '@mui/material/styles';
|
|
9
|
+
import { debounce } from '@mui/material/utils';
|
|
10
|
+
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
11
|
+
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const GridToolbarQuickFilterRoot = styled(TextField, {
|
|
14
|
+
name: 'MuiDataGrid',
|
|
15
|
+
slot: 'ToolbarQuickFilter',
|
|
16
|
+
overridesResolver: (props, styles) => styles.toolbarQuickFilter
|
|
17
|
+
})(({
|
|
18
|
+
theme
|
|
19
|
+
}) => ({
|
|
20
|
+
width: 'auto',
|
|
21
|
+
paddingBottom: theme.spacing(0.5),
|
|
22
|
+
'& .MuiSvgIcon-root': {
|
|
23
|
+
marginRight: theme.spacing(0.5)
|
|
24
|
+
},
|
|
25
|
+
'& .MuiInput-underline:before': {
|
|
26
|
+
borderBottom: `1px solid ${theme.palette.divider}`
|
|
27
|
+
}
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
const defaultSearchValueParser = searchText => searchText.split(' ').filter(word => word !== '');
|
|
31
|
+
|
|
32
|
+
function GridToolbarQuickFilter(props) {
|
|
33
|
+
var _rootProps$components;
|
|
34
|
+
|
|
35
|
+
const {
|
|
36
|
+
quickFilterParser = defaultSearchValueParser,
|
|
37
|
+
debounceMs = 500
|
|
38
|
+
} = props,
|
|
39
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
|
+
|
|
41
|
+
const apiRef = useGridApiContext();
|
|
42
|
+
const rootProps = useGridRootProps();
|
|
43
|
+
const [searchValue, setSearchValue] = React.useState('');
|
|
44
|
+
const updateSearchValue = React.useCallback(newSearchValue => {
|
|
45
|
+
apiRef.current.setQuickFilterValues(quickFilterParser(newSearchValue));
|
|
46
|
+
}, [apiRef, quickFilterParser]);
|
|
47
|
+
const debouncedUpdateSearchValue = React.useMemo(() => debounce(updateSearchValue, debounceMs), [updateSearchValue, debounceMs]);
|
|
48
|
+
const handleSearchValueChange = React.useCallback(event => {
|
|
49
|
+
const newSearchValue = event.target.value;
|
|
50
|
+
setSearchValue(newSearchValue);
|
|
51
|
+
debouncedUpdateSearchValue(newSearchValue);
|
|
52
|
+
}, [debouncedUpdateSearchValue]);
|
|
53
|
+
return /*#__PURE__*/_jsx(GridToolbarQuickFilterRoot, _extends({
|
|
54
|
+
as: rootProps.components.BaseTextField,
|
|
55
|
+
variant: "standard",
|
|
56
|
+
value: searchValue,
|
|
57
|
+
onChange: handleSearchValueChange,
|
|
58
|
+
placeholder: apiRef.current.getLocaleText('toolbarQuickFilterPlaceholder'),
|
|
59
|
+
"aria-label": apiRef.current.getLocaleText('toolbarQuickFilterLabel'),
|
|
60
|
+
type: "search",
|
|
61
|
+
InputProps: {
|
|
62
|
+
startAdornment: /*#__PURE__*/_jsx(SearchIcon, {
|
|
63
|
+
fontSize: "small"
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
}, other, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseTextField));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
process.env.NODE_ENV !== "production" ? GridToolbarQuickFilter.propTypes = {
|
|
70
|
+
// ----------------------------- Warning --------------------------------
|
|
71
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
72
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
73
|
+
// ----------------------------------------------------------------------
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The debounce time in milliseconds.
|
|
77
|
+
* @default 500
|
|
78
|
+
*/
|
|
79
|
+
debounceMs: PropTypes.number,
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Function responsible for parsing text input in an array of independent values for quick filtering.
|
|
83
|
+
* @param {string} input The value entered by the user
|
|
84
|
+
* @returns {any[]} The array of value on which quick filter is applied
|
|
85
|
+
*/
|
|
86
|
+
quickFilterParser: PropTypes.func
|
|
87
|
+
} : void 0;
|
|
88
|
+
export { GridToolbarQuickFilter };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './GridToolbar';
|
|
2
2
|
export * from './GridToolbarColumnsButton';
|
|
3
3
|
export * from './GridToolbarDensitySelector';
|
|
4
|
-
export
|
|
4
|
+
export type { GridExportDisplayOptions, GridExportMenuItemProps, GridCsvExportMenuItemProps, GridPrintExportMenuItemProps, } from './GridToolbarExport';
|
|
5
|
+
export { GridCsvExportMenuItem, GridPrintExportMenuItem, GridToolbarExport, } from './GridToolbarExport';
|
|
5
6
|
export * from './GridToolbarFilterButton';
|
|
6
7
|
export * from './GridToolbarExportContainer';
|
|
8
|
+
export * from './GridToolbarQuickFilter';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './GridToolbar';
|
|
2
2
|
export * from './GridToolbarColumnsButton';
|
|
3
3
|
export * from './GridToolbarDensitySelector';
|
|
4
|
-
export
|
|
4
|
+
export { GridCsvExportMenuItem, GridPrintExportMenuItem, GridToolbarExport } from './GridToolbarExport';
|
|
5
5
|
export * from './GridToolbarFilterButton';
|
|
6
|
-
export * from './GridToolbarExportContainer';
|
|
6
|
+
export * from './GridToolbarExportContainer';
|
|
7
|
+
export * from './GridToolbarQuickFilter';
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
declare const GridVirtualScroller: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
sx?: SxProps<Theme> | undefined;
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
3
6
|
export { GridVirtualScroller };
|
|
@@ -25,6 +25,8 @@ const VirtualScrollerRoot = styled('div', {
|
|
|
25
25
|
overridesResolver: (props, styles) => styles.virtualScroller
|
|
26
26
|
})({
|
|
27
27
|
overflow: 'auto',
|
|
28
|
+
// See https://github.com/mui/mui-x/issues/4360
|
|
29
|
+
position: 'relative',
|
|
28
30
|
'@media print': {
|
|
29
31
|
overflow: 'hidden'
|
|
30
32
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
declare const GridVirtualScrollerContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
sx?: SxProps<Theme> | undefined;
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
3
6
|
export { GridVirtualScrollerContent };
|
|
@@ -24,9 +24,7 @@ const VirtualScrollerContentRoot = styled('div', {
|
|
|
24
24
|
name: 'MuiDataGrid',
|
|
25
25
|
slot: 'VirtualScrollerContent',
|
|
26
26
|
overridesResolver: (props, styles) => styles.virtualScrollerContent
|
|
27
|
-
})({
|
|
28
|
-
position: 'relative'
|
|
29
|
-
});
|
|
27
|
+
})({});
|
|
30
28
|
const GridVirtualScrollerContent = /*#__PURE__*/React.forwardRef(function GridVirtualScrollerContent(props, ref) {
|
|
31
29
|
const {
|
|
32
30
|
className,
|