@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
package/internals/index.js
CHANGED
|
@@ -4,13 +4,16 @@ export { GridVirtualScrollerRenderZone } from '../components/virtualization/Grid
|
|
|
4
4
|
export { GridBaseColumnHeaders } from '../components/columnHeaders/GridBaseColumnHeaders';
|
|
5
5
|
export { GridColumnHeadersInner } from '../components/columnHeaders/GridColumnHeadersInner';
|
|
6
6
|
export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '../constants/defaultGridSlotsComponents';
|
|
7
|
+
export { getGridFilter } from '../components/panel/filterPanel/GridFilterPanel';
|
|
7
8
|
export { useGridRegisterPipeProcessor } from '../hooks/core/pipeProcessing';
|
|
8
9
|
export { useGridRegisterStrategyProcessor, GRID_DEFAULT_STRATEGY } from '../hooks/core/strategyProcessing';
|
|
9
10
|
export { useGridInitialization } from '../hooks/core/useGridInitialization';
|
|
10
11
|
export { useGridClipboard } from '../hooks/features/clipboard/useGridClipboard';
|
|
11
12
|
export { useGridColumnHeaders } from '../hooks/features/columnHeaders/useGridColumnHeaders';
|
|
13
|
+
export { unstable_gridHeaderFilteringEditFieldSelector, unstable_gridHeaderFilteringMenuSelector } from '../hooks/features/headerFiltering/gridHeaderFilteringSelectors';
|
|
12
14
|
export { useGridColumnMenu, columnMenuStateInitializer } from '../hooks/features/columnMenu/useGridColumnMenu';
|
|
13
15
|
export { useGridColumns, columnsStateInitializer } from '../hooks/features/columns/useGridColumns';
|
|
16
|
+
export { getTotalHeaderHeight } from '../hooks/features/columns/gridColumnsUtils';
|
|
14
17
|
export { useGridColumnSpanning } from '../hooks/features/columns/useGridColumnSpanning';
|
|
15
18
|
export { useGridColumnGrouping, columnGroupsStateInitializer } from '../hooks/features/columnGrouping/useGridColumnGrouping';
|
|
16
19
|
export { useGridDensity, densityStateInitializer } from '../hooks/features/density/useGridDensity';
|
|
@@ -32,6 +35,7 @@ export { useGridRowsMeta, rowsMetaStateInitializer } from '../hooks/features/row
|
|
|
32
35
|
export { useGridParamsApi } from '../hooks/features/rows/useGridParamsApi';
|
|
33
36
|
export { getRowIdFromRowModel } from '../hooks/features/rows/gridRowsUtils';
|
|
34
37
|
export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector } from '../hooks/features/rows/gridRowsSelector';
|
|
38
|
+
export { headerFilteringStateInitializer, useGridHeaderFiltering } from '../hooks/features/headerFiltering/useGridHeaderFiltering';
|
|
35
39
|
export { calculatePinnedRowsHeight } from '../hooks/features/rows/gridRowsUtils';
|
|
36
40
|
export { useGridRowSelection, rowSelectionStateInitializer } from '../hooks/features/rowSelection/useGridRowSelection';
|
|
37
41
|
export { useGridRowSelectionPreProcessors } from '../hooks/features/rowSelection/useGridRowSelectionPreProcessors';
|
package/internals/utils/index.js
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GridSlotsComponentsProps } from '../../models/gridSlotsComponentsProps';
|
|
2
|
+
import { GridSlotsComponent } from '../../models';
|
|
3
|
+
interface WithComponents {
|
|
4
|
+
components?: Partial<GridSlotsComponent>;
|
|
5
|
+
componentsProps?: GridSlotsComponentsProps;
|
|
6
|
+
}
|
|
7
|
+
export declare function useProps<T extends WithComponents>(allProps: T): readonly [Partial<GridSlotsComponent> | undefined, GridSlotsComponentsProps | undefined, Omit<T, "components" | "componentsProps">];
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
const _excluded = ["components", "componentsProps"];
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
/** Gathers props for the root element into a single `.forwardedProps` field */
|
|
5
|
+
function groupForwardedProps(props) {
|
|
6
|
+
var _props$forwardedProps;
|
|
7
|
+
const keys = Object.keys(props);
|
|
8
|
+
if (!keys.some(key => key.startsWith('aria-') || key.startsWith('data-'))) {
|
|
9
|
+
return props;
|
|
10
|
+
}
|
|
11
|
+
const newProps = {};
|
|
12
|
+
const forwardedProps = (_props$forwardedProps = props.forwardedProps) != null ? _props$forwardedProps : {};
|
|
13
|
+
for (let i = 0; i < keys.length; i += 1) {
|
|
14
|
+
const key = keys[i];
|
|
15
|
+
if (key.startsWith('aria-') || key.startsWith('data-')) {
|
|
16
|
+
forwardedProps[key] = props[key];
|
|
17
|
+
} else {
|
|
18
|
+
newProps[key] = props[key];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
newProps.forwardedProps = forwardedProps;
|
|
22
|
+
return newProps;
|
|
23
|
+
}
|
|
24
|
+
export function useProps(allProps) {
|
|
25
|
+
return React.useMemo(() => {
|
|
26
|
+
const {
|
|
27
|
+
components,
|
|
28
|
+
componentsProps
|
|
29
|
+
} = allProps,
|
|
30
|
+
themedProps = _objectWithoutPropertiesLoose(allProps, _excluded);
|
|
31
|
+
return [components, componentsProps, groupForwardedProps(themedProps)];
|
|
32
|
+
}, [allProps]);
|
|
33
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import { chainPropTypes } from '@mui/utils';
|
|
@@ -14,15 +15,16 @@ var DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref)
|
|
|
14
15
|
return /*#__PURE__*/_jsx(GridContextProvider, {
|
|
15
16
|
privateApiRef: privateApiRef,
|
|
16
17
|
props: props,
|
|
17
|
-
children: /*#__PURE__*/_jsxs(GridRoot, {
|
|
18
|
+
children: /*#__PURE__*/_jsxs(GridRoot, _extends({
|
|
18
19
|
className: props.className,
|
|
19
20
|
style: props.style,
|
|
20
21
|
sx: props.sx,
|
|
21
|
-
ref: ref
|
|
22
|
+
ref: ref
|
|
23
|
+
}, props.forwardedProps, {
|
|
22
24
|
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
|
|
23
25
|
VirtualScrollerComponent: DataGridVirtualScroller
|
|
24
26
|
}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
25
|
-
})
|
|
27
|
+
}))
|
|
26
28
|
});
|
|
27
29
|
});
|
|
28
30
|
export var DataGrid = /*#__PURE__*/React.memo(DataGridRaw);
|
|
@@ -184,6 +186,11 @@ DataGridRaw.propTypes = {
|
|
|
184
186
|
quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
|
|
185
187
|
quickFilterValues: PropTypes.array
|
|
186
188
|
}),
|
|
189
|
+
/**
|
|
190
|
+
* Forwarded props for the grid root element.
|
|
191
|
+
* @ignore - do not document.
|
|
192
|
+
*/
|
|
193
|
+
forwardedProps: PropTypes.object,
|
|
187
194
|
/**
|
|
188
195
|
* Function that applies CSS classes dynamically on cells.
|
|
189
196
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import
|
|
3
|
-
var _excluded = ["components", "componentsProps"];
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import { useThemeProps } from '@mui/material/styles';
|
|
6
5
|
import { GRID_DEFAULT_LOCALE_TEXT } from '../constants';
|
|
7
6
|
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '../constants/defaultGridSlotsComponents';
|
|
8
7
|
import { GridEditModes } from '../models';
|
|
9
|
-
import { computeSlots, uncapitalizeObjectKeys } from '../internals/utils';
|
|
8
|
+
import { computeSlots, useProps, uncapitalizeObjectKeys } from '../internals/utils';
|
|
10
9
|
var DATA_GRID_FORCED_PROPS = {
|
|
11
10
|
disableMultipleColumnsFiltering: true,
|
|
12
11
|
disableMultipleColumnsSorting: true,
|
|
@@ -72,13 +71,14 @@ export var DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
72
71
|
};
|
|
73
72
|
var defaultSlots = uncapitalizeObjectKeys(DATA_GRID_DEFAULT_SLOTS_COMPONENTS);
|
|
74
73
|
export var useDataGridProps = function useDataGridProps(inProps) {
|
|
75
|
-
var
|
|
74
|
+
var _useProps = useProps(useThemeProps({
|
|
76
75
|
props: inProps,
|
|
77
76
|
name: 'MuiDataGrid'
|
|
78
|
-
}),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
})),
|
|
78
|
+
_useProps2 = _slicedToArray(_useProps, 3),
|
|
79
|
+
components = _useProps2[0],
|
|
80
|
+
componentsProps = _useProps2[1],
|
|
81
|
+
themedProps = _useProps2[2];
|
|
82
82
|
var localeText = React.useMemo(function () {
|
|
83
83
|
return _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText);
|
|
84
84
|
}, [themedProps.localeText]);
|
|
@@ -17,7 +17,6 @@ export var getGridNumericQuickFilterFn = function getGridNumericQuickFilterFn(va
|
|
|
17
17
|
};
|
|
18
18
|
export var getGridNumericOperators = function getGridNumericOperators() {
|
|
19
19
|
return [{
|
|
20
|
-
label: '=',
|
|
21
20
|
value: '=',
|
|
22
21
|
getApplyFilterFn: function getApplyFilterFn(filterItem) {
|
|
23
22
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -33,7 +32,6 @@ export var getGridNumericOperators = function getGridNumericOperators() {
|
|
|
33
32
|
type: 'number'
|
|
34
33
|
}
|
|
35
34
|
}, {
|
|
36
|
-
label: '!=',
|
|
37
35
|
value: '!=',
|
|
38
36
|
getApplyFilterFn: function getApplyFilterFn(filterItem) {
|
|
39
37
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -49,7 +47,6 @@ export var getGridNumericOperators = function getGridNumericOperators() {
|
|
|
49
47
|
type: 'number'
|
|
50
48
|
}
|
|
51
49
|
}, {
|
|
52
|
-
label: '>',
|
|
53
50
|
value: '>',
|
|
54
51
|
getApplyFilterFn: function getApplyFilterFn(filterItem) {
|
|
55
52
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -68,7 +65,6 @@ export var getGridNumericOperators = function getGridNumericOperators() {
|
|
|
68
65
|
type: 'number'
|
|
69
66
|
}
|
|
70
67
|
}, {
|
|
71
|
-
label: '>=',
|
|
72
68
|
value: '>=',
|
|
73
69
|
getApplyFilterFn: function getApplyFilterFn(filterItem) {
|
|
74
70
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -87,7 +83,6 @@ export var getGridNumericOperators = function getGridNumericOperators() {
|
|
|
87
83
|
type: 'number'
|
|
88
84
|
}
|
|
89
85
|
}, {
|
|
90
|
-
label: '<',
|
|
91
86
|
value: '<',
|
|
92
87
|
getApplyFilterFn: function getApplyFilterFn(filterItem) {
|
|
93
88
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -106,7 +101,6 @@ export var getGridNumericOperators = function getGridNumericOperators() {
|
|
|
106
101
|
type: 'number'
|
|
107
102
|
}
|
|
108
103
|
}, {
|
|
109
|
-
label: '<=',
|
|
110
104
|
value: '<=',
|
|
111
105
|
getApplyFilterFn: function getApplyFilterFn(filterItem) {
|
|
112
106
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -4,11 +4,10 @@ var _excluded = ["innerRef", "className", "visibleColumns", "sortColumnLookup",
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useGridColumnHeaders } from '../hooks/features/columnHeaders/useGridColumnHeaders';
|
|
7
|
-
import { GridScrollArea } from './GridScrollArea';
|
|
8
7
|
import { GridBaseColumnHeaders } from './columnHeaders/GridBaseColumnHeaders';
|
|
9
8
|
import { GridColumnHeadersInner } from './columnHeaders/GridColumnHeadersInner';
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
11
|
var GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnsHeaders(props, ref) {
|
|
13
12
|
var innerRef = props.innerRef,
|
|
14
13
|
className = props.className,
|
|
@@ -49,18 +48,14 @@ var GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnsHeader
|
|
|
49
48
|
getInnerProps = _useGridColumnHeaders.getInnerProps,
|
|
50
49
|
getColumnHeaders = _useGridColumnHeaders.getColumnHeaders,
|
|
51
50
|
getColumnGroupHeaders = _useGridColumnHeaders.getColumnGroupHeaders;
|
|
52
|
-
return /*#__PURE__*/
|
|
51
|
+
return /*#__PURE__*/_jsx(GridBaseColumnHeaders, _extends({
|
|
53
52
|
ref: ref
|
|
54
53
|
}, getRootProps(other), {
|
|
55
|
-
children:
|
|
56
|
-
scrollDirection: "left"
|
|
57
|
-
}), /*#__PURE__*/_jsxs(GridColumnHeadersInner, _extends({
|
|
54
|
+
children: /*#__PURE__*/_jsxs(GridColumnHeadersInner, _extends({
|
|
58
55
|
isDragging: isDragging
|
|
59
56
|
}, getInnerProps(), {
|
|
60
57
|
children: [getColumnGroupHeaders(), getColumnHeaders()]
|
|
61
|
-
}))
|
|
62
|
-
scrollDirection: "right"
|
|
63
|
-
})]
|
|
58
|
+
}))
|
|
64
59
|
}));
|
|
65
60
|
});
|
|
66
61
|
process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes = {
|
|
@@ -183,9 +183,9 @@ function GridActionsCell(props) {
|
|
|
183
183
|
ref: buttonRef,
|
|
184
184
|
id: buttonId,
|
|
185
185
|
"aria-label": apiRef.current.getLocaleText('actionsCellMore'),
|
|
186
|
-
"aria-
|
|
187
|
-
"aria-expanded": open
|
|
188
|
-
"aria-
|
|
186
|
+
"aria-haspopup": "menu",
|
|
187
|
+
"aria-expanded": open,
|
|
188
|
+
"aria-controls": open ? menuId : undefined,
|
|
189
189
|
role: "menuitem",
|
|
190
190
|
size: "small",
|
|
191
191
|
onClick: showMenu,
|
|
@@ -120,7 +120,10 @@ var GridEditInputCell = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
120
120
|
type: colDef.type === 'number' ? colDef.type : 'text',
|
|
121
121
|
value: valueState != null ? valueState : '',
|
|
122
122
|
onChange: handleChange,
|
|
123
|
-
endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
123
|
+
endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
124
|
+
fontSize: "small",
|
|
125
|
+
color: "action"
|
|
126
|
+
}) : undefined
|
|
124
127
|
}, other));
|
|
125
128
|
});
|
|
126
129
|
process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
@@ -8,6 +8,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
11
|
+
import { GridCellEditStopReasons } from '../../models/params/gridEditCellParams';
|
|
11
12
|
import { isEscapeKey } from '../../utils/keyboardUtils';
|
|
12
13
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
13
14
|
import { GridEditModes } from '../../models/gridEditRowModel';
|
|
@@ -123,11 +124,10 @@ function GridEditSingleSelectCell(props) {
|
|
|
123
124
|
return;
|
|
124
125
|
}
|
|
125
126
|
if (reason === 'backdropClick' || isEscapeKey(event.key)) {
|
|
126
|
-
apiRef.current.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
});
|
|
127
|
+
var params = apiRef.current.getCellParams(id, field);
|
|
128
|
+
apiRef.current.publishEvent('cellEditStop', _extends({}, params, {
|
|
129
|
+
reason: isEscapeKey(event.key) ? GridCellEditStopReasons.escapeKeyDown : GridCellEditStopReasons.cellFocusOut
|
|
130
|
+
}));
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
133
|
var handleOpen = function handleOpen(event) {
|
|
@@ -45,9 +45,9 @@ export var ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(function (props) {
|
|
|
45
45
|
"aria-label": apiRef.current.getLocaleText('columnMenuLabel'),
|
|
46
46
|
size: "small",
|
|
47
47
|
onClick: handleMenuIconClick,
|
|
48
|
-
"aria-
|
|
49
|
-
"aria-
|
|
50
|
-
"aria-controls": columnMenuId,
|
|
48
|
+
"aria-haspopup": "menu",
|
|
49
|
+
"aria-expanded": open,
|
|
50
|
+
"aria-controls": open ? columnMenuId : undefined,
|
|
51
51
|
id: columnMenuButtonId
|
|
52
52
|
}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseIconButton, {
|
|
53
53
|
children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuIcon, {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
4
|
+
import { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils';
|
|
5
5
|
import Badge from '@mui/material/Badge';
|
|
6
|
+
import { useGridSelector } from '../../hooks';
|
|
6
7
|
import { gridPreferencePanelStateSelector } from '../../hooks/features/preferencesPanel/gridPreferencePanelSelector';
|
|
7
8
|
import { GridPreferencePanelsValue } from '../../hooks/features/preferencesPanel/gridPreferencePanelsValue';
|
|
8
9
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
@@ -29,6 +30,9 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
29
30
|
classes: rootProps.classes
|
|
30
31
|
});
|
|
31
32
|
var classes = useUtilityClasses(ownerState);
|
|
33
|
+
var preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
34
|
+
var labelId = useId();
|
|
35
|
+
var panelId = useId();
|
|
32
36
|
var toggleFilter = React.useCallback(function (event) {
|
|
33
37
|
event.preventDefault();
|
|
34
38
|
event.stopPropagation();
|
|
@@ -38,21 +42,26 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
38
42
|
if (open && openedPanelValue === GridPreferencePanelsValue.filters) {
|
|
39
43
|
apiRef.current.hideFilterPanel();
|
|
40
44
|
} else {
|
|
41
|
-
apiRef.current.showFilterPanel();
|
|
45
|
+
apiRef.current.showFilterPanel(undefined, panelId, labelId);
|
|
42
46
|
}
|
|
43
47
|
if (onClick) {
|
|
44
48
|
onClick(apiRef.current.getColumnHeaderParams(field), event);
|
|
45
49
|
}
|
|
46
|
-
}, [apiRef, field, onClick]);
|
|
50
|
+
}, [apiRef, field, onClick, panelId, labelId]);
|
|
47
51
|
if (!counter) {
|
|
48
52
|
return null;
|
|
49
53
|
}
|
|
54
|
+
var open = preferencePanel.open && preferencePanel.labelId === labelId;
|
|
50
55
|
var iconButton = /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
56
|
+
id: labelId,
|
|
51
57
|
onClick: toggleFilter,
|
|
52
58
|
color: "default",
|
|
53
59
|
"aria-label": apiRef.current.getLocaleText('columnHeaderFiltersLabel'),
|
|
54
60
|
size: "small",
|
|
55
|
-
tabIndex: -1
|
|
61
|
+
tabIndex: -1,
|
|
62
|
+
"aria-haspopup": "menu",
|
|
63
|
+
"aria-expanded": open,
|
|
64
|
+
"aria-controls": open ? panelId : undefined
|
|
56
65
|
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
57
66
|
children: /*#__PURE__*/_jsx(rootProps.slots.columnFilteredIcon, {
|
|
58
67
|
className: classes.icon,
|
|
@@ -64,9 +64,7 @@ var GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
64
64
|
role: "grid",
|
|
65
65
|
"aria-colcount": visibleColumns.length,
|
|
66
66
|
"aria-rowcount": headerGroupingMaxDepth + 1 + pinnedRowsCount + totalRowCount,
|
|
67
|
-
"aria-multiselectable": !rootProps.disableMultipleRowSelection
|
|
68
|
-
"aria-label": rootProps['aria-label'],
|
|
69
|
-
"aria-labelledby": rootProps['aria-labelledby']
|
|
67
|
+
"aria-multiselectable": !rootProps.disableMultipleRowSelection
|
|
70
68
|
}, other, {
|
|
71
69
|
children: children
|
|
72
70
|
}));
|
|
@@ -17,7 +17,9 @@ export var GridPreferencesPanel = /*#__PURE__*/React.forwardRef(function GridPre
|
|
|
17
17
|
return /*#__PURE__*/_jsx(rootProps.slots.panel, _extends({
|
|
18
18
|
ref: ref,
|
|
19
19
|
as: rootProps.slots.basePopper,
|
|
20
|
-
open: columns.length > 0 && preferencePanelState.open
|
|
20
|
+
open: columns.length > 0 && preferencePanelState.open,
|
|
21
|
+
id: preferencePanelState.panelId,
|
|
22
|
+
"aria-labelledby": preferencePanelState.labelId
|
|
21
23
|
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.panel, props, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.basePopper, {
|
|
22
24
|
children: panelContent
|
|
23
25
|
}));
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["item", "applyValue", "apiRef", "focusElementRef"];
|
|
4
|
+
var _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "headerFilterMenu", "isFilterActive", "clearButton", "tabIndex", "label"];
|
|
5
5
|
import * as React from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
6
7
|
import { unstable_useId as useId } from '@mui/utils';
|
|
8
|
+
import { styled } from '@mui/material/styles';
|
|
7
9
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
8
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
|
|
12
|
+
var BooleanOperatorContainer = styled('div')({
|
|
13
|
+
display: 'flex',
|
|
14
|
+
alignItems: 'flex-end',
|
|
15
|
+
width: '100%'
|
|
16
|
+
});
|
|
17
|
+
function GridFilterInputBoolean(props) {
|
|
11
18
|
var _rootProps$slotProps, _baseSelectProps$nati, _rootProps$slotProps2, _rootProps$slotProps3;
|
|
12
19
|
var item = props.item,
|
|
13
20
|
applyValue = props.applyValue,
|
|
14
21
|
apiRef = props.apiRef,
|
|
15
22
|
focusElementRef = props.focusElementRef,
|
|
23
|
+
headerFilterMenu = props.headerFilterMenu,
|
|
24
|
+
isFilterActive = props.isFilterActive,
|
|
25
|
+
clearButton = props.clearButton,
|
|
26
|
+
tabIndex = props.tabIndex,
|
|
27
|
+
labelProp = props.label,
|
|
16
28
|
others = _objectWithoutProperties(props, _excluded);
|
|
17
29
|
var _React$useState = React.useState(item.value || ''),
|
|
18
30
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -34,39 +46,71 @@ export function GridFilterInputBoolean(props) {
|
|
|
34
46
|
React.useEffect(function () {
|
|
35
47
|
setFilterValueState(item.value || '');
|
|
36
48
|
}, [item.value]);
|
|
37
|
-
var label = apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
38
|
-
return /*#__PURE__*/_jsxs(
|
|
39
|
-
children: [/*#__PURE__*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
inputProps: {
|
|
54
|
-
ref: focusElementRef
|
|
55
|
-
}
|
|
56
|
-
}, others, baseSelectProps, {
|
|
57
|
-
children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
49
|
+
var label = labelProp != null ? labelProp : apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
50
|
+
return /*#__PURE__*/_jsxs(BooleanOperatorContainer, {
|
|
51
|
+
children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {
|
|
52
|
+
fullWidth: true,
|
|
53
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseInputLabel, {
|
|
54
|
+
id: labelId,
|
|
55
|
+
shrink: true,
|
|
56
|
+
variant: "standard",
|
|
57
|
+
children: label
|
|
58
|
+
})), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
|
|
59
|
+
labelId: labelId,
|
|
60
|
+
id: selectId,
|
|
61
|
+
label: label,
|
|
62
|
+
value: filterValueState,
|
|
63
|
+
onChange: onFilterChange,
|
|
64
|
+
variant: "standard",
|
|
58
65
|
native: isSelectNative,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
displayEmpty: true,
|
|
67
|
+
startAdornment: isFilterActive ? headerFilterMenu : null,
|
|
68
|
+
inputProps: {
|
|
69
|
+
ref: focusElementRef,
|
|
70
|
+
tabIndex: tabIndex
|
|
71
|
+
}
|
|
72
|
+
}, others, baseSelectProps, {
|
|
73
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
74
|
+
native: isSelectNative,
|
|
75
|
+
value: "",
|
|
76
|
+
children: apiRef.current.getLocaleText('filterValueAny')
|
|
77
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
78
|
+
native: isSelectNative,
|
|
79
|
+
value: "true",
|
|
80
|
+
children: apiRef.current.getLocaleText('filterValueTrue')
|
|
81
|
+
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
82
|
+
native: isSelectNative,
|
|
83
|
+
value: "false",
|
|
84
|
+
children: apiRef.current.getLocaleText('filterValueFalse')
|
|
85
|
+
}))]
|
|
69
86
|
}))]
|
|
70
|
-
})
|
|
87
|
+
}), clearButton]
|
|
71
88
|
});
|
|
72
|
-
}
|
|
89
|
+
}
|
|
90
|
+
process.env.NODE_ENV !== "production" ? GridFilterInputBoolean.propTypes = {
|
|
91
|
+
// ----------------------------- Warning --------------------------------
|
|
92
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
93
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
94
|
+
// ----------------------------------------------------------------------
|
|
95
|
+
apiRef: PropTypes.shape({
|
|
96
|
+
current: PropTypes.object.isRequired
|
|
97
|
+
}).isRequired,
|
|
98
|
+
applyValue: PropTypes.func.isRequired,
|
|
99
|
+
clearButton: PropTypes.node,
|
|
100
|
+
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
101
|
+
current: PropTypes.any.isRequired
|
|
102
|
+
})]),
|
|
103
|
+
headerFilterMenu: PropTypes.node,
|
|
104
|
+
/**
|
|
105
|
+
* It is `true` if the filter either has a value or an operator with no value
|
|
106
|
+
* required is selected (e.g. `isEmpty`)
|
|
107
|
+
*/
|
|
108
|
+
isFilterActive: PropTypes.bool,
|
|
109
|
+
item: PropTypes.shape({
|
|
110
|
+
field: PropTypes.string.isRequired,
|
|
111
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
112
|
+
operator: PropTypes.string.isRequired,
|
|
113
|
+
value: PropTypes.any
|
|
114
|
+
}).isRequired
|
|
115
|
+
} : void 0;
|
|
116
|
+
export { GridFilterInputBoolean };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps"];
|
|
4
|
+
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "headerFilterMenu", "isFilterActive", "clearButton", "tabIndex", "disabled"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -16,6 +16,11 @@ function GridFilterInputDate(props) {
|
|
|
16
16
|
apiRef = props.apiRef,
|
|
17
17
|
focusElementRef = props.focusElementRef,
|
|
18
18
|
InputProps = props.InputProps,
|
|
19
|
+
headerFilterMenu = props.headerFilterMenu,
|
|
20
|
+
isFilterActive = props.isFilterActive,
|
|
21
|
+
clearButton = props.clearButton,
|
|
22
|
+
tabIndex = props.tabIndex,
|
|
23
|
+
disabled = props.disabled,
|
|
19
24
|
other = _objectWithoutProperties(props, _excluded);
|
|
20
25
|
var filterTimeout = React.useRef();
|
|
21
26
|
var _React$useState = React.useState((_item$value = item.value) != null ? _item$value : ''),
|
|
@@ -51,6 +56,7 @@ function GridFilterInputDate(props) {
|
|
|
51
56
|
setFilterValueState(String(itemValue));
|
|
52
57
|
}, [item.value]);
|
|
53
58
|
return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
|
|
59
|
+
fullWidth: true,
|
|
54
60
|
id: id,
|
|
55
61
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
56
62
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
@@ -62,11 +68,19 @@ function GridFilterInputDate(props) {
|
|
|
62
68
|
shrink: true
|
|
63
69
|
},
|
|
64
70
|
inputRef: focusElementRef,
|
|
65
|
-
InputProps: _extends({}, applying ? {
|
|
66
|
-
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
67
|
-
|
|
71
|
+
InputProps: _extends({}, applying || clearButton ? {
|
|
72
|
+
endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
73
|
+
fontSize: "small",
|
|
74
|
+
color: "action"
|
|
75
|
+
}) : clearButton
|
|
76
|
+
} : {}, headerFilterMenu && isFilterActive ? {
|
|
77
|
+
startAdornment: headerFilterMenu
|
|
78
|
+
} : {}, {
|
|
79
|
+
disabled: disabled
|
|
80
|
+
}, InputProps, {
|
|
68
81
|
inputProps: _extends({
|
|
69
|
-
max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31'
|
|
82
|
+
max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31',
|
|
83
|
+
tabIndex: tabIndex
|
|
70
84
|
}, InputProps == null ? void 0 : InputProps.inputProps)
|
|
71
85
|
})
|
|
72
86
|
}, other, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTextField));
|
|
@@ -80,7 +94,14 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
|
|
|
80
94
|
current: PropTypes.object.isRequired
|
|
81
95
|
}).isRequired,
|
|
82
96
|
applyValue: PropTypes.func.isRequired,
|
|
97
|
+
clearButton: PropTypes.node,
|
|
83
98
|
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
99
|
+
headerFilterMenu: PropTypes.node,
|
|
100
|
+
/**
|
|
101
|
+
* It is `true` if the filter either has a value or an operator with no value
|
|
102
|
+
* required is selected (e.g. `isEmpty`)
|
|
103
|
+
*/
|
|
104
|
+
isFilterActive: PropTypes.bool,
|
|
84
105
|
item: PropTypes.shape({
|
|
85
106
|
field: PropTypes.string.isRequired,
|
|
86
107
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|