@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
|
@@ -1,6 +1,6 @@
|
|
|
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"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "headerFilterMenu", "isFilterActive", "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';
|
|
@@ -14,7 +14,12 @@ function GridFilterInputDate(props) {
|
|
|
14
14
|
type,
|
|
15
15
|
apiRef,
|
|
16
16
|
focusElementRef,
|
|
17
|
-
InputProps
|
|
17
|
+
InputProps,
|
|
18
|
+
headerFilterMenu,
|
|
19
|
+
isFilterActive,
|
|
20
|
+
clearButton,
|
|
21
|
+
tabIndex,
|
|
22
|
+
disabled
|
|
18
23
|
} = props,
|
|
19
24
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
20
25
|
const filterTimeout = React.useRef();
|
|
@@ -44,6 +49,7 @@ function GridFilterInputDate(props) {
|
|
|
44
49
|
setFilterValueState(String(itemValue));
|
|
45
50
|
}, [item.value]);
|
|
46
51
|
return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
|
|
52
|
+
fullWidth: true,
|
|
47
53
|
id: id,
|
|
48
54
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
49
55
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
@@ -55,11 +61,19 @@ function GridFilterInputDate(props) {
|
|
|
55
61
|
shrink: true
|
|
56
62
|
},
|
|
57
63
|
inputRef: focusElementRef,
|
|
58
|
-
InputProps: _extends({}, applying ? {
|
|
59
|
-
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
60
|
-
|
|
64
|
+
InputProps: _extends({}, applying || clearButton ? {
|
|
65
|
+
endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
66
|
+
fontSize: "small",
|
|
67
|
+
color: "action"
|
|
68
|
+
}) : clearButton
|
|
69
|
+
} : {}, headerFilterMenu && isFilterActive ? {
|
|
70
|
+
startAdornment: headerFilterMenu
|
|
71
|
+
} : {}, {
|
|
72
|
+
disabled
|
|
73
|
+
}, InputProps, {
|
|
61
74
|
inputProps: _extends({
|
|
62
|
-
max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31'
|
|
75
|
+
max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31',
|
|
76
|
+
tabIndex
|
|
63
77
|
}, InputProps?.inputProps)
|
|
64
78
|
})
|
|
65
79
|
}, other, rootProps.slotProps?.baseTextField));
|
|
@@ -73,7 +87,14 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
|
|
|
73
87
|
current: PropTypes.object.isRequired
|
|
74
88
|
}).isRequired,
|
|
75
89
|
applyValue: PropTypes.func.isRequired,
|
|
90
|
+
clearButton: PropTypes.node,
|
|
76
91
|
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
92
|
+
headerFilterMenu: PropTypes.node,
|
|
93
|
+
/**
|
|
94
|
+
* It is `true` if the filter either has a value or an operator with no value
|
|
95
|
+
* required is selected (e.g. `isEmpty`)
|
|
96
|
+
*/
|
|
97
|
+
isFilterActive: PropTypes.bool,
|
|
77
98
|
item: PropTypes.shape({
|
|
78
99
|
field: PropTypes.string.isRequired,
|
|
79
100
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -1,9 +1,10 @@
|
|
|
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", "getOptionLabel", "getOptionValue"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "headerFilterMenu", "isFilterActive", "clearButton"];
|
|
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';
|
|
7
8
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
8
9
|
import { getValueFromValueOptions, isSingleSelectColDef } from './filterPanelUtils';
|
|
9
10
|
import { createElement as _createElement } from "react";
|
|
@@ -33,6 +34,11 @@ const renderSingleSelectOptions = ({
|
|
|
33
34
|
}), label);
|
|
34
35
|
});
|
|
35
36
|
};
|
|
37
|
+
const SingleSelectOperatorContainer = styled('div')({
|
|
38
|
+
display: 'flex',
|
|
39
|
+
alignItems: 'flex-end',
|
|
40
|
+
width: '100%'
|
|
41
|
+
});
|
|
36
42
|
function GridFilterInputSingleSelect(props) {
|
|
37
43
|
const {
|
|
38
44
|
item,
|
|
@@ -41,7 +47,13 @@ function GridFilterInputSingleSelect(props) {
|
|
|
41
47
|
apiRef,
|
|
42
48
|
focusElementRef,
|
|
43
49
|
getOptionLabel: getOptionLabelProp,
|
|
44
|
-
getOptionValue: getOptionValueProp
|
|
50
|
+
getOptionValue: getOptionValueProp,
|
|
51
|
+
placeholder,
|
|
52
|
+
tabIndex,
|
|
53
|
+
label: labelProp,
|
|
54
|
+
headerFilterMenu,
|
|
55
|
+
isFilterActive,
|
|
56
|
+
clearButton
|
|
45
57
|
} = props,
|
|
46
58
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
47
59
|
const [filterValueState, setFilterValueState] = React.useState(item.value ?? '');
|
|
@@ -99,36 +111,41 @@ function GridFilterInputSingleSelect(props) {
|
|
|
99
111
|
if (!isSingleSelectColDef(resolvedColumn)) {
|
|
100
112
|
return null;
|
|
101
113
|
}
|
|
102
|
-
const label = apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
103
|
-
return /*#__PURE__*/_jsxs(
|
|
104
|
-
children: [/*#__PURE__*/
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
114
|
+
const label = labelProp ?? apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
115
|
+
return /*#__PURE__*/_jsxs(SingleSelectOperatorContainer, {
|
|
116
|
+
children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {
|
|
117
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, rootProps.slotProps?.baseInputLabel, {
|
|
118
|
+
id: labelId,
|
|
119
|
+
htmlFor: id,
|
|
120
|
+
shrink: true,
|
|
121
|
+
variant: "standard",
|
|
122
|
+
children: label
|
|
123
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
124
|
+
id: id,
|
|
125
|
+
label: label,
|
|
126
|
+
labelId: labelId,
|
|
127
|
+
value: filterValueState,
|
|
128
|
+
onChange: onFilterChange,
|
|
129
|
+
startAdornment: isFilterActive ? headerFilterMenu : null,
|
|
130
|
+
variant: "standard",
|
|
131
|
+
type: type || 'text',
|
|
132
|
+
inputProps: {
|
|
133
|
+
tabIndex,
|
|
134
|
+
ref: focusElementRef,
|
|
135
|
+
placeholder: placeholder ?? apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
136
|
+
},
|
|
137
|
+
native: isSelectNative
|
|
138
|
+
}, others, rootProps.slotProps?.baseSelect, {
|
|
139
|
+
children: renderSingleSelectOptions({
|
|
140
|
+
column: resolvedColumn,
|
|
141
|
+
OptionComponent: rootProps.slots.baseSelectOption,
|
|
142
|
+
getOptionLabel,
|
|
143
|
+
getOptionValue,
|
|
144
|
+
isSelectNative,
|
|
145
|
+
baseSelectOptionProps: rootProps.slotProps?.baseSelectOption
|
|
146
|
+
})
|
|
147
|
+
}))]
|
|
148
|
+
}), clearButton]
|
|
132
149
|
});
|
|
133
150
|
}
|
|
134
151
|
process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes = {
|
|
@@ -140,6 +157,7 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
|
|
|
140
157
|
current: PropTypes.object.isRequired
|
|
141
158
|
}).isRequired,
|
|
142
159
|
applyValue: PropTypes.func.isRequired,
|
|
160
|
+
clearButton: PropTypes.node,
|
|
143
161
|
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
144
162
|
/**
|
|
145
163
|
* Used to determine the label displayed for a given value option.
|
|
@@ -153,6 +171,12 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
|
|
|
153
171
|
* @returns {string} The value to be used.
|
|
154
172
|
*/
|
|
155
173
|
getOptionValue: PropTypes.func,
|
|
174
|
+
headerFilterMenu: PropTypes.node,
|
|
175
|
+
/**
|
|
176
|
+
* It is `true` if the filter either has a value or an operator with no value
|
|
177
|
+
* required is selected (e.g. `isEmpty`)
|
|
178
|
+
*/
|
|
179
|
+
isFilterActive: PropTypes.bool,
|
|
156
180
|
item: PropTypes.shape({
|
|
157
181
|
field: PropTypes.string.isRequired,
|
|
158
182
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -1,6 +1,6 @@
|
|
|
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"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "headerFilterMenu", "isFilterActive", "clearButton", "InputProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -13,7 +13,13 @@ function GridFilterInputValue(props) {
|
|
|
13
13
|
applyValue,
|
|
14
14
|
type,
|
|
15
15
|
apiRef,
|
|
16
|
-
focusElementRef
|
|
16
|
+
focusElementRef,
|
|
17
|
+
tabIndex,
|
|
18
|
+
disabled,
|
|
19
|
+
headerFilterMenu,
|
|
20
|
+
isFilterActive,
|
|
21
|
+
clearButton,
|
|
22
|
+
InputProps
|
|
17
23
|
} = props,
|
|
18
24
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
19
25
|
const filterTimeout = React.useRef();
|
|
@@ -44,9 +50,6 @@ function GridFilterInputValue(props) {
|
|
|
44
50
|
const itemValue = item.value ?? '';
|
|
45
51
|
setFilterValueState(String(itemValue));
|
|
46
52
|
}, [item.value]);
|
|
47
|
-
const InputProps = applying ? {
|
|
48
|
-
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {})
|
|
49
|
-
} : others.InputProps;
|
|
50
53
|
return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
|
|
51
54
|
id: id,
|
|
52
55
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
@@ -55,7 +58,20 @@ function GridFilterInputValue(props) {
|
|
|
55
58
|
onChange: onFilterChange,
|
|
56
59
|
variant: "standard",
|
|
57
60
|
type: type || 'text',
|
|
58
|
-
InputProps:
|
|
61
|
+
InputProps: _extends({}, applying || clearButton ? {
|
|
62
|
+
endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
63
|
+
fontSize: "small",
|
|
64
|
+
color: "action"
|
|
65
|
+
}) : clearButton
|
|
66
|
+
} : {}, headerFilterMenu && isFilterActive ? {
|
|
67
|
+
startAdornment: headerFilterMenu
|
|
68
|
+
} : {}, {
|
|
69
|
+
disabled
|
|
70
|
+
}, InputProps, {
|
|
71
|
+
inputProps: _extends({
|
|
72
|
+
tabIndex
|
|
73
|
+
}, InputProps?.inputProps)
|
|
74
|
+
}),
|
|
59
75
|
InputLabelProps: {
|
|
60
76
|
shrink: true
|
|
61
77
|
},
|
|
@@ -71,7 +87,14 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
|
|
|
71
87
|
current: PropTypes.object.isRequired
|
|
72
88
|
}).isRequired,
|
|
73
89
|
applyValue: PropTypes.func.isRequired,
|
|
90
|
+
clearButton: PropTypes.node,
|
|
74
91
|
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
92
|
+
headerFilterMenu: PropTypes.node,
|
|
93
|
+
/**
|
|
94
|
+
* It is `true` if the filter either has a value or an operator with no value
|
|
95
|
+
* required is selected (e.g. `isEmpty`)
|
|
96
|
+
*/
|
|
97
|
+
isFilterActive: PropTypes.bool,
|
|
75
98
|
item: PropTypes.shape({
|
|
76
99
|
field: PropTypes.string.isRequired,
|
|
77
100
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -205,4 +205,4 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
|
|
|
205
205
|
*/
|
|
206
206
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
207
207
|
} : void 0;
|
|
208
|
-
export { GridFilterPanel };
|
|
208
|
+
export { GridFilterPanel, getGridFilter };
|
|
@@ -2,7 +2,8 @@ export * from './GridFilterForm';
|
|
|
2
2
|
export * from './GridFilterInputValue';
|
|
3
3
|
export * from './GridFilterInputDate';
|
|
4
4
|
export * from './GridFilterInputSingleSelect';
|
|
5
|
+
export * from './GridFilterInputBoolean';
|
|
5
6
|
export * from './GridFilterInputValueProps';
|
|
6
|
-
export
|
|
7
|
+
export { GridFilterPanel } from './GridFilterPanel';
|
|
7
8
|
export * from './GridFilterInputMultipleValue';
|
|
8
9
|
export * from './GridFilterInputMultipleSingleSelect';
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["onClick"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import { unstable_useId as useId } from '@mui/material/utils';
|
|
5
6
|
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
6
7
|
import { gridPreferencePanelStateSelector } from '../../hooks/features/preferencesPanel/gridPreferencePanelSelector';
|
|
7
8
|
import { GridPreferencePanelsValue } from '../../hooks/features/preferencesPanel/gridPreferencePanelsValue';
|
|
@@ -13,17 +14,16 @@ export const GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function G
|
|
|
13
14
|
onClick
|
|
14
15
|
} = props,
|
|
15
16
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
17
|
+
const columnButtonId = useId();
|
|
18
|
+
const columnPanelId = useId();
|
|
16
19
|
const apiRef = useGridApiContext();
|
|
17
20
|
const rootProps = useGridRootProps();
|
|
18
|
-
const
|
|
19
|
-
open,
|
|
20
|
-
openedPanelValue
|
|
21
|
-
} = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
21
|
+
const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
22
22
|
const showColumns = event => {
|
|
23
|
-
if (open && openedPanelValue === GridPreferencePanelsValue.columns) {
|
|
23
|
+
if (preferencePanel.open && preferencePanel.openedPanelValue === GridPreferencePanelsValue.columns) {
|
|
24
24
|
apiRef.current.hidePreferences();
|
|
25
25
|
} else {
|
|
26
|
-
apiRef.current.showPreferences(GridPreferencePanelsValue.columns);
|
|
26
|
+
apiRef.current.showPreferences(GridPreferencePanelsValue.columns, columnPanelId, columnButtonId);
|
|
27
27
|
}
|
|
28
28
|
onClick?.(event);
|
|
29
29
|
};
|
|
@@ -32,10 +32,15 @@ export const GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function G
|
|
|
32
32
|
if (rootProps.disableColumnSelector) {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
|
+
const isOpen = preferencePanel.open && preferencePanel.panelId === columnPanelId;
|
|
35
36
|
return /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
|
|
36
37
|
ref: ref,
|
|
38
|
+
id: columnButtonId,
|
|
37
39
|
size: "small",
|
|
38
40
|
"aria-label": apiRef.current.getLocaleText('toolbarColumnsLabel'),
|
|
41
|
+
"aria-haspopup": "menu",
|
|
42
|
+
"aria-expanded": isOpen,
|
|
43
|
+
"aria-controls": isOpen ? columnPanelId : undefined,
|
|
39
44
|
startIcon: /*#__PURE__*/_jsx(rootProps.slots.columnSelectorIcon, {})
|
|
40
45
|
}, other, {
|
|
41
46
|
onClick: showColumns
|
|
@@ -93,9 +93,9 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
93
93
|
size: "small",
|
|
94
94
|
startIcon: startIcon,
|
|
95
95
|
"aria-label": apiRef.current.getLocaleText('toolbarDensityLabel'),
|
|
96
|
-
"aria-expanded": open ? 'true' : undefined,
|
|
97
96
|
"aria-haspopup": "menu",
|
|
98
|
-
"aria-
|
|
97
|
+
"aria-expanded": open,
|
|
98
|
+
"aria-controls": open ? densityMenuId : undefined,
|
|
99
99
|
id: densityButtonId
|
|
100
100
|
}, other, {
|
|
101
101
|
onClick: handleDensitySelectorOpen
|
|
@@ -19,8 +19,8 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
|
|
|
19
19
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
20
20
|
const apiRef = useGridApiContext();
|
|
21
21
|
const rootProps = useGridRootProps();
|
|
22
|
-
const
|
|
23
|
-
const
|
|
22
|
+
const exportButtonId = useId();
|
|
23
|
+
const exportMenuId = useId();
|
|
24
24
|
const [open, setOpen] = React.useState(false);
|
|
25
25
|
const buttonRef = React.useRef(null);
|
|
26
26
|
const handleRef = useForkRef(ref, buttonRef);
|
|
@@ -53,11 +53,11 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
|
|
|
53
53
|
ref: handleRef,
|
|
54
54
|
size: "small",
|
|
55
55
|
startIcon: /*#__PURE__*/_jsx(rootProps.slots.exportIcon, {}),
|
|
56
|
-
"aria-expanded": open
|
|
56
|
+
"aria-expanded": open,
|
|
57
57
|
"aria-label": apiRef.current.getLocaleText('toolbarExportLabel'),
|
|
58
58
|
"aria-haspopup": "menu",
|
|
59
|
-
"aria-
|
|
60
|
-
id:
|
|
59
|
+
"aria-controls": open ? exportMenuId : undefined,
|
|
60
|
+
id: exportButtonId
|
|
61
61
|
}, other, {
|
|
62
62
|
onClick: handleMenuOpen
|
|
63
63
|
}, rootProps.slotProps?.baseButton, {
|
|
@@ -68,9 +68,9 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
|
|
|
68
68
|
onClickAway: handleMenuClickAway,
|
|
69
69
|
position: "bottom-start",
|
|
70
70
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
71
|
-
id:
|
|
71
|
+
id: exportMenuId,
|
|
72
72
|
className: gridClasses.menuList,
|
|
73
|
-
"aria-labelledby":
|
|
73
|
+
"aria-labelledby": exportButtonId,
|
|
74
74
|
onKeyDown: handleListKeyDown,
|
|
75
75
|
autoFocusItem: open,
|
|
76
76
|
children: React.Children.map(children, child => {
|
|
@@ -4,7 +4,7 @@ const _excluded = ["componentsProps"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
|
-
import { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize } from '@mui/utils';
|
|
7
|
+
import { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize, unstable_useId as useId } from '@mui/utils';
|
|
8
8
|
import Badge from '@mui/material/Badge';
|
|
9
9
|
import { gridColumnLookupSelector } from '../../hooks/features/columns/gridColumnsSelector';
|
|
10
10
|
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
@@ -28,7 +28,7 @@ const useUtilityClasses = ownerState => {
|
|
|
28
28
|
const GridToolbarFilterListRoot = styled('ul', {
|
|
29
29
|
name: 'MuiDataGrid',
|
|
30
30
|
slot: 'ToolbarFilterList',
|
|
31
|
-
overridesResolver: (
|
|
31
|
+
overridesResolver: (_props, styles) => styles.toolbarFilterList
|
|
32
32
|
})(({
|
|
33
33
|
theme
|
|
34
34
|
}) => ({
|
|
@@ -47,6 +47,8 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
47
47
|
const lookup = useGridSelector(apiRef, gridColumnLookupSelector);
|
|
48
48
|
const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
49
49
|
const classes = useUtilityClasses(rootProps);
|
|
50
|
+
const filterButtonId = useId();
|
|
51
|
+
const filterPanelId = useId();
|
|
50
52
|
const tooltipContentNode = React.useMemo(() => {
|
|
51
53
|
if (preferencePanel.open) {
|
|
52
54
|
return apiRef.current.getLocaleText('toolbarFiltersTooltipHide');
|
|
@@ -81,9 +83,9 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
81
83
|
openedPanelValue
|
|
82
84
|
} = preferencePanel;
|
|
83
85
|
if (open && openedPanelValue === GridPreferencePanelsValue.filters) {
|
|
84
|
-
apiRef.current.
|
|
86
|
+
apiRef.current.hidePreferences();
|
|
85
87
|
} else {
|
|
86
|
-
apiRef.current.
|
|
88
|
+
apiRef.current.showPreferences(GridPreferencePanelsValue.filters, filterPanelId, filterButtonId);
|
|
87
89
|
}
|
|
88
90
|
buttonProps.onClick?.(event);
|
|
89
91
|
};
|
|
@@ -92,14 +94,19 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
92
94
|
if (rootProps.disableColumnFilter) {
|
|
93
95
|
return null;
|
|
94
96
|
}
|
|
97
|
+
const isOpen = preferencePanel.open && preferencePanel.panelId === filterPanelId;
|
|
95
98
|
return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
|
|
96
99
|
title: tooltipContentNode,
|
|
97
100
|
enterDelay: 1000
|
|
98
101
|
}, other, rootProps.slotProps?.baseTooltip, {
|
|
99
102
|
children: /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
|
|
100
103
|
ref: ref,
|
|
104
|
+
id: filterButtonId,
|
|
101
105
|
size: "small",
|
|
102
106
|
"aria-label": apiRef.current.getLocaleText('toolbarFiltersLabel'),
|
|
107
|
+
"aria-controls": isOpen ? filterPanelId : undefined,
|
|
108
|
+
"aria-expanded": isOpen,
|
|
109
|
+
"aria-haspopup": true,
|
|
103
110
|
startIcon: /*#__PURE__*/_jsx(Badge, {
|
|
104
111
|
badgeContent: activeFilters.length,
|
|
105
112
|
color: "primary",
|
|
@@ -58,6 +58,32 @@ export const GRID_DEFAULT_LOCALE_TEXT = {
|
|
|
58
58
|
filterOperatorIsEmpty: 'is empty',
|
|
59
59
|
filterOperatorIsNotEmpty: 'is not empty',
|
|
60
60
|
filterOperatorIsAnyOf: 'is any of',
|
|
61
|
+
'filterOperator=': '=',
|
|
62
|
+
'filterOperator!=': '!=',
|
|
63
|
+
'filterOperator>': '>',
|
|
64
|
+
'filterOperator>=': '>=',
|
|
65
|
+
'filterOperator<': '<',
|
|
66
|
+
'filterOperator<=': '<=',
|
|
67
|
+
// Header filter operators text
|
|
68
|
+
headerFilterOperatorContains: 'Contains',
|
|
69
|
+
headerFilterOperatorEquals: 'Equals',
|
|
70
|
+
headerFilterOperatorStartsWith: 'Starts with',
|
|
71
|
+
headerFilterOperatorEndsWith: 'Ends with',
|
|
72
|
+
headerFilterOperatorIs: 'Is',
|
|
73
|
+
headerFilterOperatorNot: 'Is not',
|
|
74
|
+
headerFilterOperatorAfter: 'Is after',
|
|
75
|
+
headerFilterOperatorOnOrAfter: 'Is on or after',
|
|
76
|
+
headerFilterOperatorBefore: 'Is before',
|
|
77
|
+
headerFilterOperatorOnOrBefore: 'Is on or before',
|
|
78
|
+
headerFilterOperatorIsEmpty: 'Is empty',
|
|
79
|
+
headerFilterOperatorIsNotEmpty: 'Is not empty',
|
|
80
|
+
headerFilterOperatorIsAnyOf: 'Is any of',
|
|
81
|
+
'headerFilterOperator=': 'Equals',
|
|
82
|
+
'headerFilterOperator!=': 'Not equals',
|
|
83
|
+
'headerFilterOperator>': 'Is greater than',
|
|
84
|
+
'headerFilterOperator>=': 'Is greater than or equal to',
|
|
85
|
+
'headerFilterOperator<': 'Is less than',
|
|
86
|
+
'headerFilterOperator<=': 'Is less than or equal to',
|
|
61
87
|
// Filter values text
|
|
62
88
|
filterValueAny: 'any',
|
|
63
89
|
filterValueTrue: 'true',
|
|
@@ -6,7 +6,8 @@ export const GRID_DEFAULT_STRATEGY = 'none';
|
|
|
6
6
|
export const GRID_STRATEGIES_PROCESSORS = {
|
|
7
7
|
rowTreeCreation: 'rowTree',
|
|
8
8
|
filtering: 'rowTree',
|
|
9
|
-
sorting: 'rowTree'
|
|
9
|
+
sorting: 'rowTree',
|
|
10
|
+
visibleRowsLookupCreation: 'rowTree'
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
12
13
|
* Implements a variant of the Strategy Pattern (see https://en.wikipedia.org/wiki/Strategy_pattern)
|
|
@@ -260,7 +260,7 @@ export const useGridColumnHeaders = props => {
|
|
|
260
260
|
const tabIndex = columnGroupHeaderTabIndexState !== null && columnGroupHeaderTabIndexState.depth === depth && columnFields.includes(columnGroupHeaderTabIndexState.field) ? 0 : -1;
|
|
261
261
|
const headerInfo = {
|
|
262
262
|
groupId,
|
|
263
|
-
width: columnFields.
|
|
263
|
+
width: columnFields.reduce((acc, field) => acc + apiRef.current.getColumn(field).computedWidth, 0),
|
|
264
264
|
fields: columnFields,
|
|
265
265
|
colIndex: columnIndex,
|
|
266
266
|
hasFocus,
|
|
@@ -316,6 +316,7 @@ export const useGridColumnHeaders = props => {
|
|
|
316
316
|
return {
|
|
317
317
|
renderContext,
|
|
318
318
|
getColumnHeaders,
|
|
319
|
+
getColumnsToRender,
|
|
319
320
|
getColumnGroupHeaders,
|
|
320
321
|
isDragging: !!dragCol,
|
|
321
322
|
getRootProps: (other = {}) => _extends({
|
|
@@ -324,6 +325,7 @@ export const useGridColumnHeaders = props => {
|
|
|
324
325
|
getInnerProps: () => ({
|
|
325
326
|
ref: handleInnerRef,
|
|
326
327
|
role: 'rowgroup'
|
|
327
|
-
})
|
|
328
|
+
}),
|
|
329
|
+
headerHeight
|
|
328
330
|
};
|
|
329
331
|
};
|
|
@@ -153,8 +153,8 @@ export function useGridDimensions(apiRef, props) {
|
|
|
153
153
|
if (!mainEl) {
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
|
-
const height = mainEl.
|
|
157
|
-
const width = mainEl.
|
|
156
|
+
const height = mainEl.clientHeight || 0;
|
|
157
|
+
const width = mainEl.clientWidth || 0;
|
|
158
158
|
const win = ownerWindow(mainEl);
|
|
159
159
|
const computedStyle = win.getComputedStyle(mainEl);
|
|
160
160
|
const paddingLeft = parseInt(computedStyle.paddingLeft, 10) || 0;
|
|
@@ -29,9 +29,6 @@ export const useGridEditing = (apiRef, props) => {
|
|
|
29
29
|
if (isCellEditableProp) {
|
|
30
30
|
return isCellEditableProp(params);
|
|
31
31
|
}
|
|
32
|
-
if (params.rowNode.type === 'pinnedRow') {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
32
|
return true;
|
|
36
33
|
}, [isCellEditableProp]);
|
|
37
34
|
const maybeDebounce = (id, field, debounceMs, callback) => {
|
|
@@ -21,10 +21,10 @@ export const gridFilterModelSelector = createSelector(gridFilterStateSelector, f
|
|
|
21
21
|
export const gridQuickFilterValuesSelector = createSelector(gridFilterModelSelector, filterModel => filterModel.quickFilterValues);
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* @category
|
|
24
|
+
* @category Visible rows
|
|
25
25
|
* @ignore - do not document.
|
|
26
26
|
*/
|
|
27
|
-
export const gridVisibleRowsLookupSelector =
|
|
27
|
+
export const gridVisibleRowsLookupSelector = state => state.visibleRowsLookup;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* @category Filtering
|
|
@@ -9,4 +9,10 @@ export const getDefaultGridFilterModel = () => ({
|
|
|
9
9
|
/**
|
|
10
10
|
* @param {GridRowId} rowId The id of the row we want to filter.
|
|
11
11
|
* @param {(filterItem: GridFilterItem) => boolean} shouldApplyItem An optional callback to allow the filtering engine to only apply some items.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Visibility status for each row.
|
|
16
|
+
* A row is visible if it is passing the filters AND if its parents are expanded.
|
|
17
|
+
* If a row is not registered in this lookup, it is visible.
|
|
12
18
|
*/
|