@mui/x-data-grid 5.12.0 → 5.12.3
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 +160 -7
- package/colDef/gridCheckboxSelectionColDef.d.ts +1 -0
- package/colDef/gridCheckboxSelectionColDef.js +2 -1
- package/colDef/gridDateOperators.d.ts +1 -1
- package/colDef/gridNumericColDef.js +1 -1
- package/components/cell/GridBooleanCell.js +4 -3
- package/components/cell/GridEditBooleanCell.js +4 -3
- package/components/cell/GridEditDateCell.js +4 -3
- package/components/cell/GridEditInputCell.js +4 -3
- package/components/cell/GridEditSingleSelectCell.js +9 -7
- package/components/columnHeaders/GridColumnHeaderItem.js +5 -3
- package/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
- package/components/columnSelection/GridHeaderCheckbox.js +0 -1
- package/components/containers/GridRootStyles.js +4 -1
- package/components/panel/GridColumnsPanel.js +3 -6
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +3 -2
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +12 -5
- package/components/panel/filterPanel/GridFilterPanel.js +2 -5
- package/components/toolbar/GridToolbarColumnsButton.js +0 -1
- package/components/toolbar/GridToolbarDensitySelector.js +0 -1
- package/components/toolbar/GridToolbarExportContainer.js +0 -1
- package/components/toolbar/GridToolbarFilterButton.js +0 -1
- package/components/toolbar/GridToolbarQuickFilter.d.ts +7 -0
- package/components/toolbar/GridToolbarQuickFilter.js +57 -4
- package/constants/defaultGridSlotsComponents.js +2 -1
- package/constants/localeTextConstants.js +1 -0
- package/hooks/core/useGridStateInitialization.js +19 -6
- package/hooks/features/columnMenu/useGridColumnMenu.js +22 -0
- package/hooks/features/columns/useGridColumnSpanning.d.ts +1 -1
- package/hooks/features/columns/useGridColumnSpanning.js +1 -1
- package/hooks/features/columns/useGridColumns.d.ts +1 -1
- package/hooks/features/columns/useGridColumns.js +1 -1
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +5 -0
- package/hooks/features/dimensions/useGridDimensions.js +9 -8
- package/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/hooks/features/filter/gridFilterSelector.d.ts +5 -0
- package/hooks/features/filter/gridFilterSelector.js +6 -0
- package/hooks/features/filter/gridFilterState.d.ts +1 -1
- package/hooks/features/filter/gridFilterUtils.d.ts +1 -1
- package/hooks/features/filter/gridFilterUtils.js +10 -9
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/filter/useGridFilter.js +24 -7
- package/hooks/features/pagination/useGridPage.js +1 -1
- package/hooks/features/pagination/useGridPageSize.js +1 -1
- package/hooks/features/rows/useGridRows.js +15 -2
- package/hooks/features/rows/useGridRowsMeta.js +79 -77
- package/hooks/features/selection/useGridSelection.js +1 -1
- package/hooks/features/selection/useGridSelectionPreProcessors.js +8 -6
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/features/sorting/useGridSorting.js +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +42 -8
- package/index.js +1 -1
- package/legacy/colDef/gridCheckboxSelectionColDef.js +2 -1
- package/legacy/colDef/gridNumericColDef.js +1 -1
- package/legacy/components/cell/GridBooleanCell.js +3 -1
- package/legacy/components/cell/GridEditBooleanCell.js +4 -2
- package/legacy/components/cell/GridEditDateCell.js +4 -2
- package/legacy/components/cell/GridEditInputCell.js +4 -2
- package/legacy/components/cell/GridEditSingleSelectCell.js +9 -7
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +5 -3
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +0 -1
- package/legacy/components/containers/GridRootStyles.js +7 -5
- package/legacy/components/panel/GridColumnsPanel.js +5 -6
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +12 -5
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +3 -6
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +0 -1
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +0 -1
- package/legacy/components/toolbar/GridToolbarExportContainer.js +0 -1
- package/legacy/components/toolbar/GridToolbarFilterButton.js +0 -1
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +67 -6
- package/legacy/constants/defaultGridSlotsComponents.js +2 -1
- package/legacy/constants/localeTextConstants.js +1 -0
- package/legacy/hooks/core/useGridStateInitialization.js +18 -6
- package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +22 -0
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +1 -1
- package/legacy/hooks/features/columns/useGridColumns.js +1 -1
- package/legacy/hooks/features/dimensions/useGridDimensions.js +9 -8
- package/legacy/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/legacy/hooks/features/filter/gridFilterSelector.js +8 -0
- package/legacy/hooks/features/filter/gridFilterUtils.js +11 -10
- package/legacy/hooks/features/filter/useGridFilter.js +28 -7
- package/legacy/hooks/features/pagination/useGridPage.js +1 -1
- package/legacy/hooks/features/pagination/useGridPageSize.js +1 -1
- package/legacy/hooks/features/rows/useGridRows.js +17 -2
- package/legacy/hooks/features/rows/useGridRowsMeta.js +81 -77
- package/legacy/hooks/features/selection/useGridSelection.js +1 -1
- package/legacy/hooks/features/selection/useGridSelectionPreProcessors.js +8 -6
- package/legacy/hooks/features/sorting/useGridSorting.js +1 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +42 -8
- package/legacy/index.js +1 -1
- package/legacy/locales/arSD.js +1 -0
- package/legacy/locales/bgBG.js +1 -0
- package/legacy/locales/csCZ.js +1 -0
- package/legacy/locales/daDK.js +1 -0
- package/legacy/locales/deDE.js +1 -0
- package/legacy/locales/elGR.js +1 -0
- package/legacy/locales/esES.js +1 -0
- package/legacy/locales/faIR.js +1 -0
- package/legacy/locales/fiFI.js +1 -0
- package/legacy/locales/frFR.js +1 -0
- package/legacy/locales/heIL.js +1 -0
- package/legacy/locales/huHU.js +1 -0
- package/legacy/locales/index.js +1 -0
- package/legacy/locales/itIT.js +1 -0
- package/legacy/locales/jaJP.js +29 -24
- package/legacy/locales/koKR.js +1 -0
- package/legacy/locales/nbNO.js +1 -0
- package/legacy/locales/nlNL.js +1 -0
- package/legacy/locales/plPL.js +1 -0
- package/legacy/locales/ptBR.js +1 -0
- package/legacy/locales/ruRU.js +7 -6
- package/legacy/locales/skSK.js +1 -0
- package/legacy/locales/svSE.js +128 -0
- package/legacy/locales/trTR.js +1 -0
- package/legacy/locales/ukUA.js +1 -0
- package/legacy/locales/viVN.js +1 -0
- package/legacy/locales/zhCN.js +1 -0
- package/locales/arSD.js +1 -0
- package/locales/bgBG.js +1 -0
- package/locales/csCZ.js +1 -0
- package/locales/daDK.js +1 -0
- package/locales/deDE.js +1 -0
- package/locales/elGR.js +1 -0
- package/locales/esES.js +1 -0
- package/locales/faIR.js +1 -0
- package/locales/fiFI.js +1 -0
- package/locales/frFR.js +1 -0
- package/locales/heIL.js +1 -0
- package/locales/huHU.js +1 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/itIT.js +1 -0
- package/locales/jaJP.js +25 -24
- 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 +1 -0
- package/locales/ruRU.js +7 -6
- package/locales/skSK.js +1 -0
- package/locales/svSE.d.ts +2 -0
- package/locales/svSE.js +116 -0
- package/locales/trTR.js +1 -0
- package/locales/ukUA.js +1 -0
- package/locales/viVN.js +1 -0
- package/locales/zhCN.js +1 -0
- package/models/api/gridCallbackDetails.d.ts +6 -1
- package/models/api/gridFilterApi.d.ts +8 -1
- package/models/api/gridLocaleTextApi.d.ts +1 -0
- package/models/api/gridStateApi.d.ts +14 -3
- package/models/colDef/gridColDef.d.ts +1 -1
- package/models/events/gridEventLookup.d.ts +3 -0
- package/models/gridIconSlotsComponent.d.ts +5 -0
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/colDef/gridCheckboxSelectionColDef.js +2 -1
- package/modern/colDef/gridNumericColDef.js +1 -1
- package/modern/components/cell/GridBooleanCell.js +4 -3
- package/modern/components/cell/GridEditBooleanCell.js +4 -3
- package/modern/components/cell/GridEditDateCell.js +4 -3
- package/modern/components/cell/GridEditInputCell.js +4 -3
- package/modern/components/cell/GridEditSingleSelectCell.js +9 -7
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +5 -3
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
- package/modern/components/columnSelection/GridHeaderCheckbox.js +0 -1
- package/modern/components/containers/GridRootStyles.js +4 -1
- package/modern/components/panel/GridColumnsPanel.js +3 -6
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +12 -5
- package/modern/components/panel/filterPanel/GridFilterPanel.js +2 -5
- package/modern/components/toolbar/GridToolbarColumnsButton.js +0 -1
- package/modern/components/toolbar/GridToolbarDensitySelector.js +0 -1
- package/modern/components/toolbar/GridToolbarExportContainer.js +0 -1
- package/modern/components/toolbar/GridToolbarFilterButton.js +0 -1
- package/modern/components/toolbar/GridToolbarQuickFilter.js +57 -4
- package/modern/constants/defaultGridSlotsComponents.js +2 -1
- package/modern/constants/localeTextConstants.js +1 -0
- package/modern/hooks/core/useGridStateInitialization.js +19 -6
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +22 -0
- package/modern/hooks/features/columns/useGridColumnSpanning.js +1 -1
- package/modern/hooks/features/columns/useGridColumns.js +1 -1
- package/modern/hooks/features/dimensions/useGridDimensions.js +9 -8
- package/modern/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/modern/hooks/features/filter/gridFilterSelector.js +6 -0
- package/modern/hooks/features/filter/gridFilterUtils.js +10 -9
- package/modern/hooks/features/filter/useGridFilter.js +24 -7
- package/modern/hooks/features/pagination/useGridPage.js +1 -1
- package/modern/hooks/features/pagination/useGridPageSize.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +15 -2
- package/modern/hooks/features/rows/useGridRowsMeta.js +77 -75
- package/modern/hooks/features/selection/useGridSelection.js +1 -1
- package/modern/hooks/features/selection/useGridSelectionPreProcessors.js +8 -6
- package/modern/hooks/features/sorting/useGridSorting.js +1 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +42 -8
- package/modern/index.js +1 -1
- package/modern/locales/arSD.js +1 -0
- package/modern/locales/bgBG.js +1 -0
- package/modern/locales/csCZ.js +1 -0
- package/modern/locales/daDK.js +1 -0
- package/modern/locales/deDE.js +1 -0
- package/modern/locales/elGR.js +1 -0
- package/modern/locales/esES.js +1 -0
- package/modern/locales/faIR.js +1 -0
- package/modern/locales/fiFI.js +1 -0
- package/modern/locales/frFR.js +1 -0
- package/modern/locales/heIL.js +1 -0
- package/modern/locales/huHU.js +1 -0
- package/modern/locales/index.js +1 -0
- package/modern/locales/itIT.js +1 -0
- package/modern/locales/jaJP.js +25 -24
- 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 +1 -0
- package/modern/locales/ruRU.js +7 -6
- package/modern/locales/skSK.js +1 -0
- package/modern/locales/svSE.js +116 -0
- package/modern/locales/trTR.js +1 -0
- package/modern/locales/ukUA.js +1 -0
- package/modern/locales/viVN.js +1 -0
- package/modern/locales/zhCN.js +1 -0
- package/node/colDef/gridCheckboxSelectionColDef.js +4 -2
- package/node/colDef/gridNumericColDef.js +1 -1
- package/node/components/cell/GridBooleanCell.js +5 -3
- package/node/components/cell/GridEditBooleanCell.js +5 -3
- package/node/components/cell/GridEditDateCell.js +5 -3
- package/node/components/cell/GridEditInputCell.js +5 -3
- package/node/components/cell/GridEditSingleSelectCell.js +10 -7
- package/node/components/columnHeaders/GridColumnHeaderItem.js +5 -3
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
- package/node/components/columnSelection/GridHeaderCheckbox.js +0 -1
- package/node/components/containers/GridRootStyles.js +4 -1
- package/node/components/panel/GridColumnsPanel.js +3 -6
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +12 -5
- package/node/components/panel/filterPanel/GridFilterPanel.js +2 -5
- package/node/components/toolbar/GridToolbarColumnsButton.js +0 -1
- package/node/components/toolbar/GridToolbarDensitySelector.js +0 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +0 -1
- package/node/components/toolbar/GridToolbarFilterButton.js +0 -1
- package/node/components/toolbar/GridToolbarQuickFilter.js +61 -4
- package/node/constants/defaultGridSlotsComponents.js +2 -1
- package/node/constants/localeTextConstants.js +1 -0
- package/node/hooks/core/useGridStateInitialization.js +19 -6
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +23 -0
- package/node/hooks/features/columns/useGridColumnSpanning.js +11 -16
- package/node/hooks/features/columns/useGridColumns.js +1 -1
- package/node/hooks/features/dimensions/useGridDimensions.js +9 -8
- package/node/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/node/hooks/features/filter/gridFilterSelector.js +9 -2
- package/node/hooks/features/filter/gridFilterUtils.js +9 -8
- package/node/hooks/features/filter/useGridFilter.js +24 -7
- package/node/hooks/features/pagination/useGridPage.js +1 -1
- package/node/hooks/features/pagination/useGridPageSize.js +1 -1
- package/node/hooks/features/rows/useGridRows.js +15 -2
- package/node/hooks/features/rows/useGridRowsMeta.js +80 -77
- package/node/hooks/features/selection/useGridSelection.js +1 -1
- package/node/hooks/features/selection/useGridSelectionPreProcessors.js +7 -5
- package/node/hooks/features/sorting/useGridSorting.js +1 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +42 -9
- package/node/index.js +1 -1
- package/node/locales/arSD.js +1 -0
- package/node/locales/bgBG.js +1 -0
- package/node/locales/csCZ.js +1 -0
- package/node/locales/daDK.js +1 -0
- package/node/locales/deDE.js +1 -0
- package/node/locales/elGR.js +1 -0
- package/node/locales/esES.js +1 -0
- package/node/locales/faIR.js +1 -0
- package/node/locales/fiFI.js +1 -0
- package/node/locales/frFR.js +1 -0
- package/node/locales/heIL.js +1 -0
- package/node/locales/huHU.js +1 -0
- package/node/locales/index.js +13 -0
- package/node/locales/itIT.js +1 -0
- package/node/locales/jaJP.js +25 -24
- 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 +1 -0
- package/node/locales/ruRU.js +7 -6
- package/node/locales/skSK.js +1 -0
- package/node/locales/svSE.js +126 -0
- package/node/locales/trTR.js +1 -0
- package/node/locales/ukUA.js +1 -0
- package/node/locales/viVN.js +1 -0
- package/node/locales/zhCN.js +1 -0
- package/package.json +4 -3
|
@@ -10,7 +10,7 @@ export var GridRootStyles = styled('div', {
|
|
|
10
10
|
_defineProperty({}, "& .".concat(gridClasses['cell--withRenderer']), styles['cell--withRenderer']), _defineProperty({}, "& .".concat(gridClasses.cell), styles.cell), _defineProperty({}, "& .".concat(gridClasses.cellContent), styles.cellContent), _defineProperty({}, "& .".concat(gridClasses.cellCheckbox), styles.cellCheckbox), _defineProperty({}, "& .".concat(gridClasses.checkboxInput), styles.checkboxInput), _defineProperty({}, "& .".concat(gridClasses['columnHeader--alignCenter']), styles['columnHeader--alignCenter']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--alignLeft']), styles['columnHeader--alignLeft']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--alignRight']), styles['columnHeader--alignRight']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--dragging']), styles['columnHeader--dragging']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--moving']), styles['columnHeader--moving']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--numeric']), styles['columnHeader--numeric']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--sortable']), styles['columnHeader--sortable']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--sorted']), styles['columnHeader--sorted']), _defineProperty({}, "& .".concat(gridClasses.columnHeader), styles.columnHeader), _defineProperty({}, "& .".concat(gridClasses.columnHeaderCheckbox), styles.columnHeaderCheckbox), _defineProperty({}, "& .".concat(gridClasses.columnHeaderDraggableContainer), styles.columnHeaderDraggableContainer), _defineProperty({}, "& .".concat(gridClasses.columnHeaderTitleContainer), styles.columnHeaderTitleContainer), _defineProperty({}, "& .".concat(gridClasses['columnSeparator--resizable']), styles['columnSeparator--resizable']), _defineProperty({}, "& .".concat(gridClasses['columnSeparator--resizing']), styles['columnSeparator--resizing']), _defineProperty({}, "& .".concat(gridClasses.columnSeparator), styles.columnSeparator), _defineProperty({}, "& .".concat(gridClasses.filterIcon), styles.filterIcon), _defineProperty({}, "& .".concat(gridClasses.iconSeparator), styles.iconSeparator), _defineProperty({}, "& .".concat(gridClasses.menuIcon), styles.menuIcon), _defineProperty({}, "& .".concat(gridClasses.menuIconButton), styles.menuIconButton), _defineProperty({}, "& .".concat(gridClasses.menuOpen), styles.menuOpen), _defineProperty({}, "& .".concat(gridClasses.menuList), styles.menuList), _defineProperty({}, "& .".concat(gridClasses['row--editable']), styles['row--editable']), _defineProperty({}, "& .".concat(gridClasses['row--editing']), styles['row--editing']), _defineProperty({}, "& .".concat(gridClasses['row--dragging']), styles['row--dragging']), _defineProperty({}, "& .".concat(gridClasses.row), styles.row), _defineProperty({}, "& .".concat(gridClasses.rowReorderCellPlaceholder), styles.rowReorderCellPlaceholder), _defineProperty({}, "& .".concat(gridClasses.rowReorderCell), styles.rowReorderCell), _defineProperty({}, "& .".concat(gridClasses['rowReorderCell--draggable']), styles['rowReorderCell--draggable']), _defineProperty({}, "& .".concat(gridClasses.sortIcon), styles.sortIcon), _defineProperty({}, "& .".concat(gridClasses.withBorder), styles.withBorder), _defineProperty({}, "& .".concat(gridClasses.treeDataGroupingCell), styles.treeDataGroupingCell), _defineProperty({}, "& .".concat(gridClasses.treeDataGroupingCellToggle), styles.treeDataGroupingCellToggle), _defineProperty({}, "& .".concat(gridClasses.detailPanelToggleCell), styles.detailPanelToggleCell), _defineProperty({}, "& .".concat(gridClasses['detailPanelToggleCell--expanded']), styles['detailPanelToggleCell--expanded']), styles.root];
|
|
11
11
|
}
|
|
12
12
|
})(function (_ref46) {
|
|
13
|
-
var _$concat3, _extends2;
|
|
13
|
+
var _$concat2, _$concat3, _extends2;
|
|
14
14
|
|
|
15
15
|
var theme = _ref46.theme;
|
|
16
16
|
var borderColor = theme.palette.mode === 'light' ? lighten(alpha(theme.palette.divider, 1), 0.88) : darken(alpha(theme.palette.divider, 1), 0.68);
|
|
@@ -68,7 +68,7 @@ export var GridRootStyles = styled('div', {
|
|
|
68
68
|
minWidth: 0,
|
|
69
69
|
flex: 1,
|
|
70
70
|
whiteSpace: 'nowrap',
|
|
71
|
-
|
|
71
|
+
overflowX: 'hidden'
|
|
72
72
|
}), _defineProperty(_extends2, "& .".concat(gridClasses.columnHeaderTitleContainerContent), {
|
|
73
73
|
overflow: 'hidden',
|
|
74
74
|
display: 'flex',
|
|
@@ -100,7 +100,7 @@ export var GridRootStyles = styled('div', {
|
|
|
100
100
|
left: -12
|
|
101
101
|
}), _defineProperty(_extends2, "& .".concat(gridClasses['columnSeparator--sideRight']), {
|
|
102
102
|
right: -12
|
|
103
|
-
}), _defineProperty(_extends2, "& .".concat(gridClasses['columnSeparator--resizable']),
|
|
103
|
+
}), _defineProperty(_extends2, "& .".concat(gridClasses['columnSeparator--resizable']), (_$concat2 = {
|
|
104
104
|
cursor: 'col-resize',
|
|
105
105
|
touchAction: 'none',
|
|
106
106
|
'&:hover': {
|
|
@@ -110,9 +110,11 @@ export var GridRootStyles = styled('div', {
|
|
|
110
110
|
color: borderColor
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
}, "&.".concat(gridClasses['columnSeparator--resizing']), {
|
|
113
|
+
}, _defineProperty(_$concat2, "&.".concat(gridClasses['columnSeparator--resizing']), {
|
|
114
114
|
color: theme.palette.text.primary
|
|
115
|
-
})
|
|
115
|
+
}), _defineProperty(_$concat2, '& svg', {
|
|
116
|
+
pointerEvents: 'none'
|
|
117
|
+
}), _$concat2)), _defineProperty(_extends2, "& .".concat(gridClasses.iconSeparator), {
|
|
116
118
|
color: 'inherit'
|
|
117
119
|
}), _defineProperty(_extends2, "& .".concat(gridClasses.menuIcon), {
|
|
118
120
|
width: 0,
|
|
@@ -91,7 +91,9 @@ export function GridColumnsPanel(props) {
|
|
|
91
91
|
return apiRef.current.setColumnVisibilityModel({});
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
return apiRef.current.setColumnVisibilityModel(Object.fromEntries(columns.
|
|
94
|
+
return apiRef.current.setColumnVisibilityModel(Object.fromEntries(columns.filter(function (col) {
|
|
95
|
+
return col.hideable !== false;
|
|
96
|
+
}).map(function (col) {
|
|
95
97
|
return [col.field, false];
|
|
96
98
|
})));
|
|
97
99
|
} // TODO v6: Remove
|
|
@@ -149,7 +151,6 @@ export function GridColumnsPanel(props) {
|
|
|
149
151
|
checked: columnVisibilityModel[column.field] !== false,
|
|
150
152
|
onClick: toggleColumn,
|
|
151
153
|
name: column.field,
|
|
152
|
-
color: "primary",
|
|
153
154
|
size: "small"
|
|
154
155
|
}, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSwitch)),
|
|
155
156
|
label: column.headerName || column.field
|
|
@@ -168,15 +169,13 @@ export function GridColumnsPanel(props) {
|
|
|
168
169
|
children: [/*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
169
170
|
onClick: function onClick() {
|
|
170
171
|
return toggleAllColumns(false);
|
|
171
|
-
}
|
|
172
|
-
color: "primary"
|
|
172
|
+
}
|
|
173
173
|
}, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.baseButton, {
|
|
174
174
|
children: apiRef.current.getLocaleText('columnsPanelHideAllButton')
|
|
175
175
|
})), /*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
176
176
|
onClick: function onClick() {
|
|
177
177
|
return toggleAllColumns(true);
|
|
178
|
-
}
|
|
179
|
-
color: "primary"
|
|
178
|
+
}
|
|
180
179
|
}, (_rootProps$components4 = rootProps.componentsProps) == null ? void 0 : _rootProps$components4.baseButton, {
|
|
181
180
|
children: apiRef.current.getLocaleText('columnsPanelShowAllButton')
|
|
182
181
|
}))]
|
|
@@ -29,9 +29,17 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
29
29
|
var id = useId();
|
|
30
30
|
var resolvedColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
|
|
31
31
|
var resolvedValueOptions = React.useMemo(function () {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
32
|
+
if (!(resolvedColumn != null && resolvedColumn.valueOptions)) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (typeof resolvedColumn.valueOptions === 'function') {
|
|
37
|
+
return resolvedColumn.valueOptions({
|
|
38
|
+
field: resolvedColumn.field
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return resolvedColumn.valueOptions;
|
|
35
43
|
}, [resolvedColumn]);
|
|
36
44
|
var resolvedFormattedValueOptions = React.useMemo(function () {
|
|
37
45
|
return resolvedValueOptions == null ? void 0 : resolvedValueOptions.map(getValueFromOption);
|
|
@@ -94,8 +102,7 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
94
102
|
return /*#__PURE__*/_jsx(Autocomplete, _extends({
|
|
95
103
|
multiple: true,
|
|
96
104
|
limitTags: 1,
|
|
97
|
-
options: resolvedValueOptions
|
|
98
|
-
,
|
|
105
|
+
options: resolvedValueOptions,
|
|
99
106
|
isOptionEqualToValue: isOptionEqualToValue,
|
|
100
107
|
filterOptions: filter,
|
|
101
108
|
id: id,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["linkOperators", "columnsSort", "filterFormProps", "children"];
|
|
5
5
|
import * as React from 'react';
|
|
@@ -73,9 +73,7 @@ var GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(pro
|
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
apiRef.current.
|
|
77
|
-
items: [].concat(_toConsumableArray(items), [defaultItem])
|
|
78
|
-
}));
|
|
76
|
+
apiRef.current.upsertFilterItems([].concat(_toConsumableArray(items), [defaultItem]));
|
|
79
77
|
};
|
|
80
78
|
|
|
81
79
|
var deleteFilter = React.useCallback(function (item) {
|
|
@@ -118,8 +116,7 @@ var GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(pro
|
|
|
118
116
|
}), !rootProps.disableMultipleColumnsFiltering && /*#__PURE__*/_jsx(GridPanelFooter, {
|
|
119
117
|
children: /*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
120
118
|
onClick: addNewFilter,
|
|
121
|
-
startIcon: /*#__PURE__*/_jsx(GridAddIcon, {})
|
|
122
|
-
color: "primary"
|
|
119
|
+
startIcon: /*#__PURE__*/_jsx(GridAddIcon, {})
|
|
123
120
|
}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseButton, {
|
|
124
121
|
children: apiRef.current.getLocaleText('filterPanelAddFilter')
|
|
125
122
|
}))
|
|
@@ -39,7 +39,6 @@ export var GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function Gri
|
|
|
39
39
|
return /*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
40
40
|
ref: ref,
|
|
41
41
|
size: "small",
|
|
42
|
-
color: "primary",
|
|
43
42
|
"aria-label": apiRef.current.getLocaleText('toolbarColumnsLabel'),
|
|
44
43
|
startIcon: /*#__PURE__*/_jsx(rootProps.components.ColumnSelectorIcon, {})
|
|
45
44
|
}, other, {
|
|
@@ -105,7 +105,6 @@ export var GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function G
|
|
|
105
105
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
106
106
|
children: [/*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
107
107
|
ref: handleRef,
|
|
108
|
-
color: "primary",
|
|
109
108
|
size: "small",
|
|
110
109
|
startIcon: startIcon,
|
|
111
110
|
"aria-label": apiRef.current.getLocaleText('toolbarDensityLabel'),
|
|
@@ -58,7 +58,6 @@ export var GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function G
|
|
|
58
58
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
59
59
|
children: [/*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
60
60
|
ref: handleRef,
|
|
61
|
-
color: "primary",
|
|
62
61
|
size: "small",
|
|
63
62
|
startIcon: /*#__PURE__*/_jsx(rootProps.components.ExportIcon, {}),
|
|
64
63
|
"aria-expanded": open ? 'true' : undefined,
|
|
@@ -110,7 +110,6 @@ var GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolbar
|
|
|
110
110
|
children: /*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
111
111
|
ref: ref,
|
|
112
112
|
size: "small",
|
|
113
|
-
color: "primary",
|
|
114
113
|
"aria-label": apiRef.current.getLocaleText('toolbarFiltersLabel'),
|
|
115
114
|
startIcon: /*#__PURE__*/_jsx(Badge, {
|
|
116
115
|
badgeContent: activeFilters.length,
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
+
var _excluded = ["quickFilterParser", "quickFilterFormatter", "debounceMs"];
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
8
|
import TextField from '@mui/material/TextField';
|
|
9
|
+
import IconButton from '@mui/material/IconButton';
|
|
8
10
|
import { styled } from '@mui/material/styles';
|
|
9
11
|
import { debounce } from '@mui/material/utils';
|
|
10
12
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
11
13
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
14
|
+
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
15
|
+
import { gridQuickFilterValuesSelector } from '../../hooks/features/filter';
|
|
16
|
+
import { isDeepEqual } from '../../utils/utils';
|
|
12
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
18
|
var GridToolbarQuickFilterRoot = styled(TextField, {
|
|
14
19
|
name: 'MuiDataGrid',
|
|
@@ -17,17 +22,27 @@ var GridToolbarQuickFilterRoot = styled(TextField, {
|
|
|
17
22
|
return styles.toolbarQuickFilter;
|
|
18
23
|
}
|
|
19
24
|
})(function (_ref) {
|
|
25
|
+
var _ref2;
|
|
26
|
+
|
|
20
27
|
var theme = _ref.theme;
|
|
21
|
-
return {
|
|
28
|
+
return _ref2 = {
|
|
22
29
|
width: 'auto',
|
|
23
30
|
paddingBottom: theme.spacing(0.5),
|
|
24
|
-
'&
|
|
25
|
-
|
|
31
|
+
'& input': {
|
|
32
|
+
marginLeft: theme.spacing(0.5)
|
|
26
33
|
},
|
|
27
34
|
'& .MuiInput-underline:before': {
|
|
28
35
|
borderBottom: "1px solid ".concat(theme.palette.divider)
|
|
29
36
|
}
|
|
30
|
-
}
|
|
37
|
+
}, _defineProperty(_ref2, "& input[type=search]::-ms-clear,\n& input[type=search]::-ms-reveal", {
|
|
38
|
+
/* clears the 'X' icon from IE */
|
|
39
|
+
display: 'none',
|
|
40
|
+
width: 0,
|
|
41
|
+
height: 0
|
|
42
|
+
}), _defineProperty(_ref2, "& input[type=\"search\"]::-webkit-search-decoration,\n & input[type=\"search\"]::-webkit-search-cancel-button,\n & input[type=\"search\"]::-webkit-search-results-button,\n & input[type=\"search\"]::-webkit-search-results-decoration", {
|
|
43
|
+
/* clears the 'X' icon from Chrome */
|
|
44
|
+
display: 'none'
|
|
45
|
+
}), _ref2;
|
|
31
46
|
});
|
|
32
47
|
|
|
33
48
|
var defaultSearchValueParser = function defaultSearchValueParser(searchText) {
|
|
@@ -36,23 +51,47 @@ var defaultSearchValueParser = function defaultSearchValueParser(searchText) {
|
|
|
36
51
|
});
|
|
37
52
|
};
|
|
38
53
|
|
|
54
|
+
var defaultSearchValueFormatter = function defaultSearchValueFormatter(values) {
|
|
55
|
+
return values.join(' ');
|
|
56
|
+
};
|
|
57
|
+
|
|
39
58
|
function GridToolbarQuickFilter(props) {
|
|
40
59
|
var _rootProps$components;
|
|
41
60
|
|
|
42
61
|
var _props$quickFilterPar = props.quickFilterParser,
|
|
43
62
|
quickFilterParser = _props$quickFilterPar === void 0 ? defaultSearchValueParser : _props$quickFilterPar,
|
|
63
|
+
_props$quickFilterFor = props.quickFilterFormatter,
|
|
64
|
+
quickFilterFormatter = _props$quickFilterFor === void 0 ? defaultSearchValueFormatter : _props$quickFilterFor,
|
|
44
65
|
_props$debounceMs = props.debounceMs,
|
|
45
66
|
debounceMs = _props$debounceMs === void 0 ? 500 : _props$debounceMs,
|
|
46
67
|
other = _objectWithoutProperties(props, _excluded);
|
|
47
68
|
|
|
48
69
|
var apiRef = useGridApiContext();
|
|
49
70
|
var rootProps = useGridRootProps();
|
|
71
|
+
var quickFilterValues = useGridSelector(apiRef, gridQuickFilterValuesSelector);
|
|
50
72
|
|
|
51
|
-
var _React$useState = React.useState(
|
|
73
|
+
var _React$useState = React.useState(function () {
|
|
74
|
+
return quickFilterFormatter(quickFilterValues != null ? quickFilterValues : []);
|
|
75
|
+
}),
|
|
52
76
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
53
77
|
searchValue = _React$useState2[0],
|
|
54
78
|
setSearchValue = _React$useState2[1];
|
|
55
79
|
|
|
80
|
+
var _React$useState3 = React.useState(quickFilterValues),
|
|
81
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
82
|
+
prevQuickFilterValues = _React$useState4[0],
|
|
83
|
+
setPrevQuickFilterValues = _React$useState4[1];
|
|
84
|
+
|
|
85
|
+
React.useEffect(function () {
|
|
86
|
+
if (!isDeepEqual(prevQuickFilterValues, quickFilterValues)) {
|
|
87
|
+
// The model of quick filter value has been updated
|
|
88
|
+
setPrevQuickFilterValues(quickFilterValues); // Update the input value if needed to match the new model
|
|
89
|
+
|
|
90
|
+
setSearchValue(function (prevSearchValue) {
|
|
91
|
+
return isDeepEqual(quickFilterParser(prevSearchValue), quickFilterValues) ? prevSearchValue : quickFilterFormatter(quickFilterValues != null ? quickFilterValues : []);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}, [prevQuickFilterValues, quickFilterValues, quickFilterFormatter, quickFilterParser]);
|
|
56
95
|
var updateSearchValue = React.useCallback(function (newSearchValue) {
|
|
57
96
|
apiRef.current.setQuickFilterValues(quickFilterParser(newSearchValue));
|
|
58
97
|
}, [apiRef, quickFilterParser]);
|
|
@@ -64,6 +103,10 @@ function GridToolbarQuickFilter(props) {
|
|
|
64
103
|
setSearchValue(newSearchValue);
|
|
65
104
|
debouncedUpdateSearchValue(newSearchValue);
|
|
66
105
|
}, [debouncedUpdateSearchValue]);
|
|
106
|
+
var handleSearchReset = React.useCallback(function () {
|
|
107
|
+
setSearchValue('');
|
|
108
|
+
updateSearchValue('');
|
|
109
|
+
}, [updateSearchValue]);
|
|
67
110
|
return /*#__PURE__*/_jsx(GridToolbarQuickFilterRoot, _extends({
|
|
68
111
|
as: rootProps.components.BaseTextField,
|
|
69
112
|
variant: "standard",
|
|
@@ -75,6 +118,17 @@ function GridToolbarQuickFilter(props) {
|
|
|
75
118
|
InputProps: {
|
|
76
119
|
startAdornment: /*#__PURE__*/_jsx(rootProps.components.QuickFilterIcon, {
|
|
77
120
|
fontSize: "small"
|
|
121
|
+
}),
|
|
122
|
+
endAdornment: /*#__PURE__*/_jsx(IconButton, {
|
|
123
|
+
"aria-label": apiRef.current.getLocaleText('toolbarQuickFilterDeleteIconLabel'),
|
|
124
|
+
size: "small",
|
|
125
|
+
sx: {
|
|
126
|
+
visibility: searchValue ? 'visible' : 'hidden'
|
|
127
|
+
},
|
|
128
|
+
onClick: handleSearchReset,
|
|
129
|
+
children: /*#__PURE__*/_jsx(rootProps.components.QuickFilterClearIcon, {
|
|
130
|
+
fontSize: "small"
|
|
131
|
+
})
|
|
78
132
|
})
|
|
79
133
|
}
|
|
80
134
|
}, other, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseTextField));
|
|
@@ -92,6 +146,13 @@ process.env.NODE_ENV !== "production" ? GridToolbarQuickFilter.propTypes = {
|
|
|
92
146
|
*/
|
|
93
147
|
debounceMs: PropTypes.number,
|
|
94
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Function responsible for formatting values of quick filter in a string when the model is modified
|
|
151
|
+
* @param {any[]} values The new values passed to the quick filter model
|
|
152
|
+
* @returns {string} The string to display in the text field
|
|
153
|
+
*/
|
|
154
|
+
quickFilterFormatter: PropTypes.func,
|
|
155
|
+
|
|
95
156
|
/**
|
|
96
157
|
* Function responsible for parsing text input in an array of independent values for quick filtering.
|
|
97
158
|
* @param {string} input The value entered by the user
|
|
@@ -35,7 +35,8 @@ var DEFAULT_GRID_ICON_SLOTS_COMPONENTS = {
|
|
|
35
35
|
DetailPanelExpandIcon: GridAddIcon,
|
|
36
36
|
DetailPanelCollapseIcon: GridRemoveIcon,
|
|
37
37
|
RowReorderIcon: GridDragIcon,
|
|
38
|
-
QuickFilterIcon: GridSearchIcon
|
|
38
|
+
QuickFilterIcon: GridSearchIcon,
|
|
39
|
+
QuickFilterClearIcon: GridCloseIcon
|
|
39
40
|
};
|
|
40
41
|
/**
|
|
41
42
|
* TODO: Differentiate community and pro value and interface
|
|
@@ -117,6 +117,7 @@ export var GRID_DEFAULT_LOCALE_TEXT = {
|
|
|
117
117
|
return "Stop grouping by ".concat(name);
|
|
118
118
|
},
|
|
119
119
|
// Master/detail
|
|
120
|
+
detailPanelToggle: 'Detail panel toggle',
|
|
120
121
|
expandDetailPanel: 'Expand',
|
|
121
122
|
collapseDetailPanel: 'Collapse',
|
|
122
123
|
// Used core components translation keys
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
@@ -13,7 +14,7 @@ export var useGridStateInitialization = function useGridStateInitialization(apiR
|
|
|
13
14
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
14
15
|
rawForceUpdate = _React$useState2[1];
|
|
15
16
|
|
|
16
|
-
var
|
|
17
|
+
var registerControlState = React.useCallback(function (controlStateItem) {
|
|
17
18
|
var stateId = controlStateItem.stateId,
|
|
18
19
|
others = _objectWithoutProperties(controlStateItem, _excluded);
|
|
19
20
|
|
|
@@ -21,7 +22,7 @@ export var useGridStateInitialization = function useGridStateInitialization(apiR
|
|
|
21
22
|
stateId: stateId
|
|
22
23
|
});
|
|
23
24
|
}, []);
|
|
24
|
-
var setState = React.useCallback(function (state) {
|
|
25
|
+
var setState = React.useCallback(function (state, reason) {
|
|
25
26
|
var newState;
|
|
26
27
|
|
|
27
28
|
if (isFunction(state)) {
|
|
@@ -83,18 +84,28 @@ export var useGridStateInitialization = function useGridStateInitialization(apiR
|
|
|
83
84
|
|
|
84
85
|
if (controlState.propOnChange && hasPropChanged) {
|
|
85
86
|
var details = props.signature === GridSignature.DataGridPro ? {
|
|
86
|
-
api: apiRef.current
|
|
87
|
-
|
|
87
|
+
api: apiRef.current,
|
|
88
|
+
reason: reason
|
|
89
|
+
} : {
|
|
90
|
+
reason: reason
|
|
91
|
+
};
|
|
88
92
|
controlState.propOnChange(model, details);
|
|
89
93
|
}
|
|
90
94
|
|
|
91
95
|
if (!ignoreSetState) {
|
|
92
|
-
apiRef.current.publishEvent(controlState.changeEvent, model
|
|
96
|
+
apiRef.current.publishEvent(controlState.changeEvent, model, {
|
|
97
|
+
reason: reason
|
|
98
|
+
});
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
return !ignoreSetState;
|
|
97
103
|
}, [apiRef, props.signature]);
|
|
104
|
+
var updateControlState = React.useCallback(function (key, state, reason) {
|
|
105
|
+
return apiRef.current.setState(function (previousState) {
|
|
106
|
+
return _extends({}, previousState, _defineProperty({}, key, state(previousState[key])));
|
|
107
|
+
}, reason);
|
|
108
|
+
}, [apiRef]);
|
|
98
109
|
var forceUpdate = React.useCallback(function () {
|
|
99
110
|
return rawForceUpdate(function () {
|
|
100
111
|
return apiRef.current.state;
|
|
@@ -103,7 +114,8 @@ export var useGridStateInitialization = function useGridStateInitialization(apiR
|
|
|
103
114
|
var stateApi = {
|
|
104
115
|
setState: setState,
|
|
105
116
|
forceUpdate: forceUpdate,
|
|
106
|
-
unstable_updateControlState: updateControlState
|
|
117
|
+
unstable_updateControlState: updateControlState,
|
|
118
|
+
unstable_registerControlState: registerControlState
|
|
107
119
|
};
|
|
108
120
|
useGridApiMethod(apiRef, stateApi, 'GridStateApi');
|
|
109
121
|
};
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useGridLogger, useGridApiMethod, useGridApiEventHandler } from '../../utils';
|
|
4
4
|
import { gridColumnMenuSelector } from './columnMenuSelector';
|
|
5
|
+
import { gridClasses } from '../../../constants/gridClasses';
|
|
5
6
|
export var columnMenuStateInitializer = function columnMenuStateInitializer(state) {
|
|
6
7
|
return _extends({}, state, {
|
|
7
8
|
columnMenu: {
|
|
@@ -79,7 +80,28 @@ export var useGridColumnMenu = function useGridColumnMenu(apiRef) {
|
|
|
79
80
|
* EVENTS
|
|
80
81
|
*/
|
|
81
82
|
|
|
83
|
+
var handleColumnHeaderFocus = React.useCallback(function (params, event) {
|
|
84
|
+
// Check if the column menu button received focus
|
|
85
|
+
if (!event.target.classList.contains(gridClasses.menuIconButton)) {
|
|
86
|
+
return;
|
|
87
|
+
} // Check if there's an element which lost focus
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
if (!event.relatedTarget) {
|
|
91
|
+
return;
|
|
92
|
+
} // `true` if the focus was on the column menu itself, not on any item
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
var columnMenuLostFocus = event.relatedTarget.classList.contains(gridClasses.menuList); // `true` if the focus was on an item from the column menu
|
|
96
|
+
|
|
97
|
+
var columnMenuItemLostFocus = event.relatedTarget.getAttribute('role') === 'menuitem';
|
|
98
|
+
|
|
99
|
+
if (columnMenuLostFocus || columnMenuItemLostFocus) {
|
|
100
|
+
apiRef.current.setColumnHeaderFocus(params.field);
|
|
101
|
+
}
|
|
102
|
+
}, [apiRef]);
|
|
82
103
|
useGridApiEventHandler(apiRef, 'columnResizeStart', hideColumnMenu);
|
|
104
|
+
useGridApiEventHandler(apiRef, 'columnHeaderFocus', handleColumnHeaderFocus);
|
|
83
105
|
useGridApiEventHandler(apiRef, 'virtualScrollerWheel', apiRef.current.hideColumnMenu);
|
|
84
106
|
useGridApiEventHandler(apiRef, 'virtualScrollerTouchMove', apiRef.current.hideColumnMenu);
|
|
85
107
|
};
|
|
@@ -46,7 +46,7 @@ export function useGridColumns(apiRef, props) {
|
|
|
46
46
|
}, [props.columnTypes]);
|
|
47
47
|
var previousColumnsProp = React.useRef(props.columns);
|
|
48
48
|
var previousColumnTypesProp = React.useRef(columnTypes);
|
|
49
|
-
apiRef.current.
|
|
49
|
+
apiRef.current.unstable_registerControlState({
|
|
50
50
|
stateId: 'visibleColumns',
|
|
51
51
|
propModel: props.columnVisibilityModel,
|
|
52
52
|
propOnChange: props.onColumnVisibilityModelChange,
|
|
@@ -36,7 +36,7 @@ var hasScroll = function hasScroll(_ref) {
|
|
|
36
36
|
|
|
37
37
|
export function useGridDimensions(apiRef, props) {
|
|
38
38
|
var logger = useGridLogger(apiRef, 'useResizeContainer');
|
|
39
|
-
var
|
|
39
|
+
var errorShown = React.useRef(false);
|
|
40
40
|
var rootDimensionsRef = React.useRef(null);
|
|
41
41
|
var fullDimensionsRef = React.useRef(null);
|
|
42
42
|
var rowsMeta = useGridSelector(apiRef, gridRowsMetaSelector);
|
|
@@ -94,7 +94,8 @@ export function useGridDimensions(apiRef, props) {
|
|
|
94
94
|
viewportOuterSize: viewportOuterSize,
|
|
95
95
|
viewportInnerSize: viewportInnerSize,
|
|
96
96
|
hasScrollX: hasScrollX,
|
|
97
|
-
hasScrollY: hasScrollY
|
|
97
|
+
hasScrollY: hasScrollY,
|
|
98
|
+
scrollBarSize: scrollBarSize
|
|
98
99
|
};
|
|
99
100
|
var prevDimensions = fullDimensionsRef.current;
|
|
100
101
|
fullDimensionsRef.current = newFullDimensions;
|
|
@@ -148,14 +149,14 @@ export function useGridDimensions(apiRef, props) {
|
|
|
148
149
|
|
|
149
150
|
var isJSDOM = /jsdom/.test(window.navigator.userAgent);
|
|
150
151
|
|
|
151
|
-
if (size.height === 0 && !
|
|
152
|
-
logger.
|
|
153
|
-
|
|
152
|
+
if (size.height === 0 && !errorShown.current && !props.autoHeight && !isJSDOM) {
|
|
153
|
+
logger.error(['The parent DOM element of the data grid has an empty height.', 'Please make sure that this element has an intrinsic height.', 'The grid displays with a height of 0px.', '', 'More details: https://mui.com/r/x-data-grid-no-dimensions.'].join('\n'));
|
|
154
|
+
errorShown.current = true;
|
|
154
155
|
}
|
|
155
156
|
|
|
156
|
-
if (size.width === 0 && !
|
|
157
|
-
logger.
|
|
158
|
-
|
|
157
|
+
if (size.width === 0 && !errorShown.current && !isJSDOM) {
|
|
158
|
+
logger.error(['The parent DOM element of the data grid has an empty width.', 'Please make sure that this element has an intrinsic width.', 'The grid displays with a width of 0px.', '', 'More details: https://mui.com/r/x-data-grid-no-dimensions.'].join('\n'));
|
|
159
|
+
errorShown.current = true;
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
if (isTestEnvironment) {
|
|
@@ -26,7 +26,7 @@ export function useGridEditing(apiRef, props) {
|
|
|
26
26
|
useCellEditing(apiRef, props);
|
|
27
27
|
useGridRowEditing(apiRef, props);
|
|
28
28
|
var debounceMap = React.useRef({});
|
|
29
|
-
apiRef.current.
|
|
29
|
+
apiRef.current.unstable_registerControlState({
|
|
30
30
|
stateId: 'editRows',
|
|
31
31
|
propModel: props.editRowsModel,
|
|
32
32
|
propOnChange: props.onEditRowsModelChange,
|
|
@@ -17,6 +17,14 @@ export var gridFilterStateSelector = function gridFilterStateSelector(state) {
|
|
|
17
17
|
export var gridFilterModelSelector = createSelector(gridFilterStateSelector, function (filterState) {
|
|
18
18
|
return filterState.filterModel;
|
|
19
19
|
});
|
|
20
|
+
/**
|
|
21
|
+
* Get the current quick filter values.
|
|
22
|
+
* @category Filtering
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export var gridQuickFilterValuesSelector = createSelector(gridFilterModelSelector, function (filterModel) {
|
|
26
|
+
return filterModel.quickFilterValues;
|
|
27
|
+
});
|
|
20
28
|
/**
|
|
21
29
|
* @category Filtering
|
|
22
30
|
* @ignore - do not document.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { GridLinkOperator } from '../../../models';
|
|
3
3
|
import { buildWarning } from '../../../utils/warning';
|
|
4
|
-
import { gridColumnFieldsSelector } from '../columns';
|
|
4
|
+
import { gridColumnFieldsSelector, gridColumnLookupSelector } from '../columns';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Adds default values to the optional fields of a filter items.
|
|
@@ -18,8 +18,9 @@ export var cleanFilterItem = function cleanFilterItem(item, apiRef) {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
if (cleanItem.operatorValue == null) {
|
|
21
|
-
//
|
|
22
|
-
|
|
21
|
+
// Selects a default operator
|
|
22
|
+
// We don't use `apiRef.current.getColumn` because it is not ready during state initialization
|
|
23
|
+
var column = gridColumnLookupSelector(apiRef)[cleanItem.columnField];
|
|
23
24
|
cleanItem.operatorValue = column && column.filterOperators[0].value;
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -71,11 +72,9 @@ export var sanitizeFilterModel = function sanitizeFilterModel(model, disableMult
|
|
|
71
72
|
return model;
|
|
72
73
|
};
|
|
73
74
|
export var mergeStateWithFilterModel = function mergeStateWithFilterModel(filterModel, disableMultipleColumnsFiltering, apiRef) {
|
|
74
|
-
return function (
|
|
75
|
-
return _extends({},
|
|
76
|
-
|
|
77
|
-
filterModel: sanitizeFilterModel(filterModel, disableMultipleColumnsFiltering, apiRef)
|
|
78
|
-
})
|
|
75
|
+
return function (filteringState) {
|
|
76
|
+
return _extends({}, filteringState, {
|
|
77
|
+
filterModel: sanitizeFilterModel(filterModel, disableMultipleColumnsFiltering, apiRef)
|
|
79
78
|
});
|
|
80
79
|
};
|
|
81
80
|
};
|
|
@@ -214,15 +213,17 @@ export var buildAggregatedQuickFilterApplier = function buildAggregatedQuickFilt
|
|
|
214
213
|
});
|
|
215
214
|
return function (rowId, shouldApplyFilter) {
|
|
216
215
|
var usedCellParams = {};
|
|
216
|
+
var columnsFieldsToFilter = [];
|
|
217
217
|
Object.keys(appliersPerColumnField).forEach(function (columnField) {
|
|
218
218
|
if (!shouldApplyFilter || shouldApplyFilter(columnField)) {
|
|
219
219
|
usedCellParams[columnField] = apiRef.current.getCellParams(rowId, columnField);
|
|
220
|
+
columnsFieldsToFilter.push(columnField);
|
|
220
221
|
}
|
|
221
222
|
}); // Return `false` as soon as we have a quick filter value that does not match any column
|
|
222
223
|
|
|
223
224
|
if (quickFilterLogicOperator === GridLinkOperator.And) {
|
|
224
225
|
return sanitizedQuickFilterValues.every(function (value, index) {
|
|
225
|
-
return
|
|
226
|
+
return columnsFieldsToFilter.some(function (field) {
|
|
226
227
|
var _appliersPerColumnFie, _appliersPerColumnFie2;
|
|
227
228
|
|
|
228
229
|
if (appliersPerColumnField[field][index] == null) {
|
|
@@ -236,7 +237,7 @@ export var buildAggregatedQuickFilterApplier = function buildAggregatedQuickFilt
|
|
|
236
237
|
|
|
237
238
|
|
|
238
239
|
return sanitizedQuickFilterValues.some(function (value, index) {
|
|
239
|
-
return
|
|
240
|
+
return columnsFieldsToFilter.some(function (field) {
|
|
240
241
|
var _appliersPerColumnFie3, _appliersPerColumnFie4;
|
|
241
242
|
|
|
242
243
|
if (appliersPerColumnField[field][index] == null) {
|