@mui/x-data-grid 5.11.1 → 5.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +199 -20
- package/DataGrid/DataGrid.js +26 -1
- package/README.md +2 -2
- 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/GridRow.d.ts +1 -1
- package/components/GridRow.js +51 -12
- package/components/cell/GridActionsCellItem.d.ts +1 -1
- package/components/cell/GridCell.d.ts +2 -1
- package/components/cell/GridCell.js +12 -7
- package/components/columnHeaders/GridColumnHeaderItem.js +9 -6
- package/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
- package/components/columnSelection/GridHeaderCheckbox.js +0 -1
- package/components/containers/GridRootStyles.js +8 -3
- package/components/menu/GridMenu.js +9 -2
- package/components/panel/GridColumnsPanel.js +12 -7
- package/components/panel/GridPanelWrapper.d.ts +1 -1
- package/components/panel/GridPanelWrapper.js +3 -3
- package/components/panel/filterPanel/GridFilterForm.d.ts +61 -4
- package/components/panel/filterPanel/GridFilterForm.js +88 -8
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/components/panel/filterPanel/GridFilterPanel.d.ts +8 -5
- package/components/panel/filterPanel/GridFilterPanel.js +26 -11
- 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.d.ts +1 -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/gridClasses.d.ts +4 -0
- package/constants/gridClasses.js +1 -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/gridColumnsInterfaces.d.ts +3 -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 +13 -15
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +5 -0
- package/hooks/features/dimensions/useGridDimensions.js +9 -8
- package/hooks/features/editRows/useGridCellEditing.new.js +11 -4
- package/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/hooks/features/editRows/useGridRowEditing.new.js +10 -4
- package/hooks/features/events/useGridEvents.d.ts +1 -1
- package/hooks/features/events/useGridEvents.js +2 -0
- 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 +10 -2
- package/hooks/features/filter/gridFilterUtils.js +3 -6
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/filter/useGridFilter.js +29 -12
- package/hooks/features/pagination/useGridPage.js +1 -1
- package/hooks/features/pagination/useGridPageSize.js +1 -1
- package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
- package/hooks/features/rows/useGridRowsMeta.js +133 -67
- 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 +2 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +65 -11
- package/index.js +1 -1
- package/internals/index.d.ts +1 -0
- package/legacy/DataGrid/DataGrid.js +26 -1
- package/legacy/colDef/gridCheckboxSelectionColDef.js +2 -1
- package/legacy/colDef/gridNumericColDef.js +1 -1
- package/legacy/components/GridRow.js +56 -12
- package/legacy/components/cell/GridCell.js +12 -7
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +11 -6
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +0 -1
- package/legacy/components/containers/GridRootStyles.js +10 -7
- package/legacy/components/menu/GridMenu.js +9 -2
- package/legacy/components/panel/GridColumnsPanel.js +14 -7
- package/legacy/components/panel/GridPanelWrapper.js +3 -3
- package/legacy/components/panel/filterPanel/GridFilterForm.js +89 -8
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +28 -12
- 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/gridClasses.js +1 -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 +13 -15
- package/legacy/hooks/features/dimensions/useGridDimensions.js +9 -8
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +14 -7
- package/legacy/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +10 -4
- package/legacy/hooks/features/events/useGridEvents.js +2 -0
- package/legacy/hooks/features/filter/gridFilterSelector.js +8 -0
- package/legacy/hooks/features/filter/gridFilterUtils.js +4 -7
- package/legacy/hooks/features/filter/useGridFilter.js +33 -12
- package/legacy/hooks/features/pagination/useGridPage.js +1 -1
- package/legacy/hooks/features/pagination/useGridPageSize.js +1 -1
- package/legacy/hooks/features/rows/useGridRowsMeta.js +133 -66
- 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 +84 -26
- 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 +10 -9
- package/legacy/locales/huHU.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 +128 -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/trTR.js +8 -7
- package/legacy/locales/ukUA.js +1 -0
- package/legacy/locales/viVN.js +1 -0
- package/legacy/locales/zhCN.js +1 -0
- package/legacy/models/events/gridEvents.js +2 -0
- package/legacy/models/gridApiCaches.js +1 -0
- package/legacy/models/params/gridMenuParams.js +1 -0
- package/legacy/models/params/index.js +2 -1
- 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 +10 -9
- package/locales/huHU.js +1 -0
- package/locales/itIT.js +1 -0
- package/locales/jaJP.js +25 -24
- package/locales/koKR.js +1 -0
- package/locales/nbNO.d.ts +2 -0
- package/locales/nbNO.js +116 -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/trTR.js +8 -7
- 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/gridCoreApi.d.ts +2 -6
- package/models/api/gridFilterApi.d.ts +8 -1
- package/models/api/gridLocaleTextApi.d.ts +1 -0
- package/models/api/gridRowsMetaApi.d.ts +24 -0
- package/models/api/gridStateApi.d.ts +14 -3
- package/models/colDef/gridColDef.d.ts +4 -4
- package/models/events/gridEventLookup.d.ts +16 -1
- package/models/events/gridEvents.d.ts +3 -1
- package/models/events/gridEvents.js +2 -0
- package/models/gridApiCaches.d.ts +6 -0
- package/models/gridApiCaches.js +1 -0
- package/models/gridIconSlotsComponent.d.ts +5 -0
- package/models/params/gridMenuParams.d.ts +7 -0
- package/models/params/gridMenuParams.js +1 -0
- package/models/params/gridRowParams.d.ts +1 -1
- package/models/params/index.d.ts +1 -0
- package/models/params/index.js +2 -1
- package/models/props/DataGridProps.d.ts +24 -2
- package/modern/DataGrid/DataGrid.js +26 -1
- package/modern/colDef/gridCheckboxSelectionColDef.js +2 -1
- package/modern/colDef/gridNumericColDef.js +1 -1
- package/modern/components/GridRow.js +51 -12
- package/modern/components/cell/GridCell.js +12 -7
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +9 -6
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
- package/modern/components/columnSelection/GridHeaderCheckbox.js +0 -1
- package/modern/components/containers/GridRootStyles.js +8 -3
- package/modern/components/menu/GridMenu.js +9 -2
- package/modern/components/panel/GridColumnsPanel.js +12 -7
- package/modern/components/panel/GridPanelWrapper.js +3 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +88 -8
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/modern/components/panel/filterPanel/GridFilterPanel.js +26 -11
- 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/gridClasses.js +1 -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 +12 -14
- package/modern/hooks/features/dimensions/useGridDimensions.js +9 -8
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +10 -3
- package/modern/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +9 -3
- package/modern/hooks/features/events/useGridEvents.js +2 -0
- package/modern/hooks/features/filter/gridFilterSelector.js +6 -0
- package/modern/hooks/features/filter/gridFilterUtils.js +3 -6
- package/modern/hooks/features/filter/useGridFilter.js +29 -12
- package/modern/hooks/features/pagination/useGridPage.js +1 -1
- package/modern/hooks/features/pagination/useGridPageSize.js +1 -1
- package/modern/hooks/features/rows/useGridRowsMeta.js +129 -59
- 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 +65 -11
- 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 +10 -9
- package/modern/locales/huHU.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 +116 -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/trTR.js +8 -7
- package/modern/locales/ukUA.js +1 -0
- package/modern/locales/viVN.js +1 -0
- package/modern/locales/zhCN.js +1 -0
- package/modern/models/events/gridEvents.js +2 -0
- package/modern/models/gridApiCaches.js +1 -0
- package/modern/models/params/gridMenuParams.js +1 -0
- package/modern/models/params/index.js +2 -1
- package/node/DataGrid/DataGrid.js +26 -1
- package/node/colDef/gridCheckboxSelectionColDef.js +4 -2
- package/node/colDef/gridNumericColDef.js +1 -1
- package/node/components/GridRow.js +53 -12
- package/node/components/cell/GridCell.js +12 -7
- package/node/components/columnHeaders/GridColumnHeaderItem.js +9 -6
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
- package/node/components/columnSelection/GridHeaderCheckbox.js +0 -1
- package/node/components/containers/GridRootStyles.js +8 -3
- package/node/components/menu/GridMenu.js +10 -2
- package/node/components/panel/GridColumnsPanel.js +12 -7
- package/node/components/panel/GridPanelWrapper.js +5 -3
- package/node/components/panel/filterPanel/GridFilterForm.js +91 -9
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/node/components/panel/filterPanel/GridFilterPanel.js +28 -11
- 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/gridClasses.js +1 -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 +13 -15
- package/node/hooks/features/dimensions/useGridDimensions.js +9 -8
- package/node/hooks/features/editRows/useGridCellEditing.new.js +11 -4
- package/node/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/node/hooks/features/editRows/useGridRowEditing.new.js +10 -4
- package/node/hooks/features/events/useGridEvents.js +2 -0
- package/node/hooks/features/filter/gridFilterSelector.js +9 -2
- package/node/hooks/features/filter/gridFilterUtils.js +4 -5
- package/node/hooks/features/filter/useGridFilter.js +28 -11
- package/node/hooks/features/pagination/useGridPage.js +1 -1
- package/node/hooks/features/pagination/useGridPageSize.js +1 -1
- package/node/hooks/features/rows/useGridRowsMeta.js +136 -69
- 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 +65 -12
- 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 +10 -9
- package/node/locales/huHU.js +1 -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 +126 -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/trTR.js +8 -7
- package/node/locales/ukUA.js +1 -0
- package/node/locales/viVN.js +1 -0
- package/node/locales/zhCN.js +1 -0
- package/node/models/events/gridEvents.js +2 -0
- package/node/models/gridApiCaches.js +5 -0
- package/node/models/params/gridMenuParams.js +5 -0
- package/node/models/params/index.js +13 -0
- package/package.json +6 -5
|
@@ -70,6 +70,7 @@ function GridColumnHeaderItem(props) {
|
|
|
70
70
|
hasScrollX: false,
|
|
71
71
|
hasScrollY: false
|
|
72
72
|
};
|
|
73
|
+
const isDraggable = React.useMemo(() => !rootProps.disableColumnReorder && !disableReorder && !column.disableReorder, [rootProps.disableColumnReorder, disableReorder, column.disableReorder]);
|
|
73
74
|
let headerComponent = null;
|
|
74
75
|
|
|
75
76
|
if (column.renderHeader) {
|
|
@@ -100,12 +101,12 @@ function GridColumnHeaderItem(props) {
|
|
|
100
101
|
onFocus: publish('columnHeaderFocus'),
|
|
101
102
|
onBlur: publish('columnHeaderBlur')
|
|
102
103
|
};
|
|
103
|
-
const draggableEventHandlers = {
|
|
104
|
+
const draggableEventHandlers = isDraggable ? {
|
|
104
105
|
onDragStart: publish('columnHeaderDragStart'),
|
|
105
106
|
onDragEnter: publish('columnHeaderDragEnter'),
|
|
106
107
|
onDragOver: publish('columnHeaderDragOver'),
|
|
107
108
|
onDragEnd: publish('columnHeaderDragEnd')
|
|
108
|
-
};
|
|
109
|
+
} : null;
|
|
109
110
|
const removeLastBorderRight = isLastColumn && hasScrollX && !hasScrollY;
|
|
110
111
|
const showRightBorder = !isLastColumn ? rootProps.showColumnRightBorder : !removeLastBorderRight && !extendRowFullWidth;
|
|
111
112
|
|
|
@@ -166,6 +167,7 @@ function GridColumnHeaderItem(props) {
|
|
|
166
167
|
field: column.field,
|
|
167
168
|
colDef: column
|
|
168
169
|
}) : column.headerClassName;
|
|
170
|
+
const label = (_column$headerName = column.headerName) != null ? _column$headerName : column.field;
|
|
169
171
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
170
172
|
ref: headerCellRef,
|
|
171
173
|
className: clsx(classes.root, headerClassName),
|
|
@@ -178,18 +180,19 @@ function GridColumnHeaderItem(props) {
|
|
|
178
180
|
role: "columnheader",
|
|
179
181
|
tabIndex: tabIndex,
|
|
180
182
|
"aria-colindex": colIndex + 1,
|
|
181
|
-
"aria-sort": ariaSort
|
|
183
|
+
"aria-sort": ariaSort,
|
|
184
|
+
"aria-label": column.renderHeader && headerComponent == null ? label : undefined
|
|
182
185
|
}, mouseEventsHandlers, {
|
|
183
186
|
children: [/*#__PURE__*/_jsxs("div", _extends({
|
|
184
187
|
className: classes.draggableContainer,
|
|
185
|
-
draggable:
|
|
188
|
+
draggable: isDraggable
|
|
186
189
|
}, draggableEventHandlers, {
|
|
187
190
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
188
191
|
className: classes.titleContainer,
|
|
189
192
|
children: [/*#__PURE__*/_jsx("div", {
|
|
190
193
|
className: classes.titleContainerContent,
|
|
191
|
-
children: headerComponent
|
|
192
|
-
label:
|
|
194
|
+
children: column.renderHeader ? headerComponent : /*#__PURE__*/_jsx(GridColumnHeaderTitle, {
|
|
195
|
+
label: label,
|
|
193
196
|
description: column.description,
|
|
194
197
|
columnWidth: width
|
|
195
198
|
})
|
|
@@ -165,7 +165,7 @@ export const GridRootStyles = styled('div', {
|
|
|
165
165
|
minWidth: 0,
|
|
166
166
|
flex: 1,
|
|
167
167
|
whiteSpace: 'nowrap',
|
|
168
|
-
|
|
168
|
+
overflowX: 'hidden'
|
|
169
169
|
},
|
|
170
170
|
[`& .${gridClasses.columnHeaderTitleContainerContent}`]: {
|
|
171
171
|
overflow: 'hidden',
|
|
@@ -221,6 +221,9 @@ export const GridRootStyles = styled('div', {
|
|
|
221
221
|
},
|
|
222
222
|
[`&.${gridClasses['columnSeparator--resizing']}`]: {
|
|
223
223
|
color: theme.palette.text.primary
|
|
224
|
+
},
|
|
225
|
+
'& svg': {
|
|
226
|
+
pointerEvents: 'none'
|
|
224
227
|
}
|
|
225
228
|
},
|
|
226
229
|
[`& .${gridClasses.iconSeparator}`]: {
|
|
@@ -274,10 +277,12 @@ export const GridRootStyles = styled('div', {
|
|
|
274
277
|
[`& .${gridClasses.cell}`]: {
|
|
275
278
|
display: 'flex',
|
|
276
279
|
alignItems: 'center',
|
|
277
|
-
overflow: 'hidden',
|
|
278
|
-
whiteSpace: 'nowrap',
|
|
279
280
|
borderBottom: `1px solid ${borderColor}`
|
|
280
281
|
},
|
|
282
|
+
[`& .${gridClasses.row}:not(.${gridClasses['row--dynamicHeight']}) > .${gridClasses.cell}`]: {
|
|
283
|
+
overflow: 'hidden',
|
|
284
|
+
whiteSpace: 'nowrap'
|
|
285
|
+
},
|
|
281
286
|
[`& .${gridClasses.cellContent}`]: {
|
|
282
287
|
overflow: 'hidden',
|
|
283
288
|
textOverflow: 'ellipsis'
|
|
@@ -13,6 +13,7 @@ import { styled } from '@mui/material/styles';
|
|
|
13
13
|
import { HTMLElementType } from '@mui/utils';
|
|
14
14
|
import { getDataGridUtilityClass, gridClasses } from '../../constants/gridClasses';
|
|
15
15
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
16
|
+
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
18
|
|
|
18
19
|
const useUtilityClasses = ownerState => {
|
|
@@ -56,6 +57,7 @@ const GridMenu = props => {
|
|
|
56
57
|
} = props,
|
|
57
58
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
58
59
|
|
|
60
|
+
const apiRef = useGridApiContext();
|
|
59
61
|
const prevTarget = React.useRef(target);
|
|
60
62
|
const prevOpen = React.useRef(open);
|
|
61
63
|
const rootProps = useGridRootProps();
|
|
@@ -66,11 +68,16 @@ const GridMenu = props => {
|
|
|
66
68
|
React.useEffect(() => {
|
|
67
69
|
if (prevOpen.current && prevTarget.current) {
|
|
68
70
|
prevTarget.current.focus();
|
|
69
|
-
}
|
|
71
|
+
} // Emit menuOpen or menuClose events
|
|
72
|
+
|
|
70
73
|
|
|
74
|
+
const eventName = open ? 'menuOpen' : 'menuClose';
|
|
75
|
+
apiRef.current.publishEvent(eventName, {
|
|
76
|
+
target
|
|
77
|
+
});
|
|
71
78
|
prevOpen.current = open;
|
|
72
79
|
prevTarget.current = target;
|
|
73
|
-
}, [open, target]);
|
|
80
|
+
}, [apiRef, open, target]);
|
|
74
81
|
|
|
75
82
|
const handleExited = popperOnExited => node => {
|
|
76
83
|
if (popperOnExited) {
|
|
@@ -76,8 +76,16 @@ export function GridColumnsPanel(props) {
|
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
const toggleAllColumns = React.useCallback(isVisible => {
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
if (apiRef.current.unstable_caches.columns.isUsingColumnVisibilityModel) {
|
|
80
|
+
if (isVisible) {
|
|
81
|
+
return apiRef.current.setColumnVisibilityModel({});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return apiRef.current.setColumnVisibilityModel(Object.fromEntries(columns.map(col => [col.field, false])));
|
|
85
|
+
} // TODO v6: Remove
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
return apiRef.current.updateColumns(columns.map(col => {
|
|
81
89
|
if (col.hideable !== false) {
|
|
82
90
|
return {
|
|
83
91
|
field: col.field,
|
|
@@ -127,7 +135,6 @@ export function GridColumnsPanel(props) {
|
|
|
127
135
|
checked: columnVisibilityModel[column.field] !== false,
|
|
128
136
|
onClick: toggleColumn,
|
|
129
137
|
name: column.field,
|
|
130
|
-
color: "primary",
|
|
131
138
|
size: "small"
|
|
132
139
|
}, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSwitch)),
|
|
133
140
|
label: column.headerName || column.field
|
|
@@ -144,13 +151,11 @@ export function GridColumnsPanel(props) {
|
|
|
144
151
|
})
|
|
145
152
|
}), /*#__PURE__*/_jsxs(GridPanelFooter, {
|
|
146
153
|
children: [/*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
147
|
-
onClick: () => toggleAllColumns(false)
|
|
148
|
-
color: "primary"
|
|
154
|
+
onClick: () => toggleAllColumns(false)
|
|
149
155
|
}, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.baseButton, {
|
|
150
156
|
children: apiRef.current.getLocaleText('columnsPanelHideAllButton')
|
|
151
157
|
})), /*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
152
|
-
onClick: () => toggleAllColumns(true)
|
|
153
|
-
color: "primary"
|
|
158
|
+
onClick: () => toggleAllColumns(true)
|
|
154
159
|
}, (_rootProps$components4 = rootProps.componentsProps) == null ? void 0 : _rootProps$components4.baseButton, {
|
|
155
160
|
children: apiRef.current.getLocaleText('columnsPanelShowAllButton')
|
|
156
161
|
}))]
|
|
@@ -3,5 +3,5 @@ import { Theme } from '@mui/material/styles';
|
|
|
3
3
|
import { MUIStyledCommonProps } from '@mui/system';
|
|
4
4
|
export interface GridPanelWrapperProps extends React.PropsWithChildren<React.HTMLAttributes<HTMLDivElement>>, MUIStyledCommonProps<Theme> {
|
|
5
5
|
}
|
|
6
|
-
declare
|
|
6
|
+
declare const GridPanelWrapper: React.ForwardRefExoticComponent<GridPanelWrapperProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export { GridPanelWrapper };
|
|
@@ -35,7 +35,7 @@ const GridPanelWrapperRoot = styled('div', {
|
|
|
35
35
|
|
|
36
36
|
const isEnabled = () => true;
|
|
37
37
|
|
|
38
|
-
function GridPanelWrapper(props) {
|
|
38
|
+
const GridPanelWrapper = /*#__PURE__*/React.forwardRef(function GridPanelWrapper(props, ref) {
|
|
39
39
|
const {
|
|
40
40
|
className
|
|
41
41
|
} = props,
|
|
@@ -51,10 +51,10 @@ function GridPanelWrapper(props) {
|
|
|
51
51
|
disableEnforceFocus: true,
|
|
52
52
|
isEnabled: isEnabled,
|
|
53
53
|
children: /*#__PURE__*/_jsx(GridPanelWrapperRoot, _extends({
|
|
54
|
+
ref: ref,
|
|
54
55
|
tabIndex: -1,
|
|
55
56
|
className: clsx(className, classes.root)
|
|
56
57
|
}, other))
|
|
57
58
|
});
|
|
58
|
-
}
|
|
59
|
-
|
|
59
|
+
});
|
|
60
60
|
export { GridPanelWrapper };
|
|
@@ -1,25 +1,82 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridFilterItem, GridLinkOperator } from '../../../models/gridFilterItem';
|
|
3
3
|
export interface GridFilterFormProps {
|
|
4
|
+
/**
|
|
5
|
+
* The [[GridFilterItem]] representing this form.
|
|
6
|
+
*/
|
|
4
7
|
item: GridFilterItem;
|
|
8
|
+
/**
|
|
9
|
+
* If `true`, the logic operator field is rendered.
|
|
10
|
+
* The field will be invisible if `showMultiFilterOperators` is also `true`.
|
|
11
|
+
*/
|
|
5
12
|
hasMultipleFilters: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* If `true`, the logic operator field is visible.
|
|
15
|
+
*/
|
|
6
16
|
showMultiFilterOperators?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The current logic operator applied.
|
|
19
|
+
*/
|
|
7
20
|
multiFilterOperator?: GridLinkOperator;
|
|
21
|
+
/**
|
|
22
|
+
* If `true`, disables the logic operator field but still renders it.
|
|
23
|
+
*/
|
|
8
24
|
disableMultiFilterOperator?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* A ref allowing to set imperative focus.
|
|
27
|
+
* It can be passed to the el
|
|
28
|
+
*/
|
|
9
29
|
focusElementRef?: React.Ref<any>;
|
|
30
|
+
/**
|
|
31
|
+
* Callback called when the operator, column field or value is changed.
|
|
32
|
+
* @param {GridFilterItem} item The updated [[GridFilterItem]].
|
|
33
|
+
*/
|
|
10
34
|
applyFilterChanges: (item: GridFilterItem) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Callback called when the logic operator is changed.
|
|
37
|
+
* @param {GridLinkOperator} operator The new logic operator.
|
|
38
|
+
*/
|
|
11
39
|
applyMultiFilterOperatorChanges: (operator: GridLinkOperator) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Callback called when the delete button is clicked.
|
|
42
|
+
* @param {GridFilterItem} item The deleted [[GridFilterItem]].
|
|
43
|
+
*/
|
|
12
44
|
deleteFilter: (item: GridFilterItem) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the available logic operators.
|
|
47
|
+
* @default [GridLinkOperator.And, GridLinkOperator.Or]
|
|
48
|
+
*/
|
|
13
49
|
linkOperators?: GridLinkOperator[];
|
|
50
|
+
/**
|
|
51
|
+
* Changes how the options in the columns selector should be ordered.
|
|
52
|
+
* If not specified, the order is derived from the `columns` prop.
|
|
53
|
+
*/
|
|
14
54
|
columnsSort?: 'asc' | 'desc';
|
|
55
|
+
/**
|
|
56
|
+
* Props passed to the delete icon.
|
|
57
|
+
* @default {}
|
|
58
|
+
*/
|
|
15
59
|
deleteIconProps?: any;
|
|
60
|
+
/**
|
|
61
|
+
* Props passed to the logic operator input component.
|
|
62
|
+
* @default {}
|
|
63
|
+
*/
|
|
16
64
|
linkOperatorInputProps?: any;
|
|
65
|
+
/**
|
|
66
|
+
* Props passed to the operator input component.
|
|
67
|
+
* @default {}
|
|
68
|
+
*/
|
|
17
69
|
operatorInputProps?: any;
|
|
70
|
+
/**
|
|
71
|
+
* Props passed to the column input component.
|
|
72
|
+
* @default {}
|
|
73
|
+
*/
|
|
18
74
|
columnInputProps?: any;
|
|
75
|
+
/**
|
|
76
|
+
* Props passed to the value input component.
|
|
77
|
+
* @default {}
|
|
78
|
+
*/
|
|
19
79
|
valueInputProps?: any;
|
|
20
80
|
}
|
|
21
|
-
declare
|
|
22
|
-
declare namespace GridFilterForm {
|
|
23
|
-
var propTypes: any;
|
|
24
|
-
}
|
|
81
|
+
declare const GridFilterForm: React.ForwardRefExoticComponent<GridFilterFormProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
82
|
export { GridFilterForm };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "multiFilterOperator", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "linkOperators", "columnsSort", "deleteIconProps", "linkOperatorInputProps", "operatorInputProps", "columnInputProps", "valueInputProps", "children"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
4
6
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
@@ -102,8 +104,7 @@ const getLinkOperatorLocaleKey = linkOperator => {
|
|
|
102
104
|
const getColumnLabel = col => col.headerName || col.field;
|
|
103
105
|
|
|
104
106
|
const collator = new Intl.Collator();
|
|
105
|
-
|
|
106
|
-
function GridFilterForm(props) {
|
|
107
|
+
const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props, ref) {
|
|
107
108
|
var _rootProps$components, _rootProps$components2, _baseSelectProps$nati, _rootProps$components3, _rootProps$components4, _rootProps$components5, _currentColumn$filter2;
|
|
108
109
|
|
|
109
110
|
const {
|
|
@@ -123,7 +124,9 @@ function GridFilterForm(props) {
|
|
|
123
124
|
operatorInputProps = {},
|
|
124
125
|
columnInputProps = {},
|
|
125
126
|
valueInputProps = {}
|
|
126
|
-
} = props
|
|
127
|
+
} = props,
|
|
128
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
129
|
+
|
|
127
130
|
const apiRef = useGridApiContext();
|
|
128
131
|
const filterableColumns = useGridSelector(apiRef, gridFilterableColumnDefinitionsSelector);
|
|
129
132
|
const columnSelectId = useId();
|
|
@@ -223,8 +226,10 @@ function GridFilterForm(props) {
|
|
|
223
226
|
}
|
|
224
227
|
}
|
|
225
228
|
}), [currentOperator]);
|
|
226
|
-
return /*#__PURE__*/_jsxs(GridFilterFormRoot, {
|
|
227
|
-
|
|
229
|
+
return /*#__PURE__*/_jsxs(GridFilterFormRoot, _extends({
|
|
230
|
+
ref: ref,
|
|
231
|
+
className: classes.root
|
|
232
|
+
}, other, {
|
|
228
233
|
children: [/*#__PURE__*/_jsx(FilterFormDeleteIcon, _extends({
|
|
229
234
|
variant: "standard",
|
|
230
235
|
as: rootProps.components.BaseFormControl
|
|
@@ -319,36 +324,111 @@ function GridFilterForm(props) {
|
|
|
319
324
|
focusElementRef: valueRef
|
|
320
325
|
}, currentOperator.InputComponentProps)) : null
|
|
321
326
|
}))]
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
|
|
327
|
+
}));
|
|
328
|
+
});
|
|
325
329
|
process.env.NODE_ENV !== "production" ? GridFilterForm.propTypes = {
|
|
326
330
|
// ----------------------------- Warning --------------------------------
|
|
327
331
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
328
332
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
329
333
|
// ----------------------------------------------------------------------
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Callback called when the operator, column field or value is changed.
|
|
337
|
+
* @param {GridFilterItem} item The updated [[GridFilterItem]].
|
|
338
|
+
*/
|
|
330
339
|
applyFilterChanges: PropTypes.func.isRequired,
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Callback called when the logic operator is changed.
|
|
343
|
+
* @param {GridLinkOperator} operator The new logic operator.
|
|
344
|
+
*/
|
|
331
345
|
applyMultiFilterOperatorChanges: PropTypes.func.isRequired,
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Props passed to the column input component.
|
|
349
|
+
* @default {}
|
|
350
|
+
*/
|
|
332
351
|
columnInputProps: PropTypes.any,
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Changes how the options in the columns selector should be ordered.
|
|
355
|
+
* If not specified, the order is derived from the `columns` prop.
|
|
356
|
+
*/
|
|
333
357
|
columnsSort: PropTypes.oneOf(['asc', 'desc']),
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Callback called when the delete button is clicked.
|
|
361
|
+
* @param {GridFilterItem} item The deleted [[GridFilterItem]].
|
|
362
|
+
*/
|
|
334
363
|
deleteFilter: PropTypes.func.isRequired,
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Props passed to the delete icon.
|
|
367
|
+
* @default {}
|
|
368
|
+
*/
|
|
335
369
|
deleteIconProps: PropTypes.any,
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* If `true`, disables the logic operator field but still renders it.
|
|
373
|
+
*/
|
|
336
374
|
disableMultiFilterOperator: PropTypes.bool,
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* A ref allowing to set imperative focus.
|
|
378
|
+
* It can be passed to the el
|
|
379
|
+
*/
|
|
337
380
|
focusElementRef: PropTypes
|
|
338
381
|
/* @typescript-to-proptypes-ignore */
|
|
339
382
|
.oneOfType([PropTypes.func, PropTypes.object]),
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* If `true`, the logic operator field is rendered.
|
|
386
|
+
* The field will be invisible if `showMultiFilterOperators` is also `true`.
|
|
387
|
+
*/
|
|
340
388
|
hasMultipleFilters: PropTypes.bool.isRequired,
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* The [[GridFilterItem]] representing this form.
|
|
392
|
+
*/
|
|
341
393
|
item: PropTypes.shape({
|
|
342
394
|
columnField: PropTypes.string.isRequired,
|
|
343
395
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
344
396
|
operatorValue: PropTypes.string,
|
|
345
397
|
value: PropTypes.any
|
|
346
398
|
}).isRequired,
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Props passed to the logic operator input component.
|
|
402
|
+
* @default {}
|
|
403
|
+
*/
|
|
347
404
|
linkOperatorInputProps: PropTypes.any,
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Sets the available logic operators.
|
|
408
|
+
* @default [GridLinkOperator.And, GridLinkOperator.Or]
|
|
409
|
+
*/
|
|
348
410
|
linkOperators: PropTypes.arrayOf(PropTypes.oneOf(['and', 'or']).isRequired),
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* The current logic operator applied.
|
|
414
|
+
*/
|
|
349
415
|
multiFilterOperator: PropTypes.oneOf(['and', 'or']),
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Props passed to the operator input component.
|
|
419
|
+
* @default {}
|
|
420
|
+
*/
|
|
350
421
|
operatorInputProps: PropTypes.any,
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* If `true`, the logic operator field is visible.
|
|
425
|
+
*/
|
|
351
426
|
showMultiFilterOperators: PropTypes.bool,
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Props passed to the value input component.
|
|
430
|
+
* @default {}
|
|
431
|
+
*/
|
|
352
432
|
valueInputProps: PropTypes.any
|
|
353
433
|
} : void 0;
|
|
354
434
|
export { GridFilterForm };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
3
|
import { GridFilterFormProps } from './GridFilterForm';
|
|
4
4
|
export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'linkOperators' | 'columnsSort'> {
|
|
5
|
+
/**
|
|
6
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
7
|
+
*/
|
|
5
8
|
sx?: SxProps<Theme>;
|
|
9
|
+
/**
|
|
10
|
+
* Props passed to each filter form.
|
|
11
|
+
*/
|
|
6
12
|
filterFormProps?: Pick<GridFilterFormProps, 'columnsSort' | 'deleteIconProps' | 'linkOperatorInputProps' | 'operatorInputProps' | 'columnInputProps' | 'valueInputProps'>;
|
|
7
13
|
}
|
|
8
|
-
declare
|
|
9
|
-
declare namespace GridFilterPanel {
|
|
10
|
-
var propTypes: any;
|
|
11
|
-
}
|
|
14
|
+
declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
15
|
export { GridFilterPanel };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["linkOperators", "columnsSort", "filterFormProps"];
|
|
3
|
+
const _excluded = ["linkOperators", "columnsSort", "filterFormProps", "children"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { GridLinkOperator } from '../../../models/gridFilterItem';
|
|
@@ -16,8 +16,7 @@ import { gridFilterModelSelector } from '../../../hooks/features/filter/gridFilt
|
|
|
16
16
|
import { gridFilterableColumnDefinitionsSelector } from '../../../hooks/features/columns/gridColumnsSelector';
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
-
|
|
20
|
-
function GridFilterPanel(props) {
|
|
19
|
+
const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(props, ref) {
|
|
21
20
|
var _rootProps$components;
|
|
22
21
|
|
|
23
22
|
const apiRef = useGridApiContext();
|
|
@@ -73,9 +72,7 @@ function GridFilterPanel(props) {
|
|
|
73
72
|
return;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
apiRef.current.
|
|
77
|
-
items: [...items, defaultItem]
|
|
78
|
-
}));
|
|
75
|
+
apiRef.current.upsertFilterItems([...items, defaultItem]);
|
|
79
76
|
};
|
|
80
77
|
|
|
81
78
|
const deleteFilter = React.useCallback(item => {
|
|
@@ -96,7 +93,9 @@ function GridFilterPanel(props) {
|
|
|
96
93
|
lastFilterRef.current.focus();
|
|
97
94
|
}
|
|
98
95
|
}, [items.length]);
|
|
99
|
-
return /*#__PURE__*/_jsxs(GridPanelWrapper, _extends({
|
|
96
|
+
return /*#__PURE__*/_jsxs(GridPanelWrapper, _extends({
|
|
97
|
+
ref: ref
|
|
98
|
+
}, other, {
|
|
100
99
|
children: [/*#__PURE__*/_jsx(GridPanelContent, {
|
|
101
100
|
children: items.map((item, index) => /*#__PURE__*/_jsx(GridFilterForm, _extends({
|
|
102
101
|
item: item,
|
|
@@ -114,21 +113,28 @@ function GridFilterPanel(props) {
|
|
|
114
113
|
}), !rootProps.disableMultipleColumnsFiltering && /*#__PURE__*/_jsx(GridPanelFooter, {
|
|
115
114
|
children: /*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
116
115
|
onClick: addNewFilter,
|
|
117
|
-
startIcon: /*#__PURE__*/_jsx(GridAddIcon, {})
|
|
118
|
-
color: "primary"
|
|
116
|
+
startIcon: /*#__PURE__*/_jsx(GridAddIcon, {})
|
|
119
117
|
}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseButton, {
|
|
120
118
|
children: apiRef.current.getLocaleText('filterPanelAddFilter')
|
|
121
119
|
}))
|
|
122
120
|
})]
|
|
123
121
|
}));
|
|
124
|
-
}
|
|
125
|
-
|
|
122
|
+
});
|
|
126
123
|
process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
|
|
127
124
|
// ----------------------------- Warning --------------------------------
|
|
128
125
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
129
126
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
130
127
|
// ----------------------------------------------------------------------
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Changes how the options in the columns selector should be ordered.
|
|
131
|
+
* If not specified, the order is derived from the `columns` prop.
|
|
132
|
+
*/
|
|
131
133
|
columnsSort: PropTypes.oneOf(['asc', 'desc']),
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Props passed to each filter form.
|
|
137
|
+
*/
|
|
132
138
|
filterFormProps: PropTypes.shape({
|
|
133
139
|
columnInputProps: PropTypes.any,
|
|
134
140
|
columnsSort: PropTypes.oneOf(['asc', 'desc']),
|
|
@@ -137,7 +143,16 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
|
|
|
137
143
|
operatorInputProps: PropTypes.any,
|
|
138
144
|
valueInputProps: PropTypes.any
|
|
139
145
|
}),
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Sets the available logic operators.
|
|
149
|
+
* @default [GridLinkOperator.And, GridLinkOperator.Or]
|
|
150
|
+
*/
|
|
140
151
|
linkOperators: PropTypes.arrayOf(PropTypes.oneOf(['and', 'or']).isRequired),
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
155
|
+
*/
|
|
141
156
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
142
157
|
} : void 0;
|
|
143
158
|
export { GridFilterPanel };
|
|
@@ -41,7 +41,6 @@ export const GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function G
|
|
|
41
41
|
return /*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
42
42
|
ref: ref,
|
|
43
43
|
size: "small",
|
|
44
|
-
color: "primary",
|
|
45
44
|
"aria-label": apiRef.current.getLocaleText('toolbarColumnsLabel'),
|
|
46
45
|
startIcon: /*#__PURE__*/_jsx(rootProps.components.ColumnSelectorIcon, {})
|
|
47
46
|
}, other, {
|
|
@@ -95,7 +95,6 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
95
95
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
96
96
|
children: [/*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
97
97
|
ref: handleRef,
|
|
98
|
-
color: "primary",
|
|
99
98
|
size: "small",
|
|
100
99
|
startIcon: startIcon,
|
|
101
100
|
"aria-label": apiRef.current.getLocaleText('toolbarDensityLabel'),
|
|
@@ -52,7 +52,6 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
|
|
|
52
52
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
53
53
|
children: [/*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
54
54
|
ref: handleRef,
|
|
55
|
-
color: "primary",
|
|
56
55
|
size: "small",
|
|
57
56
|
startIcon: /*#__PURE__*/_jsx(rootProps.components.ExportIcon, {}),
|
|
58
57
|
"aria-expanded": open ? 'true' : undefined,
|
|
@@ -10,5 +10,5 @@ export interface GridToolbarFilterButtonProps extends Omit<TooltipProps, 'title'
|
|
|
10
10
|
button?: ButtonProps;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
declare const GridToolbarFilterButton: React.ForwardRefExoticComponent<Pick<GridToolbarFilterButtonProps, "hidden" | "color" | "style" | "open" | "translate" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onClose" | "sx" | "classes" | "
|
|
13
|
+
declare const GridToolbarFilterButton: React.ForwardRefExoticComponent<Pick<GridToolbarFilterButtonProps, "hidden" | "color" | "style" | "open" | "translate" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onClose" | "sx" | "classes" | "components" | "componentsProps" | "TransitionComponent" | "TransitionProps" | "onOpen" | "placement" | "arrow" | "describeChild" | "disableFocusListener" | "disableHoverListener" | "disableInteractive" | "disableTouchListener" | "enterDelay" | "enterNextDelay" | "enterTouchDelay" | "followCursor" | "leaveDelay" | "leaveTouchDelay" | "PopperComponent" | "PopperProps"> & React.RefAttributes<HTMLButtonElement>>;
|
|
14
14
|
export { GridToolbarFilterButton };
|
|
@@ -108,7 +108,6 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
108
108
|
children: /*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
|
|
109
109
|
ref: ref,
|
|
110
110
|
size: "small",
|
|
111
|
-
color: "primary",
|
|
112
111
|
"aria-label": apiRef.current.getLocaleText('toolbarFiltersLabel'),
|
|
113
112
|
startIcon: /*#__PURE__*/_jsx(Badge, {
|
|
114
113
|
badgeContent: activeFilters.length,
|