@mui/x-data-grid 6.5.0 → 6.7.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 +150 -2
- package/DataGrid/DataGrid.js +10 -3
- package/README.md +2 -2
- 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/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/containers/GridRootStyles.js +8 -1
- 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 +16 -2
- package/components/panel/GridColumnsPanel.js +14 -0
- 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 +1 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +1 -2
- package/components/panel/filterPanel/GridFilterInputDate.js +1 -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 +1 -2
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -6
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -2
- package/components/panel/filterPanel/GridFilterInputValue.js +1 -6
- package/components/panel/filterPanel/GridFilterPanel.d.ts +8 -0
- package/components/panel/filterPanel/GridFilterPanel.js +8 -0
- 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/gridClasses.d.ts +4 -0
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +4 -4
- 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 +1 -1
- 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 +31 -10
- package/hooks/features/focus/useGridFocus.js +1 -0
- package/hooks/features/preferencesPanel/gridPreferencePanelState.d.ts +2 -0
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/hooks/features/rows/useGridRowsMeta.js +12 -13
- package/hooks/features/sorting/useGridSorting.js +2 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/index.js +1 -1
- package/internals/utils/useProps.js +21 -1
- package/legacy/DataGrid/DataGrid.js +10 -3
- package/legacy/components/GridColumnHeaders.js +4 -9
- package/legacy/components/cell/GridActionsCell.js +3 -3
- 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/containers/GridRootStyles.js +8 -4
- package/legacy/components/index.js +1 -2
- package/legacy/components/panel/GridColumnsPanel.js +14 -0
- package/legacy/components/panel/GridPreferencesPanel.js +3 -1
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +7 -7
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +1 -5
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +7 -6
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -5
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +8 -0
- 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/gridClasses.js +1 -1
- package/legacy/constants/localeTextConstants.js +4 -4
- package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- 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 +31 -10
- package/legacy/hooks/features/focus/useGridFocus.js +1 -0
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/legacy/hooks/features/rows/useGridRowsMeta.js +13 -21
- package/legacy/hooks/features/sorting/useGridSorting.js +2 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/utils/useProps.js +23 -1
- package/legacy/locales/arSD.js +12 -12
- package/legacy/locales/beBY.js +12 -12
- package/legacy/locales/bgBG.js +12 -12
- package/legacy/locales/csCZ.js +25 -27
- package/legacy/locales/daDK.js +12 -12
- package/legacy/locales/deDE.js +25 -27
- package/legacy/locales/elGR.js +12 -12
- package/legacy/locales/esES.js +12 -12
- package/legacy/locales/faIR.js +12 -12
- package/legacy/locales/fiFI.js +12 -12
- package/legacy/locales/frFR.js +25 -27
- package/legacy/locales/heIL.js +12 -12
- package/legacy/locales/huHU.js +12 -12
- package/legacy/locales/itIT.js +12 -12
- package/legacy/locales/jaJP.js +12 -12
- package/legacy/locales/koKR.js +12 -12
- package/legacy/locales/nbNO.js +12 -12
- package/legacy/locales/nlNL.js +25 -27
- package/legacy/locales/plPL.js +12 -12
- package/legacy/locales/ptBR.js +12 -12
- package/legacy/locales/roRO.js +12 -12
- package/legacy/locales/ruRU.js +12 -12
- package/legacy/locales/skSK.js +12 -12
- package/legacy/locales/svSE.js +12 -12
- package/legacy/locales/trTR.js +18 -19
- package/legacy/locales/ukUA.js +12 -12
- package/legacy/locales/urPK.js +12 -12
- package/legacy/locales/viVN.js +12 -12
- package/legacy/locales/zhCN.js +12 -12
- package/legacy/locales/zhTW.js +12 -12
- package/legacy/models/gridFilterItem.js +1 -1
- package/legacy/utils/EventManager.js +2 -2
- package/locales/arSD.js +12 -12
- package/locales/beBY.js +12 -12
- package/locales/bgBG.js +12 -12
- package/locales/csCZ.js +25 -27
- package/locales/daDK.js +12 -12
- package/locales/deDE.js +25 -27
- package/locales/elGR.js +12 -12
- package/locales/esES.js +12 -12
- package/locales/faIR.js +12 -12
- package/locales/fiFI.js +12 -12
- package/locales/frFR.js +25 -27
- package/locales/heIL.js +12 -12
- package/locales/huHU.js +12 -12
- package/locales/itIT.js +12 -12
- package/locales/jaJP.js +12 -12
- package/locales/koKR.js +12 -12
- package/locales/nbNO.js +12 -12
- package/locales/nlNL.js +25 -27
- package/locales/plPL.js +12 -12
- package/locales/ptBR.js +12 -12
- package/locales/roRO.js +12 -12
- package/locales/ruRU.js +12 -12
- package/locales/skSK.js +12 -12
- package/locales/svSE.js +12 -12
- package/locales/trTR.js +18 -19
- package/locales/ukUA.js +12 -12
- package/locales/urPK.js +12 -12
- package/locales/viVN.js +12 -12
- package/locales/zhCN.js +12 -12
- package/locales/zhTW.js +12 -12
- package/material/components/MUISelectOption.d.ts +2 -2
- package/models/api/gridFilterApi.d.ts +3 -1
- package/models/api/gridPreferencesPanelApi.d.ts +3 -1
- package/models/events/gridEventLookup.d.ts +8 -0
- package/models/gridFilterItem.d.ts +1 -1
- package/models/gridFilterItem.js +1 -1
- package/models/gridFilterOperator.d.ts +1 -1
- package/models/gridStateCommunity.d.ts +2 -0
- package/models/props/DataGridProps.d.ts +5 -0
- package/modern/DataGrid/DataGrid.js +10 -3
- package/modern/components/GridColumnHeaders.js +4 -9
- package/modern/components/cell/GridActionsCell.js +3 -3
- 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/containers/GridRootStyles.js +8 -1
- package/modern/components/index.js +1 -2
- package/modern/components/panel/GridColumnsPanel.js +14 -0
- package/modern/components/panel/GridPreferencesPanel.js +3 -1
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +1 -6
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -6
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -6
- package/modern/components/panel/filterPanel/GridFilterPanel.js +8 -0
- 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/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +4 -4
- package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- 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 +31 -10
- package/modern/hooks/features/focus/useGridFocus.js +1 -0
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/modern/hooks/features/rows/useGridRowsMeta.js +12 -13
- package/modern/hooks/features/sorting/useGridSorting.js +2 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/modern/index.js +1 -1
- package/modern/internals/utils/useProps.js +20 -1
- package/modern/locales/arSD.js +12 -12
- package/modern/locales/beBY.js +12 -12
- package/modern/locales/bgBG.js +12 -12
- package/modern/locales/csCZ.js +25 -27
- package/modern/locales/daDK.js +12 -12
- package/modern/locales/deDE.js +25 -27
- package/modern/locales/elGR.js +12 -12
- package/modern/locales/esES.js +12 -12
- package/modern/locales/faIR.js +12 -12
- package/modern/locales/fiFI.js +12 -12
- package/modern/locales/frFR.js +25 -27
- package/modern/locales/heIL.js +12 -12
- package/modern/locales/huHU.js +12 -12
- package/modern/locales/itIT.js +12 -12
- package/modern/locales/jaJP.js +12 -12
- package/modern/locales/koKR.js +12 -12
- package/modern/locales/nbNO.js +12 -12
- package/modern/locales/nlNL.js +25 -27
- package/modern/locales/plPL.js +12 -12
- package/modern/locales/ptBR.js +12 -12
- package/modern/locales/roRO.js +12 -12
- package/modern/locales/ruRU.js +12 -12
- package/modern/locales/skSK.js +12 -12
- package/modern/locales/svSE.js +12 -12
- package/modern/locales/trTR.js +18 -19
- package/modern/locales/ukUA.js +12 -12
- package/modern/locales/urPK.js +12 -12
- package/modern/locales/viVN.js +12 -12
- package/modern/locales/zhCN.js +12 -12
- package/modern/locales/zhTW.js +12 -12
- package/modern/models/gridFilterItem.js +1 -1
- package/modern/utils/EventManager.js +2 -2
- package/node/DataGrid/DataGrid.js +10 -3
- package/node/components/GridColumnHeaders.js +3 -8
- package/node/components/cell/GridActionsCell.js +3 -3
- 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/containers/GridRootStyles.js +8 -1
- package/node/components/index.js +0 -11
- package/node/components/panel/GridColumnsPanel.js +14 -0
- package/node/components/panel/GridPreferencesPanel.js +3 -1
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
- package/node/components/panel/filterPanel/GridFilterInputDate.js +1 -6
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -6
- package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -6
- package/node/components/panel/filterPanel/GridFilterPanel.js +8 -0
- 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/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +4 -4
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- 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 +35 -14
- package/node/hooks/features/focus/useGridFocus.js +1 -0
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/node/hooks/features/rows/useGridRowsMeta.js +12 -13
- package/node/hooks/features/sorting/useGridSorting.js +2 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/node/index.js +1 -1
- package/node/internals/utils/useProps.js +20 -1
- package/node/locales/arSD.js +12 -12
- package/node/locales/beBY.js +12 -12
- package/node/locales/bgBG.js +12 -12
- package/node/locales/csCZ.js +25 -27
- package/node/locales/daDK.js +12 -12
- package/node/locales/deDE.js +25 -27
- package/node/locales/elGR.js +12 -12
- package/node/locales/esES.js +12 -12
- package/node/locales/faIR.js +12 -12
- package/node/locales/fiFI.js +12 -12
- package/node/locales/frFR.js +25 -27
- package/node/locales/heIL.js +12 -12
- package/node/locales/huHU.js +12 -12
- package/node/locales/itIT.js +12 -12
- package/node/locales/jaJP.js +12 -12
- package/node/locales/koKR.js +12 -12
- package/node/locales/nbNO.js +12 -12
- package/node/locales/nlNL.js +25 -27
- package/node/locales/plPL.js +12 -12
- package/node/locales/ptBR.js +12 -12
- package/node/locales/roRO.js +12 -12
- package/node/locales/ruRU.js +12 -12
- package/node/locales/skSK.js +12 -12
- package/node/locales/svSE.js +12 -12
- package/node/locales/trTR.js +18 -19
- package/node/locales/ukUA.js +12 -12
- package/node/locales/urPK.js +12 -12
- package/node/locales/viVN.js +12 -12
- package/node/locales/zhCN.js +12 -12
- package/node/locales/zhTW.js +12 -12
- package/node/models/gridFilterItem.js +1 -1
- package/node/utils/EventManager.js +2 -2
- package/package.json +4 -4
- package/themeAugmentation/overrides.d.ts +1 -1
- package/utils/EventManager.js +2 -2
- 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
|
@@ -307,6 +307,10 @@ export interface GridClasses {
|
|
|
307
307
|
* Styles applied to the column header separator icon element.
|
|
308
308
|
*/
|
|
309
309
|
iconSeparator: string;
|
|
310
|
+
/**
|
|
311
|
+
* Styles applied to the column header filter row.
|
|
312
|
+
*/
|
|
313
|
+
headerFilterRow: string;
|
|
310
314
|
/**
|
|
311
315
|
* Styles applied to the main container element.
|
|
312
316
|
*/
|
package/constants/gridClasses.js
CHANGED
|
@@ -2,4 +2,4 @@ import { unstable_generateUtilityClasses as generateUtilityClasses, unstable_gen
|
|
|
2
2
|
export function getDataGridUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiDataGrid', slot);
|
|
4
4
|
}
|
|
5
|
-
export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell', 'cellContent', 'cellCheckbox', 'cellSkeleton', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnGroupHeader', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeader--showColumnBorder', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorderColor', 'cell--withRightBorder', 'columnHeader--withRightBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
5
|
+
export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell', 'cellContent', 'cellCheckbox', 'cellSkeleton', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnGroupHeader', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeader--showColumnBorder', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorderColor', 'cell--withRightBorder', 'columnHeader--withRightBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
@@ -80,10 +80,10 @@ export const GRID_DEFAULT_LOCALE_TEXT = {
|
|
|
80
80
|
headerFilterOperatorIsAnyOf: 'Is any of',
|
|
81
81
|
'headerFilterOperator=': 'Equals',
|
|
82
82
|
'headerFilterOperator!=': 'Not equals',
|
|
83
|
-
'headerFilterOperator>': '
|
|
84
|
-
'headerFilterOperator>=': '
|
|
85
|
-
'headerFilterOperator<': '
|
|
86
|
-
'headerFilterOperator<=': '
|
|
83
|
+
'headerFilterOperator>': 'Greater than',
|
|
84
|
+
'headerFilterOperator>=': 'Greater than or equal to',
|
|
85
|
+
'headerFilterOperator<': 'Less than',
|
|
86
|
+
'headerFilterOperator<=': 'Less than or equal to',
|
|
87
87
|
// Filter values text
|
|
88
88
|
filterValueAny: 'any',
|
|
89
89
|
filterValueTrue: 'true',
|
|
@@ -5,5 +5,5 @@ type GridContextProviderProps = {
|
|
|
5
5
|
props: {};
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
};
|
|
8
|
-
export declare function GridContextProvider({ privateApiRef, props, children }: GridContextProviderProps): JSX.Element;
|
|
8
|
+
export declare function GridContextProvider({ privateApiRef, props, children }: GridContextProviderProps): React.JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GridRowTreeCreationParams, GridRowTreeCreationValue } from '../../features/rows/gridRowsInterfaces';
|
|
2
|
-
import { GridFilteringMethodParams, GridFilteringMethodValue } from '../../features/filter/gridFilterState';
|
|
1
|
+
import { GridRowTreeCreationParams, GridRowTreeCreationValue, GridRowsState } from '../../features/rows/gridRowsInterfaces';
|
|
2
|
+
import { GridFilteringMethodParams, GridFilteringMethodValue, GridFilterState, GridVisibleRowsLookupState } from '../../features/filter/gridFilterState';
|
|
3
3
|
import { GridSortingMethodParams, GridSortingMethodValue } from '../../features/sorting/gridSortingState';
|
|
4
4
|
export type GridStrategyProcessorName = keyof GridStrategyProcessingLookup;
|
|
5
5
|
export type GridStrategyGroup = GridStrategyProcessingLookup[keyof GridStrategyProcessingLookup]['group'];
|
|
@@ -19,6 +19,14 @@ export interface GridStrategyProcessingLookup {
|
|
|
19
19
|
params: GridSortingMethodParams;
|
|
20
20
|
value: GridSortingMethodValue;
|
|
21
21
|
};
|
|
22
|
+
visibleRowsLookupCreation: {
|
|
23
|
+
group: 'rowTree';
|
|
24
|
+
params: {
|
|
25
|
+
tree: GridRowsState['tree'];
|
|
26
|
+
filteredRowsLookup: GridFilterState['filteredRowsLookup'];
|
|
27
|
+
};
|
|
28
|
+
value: GridVisibleRowsLookupState;
|
|
29
|
+
};
|
|
22
30
|
}
|
|
23
31
|
export type GridStrategyProcessor<P extends GridStrategyProcessorName> = (params: GridStrategyProcessingLookup[P]['params']) => GridStrategyProcessingLookup[P]['value'];
|
|
24
32
|
export interface GridStrategyProcessingApi {
|
|
@@ -6,7 +6,8 @@ export const GRID_DEFAULT_STRATEGY = 'none';
|
|
|
6
6
|
export const GRID_STRATEGIES_PROCESSORS = {
|
|
7
7
|
rowTreeCreation: 'rowTree',
|
|
8
8
|
filtering: 'rowTree',
|
|
9
|
-
sorting: 'rowTree'
|
|
9
|
+
sorting: 'rowTree',
|
|
10
|
+
visibleRowsLookupCreation: 'rowTree'
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
12
13
|
* Implements a variant of the Strategy Pattern (see https://en.wikipedia.org/wiki/Strategy_pattern)
|
|
@@ -32,7 +32,7 @@ export interface GetHeadersParams {
|
|
|
32
32
|
}
|
|
33
33
|
export declare const useGridColumnHeaders: (props: UseGridColumnHeadersProps) => {
|
|
34
34
|
renderContext: GridRenderContext | null;
|
|
35
|
-
getColumnHeaders: (params?: GetHeadersParams, other?: {}) => JSX.Element | null;
|
|
35
|
+
getColumnHeaders: (params?: GetHeadersParams, other?: {}) => React.JSX.Element | null;
|
|
36
36
|
getColumnsToRender: (params?: GetHeadersParams) => {
|
|
37
37
|
renderedColumns: GridStateColDef[];
|
|
38
38
|
firstColumnToRender: number;
|
|
@@ -11,10 +11,10 @@ export declare const gridFilterModelSelector: import("../../../utils/createSelec
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const gridQuickFilterValuesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, any[] | undefined>;
|
|
13
13
|
/**
|
|
14
|
-
* @category
|
|
14
|
+
* @category Visible rows
|
|
15
15
|
* @ignore - do not document.
|
|
16
16
|
*/
|
|
17
|
-
export declare const gridVisibleRowsLookupSelector:
|
|
17
|
+
export declare const gridVisibleRowsLookupSelector: (state: GridStateCommunity) => import("./gridFilterState").GridVisibleRowsLookupState;
|
|
18
18
|
/**
|
|
19
19
|
* @category Filtering
|
|
20
20
|
* @ignore - do not document.
|
|
@@ -21,10 +21,10 @@ export const gridFilterModelSelector = createSelector(gridFilterStateSelector, f
|
|
|
21
21
|
export const gridQuickFilterValuesSelector = createSelector(gridFilterModelSelector, filterModel => filterModel.quickFilterValues);
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* @category
|
|
24
|
+
* @category Visible rows
|
|
25
25
|
* @ignore - do not document.
|
|
26
26
|
*/
|
|
27
|
-
export const gridVisibleRowsLookupSelector =
|
|
27
|
+
export const gridVisibleRowsLookupSelector = state => state.visibleRowsLookup;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* @category Filtering
|
|
@@ -17,12 +17,6 @@ export interface GridFilterState {
|
|
|
17
17
|
* This is the equivalent of the `visibleRowsLookup` if all the groups were expanded.
|
|
18
18
|
*/
|
|
19
19
|
filteredRowsLookup: Record<GridRowId, boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Visibility status for each row.
|
|
22
|
-
* A row is visible if it is passing the filters AND if its parents are expanded.
|
|
23
|
-
* If a row is not registered in this lookup, it is visible.
|
|
24
|
-
*/
|
|
25
|
-
visibleRowsLookup: Record<GridRowId, boolean>;
|
|
26
20
|
/**
|
|
27
21
|
* Amount of descendants that are passing the filters.
|
|
28
22
|
* For the Tree Data, it includes all the intermediate depth levels (= amount of children + amount of grand children + ...).
|
|
@@ -47,3 +41,9 @@ export interface GridFilteringMethodParams {
|
|
|
47
41
|
filterModel: GridFilterModel;
|
|
48
42
|
}
|
|
49
43
|
export type GridFilteringMethodValue = Omit<GridFilterState, 'filterModel'>;
|
|
44
|
+
/**
|
|
45
|
+
* Visibility status for each row.
|
|
46
|
+
* A row is visible if it is passing the filters AND if its parents are expanded.
|
|
47
|
+
* If a row is not registered in this lookup, it is visible.
|
|
48
|
+
*/
|
|
49
|
+
export type GridVisibleRowsLookupState = Record<GridRowId, boolean>;
|
|
@@ -9,4 +9,10 @@ export const getDefaultGridFilterModel = () => ({
|
|
|
9
9
|
/**
|
|
10
10
|
* @param {GridRowId} rowId The id of the row we want to filter.
|
|
11
11
|
* @param {(filterItem: GridFilterItem) => boolean} shouldApplyItem An optional callback to allow the filtering engine to only apply some items.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Visibility status for each row.
|
|
16
|
+
* A row is visible if it is passing the filters AND if its parents are expanded.
|
|
17
|
+
* If a row is not registered in this lookup, it is visible.
|
|
12
18
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
3
4
|
import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
4
5
|
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
5
6
|
import { useGridLogger } from '../../utils/useGridLogger';
|
|
@@ -20,11 +21,21 @@ export const filterStateInitializer = (state, props, apiRef) => {
|
|
|
20
21
|
return _extends({}, state, {
|
|
21
22
|
filter: {
|
|
22
23
|
filterModel: sanitizeFilterModel(filterModel, props.disableMultipleColumnsFiltering, apiRef),
|
|
23
|
-
visibleRowsLookup: {},
|
|
24
24
|
filteredDescendantCountLookup: {}
|
|
25
|
-
}
|
|
25
|
+
},
|
|
26
|
+
visibleRowsLookup: {}
|
|
26
27
|
});
|
|
27
28
|
};
|
|
29
|
+
const getVisibleRowsLookup = params => {
|
|
30
|
+
// For flat tree, the `visibleRowsLookup` and the `filteredRowsLookup` are equals since no row is collapsed.
|
|
31
|
+
return params.filteredRowsLookup;
|
|
32
|
+
};
|
|
33
|
+
function getVisibleRowsLookupState(apiRef, state) {
|
|
34
|
+
return apiRef.current.applyStrategyProcessor('visibleRowsLookupCreation', {
|
|
35
|
+
tree: state.rows.tree,
|
|
36
|
+
filteredRowsLookup: state.filter.filteredRowsLookup
|
|
37
|
+
});
|
|
38
|
+
}
|
|
28
39
|
|
|
29
40
|
/**
|
|
30
41
|
* @requires useGridColumns (method, event)
|
|
@@ -49,9 +60,13 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
49
60
|
isRowMatchingFilters,
|
|
50
61
|
filterModel: filterModel != null ? filterModel : getDefaultGridFilterModel()
|
|
51
62
|
});
|
|
52
|
-
|
|
63
|
+
const newState = _extends({}, state, {
|
|
53
64
|
filter: _extends({}, state.filter, filteringResult)
|
|
54
65
|
});
|
|
66
|
+
const visibleRowsLookupState = getVisibleRowsLookupState(apiRef, newState);
|
|
67
|
+
return _extends({}, newState, {
|
|
68
|
+
visibleRowsLookup: visibleRowsLookupState
|
|
69
|
+
});
|
|
55
70
|
});
|
|
56
71
|
apiRef.current.publishEvent('filteredRowsSet');
|
|
57
72
|
}, [props.filterMode, apiRef]);
|
|
@@ -107,7 +122,7 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
107
122
|
items
|
|
108
123
|
}), 'deleteFilterItem');
|
|
109
124
|
}, [apiRef]);
|
|
110
|
-
const showFilterPanel = React.useCallback(targetColumnField => {
|
|
125
|
+
const showFilterPanel = React.useCallback((targetColumnField, panelId, labelId) => {
|
|
111
126
|
logger.debug('Displaying filter panel');
|
|
112
127
|
if (targetColumnField) {
|
|
113
128
|
const filterModel = gridFilterModelSelector(apiRef);
|
|
@@ -153,7 +168,7 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
153
168
|
items: newFilterItems
|
|
154
169
|
}));
|
|
155
170
|
}
|
|
156
|
-
apiRef.current.showPreferences(GridPreferencePanelsValue.filters);
|
|
171
|
+
apiRef.current.showPreferences(GridPreferencePanelsValue.filters, panelId, labelId);
|
|
157
172
|
}, [apiRef, logger, props.disableMultipleColumnsFiltering]);
|
|
158
173
|
const hideFilterPanel = React.useCallback(() => {
|
|
159
174
|
logger.debug('Hiding filter panel');
|
|
@@ -262,13 +277,10 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
262
277
|
}
|
|
263
278
|
return {
|
|
264
279
|
filteredRowsLookup,
|
|
265
|
-
// For flat tree, the `visibleRowsLookup` and the `filteredRowsLookup` are equals since no row is collapsed.
|
|
266
|
-
visibleRowsLookup: filteredRowsLookup,
|
|
267
280
|
filteredDescendantCountLookup: {}
|
|
268
281
|
};
|
|
269
282
|
}
|
|
270
283
|
return {
|
|
271
|
-
visibleRowsLookup: {},
|
|
272
284
|
filteredRowsLookup: {},
|
|
273
285
|
filteredDescendantCountLookup: {}
|
|
274
286
|
};
|
|
@@ -278,6 +290,7 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
278
290
|
useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
279
291
|
useGridRegisterPipeProcessor(apiRef, 'preferencePanel', preferencePanelPreProcessing);
|
|
280
292
|
useGridRegisterStrategyProcessor(apiRef, GRID_DEFAULT_STRATEGY, 'filtering', flatFilteringMethod);
|
|
293
|
+
useGridRegisterStrategyProcessor(apiRef, GRID_DEFAULT_STRATEGY, 'visibleRowsLookupCreation', getVisibleRowsLookup);
|
|
281
294
|
|
|
282
295
|
/**
|
|
283
296
|
* EVENTS
|
|
@@ -298,13 +311,21 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
298
311
|
apiRef.current.unstable_applyFilters();
|
|
299
312
|
}
|
|
300
313
|
}, [apiRef]);
|
|
314
|
+
const updateVisibleRowsLookupState = React.useCallback(() => {
|
|
315
|
+
apiRef.current.setState(state => {
|
|
316
|
+
return _extends({}, state, {
|
|
317
|
+
visibleRowsLookup: getVisibleRowsLookupState(apiRef, state)
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
apiRef.current.forceUpdate();
|
|
321
|
+
}, [apiRef]);
|
|
301
322
|
|
|
302
323
|
// Do not call `apiRef.current.forceUpdate` to avoid re-render before updating the sorted rows.
|
|
303
324
|
// Otherwise, the state is not consistent during the render
|
|
304
325
|
useGridApiEventHandler(apiRef, 'rowsSet', updateFilteredRows);
|
|
305
|
-
useGridApiEventHandler(apiRef, 'rowExpansionChange', apiRef.current.unstable_applyFilters);
|
|
306
326
|
useGridApiEventHandler(apiRef, 'columnsChange', handleColumnsChange);
|
|
307
327
|
useGridApiEventHandler(apiRef, 'activeStrategyProcessorChange', handleStrategyProcessorChange);
|
|
328
|
+
useGridApiEventHandler(apiRef, 'rowExpansionChange', updateVisibleRowsLookupState);
|
|
308
329
|
|
|
309
330
|
/**
|
|
310
331
|
* 1ST RENDER
|
|
@@ -316,7 +337,7 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
316
337
|
/**
|
|
317
338
|
* EFFECTS
|
|
318
339
|
*/
|
|
319
|
-
|
|
340
|
+
useEnhancedEffect(() => {
|
|
320
341
|
if (props.filterModel !== undefined) {
|
|
321
342
|
apiRef.current.setFilterModel(props.filterModel);
|
|
322
343
|
}
|
|
@@ -350,6 +350,7 @@ export const useGridFocus = (apiRef, props) => {
|
|
|
350
350
|
};
|
|
351
351
|
}, [apiRef, handleDocumentClick]);
|
|
352
352
|
useGridApiEventHandler(apiRef, 'columnHeaderBlur', handleBlur);
|
|
353
|
+
useGridApiEventHandler(apiRef, 'headerFilterBlur', handleBlur);
|
|
353
354
|
useGridApiEventHandler(apiRef, 'cellDoubleClick', handleCellDoubleClick);
|
|
354
355
|
useGridApiEventHandler(apiRef, 'cellMouseDown', handleCellMouseDown);
|
|
355
356
|
useGridApiEventHandler(apiRef, 'cellKeyDown', handleCellKeyDown);
|
|
@@ -52,13 +52,15 @@ export const useGridPreferencesPanel = (apiRef, props) => {
|
|
|
52
52
|
const hidePreferencesDelayed = React.useCallback(() => {
|
|
53
53
|
hideTimeout.current = setTimeout(hidePreferences, 100);
|
|
54
54
|
}, [hidePreferences]);
|
|
55
|
-
const showPreferences = React.useCallback(newValue => {
|
|
55
|
+
const showPreferences = React.useCallback((newValue, panelId, labelId) => {
|
|
56
56
|
logger.debug('Opening Preferences Panel');
|
|
57
57
|
doNotHidePanel();
|
|
58
58
|
apiRef.current.setState(state => _extends({}, state, {
|
|
59
59
|
preferencePanel: _extends({}, state.preferencePanel, {
|
|
60
60
|
open: true,
|
|
61
|
-
openedPanelValue: newValue
|
|
61
|
+
openedPanelValue: newValue,
|
|
62
|
+
panelId,
|
|
63
|
+
labelId
|
|
62
64
|
})
|
|
63
65
|
}));
|
|
64
66
|
apiRef.current.publishEvent('preferencePanelOpen', {
|
|
@@ -41,7 +41,7 @@ export const useGridRowsMeta = (apiRef, props) => {
|
|
|
41
41
|
getRowSpacing,
|
|
42
42
|
getEstimatedRowHeight
|
|
43
43
|
} = props;
|
|
44
|
-
const rowsHeightLookup = React.useRef(
|
|
44
|
+
const rowsHeightLookup = React.useRef(Object.create(null));
|
|
45
45
|
|
|
46
46
|
// Inspired by https://github.com/bvaughn/react-virtualized/blob/master/source/Grid/utils/CellSizeAndPositionManager.js
|
|
47
47
|
const lastMeasuredRowIndex = React.useRef(-1);
|
|
@@ -105,17 +105,14 @@ export const useGridRowsMeta = (apiRef, props) => {
|
|
|
105
105
|
} else {
|
|
106
106
|
rowsHeightLookup.current[row.id].needsFirstMeasurement = false;
|
|
107
107
|
}
|
|
108
|
-
const
|
|
108
|
+
const initialHeights = {};
|
|
109
|
+
/* eslint-disable-next-line no-restricted-syntax */
|
|
110
|
+
for (const key in sizes) {
|
|
109
111
|
if (/^base[A-Z]/.test(key)) {
|
|
110
|
-
|
|
112
|
+
initialHeights[key] = sizes[key];
|
|
111
113
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
// We use an object to make simple to check if a height is already added or not
|
|
116
|
-
const initialHeights = _extends({}, existingBaseSizes, {
|
|
117
|
-
baseCenter: baseRowHeight
|
|
118
|
-
});
|
|
114
|
+
}
|
|
115
|
+
initialHeights.baseCenter = baseRowHeight;
|
|
119
116
|
if (getRowSpacing) {
|
|
120
117
|
var _spacing$top, _spacing$bottom;
|
|
121
118
|
const indexRelativeToCurrentPage = apiRef.current.getRowIndexRelativeToVisibleRows(row.id);
|
|
@@ -137,13 +134,15 @@ export const useGridRowsMeta = (apiRef, props) => {
|
|
|
137
134
|
let maximumBaseSize = 0;
|
|
138
135
|
let otherSizes = 0;
|
|
139
136
|
const processedSizes = calculateRowProcessedSizes(row);
|
|
140
|
-
|
|
141
|
-
|
|
137
|
+
/* eslint-disable-next-line no-restricted-syntax, guard-for-in */
|
|
138
|
+
for (const key in processedSizes) {
|
|
139
|
+
const value = processedSizes[key];
|
|
140
|
+
if (/^base[A-Z]/.test(key)) {
|
|
142
141
|
maximumBaseSize = value > maximumBaseSize ? value : maximumBaseSize;
|
|
143
142
|
} else {
|
|
144
143
|
otherSizes += value;
|
|
145
144
|
}
|
|
146
|
-
}
|
|
145
|
+
}
|
|
147
146
|
return acc + maximumBaseSize + otherSizes;
|
|
148
147
|
}, 0);
|
|
149
148
|
pinnedRows == null ? void 0 : (_pinnedRows$top = pinnedRows.top) == null ? void 0 : _pinnedRows$top.forEach(row => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
3
4
|
import { isEnterKey } from '../../../utils/keyboardUtils';
|
|
4
5
|
import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
5
6
|
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
@@ -244,7 +245,7 @@ export const useGridSorting = (apiRef, props) => {
|
|
|
244
245
|
/**
|
|
245
246
|
* EFFECTS
|
|
246
247
|
*/
|
|
247
|
-
|
|
248
|
+
useEnhancedEffect(() => {
|
|
248
249
|
if (props.sortModel !== undefined) {
|
|
249
250
|
apiRef.current.setSortModel(props.sortModel);
|
|
250
251
|
}
|
|
@@ -91,7 +91,7 @@ export const useGridVirtualScroller = props => {
|
|
|
91
91
|
height: null
|
|
92
92
|
});
|
|
93
93
|
const prevTotalWidth = React.useRef(columnsTotalWidth);
|
|
94
|
-
const rowStyleCache = React.useRef(
|
|
94
|
+
const rowStyleCache = React.useRef(Object.create(null));
|
|
95
95
|
const prevGetRowProps = React.useRef();
|
|
96
96
|
const prevRootRowStyle = React.useRef();
|
|
97
97
|
const getRenderedColumnsRef = React.useRef(defaultMemoize((columns, firstColumnToRender, lastColumnToRender) => {
|
|
@@ -377,7 +377,7 @@ export const useGridVirtualScroller = props => {
|
|
|
377
377
|
rootRowProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
378
378
|
const invalidatesCachedRowStyle = prevGetRowProps.current !== getRowProps || prevRootRowStyle.current !== rootRowStyle;
|
|
379
379
|
if (invalidatesCachedRowStyle) {
|
|
380
|
-
rowStyleCache.current =
|
|
380
|
+
rowStyleCache.current = Object.create(null);
|
|
381
381
|
}
|
|
382
382
|
const rows = [];
|
|
383
383
|
for (let i = 0; i < renderedRows.length; i += 1) {
|
package/index.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
const _excluded = ["components", "componentsProps"];
|
|
3
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
|
+
}
|
|
4
24
|
export function useProps(allProps) {
|
|
5
25
|
return React.useMemo(() => {
|
|
6
26
|
const {
|
|
@@ -8,6 +28,6 @@ export function useProps(allProps) {
|
|
|
8
28
|
componentsProps
|
|
9
29
|
} = allProps,
|
|
10
30
|
themedProps = _objectWithoutPropertiesLoose(allProps, _excluded);
|
|
11
|
-
return [components, componentsProps, themedProps];
|
|
31
|
+
return [components, componentsProps, groupForwardedProps(themedProps)];
|
|
12
32
|
}, [allProps]);
|
|
13
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]].
|
|
@@ -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,
|
|
@@ -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
|
}));
|