@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"];
|
|
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';
|
|
@@ -14,7 +14,13 @@ function GridFilterInputValue(props) {
|
|
|
14
14
|
applyValue,
|
|
15
15
|
type,
|
|
16
16
|
apiRef,
|
|
17
|
-
focusElementRef
|
|
17
|
+
focusElementRef,
|
|
18
|
+
tabIndex,
|
|
19
|
+
disabled,
|
|
20
|
+
headerFilterMenu,
|
|
21
|
+
isFilterActive,
|
|
22
|
+
clearButton,
|
|
23
|
+
InputProps
|
|
18
24
|
} = props,
|
|
19
25
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
20
26
|
const filterTimeout = React.useRef();
|
|
@@ -46,9 +52,6 @@ function GridFilterInputValue(props) {
|
|
|
46
52
|
const itemValue = (_item$value2 = item.value) != null ? _item$value2 : '';
|
|
47
53
|
setFilterValueState(String(itemValue));
|
|
48
54
|
}, [item.value]);
|
|
49
|
-
const InputProps = applying ? {
|
|
50
|
-
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {})
|
|
51
|
-
} : others.InputProps;
|
|
52
55
|
return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
|
|
53
56
|
id: id,
|
|
54
57
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
@@ -57,7 +60,20 @@ function GridFilterInputValue(props) {
|
|
|
57
60
|
onChange: onFilterChange,
|
|
58
61
|
variant: "standard",
|
|
59
62
|
type: type || 'text',
|
|
60
|
-
InputProps:
|
|
63
|
+
InputProps: _extends({}, applying || clearButton ? {
|
|
64
|
+
endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
65
|
+
fontSize: "small",
|
|
66
|
+
color: "action"
|
|
67
|
+
}) : clearButton
|
|
68
|
+
} : {}, headerFilterMenu && isFilterActive ? {
|
|
69
|
+
startAdornment: headerFilterMenu
|
|
70
|
+
} : {}, {
|
|
71
|
+
disabled
|
|
72
|
+
}, InputProps, {
|
|
73
|
+
inputProps: _extends({
|
|
74
|
+
tabIndex
|
|
75
|
+
}, InputProps == null ? void 0 : InputProps.inputProps)
|
|
76
|
+
}),
|
|
61
77
|
InputLabelProps: {
|
|
62
78
|
shrink: true
|
|
63
79
|
},
|
|
@@ -73,7 +89,14 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
|
|
|
73
89
|
current: PropTypes.object.isRequired
|
|
74
90
|
}).isRequired,
|
|
75
91
|
applyValue: PropTypes.func.isRequired,
|
|
92
|
+
clearButton: PropTypes.node,
|
|
76
93
|
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
94
|
+
headerFilterMenu: PropTypes.node,
|
|
95
|
+
/**
|
|
96
|
+
* It is `true` if the filter either has a value or an operator with no value
|
|
97
|
+
* required is selected (e.g. `isEmpty`)
|
|
98
|
+
*/
|
|
99
|
+
isFilterActive: PropTypes.bool,
|
|
77
100
|
item: PropTypes.shape({
|
|
78
101
|
field: PropTypes.string.isRequired,
|
|
79
102
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -29,5 +29,6 @@ export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'logicOp
|
|
|
29
29
|
*/
|
|
30
30
|
children?: React.ReactNode;
|
|
31
31
|
}
|
|
32
|
+
declare const getGridFilter: (col: GridStateColDef) => GridFilterItem;
|
|
32
33
|
declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
-
export { GridFilterPanel };
|
|
34
|
+
export { GridFilterPanel, getGridFilter };
|
|
@@ -209,4 +209,4 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
|
|
|
209
209
|
*/
|
|
210
210
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
211
211
|
} : void 0;
|
|
212
|
-
export { GridFilterPanel };
|
|
212
|
+
export { GridFilterPanel, getGridFilter };
|
|
@@ -2,7 +2,9 @@ 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';
|
|
8
|
+
export type { GetColumnForNewFilterArgs } from './GridFilterPanel';
|
|
7
9
|
export * from './GridFilterInputMultipleValue';
|
|
8
10
|
export * from './GridFilterInputMultipleSingleSelect';
|
|
@@ -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';
|
|
@@ -14,17 +15,16 @@ export const GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function G
|
|
|
14
15
|
onClick
|
|
15
16
|
} = props,
|
|
16
17
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
18
|
+
const columnButtonId = useId();
|
|
19
|
+
const columnPanelId = useId();
|
|
17
20
|
const apiRef = useGridApiContext();
|
|
18
21
|
const rootProps = useGridRootProps();
|
|
19
|
-
const
|
|
20
|
-
open,
|
|
21
|
-
openedPanelValue
|
|
22
|
-
} = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
22
|
+
const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
23
23
|
const showColumns = event => {
|
|
24
|
-
if (open && openedPanelValue === GridPreferencePanelsValue.columns) {
|
|
24
|
+
if (preferencePanel.open && preferencePanel.openedPanelValue === GridPreferencePanelsValue.columns) {
|
|
25
25
|
apiRef.current.hidePreferences();
|
|
26
26
|
} else {
|
|
27
|
-
apiRef.current.showPreferences(GridPreferencePanelsValue.columns);
|
|
27
|
+
apiRef.current.showPreferences(GridPreferencePanelsValue.columns, columnPanelId, columnButtonId);
|
|
28
28
|
}
|
|
29
29
|
onClick == null ? void 0 : onClick(event);
|
|
30
30
|
};
|
|
@@ -33,10 +33,15 @@ export const GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function G
|
|
|
33
33
|
if (rootProps.disableColumnSelector) {
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
|
+
const isOpen = preferencePanel.open && preferencePanel.panelId === columnPanelId;
|
|
36
37
|
return /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
|
|
37
38
|
ref: ref,
|
|
39
|
+
id: columnButtonId,
|
|
38
40
|
size: "small",
|
|
39
41
|
"aria-label": apiRef.current.getLocaleText('toolbarColumnsLabel'),
|
|
42
|
+
"aria-haspopup": "menu",
|
|
43
|
+
"aria-expanded": isOpen,
|
|
44
|
+
"aria-controls": isOpen ? columnPanelId : undefined,
|
|
40
45
|
startIcon: /*#__PURE__*/_jsx(rootProps.slots.columnSelectorIcon, {})
|
|
41
46
|
}, other, {
|
|
42
47
|
onClick: showColumns
|
|
@@ -94,9 +94,9 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
94
94
|
size: "small",
|
|
95
95
|
startIcon: startIcon,
|
|
96
96
|
"aria-label": apiRef.current.getLocaleText('toolbarDensityLabel'),
|
|
97
|
-
"aria-expanded": open ? 'true' : undefined,
|
|
98
97
|
"aria-haspopup": "menu",
|
|
99
|
-
"aria-
|
|
98
|
+
"aria-expanded": open,
|
|
99
|
+
"aria-controls": open ? densityMenuId : undefined,
|
|
100
100
|
id: densityButtonId
|
|
101
101
|
}, other, {
|
|
102
102
|
onClick: handleDensitySelectorOpen
|
|
@@ -19,7 +19,7 @@ export interface GridToolbarExportProps extends ButtonProps {
|
|
|
19
19
|
printOptions?: GridPrintExportOptions & GridExportDisplayOptions;
|
|
20
20
|
[key: string]: any;
|
|
21
21
|
}
|
|
22
|
-
export declare function GridCsvExportMenuItem(props: GridCsvExportMenuItemProps): JSX.Element;
|
|
23
|
-
export declare function GridPrintExportMenuItem(props: GridPrintExportMenuItemProps): JSX.Element;
|
|
22
|
+
export declare function GridCsvExportMenuItem(props: GridCsvExportMenuItemProps): React.JSX.Element;
|
|
23
|
+
export declare function GridPrintExportMenuItem(props: GridPrintExportMenuItemProps): React.JSX.Element;
|
|
24
24
|
declare const GridToolbarExport: React.ForwardRefExoticComponent<Omit<GridToolbarExportProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
25
25
|
export { GridToolbarExport };
|
|
@@ -20,8 +20,8 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
|
|
|
20
20
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
21
21
|
const apiRef = useGridApiContext();
|
|
22
22
|
const rootProps = useGridRootProps();
|
|
23
|
-
const
|
|
24
|
-
const
|
|
23
|
+
const exportButtonId = useId();
|
|
24
|
+
const exportMenuId = useId();
|
|
25
25
|
const [open, setOpen] = React.useState(false);
|
|
26
26
|
const buttonRef = React.useRef(null);
|
|
27
27
|
const handleRef = useForkRef(ref, buttonRef);
|
|
@@ -54,11 +54,11 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
|
|
|
54
54
|
ref: handleRef,
|
|
55
55
|
size: "small",
|
|
56
56
|
startIcon: /*#__PURE__*/_jsx(rootProps.slots.exportIcon, {}),
|
|
57
|
-
"aria-expanded": open
|
|
57
|
+
"aria-expanded": open,
|
|
58
58
|
"aria-label": apiRef.current.getLocaleText('toolbarExportLabel'),
|
|
59
59
|
"aria-haspopup": "menu",
|
|
60
|
-
"aria-
|
|
61
|
-
id:
|
|
60
|
+
"aria-controls": open ? exportMenuId : undefined,
|
|
61
|
+
id: exportButtonId
|
|
62
62
|
}, other, {
|
|
63
63
|
onClick: handleMenuOpen
|
|
64
64
|
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseButton, {
|
|
@@ -69,9 +69,9 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
|
|
|
69
69
|
onClickAway: handleMenuClickAway,
|
|
70
70
|
position: "bottom-start",
|
|
71
71
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
72
|
-
id:
|
|
72
|
+
id: exportMenuId,
|
|
73
73
|
className: gridClasses.menuList,
|
|
74
|
-
"aria-labelledby":
|
|
74
|
+
"aria-labelledby": exportButtonId,
|
|
75
75
|
onKeyDown: handleListKeyDown,
|
|
76
76
|
autoFocusItem: open,
|
|
77
77
|
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
|
}) => ({
|
|
@@ -48,6 +48,8 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
48
48
|
const lookup = useGridSelector(apiRef, gridColumnLookupSelector);
|
|
49
49
|
const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
50
50
|
const classes = useUtilityClasses(rootProps);
|
|
51
|
+
const filterButtonId = useId();
|
|
52
|
+
const filterPanelId = useId();
|
|
51
53
|
const tooltipContentNode = React.useMemo(() => {
|
|
52
54
|
if (preferencePanel.open) {
|
|
53
55
|
return apiRef.current.getLocaleText('toolbarFiltersTooltipHide');
|
|
@@ -83,9 +85,9 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
83
85
|
openedPanelValue
|
|
84
86
|
} = preferencePanel;
|
|
85
87
|
if (open && openedPanelValue === GridPreferencePanelsValue.filters) {
|
|
86
|
-
apiRef.current.
|
|
88
|
+
apiRef.current.hidePreferences();
|
|
87
89
|
} else {
|
|
88
|
-
apiRef.current.
|
|
90
|
+
apiRef.current.showPreferences(GridPreferencePanelsValue.filters, filterPanelId, filterButtonId);
|
|
89
91
|
}
|
|
90
92
|
(_buttonProps$onClick = buttonProps.onClick) == null ? void 0 : _buttonProps$onClick.call(buttonProps, event);
|
|
91
93
|
};
|
|
@@ -94,14 +96,19 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
94
96
|
if (rootProps.disableColumnFilter) {
|
|
95
97
|
return null;
|
|
96
98
|
}
|
|
99
|
+
const isOpen = preferencePanel.open && preferencePanel.panelId === filterPanelId;
|
|
97
100
|
return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
|
|
98
101
|
title: tooltipContentNode,
|
|
99
102
|
enterDelay: 1000
|
|
100
103
|
}, other, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTooltip, {
|
|
101
104
|
children: /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
|
|
102
105
|
ref: ref,
|
|
106
|
+
id: filterButtonId,
|
|
103
107
|
size: "small",
|
|
104
108
|
"aria-label": apiRef.current.getLocaleText('toolbarFiltersLabel'),
|
|
109
|
+
"aria-controls": isOpen ? filterPanelId : undefined,
|
|
110
|
+
"aria-expanded": isOpen,
|
|
111
|
+
"aria-haspopup": true,
|
|
105
112
|
startIcon: /*#__PURE__*/_jsx(Badge, {
|
|
106
113
|
badgeContent: activeFilters.length,
|
|
107
114
|
color: "primary",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { TextFieldProps } from '@mui/material/TextField';
|
|
3
3
|
import { GridFilterModel } from '../../models/gridFilterModel';
|
|
4
4
|
export type GridToolbarQuickFilterProps = TextFieldProps & {
|
|
@@ -20,7 +20,7 @@ export type GridToolbarQuickFilterProps = TextFieldProps & {
|
|
|
20
20
|
*/
|
|
21
21
|
debounceMs?: number;
|
|
22
22
|
};
|
|
23
|
-
declare function GridToolbarQuickFilter(props: GridToolbarQuickFilterProps): JSX.Element;
|
|
23
|
+
declare function GridToolbarQuickFilter(props: GridToolbarQuickFilterProps): React.JSX.Element;
|
|
24
24
|
declare namespace GridToolbarQuickFilter {
|
|
25
25
|
var propTypes: any;
|
|
26
26
|
}
|
|
@@ -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',
|
|
@@ -5,5 +5,5 @@ type GridContextProviderProps = {
|
|
|
5
5
|
props: {};
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
};
|
|
8
|
-
export declare function GridContextProvider({ privateApiRef, props, children }: GridContextProviderProps): JSX.Element;
|
|
8
|
+
export declare function GridContextProvider({ privateApiRef, props, children }: GridContextProviderProps): React.JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GridRowTreeCreationParams, GridRowTreeCreationValue } from '../../features/rows/gridRowsInterfaces';
|
|
2
|
-
import { GridFilteringMethodParams, GridFilteringMethodValue } from '../../features/filter/gridFilterState';
|
|
1
|
+
import { GridRowTreeCreationParams, GridRowTreeCreationValue, GridRowsState } from '../../features/rows/gridRowsInterfaces';
|
|
2
|
+
import { GridFilteringMethodParams, GridFilteringMethodValue, GridFilterState, GridVisibleRowsLookupState } from '../../features/filter/gridFilterState';
|
|
3
3
|
import { GridSortingMethodParams, GridSortingMethodValue } from '../../features/sorting/gridSortingState';
|
|
4
4
|
export type GridStrategyProcessorName = keyof GridStrategyProcessingLookup;
|
|
5
5
|
export type GridStrategyGroup = GridStrategyProcessingLookup[keyof GridStrategyProcessingLookup]['group'];
|
|
@@ -19,6 +19,14 @@ export interface GridStrategyProcessingLookup {
|
|
|
19
19
|
params: GridSortingMethodParams;
|
|
20
20
|
value: GridSortingMethodValue;
|
|
21
21
|
};
|
|
22
|
+
visibleRowsLookupCreation: {
|
|
23
|
+
group: 'rowTree';
|
|
24
|
+
params: {
|
|
25
|
+
tree: GridRowsState['tree'];
|
|
26
|
+
filteredRowsLookup: GridFilterState['filteredRowsLookup'];
|
|
27
|
+
};
|
|
28
|
+
value: GridVisibleRowsLookupState;
|
|
29
|
+
};
|
|
22
30
|
}
|
|
23
31
|
export type GridStrategyProcessor<P extends GridStrategyProcessorName> = (params: GridStrategyProcessingLookup[P]['params']) => GridStrategyProcessingLookup[P]['value'];
|
|
24
32
|
export interface GridStrategyProcessingApi {
|
|
@@ -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)
|
|
@@ -25,14 +25,21 @@ export interface UseGridColumnHeadersProps {
|
|
|
25
25
|
columnGroupsHeaderStructure: GridGroupingStructure[][];
|
|
26
26
|
hasOtherElementInTabSequence: boolean;
|
|
27
27
|
}
|
|
28
|
-
interface GetHeadersParams {
|
|
28
|
+
export interface GetHeadersParams {
|
|
29
29
|
renderContext: GridRenderContext | null;
|
|
30
30
|
minFirstColumn?: number;
|
|
31
31
|
maxLastColumn?: number;
|
|
32
32
|
}
|
|
33
33
|
export declare const useGridColumnHeaders: (props: UseGridColumnHeadersProps) => {
|
|
34
34
|
renderContext: GridRenderContext | null;
|
|
35
|
-
getColumnHeaders: (params?: GetHeadersParams, other?: {}) => JSX.Element | null;
|
|
35
|
+
getColumnHeaders: (params?: GetHeadersParams, other?: {}) => React.JSX.Element | null;
|
|
36
|
+
getColumnsToRender: (params?: GetHeadersParams) => {
|
|
37
|
+
renderedColumns: GridStateColDef[];
|
|
38
|
+
firstColumnToRender: number;
|
|
39
|
+
lastColumnToRender: number;
|
|
40
|
+
minFirstColumn: number;
|
|
41
|
+
maxLastColumn: number;
|
|
42
|
+
} | null;
|
|
36
43
|
getColumnGroupHeaders: (params?: GetHeadersParams) => JSX.Element[] | null;
|
|
37
44
|
isDragging: boolean;
|
|
38
45
|
getRootProps: (other?: {}) => {
|
|
@@ -46,5 +53,5 @@ export declare const useGridColumnHeaders: (props: UseGridColumnHeadersProps) =>
|
|
|
46
53
|
ref: ((instance: HTMLDivElement | null) => void) | null;
|
|
47
54
|
role: string;
|
|
48
55
|
};
|
|
56
|
+
headerHeight: number;
|
|
49
57
|
};
|
|
50
|
-
export {};
|
|
@@ -263,7 +263,7 @@ export const useGridColumnHeaders = props => {
|
|
|
263
263
|
const tabIndex = columnGroupHeaderTabIndexState !== null && columnGroupHeaderTabIndexState.depth === depth && columnFields.includes(columnGroupHeaderTabIndexState.field) ? 0 : -1;
|
|
264
264
|
const headerInfo = {
|
|
265
265
|
groupId,
|
|
266
|
-
width: columnFields.
|
|
266
|
+
width: columnFields.reduce((acc, field) => acc + apiRef.current.getColumn(field).computedWidth, 0),
|
|
267
267
|
fields: columnFields,
|
|
268
268
|
colIndex: columnIndex,
|
|
269
269
|
hasFocus,
|
|
@@ -319,6 +319,7 @@ export const useGridColumnHeaders = props => {
|
|
|
319
319
|
return {
|
|
320
320
|
renderContext,
|
|
321
321
|
getColumnHeaders,
|
|
322
|
+
getColumnsToRender,
|
|
322
323
|
getColumnGroupHeaders,
|
|
323
324
|
isDragging: !!dragCol,
|
|
324
325
|
getRootProps: (other = {}) => _extends({
|
|
@@ -327,6 +328,7 @@ export const useGridColumnHeaders = props => {
|
|
|
327
328
|
getInnerProps: () => ({
|
|
328
329
|
ref: handleInnerRef,
|
|
329
330
|
role: 'rowgroup'
|
|
330
|
-
})
|
|
331
|
+
}),
|
|
332
|
+
headerHeight
|
|
331
333
|
};
|
|
332
334
|
};
|
|
@@ -155,8 +155,8 @@ export function useGridDimensions(apiRef, props) {
|
|
|
155
155
|
if (!mainEl) {
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
-
const height = mainEl.
|
|
159
|
-
const width = mainEl.
|
|
158
|
+
const height = mainEl.clientHeight || 0;
|
|
159
|
+
const width = mainEl.clientWidth || 0;
|
|
160
160
|
const win = ownerWindow(mainEl);
|
|
161
161
|
const computedStyle = win.getComputedStyle(mainEl);
|
|
162
162
|
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) => {
|
|
@@ -11,10 +11,10 @@ export declare const gridFilterModelSelector: import("../../../utils/createSelec
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const gridQuickFilterValuesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, any[] | undefined>;
|
|
13
13
|
/**
|
|
14
|
-
* @category
|
|
14
|
+
* @category Visible rows
|
|
15
15
|
* @ignore - do not document.
|
|
16
16
|
*/
|
|
17
|
-
export declare const gridVisibleRowsLookupSelector:
|
|
17
|
+
export declare const gridVisibleRowsLookupSelector: (state: GridStateCommunity) => import("./gridFilterState").GridVisibleRowsLookupState;
|
|
18
18
|
/**
|
|
19
19
|
* @category Filtering
|
|
20
20
|
* @ignore - do not document.
|
|
@@ -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
|
|
@@ -17,12 +17,6 @@ export interface GridFilterState {
|
|
|
17
17
|
* This is the equivalent of the `visibleRowsLookup` if all the groups were expanded.
|
|
18
18
|
*/
|
|
19
19
|
filteredRowsLookup: Record<GridRowId, boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Visibility status for each row.
|
|
22
|
-
* A row is visible if it is passing the filters AND if its parents are expanded.
|
|
23
|
-
* If a row is not registered in this lookup, it is visible.
|
|
24
|
-
*/
|
|
25
|
-
visibleRowsLookup: Record<GridRowId, boolean>;
|
|
26
20
|
/**
|
|
27
21
|
* Amount of descendants that are passing the filters.
|
|
28
22
|
* For the Tree Data, it includes all the intermediate depth levels (= amount of children + amount of grand children + ...).
|
|
@@ -47,3 +41,9 @@ export interface GridFilteringMethodParams {
|
|
|
47
41
|
filterModel: GridFilterModel;
|
|
48
42
|
}
|
|
49
43
|
export type GridFilteringMethodValue = Omit<GridFilterState, 'filterModel'>;
|
|
44
|
+
/**
|
|
45
|
+
* Visibility status for each row.
|
|
46
|
+
* A row is visible if it is passing the filters AND if its parents are expanded.
|
|
47
|
+
* If a row is not registered in this lookup, it is visible.
|
|
48
|
+
*/
|
|
49
|
+
export type GridVisibleRowsLookupState = Record<GridRowId, boolean>;
|
|
@@ -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
|
*/
|
|
@@ -20,11 +20,21 @@ export const filterStateInitializer = (state, props, apiRef) => {
|
|
|
20
20
|
return _extends({}, state, {
|
|
21
21
|
filter: {
|
|
22
22
|
filterModel: sanitizeFilterModel(filterModel, props.disableMultipleColumnsFiltering, apiRef),
|
|
23
|
-
visibleRowsLookup: {},
|
|
24
23
|
filteredDescendantCountLookup: {}
|
|
25
|
-
}
|
|
24
|
+
},
|
|
25
|
+
visibleRowsLookup: {}
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
|
+
const getVisibleRowsLookup = params => {
|
|
29
|
+
// For flat tree, the `visibleRowsLookup` and the `filteredRowsLookup` are equals since no row is collapsed.
|
|
30
|
+
return params.filteredRowsLookup;
|
|
31
|
+
};
|
|
32
|
+
function getVisibleRowsLookupState(apiRef, state) {
|
|
33
|
+
return apiRef.current.applyStrategyProcessor('visibleRowsLookupCreation', {
|
|
34
|
+
tree: state.rows.tree,
|
|
35
|
+
filteredRowsLookup: state.filter.filteredRowsLookup
|
|
36
|
+
});
|
|
37
|
+
}
|
|
28
38
|
|
|
29
39
|
/**
|
|
30
40
|
* @requires useGridColumns (method, event)
|
|
@@ -49,9 +59,13 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
49
59
|
isRowMatchingFilters,
|
|
50
60
|
filterModel: filterModel != null ? filterModel : getDefaultGridFilterModel()
|
|
51
61
|
});
|
|
52
|
-
|
|
62
|
+
const newState = _extends({}, state, {
|
|
53
63
|
filter: _extends({}, state.filter, filteringResult)
|
|
54
64
|
});
|
|
65
|
+
const visibleRowsLookupState = getVisibleRowsLookupState(apiRef, newState);
|
|
66
|
+
return _extends({}, newState, {
|
|
67
|
+
visibleRowsLookup: visibleRowsLookupState
|
|
68
|
+
});
|
|
55
69
|
});
|
|
56
70
|
apiRef.current.publishEvent('filteredRowsSet');
|
|
57
71
|
}, [props.filterMode, apiRef]);
|
|
@@ -107,7 +121,7 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
107
121
|
items
|
|
108
122
|
}), 'deleteFilterItem');
|
|
109
123
|
}, [apiRef]);
|
|
110
|
-
const showFilterPanel = React.useCallback(targetColumnField => {
|
|
124
|
+
const showFilterPanel = React.useCallback((targetColumnField, panelId, labelId) => {
|
|
111
125
|
logger.debug('Displaying filter panel');
|
|
112
126
|
if (targetColumnField) {
|
|
113
127
|
const filterModel = gridFilterModelSelector(apiRef);
|
|
@@ -153,7 +167,7 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
153
167
|
items: newFilterItems
|
|
154
168
|
}));
|
|
155
169
|
}
|
|
156
|
-
apiRef.current.showPreferences(GridPreferencePanelsValue.filters);
|
|
170
|
+
apiRef.current.showPreferences(GridPreferencePanelsValue.filters, panelId, labelId);
|
|
157
171
|
}, [apiRef, logger, props.disableMultipleColumnsFiltering]);
|
|
158
172
|
const hideFilterPanel = React.useCallback(() => {
|
|
159
173
|
logger.debug('Hiding filter panel');
|
|
@@ -262,13 +276,10 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
262
276
|
}
|
|
263
277
|
return {
|
|
264
278
|
filteredRowsLookup,
|
|
265
|
-
// For flat tree, the `visibleRowsLookup` and the `filteredRowsLookup` are equals since no row is collapsed.
|
|
266
|
-
visibleRowsLookup: filteredRowsLookup,
|
|
267
279
|
filteredDescendantCountLookup: {}
|
|
268
280
|
};
|
|
269
281
|
}
|
|
270
282
|
return {
|
|
271
|
-
visibleRowsLookup: {},
|
|
272
283
|
filteredRowsLookup: {},
|
|
273
284
|
filteredDescendantCountLookup: {}
|
|
274
285
|
};
|
|
@@ -278,6 +289,7 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
278
289
|
useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
279
290
|
useGridRegisterPipeProcessor(apiRef, 'preferencePanel', preferencePanelPreProcessing);
|
|
280
291
|
useGridRegisterStrategyProcessor(apiRef, GRID_DEFAULT_STRATEGY, 'filtering', flatFilteringMethod);
|
|
292
|
+
useGridRegisterStrategyProcessor(apiRef, GRID_DEFAULT_STRATEGY, 'visibleRowsLookupCreation', getVisibleRowsLookup);
|
|
281
293
|
|
|
282
294
|
/**
|
|
283
295
|
* EVENTS
|
|
@@ -298,13 +310,21 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
298
310
|
apiRef.current.unstable_applyFilters();
|
|
299
311
|
}
|
|
300
312
|
}, [apiRef]);
|
|
313
|
+
const updateVisibleRowsLookupState = React.useCallback(() => {
|
|
314
|
+
apiRef.current.setState(state => {
|
|
315
|
+
return _extends({}, state, {
|
|
316
|
+
visibleRowsLookup: getVisibleRowsLookupState(apiRef, state)
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
apiRef.current.forceUpdate();
|
|
320
|
+
}, [apiRef]);
|
|
301
321
|
|
|
302
322
|
// Do not call `apiRef.current.forceUpdate` to avoid re-render before updating the sorted rows.
|
|
303
323
|
// Otherwise, the state is not consistent during the render
|
|
304
324
|
useGridApiEventHandler(apiRef, 'rowsSet', updateFilteredRows);
|
|
305
|
-
useGridApiEventHandler(apiRef, 'rowExpansionChange', apiRef.current.unstable_applyFilters);
|
|
306
325
|
useGridApiEventHandler(apiRef, 'columnsChange', handleColumnsChange);
|
|
307
326
|
useGridApiEventHandler(apiRef, 'activeStrategyProcessorChange', handleStrategyProcessorChange);
|
|
327
|
+
useGridApiEventHandler(apiRef, 'rowExpansionChange', updateVisibleRowsLookupState);
|
|
308
328
|
|
|
309
329
|
/**
|
|
310
330
|
* 1ST RENDER
|
|
@@ -9,10 +9,12 @@ export type GridColumnGroupIdentifier = {
|
|
|
9
9
|
export interface GridFocusState {
|
|
10
10
|
cell: GridCellCoordinates | null;
|
|
11
11
|
columnHeader: GridColumnIdentifier | null;
|
|
12
|
+
columnHeaderFilter: GridColumnIdentifier | null;
|
|
12
13
|
columnGroupHeader: GridColumnGroupIdentifier | null;
|
|
13
14
|
}
|
|
14
15
|
export interface GridTabIndexState {
|
|
15
16
|
cell: GridCellCoordinates | null;
|
|
16
17
|
columnHeader: GridColumnIdentifier | null;
|
|
18
|
+
columnHeaderFilter: GridColumnIdentifier | null;
|
|
17
19
|
columnGroupHeader: GridColumnGroupIdentifier | null;
|
|
18
20
|
}
|
|
@@ -3,8 +3,10 @@ import { GridFocusState, GridTabIndexState } from './gridFocusState';
|
|
|
3
3
|
export declare const gridFocusStateSelector: (state: GridStateCommunity) => GridFocusState;
|
|
4
4
|
export declare const gridFocusCellSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("../../..").GridCellCoordinates | null>;
|
|
5
5
|
export declare const gridFocusColumnHeaderSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridFocusState").GridColumnIdentifier | null>;
|
|
6
|
+
export declare const unstable_gridFocusColumnHeaderFilterSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridFocusState").GridColumnIdentifier | null>;
|
|
6
7
|
export declare const unstable_gridFocusColumnGroupHeaderSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridFocusState").GridColumnGroupIdentifier | null>;
|
|
7
8
|
export declare const gridTabIndexStateSelector: (state: GridStateCommunity) => GridTabIndexState;
|
|
8
9
|
export declare const gridTabIndexCellSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("../../..").GridCellCoordinates | null>;
|
|
9
10
|
export declare const gridTabIndexColumnHeaderSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridFocusState").GridColumnIdentifier | null>;
|
|
11
|
+
export declare const unstable_gridTabIndexColumnHeaderFilterSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridFocusState").GridColumnIdentifier | null>;
|
|
10
12
|
export declare const unstable_gridTabIndexColumnGroupHeaderSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridFocusState").GridColumnGroupIdentifier | null>;
|