@mui/x-data-grid 6.4.0 → 6.6.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 +134 -2
- package/DataGrid/DataGrid.js +10 -3
- package/DataGrid/useDataGridProps.js +5 -12
- package/README.md +2 -2
- package/colDef/gridNumericOperators.js +0 -6
- package/components/GridColumnHeaders.js +4 -9
- package/components/GridHeader.d.ts +2 -2
- package/components/base/GridBody.d.ts +1 -1
- package/components/base/GridFooterPlaceholder.d.ts +2 -2
- package/components/base/GridOverlays.d.ts +2 -2
- package/components/cell/GridActionsCell.d.ts +3 -3
- package/components/cell/GridActionsCell.js +3 -3
- package/components/cell/GridBooleanCell.d.ts +1 -1
- package/components/cell/GridEditBooleanCell.d.ts +2 -2
- package/components/cell/GridEditDateCell.d.ts +2 -2
- package/components/cell/GridEditInputCell.d.ts +1 -1
- package/components/cell/GridEditInputCell.js +4 -1
- package/components/cell/GridEditSingleSelectCell.d.ts +3 -3
- package/components/cell/GridEditSingleSelectCell.js +5 -5
- package/components/cell/GridSkeletonCell.d.ts +1 -1
- package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
- package/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +2 -2
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +2 -2
- package/components/columnHeaders/GridColumnHeaderSeparator.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderSortIcon.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderTitle.d.ts +1 -1
- package/components/containers/GridRoot.js +1 -3
- package/components/index.d.ts +0 -1
- package/components/index.js +1 -2
- package/components/menu/GridMenu.d.ts +1 -1
- package/components/menu/columnMenu/GridColumnHeaderMenu.d.ts +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.d.ts +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.d.ts +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.d.ts +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.d.ts +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.d.ts +2 -2
- package/components/panel/GridColumnsPanel.d.ts +2 -2
- package/components/panel/GridPanelContent.d.ts +1 -1
- package/components/panel/GridPanelFooter.d.ts +1 -1
- package/components/panel/GridPanelHeader.d.ts +1 -1
- package/components/panel/GridPreferencesPanel.js +3 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +15 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.js +80 -36
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +9 -2
- package/components/panel/filterPanel/GridFilterInputDate.js +27 -6
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +9 -2
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +56 -32
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +11 -4
- package/components/panel/filterPanel/GridFilterInputValue.js +29 -6
- package/components/panel/filterPanel/GridFilterPanel.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/components/panel/filterPanel/index.d.ts +3 -1
- package/components/panel/filterPanel/index.js +2 -1
- package/components/toolbar/GridToolbarColumnsButton.js +11 -6
- package/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/components/toolbar/GridToolbarExport.d.ts +2 -2
- package/components/toolbar/GridToolbarExportContainer.js +7 -7
- package/components/toolbar/GridToolbarFilterButton.js +11 -4
- package/components/toolbar/GridToolbarQuickFilter.d.ts +2 -2
- package/constants/localeTextConstants.js +26 -0
- package/context/GridContextProvider.d.ts +1 -1
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +10 -2
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +10 -3
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
- package/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/hooks/features/editing/useGridEditing.js +0 -3
- package/hooks/features/filter/gridFilterSelector.d.ts +2 -2
- package/hooks/features/filter/gridFilterSelector.js +2 -2
- package/hooks/features/filter/gridFilterState.d.ts +6 -6
- package/hooks/features/filter/gridFilterState.js +6 -0
- package/hooks/features/filter/useGridFilter.js +29 -9
- package/hooks/features/focus/gridFocusState.d.ts +2 -0
- package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -0
- package/hooks/features/focus/gridFocusStateSelector.js +6 -0
- package/hooks/features/focus/useGridFocus.js +55 -9
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +4 -0
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -0
- package/hooks/features/headerFiltering/index.d.ts +1 -0
- package/hooks/features/headerFiltering/index.js +1 -0
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +6 -0
- package/hooks/features/headerFiltering/useGridHeaderFiltering.js +91 -0
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +2 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
- package/hooks/features/preferencesPanel/gridPreferencePanelState.d.ts +2 -0
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/hooks/features/rows/useGridRows.js +16 -1
- package/hooks/features/rows/useGridRowsMeta.js +11 -12
- package/index.js +1 -1
- package/internals/index.d.ts +6 -1
- package/internals/index.js +4 -0
- package/internals/utils/index.d.ts +1 -0
- package/internals/utils/index.js +2 -1
- package/internals/utils/useProps.d.ts +8 -0
- package/internals/utils/useProps.js +33 -0
- package/legacy/DataGrid/DataGrid.js +10 -3
- package/legacy/DataGrid/useDataGridProps.js +8 -8
- package/legacy/colDef/gridNumericOperators.js +0 -6
- package/legacy/components/GridColumnHeaders.js +4 -9
- package/legacy/components/cell/GridActionsCell.js +3 -3
- package/legacy/components/cell/GridEditInputCell.js +4 -1
- package/legacy/components/cell/GridEditSingleSelectCell.js +5 -5
- package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/legacy/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
- package/legacy/components/containers/GridRoot.js +1 -3
- package/legacy/components/index.js +1 -2
- package/legacy/components/panel/GridPreferencesPanel.js +3 -1
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +79 -35
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +26 -5
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +55 -31
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +28 -5
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/legacy/components/panel/filterPanel/index.js +2 -1
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +11 -5
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/legacy/components/toolbar/GridToolbarExportContainer.js +7 -7
- package/legacy/components/toolbar/GridToolbarFilterButton.js +11 -4
- package/legacy/constants/localeTextConstants.js +26 -0
- package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -5
- package/legacy/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/legacy/hooks/features/editing/useGridEditing.js +0 -3
- package/legacy/hooks/features/filter/gridFilterSelector.js +4 -4
- package/legacy/hooks/features/filter/gridFilterState.js +6 -0
- package/legacy/hooks/features/filter/useGridFilter.js +29 -9
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +10 -0
- package/legacy/hooks/features/focus/useGridFocus.js +58 -9
- package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +11 -0
- package/legacy/hooks/features/headerFiltering/index.js +1 -0
- package/legacy/hooks/features/headerFiltering/useGridHeaderFiltering.js +93 -0
- package/legacy/hooks/features/index.js +2 -1
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/legacy/hooks/features/rows/useGridRows.js +16 -1
- package/legacy/hooks/features/rows/useGridRowsMeta.js +12 -20
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +4 -0
- package/legacy/internals/utils/index.js +2 -1
- package/legacy/internals/utils/useProps.js +33 -0
- package/legacy/locales/arSD.js +28 -0
- package/legacy/locales/beBY.js +28 -0
- package/legacy/locales/bgBG.js +28 -0
- package/legacy/locales/csCZ.js +36 -8
- package/legacy/locales/daDK.js +28 -0
- package/legacy/locales/deDE.js +28 -0
- package/legacy/locales/elGR.js +27 -0
- package/legacy/locales/esES.js +28 -0
- package/legacy/locales/faIR.js +28 -0
- package/legacy/locales/fiFI.js +28 -0
- package/legacy/locales/frFR.js +26 -0
- package/legacy/locales/heIL.js +30 -2
- package/legacy/locales/huHU.js +28 -0
- package/legacy/locales/itIT.js +28 -0
- package/legacy/locales/jaJP.js +28 -0
- package/legacy/locales/koKR.js +28 -0
- package/legacy/locales/nbNO.js +28 -0
- package/legacy/locales/nlNL.js +26 -0
- package/legacy/locales/plPL.js +28 -0
- package/legacy/locales/ptBR.js +28 -0
- package/legacy/locales/roRO.js +28 -0
- package/legacy/locales/ruRU.js +28 -0
- package/legacy/locales/skSK.js +28 -0
- package/legacy/locales/svSE.js +28 -0
- package/legacy/locales/trTR.js +28 -0
- package/legacy/locales/ukUA.js +28 -0
- package/legacy/locales/urPK.js +28 -0
- package/legacy/locales/viVN.js +27 -0
- package/legacy/locales/zhCN.js +28 -0
- package/legacy/locales/zhTW.js +28 -0
- package/legacy/material/index.js +2 -0
- package/legacy/models/api/gridHeaderFilteringApi.js +1 -0
- package/legacy/models/gridFilterItem.js +1 -1
- package/legacy/models/gridHeaderFilteringModel.js +1 -0
- package/legacy/models/index.js +0 -1
- package/locales/arSD.js +28 -0
- package/locales/beBY.js +28 -0
- package/locales/bgBG.js +28 -0
- package/locales/csCZ.js +36 -8
- package/locales/daDK.js +28 -0
- package/locales/deDE.js +28 -0
- package/locales/elGR.js +27 -0
- package/locales/esES.js +28 -0
- package/locales/faIR.js +28 -0
- package/locales/fiFI.js +28 -0
- package/locales/frFR.js +26 -0
- package/locales/heIL.js +30 -2
- package/locales/huHU.js +28 -0
- package/locales/itIT.js +28 -0
- package/locales/jaJP.js +28 -0
- package/locales/koKR.js +28 -0
- package/locales/nbNO.js +28 -0
- package/locales/nlNL.js +26 -0
- package/locales/plPL.js +28 -0
- package/locales/ptBR.js +28 -0
- package/locales/roRO.js +28 -0
- package/locales/ruRU.js +28 -0
- package/locales/skSK.js +28 -0
- package/locales/svSE.js +28 -0
- package/locales/trTR.js +28 -0
- package/locales/ukUA.js +28 -0
- package/locales/urPK.js +28 -0
- package/locales/viVN.js +27 -0
- package/locales/zhCN.js +28 -0
- package/locales/zhTW.js +28 -0
- package/material/components/MUISelectOption.d.ts +2 -2
- package/material/index.d.ts +3 -66
- package/material/index.js +2 -0
- package/models/api/gridApiCommon.d.ts +3 -2
- package/models/api/gridCoreApi.d.ts +4 -0
- package/models/api/gridFilterApi.d.ts +3 -1
- package/models/api/gridFocusApi.d.ts +6 -0
- package/models/api/gridHeaderFilteringApi.d.ts +30 -0
- package/models/api/gridHeaderFilteringApi.js +1 -0
- package/models/api/gridLocaleTextApi.d.ts +25 -0
- package/models/api/gridPreferencesPanelApi.d.ts +3 -1
- package/models/events/gridEventLookup.d.ts +27 -1
- package/models/gridFilterItem.d.ts +1 -1
- package/models/gridFilterItem.js +1 -1
- package/models/gridFilterOperator.d.ts +5 -1
- package/models/gridHeaderFilteringModel.d.ts +5 -0
- package/models/gridHeaderFilteringModel.js +1 -0
- package/models/gridSlotsComponent.d.ts +16 -4
- package/models/gridStateCommunity.d.ts +4 -0
- package/models/index.d.ts +1 -1
- package/models/index.js +0 -1
- package/models/props/DataGridProps.d.ts +5 -0
- package/modern/DataGrid/DataGrid.js +10 -3
- package/modern/DataGrid/useDataGridProps.js +5 -12
- package/modern/colDef/gridNumericOperators.js +0 -6
- package/modern/components/GridColumnHeaders.js +4 -9
- package/modern/components/cell/GridActionsCell.js +3 -3
- package/modern/components/cell/GridEditInputCell.js +4 -1
- package/modern/components/cell/GridEditSingleSelectCell.js +5 -5
- package/modern/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
- package/modern/components/containers/GridRoot.js +1 -3
- package/modern/components/index.js +1 -2
- package/modern/components/panel/GridPreferencesPanel.js +3 -1
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +80 -36
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +27 -6
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +56 -32
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +29 -6
- package/modern/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/modern/components/panel/filterPanel/index.js +2 -1
- package/modern/components/toolbar/GridToolbarColumnsButton.js +11 -6
- package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/modern/components/toolbar/GridToolbarExportContainer.js +7 -7
- package/modern/components/toolbar/GridToolbarFilterButton.js +11 -4
- package/modern/constants/localeTextConstants.js +26 -0
- package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/modern/hooks/features/editing/useGridEditing.js +0 -3
- package/modern/hooks/features/filter/gridFilterSelector.js +2 -2
- package/modern/hooks/features/filter/gridFilterState.js +6 -0
- package/modern/hooks/features/filter/useGridFilter.js +29 -9
- package/modern/hooks/features/focus/gridFocusStateSelector.js +6 -0
- package/modern/hooks/features/focus/useGridFocus.js +55 -9
- package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -0
- package/modern/hooks/features/headerFiltering/index.js +1 -0
- package/modern/hooks/features/headerFiltering/useGridHeaderFiltering.js +90 -0
- package/modern/hooks/features/index.js +2 -1
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/modern/hooks/features/rows/useGridRows.js +16 -1
- package/modern/hooks/features/rows/useGridRowsMeta.js +11 -12
- package/modern/index.js +1 -1
- package/modern/internals/index.js +4 -0
- package/modern/internals/utils/index.js +2 -1
- package/modern/internals/utils/useProps.js +32 -0
- package/modern/locales/arSD.js +28 -0
- package/modern/locales/beBY.js +28 -0
- package/modern/locales/bgBG.js +28 -0
- package/modern/locales/csCZ.js +36 -8
- package/modern/locales/daDK.js +28 -0
- package/modern/locales/deDE.js +28 -0
- package/modern/locales/elGR.js +27 -0
- package/modern/locales/esES.js +28 -0
- package/modern/locales/faIR.js +28 -0
- package/modern/locales/fiFI.js +28 -0
- package/modern/locales/frFR.js +26 -0
- package/modern/locales/heIL.js +30 -2
- package/modern/locales/huHU.js +28 -0
- package/modern/locales/itIT.js +28 -0
- package/modern/locales/jaJP.js +28 -0
- package/modern/locales/koKR.js +28 -0
- package/modern/locales/nbNO.js +28 -0
- package/modern/locales/nlNL.js +26 -0
- package/modern/locales/plPL.js +28 -0
- package/modern/locales/ptBR.js +28 -0
- package/modern/locales/roRO.js +28 -0
- package/modern/locales/ruRU.js +28 -0
- package/modern/locales/skSK.js +28 -0
- package/modern/locales/svSE.js +28 -0
- package/modern/locales/trTR.js +28 -0
- package/modern/locales/ukUA.js +28 -0
- package/modern/locales/urPK.js +28 -0
- package/modern/locales/viVN.js +27 -0
- package/modern/locales/zhCN.js +28 -0
- package/modern/locales/zhTW.js +28 -0
- package/modern/material/index.js +2 -0
- package/modern/models/api/gridHeaderFilteringApi.js +1 -0
- package/modern/models/gridFilterItem.js +1 -1
- package/modern/models/gridHeaderFilteringModel.js +1 -0
- package/modern/models/index.js +0 -1
- package/node/DataGrid/DataGrid.js +10 -3
- package/node/DataGrid/useDataGridProps.js +4 -11
- package/node/colDef/gridNumericOperators.js +0 -6
- package/node/components/GridColumnHeaders.js +3 -8
- package/node/components/cell/GridActionsCell.js +3 -3
- package/node/components/cell/GridEditInputCell.js +4 -1
- package/node/components/cell/GridEditSingleSelectCell.js +5 -5
- package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +12 -3
- package/node/components/containers/GridRoot.js +1 -3
- package/node/components/index.js +0 -11
- package/node/components/panel/GridPreferencesPanel.js +3 -1
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +78 -35
- package/node/components/panel/filterPanel/GridFilterInputDate.js +27 -6
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +56 -32
- package/node/components/panel/filterPanel/GridFilterInputValue.js +29 -6
- package/node/components/panel/filterPanel/GridFilterPanel.js +2 -1
- package/node/components/panel/filterPanel/index.js +26 -8
- package/node/components/toolbar/GridToolbarColumnsButton.js +11 -6
- package/node/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/node/components/toolbar/GridToolbarExportContainer.js +7 -7
- package/node/components/toolbar/GridToolbarFilterButton.js +10 -3
- package/node/constants/localeTextConstants.js +26 -0
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
- package/node/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/node/hooks/features/editing/useGridEditing.js +0 -3
- package/node/hooks/features/filter/gridFilterSelector.js +2 -2
- package/node/hooks/features/filter/gridFilterState.js +6 -0
- package/node/hooks/features/filter/useGridFilter.js +30 -10
- package/node/hooks/features/focus/gridFocusStateSelector.js +9 -1
- package/node/hooks/features/focus/useGridFocus.js +55 -9
- package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +15 -0
- package/node/hooks/features/headerFiltering/index.js +16 -0
- package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +101 -0
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/node/hooks/features/rows/useGridRows.js +16 -1
- package/node/hooks/features/rows/useGridRowsMeta.js +11 -12
- package/node/index.js +1 -1
- package/node/internals/index.js +46 -0
- package/node/internals/utils/index.js +11 -0
- package/node/internals/utils/useProps.js +41 -0
- package/node/locales/arSD.js +28 -0
- package/node/locales/beBY.js +28 -0
- package/node/locales/bgBG.js +28 -0
- package/node/locales/csCZ.js +36 -8
- package/node/locales/daDK.js +28 -0
- package/node/locales/deDE.js +28 -0
- package/node/locales/elGR.js +27 -0
- package/node/locales/esES.js +28 -0
- package/node/locales/faIR.js +28 -0
- package/node/locales/fiFI.js +28 -0
- package/node/locales/frFR.js +26 -0
- package/node/locales/heIL.js +30 -2
- package/node/locales/huHU.js +28 -0
- package/node/locales/itIT.js +28 -0
- package/node/locales/jaJP.js +28 -0
- package/node/locales/koKR.js +28 -0
- package/node/locales/nbNO.js +28 -0
- package/node/locales/nlNL.js +26 -0
- package/node/locales/plPL.js +28 -0
- package/node/locales/ptBR.js +28 -0
- package/node/locales/roRO.js +28 -0
- package/node/locales/ruRU.js +28 -0
- package/node/locales/skSK.js +28 -0
- package/node/locales/svSE.js +28 -0
- package/node/locales/trTR.js +28 -0
- package/node/locales/ukUA.js +28 -0
- package/node/locales/urPK.js +28 -0
- package/node/locales/viVN.js +27 -0
- package/node/locales/zhCN.js +28 -0
- package/node/locales/zhTW.js +28 -0
- package/node/material/index.js +2 -0
- package/node/models/api/gridHeaderFilteringApi.js +5 -0
- package/node/models/gridFilterItem.js +1 -1
- package/node/models/gridHeaderFilteringModel.js +5 -0
- package/node/models/index.js +0 -11
- package/package.json +4 -4
- package/components/GridScrollArea.d.ts +0 -10
- package/components/GridScrollArea.js +0 -117
- package/legacy/components/GridScrollArea.js +0 -119
- package/legacy/lib/createDetectElementResize/index.js +0 -145
- package/lib/createDetectElementResize/index.d.ts +0 -18
- package/lib/createDetectElementResize/index.js +0 -145
- package/lib/createDetectElementResize/types.d.ts +0 -9
- package/modern/components/GridScrollArea.js +0 -117
- package/modern/lib/createDetectElementResize/index.js +0 -145
- package/node/components/GridScrollArea.js +0 -126
- package/node/lib/createDetectElementResize/index.js +0 -151
|
@@ -189,6 +189,32 @@ export interface GridColumnHeaderEventLookup {
|
|
|
189
189
|
params: GridColumnOrderChangeParams;
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
+
export interface GridHeaderFilterEventLookup {
|
|
193
|
+
/**
|
|
194
|
+
* Fired when a column header filter is clicked
|
|
195
|
+
* @ignore - do not document.
|
|
196
|
+
*/
|
|
197
|
+
headerFilterClick: {
|
|
198
|
+
params: GridColumnHeaderParams;
|
|
199
|
+
event: React.MouseEvent<HTMLElement>;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Fired when a key is pressed in a column header filter. It's mapped to the `keydown` DOM event.
|
|
203
|
+
* @ignore - do not document.
|
|
204
|
+
*/
|
|
205
|
+
headerFilterKeyDown: {
|
|
206
|
+
params: GridColumnHeaderParams;
|
|
207
|
+
event: React.KeyboardEvent<HTMLElement>;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Fired when a mouse is pressed in a column header filter. It's mapped to the `mousedown` DOM event.
|
|
211
|
+
* @ignore - do not document.
|
|
212
|
+
*/
|
|
213
|
+
headerFilterMouseDown: {
|
|
214
|
+
params: GridColumnHeaderParams;
|
|
215
|
+
event: React.KeyboardEvent<HTMLElement>;
|
|
216
|
+
};
|
|
217
|
+
}
|
|
192
218
|
export interface GridColumnGroupHeaderEventLookup {
|
|
193
219
|
/**
|
|
194
220
|
* Fired when a key is pressed in a column group header. It's mapped do the `keydown` DOM event.
|
|
@@ -318,7 +344,7 @@ export interface GridControlledStateReasonLookup {
|
|
|
318
344
|
filter: 'upsertFilterItem' | 'upsertFilterItems' | 'deleteFilterItem' | 'changeLogicOperator' | 'restoreState';
|
|
319
345
|
pagination: 'setPaginationModel' | 'stateRestorePreProcessing';
|
|
320
346
|
}
|
|
321
|
-
export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEventLookup, GridColumnGroupHeaderEventLookup, GridCellEventLookup, GridControlledStateEventLookup {
|
|
347
|
+
export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEventLookup, GridHeaderFilterEventLookup, GridColumnGroupHeaderEventLookup, GridCellEventLookup, GridControlledStateEventLookup {
|
|
322
348
|
/**
|
|
323
349
|
* Fired when the grid is unmounted.
|
|
324
350
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Filter item definition interface.
|
|
3
3
|
* @demos
|
|
4
|
-
* - [Custom filter operator](/x/react-data-grid/filtering/#create-a-custom-operator)
|
|
4
|
+
* - [Custom filter operator](/x/react-data-grid/filtering/customization/#create-a-custom-operator)
|
|
5
5
|
*/
|
|
6
6
|
export interface GridFilterItem {
|
|
7
7
|
/**
|
package/models/gridFilterItem.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Filter item definition interface.
|
|
3
3
|
* @demos
|
|
4
|
-
* - [Custom filter operator](/x/react-data-grid/filtering/#create-a-custom-operator)
|
|
4
|
+
* - [Custom filter operator](/x/react-data-grid/filtering/customization/#create-a-custom-operator)
|
|
5
5
|
*/
|
|
6
6
|
var GridLogicOperator = /*#__PURE__*/function (GridLogicOperator) {
|
|
7
7
|
GridLogicOperator["And"] = "and";
|
|
@@ -6,13 +6,17 @@ import type { GridValidRowModel } from './gridRows';
|
|
|
6
6
|
/**
|
|
7
7
|
* Filter operator definition interface.
|
|
8
8
|
* @demos
|
|
9
|
-
* - [Custom filter operator](/x/react-data-grid/filtering/#create-a-custom-operator)
|
|
9
|
+
* - [Custom filter operator](/x/react-data-grid/filtering/customization/#create-a-custom-operator)
|
|
10
10
|
*/
|
|
11
11
|
export interface GridFilterOperator<R extends GridValidRowModel = any, V = any, F = V> {
|
|
12
12
|
/**
|
|
13
13
|
* The label of the filter operator.
|
|
14
14
|
*/
|
|
15
15
|
label?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The label of the filter shown in header filter row.
|
|
18
|
+
*/
|
|
19
|
+
headerLabel?: string;
|
|
16
20
|
/**
|
|
17
21
|
* The name of the filter operator.
|
|
18
22
|
* It will be matched with the `operator` property of the filter items.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { UncapitalizeObjectKeys } from '../internals/utils';
|
|
3
3
|
import type { GridIconSlotsComponent } from './gridIconSlotsComponent';
|
|
4
|
-
|
|
5
|
-
* Grid components React prop interface containing all the overridable components.
|
|
6
|
-
*/
|
|
7
|
-
export interface GridSlotsComponent extends GridIconSlotsComponent {
|
|
4
|
+
export interface GridBaseSlots {
|
|
8
5
|
/**
|
|
9
6
|
* The custom Checkbox component used in the grid for both header and cells.
|
|
10
7
|
* @default Checkbox
|
|
11
8
|
*/
|
|
12
9
|
BaseCheckbox: React.JSXElementConstructor<any>;
|
|
10
|
+
/**
|
|
11
|
+
* The custom Chip component used in the grid.
|
|
12
|
+
* @default Chip
|
|
13
|
+
*/
|
|
14
|
+
BaseChip: React.JSXElementConstructor<any>;
|
|
15
|
+
/**
|
|
16
|
+
* The custom InputAdornment component used in the grid.
|
|
17
|
+
* @default InputAdornment
|
|
18
|
+
*/
|
|
19
|
+
BaseInputAdornment: React.JSXElementConstructor<any>;
|
|
13
20
|
/**
|
|
14
21
|
* The custom TextField component used in the grid.
|
|
15
22
|
* @default TextField
|
|
@@ -60,6 +67,11 @@ export interface GridSlotsComponent extends GridIconSlotsComponent {
|
|
|
60
67
|
* @default MenuItem
|
|
61
68
|
*/
|
|
62
69
|
BaseSelectOption: React.JSXElementConstructor<any>;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Grid components React prop interface containing all the overridable components.
|
|
73
|
+
*/
|
|
74
|
+
export interface GridSlotsComponent extends GridBaseSlots, GridIconSlotsComponent {
|
|
63
75
|
/**
|
|
64
76
|
* The custom Chip component used in the grid.
|
|
65
77
|
* @default Chip
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import type { GridColumnMenuState, GridColumnsInitialState, GridColumnsState, GridColumnsGroupingState, GridDensityState, GridFilterInitialState, GridFilterState, GridFocusState, GridPaginationInitialState, GridPaginationState, GridPreferencePanelInitialState, GridPreferencePanelState, GridRowsState, GridSortingInitialState, GridSortingState, GridTabIndexState } from '../hooks';
|
|
2
2
|
import type { GridRowsMetaState } from '../hooks/features/rows/gridRowsMetaState';
|
|
3
3
|
import type { GridEditingState } from './gridEditRowModel';
|
|
4
|
+
import { GridHeaderFilteringState } from './gridHeaderFilteringModel';
|
|
4
5
|
import type { GridRowSelectionModel } from './gridRowSelectionModel';
|
|
6
|
+
import type { GridVisibleRowsLookupState } from '../hooks/features/filter/gridFilterState';
|
|
5
7
|
/**
|
|
6
8
|
* The state of `DataGrid`.
|
|
7
9
|
*/
|
|
8
10
|
export interface GridStateCommunity {
|
|
9
11
|
rows: GridRowsState;
|
|
12
|
+
visibleRowsLookup: GridVisibleRowsLookupState;
|
|
10
13
|
rowsMeta: GridRowsMetaState;
|
|
11
14
|
editRows: GridEditingState;
|
|
15
|
+
headerFiltering: GridHeaderFilteringState;
|
|
12
16
|
pagination: GridPaginationState;
|
|
13
17
|
columns: GridColumnsState;
|
|
14
18
|
columnGrouping: GridColumnsGroupingState;
|
package/models/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export * from './gridCell';
|
|
|
16
16
|
export * from './gridColumnHeaderClass';
|
|
17
17
|
export * from './api';
|
|
18
18
|
export * from './gridIconSlotsComponent';
|
|
19
|
-
export
|
|
19
|
+
export type { GridSlotsComponent, UncapitalizedGridSlotsComponent } from './gridSlotsComponent';
|
|
20
20
|
export * from './gridSlotsComponentsProps';
|
|
21
21
|
export * from './gridDensity';
|
|
22
22
|
export * from './logger';
|
package/models/index.js
CHANGED
|
@@ -16,7 +16,6 @@ export * from './gridCell';
|
|
|
16
16
|
export * from './gridColumnHeaderClass';
|
|
17
17
|
export * from './api';
|
|
18
18
|
export * from './gridIconSlotsComponent';
|
|
19
|
-
export * from './gridSlotsComponent';
|
|
20
19
|
export * from './gridSlotsComponentsProps';
|
|
21
20
|
export * from './gridDensity';
|
|
22
21
|
export * from './logger';
|
|
@@ -329,6 +329,11 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
329
329
|
* The ref object that allows grid manipulation. Can be instantiated with `useGridApiRef()`.
|
|
330
330
|
*/
|
|
331
331
|
apiRef?: React.MutableRefObject<GridApiCommunity>;
|
|
332
|
+
/**
|
|
333
|
+
* Forwarded props for the grid root element.
|
|
334
|
+
* @ignore - do not document.
|
|
335
|
+
*/
|
|
336
|
+
forwardedProps?: Record<string, unknown>;
|
|
332
337
|
/**
|
|
333
338
|
* Signal to the underlying logic what version of the public component API
|
|
334
339
|
* of the data grid is exposed [[GridSignature]].
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import { chainPropTypes } from '@mui/utils';
|
|
@@ -14,15 +15,16 @@ const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref
|
|
|
14
15
|
return /*#__PURE__*/_jsx(GridContextProvider, {
|
|
15
16
|
privateApiRef: privateApiRef,
|
|
16
17
|
props: props,
|
|
17
|
-
children: /*#__PURE__*/_jsxs(GridRoot, {
|
|
18
|
+
children: /*#__PURE__*/_jsxs(GridRoot, _extends({
|
|
18
19
|
className: props.className,
|
|
19
20
|
style: props.style,
|
|
20
21
|
sx: props.sx,
|
|
21
|
-
ref: ref
|
|
22
|
+
ref: ref
|
|
23
|
+
}, props.forwardedProps, {
|
|
22
24
|
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
|
|
23
25
|
VirtualScrollerComponent: DataGridVirtualScroller
|
|
24
26
|
}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
25
|
-
})
|
|
27
|
+
}))
|
|
26
28
|
});
|
|
27
29
|
});
|
|
28
30
|
export const DataGrid = /*#__PURE__*/React.memo(DataGridRaw);
|
|
@@ -182,6 +184,11 @@ DataGridRaw.propTypes = {
|
|
|
182
184
|
quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
|
|
183
185
|
quickFilterValues: PropTypes.array
|
|
184
186
|
}),
|
|
187
|
+
/**
|
|
188
|
+
* Forwarded props for the grid root element.
|
|
189
|
+
* @ignore - do not document.
|
|
190
|
+
*/
|
|
191
|
+
forwardedProps: PropTypes.object,
|
|
185
192
|
/**
|
|
186
193
|
* Function that applies CSS classes dynamically on cells.
|
|
187
194
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["components", "componentsProps"];
|
|
4
2
|
import * as React from 'react';
|
|
5
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
6
4
|
import { GRID_DEFAULT_LOCALE_TEXT } from '../constants';
|
|
7
5
|
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '../constants/defaultGridSlotsComponents';
|
|
8
6
|
import { GridEditModes } from '../models';
|
|
9
|
-
import { computeSlots, uncapitalizeObjectKeys } from '../internals/utils';
|
|
7
|
+
import { computeSlots, useProps, uncapitalizeObjectKeys } from '../internals/utils';
|
|
10
8
|
const DATA_GRID_FORCED_PROPS = {
|
|
11
9
|
disableMultipleColumnsFiltering: true,
|
|
12
10
|
disableMultipleColumnsSorting: true,
|
|
@@ -72,15 +70,10 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
72
70
|
};
|
|
73
71
|
const defaultSlots = uncapitalizeObjectKeys(DATA_GRID_DEFAULT_SLOTS_COMPONENTS);
|
|
74
72
|
export const useDataGridProps = inProps => {
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
components,
|
|
81
|
-
componentsProps
|
|
82
|
-
} = _useThemeProps,
|
|
83
|
-
themedProps = _objectWithoutPropertiesLoose(_useThemeProps, _excluded);
|
|
73
|
+
const [components, componentsProps, themedProps] = useProps(useThemeProps({
|
|
74
|
+
props: inProps,
|
|
75
|
+
name: 'MuiDataGrid'
|
|
76
|
+
}));
|
|
84
77
|
const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
85
78
|
const slots = React.useMemo(() => computeSlots({
|
|
86
79
|
defaultSlots,
|
|
@@ -17,7 +17,6 @@ export const getGridNumericQuickFilterFn = value => {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
export const getGridNumericOperators = () => [{
|
|
20
|
-
label: '=',
|
|
21
20
|
value: '=',
|
|
22
21
|
getApplyFilterFn: filterItem => {
|
|
23
22
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -34,7 +33,6 @@ export const getGridNumericOperators = () => [{
|
|
|
34
33
|
type: 'number'
|
|
35
34
|
}
|
|
36
35
|
}, {
|
|
37
|
-
label: '!=',
|
|
38
36
|
value: '!=',
|
|
39
37
|
getApplyFilterFn: filterItem => {
|
|
40
38
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -51,7 +49,6 @@ export const getGridNumericOperators = () => [{
|
|
|
51
49
|
type: 'number'
|
|
52
50
|
}
|
|
53
51
|
}, {
|
|
54
|
-
label: '>',
|
|
55
52
|
value: '>',
|
|
56
53
|
getApplyFilterFn: filterItem => {
|
|
57
54
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -71,7 +68,6 @@ export const getGridNumericOperators = () => [{
|
|
|
71
68
|
type: 'number'
|
|
72
69
|
}
|
|
73
70
|
}, {
|
|
74
|
-
label: '>=',
|
|
75
71
|
value: '>=',
|
|
76
72
|
getApplyFilterFn: filterItem => {
|
|
77
73
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -91,7 +87,6 @@ export const getGridNumericOperators = () => [{
|
|
|
91
87
|
type: 'number'
|
|
92
88
|
}
|
|
93
89
|
}, {
|
|
94
|
-
label: '<',
|
|
95
90
|
value: '<',
|
|
96
91
|
getApplyFilterFn: filterItem => {
|
|
97
92
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -111,7 +106,6 @@ export const getGridNumericOperators = () => [{
|
|
|
111
106
|
type: 'number'
|
|
112
107
|
}
|
|
113
108
|
}, {
|
|
114
|
-
label: '<=',
|
|
115
109
|
value: '<=',
|
|
116
110
|
getApplyFilterFn: filterItem => {
|
|
117
111
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -4,11 +4,10 @@ const _excluded = ["innerRef", "className", "visibleColumns", "sortColumnLookup"
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useGridColumnHeaders } from '../hooks/features/columnHeaders/useGridColumnHeaders';
|
|
7
|
-
import { GridScrollArea } from './GridScrollArea';
|
|
8
7
|
import { GridBaseColumnHeaders } from './columnHeaders/GridBaseColumnHeaders';
|
|
9
8
|
import { GridColumnHeadersInner } from './columnHeaders/GridColumnHeadersInner';
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
11
|
const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnsHeaders(props, ref) {
|
|
13
12
|
const {
|
|
14
13
|
innerRef,
|
|
@@ -51,18 +50,14 @@ const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnsHead
|
|
|
51
50
|
columnGroupsHeaderStructure,
|
|
52
51
|
hasOtherElementInTabSequence
|
|
53
52
|
});
|
|
54
|
-
return /*#__PURE__*/
|
|
53
|
+
return /*#__PURE__*/_jsx(GridBaseColumnHeaders, _extends({
|
|
55
54
|
ref: ref
|
|
56
55
|
}, getRootProps(other), {
|
|
57
|
-
children:
|
|
58
|
-
scrollDirection: "left"
|
|
59
|
-
}), /*#__PURE__*/_jsxs(GridColumnHeadersInner, _extends({
|
|
56
|
+
children: /*#__PURE__*/_jsxs(GridColumnHeadersInner, _extends({
|
|
60
57
|
isDragging: isDragging
|
|
61
58
|
}, getInnerProps(), {
|
|
62
59
|
children: [getColumnGroupHeaders(), getColumnHeaders()]
|
|
63
|
-
}))
|
|
64
|
-
scrollDirection: "right"
|
|
65
|
-
})]
|
|
60
|
+
}))
|
|
66
61
|
}));
|
|
67
62
|
});
|
|
68
63
|
process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes = {
|
|
@@ -151,9 +151,9 @@ function GridActionsCell(props) {
|
|
|
151
151
|
ref: buttonRef,
|
|
152
152
|
id: buttonId,
|
|
153
153
|
"aria-label": apiRef.current.getLocaleText('actionsCellMore'),
|
|
154
|
-
"aria-
|
|
155
|
-
"aria-expanded": open
|
|
156
|
-
"aria-
|
|
154
|
+
"aria-haspopup": "menu",
|
|
155
|
+
"aria-expanded": open,
|
|
156
|
+
"aria-controls": open ? menuId : undefined,
|
|
157
157
|
role: "menuitem",
|
|
158
158
|
size: "small",
|
|
159
159
|
onClick: showMenu,
|
|
@@ -88,7 +88,10 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
88
88
|
type: colDef.type === 'number' ? colDef.type : 'text',
|
|
89
89
|
value: valueState ?? '',
|
|
90
90
|
onChange: handleChange,
|
|
91
|
-
endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
91
|
+
endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
92
|
+
fontSize: "small",
|
|
93
|
+
color: "action"
|
|
94
|
+
}) : undefined
|
|
92
95
|
}, other));
|
|
93
96
|
});
|
|
94
97
|
process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
@@ -5,6 +5,7 @@ const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowN
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
8
|
+
import { GridCellEditStopReasons } from '../../models/params/gridEditCellParams';
|
|
8
9
|
import { isEscapeKey } from '../../utils/keyboardUtils';
|
|
9
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
11
|
import { GridEditModes } from '../../models/gridEditRowModel';
|
|
@@ -88,11 +89,10 @@ function GridEditSingleSelectCell(props) {
|
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
90
91
|
if (reason === 'backdropClick' || isEscapeKey(event.key)) {
|
|
91
|
-
apiRef.current.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
});
|
|
92
|
+
const params = apiRef.current.getCellParams(id, field);
|
|
93
|
+
apiRef.current.publishEvent('cellEditStop', _extends({}, params, {
|
|
94
|
+
reason: isEscapeKey(event.key) ? GridCellEditStopReasons.escapeKeyDown : GridCellEditStopReasons.cellFocusOut
|
|
95
|
+
}));
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
const handleOpen = event => {
|
|
@@ -48,9 +48,9 @@ export const ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(props => {
|
|
|
48
48
|
"aria-label": apiRef.current.getLocaleText('columnMenuLabel'),
|
|
49
49
|
size: "small",
|
|
50
50
|
onClick: handleMenuIconClick,
|
|
51
|
-
"aria-
|
|
52
|
-
"aria-
|
|
53
|
-
"aria-controls": columnMenuId,
|
|
51
|
+
"aria-haspopup": "menu",
|
|
52
|
+
"aria-expanded": open,
|
|
53
|
+
"aria-controls": open ? columnMenuId : undefined,
|
|
54
54
|
id: columnMenuButtonId
|
|
55
55
|
}, rootProps.slotProps?.baseIconButton, {
|
|
56
56
|
children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuIcon, {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
4
|
+
import { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils';
|
|
5
5
|
import Badge from '@mui/material/Badge';
|
|
6
|
+
import { useGridSelector } from '../../hooks';
|
|
6
7
|
import { gridPreferencePanelStateSelector } from '../../hooks/features/preferencesPanel/gridPreferencePanelSelector';
|
|
7
8
|
import { GridPreferencePanelsValue } from '../../hooks/features/preferencesPanel/gridPreferencePanelsValue';
|
|
8
9
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
@@ -32,6 +33,9 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
32
33
|
classes: rootProps.classes
|
|
33
34
|
});
|
|
34
35
|
const classes = useUtilityClasses(ownerState);
|
|
36
|
+
const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
37
|
+
const labelId = useId();
|
|
38
|
+
const panelId = useId();
|
|
35
39
|
const toggleFilter = React.useCallback(event => {
|
|
36
40
|
event.preventDefault();
|
|
37
41
|
event.stopPropagation();
|
|
@@ -42,21 +46,26 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
42
46
|
if (open && openedPanelValue === GridPreferencePanelsValue.filters) {
|
|
43
47
|
apiRef.current.hideFilterPanel();
|
|
44
48
|
} else {
|
|
45
|
-
apiRef.current.showFilterPanel();
|
|
49
|
+
apiRef.current.showFilterPanel(undefined, panelId, labelId);
|
|
46
50
|
}
|
|
47
51
|
if (onClick) {
|
|
48
52
|
onClick(apiRef.current.getColumnHeaderParams(field), event);
|
|
49
53
|
}
|
|
50
|
-
}, [apiRef, field, onClick]);
|
|
54
|
+
}, [apiRef, field, onClick, panelId, labelId]);
|
|
51
55
|
if (!counter) {
|
|
52
56
|
return null;
|
|
53
57
|
}
|
|
58
|
+
const open = preferencePanel.open && preferencePanel.labelId === labelId;
|
|
54
59
|
const iconButton = /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
60
|
+
id: labelId,
|
|
55
61
|
onClick: toggleFilter,
|
|
56
62
|
color: "default",
|
|
57
63
|
"aria-label": apiRef.current.getLocaleText('columnHeaderFiltersLabel'),
|
|
58
64
|
size: "small",
|
|
59
|
-
tabIndex: -1
|
|
65
|
+
tabIndex: -1,
|
|
66
|
+
"aria-haspopup": "menu",
|
|
67
|
+
"aria-expanded": open,
|
|
68
|
+
"aria-controls": open ? panelId : undefined
|
|
60
69
|
}, rootProps.slotProps?.baseIconButton, {
|
|
61
70
|
children: /*#__PURE__*/_jsx(rootProps.slots.columnFilteredIcon, {
|
|
62
71
|
className: classes.icon,
|
|
@@ -64,9 +64,7 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
64
64
|
role: "grid",
|
|
65
65
|
"aria-colcount": visibleColumns.length,
|
|
66
66
|
"aria-rowcount": headerGroupingMaxDepth + 1 + pinnedRowsCount + totalRowCount,
|
|
67
|
-
"aria-multiselectable": !rootProps.disableMultipleRowSelection
|
|
68
|
-
"aria-label": rootProps['aria-label'],
|
|
69
|
-
"aria-labelledby": rootProps['aria-labelledby']
|
|
67
|
+
"aria-multiselectable": !rootProps.disableMultipleRowSelection
|
|
70
68
|
}, other, {
|
|
71
69
|
children: children
|
|
72
70
|
}));
|
|
@@ -16,7 +16,9 @@ export const GridPreferencesPanel = /*#__PURE__*/React.forwardRef(function GridP
|
|
|
16
16
|
return /*#__PURE__*/_jsx(rootProps.slots.panel, _extends({
|
|
17
17
|
ref: ref,
|
|
18
18
|
as: rootProps.slots.basePopper,
|
|
19
|
-
open: columns.length > 0 && preferencePanelState.open
|
|
19
|
+
open: columns.length > 0 && preferencePanelState.open,
|
|
20
|
+
id: preferencePanelState.panelId,
|
|
21
|
+
"aria-labelledby": preferencePanelState.labelId
|
|
20
22
|
}, rootProps.slotProps?.panel, props, rootProps.slotProps?.basePopper, {
|
|
21
23
|
children: panelContent
|
|
22
24
|
}));
|
|
@@ -1,17 +1,29 @@
|
|
|
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"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "headerFilterMenu", "isFilterActive", "clearButton", "tabIndex", "label"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
7
|
+
import { styled } from '@mui/material/styles';
|
|
6
8
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
7
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
|
|
11
|
+
const BooleanOperatorContainer = styled('div')({
|
|
12
|
+
display: 'flex',
|
|
13
|
+
alignItems: 'flex-end',
|
|
14
|
+
width: '100%'
|
|
15
|
+
});
|
|
16
|
+
function GridFilterInputBoolean(props) {
|
|
10
17
|
const {
|
|
11
18
|
item,
|
|
12
19
|
applyValue,
|
|
13
20
|
apiRef,
|
|
14
|
-
focusElementRef
|
|
21
|
+
focusElementRef,
|
|
22
|
+
headerFilterMenu,
|
|
23
|
+
isFilterActive,
|
|
24
|
+
clearButton,
|
|
25
|
+
tabIndex,
|
|
26
|
+
label: labelProp
|
|
15
27
|
} = props,
|
|
16
28
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
17
29
|
const [filterValueState, setFilterValueState] = React.useState(item.value || '');
|
|
@@ -31,39 +43,71 @@ export function GridFilterInputBoolean(props) {
|
|
|
31
43
|
React.useEffect(() => {
|
|
32
44
|
setFilterValueState(item.value || '');
|
|
33
45
|
}, [item.value]);
|
|
34
|
-
const label = apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
35
|
-
return /*#__PURE__*/_jsxs(
|
|
36
|
-
children: [/*#__PURE__*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
inputProps: {
|
|
51
|
-
ref: focusElementRef
|
|
52
|
-
}
|
|
53
|
-
}, others, baseSelectProps, {
|
|
54
|
-
children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
46
|
+
const label = labelProp ?? apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
47
|
+
return /*#__PURE__*/_jsxs(BooleanOperatorContainer, {
|
|
48
|
+
children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {
|
|
49
|
+
fullWidth: true,
|
|
50
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, rootProps.slotProps?.baseInputLabel, {
|
|
51
|
+
id: labelId,
|
|
52
|
+
shrink: true,
|
|
53
|
+
variant: "standard",
|
|
54
|
+
children: label
|
|
55
|
+
})), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
|
|
56
|
+
labelId: labelId,
|
|
57
|
+
id: selectId,
|
|
58
|
+
label: label,
|
|
59
|
+
value: filterValueState,
|
|
60
|
+
onChange: onFilterChange,
|
|
61
|
+
variant: "standard",
|
|
55
62
|
native: isSelectNative,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
displayEmpty: true,
|
|
64
|
+
startAdornment: isFilterActive ? headerFilterMenu : null,
|
|
65
|
+
inputProps: {
|
|
66
|
+
ref: focusElementRef,
|
|
67
|
+
tabIndex
|
|
68
|
+
}
|
|
69
|
+
}, others, baseSelectProps, {
|
|
70
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
71
|
+
native: isSelectNative,
|
|
72
|
+
value: "",
|
|
73
|
+
children: apiRef.current.getLocaleText('filterValueAny')
|
|
74
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
75
|
+
native: isSelectNative,
|
|
76
|
+
value: "true",
|
|
77
|
+
children: apiRef.current.getLocaleText('filterValueTrue')
|
|
78
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
79
|
+
native: isSelectNative,
|
|
80
|
+
value: "false",
|
|
81
|
+
children: apiRef.current.getLocaleText('filterValueFalse')
|
|
82
|
+
}))]
|
|
66
83
|
}))]
|
|
67
|
-
})
|
|
84
|
+
}), clearButton]
|
|
68
85
|
});
|
|
69
|
-
}
|
|
86
|
+
}
|
|
87
|
+
process.env.NODE_ENV !== "production" ? GridFilterInputBoolean.propTypes = {
|
|
88
|
+
// ----------------------------- Warning --------------------------------
|
|
89
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
90
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
91
|
+
// ----------------------------------------------------------------------
|
|
92
|
+
apiRef: PropTypes.shape({
|
|
93
|
+
current: PropTypes.object.isRequired
|
|
94
|
+
}).isRequired,
|
|
95
|
+
applyValue: PropTypes.func.isRequired,
|
|
96
|
+
clearButton: PropTypes.node,
|
|
97
|
+
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
98
|
+
current: PropTypes.any.isRequired
|
|
99
|
+
})]),
|
|
100
|
+
headerFilterMenu: PropTypes.node,
|
|
101
|
+
/**
|
|
102
|
+
* It is `true` if the filter either has a value or an operator with no value
|
|
103
|
+
* required is selected (e.g. `isEmpty`)
|
|
104
|
+
*/
|
|
105
|
+
isFilterActive: PropTypes.bool,
|
|
106
|
+
item: PropTypes.shape({
|
|
107
|
+
field: PropTypes.string.isRequired,
|
|
108
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
109
|
+
operator: PropTypes.string.isRequired,
|
|
110
|
+
value: PropTypes.any
|
|
111
|
+
}).isRequired
|
|
112
|
+
} : void 0;
|
|
113
|
+
export { GridFilterInputBoolean };
|