@mui/x-data-grid 8.0.0-alpha.7 → 8.0.0-alpha.9
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 +551 -3
- package/DataGrid/DataGrid.js +4 -5
- package/DataGrid/useDataGridComponent.d.ts +2 -1
- package/DataGrid/useDataGridComponent.js +1 -1
- package/components/GridApiContext.js +2 -0
- package/components/GridConfigurationContext.js +2 -0
- package/components/GridHeaders.js +2 -2
- package/components/GridRow.d.ts +5 -9
- package/components/GridRow.js +28 -78
- package/components/GridScrollArea.js +2 -0
- package/components/GridSkeletonLoadingOverlay.js +18 -18
- package/components/cell/GridCell.d.ts +9 -16
- package/components/cell/GridCell.js +17 -35
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -5
- package/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +3 -3
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +20 -6
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -5
- package/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
- package/components/containers/GridRoot.d.ts +2 -2
- package/components/containers/GridRoot.js +14 -6
- package/components/containers/GridRootStyles.js +7 -0
- package/components/panel/GridPanel.js +2 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +32 -29
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -0
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -0
- package/components/panel/filterPanel/GridFilterInputValue.js +34 -28
- package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +2 -1
- package/components/toolbar/GridToolbarColumnsButton.js +6 -1
- package/components/toolbar/GridToolbarFilterButton.js +6 -1
- package/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/components/virtualization/GridVirtualScroller.js +4 -4
- package/constants/gridClasses.d.ts +12 -0
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +1 -0
- package/context/GridContextProvider.d.ts +2 -1
- package/context/GridRootPropsContext.js +2 -0
- package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +2 -2
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +2 -2
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +2 -2
- package/hooks/core/useGridApiInitialization.d.ts +2 -2
- package/hooks/core/useGridInitialization.d.ts +2 -2
- package/hooks/core/useGridIsRtl.d.ts +2 -2
- package/hooks/core/useGridLocaleText.d.ts +2 -2
- package/hooks/core/useGridLoggerFactory.d.ts +2 -2
- package/hooks/core/useGridRefs.d.ts +2 -2
- package/hooks/core/useGridStateInitialization.d.ts +2 -2
- package/hooks/features/clipboard/useGridClipboard.d.ts +2 -2
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +2 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +5 -7
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
- package/hooks/features/columnMenu/useGridColumnMenu.d.ts +2 -2
- package/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/hooks/features/columnResize/useGridColumnResize.d.ts +2 -2
- package/hooks/features/columns/gridColumnsUtils.d.ts +4 -4
- package/hooks/features/columns/useGridColumnSpanning.d.ts +2 -2
- package/hooks/features/columns/useGridColumns.d.ts +2 -2
- package/hooks/features/density/useGridDensity.d.ts +2 -2
- package/hooks/features/dimensions/useGridDimensions.d.ts +2 -2
- package/hooks/features/dimensions/useGridDimensions.js +1 -3
- package/hooks/features/editing/useGridCellEditing.d.ts +2 -2
- package/hooks/features/editing/useGridCellEditing.js +1 -1
- package/hooks/features/editing/useGridEditing.d.ts +2 -2
- package/hooks/features/editing/useGridRowEditing.d.ts +2 -2
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/events/useGridEvents.d.ts +2 -2
- package/hooks/features/export/serializers/csvSerializer.d.ts +2 -1
- package/hooks/features/export/useGridCsvExport.d.ts +2 -2
- package/hooks/features/export/useGridPrintExport.d.ts +2 -2
- package/hooks/features/export/utils.d.ts +2 -2
- package/hooks/features/filter/gridFilterSelector.d.ts +1 -1
- package/hooks/features/filter/gridFilterSelector.js +6 -1
- package/hooks/features/filter/gridFilterUtils.d.ts +7 -7
- package/hooks/features/filter/gridFilterUtils.js +3 -3
- package/hooks/features/filter/useGridFilter.d.ts +2 -2
- package/hooks/features/focus/useGridFocus.d.ts +2 -2
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +2 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +2 -2
- package/hooks/features/keyboardNavigation/utils.d.ts +3 -3
- package/hooks/features/listView/useGridListView.d.ts +2 -2
- package/hooks/features/pagination/gridPaginationInterfaces.d.ts +3 -0
- package/hooks/features/pagination/gridPaginationSelector.d.ts +21 -2
- package/hooks/features/pagination/gridPaginationSelector.js +39 -1
- package/hooks/features/pagination/useGridPagination.d.ts +3 -3
- package/hooks/features/pagination/useGridPagination.js +5 -3
- package/hooks/features/pagination/useGridPaginationMeta.d.ts +2 -2
- package/hooks/features/pagination/useGridPaginationModel.d.ts +2 -2
- package/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/hooks/features/pagination/useGridRowCount.d.ts +2 -2
- package/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +1 -0
- package/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
- package/hooks/features/preferencesPanel/index.d.ts +1 -1
- package/hooks/features/preferencesPanel/index.js +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +2 -2
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +2 -2
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +2 -2
- package/hooks/features/rowSelection/utils.d.ts +3 -2
- package/hooks/features/rows/gridRowSpanningUtils.d.ts +2 -2
- package/hooks/features/rows/gridRowsSelector.js +1 -1
- package/hooks/features/rows/gridRowsUtils.d.ts +4 -4
- package/hooks/features/rows/useGridParamsApi.d.ts +2 -2
- package/hooks/features/rows/useGridRowSpanning.d.ts +2 -2
- package/hooks/features/rows/useGridRows.d.ts +2 -2
- package/hooks/features/rows/useGridRows.js +2 -2
- package/hooks/features/rows/useGridRowsMeta.d.ts +2 -2
- package/hooks/features/rows/useGridRowsPreProcessors.d.ts +2 -2
- package/hooks/features/scroll/useGridScroll.d.ts +2 -2
- package/hooks/features/sorting/gridSortingUtils.d.ts +3 -3
- package/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/hooks/features/sorting/useGridSorting.d.ts +2 -2
- package/hooks/features/statePersistence/useGridStatePersistence.d.ts +2 -2
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +6 -0
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +2 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +92 -50
- package/hooks/features/virtualization/useGridVirtualization.d.ts +2 -2
- package/hooks/utils/useGridApiContext.d.ts +2 -2
- package/hooks/utils/useGridApiEventHandler.d.ts +4 -4
- package/hooks/utils/useGridApiMethod.d.ts +2 -2
- package/hooks/utils/useGridApiRef.d.ts +2 -2
- package/hooks/utils/useGridApiRef.js +3 -1
- package/hooks/utils/useGridInitializeState.d.ts +3 -3
- package/hooks/utils/useGridLogger.d.ts +2 -2
- package/hooks/utils/useGridNativeEventListener.d.ts +2 -1
- package/hooks/utils/useGridPrivateApiContext.d.ts +2 -1
- package/hooks/utils/useGridSelector.d.ts +2 -2
- package/hooks/utils/useGridVisibleRows.d.ts +8 -6
- package/hooks/utils/useGridVisibleRows.js +5 -28
- package/index.js +1 -1
- package/internals/constants.d.ts +6 -0
- package/internals/constants.js +8 -1
- package/internals/index.d.ts +1 -0
- package/internals/index.js +1 -0
- package/internals/utils/attachPinnedStyle.d.ts +2 -0
- package/internals/utils/attachPinnedStyle.js +9 -0
- package/internals/utils/getPinnedCellOffset.d.ts +3 -3
- package/internals/utils/getPinnedCellOffset.js +6 -7
- package/internals/utils/index.d.ts +1 -0
- package/internals/utils/index.js +2 -1
- package/locales/arSD.js +2 -0
- package/locales/beBY.js +1 -0
- package/locales/bgBG.js +2 -0
- package/locales/csCZ.js +2 -0
- package/locales/daDK.js +2 -0
- package/locales/deDE.js +2 -0
- package/locales/elGR.js +2 -0
- package/locales/esES.js +2 -0
- package/locales/faIR.js +7 -6
- package/locales/fiFI.js +2 -0
- package/locales/frFR.js +2 -0
- package/locales/heIL.js +2 -0
- package/locales/hrHR.js +2 -0
- package/locales/huHU.js +2 -0
- package/locales/isIS.js +2 -0
- package/locales/itIT.js +2 -0
- package/locales/jaJP.js +2 -0
- package/locales/koKR.js +2 -0
- package/locales/nbNO.js +2 -0
- package/locales/nlNL.js +2 -0
- package/locales/nnNO.js +2 -0
- package/locales/plPL.js +2 -0
- package/locales/ptBR.js +2 -0
- package/locales/ptPT.js +2 -0
- package/locales/roRO.js +2 -0
- package/locales/ruRU.js +2 -0
- package/locales/skSK.js +2 -0
- package/locales/svSE.js +2 -0
- package/locales/trTR.js +2 -0
- package/locales/ukUA.js +2 -0
- package/locales/urPK.js +11 -10
- package/locales/viVN.js +2 -0
- package/locales/zhCN.js +2 -0
- package/locales/zhHK.js +2 -0
- package/locales/zhTW.js +2 -0
- package/material/index.js +2 -1
- package/models/api/gridLocaleTextApi.d.ts +1 -0
- package/models/colDef/gridColDef.d.ts +9 -8
- package/models/events/gridEventLookup.d.ts +6 -1
- package/models/gridExport.d.ts +2 -2
- package/models/gridFilterOperator.d.ts +2 -1
- package/models/gridIconSlotsComponent.d.ts +5 -0
- package/models/gridStateCommunity.d.ts +4 -0
- package/models/props/DataGridProps.d.ts +2 -1
- package/modern/DataGrid/DataGrid.js +4 -5
- package/modern/DataGrid/useDataGridComponent.js +1 -1
- package/modern/components/GridApiContext.js +2 -0
- package/modern/components/GridConfigurationContext.js +2 -0
- package/modern/components/GridHeaders.js +2 -2
- package/modern/components/GridRow.js +28 -78
- package/modern/components/GridScrollArea.js +2 -0
- package/modern/components/GridSkeletonLoadingOverlay.js +18 -18
- package/modern/components/cell/GridCell.js +17 -35
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +20 -6
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
- package/modern/components/containers/GridRoot.js +14 -6
- package/modern/components/containers/GridRootStyles.js +7 -0
- package/modern/components/panel/GridPanel.js +2 -1
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +32 -29
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +34 -28
- package/modern/components/toolbar/GridToolbarColumnsButton.js +6 -1
- package/modern/components/toolbar/GridToolbarFilterButton.js +6 -1
- package/modern/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/modern/components/virtualization/GridVirtualScroller.js +4 -4
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +1 -0
- package/modern/context/GridRootPropsContext.js +2 -0
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +1 -3
- package/modern/hooks/features/editing/useGridCellEditing.js +1 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
- package/modern/hooks/features/filter/gridFilterSelector.js +6 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +3 -3
- package/modern/hooks/features/pagination/gridPaginationSelector.js +39 -1
- package/modern/hooks/features/pagination/useGridPagination.js +5 -3
- package/modern/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/modern/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
- package/modern/hooks/features/preferencesPanel/index.js +1 -1
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/modern/hooks/features/rows/gridRowsSelector.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +2 -2
- package/modern/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/modern/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +92 -50
- package/modern/hooks/utils/useGridApiRef.js +3 -1
- package/modern/hooks/utils/useGridVisibleRows.js +5 -28
- package/modern/index.js +1 -1
- package/modern/internals/constants.js +8 -1
- package/modern/internals/index.js +1 -0
- package/modern/internals/utils/attachPinnedStyle.js +9 -0
- package/modern/internals/utils/getPinnedCellOffset.js +6 -7
- package/modern/internals/utils/index.js +2 -1
- package/modern/locales/arSD.js +2 -0
- package/modern/locales/beBY.js +1 -0
- package/modern/locales/bgBG.js +2 -0
- package/modern/locales/csCZ.js +2 -0
- package/modern/locales/daDK.js +2 -0
- package/modern/locales/deDE.js +2 -0
- package/modern/locales/elGR.js +2 -0
- package/modern/locales/esES.js +2 -0
- package/modern/locales/faIR.js +7 -6
- package/modern/locales/fiFI.js +2 -0
- package/modern/locales/frFR.js +2 -0
- package/modern/locales/heIL.js +2 -0
- package/modern/locales/hrHR.js +2 -0
- package/modern/locales/huHU.js +2 -0
- package/modern/locales/isIS.js +2 -0
- package/modern/locales/itIT.js +2 -0
- package/modern/locales/jaJP.js +2 -0
- package/modern/locales/koKR.js +2 -0
- package/modern/locales/nbNO.js +2 -0
- package/modern/locales/nlNL.js +2 -0
- package/modern/locales/nnNO.js +2 -0
- package/modern/locales/plPL.js +2 -0
- package/modern/locales/ptBR.js +2 -0
- package/modern/locales/ptPT.js +2 -0
- package/modern/locales/roRO.js +2 -0
- package/modern/locales/ruRU.js +2 -0
- package/modern/locales/skSK.js +2 -0
- package/modern/locales/svSE.js +2 -0
- package/modern/locales/trTR.js +2 -0
- package/modern/locales/ukUA.js +2 -0
- package/modern/locales/urPK.js +11 -10
- package/modern/locales/viVN.js +2 -0
- package/modern/locales/zhCN.js +2 -0
- package/modern/locales/zhHK.js +2 -0
- package/modern/locales/zhTW.js +2 -0
- package/modern/material/index.js +2 -1
- package/modern/utils/cellBorderUtils.js +5 -5
- package/modern/utils/domUtils.js +7 -2
- package/modern/utils/isJSDOM.js +1 -0
- package/modern/utils/rtlFlipSide.js +22 -0
- package/node/DataGrid/DataGrid.js +2 -3
- package/node/DataGrid/useDataGridComponent.js +1 -1
- package/node/components/GridApiContext.js +1 -0
- package/node/components/GridConfigurationContext.js +1 -0
- package/node/components/GridHeaders.js +2 -2
- package/node/components/GridRow.js +26 -77
- package/node/components/GridScrollArea.js +1 -0
- package/node/components/GridSkeletonLoadingOverlay.js +17 -17
- package/node/components/cell/GridCell.js +18 -36
- package/node/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +19 -5
- package/node/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/node/components/containers/GridRoot.js +14 -6
- package/node/components/containers/GridRootStyles.js +7 -0
- package/node/components/panel/GridPanel.js +2 -1
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
- package/node/components/panel/filterPanel/GridFilterInputDate.js +31 -28
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
- package/node/components/panel/filterPanel/GridFilterInputValue.js +33 -27
- package/node/components/toolbar/GridToolbarColumnsButton.js +6 -1
- package/node/components/toolbar/GridToolbarFilterButton.js +6 -1
- package/node/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/node/components/virtualization/GridVirtualScroller.js +4 -4
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +1 -0
- package/node/context/GridRootPropsContext.js +1 -0
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +32 -74
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/node/hooks/features/dimensions/useGridDimensions.js +3 -5
- package/node/hooks/features/editing/useGridCellEditing.js +1 -1
- package/node/hooks/features/editing/useGridRowEditing.js +1 -1
- package/node/hooks/features/filter/gridFilterSelector.js +6 -1
- package/node/hooks/features/filter/gridFilterUtils.js +3 -3
- package/node/hooks/features/pagination/gridPaginationSelector.js +41 -3
- package/node/hooks/features/pagination/useGridPagination.js +5 -3
- package/node/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/node/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +9 -2
- package/node/hooks/features/preferencesPanel/index.js +11 -10
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/node/hooks/features/rows/gridRowsSelector.js +1 -1
- package/node/hooks/features/rows/useGridRows.js +1 -1
- package/node/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/node/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +49 -0
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +94 -52
- package/node/hooks/utils/useGridApiRef.js +3 -1
- package/node/hooks/utils/useGridVisibleRows.js +3 -28
- package/node/index.js +1 -1
- package/node/internals/constants.js +9 -2
- package/node/internals/index.js +12 -0
- package/node/internals/utils/attachPinnedStyle.js +15 -0
- package/node/internals/utils/getPinnedCellOffset.js +6 -7
- package/node/internals/utils/index.js +11 -0
- package/node/locales/arSD.js +2 -0
- package/node/locales/beBY.js +1 -0
- package/node/locales/bgBG.js +2 -0
- package/node/locales/csCZ.js +2 -0
- package/node/locales/daDK.js +2 -0
- package/node/locales/deDE.js +2 -0
- package/node/locales/elGR.js +2 -0
- package/node/locales/esES.js +2 -0
- package/node/locales/faIR.js +7 -6
- package/node/locales/fiFI.js +2 -0
- package/node/locales/frFR.js +2 -0
- package/node/locales/heIL.js +2 -0
- package/node/locales/hrHR.js +2 -0
- package/node/locales/huHU.js +2 -0
- package/node/locales/isIS.js +2 -0
- package/node/locales/itIT.js +2 -0
- package/node/locales/jaJP.js +2 -0
- package/node/locales/koKR.js +2 -0
- package/node/locales/nbNO.js +2 -0
- package/node/locales/nlNL.js +2 -0
- package/node/locales/nnNO.js +2 -0
- package/node/locales/plPL.js +2 -0
- package/node/locales/ptBR.js +2 -0
- package/node/locales/ptPT.js +2 -0
- package/node/locales/roRO.js +2 -0
- package/node/locales/ruRU.js +2 -0
- package/node/locales/skSK.js +2 -0
- package/node/locales/svSE.js +2 -0
- package/node/locales/trTR.js +2 -0
- package/node/locales/ukUA.js +2 -0
- package/node/locales/urPK.js +11 -10
- package/node/locales/viVN.js +2 -0
- package/node/locales/zhCN.js +2 -0
- package/node/locales/zhHK.js +2 -0
- package/node/locales/zhTW.js +2 -0
- package/node/material/index.js +2 -1
- package/node/utils/cellBorderUtils.js +5 -5
- package/node/utils/domUtils.js +7 -2
- package/node/utils/isJSDOM.js +7 -0
- package/node/utils/rtlFlipSide.js +29 -0
- package/package.json +2 -2
- package/utils/cellBorderUtils.d.ts +3 -3
- package/utils/cellBorderUtils.js +5 -5
- package/utils/createSelector.d.ts +2 -2
- package/utils/domUtils.js +7 -2
- package/utils/getPublicApiRef.d.ts +2 -1
- package/utils/isJSDOM.d.ts +1 -0
- package/utils/isJSDOM.js +1 -0
- package/utils/rtlFlipSide.d.ts +2 -0
- package/utils/rtlFlipSide.js +22 -0
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils';
|
|
5
5
|
import { useGridSelector } from "../../hooks/index.js";
|
|
6
|
-
import { gridPreferencePanelStateSelector } from "../../hooks/features/preferencesPanel/gridPreferencePanelSelector.js";
|
|
6
|
+
import { gridPreferencePanelSelectorWithLabel, gridPreferencePanelStateSelector } from "../../hooks/features/preferencesPanel/gridPreferencePanelSelector.js";
|
|
7
7
|
import { GridPreferencePanelsValue } from "../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js";
|
|
8
8
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
9
9
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
@@ -19,6 +19,21 @@ const useUtilityClasses = ownerState => {
|
|
|
19
19
|
};
|
|
20
20
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
21
21
|
};
|
|
22
|
+
function GridColumnHeaderFilterIconButtonWrapped(props) {
|
|
23
|
+
if (!props.counter) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/_jsx(GridColumnHeaderFilterIconButton, _extends({}, props));
|
|
27
|
+
}
|
|
28
|
+
process.env.NODE_ENV !== "production" ? GridColumnHeaderFilterIconButtonWrapped.propTypes = {
|
|
29
|
+
// ----------------------------- Warning --------------------------------
|
|
30
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
31
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
32
|
+
// ----------------------------------------------------------------------
|
|
33
|
+
counter: PropTypes.number,
|
|
34
|
+
field: PropTypes.string.isRequired,
|
|
35
|
+
onClick: PropTypes.func
|
|
36
|
+
} : void 0;
|
|
22
37
|
function GridColumnHeaderFilterIconButton(props) {
|
|
23
38
|
const {
|
|
24
39
|
counter,
|
|
@@ -31,8 +46,8 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
31
46
|
classes: rootProps.classes
|
|
32
47
|
});
|
|
33
48
|
const classes = useUtilityClasses(ownerState);
|
|
34
|
-
const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
35
49
|
const labelId = useId();
|
|
50
|
+
const isOpen = useGridSelector(apiRef, gridPreferencePanelSelectorWithLabel, labelId);
|
|
36
51
|
const panelId = useId();
|
|
37
52
|
const toggleFilter = React.useCallback(event => {
|
|
38
53
|
event.preventDefault();
|
|
@@ -53,7 +68,6 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
53
68
|
if (!counter) {
|
|
54
69
|
return null;
|
|
55
70
|
}
|
|
56
|
-
const open = preferencePanel.open && preferencePanel.labelId === labelId;
|
|
57
71
|
const iconButton = /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
58
72
|
id: labelId,
|
|
59
73
|
onClick: toggleFilter,
|
|
@@ -61,8 +75,8 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
61
75
|
size: "small",
|
|
62
76
|
tabIndex: -1,
|
|
63
77
|
"aria-haspopup": "menu",
|
|
64
|
-
"aria-expanded":
|
|
65
|
-
"aria-controls":
|
|
78
|
+
"aria-expanded": isOpen,
|
|
79
|
+
"aria-controls": isOpen ? panelId : undefined
|
|
66
80
|
}, rootProps.slotProps?.baseIconButton, {
|
|
67
81
|
children: /*#__PURE__*/_jsx(rootProps.slots.columnFilteredIcon, {
|
|
68
82
|
className: classes.icon,
|
|
@@ -91,4 +105,4 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaderFilterIconButton.propTyp
|
|
|
91
105
|
field: PropTypes.string.isRequired,
|
|
92
106
|
onClick: PropTypes.func
|
|
93
107
|
} : void 0;
|
|
94
|
-
export { GridColumnHeaderFilterIconButton };
|
|
108
|
+
export { GridColumnHeaderFilterIconButtonWrapped as GridColumnHeaderFilterIconButton };
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { GridStateColDef } from '../../models/colDef/gridColDef';
|
|
3
3
|
import { GridSortDirection } from '../../models/gridSortModel';
|
|
4
4
|
import { GridColumnHeaderSeparatorProps } from './GridColumnHeaderSeparator';
|
|
5
|
-
import {
|
|
5
|
+
import { PinnedColumnPosition } from '../../internals/constants';
|
|
6
6
|
interface GridColumnHeaderItemProps {
|
|
7
7
|
colIndex: number;
|
|
8
8
|
colDef: GridStateColDef;
|
|
@@ -18,13 +18,13 @@ interface GridColumnHeaderItemProps {
|
|
|
18
18
|
tabIndex: 0 | -1;
|
|
19
19
|
disableReorder?: boolean;
|
|
20
20
|
separatorSide?: GridColumnHeaderSeparatorProps['side'];
|
|
21
|
-
pinnedPosition?:
|
|
21
|
+
pinnedPosition?: PinnedColumnPosition;
|
|
22
|
+
pinnedOffset?: number;
|
|
22
23
|
style?: React.CSSProperties;
|
|
23
|
-
indexInSection: number;
|
|
24
|
-
sectionLength: number;
|
|
25
|
-
gridHasFiller: boolean;
|
|
26
24
|
isLastUnpinned: boolean;
|
|
27
25
|
isSiblingFocused: boolean;
|
|
26
|
+
showLeftBorder: boolean;
|
|
27
|
+
showRightBorder: boolean;
|
|
28
28
|
}
|
|
29
29
|
declare function GridColumnHeaderItem(props: GridColumnHeaderItemProps): React.JSX.Element;
|
|
30
30
|
declare namespace GridColumnHeaderItem {
|
|
@@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils';
|
|
6
6
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
7
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
7
8
|
import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.js";
|
|
8
9
|
import { ColumnHeaderMenuIcon } from "./ColumnHeaderMenuIcon.js";
|
|
9
10
|
import { GridColumnHeaderMenu } from "../menu/columnMenu/GridColumnHeaderMenu.js";
|
|
@@ -11,7 +12,8 @@ import { gridClasses, getDataGridUtilityClass } from "../../constants/gridClasse
|
|
|
11
12
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
12
13
|
import { GridGenericColumnHeaderItem } from "./GridGenericColumnHeaderItem.js";
|
|
13
14
|
import { isEventTargetInPortal } from "../../utils/domUtils.js";
|
|
14
|
-
import {
|
|
15
|
+
import { PinnedColumnPosition } from "../../internals/constants.js";
|
|
16
|
+
import { attachPinnedStyle } from "../../internals/utils/index.js";
|
|
15
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
18
|
const useUtilityClasses = ownerState => {
|
|
17
19
|
const {
|
|
@@ -31,7 +33,7 @@ const useUtilityClasses = ownerState => {
|
|
|
31
33
|
// todo refactor to a prop on col isNumeric or ?? ie: coltype===price wont work
|
|
32
34
|
const isColumnNumeric = colDef.type === 'number';
|
|
33
35
|
const slots = {
|
|
34
|
-
root: ['columnHeader', colDef.headerAlign === 'left' && 'columnHeader--alignLeft', colDef.headerAlign === 'center' && 'columnHeader--alignCenter', colDef.headerAlign === 'right' && 'columnHeader--alignRight', colDef.sortable && 'columnHeader--sortable', isDragging && 'columnHeader--moving', isColumnSorted && 'columnHeader--sorted', isColumnFiltered && 'columnHeader--filtered', isColumnNumeric && 'columnHeader--numeric', 'withBorderColor', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', pinnedPosition ===
|
|
36
|
+
root: ['columnHeader', colDef.headerAlign === 'left' && 'columnHeader--alignLeft', colDef.headerAlign === 'center' && 'columnHeader--alignCenter', colDef.headerAlign === 'right' && 'columnHeader--alignRight', colDef.sortable && 'columnHeader--sortable', isDragging && 'columnHeader--moving', isColumnSorted && 'columnHeader--sorted', isColumnFiltered && 'columnHeader--filtered', isColumnNumeric && 'columnHeader--numeric', 'withBorderColor', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', pinnedPosition === PinnedColumnPosition.LEFT && 'columnHeader--pinnedLeft', pinnedPosition === PinnedColumnPosition.RIGHT && 'columnHeader--pinnedRight',
|
|
35
37
|
// TODO: Remove classes below and restore `:has` selectors when they are supported in jsdom
|
|
36
38
|
// See https://github.com/mui/mui-x/pull/14559
|
|
37
39
|
isLastUnpinned && 'columnHeader--lastUnpinned', isSiblingFocused && 'columnHeader--siblingFocused'],
|
|
@@ -56,14 +58,14 @@ function GridColumnHeaderItem(props) {
|
|
|
56
58
|
tabIndex,
|
|
57
59
|
disableReorder,
|
|
58
60
|
separatorSide,
|
|
59
|
-
|
|
61
|
+
showLeftBorder,
|
|
62
|
+
showRightBorder,
|
|
60
63
|
pinnedPosition,
|
|
61
|
-
|
|
62
|
-
sectionLength,
|
|
63
|
-
gridHasFiller
|
|
64
|
+
pinnedOffset
|
|
64
65
|
} = props;
|
|
65
66
|
const apiRef = useGridPrivateApiContext();
|
|
66
67
|
const rootProps = useGridRootProps();
|
|
68
|
+
const isRtl = useRtl();
|
|
67
69
|
const headerCellRef = React.useRef(null);
|
|
68
70
|
const columnMenuId = useId();
|
|
69
71
|
const columnMenuButtonId = useId();
|
|
@@ -74,8 +76,6 @@ function GridColumnHeaderItem(props) {
|
|
|
74
76
|
if (colDef.renderHeader) {
|
|
75
77
|
headerComponent = colDef.renderHeader(apiRef.current.getColumnHeaderParams(colDef.field));
|
|
76
78
|
}
|
|
77
|
-
const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
|
|
78
|
-
const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showColumnVerticalBorder, gridHasFiller);
|
|
79
79
|
const ownerState = _extends({}, props, {
|
|
80
80
|
classes: rootProps.classes,
|
|
81
81
|
showRightBorder,
|
|
@@ -171,6 +171,7 @@ function GridColumnHeaderItem(props) {
|
|
|
171
171
|
colDef
|
|
172
172
|
}) : colDef.headerClassName;
|
|
173
173
|
const label = colDef.headerName ?? colDef.field;
|
|
174
|
+
const style = React.useMemo(() => attachPinnedStyle(_extends({}, props.style), isRtl, pinnedPosition, pinnedOffset), [pinnedPosition, pinnedOffset, props.style, isRtl]);
|
|
174
175
|
return /*#__PURE__*/_jsx(GridGenericColumnHeaderItem, _extends({
|
|
175
176
|
ref: headerCellRef,
|
|
176
177
|
classes: classes,
|
|
@@ -209,18 +210,18 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaderItem.propTypes = {
|
|
|
209
210
|
columnMenuOpen: PropTypes.bool.isRequired,
|
|
210
211
|
disableReorder: PropTypes.bool,
|
|
211
212
|
filterItemsCounter: PropTypes.number,
|
|
212
|
-
gridHasFiller: PropTypes.bool.isRequired,
|
|
213
213
|
hasFocus: PropTypes.bool,
|
|
214
214
|
headerHeight: PropTypes.number.isRequired,
|
|
215
|
-
indexInSection: PropTypes.number.isRequired,
|
|
216
215
|
isDragging: PropTypes.bool.isRequired,
|
|
217
216
|
isLast: PropTypes.bool.isRequired,
|
|
218
217
|
isLastUnpinned: PropTypes.bool.isRequired,
|
|
219
218
|
isResizing: PropTypes.bool.isRequired,
|
|
220
219
|
isSiblingFocused: PropTypes.bool.isRequired,
|
|
221
|
-
|
|
222
|
-
|
|
220
|
+
pinnedOffset: PropTypes.number,
|
|
221
|
+
pinnedPosition: PropTypes.oneOf([0, 1, 2, 3]),
|
|
223
222
|
separatorSide: PropTypes.oneOf(['left', 'right']),
|
|
223
|
+
showLeftBorder: PropTypes.bool.isRequired,
|
|
224
|
+
showRightBorder: PropTypes.bool.isRequired,
|
|
224
225
|
sortDirection: PropTypes.oneOf(['asc', 'desc']),
|
|
225
226
|
sortIndex: PropTypes.number,
|
|
226
227
|
style: PropTypes.object,
|
|
@@ -8,7 +8,7 @@ import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
|
8
8
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
9
9
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
10
10
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
11
|
-
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
11
|
+
import { objectShallowCompare, useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
12
12
|
import { getCheckboxPropsSelector } from "../../hooks/features/rowSelection/utils.js";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
const useUtilityClasses = ownerState => {
|
|
@@ -76,7 +76,7 @@ const GridCellCheckboxForwardRef = forwardRef(function GridCellCheckboxRenderer(
|
|
|
76
76
|
const {
|
|
77
77
|
isIndeterminate,
|
|
78
78
|
isChecked
|
|
79
|
-
} = useGridSelector(apiRef, checkboxPropsSelector);
|
|
79
|
+
} = useGridSelector(apiRef, checkboxPropsSelector, undefined, objectShallowCompare);
|
|
80
80
|
if (rowNode.type === 'footer' || rowNode.type === 'pinnedRow') {
|
|
81
81
|
return null;
|
|
82
82
|
}
|
|
@@ -7,5 +7,5 @@ export interface GridRootProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
*/
|
|
8
8
|
sx?: SxProps<Theme>;
|
|
9
9
|
}
|
|
10
|
-
declare const
|
|
11
|
-
export { GridRoot };
|
|
10
|
+
declare const MemoizedGridRoot: React.ForwardRefExoticComponent<GridRootProps> | React.ForwardRefExoticComponent<GridRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export { MemoizedGridRoot as GridRoot };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["className"];
|
|
3
|
+
const _excluded = ["className", "children"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_useForkRef as useForkRef, unstable_useEnhancedEffect as useEnhancedEffect, unstable_capitalize as capitalize, unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
+
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
8
9
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
9
10
|
import { GridRootStyles } from "./GridRootStyles.js";
|
|
10
11
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
@@ -12,7 +13,9 @@ import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiCon
|
|
|
12
13
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
13
14
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
14
15
|
import { gridDensitySelector } from "../../hooks/features/density/densitySelector.js";
|
|
15
|
-
import {
|
|
16
|
+
import { GridHeader } from "../GridHeader.js";
|
|
17
|
+
import { GridBody, GridFooterPlaceholder } from "../base/index.js";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
19
|
const useUtilityClasses = (ownerState, density) => {
|
|
17
20
|
const {
|
|
18
21
|
autoHeight,
|
|
@@ -27,7 +30,8 @@ const useUtilityClasses = (ownerState, density) => {
|
|
|
27
30
|
const GridRoot = forwardRef(function GridRoot(props, ref) {
|
|
28
31
|
const rootProps = useGridRootProps();
|
|
29
32
|
const {
|
|
30
|
-
className
|
|
33
|
+
className,
|
|
34
|
+
children
|
|
31
35
|
} = props,
|
|
32
36
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
33
37
|
const apiRef = useGridPrivateApiContext();
|
|
@@ -45,11 +49,14 @@ const GridRoot = forwardRef(function GridRoot(props, ref) {
|
|
|
45
49
|
if (!mountedState) {
|
|
46
50
|
return null;
|
|
47
51
|
}
|
|
48
|
-
return /*#__PURE__*/
|
|
52
|
+
return /*#__PURE__*/_jsxs(GridRootStyles, _extends({
|
|
49
53
|
className: clsx(classes.root, className),
|
|
50
54
|
ownerState: ownerState
|
|
51
55
|
}, other, {
|
|
52
|
-
ref: handleRef
|
|
56
|
+
ref: handleRef,
|
|
57
|
+
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
|
|
58
|
+
children: children
|
|
59
|
+
}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
53
60
|
}));
|
|
54
61
|
});
|
|
55
62
|
process.env.NODE_ENV !== "production" ? GridRoot.propTypes = {
|
|
@@ -62,4 +69,5 @@ process.env.NODE_ENV !== "production" ? GridRoot.propTypes = {
|
|
|
62
69
|
*/
|
|
63
70
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
64
71
|
} : void 0;
|
|
65
|
-
|
|
72
|
+
const MemoizedGridRoot = fastMemo(GridRoot);
|
|
73
|
+
export { MemoizedGridRoot as GridRoot };
|
|
@@ -331,6 +331,13 @@ export const GridRootStyles = styled('div', {
|
|
|
331
331
|
display: 'flex',
|
|
332
332
|
alignItems: 'center'
|
|
333
333
|
},
|
|
334
|
+
[`& .${c['columnHeader--filter']}`]: {
|
|
335
|
+
paddingTop: 8,
|
|
336
|
+
paddingBottom: 8,
|
|
337
|
+
paddingRight: 5,
|
|
338
|
+
minHeight: 'min-content',
|
|
339
|
+
overflow: 'hidden'
|
|
340
|
+
},
|
|
334
341
|
[`& .${c['virtualScroller--hasScrollX']} .${c['columnHeader--last']}`]: {
|
|
335
342
|
overflow: 'hidden'
|
|
336
343
|
},
|
|
@@ -91,7 +91,8 @@ const GridPanel = forwardRef((props, ref) => {
|
|
|
91
91
|
}, other, {
|
|
92
92
|
ref: ref,
|
|
93
93
|
children: /*#__PURE__*/_jsx(ClickAwayListener, {
|
|
94
|
-
mouseEvent: "
|
|
94
|
+
mouseEvent: "onPointerUp",
|
|
95
|
+
touchEvent: false,
|
|
95
96
|
onClickAway: handleClickAway,
|
|
96
97
|
children: /*#__PURE__*/_jsx(GridPaperRoot, {
|
|
97
98
|
className: classes.paper,
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { TextFieldProps } from '@mui/material/TextField';
|
|
3
3
|
import { GridFilterInputValueProps } from './GridFilterInputValueProps';
|
|
4
4
|
export type GridFilterInputBooleanProps = GridFilterInputValueProps & TextFieldProps & {
|
|
5
|
+
headerFilterMenu?: React.ReactNode;
|
|
5
6
|
clearButton?: React.ReactNode | null;
|
|
6
7
|
/**
|
|
7
8
|
* It is `true` if the filter either has a value or an operator with no value
|
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "variant", "InputLabelProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "headerFilterMenu", "clearButton", "tabIndex", "label", "variant", "InputProps", "InputLabelProps", "sx"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { refType, unstable_useId as useId } from '@mui/utils';
|
|
7
|
-
import { styled } from '@mui/material/styles';
|
|
8
7
|
import { useGridRootProps } from "../../../hooks/utils/useGridRootProps.js";
|
|
9
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
const BooleanOperatorContainer = styled('div')({
|
|
11
|
-
display: 'flex',
|
|
12
|
-
alignItems: 'center',
|
|
13
|
-
width: '100%',
|
|
14
|
-
[`& button`]: {
|
|
15
|
-
margin: 'auto 0px 5px 5px'
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
9
|
function GridFilterInputBoolean(props) {
|
|
19
10
|
const {
|
|
20
11
|
item,
|
|
21
12
|
applyValue,
|
|
22
13
|
apiRef,
|
|
23
14
|
focusElementRef,
|
|
15
|
+
headerFilterMenu,
|
|
24
16
|
clearButton,
|
|
25
17
|
tabIndex,
|
|
26
18
|
label: labelProp,
|
|
27
|
-
variant = '
|
|
19
|
+
variant = 'outlined',
|
|
20
|
+
InputProps,
|
|
21
|
+
sx
|
|
28
22
|
} = props,
|
|
29
23
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
30
24
|
const [filterValueState, setFilterValueState] = React.useState(sanitizeFilterItemValue(item.value));
|
|
@@ -45,9 +39,10 @@ function GridFilterInputBoolean(props) {
|
|
|
45
39
|
setFilterValueState(sanitizeFilterItemValue(item.value));
|
|
46
40
|
}, [item.value]);
|
|
47
41
|
const label = labelProp ?? apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
48
|
-
return /*#__PURE__*/_jsxs(
|
|
42
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
49
43
|
children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {
|
|
50
44
|
fullWidth: true,
|
|
45
|
+
sx: sx,
|
|
51
46
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, rootProps.slotProps?.baseInputLabel, {
|
|
52
47
|
id: labelId,
|
|
53
48
|
shrink: true,
|
|
@@ -63,11 +58,11 @@ function GridFilterInputBoolean(props) {
|
|
|
63
58
|
notched: variant === 'outlined' ? true : undefined,
|
|
64
59
|
native: isSelectNative,
|
|
65
60
|
displayEmpty: true,
|
|
66
|
-
inputProps: {
|
|
61
|
+
inputProps: _extends({
|
|
67
62
|
ref: focusElementRef,
|
|
68
63
|
tabIndex
|
|
69
|
-
}
|
|
70
|
-
}, others /* FIXME: typing error */,
|
|
64
|
+
}, InputProps?.inputProps)
|
|
65
|
+
}, baseSelectProps, others /* FIXME: typing error */, {
|
|
71
66
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
72
67
|
native: isSelectNative,
|
|
73
68
|
value: "",
|
|
@@ -82,7 +77,7 @@ function GridFilterInputBoolean(props) {
|
|
|
82
77
|
children: apiRef.current.getLocaleText('filterValueFalse')
|
|
83
78
|
}))]
|
|
84
79
|
}))]
|
|
85
|
-
}), clearButton]
|
|
80
|
+
}), headerFilterMenu, clearButton]
|
|
86
81
|
});
|
|
87
82
|
}
|
|
88
83
|
export function sanitizeFilterItemValue(value) {
|
|
@@ -105,6 +100,7 @@ process.env.NODE_ENV !== "production" ? GridFilterInputBoolean.propTypes = {
|
|
|
105
100
|
applyValue: PropTypes.func.isRequired,
|
|
106
101
|
clearButton: PropTypes.node,
|
|
107
102
|
focusElementRef: refType,
|
|
103
|
+
headerFilterMenu: PropTypes.node,
|
|
108
104
|
/**
|
|
109
105
|
* It is `true` if the filter either has a value or an operator with no value
|
|
110
106
|
* required is selected (for example `isEmpty`)
|
|
@@ -2,8 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import { TextFieldProps } from '@mui/material/TextField';
|
|
3
3
|
import { GridFilterInputValueProps } from './GridFilterInputValueProps';
|
|
4
4
|
export type GridFilterInputDateProps = GridFilterInputValueProps & TextFieldProps & {
|
|
5
|
-
|
|
5
|
+
headerFilterMenu?: React.ReactNode;
|
|
6
6
|
clearButton?: React.ReactNode | null;
|
|
7
|
+
type?: 'date' | 'datetime-local';
|
|
7
8
|
/**
|
|
8
9
|
* It is `true` if the filter either has a value or an operator with no value
|
|
9
10
|
* required is selected (for example `isEmpty`)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "isFilterActive", "clearButton", "tabIndex", "disabled"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "isFilterActive", "headerFilterMenu", "clearButton", "tabIndex", "disabled"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
7
7
|
import { useTimeout } from "../../../hooks/utils/useTimeout.js";
|
|
8
8
|
import { useGridRootProps } from "../../../hooks/utils/useGridRootProps.js";
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
function convertFilterItemValueToInputValue(itemValue, inputType) {
|
|
11
11
|
if (itemValue == null) {
|
|
12
12
|
return '';
|
|
@@ -35,6 +35,7 @@ function GridFilterInputDate(props) {
|
|
|
35
35
|
apiRef,
|
|
36
36
|
focusElementRef,
|
|
37
37
|
InputProps,
|
|
38
|
+
headerFilterMenu,
|
|
38
39
|
clearButton,
|
|
39
40
|
tabIndex,
|
|
40
41
|
disabled
|
|
@@ -62,33 +63,34 @@ function GridFilterInputDate(props) {
|
|
|
62
63
|
const value = convertFilterItemValueToInputValue(item.value, type);
|
|
63
64
|
setFilterValueState(value);
|
|
64
65
|
}, [item.value, type]);
|
|
65
|
-
return /*#__PURE__*/
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
66
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
67
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
|
|
68
|
+
fullWidth: true,
|
|
69
|
+
id: id,
|
|
70
|
+
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
71
|
+
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
72
|
+
value: filterValueState,
|
|
73
|
+
onChange: onFilterChange,
|
|
74
|
+
variant: "standard",
|
|
75
|
+
type: type || 'text',
|
|
76
|
+
disabled: disabled,
|
|
77
|
+
InputLabelProps: {
|
|
78
|
+
shrink: true
|
|
79
|
+
},
|
|
80
|
+
inputRef: focusElementRef,
|
|
81
|
+
InputProps: _extends({
|
|
82
|
+
endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
83
|
+
fontSize: "small",
|
|
84
|
+
color: "action"
|
|
85
|
+
}) : null
|
|
86
|
+
}, InputProps, {
|
|
87
|
+
inputProps: _extends({
|
|
88
|
+
max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31',
|
|
89
|
+
tabIndex
|
|
90
|
+
}, InputProps?.inputProps)
|
|
91
|
+
})
|
|
92
|
+
}, rootProps.slotProps?.baseTextField, other)), headerFilterMenu, clearButton]
|
|
93
|
+
});
|
|
92
94
|
}
|
|
93
95
|
process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
|
|
94
96
|
// ----------------------------- Warning --------------------------------
|
|
@@ -101,6 +103,7 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
|
|
|
101
103
|
applyValue: PropTypes.func.isRequired,
|
|
102
104
|
clearButton: PropTypes.node,
|
|
103
105
|
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
106
|
+
headerFilterMenu: PropTypes.node,
|
|
104
107
|
/**
|
|
105
108
|
* It is `true` if the filter either has a value or an operator with no value
|
|
106
109
|
* required is selected (for example `isEmpty`)
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { TextFieldProps } from '@mui/material/TextField';
|
|
3
3
|
import { GridFilterInputValueProps } from './GridFilterInputValueProps';
|
|
4
4
|
export type GridFilterInputSingleSelectProps = GridFilterInputValueProps & TextFieldProps & {
|
|
5
|
+
headerFilterMenu?: React.ReactNode;
|
|
5
6
|
clearButton?: React.ReactNode | null;
|
|
6
7
|
/**
|
|
7
8
|
* It is `true` if the filter either has a value or an operator with no value
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "placeholder", "tabIndex", "label", "variant", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "placeholder", "tabIndex", "label", "variant", "isFilterActive", "clearButton", "headerFilterMenu", "InputProps", "InputLabelProps", "sx"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
7
|
-
import { styled } from '@mui/material/styles';
|
|
8
7
|
import { useGridRootProps } from "../../../hooks/utils/useGridRootProps.js";
|
|
9
8
|
import { getValueFromValueOptions, getValueOptions, isSingleSelectColDef } from "./filterPanelUtils.js";
|
|
10
9
|
import { createElement as _createElement } from "react";
|
|
@@ -31,14 +30,6 @@ const renderSingleSelectOptions = ({
|
|
|
31
30
|
}), label);
|
|
32
31
|
});
|
|
33
32
|
};
|
|
34
|
-
const SingleSelectOperatorContainer = styled('div')({
|
|
35
|
-
display: 'flex',
|
|
36
|
-
alignItems: 'flex-end',
|
|
37
|
-
width: '100%',
|
|
38
|
-
[`& button`]: {
|
|
39
|
-
margin: 'auto 0px 5px 5px'
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
33
|
function GridFilterInputSingleSelect(props) {
|
|
43
34
|
const {
|
|
44
35
|
item,
|
|
@@ -49,8 +40,11 @@ function GridFilterInputSingleSelect(props) {
|
|
|
49
40
|
placeholder,
|
|
50
41
|
tabIndex,
|
|
51
42
|
label: labelProp,
|
|
52
|
-
variant = '
|
|
53
|
-
clearButton
|
|
43
|
+
variant = 'outlined',
|
|
44
|
+
clearButton,
|
|
45
|
+
headerFilterMenu,
|
|
46
|
+
InputProps,
|
|
47
|
+
sx
|
|
54
48
|
} = props,
|
|
55
49
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
56
50
|
const filterValue = item.value ?? '';
|
|
@@ -83,9 +77,10 @@ function GridFilterInputSingleSelect(props) {
|
|
|
83
77
|
return null;
|
|
84
78
|
}
|
|
85
79
|
const label = labelProp ?? apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
86
|
-
return /*#__PURE__*/_jsxs(
|
|
80
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
87
81
|
children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {
|
|
88
82
|
fullWidth: true,
|
|
83
|
+
sx: sx,
|
|
89
84
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, rootProps.slotProps?.baseInputLabel, {
|
|
90
85
|
id: labelId,
|
|
91
86
|
htmlFor: id,
|
|
@@ -100,14 +95,14 @@ function GridFilterInputSingleSelect(props) {
|
|
|
100
95
|
onChange: onFilterChange,
|
|
101
96
|
variant: variant,
|
|
102
97
|
type: type || 'text',
|
|
103
|
-
inputProps: {
|
|
98
|
+
inputProps: _extends({
|
|
104
99
|
tabIndex,
|
|
105
100
|
ref: focusElementRef,
|
|
106
101
|
placeholder: placeholder ?? apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
107
|
-
},
|
|
102
|
+
}, InputProps?.inputProps),
|
|
108
103
|
native: isSelectNative,
|
|
109
104
|
notched: variant === 'outlined' ? true : undefined
|
|
110
|
-
}, others /* FIXME: typing error */,
|
|
105
|
+
}, rootProps.slotProps?.baseSelect, others /* FIXME: typing error */, {
|
|
111
106
|
children: renderSingleSelectOptions({
|
|
112
107
|
column: resolvedColumn,
|
|
113
108
|
OptionComponent: rootProps.slots.baseSelectOption,
|
|
@@ -117,7 +112,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
117
112
|
baseSelectOptionProps: rootProps.slotProps?.baseSelectOption
|
|
118
113
|
})
|
|
119
114
|
}))]
|
|
120
|
-
}), clearButton]
|
|
115
|
+
}), headerFilterMenu, clearButton]
|
|
121
116
|
});
|
|
122
117
|
}
|
|
123
118
|
process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes = {
|
|
@@ -131,6 +126,7 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
|
|
|
131
126
|
applyValue: PropTypes.func.isRequired,
|
|
132
127
|
clearButton: PropTypes.node,
|
|
133
128
|
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
129
|
+
headerFilterMenu: PropTypes.node,
|
|
134
130
|
/**
|
|
135
131
|
* It is `true` if the filter either has a value or an operator with no value
|
|
136
132
|
* required is selected (for example `isEmpty`)
|
|
@@ -3,6 +3,7 @@ import { TextFieldProps } from '@mui/material/TextField';
|
|
|
3
3
|
import { GridFilterInputValueProps } from './GridFilterInputValueProps';
|
|
4
4
|
export type GridTypeFilterInputValueProps = GridFilterInputValueProps & TextFieldProps & {
|
|
5
5
|
type?: 'text' | 'number' | 'date' | 'datetime-local';
|
|
6
|
+
headerFilterMenu?: React.ReactNode;
|
|
6
7
|
clearButton?: React.ReactNode | null;
|
|
7
8
|
/**
|
|
8
9
|
* It is `true` if the filter either has a value or an operator with no value
|