@mui/x-data-grid 7.3.0 → 7.3.2
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 +155 -7
- package/DataGrid/DataGrid.js +2 -3
- package/colDef/gridDateOperators.js +7 -0
- package/components/GridFooter.js +1 -2
- package/components/GridHeader.js +1 -2
- package/components/GridHeaders.js +3 -2
- package/components/GridRow.js +1 -2
- package/components/cell/GridActionsCell.js +1 -2
- package/components/cell/GridActionsCellItem.js +1 -2
- package/components/cell/GridCell.js +5 -4
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +1 -2
- package/components/columnHeaders/GridColumnHeaderItem.js +1 -2
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +1 -2
- package/components/columnsManagement/GridColumnsManagement.js +2 -3
- package/components/containers/GridRoot.js +1 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.js +1 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -2
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +1 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -2
- package/components/panel/filterPanel/GridFilterInputDate.js +4 -4
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -2
- package/components/panel/filterPanel/GridFilterPanel.js +1 -2
- package/components/toolbar/GridToolbar.js +1 -2
- package/components/toolbar/GridToolbarDensitySelector.js +1 -2
- package/components/toolbar/GridToolbarExportContainer.js +1 -2
- package/components/toolbar/GridToolbarFilterButton.js +1 -2
- package/components/virtualization/GridVirtualScroller.js +1 -2
- package/components/virtualization/GridVirtualScrollerFiller.js +1 -2
- package/constants/localeTextConstants.js +1 -0
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -2
- package/hooks/features/columnResize/useGridColumnResize.js +16 -1
- package/hooks/features/columns/gridColumnsUtils.d.ts +3 -2
- package/hooks/features/columns/gridColumnsUtils.js +5 -4
- package/hooks/features/columns/useGridColumns.js +5 -4
- package/hooks/features/export/useGridPrintExport.js +22 -5
- package/hooks/features/filter/gridFilterSelector.d.ts +3 -12
- package/hooks/features/pagination/gridPaginationSelector.d.ts +1 -4
- package/hooks/features/rows/gridRowsUtils.d.ts +1 -1
- package/hooks/features/rows/useGridRows.js +9 -1
- package/hooks/features/sorting/gridSortingSelector.d.ts +4 -6
- package/hooks/features/sorting/gridSortingSelector.js +21 -8
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -3
- package/hooks/utils/useGridApiEventHandler.d.ts +2 -2
- package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
- package/hooks/utils/useGridSelector.d.ts +1 -1
- package/index.js +1 -1
- package/joy/icons.js +1 -2
- package/joy/joySlots.js +1 -2
- package/locales/arSD.js +1 -0
- package/locales/beBY.js +1 -0
- package/locales/bgBG.js +1 -0
- package/locales/csCZ.js +1 -0
- package/locales/daDK.js +3 -1
- package/locales/deDE.js +2 -0
- package/locales/elGR.js +1 -0
- package/locales/esES.js +2 -0
- package/locales/faIR.js +2 -0
- package/locales/fiFI.js +1 -0
- package/locales/frFR.js +2 -0
- package/locales/heIL.js +1 -0
- package/locales/hrHR.js +1 -0
- package/locales/huHU.js +1 -0
- package/locales/itIT.js +1 -0
- package/locales/jaJP.js +2 -0
- package/locales/koKR.js +1 -0
- package/locales/nbNO.js +1 -0
- package/locales/nlNL.js +1 -0
- package/locales/plPL.js +1 -0
- package/locales/ptBR.js +2 -0
- package/locales/ptPT.js +1 -0
- package/locales/roRO.js +1 -0
- package/locales/ruRU.js +1 -0
- package/locales/skSK.js +4 -3
- package/locales/svSE.js +2 -0
- package/locales/trTR.js +1 -0
- package/locales/ukUA.js +1 -0
- package/locales/urPK.js +1 -0
- package/locales/viVN.js +1 -0
- package/locales/zhCN.js +1 -0
- package/locales/zhHK.js +1 -0
- package/locales/zhTW.js +1 -0
- package/models/api/gridLocaleTextApi.d.ts +1 -0
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/DataGrid/DataGrid.js +2 -3
- package/modern/colDef/gridDateOperators.js +7 -0
- package/modern/components/GridFooter.js +1 -2
- package/modern/components/GridHeader.js +1 -2
- package/modern/components/GridHeaders.js +3 -2
- package/modern/components/GridRow.js +1 -2
- package/modern/components/cell/GridActionsCell.js +1 -2
- package/modern/components/cell/GridActionsCellItem.js +1 -2
- package/modern/components/cell/GridCell.js +5 -4
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +1 -2
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +1 -2
- package/modern/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +1 -2
- package/modern/components/columnsManagement/GridColumnsManagement.js +2 -3
- package/modern/components/containers/GridRoot.js +1 -2
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.js +1 -2
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -2
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -2
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -2
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -2
- package/modern/components/panel/filterPanel/GridFilterForm.js +1 -2
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -2
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +4 -4
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -2
- package/modern/components/panel/filterPanel/GridFilterPanel.js +1 -2
- package/modern/components/toolbar/GridToolbar.js +1 -2
- package/modern/components/toolbar/GridToolbarDensitySelector.js +1 -2
- package/modern/components/toolbar/GridToolbarExportContainer.js +1 -2
- package/modern/components/toolbar/GridToolbarFilterButton.js +1 -2
- package/modern/components/virtualization/GridVirtualScroller.js +1 -2
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +1 -2
- package/modern/constants/localeTextConstants.js +1 -0
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -2
- package/modern/hooks/features/columnResize/useGridColumnResize.js +16 -1
- package/modern/hooks/features/columns/gridColumnsUtils.js +5 -4
- package/modern/hooks/features/columns/useGridColumns.js +5 -4
- package/modern/hooks/features/export/useGridPrintExport.js +22 -5
- package/modern/hooks/features/rows/useGridRows.js +9 -1
- package/modern/hooks/features/sorting/gridSortingSelector.js +21 -8
- package/modern/index.js +1 -1
- package/modern/joy/icons.js +1 -2
- package/modern/joy/joySlots.js +1 -2
- package/modern/locales/arSD.js +1 -0
- package/modern/locales/beBY.js +1 -0
- package/modern/locales/bgBG.js +1 -0
- package/modern/locales/csCZ.js +1 -0
- package/modern/locales/daDK.js +3 -1
- package/modern/locales/deDE.js +2 -0
- package/modern/locales/elGR.js +1 -0
- package/modern/locales/esES.js +2 -0
- package/modern/locales/faIR.js +2 -0
- package/modern/locales/fiFI.js +1 -0
- package/modern/locales/frFR.js +2 -0
- package/modern/locales/heIL.js +1 -0
- package/modern/locales/hrHR.js +1 -0
- package/modern/locales/huHU.js +1 -0
- package/modern/locales/itIT.js +1 -0
- package/modern/locales/jaJP.js +2 -0
- package/modern/locales/koKR.js +1 -0
- package/modern/locales/nbNO.js +1 -0
- package/modern/locales/nlNL.js +1 -0
- package/modern/locales/plPL.js +1 -0
- package/modern/locales/ptBR.js +2 -0
- package/modern/locales/ptPT.js +1 -0
- package/modern/locales/roRO.js +1 -0
- package/modern/locales/ruRU.js +1 -0
- package/modern/locales/skSK.js +4 -3
- package/modern/locales/svSE.js +2 -0
- package/modern/locales/trTR.js +1 -0
- package/modern/locales/ukUA.js +1 -0
- package/modern/locales/urPK.js +1 -0
- package/modern/locales/viVN.js +1 -0
- package/modern/locales/zhCN.js +1 -0
- package/modern/locales/zhHK.js +1 -0
- package/modern/locales/zhTW.js +1 -0
- package/modern/utils/domUtils.js +4 -0
- package/node/DataGrid/DataGrid.js +2 -2
- package/node/DataGrid/useDataGridProps.js +1 -1
- package/node/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/node/colDef/gridDateOperators.js +7 -0
- package/node/components/GridApiContext.js +1 -1
- package/node/components/GridColumnHeaders.js +1 -1
- package/node/components/GridFooter.js +1 -1
- package/node/components/GridHeader.js +1 -1
- package/node/components/GridHeaders.js +5 -3
- package/node/components/GridLoadingOverlay.js +1 -1
- package/node/components/GridNoResultsOverlay.js +1 -1
- package/node/components/GridNoRowsOverlay.js +1 -1
- package/node/components/GridPagination.js +1 -1
- package/node/components/GridRow.js +1 -1
- package/node/components/GridRowCount.js +1 -1
- package/node/components/GridScrollArea.js +1 -1
- package/node/components/GridScrollbarFillerCell.js +1 -1
- package/node/components/GridSelectedRowCount.js +1 -1
- package/node/components/base/GridFooterPlaceholder.js +1 -1
- package/node/components/base/GridOverlays.js +1 -1
- package/node/components/cell/GridActionsCell.js +1 -1
- package/node/components/cell/GridActionsCellItem.js +1 -1
- package/node/components/cell/GridBooleanCell.js +1 -1
- package/node/components/cell/GridCell.js +6 -5
- package/node/components/cell/GridEditBooleanCell.js +1 -1
- package/node/components/cell/GridEditDateCell.js +1 -1
- package/node/components/cell/GridEditInputCell.js +1 -1
- package/node/components/cell/GridEditSingleSelectCell.js +1 -1
- package/node/components/cell/GridSkeletonCell.js +1 -1
- package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +1 -1
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
- package/node/components/columnHeaders/GridColumnGroupHeader.js +1 -1
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +1 -1
- package/node/components/columnHeaders/GridColumnHeaderItem.js +1 -1
- package/node/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
- package/node/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -1
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +1 -1
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +1 -1
- package/node/components/columnHeaders/GridIconButtonContainer.js +1 -1
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/node/components/columnSelection/GridHeaderCheckbox.js +1 -1
- package/node/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/node/components/containers/GridFooterContainer.js +1 -1
- package/node/components/containers/GridOverlay.js +1 -1
- package/node/components/containers/GridRoot.js +1 -1
- package/node/components/containers/GridToolbarContainer.js +1 -1
- package/node/components/menu/GridMenu.js +1 -1
- package/node/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/node/components/menu/columnMenu/GridColumnMenu.js +1 -1
- package/node/components/menu/columnMenu/GridColumnMenuContainer.js +1 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.js +1 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/node/components/panel/GridColumnsPanel.js +1 -1
- package/node/components/panel/GridPanel.js +1 -1
- package/node/components/panel/GridPanelContent.js +1 -1
- package/node/components/panel/GridPanelFooter.js +1 -1
- package/node/components/panel/GridPanelHeader.js +1 -1
- package/node/components/panel/GridPanelWrapper.js +1 -1
- package/node/components/panel/GridPreferencesPanel.js +1 -1
- package/node/components/panel/filterPanel/GridFilterForm.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputDate.js +5 -5
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/node/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/node/components/toolbar/GridToolbar.js +1 -1
- package/node/components/toolbar/GridToolbarColumnsButton.js +1 -1
- package/node/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/node/components/toolbar/GridToolbarExport.js +1 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +1 -1
- package/node/components/toolbar/GridToolbarFilterButton.js +1 -1
- package/node/components/toolbar/GridToolbarQuickFilter.js +1 -1
- package/node/components/virtualization/GridBottomContainer.js +1 -1
- package/node/components/virtualization/GridMainContainer.js +1 -1
- package/node/components/virtualization/GridTopContainer.js +1 -1
- package/node/components/virtualization/GridVirtualScrollbar.js +1 -1
- package/node/components/virtualization/GridVirtualScroller.js +1 -1
- package/node/components/virtualization/GridVirtualScrollerContent.js +1 -1
- package/node/components/virtualization/GridVirtualScrollerFiller.js +1 -1
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
- package/node/constants/localeTextConstants.js +1 -0
- package/node/context/GridContextProvider.js +1 -1
- package/node/context/GridRootPropsContext.js +1 -1
- package/node/hooks/core/pipeProcessing/useGridPipeProcessing.js +1 -1
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/node/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +1 -1
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +1 -1
- package/node/hooks/core/useGridApiInitialization.js +1 -1
- package/node/hooks/core/useGridLocaleText.js +1 -1
- package/node/hooks/core/useGridLoggerFactory.js +1 -1
- package/node/hooks/core/useGridRefs.js +1 -1
- package/node/hooks/core/useGridStateInitialization.js +1 -1
- package/node/hooks/core/useGridTheme.js +1 -1
- package/node/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/node/hooks/features/columnGrouping/useGridColumnGrouping.js +1 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -1
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +1 -1
- package/node/hooks/features/columnMenu/useGridColumnMenuSlots.js +1 -1
- package/node/hooks/features/columnResize/useGridColumnResize.js +16 -1
- package/node/hooks/features/columns/gridColumnsUtils.js +5 -4
- package/node/hooks/features/columns/useGridColumnSpanning.js +1 -1
- package/node/hooks/features/columns/useGridColumns.js +6 -5
- package/node/hooks/features/density/useGridDensity.js +1 -1
- package/node/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/node/hooks/features/editing/useGridCellEditing.js +1 -1
- package/node/hooks/features/editing/useGridEditing.js +1 -1
- package/node/hooks/features/editing/useGridRowEditing.js +1 -1
- package/node/hooks/features/export/useGridCsvExport.js +1 -1
- package/node/hooks/features/export/useGridPrintExport.js +23 -6
- package/node/hooks/features/filter/useGridFilter.js +1 -1
- package/node/hooks/features/focus/useGridFocus.js +1 -1
- package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +1 -1
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +1 -1
- package/node/hooks/features/pagination/useGridPaginationMeta.js +1 -1
- package/node/hooks/features/pagination/useGridPaginationModel.js +1 -1
- package/node/hooks/features/pagination/useGridRowCount.js +1 -1
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +1 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +1 -1
- package/node/hooks/features/rowSelection/useGridRowSelectionPreProcessors.js +1 -1
- package/node/hooks/features/rows/useGridParamsApi.js +1 -1
- package/node/hooks/features/rows/useGridRows.js +10 -2
- package/node/hooks/features/rows/useGridRowsMeta.js +1 -1
- package/node/hooks/features/scroll/useGridScroll.js +1 -1
- package/node/hooks/features/sorting/gridSortingSelector.js +20 -6
- package/node/hooks/features/sorting/useGridSorting.js +1 -1
- package/node/hooks/features/statePersistence/useGridStatePersistence.js +1 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +1 -1
- package/node/hooks/features/virtualization/useGridVirtualization.js +1 -1
- package/node/hooks/utils/useFirstRender.js +1 -1
- package/node/hooks/utils/useGridApiContext.js +1 -1
- package/node/hooks/utils/useGridApiEventHandler.js +1 -1
- package/node/hooks/utils/useGridApiMethod.js +1 -1
- package/node/hooks/utils/useGridApiRef.js +1 -1
- package/node/hooks/utils/useGridInitializeState.js +1 -1
- package/node/hooks/utils/useGridLogger.js +1 -1
- package/node/hooks/utils/useGridNativeEventListener.js +1 -1
- package/node/hooks/utils/useGridPrivateApiContext.js +1 -1
- package/node/hooks/utils/useGridRootProps.js +1 -1
- package/node/hooks/utils/useGridSelector.js +1 -1
- package/node/hooks/utils/useGridVisibleRows.js +1 -1
- package/node/hooks/utils/useResizeObserver.js +1 -1
- package/node/hooks/utils/useRunOnce.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/utils/useProps.js +1 -1
- package/node/joy/icons.js +1 -1
- package/node/joy/joySlots.js +1 -1
- package/node/locales/arSD.js +1 -0
- package/node/locales/beBY.js +1 -0
- package/node/locales/bgBG.js +1 -0
- package/node/locales/csCZ.js +1 -0
- package/node/locales/daDK.js +3 -1
- package/node/locales/deDE.js +2 -0
- package/node/locales/elGR.js +1 -0
- package/node/locales/esES.js +2 -0
- package/node/locales/faIR.js +2 -0
- package/node/locales/fiFI.js +1 -0
- package/node/locales/frFR.js +2 -0
- package/node/locales/heIL.js +1 -0
- package/node/locales/hrHR.js +1 -0
- package/node/locales/huHU.js +1 -0
- package/node/locales/itIT.js +1 -0
- package/node/locales/jaJP.js +2 -0
- package/node/locales/koKR.js +1 -0
- package/node/locales/nbNO.js +1 -0
- package/node/locales/nlNL.js +1 -0
- package/node/locales/plPL.js +1 -0
- package/node/locales/ptBR.js +2 -0
- package/node/locales/ptPT.js +1 -0
- package/node/locales/roRO.js +1 -0
- package/node/locales/ruRU.js +1 -0
- package/node/locales/skSK.js +4 -3
- package/node/locales/svSE.js +2 -0
- package/node/locales/trTR.js +1 -0
- package/node/locales/ukUA.js +1 -0
- package/node/locales/urPK.js +1 -0
- package/node/locales/viVN.js +1 -0
- package/node/locales/zhCN.js +1 -0
- package/node/locales/zhHK.js +1 -0
- package/node/locales/zhTW.js +1 -0
- package/node/material/components/MUISelectOption.js +1 -1
- package/node/material/icons/GridColumnUnsortedIcon.js +1 -1
- package/node/material/icons/index.js +1 -1
- package/node/utils/domUtils.js +5 -0
- package/node/utils/fastMemo.js +1 -1
- package/package.json +3 -5
- package/utils/domUtils.d.ts +1 -0
- package/utils/domUtils.js +4 -0
|
@@ -8,8 +8,7 @@ import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
|
8
8
|
import { GridMenu } from '../menu/GridMenu';
|
|
9
9
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
10
|
import { gridClasses } from '../../constants/gridClasses';
|
|
11
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
12
|
const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function GridToolbarExportContainer(props, ref) {
|
|
14
13
|
const {
|
|
15
14
|
children,
|
|
@@ -12,8 +12,7 @@ import { GridPreferencePanelsValue } from '../../hooks/features/preferencesPanel
|
|
|
12
12
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
13
13
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
14
14
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
16
|
const useUtilityClasses = ownerState => {
|
|
18
17
|
const {
|
|
19
18
|
classes
|
|
@@ -18,8 +18,7 @@ import { GridVirtualScrollerContent as Content } from './GridVirtualScrollerCont
|
|
|
18
18
|
import { GridVirtualScrollerFiller as SpaceFiller } from './GridVirtualScrollerFiller';
|
|
19
19
|
import { GridVirtualScrollerRenderZone as RenderZone } from './GridVirtualScrollerRenderZone';
|
|
20
20
|
import { GridVirtualScrollbar as Scrollbar } from './GridVirtualScrollbar';
|
|
21
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
22
|
const useUtilityClasses = (ownerState, dimensions) => {
|
|
24
23
|
const {
|
|
25
24
|
classes
|
|
@@ -5,8 +5,7 @@ import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
|
5
5
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
6
6
|
import { gridDimensionsSelector } from '../../hooks/features/dimensions';
|
|
7
7
|
import { gridClasses } from '../../constants';
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
9
|
const Filler = styled('div')({
|
|
11
10
|
display: 'flex',
|
|
12
11
|
flexDirection: 'row',
|
|
@@ -31,6 +31,7 @@ export const GRID_DEFAULT_LOCALE_TEXT = {
|
|
|
31
31
|
columnsManagementSearchTitle: 'Search',
|
|
32
32
|
columnsManagementNoColumns: 'No columns',
|
|
33
33
|
columnsManagementShowHideAllText: 'Show/Hide All',
|
|
34
|
+
columnsManagementReset: 'Reset',
|
|
34
35
|
// Filter panel text
|
|
35
36
|
filterPanelAddFilter: 'Add filter',
|
|
36
37
|
filterPanelRemoveAll: 'Remove all',
|
|
@@ -48,7 +48,7 @@ export declare const useGridColumnHeaders: (props: UseGridColumnHeadersProps) =>
|
|
|
48
48
|
};
|
|
49
49
|
visibleColumns: GridStateColDef[];
|
|
50
50
|
getCellOffsetStyle: ({ pinnedPosition, columnIndex, computedWidth, }: {
|
|
51
|
-
pinnedPosition?: GridPinnedColumnPosition
|
|
51
|
+
pinnedPosition?: GridPinnedColumnPosition;
|
|
52
52
|
columnIndex: number;
|
|
53
53
|
computedWidth: number;
|
|
54
54
|
}) => React.CSSProperties | undefined;
|
|
@@ -16,8 +16,7 @@ import { GridScrollbarFillerCell as ScrollbarFiller } from '../../../components/
|
|
|
16
16
|
import { getPinnedCellOffset } from '../../../internals/utils/getPinnedCellOffset';
|
|
17
17
|
import { GridColumnHeaderSeparatorSides } from '../../../components/columnHeaders/GridColumnHeaderSeparator';
|
|
18
18
|
import { gridClasses } from '../../../constants/gridClasses';
|
|
19
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
20
|
export const GridColumnHeaderRow = styled('div', {
|
|
22
21
|
name: 'MuiDataGrid',
|
|
23
22
|
slot: 'ColumnHeaderRow',
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { unstable_ownerDocument as ownerDocument, unstable_useEventCallback as useEventCallback } from '@mui/utils';
|
|
4
4
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
5
5
|
import { useTheme } from '@mui/material/styles';
|
|
6
|
-
import { findGridCellElementsFromCol, findGridElement, findLeftPinnedCellsAfterCol, findRightPinnedCellsBeforeCol, getFieldFromHeaderElem, findHeaderElementFromField, findGroupHeaderElementsFromField, findGridHeader, findGridCells, findParentElementFromClassName, findLeftPinnedHeadersAfterCol, findRightPinnedHeadersBeforeCol } from '../../../utils/domUtils';
|
|
6
|
+
import { findGridCellElementsFromCol, findGridElement, findLeftPinnedCellsAfterCol, findRightPinnedCellsBeforeCol, getFieldFromHeaderElem, findHeaderElementFromField, getFieldsFromGroupHeaderElem, findGroupHeaderElementsFromField, findGridHeader, findGridCells, findParentElementFromClassName, findLeftPinnedHeadersAfterCol, findRightPinnedHeadersBeforeCol } from '../../../utils/domUtils';
|
|
7
7
|
import { DEFAULT_GRID_AUTOSIZE_OPTIONS } from './gridColumnResizeApi';
|
|
8
8
|
import { gridClasses } from '../../../constants/gridClasses';
|
|
9
9
|
import { useGridApiEventHandler, useGridApiMethod, useGridApiOptionHandler, useGridLogger, useGridNativeEventListener, useGridSelector, useOnMount } from '../../utils';
|
|
@@ -294,6 +294,21 @@ export const useGridColumnResize = (apiRef, props) => {
|
|
|
294
294
|
if (refs.colDef) {
|
|
295
295
|
apiRef.current.setColumnWidth(refs.colDef.field, refs.colDef.width);
|
|
296
296
|
logger.debug(`Updating col ${refs.colDef.field} with new width: ${refs.colDef.width}`);
|
|
297
|
+
const columnsState = gridColumnsStateSelector(apiRef.current.state);
|
|
298
|
+
refs.groupHeaderElements.forEach(element => {
|
|
299
|
+
const fields = getFieldsFromGroupHeaderElem(element);
|
|
300
|
+
const div = element;
|
|
301
|
+
const newWidth = fields.reduce((acc, field) => {
|
|
302
|
+
if (columnsState.columnVisibilityModel[field] !== false) {
|
|
303
|
+
return acc + columnsState.lookup[field].computedWidth;
|
|
304
|
+
}
|
|
305
|
+
return acc;
|
|
306
|
+
}, 0);
|
|
307
|
+
const finalWidth = `${newWidth}px`;
|
|
308
|
+
div.style.width = finalWidth;
|
|
309
|
+
div.style.minWidth = finalWidth;
|
|
310
|
+
div.style.maxWidth = finalWidth;
|
|
311
|
+
});
|
|
297
312
|
}
|
|
298
313
|
stopResizeEventTimeout.start(0, () => {
|
|
299
314
|
apiRef.current.publishEvent('columnResizeStop', null, nativeEvent);
|
|
@@ -5,6 +5,7 @@ import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
|
5
5
|
import { GridColDef } from '../../../models/colDef/gridColDef';
|
|
6
6
|
import { GridApiCommon } from '../../../models/api/gridApiCommon';
|
|
7
7
|
import { GridRowEntry } from '../../../models/gridRows';
|
|
8
|
+
import type { GridDimensions } from '../dimensions/gridDimensionsApi';
|
|
8
9
|
export declare const COLUMNS_DIMENSION_PROPERTIES: readonly ["maxWidth", "minWidth", "width", "flex"];
|
|
9
10
|
export type GridColumnDimensionProperties = (typeof COLUMNS_DIMENSION_PROPERTIES)[number];
|
|
10
11
|
/**
|
|
@@ -32,7 +33,7 @@ export declare function computeFlexColumnsWidth({ initialFreeSpace, totalFlexUni
|
|
|
32
33
|
* TODO: Unit test this function in depth and only keep basic cases for the whole grid testing.
|
|
33
34
|
* TODO: Improve the `GridColDef` typing to reflect the fact that `minWidth` / `maxWidth` and `width` can't be null after the merge with the `type` default values.
|
|
34
35
|
*/
|
|
35
|
-
export declare const hydrateColumnsWidth: (rawState: GridColumnsRawState,
|
|
36
|
+
export declare const hydrateColumnsWidth: (rawState: GridColumnsRawState, dimensions: GridDimensions | undefined) => GridColumnsState;
|
|
36
37
|
/**
|
|
37
38
|
* Apply the order and the dimensions of the initial state.
|
|
38
39
|
* The columns not registered in `orderedFields` will be placed after the imported columns.
|
|
@@ -41,7 +42,7 @@ export declare const applyInitialState: (columnsState: GridColumnsRawState, init
|
|
|
41
42
|
export declare const createColumnsState: ({ apiRef, columnsToUpsert, initialState, columnVisibilityModel, keepOnlyColumnsToUpsert, }: {
|
|
42
43
|
columnsToUpsert: readonly GridColDef[];
|
|
43
44
|
initialState: GridColumnsInitialState | undefined;
|
|
44
|
-
columnVisibilityModel?: GridColumnVisibilityModel
|
|
45
|
+
columnVisibilityModel?: GridColumnVisibilityModel;
|
|
45
46
|
keepOnlyColumnsToUpsert: boolean;
|
|
46
47
|
apiRef: React.MutableRefObject<GridApiCommunity>;
|
|
47
48
|
}) => GridColumnsState;
|
|
@@ -110,7 +110,7 @@ export function computeFlexColumnsWidth({
|
|
|
110
110
|
* TODO: Unit test this function in depth and only keep basic cases for the whole grid testing.
|
|
111
111
|
* TODO: Improve the `GridColDef` typing to reflect the fact that `minWidth` / `maxWidth` and `width` can't be null after the merge with the `type` default values.
|
|
112
112
|
*/
|
|
113
|
-
export const hydrateColumnsWidth = (rawState,
|
|
113
|
+
export const hydrateColumnsWidth = (rawState, dimensions) => {
|
|
114
114
|
const columnsLookup = {};
|
|
115
115
|
let totalFlexUnits = 0;
|
|
116
116
|
let widthAllocatedBeforeFlex = 0;
|
|
@@ -136,10 +136,11 @@ export const hydrateColumnsWidth = (rawState, viewportInnerWidth) => {
|
|
|
136
136
|
}
|
|
137
137
|
columnsLookup[columnField] = newColumn;
|
|
138
138
|
});
|
|
139
|
-
const
|
|
139
|
+
const availableWidth = dimensions === undefined ? 0 : dimensions.viewportOuterSize.width - (dimensions.hasScrollY ? dimensions.scrollbarSize : 0);
|
|
140
|
+
const initialFreeSpace = Math.max(availableWidth - widthAllocatedBeforeFlex, 0);
|
|
140
141
|
|
|
141
142
|
// Allocate the remaining space to the flex columns
|
|
142
|
-
if (totalFlexUnits > 0 &&
|
|
143
|
+
if (totalFlexUnits > 0 && availableWidth > 0) {
|
|
143
144
|
const computedColumnWidths = computeFlexColumnsWidth({
|
|
144
145
|
initialFreeSpace,
|
|
145
146
|
totalFlexUnits,
|
|
@@ -282,7 +283,7 @@ export const createColumnsState = ({
|
|
|
282
283
|
}
|
|
283
284
|
const columnsStateWithPreProcessing = apiRef.current.unstable_applyPipeProcessors('hydrateColumns', columnsState);
|
|
284
285
|
const columnsStateWithPortableColumns = applyInitialState(columnsStateWithPreProcessing, initialState);
|
|
285
|
-
return hydrateColumnsWidth(columnsStateWithPortableColumns, apiRef.current.getRootDimensions?.()
|
|
286
|
+
return hydrateColumnsWidth(columnsStateWithPortableColumns, apiRef.current.getRootDimensions?.() ?? undefined);
|
|
286
287
|
};
|
|
287
288
|
export function getFirstNonSpannedColumnToRender({
|
|
288
289
|
firstColumnToRender,
|
|
@@ -133,7 +133,7 @@ export function useGridColumns(apiRef, props) {
|
|
|
133
133
|
lookup: _extends({}, columnsState.lookup, {
|
|
134
134
|
[field]: newColumn
|
|
135
135
|
})
|
|
136
|
-
}), apiRef.current.getRootDimensions()
|
|
136
|
+
}), apiRef.current.getRootDimensions()));
|
|
137
137
|
apiRef.current.publishEvent('columnWidthChange', {
|
|
138
138
|
element: apiRef.current.getColumnHeaderElement(field),
|
|
139
139
|
colDef: newColumn,
|
|
@@ -237,14 +237,15 @@ export function useGridColumns(apiRef, props) {
|
|
|
237
237
|
useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
238
238
|
useGridRegisterPipeProcessor(apiRef, 'preferencePanel', preferencePanelPreProcessing);
|
|
239
239
|
|
|
240
|
-
|
|
240
|
+
/*
|
|
241
241
|
* EVENTS
|
|
242
242
|
*/
|
|
243
|
+
|
|
243
244
|
const prevInnerWidth = React.useRef(null);
|
|
244
245
|
const handleGridSizeChange = viewportInnerSize => {
|
|
245
246
|
if (prevInnerWidth.current !== viewportInnerSize.width) {
|
|
246
247
|
prevInnerWidth.current = viewportInnerSize.width;
|
|
247
|
-
setGridColumnsState(hydrateColumnsWidth(gridColumnsStateSelector(apiRef.current.state),
|
|
248
|
+
setGridColumnsState(hydrateColumnsWidth(gridColumnsStateSelector(apiRef.current.state), apiRef.current.getRootDimensions()));
|
|
248
249
|
}
|
|
249
250
|
};
|
|
250
251
|
useGridApiEventHandler(apiRef, 'viewportInnerSizeChange', handleGridSizeChange);
|
|
@@ -264,7 +265,7 @@ export function useGridColumns(apiRef, props) {
|
|
|
264
265
|
}, [apiRef, logger, setGridColumnsState]);
|
|
265
266
|
useGridRegisterPipeApplier(apiRef, 'hydrateColumns', hydrateColumns);
|
|
266
267
|
|
|
267
|
-
|
|
268
|
+
/*
|
|
268
269
|
* EFFECTS
|
|
269
270
|
*/
|
|
270
271
|
// The effect do not track any value defined synchronously during the 1st render by hooks called after `useGridColumns`
|
|
@@ -7,6 +7,7 @@ import { gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector } from
|
|
|
7
7
|
import { gridClasses } from '../../../constants/gridClasses';
|
|
8
8
|
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
9
9
|
import { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';
|
|
10
|
+
import { GRID_ID_AUTOGENERATED } from '../rows/gridRowsUtils';
|
|
10
11
|
import { defaultGetRowsToExport, getColumnsToExport } from './utils';
|
|
11
12
|
import { getDerivedPaginationModel } from '../pagination/useGridPaginationModel';
|
|
12
13
|
import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
|
|
@@ -42,6 +43,7 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
42
43
|
const previousGridState = React.useRef(null);
|
|
43
44
|
const previousColumnVisibility = React.useRef({});
|
|
44
45
|
const previousRows = React.useRef([]);
|
|
46
|
+
const previousVirtualizationState = React.useRef();
|
|
45
47
|
React.useEffect(() => {
|
|
46
48
|
doc.current = ownerDocument(apiRef.current.rootElementRef.current);
|
|
47
49
|
}, [apiRef]);
|
|
@@ -71,7 +73,13 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
71
73
|
const rowsToExportIds = getRowsToExport({
|
|
72
74
|
apiRef
|
|
73
75
|
});
|
|
74
|
-
const newRows = rowsToExportIds.
|
|
76
|
+
const newRows = rowsToExportIds.reduce((acc, id) => {
|
|
77
|
+
const row = apiRef.current.getRow(id);
|
|
78
|
+
if (!row[GRID_ID_AUTOGENERATED]) {
|
|
79
|
+
acc.push(row);
|
|
80
|
+
}
|
|
81
|
+
return acc;
|
|
82
|
+
}, []);
|
|
75
83
|
apiRef.current.setRows(newRows);
|
|
76
84
|
}, [apiRef]);
|
|
77
85
|
const handlePrintWindowLoad = React.useCallback((printWindow, options) => {
|
|
@@ -124,6 +132,8 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
124
132
|
// prevents us to do it
|
|
125
133
|
const container = document.createElement('div');
|
|
126
134
|
container.appendChild(gridClone);
|
|
135
|
+
// To avoid an empty page in start on Chromium based browsers
|
|
136
|
+
printDoc.body.style.marginTop = '0px';
|
|
127
137
|
printDoc.body.innerHTML = container.innerHTML;
|
|
128
138
|
const defaultPageStyle = typeof normalizeOptions.pageStyle === 'function' ? normalizeOptions.pageStyle() : normalizeOptions.pageStyle;
|
|
129
139
|
if (typeof defaultPageStyle === 'string') {
|
|
@@ -192,7 +202,9 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
192
202
|
// if the apiRef.current.exportState(); did not exported the column visibility, we update it
|
|
193
203
|
apiRef.current.setColumnVisibilityModel(previousColumnVisibility.current);
|
|
194
204
|
}
|
|
195
|
-
apiRef.current.
|
|
205
|
+
apiRef.current.setState(state => _extends({}, state, {
|
|
206
|
+
virtualization: previousVirtualizationState.current
|
|
207
|
+
}));
|
|
196
208
|
apiRef.current.setRows(previousRows.current);
|
|
197
209
|
|
|
198
210
|
// Clear local state
|
|
@@ -208,7 +220,7 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
208
220
|
previousGridState.current = apiRef.current.exportState();
|
|
209
221
|
// It appends that the visibility model is not exported, especially if columnVisibility is not controlled
|
|
210
222
|
previousColumnVisibility.current = gridColumnVisibilityModelSelector(apiRef);
|
|
211
|
-
previousRows.current = apiRef.current.getSortedRows();
|
|
223
|
+
previousRows.current = apiRef.current.getSortedRows().filter(row => !row[GRID_ID_AUTOGENERATED]);
|
|
212
224
|
if (props.pagination) {
|
|
213
225
|
const visibleRowCount = gridExpandedRowCountSelector(apiRef);
|
|
214
226
|
const paginationModel = {
|
|
@@ -222,11 +234,16 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
222
234
|
'DataGridPro', paginationModel)
|
|
223
235
|
})
|
|
224
236
|
}));
|
|
225
|
-
apiRef.current.forceUpdate();
|
|
226
237
|
}
|
|
238
|
+
previousVirtualizationState.current = apiRef.current.state.virtualization;
|
|
239
|
+
apiRef.current.setState(state => _extends({}, state, {
|
|
240
|
+
virtualization: _extends({}, state.virtualization, {
|
|
241
|
+
enabled: false,
|
|
242
|
+
enabledForColumns: false
|
|
243
|
+
})
|
|
244
|
+
}));
|
|
227
245
|
await updateGridColumnsForPrint(options?.fields, options?.allColumns, options?.includeCheckboxes);
|
|
228
246
|
updateGridRowsForPrint(options?.getRowsToExport ?? defaultGetRowsToExport);
|
|
229
|
-
apiRef.current.unstable_setVirtualization(false);
|
|
230
247
|
await raf(); // wait for the state changes to take action
|
|
231
248
|
const printWindow = buildPrintWindow(options?.fileName);
|
|
232
249
|
if (process.env.NODE_ENV === 'test') {
|
|
@@ -30,10 +30,7 @@ export declare const gridFilteredDescendantCountLookupSelector: import("../../..
|
|
|
30
30
|
* Does not contain the collapsed children.
|
|
31
31
|
* @category Filtering
|
|
32
32
|
*/
|
|
33
|
-
export declare const gridExpandedSortedRowEntriesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity,
|
|
34
|
-
id: import("../../..").GridRowId;
|
|
35
|
-
model: import("../../..").GridValidRowModel;
|
|
36
|
-
}[]>;
|
|
33
|
+
export declare const gridExpandedSortedRowEntriesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("../../..").GridRowEntry<import("../../..").GridValidRowModel>[]>;
|
|
37
34
|
/**
|
|
38
35
|
* Get the id of the rows accessible after the filtering process.
|
|
39
36
|
* Does not contain the collapsed children.
|
|
@@ -45,10 +42,7 @@ export declare const gridExpandedSortedRowIdsSelector: import("../../../utils/cr
|
|
|
45
42
|
* Contains the collapsed children.
|
|
46
43
|
* @category Filtering
|
|
47
44
|
*/
|
|
48
|
-
export declare const gridFilteredSortedRowEntriesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity,
|
|
49
|
-
id: import("../../..").GridRowId;
|
|
50
|
-
model: import("../../..").GridValidRowModel;
|
|
51
|
-
}[]>;
|
|
45
|
+
export declare const gridFilteredSortedRowEntriesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("../../..").GridRowEntry<import("../../..").GridValidRowModel>[]>;
|
|
52
46
|
/**
|
|
53
47
|
* Get the id of the rows accessible after the filtering process.
|
|
54
48
|
* Contains the collapsed children.
|
|
@@ -59,10 +53,7 @@ export declare const gridFilteredSortedRowIdsSelector: import("../../../utils/cr
|
|
|
59
53
|
* Get the id and the model of the top level rows accessible after the filtering process.
|
|
60
54
|
* @category Filtering
|
|
61
55
|
*/
|
|
62
|
-
export declare const gridFilteredSortedTopLevelRowEntriesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity,
|
|
63
|
-
id: import("../../..").GridRowId;
|
|
64
|
-
model: import("../../..").GridValidRowModel;
|
|
65
|
-
}[]>;
|
|
56
|
+
export declare const gridFilteredSortedTopLevelRowEntriesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("../../..").GridRowEntry<import("../../..").GridValidRowModel>[]>;
|
|
66
57
|
/**
|
|
67
58
|
* Get the amount of rows accessible after the filtering process.
|
|
68
59
|
* @category Filtering
|
|
@@ -46,10 +46,7 @@ export declare const gridPaginationRowRangeSelector: import("../../../utils/crea
|
|
|
46
46
|
* Get the id and the model of each row to include in the current page if the pagination is enabled.
|
|
47
47
|
* @category Pagination
|
|
48
48
|
*/
|
|
49
|
-
export declare const gridPaginatedVisibleSortedGridRowEntriesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity,
|
|
50
|
-
id: import("../../..").GridRowId;
|
|
51
|
-
model: import("../../..").GridValidRowModel;
|
|
52
|
-
}[]>;
|
|
49
|
+
export declare const gridPaginatedVisibleSortedGridRowEntriesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("../../..").GridRowEntry<import("../../..").GridValidRowModel>[]>;
|
|
53
50
|
/**
|
|
54
51
|
* Get the id of each row to include in the current page if the pagination is enabled.
|
|
55
52
|
* @category Pagination
|
|
@@ -19,7 +19,7 @@ export declare const getTopLevelRowCount: ({ tree, rowCountProp, }: {
|
|
|
19
19
|
tree: GridRowTreeConfig;
|
|
20
20
|
rowCountProp: DataGridProcessedProps['rowCount'];
|
|
21
21
|
}) => number;
|
|
22
|
-
export declare const getRowsStateFromCache: ({ apiRef, rowCountProp, loadingProp, previousTree, previousTreeDepths, }: Pick<GridRowTreeCreationParams,
|
|
22
|
+
export declare const getRowsStateFromCache: ({ apiRef, rowCountProp, loadingProp, previousTree, previousTreeDepths, }: Pick<GridRowTreeCreationParams, 'previousTree' | 'previousTreeDepths'> & {
|
|
23
23
|
apiRef: React.MutableRefObject<GridPrivateApiCommunity>;
|
|
24
24
|
rowCountProp: number | undefined;
|
|
25
25
|
loadingProp: boolean | undefined;
|
|
@@ -39,6 +39,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
39
39
|
const logger = useGridLogger(apiRef, 'useGridRows');
|
|
40
40
|
const currentPage = useGridVisibleRows(apiRef, props);
|
|
41
41
|
const lastUpdateMs = React.useRef(Date.now());
|
|
42
|
+
const lastRowCount = React.useRef(props.rowCount);
|
|
42
43
|
const timeout = useTimeout();
|
|
43
44
|
const getRow = React.useCallback(id => {
|
|
44
45
|
const model = gridRowsLookupSelector(apiRef)[id];
|
|
@@ -400,6 +401,11 @@ export const useGridRows = (apiRef, props) => {
|
|
|
400
401
|
isFirstRender.current = false;
|
|
401
402
|
return;
|
|
402
403
|
}
|
|
404
|
+
let isRowCountPropUpdated = false;
|
|
405
|
+
if (props.rowCount !== lastRowCount.current) {
|
|
406
|
+
isRowCountPropUpdated = true;
|
|
407
|
+
lastRowCount.current = props.rowCount;
|
|
408
|
+
}
|
|
403
409
|
const areNewRowsAlreadyInState = apiRef.current.caches.rows.rowsBeforePartialUpdates === props.rows;
|
|
404
410
|
const isNewLoadingAlreadyInState = apiRef.current.caches.rows.loadingPropBeforePartialUpdates === props.loading;
|
|
405
411
|
const isNewRowCountAlreadyInState = apiRef.current.caches.rows.rowCountPropBeforePartialUpdates === props.rowCount;
|
|
@@ -426,7 +432,9 @@ export const useGridRows = (apiRef, props) => {
|
|
|
426
432
|
apiRef.current.caches.rows.rowCountPropBeforePartialUpdates = props.rowCount;
|
|
427
433
|
apiRef.current.forceUpdate();
|
|
428
434
|
}
|
|
429
|
-
|
|
435
|
+
if (!isRowCountPropUpdated) {
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
430
438
|
}
|
|
431
439
|
logger.debug(`Updating all rows, new length ${props.rows.length}`);
|
|
432
440
|
throttledRowsChange({
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { GridSortDirection, GridSortModel } from '../../../models/gridSortModel';
|
|
2
|
-
import { GridStateCommunity } from '../../../models/gridStateCommunity';
|
|
2
|
+
import type { GridStateCommunity } from '../../../models/gridStateCommunity';
|
|
3
|
+
import type { GridValidRowModel, GridRowEntry } from '../../../models/gridRows';
|
|
3
4
|
/**
|
|
4
5
|
* Get the id of the rows after the sorting process.
|
|
5
6
|
* @category Sorting
|
|
6
7
|
*/
|
|
7
|
-
export declare const gridSortedRowIdsSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("
|
|
8
|
+
export declare const gridSortedRowIdsSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("../../../models/gridRows").GridRowId[]>;
|
|
8
9
|
/**
|
|
9
10
|
* Get the id and the model of the rows after the sorting process.
|
|
10
11
|
* @category Sorting
|
|
11
12
|
*/
|
|
12
|
-
export declare const gridSortedRowEntriesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity,
|
|
13
|
-
id: import("../../..").GridRowId;
|
|
14
|
-
model: import("../../..").GridValidRowModel;
|
|
15
|
-
}[]>;
|
|
13
|
+
export declare const gridSortedRowEntriesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, GridRowEntry<GridValidRowModel>[]>;
|
|
16
14
|
/**
|
|
17
15
|
* Get the current sorting model.
|
|
18
16
|
* @category Sorting
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createSelector, createSelectorMemoized } from '../../../utils/createSelector';
|
|
2
|
-
import { gridRowsLookupSelector } from '../rows/gridRowsSelector';
|
|
3
|
-
|
|
2
|
+
import { gridRowTreeSelector, gridRowsLookupSelector } from '../rows/gridRowsSelector';
|
|
3
|
+
import { GRID_ID_AUTOGENERATED, isAutoGeneratedRow } from '../rows/gridRowsUtils';
|
|
4
4
|
/**
|
|
5
5
|
* @category Sorting
|
|
6
6
|
* @ignore - do not document.
|
|
@@ -17,12 +17,25 @@ export const gridSortedRowIdsSelector = createSelector(gridSortingStateSelector,
|
|
|
17
17
|
* Get the id and the model of the rows after the sorting process.
|
|
18
18
|
* @category Sorting
|
|
19
19
|
*/
|
|
20
|
-
export const gridSortedRowEntriesSelector = createSelectorMemoized(gridSortedRowIdsSelector, gridRowsLookupSelector,
|
|
21
|
-
|
|
22
|
-
(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
export const gridSortedRowEntriesSelector = createSelectorMemoized(gridSortedRowIdsSelector, gridRowsLookupSelector, gridRowTreeSelector, (sortedIds, idRowsLookup, rowTree) => sortedIds.reduce((acc, id) => {
|
|
21
|
+
const model = idRowsLookup[id];
|
|
22
|
+
if (model) {
|
|
23
|
+
acc.push({
|
|
24
|
+
id,
|
|
25
|
+
model
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const rowNode = rowTree[id];
|
|
29
|
+
if (rowNode && isAutoGeneratedRow(rowNode)) {
|
|
30
|
+
acc.push({
|
|
31
|
+
id,
|
|
32
|
+
model: {
|
|
33
|
+
[GRID_ID_AUTOGENERATED]: id
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return acc;
|
|
38
|
+
}, []));
|
|
26
39
|
|
|
27
40
|
/**
|
|
28
41
|
* Get the current sorting model.
|
|
@@ -8,9 +8,9 @@ export declare const useGridVirtualScroller: () => {
|
|
|
8
8
|
renderContext: GridRenderContext;
|
|
9
9
|
setPanels: React.Dispatch<React.SetStateAction<Readonly<Map<GridRowId, React.ReactNode>>>>;
|
|
10
10
|
getRows: (params?: {
|
|
11
|
-
rows?: GridRowEntry
|
|
12
|
-
position?:
|
|
13
|
-
renderContext?: GridRenderContext
|
|
11
|
+
rows?: GridRowEntry[];
|
|
12
|
+
position?: GridPinnedRowsPosition;
|
|
13
|
+
renderContext?: GridRenderContext;
|
|
14
14
|
}) => React.ReactNode[];
|
|
15
15
|
getContainerProps: () => {
|
|
16
16
|
ref: React.RefObject<HTMLDivElement>;
|
|
@@ -14,8 +14,8 @@ declare enum GridSignature {
|
|
|
14
14
|
interface RegistryContainer {
|
|
15
15
|
registry: CleanupTracking | null;
|
|
16
16
|
}
|
|
17
|
-
export declare function createUseGridApiEventHandler(registryContainer: RegistryContainer): <Api extends GridApiCommon<any, any>, E extends keyof import("../../models").GridEventLookup>(apiRef: React.MutableRefObject<Api>, eventName: E, handler?: GridEventListener<E
|
|
17
|
+
export declare function createUseGridApiEventHandler(registryContainer: RegistryContainer): <Api extends GridApiCommon<any, any>, E extends keyof import("../../models").GridEventLookup>(apiRef: React.MutableRefObject<Api>, eventName: E, handler?: GridEventListener<E>, options?: EventListenerOptions) => void;
|
|
18
18
|
export declare const unstable_resetCleanupTracking: () => void;
|
|
19
|
-
export declare const useGridApiEventHandler: <Api extends GridApiCommon<any, any>, E extends keyof import("../../models").GridEventLookup>(apiRef: React.MutableRefObject<Api>, eventName: E, handler?: GridEventListener<E
|
|
19
|
+
export declare const useGridApiEventHandler: <Api extends GridApiCommon<any, any>, E extends keyof import("../../models").GridEventLookup>(apiRef: React.MutableRefObject<Api>, eventName: E, handler?: GridEventListener<E>, options?: EventListenerOptions) => void;
|
|
20
20
|
export declare function useGridApiOptionHandler<Api extends GridApiCommon, E extends GridEvents>(apiRef: React.MutableRefObject<Api>, eventName: E, handler?: GridEventListener<E>): void;
|
|
21
21
|
export { GridSignature };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
|
|
3
|
-
export declare const useGridNativeEventListener: <PrivateApi extends GridPrivateApiCommon, K extends keyof HTMLElementEventMap>(apiRef: React.MutableRefObject<PrivateApi>, ref: React.MutableRefObject<HTMLDivElement | null> | (() => HTMLElement | undefined | null), eventName: K, handler?: (
|
|
3
|
+
export declare const useGridNativeEventListener: <PrivateApi extends GridPrivateApiCommon, K extends keyof HTMLElementEventMap>(apiRef: React.MutableRefObject<PrivateApi>, ref: React.MutableRefObject<HTMLDivElement | null> | (() => HTMLElement | undefined | null), eventName: K, handler?: (event: HTMLElementEventMap[K]) => any, options?: AddEventListenerOptions) => void;
|
|
@@ -3,4 +3,4 @@ import type { GridApiCommon } from '../../models/api/gridApiCommon';
|
|
|
3
3
|
import { OutputSelector } from '../../utils/createSelector';
|
|
4
4
|
import { fastObjectShallowCompare } from '../../utils/fastObjectShallowCompare';
|
|
5
5
|
export declare const objectShallowCompare: typeof fastObjectShallowCompare;
|
|
6
|
-
export declare const useGridSelector: <Api extends GridApiCommon<any, any>, T>(apiRef: React.MutableRefObject<Api>, selector:
|
|
6
|
+
export declare const useGridSelector: <Api extends GridApiCommon<any, any>, T>(apiRef: React.MutableRefObject<Api>, selector: ((state: Api['state']) => T) | OutputSelector<Api['state'], T>, equals?: (a: T, b: T) => boolean) => T;
|
package/index.js
CHANGED
package/joy/icons.js
CHANGED
|
@@ -18,8 +18,7 @@ const _excluded = ["sx", "fontSize"],
|
|
|
18
18
|
import * as React from 'react';
|
|
19
19
|
import SvgIcon from '@mui/joy/SvgIcon';
|
|
20
20
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
21
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
22
|
function createSvgIcon(path, displayName) {
|
|
24
23
|
const fontSizeMap = {
|
|
25
24
|
small: 'lg',
|
package/joy/joySlots.js
CHANGED
|
@@ -26,8 +26,7 @@ import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
|
26
26
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
27
27
|
import { gridFilteredTopLevelRowCountSelector, gridPaginationModelSelector } from '../hooks';
|
|
28
28
|
import { GridOverlay } from '../components/containers/GridOverlay';
|
|
29
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
30
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
31
30
|
function convertColor(color) {
|
|
32
31
|
if (color === 'secondary') {
|
|
33
32
|
return 'primary';
|
package/locales/arSD.js
CHANGED
|
@@ -33,6 +33,7 @@ const arSDGrid = {
|
|
|
33
33
|
// columnsManagementSearchTitle: 'Search',
|
|
34
34
|
// columnsManagementNoColumns: 'No columns',
|
|
35
35
|
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
36
|
+
// columnsManagementReset: 'Reset',
|
|
36
37
|
|
|
37
38
|
// Filter panel text
|
|
38
39
|
filterPanelAddFilter: 'إضافة مرشِح',
|
package/locales/beBY.js
CHANGED
|
@@ -47,6 +47,7 @@ const beBYGrid = {
|
|
|
47
47
|
// columnsManagementSearchTitle: 'Search',
|
|
48
48
|
// columnsManagementNoColumns: 'No columns',
|
|
49
49
|
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
50
|
+
// columnsManagementReset: 'Reset',
|
|
50
51
|
|
|
51
52
|
// Filter panel text
|
|
52
53
|
filterPanelAddFilter: 'Дадаць фільтр',
|
package/locales/bgBG.js
CHANGED
|
@@ -33,6 +33,7 @@ const bgBGGrid = {
|
|
|
33
33
|
// columnsManagementSearchTitle: 'Search',
|
|
34
34
|
// columnsManagementNoColumns: 'No columns',
|
|
35
35
|
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
36
|
+
// columnsManagementReset: 'Reset',
|
|
36
37
|
|
|
37
38
|
// Filter panel text
|
|
38
39
|
filterPanelAddFilter: 'Добави Филтър',
|
package/locales/csCZ.js
CHANGED
|
@@ -41,6 +41,7 @@ const csCZGrid = {
|
|
|
41
41
|
// columnsManagementSearchTitle: 'Search',
|
|
42
42
|
// columnsManagementNoColumns: 'No columns',
|
|
43
43
|
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
44
|
+
// columnsManagementReset: 'Reset',
|
|
44
45
|
|
|
45
46
|
// Filter panel text
|
|
46
47
|
filterPanelAddFilter: 'Přidat filtr',
|
package/locales/daDK.js
CHANGED
|
@@ -32,7 +32,9 @@ const daDKGrid = {
|
|
|
32
32
|
// Columns management text
|
|
33
33
|
columnsManagementSearchTitle: 'Søg',
|
|
34
34
|
columnsManagementNoColumns: 'Ingen søjler',
|
|
35
|
-
columnsManagementShowHideAllText: 'Vis/
|
|
35
|
+
columnsManagementShowHideAllText: 'Vis/Skjul Alle',
|
|
36
|
+
// columnsManagementReset: 'Reset',
|
|
37
|
+
|
|
36
38
|
// Filter panel text
|
|
37
39
|
filterPanelAddFilter: 'Tilføj filter',
|
|
38
40
|
filterPanelRemoveAll: 'Fjern alle',
|
package/locales/deDE.js
CHANGED
|
@@ -33,6 +33,8 @@ const deDEGrid = {
|
|
|
33
33
|
columnsManagementSearchTitle: 'Suche',
|
|
34
34
|
columnsManagementNoColumns: 'Keine Spalten',
|
|
35
35
|
columnsManagementShowHideAllText: 'Alle anzeigen/verbergen',
|
|
36
|
+
// columnsManagementReset: 'Reset',
|
|
37
|
+
|
|
36
38
|
// Filter panel text
|
|
37
39
|
filterPanelAddFilter: 'Filter hinzufügen',
|
|
38
40
|
filterPanelRemoveAll: 'Alle entfernen',
|
package/locales/elGR.js
CHANGED
|
@@ -33,6 +33,7 @@ const elGRGrid = {
|
|
|
33
33
|
// columnsManagementSearchTitle: 'Search',
|
|
34
34
|
// columnsManagementNoColumns: 'No columns',
|
|
35
35
|
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
36
|
+
// columnsManagementReset: 'Reset',
|
|
36
37
|
|
|
37
38
|
// Filter panel text
|
|
38
39
|
filterPanelAddFilter: 'Προσθήκη φίλτρου',
|
package/locales/esES.js
CHANGED
|
@@ -33,6 +33,8 @@ const esESGrid = {
|
|
|
33
33
|
columnsManagementSearchTitle: 'Buscar',
|
|
34
34
|
columnsManagementNoColumns: 'Sin columnas',
|
|
35
35
|
columnsManagementShowHideAllText: 'Mostrar/Ocultar todas',
|
|
36
|
+
// columnsManagementReset: 'Reset',
|
|
37
|
+
|
|
36
38
|
// Filter panel text
|
|
37
39
|
filterPanelAddFilter: 'Agregar filtro',
|
|
38
40
|
filterPanelRemoveAll: 'Remover todos',
|
package/locales/faIR.js
CHANGED
|
@@ -33,6 +33,8 @@ const faIRGrid = {
|
|
|
33
33
|
columnsManagementSearchTitle: 'جستجو',
|
|
34
34
|
columnsManagementNoColumns: 'بدون سطر',
|
|
35
35
|
columnsManagementShowHideAllText: 'نمایش/مخفی کردن همه',
|
|
36
|
+
// columnsManagementReset: 'Reset',
|
|
37
|
+
|
|
36
38
|
// Filter panel text
|
|
37
39
|
filterPanelAddFilter: 'افزودن فیلتر',
|
|
38
40
|
filterPanelRemoveAll: 'حذف همه',
|
package/locales/fiFI.js
CHANGED
|
@@ -33,6 +33,7 @@ const fiFIGrid = {
|
|
|
33
33
|
// columnsManagementSearchTitle: 'Search',
|
|
34
34
|
// columnsManagementNoColumns: 'No columns',
|
|
35
35
|
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
36
|
+
// columnsManagementReset: 'Reset',
|
|
36
37
|
|
|
37
38
|
// Filter panel text
|
|
38
39
|
filterPanelAddFilter: 'Lisää suodatin',
|
package/locales/frFR.js
CHANGED
|
@@ -33,6 +33,8 @@ const frFRGrid = {
|
|
|
33
33
|
columnsManagementSearchTitle: 'Rechercher',
|
|
34
34
|
columnsManagementNoColumns: 'Pas de colonnes',
|
|
35
35
|
columnsManagementShowHideAllText: 'Afficher/masquer toutes',
|
|
36
|
+
// columnsManagementReset: 'Reset',
|
|
37
|
+
|
|
36
38
|
// Filter panel text
|
|
37
39
|
filterPanelAddFilter: 'Ajouter un filtre',
|
|
38
40
|
filterPanelRemoveAll: 'Tout supprimer',
|