@mui/x-data-grid 7.22.2 → 7.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +169 -0
- package/DataGrid/DataGrid.js +9 -1
- package/README.md +3 -3
- package/components/GridDetailPanels.js +0 -1
- package/components/GridPinnedRows.js +0 -1
- package/components/GridRow.d.ts +2 -2
- package/components/GridRow.js +1 -1
- package/components/base/GridOverlays.js +5 -6
- package/components/cell/GridCell.d.ts +41 -3
- package/components/cell/GridCell.js +11 -19
- package/components/cell/GridEditInputCell.js +0 -67
- package/components/columnsManagement/GridColumnsManagement.d.ts +2 -0
- package/components/columnsManagement/GridColumnsManagement.js +53 -6
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/toolbar/GridToolbar.d.ts +2 -2
- package/components/toolbar/GridToolbar.js +12 -4
- package/components/toolbar/GridToolbarColumnsButton.js +3 -4
- package/components/toolbar/GridToolbarDensitySelector.js +3 -4
- package/components/toolbar/GridToolbarExport.d.ts +2 -2
- package/components/toolbar/GridToolbarExport.js +4 -3
- package/components/toolbar/GridToolbarExportContainer.js +3 -4
- package/components/toolbar/GridToolbarFilterButton.d.ts +2 -0
- package/components/toolbar/GridToolbarFilterButton.js +7 -6
- package/components/toolbar/GridToolbarQuickFilter.js +1 -0
- package/components/toolbar/index.d.ts +1 -1
- package/constants/dataGridPropsDefaultValues.js +2 -1
- package/constants/gridClasses.d.ts +4 -0
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +1 -0
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/hooks/features/dimensions/useGridDimensions.js +2 -1
- package/hooks/features/export/useGridCsvExport.js +1 -1
- package/hooks/features/export/useGridPrintExport.js +1 -1
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +1 -0
- package/hooks/features/listView/gridListViewSelectors.d.ts +3 -1
- package/hooks/features/listView/gridListViewSelectors.js +3 -1
- package/hooks/features/listView/index.d.ts +1 -0
- package/hooks/features/listView/index.js +1 -0
- package/hooks/features/pagination/useGridPaginationModel.js +2 -2
- package/hooks/features/rowSelection/useGridRowSelection.js +0 -9
- package/hooks/features/rows/gridRowsUtils.d.ts +1 -1
- package/hooks/features/rows/gridRowsUtils.js +1 -5
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +59 -19
- package/hooks/utils/useGridSelector.d.ts +3 -2
- package/hooks/utils/useGridSelector.js +27 -2
- package/index.d.ts +0 -1
- package/index.js +1 -1
- package/joy/joySlots.js +7 -2
- package/locales/arSD.js +1 -0
- package/locales/beBY.js +1 -0
- package/locales/bgBG.js +2 -0
- package/locales/csCZ.js +2 -0
- package/locales/daDK.js +2 -0
- package/locales/deDE.js +2 -0
- package/locales/elGR.js +1 -0
- package/locales/esES.js +5 -4
- package/locales/faIR.js +2 -0
- package/locales/fiFI.js +2 -0
- package/locales/frFR.js +2 -0
- package/locales/heIL.js +2 -0
- package/locales/hrHR.js +2 -0
- package/locales/huHU.js +2 -0
- package/locales/isIS.js +1 -0
- package/locales/itIT.js +2 -0
- package/locales/jaJP.js +2 -0
- package/locales/koKR.js +1 -0
- package/locales/nbNO.js +2 -0
- package/locales/nlNL.js +2 -0
- package/locales/nnNO.js +2 -0
- package/locales/plPL.js +1 -0
- package/locales/ptBR.js +1 -0
- package/locales/ptPT.js +1 -0
- package/locales/roRO.js +1 -0
- package/locales/ruRU.js +2 -0
- package/locales/skSK.js +1 -0
- package/locales/svSE.js +6 -5
- package/locales/trTR.js +4 -2
- package/locales/ukUA.js +1 -0
- package/locales/urPK.js +1 -0
- package/locales/viVN.js +2 -0
- package/locales/zhCN.js +5 -4
- package/locales/zhHK.js +1 -0
- package/locales/zhTW.js +1 -0
- package/models/api/gridCoreApi.d.ts +1 -1
- package/models/api/gridLocaleTextApi.d.ts +1 -0
- package/models/colDef/gridColDef.d.ts +24 -24
- package/models/gridDataSource.d.ts +12 -12
- package/models/props/DataGridProps.d.ts +9 -1
- package/modern/DataGrid/DataGrid.js +9 -1
- package/modern/components/GridDetailPanels.js +0 -1
- package/modern/components/GridPinnedRows.js +0 -1
- package/modern/components/GridRow.js +1 -1
- package/modern/components/base/GridOverlays.js +5 -6
- package/modern/components/cell/GridCell.js +11 -19
- package/modern/components/cell/GridEditInputCell.js +0 -67
- package/modern/components/columnsManagement/GridColumnsManagement.js +53 -6
- package/modern/components/toolbar/GridToolbar.js +12 -4
- package/modern/components/toolbar/GridToolbarColumnsButton.js +3 -4
- package/modern/components/toolbar/GridToolbarDensitySelector.js +3 -4
- package/modern/components/toolbar/GridToolbarExport.js +4 -3
- package/modern/components/toolbar/GridToolbarExportContainer.js +3 -4
- package/modern/components/toolbar/GridToolbarFilterButton.js +7 -6
- package/modern/components/toolbar/GridToolbarQuickFilter.js +1 -0
- package/modern/constants/dataGridPropsDefaultValues.js +2 -1
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +1 -0
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +2 -1
- package/modern/hooks/features/export/useGridCsvExport.js +1 -1
- package/modern/hooks/features/export/useGridPrintExport.js +1 -1
- package/modern/hooks/features/index.js +1 -0
- package/modern/hooks/features/listView/gridListViewSelectors.js +3 -1
- package/modern/hooks/features/listView/index.js +1 -0
- package/modern/hooks/features/pagination/useGridPaginationModel.js +2 -2
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +0 -9
- package/modern/hooks/features/rows/gridRowsUtils.js +1 -5
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +59 -19
- package/modern/hooks/utils/useGridSelector.js +27 -2
- package/modern/index.js +1 -1
- package/modern/joy/joySlots.js +7 -2
- package/modern/locales/arSD.js +1 -0
- package/modern/locales/beBY.js +1 -0
- package/modern/locales/bgBG.js +2 -0
- package/modern/locales/csCZ.js +2 -0
- package/modern/locales/daDK.js +2 -0
- package/modern/locales/deDE.js +2 -0
- package/modern/locales/elGR.js +1 -0
- package/modern/locales/esES.js +5 -4
- package/modern/locales/faIR.js +2 -0
- package/modern/locales/fiFI.js +2 -0
- package/modern/locales/frFR.js +2 -0
- package/modern/locales/heIL.js +2 -0
- package/modern/locales/hrHR.js +2 -0
- package/modern/locales/huHU.js +2 -0
- package/modern/locales/isIS.js +1 -0
- package/modern/locales/itIT.js +2 -0
- package/modern/locales/jaJP.js +2 -0
- package/modern/locales/koKR.js +1 -0
- package/modern/locales/nbNO.js +2 -0
- package/modern/locales/nlNL.js +2 -0
- package/modern/locales/nnNO.js +2 -0
- package/modern/locales/plPL.js +1 -0
- package/modern/locales/ptBR.js +1 -0
- package/modern/locales/ptPT.js +1 -0
- package/modern/locales/roRO.js +1 -0
- package/modern/locales/ruRU.js +2 -0
- package/modern/locales/skSK.js +1 -0
- package/modern/locales/svSE.js +6 -5
- package/modern/locales/trTR.js +4 -2
- package/modern/locales/ukUA.js +1 -0
- package/modern/locales/urPK.js +1 -0
- package/modern/locales/viVN.js +2 -0
- package/modern/locales/zhCN.js +5 -4
- package/modern/locales/zhHK.js +1 -0
- package/modern/locales/zhTW.js +1 -0
- package/modern/utils/createSelector.js +11 -1
- package/modern/utils/utils.js +1 -3
- package/node/DataGrid/DataGrid.js +9 -1
- package/node/components/GridDetailPanels.js +0 -1
- package/node/components/GridPinnedRows.js +0 -1
- package/node/components/GridRow.js +1 -1
- package/node/components/base/GridOverlays.js +5 -6
- package/node/components/cell/GridCell.js +11 -19
- package/node/components/cell/GridEditInputCell.js +0 -67
- package/node/components/columnsManagement/GridColumnsManagement.js +53 -6
- package/node/components/toolbar/GridToolbar.js +12 -4
- package/node/components/toolbar/GridToolbarColumnsButton.js +3 -4
- package/node/components/toolbar/GridToolbarDensitySelector.js +3 -4
- package/node/components/toolbar/GridToolbarExport.js +4 -3
- package/node/components/toolbar/GridToolbarExportContainer.js +3 -4
- package/node/components/toolbar/GridToolbarFilterButton.js +7 -6
- package/node/components/toolbar/GridToolbarQuickFilter.js +1 -0
- package/node/constants/dataGridPropsDefaultValues.js +2 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +1 -0
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/node/hooks/features/dimensions/useGridDimensions.js +2 -1
- package/node/hooks/features/export/useGridCsvExport.js +2 -2
- package/node/hooks/features/export/useGridPrintExport.js +2 -2
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/listView/gridListViewSelectors.js +3 -1
- package/node/hooks/features/listView/index.js +16 -0
- package/node/hooks/features/pagination/useGridPaginationModel.js +2 -2
- package/node/hooks/features/rowSelection/useGridRowSelection.js +0 -9
- package/node/hooks/features/rows/gridRowsUtils.js +2 -8
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +59 -19
- package/node/hooks/utils/useGridSelector.js +29 -3
- package/node/index.js +1 -1
- package/node/joy/joySlots.js +7 -2
- package/node/locales/arSD.js +1 -0
- package/node/locales/beBY.js +1 -0
- package/node/locales/bgBG.js +2 -0
- package/node/locales/csCZ.js +2 -0
- package/node/locales/daDK.js +2 -0
- package/node/locales/deDE.js +2 -0
- package/node/locales/elGR.js +1 -0
- package/node/locales/esES.js +5 -4
- package/node/locales/faIR.js +2 -0
- package/node/locales/fiFI.js +2 -0
- package/node/locales/frFR.js +2 -0
- package/node/locales/heIL.js +2 -0
- package/node/locales/hrHR.js +2 -0
- package/node/locales/huHU.js +2 -0
- package/node/locales/isIS.js +1 -0
- package/node/locales/itIT.js +2 -0
- package/node/locales/jaJP.js +2 -0
- package/node/locales/koKR.js +1 -0
- package/node/locales/nbNO.js +2 -0
- package/node/locales/nlNL.js +2 -0
- package/node/locales/nnNO.js +2 -0
- package/node/locales/plPL.js +1 -0
- package/node/locales/ptBR.js +1 -0
- package/node/locales/ptPT.js +1 -0
- package/node/locales/roRO.js +1 -0
- package/node/locales/ruRU.js +2 -0
- package/node/locales/skSK.js +1 -0
- package/node/locales/svSE.js +6 -5
- package/node/locales/trTR.js +4 -2
- package/node/locales/ukUA.js +1 -0
- package/node/locales/urPK.js +1 -0
- package/node/locales/viVN.js +2 -0
- package/node/locales/zhCN.js +5 -4
- package/node/locales/zhHK.js +1 -0
- package/node/locales/zhTW.js +1 -0
- package/node/utils/createSelector.js +11 -1
- package/node/utils/utils.js +1 -3
- package/package.json +4 -4
- package/utils/createSelector.d.ts +1 -1
- package/utils/createSelector.js +11 -1
- package/utils/utils.js +1 -3
|
@@ -21,12 +21,11 @@ var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
|
21
21
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
22
22
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
23
23
|
var _gridFocusStateSelector = require("../../hooks/features/focus/gridFocusStateSelector");
|
|
24
|
-
var _useGridParamsApi = require("../../hooks/features/rows/useGridParamsApi");
|
|
25
24
|
var _cellBorderUtils = require("../../utils/cellBorderUtils");
|
|
26
25
|
var _gridColumnsInterfaces = require("../../hooks/features/columns/gridColumnsInterfaces");
|
|
27
26
|
var _gridRowSpanningSelectors = require("../../hooks/features/rows/gridRowSpanningSelectors");
|
|
28
27
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
|
-
const _excluded = ["column", "rowId", "editCellState", "align", "children", "colIndex", "width", "className", "style", "
|
|
28
|
+
const _excluded = ["column", "rowId", "editCellState", "align", "children", "colIndex", "width", "className", "style", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "sectionIndex", "sectionLength", "gridHasFiller", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
|
|
30
29
|
_excluded2 = ["changeReason", "unstable_updateValueOnRender"];
|
|
31
30
|
let PinnedPosition = exports.PinnedPosition = /*#__PURE__*/function (PinnedPosition) {
|
|
32
31
|
PinnedPosition[PinnedPosition["NONE"] = 0] = "NONE";
|
|
@@ -122,16 +121,13 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
122
121
|
// This is required because `.getCellParams` tries to get the `state.rows.tree` entry
|
|
123
122
|
// associated with `rowId`/`fieldId`, but this selector runs after the state has been
|
|
124
123
|
// updated, while `rowId`/`fieldId` reference an entry in the old state.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return result;
|
|
129
|
-
} catch (error) {
|
|
130
|
-
if (error instanceof _useGridParamsApi.MissingRowIdError) {
|
|
131
|
-
return EMPTY_CELL_PARAMS;
|
|
132
|
-
}
|
|
133
|
-
throw error;
|
|
124
|
+
const row = apiRef.current.getRow(rowId);
|
|
125
|
+
if (!row) {
|
|
126
|
+
return EMPTY_CELL_PARAMS;
|
|
134
127
|
}
|
|
128
|
+
const result = apiRef.current.getCellParams(rowId, field);
|
|
129
|
+
result.api = apiRef.current;
|
|
130
|
+
return result;
|
|
135
131
|
}, _useGridSelector.objectShallowCompare);
|
|
136
132
|
const isSelected = (0, _useGridSelector.useGridSelector)(apiRef, () => apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {
|
|
137
133
|
id: rowId,
|
|
@@ -219,6 +215,7 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
219
215
|
padding: 0,
|
|
220
216
|
opacity: 0,
|
|
221
217
|
width: 0,
|
|
218
|
+
height: 0,
|
|
222
219
|
border: 0
|
|
223
220
|
};
|
|
224
221
|
}
|
|
@@ -237,6 +234,9 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
237
234
|
if (rowSpan > 1) {
|
|
238
235
|
cellStyle.height = `calc(var(--height) * ${rowSpan})`;
|
|
239
236
|
cellStyle.zIndex = 5;
|
|
237
|
+
if (isLeftPinned || isRightPinned) {
|
|
238
|
+
cellStyle.zIndex = 6;
|
|
239
|
+
}
|
|
240
240
|
}
|
|
241
241
|
return cellStyle;
|
|
242
242
|
}, [width, isNotVisible, styleProp, pinnedOffset, pinnedPosition, isRtl, rowSpan]);
|
|
@@ -350,7 +350,6 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
350
350
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
351
351
|
// ----------------------------------------------------------------------
|
|
352
352
|
align: _propTypes.default.oneOf(['center', 'left', 'right']).isRequired,
|
|
353
|
-
className: _propTypes.default.string,
|
|
354
353
|
colIndex: _propTypes.default.number.isRequired,
|
|
355
354
|
colSpan: _propTypes.default.number,
|
|
356
355
|
column: _propTypes.default.object.isRequired,
|
|
@@ -363,13 +362,6 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
363
362
|
}),
|
|
364
363
|
gridHasFiller: _propTypes.default.bool.isRequired,
|
|
365
364
|
isNotVisible: _propTypes.default.bool.isRequired,
|
|
366
|
-
onClick: _propTypes.default.func,
|
|
367
|
-
onDoubleClick: _propTypes.default.func,
|
|
368
|
-
onDragEnter: _propTypes.default.func,
|
|
369
|
-
onDragOver: _propTypes.default.func,
|
|
370
|
-
onKeyDown: _propTypes.default.func,
|
|
371
|
-
onMouseDown: _propTypes.default.func,
|
|
372
|
-
onMouseUp: _propTypes.default.func,
|
|
373
365
|
pinnedOffset: _propTypes.default.number.isRequired,
|
|
374
366
|
pinnedPosition: _propTypes.default.oneOf([0, 1, 2, 3]).isRequired,
|
|
375
367
|
rowId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
@@ -9,7 +9,6 @@ exports.renderEditInputCell = exports.GridEditInputCell = void 0;
|
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
12
|
var _utils = require("@mui/utils");
|
|
14
13
|
var _styles = require("@mui/material/styles");
|
|
15
14
|
var _InputBase = _interopRequireDefault(require("@mui/material/InputBase"));
|
|
@@ -102,71 +101,5 @@ const GridEditInputCell = exports.GridEditInputCell = /*#__PURE__*/React.forward
|
|
|
102
101
|
}) : undefined
|
|
103
102
|
}, other));
|
|
104
103
|
});
|
|
105
|
-
process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
106
|
-
// ----------------------------- Warning --------------------------------
|
|
107
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
108
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
109
|
-
// ----------------------------------------------------------------------
|
|
110
|
-
/**
|
|
111
|
-
* GridApi that let you manipulate the grid.
|
|
112
|
-
*/
|
|
113
|
-
api: _propTypes.default.object.isRequired,
|
|
114
|
-
/**
|
|
115
|
-
* The mode of the cell.
|
|
116
|
-
*/
|
|
117
|
-
cellMode: _propTypes.default.oneOf(['edit', 'view']).isRequired,
|
|
118
|
-
changeReason: _propTypes.default.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
119
|
-
/**
|
|
120
|
-
* The column of the row that the current cell belongs to.
|
|
121
|
-
*/
|
|
122
|
-
colDef: _propTypes.default.object.isRequired,
|
|
123
|
-
debounceMs: _propTypes.default.number,
|
|
124
|
-
/**
|
|
125
|
-
* The column field of the cell that triggered the event.
|
|
126
|
-
*/
|
|
127
|
-
field: _propTypes.default.string.isRequired,
|
|
128
|
-
/**
|
|
129
|
-
* The cell value formatted with the column valueFormatter.
|
|
130
|
-
*/
|
|
131
|
-
formattedValue: _propTypes.default.any,
|
|
132
|
-
/**
|
|
133
|
-
* If true, the cell is the active element.
|
|
134
|
-
*/
|
|
135
|
-
hasFocus: _propTypes.default.bool.isRequired,
|
|
136
|
-
/**
|
|
137
|
-
* The grid row id.
|
|
138
|
-
*/
|
|
139
|
-
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
140
|
-
/**
|
|
141
|
-
* If true, the cell is editable.
|
|
142
|
-
*/
|
|
143
|
-
isEditable: _propTypes.default.bool,
|
|
144
|
-
isProcessingProps: _propTypes.default.bool,
|
|
145
|
-
isValidating: _propTypes.default.bool,
|
|
146
|
-
/**
|
|
147
|
-
* Callback called when the value is changed by the user.
|
|
148
|
-
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
149
|
-
* @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
|
|
150
|
-
* @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
|
|
151
|
-
*/
|
|
152
|
-
onValueChange: _propTypes.default.func,
|
|
153
|
-
/**
|
|
154
|
-
* The row model of the row that the current cell belongs to.
|
|
155
|
-
*/
|
|
156
|
-
row: _propTypes.default.any.isRequired,
|
|
157
|
-
/**
|
|
158
|
-
* The node of the row that the current cell belongs to.
|
|
159
|
-
*/
|
|
160
|
-
rowNode: _propTypes.default.object.isRequired,
|
|
161
|
-
/**
|
|
162
|
-
* the tabIndex value.
|
|
163
|
-
*/
|
|
164
|
-
tabIndex: _propTypes.default.oneOf([-1, 0]).isRequired,
|
|
165
|
-
/**
|
|
166
|
-
* The cell value.
|
|
167
|
-
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
168
|
-
*/
|
|
169
|
-
value: _propTypes.default.any
|
|
170
|
-
} : void 0;
|
|
171
104
|
const renderEditInputCell = params => /*#__PURE__*/(0, _jsxRuntime.jsx)(GridEditInputCell, (0, _extends2.default)({}, params));
|
|
172
105
|
exports.renderEditInputCell = renderEditInputCell;
|
|
@@ -12,6 +12,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
12
12
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
13
13
|
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
16
|
+
var _InputBase = require("@mui/material/InputBase");
|
|
15
17
|
var _gridColumnsSelector = require("../../hooks/features/columns/gridColumnsSelector");
|
|
16
18
|
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
17
19
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
@@ -29,6 +31,7 @@ const useUtilityClasses = ownerState => {
|
|
|
29
31
|
const slots = {
|
|
30
32
|
root: ['columnsManagement'],
|
|
31
33
|
header: ['columnsManagementHeader'],
|
|
34
|
+
searchInput: ['columnsManagementSearchInput'],
|
|
32
35
|
footer: ['columnsManagementFooter'],
|
|
33
36
|
row: ['columnsManagementRow']
|
|
34
37
|
};
|
|
@@ -51,7 +54,8 @@ function GridColumnsManagement(props) {
|
|
|
51
54
|
disableShowHideToggle = false,
|
|
52
55
|
disableResetButton = false,
|
|
53
56
|
toggleAllMode = 'all',
|
|
54
|
-
getTogglableColumns
|
|
57
|
+
getTogglableColumns,
|
|
58
|
+
searchInputProps
|
|
55
59
|
} = props;
|
|
56
60
|
const isResetDisabled = React.useMemo(() => (0, _utils.checkColumnVisibilityModelsSame)(columnVisibilityModel, initialColumnVisibilityModel), [columnVisibilityModel, initialColumnVisibilityModel]);
|
|
57
61
|
const sortedColumns = React.useMemo(() => {
|
|
@@ -118,28 +122,52 @@ function GridColumnsManagement(props) {
|
|
|
118
122
|
}
|
|
119
123
|
return false;
|
|
120
124
|
};
|
|
125
|
+
const handleSearchReset = React.useCallback(() => {
|
|
126
|
+
setSearchValue('');
|
|
127
|
+
searchInputRef.current.focus();
|
|
128
|
+
}, []);
|
|
121
129
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
122
130
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(GridColumnsManagementHeader, {
|
|
123
131
|
className: classes.header,
|
|
124
132
|
ownerState: rootProps,
|
|
125
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
133
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(SearchInput, (0, _extends2.default)({
|
|
134
|
+
as: rootProps.slots.baseTextField,
|
|
135
|
+
ownerState: rootProps,
|
|
126
136
|
placeholder: apiRef.current.getLocaleText('columnsManagementSearchTitle'),
|
|
127
137
|
inputRef: searchInputRef,
|
|
138
|
+
className: classes.searchInput,
|
|
128
139
|
value: searchValue,
|
|
129
140
|
onChange: handleSearchValueChange,
|
|
130
141
|
variant: "outlined",
|
|
131
142
|
size: "small",
|
|
143
|
+
type: "search",
|
|
132
144
|
InputProps: {
|
|
133
145
|
startAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseInputAdornment, {
|
|
134
146
|
position: "start",
|
|
135
147
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.quickFilterIcon, {})
|
|
136
148
|
}),
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
149
|
+
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseIconButton, (0, _extends2.default)({
|
|
150
|
+
"aria-label": apiRef.current.getLocaleText('columnsManagementDeleteIconLabel'),
|
|
151
|
+
size: "small",
|
|
152
|
+
sx: [searchValue ? {
|
|
153
|
+
visibility: 'visible'
|
|
154
|
+
} : {
|
|
155
|
+
visibility: 'hidden'
|
|
156
|
+
}],
|
|
157
|
+
tabIndex: -1,
|
|
158
|
+
onClick: handleSearchReset
|
|
159
|
+
}, rootProps.slotProps?.baseIconButton, {
|
|
160
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.quickFilterClearIcon, {
|
|
161
|
+
fontSize: "small"
|
|
162
|
+
})
|
|
163
|
+
}))
|
|
164
|
+
},
|
|
165
|
+
inputProps: {
|
|
166
|
+
'aria-label': apiRef.current.getLocaleText('columnsManagementSearchTitle')
|
|
140
167
|
},
|
|
168
|
+
autoComplete: "off",
|
|
141
169
|
fullWidth: true
|
|
142
|
-
}, rootProps.slotProps?.baseTextField))
|
|
170
|
+
}, rootProps.slotProps?.baseTextField, searchInputProps))
|
|
143
171
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(GridColumnsManagementBody, {
|
|
144
172
|
className: classes.root,
|
|
145
173
|
ownerState: rootProps,
|
|
@@ -214,6 +242,7 @@ process.env.NODE_ENV !== "production" ? GridColumnsManagement.propTypes = {
|
|
|
214
242
|
* @returns {GridColDef['field'][]} The list of togglable columns' field names.
|
|
215
243
|
*/
|
|
216
244
|
getTogglableColumns: _propTypes.default.func,
|
|
245
|
+
searchInputProps: _propTypes.default.object,
|
|
217
246
|
searchPredicate: _propTypes.default.func,
|
|
218
247
|
sort: _propTypes.default.oneOf(['asc', 'desc']),
|
|
219
248
|
/**
|
|
@@ -248,6 +277,24 @@ const GridColumnsManagementHeader = (0, _styles.styled)('div', {
|
|
|
248
277
|
}) => ({
|
|
249
278
|
padding: theme.spacing(1.5, 3)
|
|
250
279
|
}));
|
|
280
|
+
const SearchInput = (0, _styles.styled)(_TextField.default, {
|
|
281
|
+
name: 'MuiDataGrid',
|
|
282
|
+
slot: 'ColumnsManagementSearchInput',
|
|
283
|
+
overridesResolver: (props, styles) => styles.columnsManagementSearchInput
|
|
284
|
+
})(({
|
|
285
|
+
theme
|
|
286
|
+
}) => ({
|
|
287
|
+
[`& .${_InputBase.inputBaseClasses.root}`]: {
|
|
288
|
+
padding: theme.spacing(0, 1.5, 0, 1.5)
|
|
289
|
+
},
|
|
290
|
+
[`& .${_InputBase.inputBaseClasses.input}::-webkit-search-decoration,
|
|
291
|
+
& .${_InputBase.inputBaseClasses.input}::-webkit-search-cancel-button,
|
|
292
|
+
& .${_InputBase.inputBaseClasses.input}::-webkit-search-results-button,
|
|
293
|
+
& .${_InputBase.inputBaseClasses.input}::-webkit-search-results-decoration`]: {
|
|
294
|
+
/* clears the 'X' icon from Chrome */
|
|
295
|
+
display: 'none'
|
|
296
|
+
}
|
|
297
|
+
}));
|
|
251
298
|
const GridColumnsManagementFooter = (0, _styles.styled)('div', {
|
|
252
299
|
name: 'MuiDataGrid',
|
|
253
300
|
slot: 'ColumnsManagementFooter',
|
|
@@ -22,14 +22,15 @@ const _excluded = ["className", "csvOptions", "printOptions", "excelOptions", "s
|
|
|
22
22
|
const GridToolbar = exports.GridToolbar = /*#__PURE__*/React.forwardRef(function GridToolbar(props, ref) {
|
|
23
23
|
// TODO v7: think about where export option should be passed.
|
|
24
24
|
// from slotProps={{ toolbarExport: { ...exportOption } }} seems to be more appropriate
|
|
25
|
-
const
|
|
25
|
+
const _ref = props,
|
|
26
|
+
{
|
|
26
27
|
csvOptions,
|
|
27
28
|
printOptions,
|
|
28
29
|
excelOptions,
|
|
29
30
|
showQuickFilter = false,
|
|
30
31
|
quickFilterProps = {}
|
|
31
|
-
} =
|
|
32
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(
|
|
32
|
+
} = _ref,
|
|
33
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
33
34
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
34
35
|
if (rootProps.disableColumnFilter && rootProps.disableColumnSelector && rootProps.disableDensitySelector && !showQuickFilter) {
|
|
35
36
|
return null;
|
|
@@ -40,7 +41,7 @@ const GridToolbar = exports.GridToolbar = /*#__PURE__*/React.forwardRef(function
|
|
|
40
41
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_GridToolbarColumnsButton.GridToolbarColumnsButton, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridToolbarFilterButton.GridToolbarFilterButton, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridToolbarDensitySelector.GridToolbarDensitySelector, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridToolbarExport.GridToolbarExport, {
|
|
41
42
|
csvOptions: csvOptions,
|
|
42
43
|
printOptions: printOptions
|
|
43
|
-
//
|
|
44
|
+
// @ts-ignore
|
|
44
45
|
,
|
|
45
46
|
excelOptions: excelOptions
|
|
46
47
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -55,6 +56,8 @@ process.env.NODE_ENV !== "production" ? GridToolbar.propTypes = {
|
|
|
55
56
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
56
57
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
57
58
|
// ----------------------------------------------------------------------
|
|
59
|
+
csvOptions: _propTypes.default.object,
|
|
60
|
+
printOptions: _propTypes.default.object,
|
|
58
61
|
/**
|
|
59
62
|
* Props passed to the quick filter component.
|
|
60
63
|
*/
|
|
@@ -64,5 +67,10 @@ process.env.NODE_ENV !== "production" ? GridToolbar.propTypes = {
|
|
|
64
67
|
* @default false
|
|
65
68
|
*/
|
|
66
69
|
showQuickFilter: _propTypes.default.bool,
|
|
70
|
+
/**
|
|
71
|
+
* The props used for each slot inside.
|
|
72
|
+
* @default {}
|
|
73
|
+
*/
|
|
74
|
+
slotProps: _propTypes.default.object,
|
|
67
75
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
68
76
|
} : void 0;
|
|
@@ -44,7 +44,7 @@ const GridToolbarColumnsButton = exports.GridToolbarColumnsButton = /*#__PURE__*
|
|
|
44
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTooltip, (0, _extends2.default)({
|
|
45
45
|
title: apiRef.current.getLocaleText('toolbarColumnsLabel'),
|
|
46
46
|
enterDelay: 1000
|
|
47
|
-
},
|
|
47
|
+
}, rootProps.slotProps?.baseTooltip, tooltipProps, {
|
|
48
48
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseButton, (0, _extends2.default)({
|
|
49
49
|
ref: ref,
|
|
50
50
|
id: columnButtonId,
|
|
@@ -53,10 +53,9 @@ const GridToolbarColumnsButton = exports.GridToolbarColumnsButton = /*#__PURE__*
|
|
|
53
53
|
"aria-haspopup": "menu",
|
|
54
54
|
"aria-expanded": isOpen,
|
|
55
55
|
"aria-controls": isOpen ? columnPanelId : undefined,
|
|
56
|
-
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnSelectorIcon, {})
|
|
57
|
-
}, buttonProps, {
|
|
56
|
+
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnSelectorIcon, {}),
|
|
58
57
|
onClick: showColumns
|
|
59
|
-
}, rootProps.slotProps?.baseButton, {
|
|
58
|
+
}, rootProps.slotProps?.baseButton, buttonProps, {
|
|
60
59
|
children: apiRef.current.getLocaleText('toolbarColumns')
|
|
61
60
|
}))
|
|
62
61
|
}));
|
|
@@ -93,7 +93,7 @@ const GridToolbarDensitySelector = exports.GridToolbarDensitySelector = /*#__PUR
|
|
|
93
93
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTooltip, (0, _extends2.default)({
|
|
94
94
|
title: apiRef.current.getLocaleText('toolbarDensityLabel'),
|
|
95
95
|
enterDelay: 1000
|
|
96
|
-
},
|
|
96
|
+
}, rootProps.slotProps?.baseTooltip, tooltipProps, {
|
|
97
97
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseButton, (0, _extends2.default)({
|
|
98
98
|
ref: handleRef,
|
|
99
99
|
size: "small",
|
|
@@ -102,10 +102,9 @@ const GridToolbarDensitySelector = exports.GridToolbarDensitySelector = /*#__PUR
|
|
|
102
102
|
"aria-haspopup": "menu",
|
|
103
103
|
"aria-expanded": open,
|
|
104
104
|
"aria-controls": open ? densityMenuId : undefined,
|
|
105
|
-
id: densityButtonId
|
|
106
|
-
}, buttonProps, {
|
|
105
|
+
id: densityButtonId,
|
|
107
106
|
onClick: handleDensitySelectorOpen
|
|
108
|
-
}, rootProps.slotProps?.baseButton, {
|
|
107
|
+
}, rootProps.slotProps?.baseButton, buttonProps, {
|
|
109
108
|
children: apiRef.current.getLocaleText('toolbarDensity')
|
|
110
109
|
}))
|
|
111
110
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridMenu.GridMenu, {
|
|
@@ -92,12 +92,13 @@ process.env.NODE_ENV !== "production" ? GridPrintExportMenuItem.propTypes = {
|
|
|
92
92
|
})
|
|
93
93
|
} : void 0;
|
|
94
94
|
const GridToolbarExport = exports.GridToolbarExport = /*#__PURE__*/React.forwardRef(function GridToolbarExport(props, ref) {
|
|
95
|
-
const
|
|
95
|
+
const _ref = props,
|
|
96
|
+
{
|
|
96
97
|
csvOptions = {},
|
|
97
98
|
printOptions = {},
|
|
98
99
|
excelOptions
|
|
99
|
-
} =
|
|
100
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(
|
|
100
|
+
} = _ref,
|
|
101
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded3);
|
|
101
102
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
102
103
|
const preProcessedButtons = apiRef.current.unstable_applyPipeProcessors('exportMenu', [], {
|
|
103
104
|
excelOptions,
|
|
@@ -51,7 +51,7 @@ const GridToolbarExportContainer = exports.GridToolbarExportContainer = /*#__PUR
|
|
|
51
51
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTooltip, (0, _extends2.default)({
|
|
52
52
|
title: apiRef.current.getLocaleText('toolbarExportLabel'),
|
|
53
53
|
enterDelay: 1000
|
|
54
|
-
},
|
|
54
|
+
}, rootProps.slotProps?.baseTooltip, tooltipProps, {
|
|
55
55
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseButton, (0, _extends2.default)({
|
|
56
56
|
ref: handleRef,
|
|
57
57
|
size: "small",
|
|
@@ -60,10 +60,9 @@ const GridToolbarExportContainer = exports.GridToolbarExportContainer = /*#__PUR
|
|
|
60
60
|
"aria-label": apiRef.current.getLocaleText('toolbarExportLabel'),
|
|
61
61
|
"aria-haspopup": "menu",
|
|
62
62
|
"aria-controls": open ? exportMenuId : undefined,
|
|
63
|
-
id: exportButtonId
|
|
64
|
-
}, buttonProps, {
|
|
63
|
+
id: exportButtonId,
|
|
65
64
|
onClick: handleMenuOpen
|
|
66
|
-
}, rootProps.slotProps?.baseButton, {
|
|
65
|
+
}, rootProps.slotProps?.baseButton, buttonProps, {
|
|
67
66
|
children: apiRef.current.getLocaleText('toolbarExport')
|
|
68
67
|
}))
|
|
69
68
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridMenu.GridMenu, {
|
|
@@ -45,6 +45,7 @@ const GridToolbarFilterButton = exports.GridToolbarFilterButton = /*#__PURE__*/R
|
|
|
45
45
|
} = props;
|
|
46
46
|
const buttonProps = slotProps.button || {};
|
|
47
47
|
const tooltipProps = slotProps.tooltip || {};
|
|
48
|
+
const badgeProps = slotProps.badge || {};
|
|
48
49
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
49
50
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
50
51
|
const activeFilters = (0, _useGridSelector.useGridSelector)(apiRef, _gridFilterSelector.gridFilterActiveItemsSelector);
|
|
@@ -102,7 +103,7 @@ const GridToolbarFilterButton = exports.GridToolbarFilterButton = /*#__PURE__*/R
|
|
|
102
103
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTooltip, (0, _extends2.default)({
|
|
103
104
|
title: tooltipContentNode,
|
|
104
105
|
enterDelay: 1000
|
|
105
|
-
},
|
|
106
|
+
}, rootProps.slotProps?.baseTooltip, tooltipProps, {
|
|
106
107
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseButton, (0, _extends2.default)({
|
|
107
108
|
ref: ref,
|
|
108
109
|
id: filterButtonId,
|
|
@@ -111,14 +112,14 @@ const GridToolbarFilterButton = exports.GridToolbarFilterButton = /*#__PURE__*/R
|
|
|
111
112
|
"aria-controls": isOpen ? filterPanelId : undefined,
|
|
112
113
|
"aria-expanded": isOpen,
|
|
113
114
|
"aria-haspopup": true,
|
|
114
|
-
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseBadge, {
|
|
115
|
+
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseBadge, (0, _extends2.default)({
|
|
115
116
|
badgeContent: activeFilters.length,
|
|
116
|
-
color: "primary"
|
|
117
|
+
color: "primary"
|
|
118
|
+
}, rootProps.slotProps?.baseBadge, badgeProps, {
|
|
117
119
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.openFilterButtonIcon, {})
|
|
118
|
-
})
|
|
119
|
-
}, buttonProps, {
|
|
120
|
+
})),
|
|
120
121
|
onClick: toggleFilter
|
|
121
|
-
}, rootProps.slotProps?.baseButton, {
|
|
122
|
+
}, rootProps.slotProps?.baseButton, buttonProps, {
|
|
122
123
|
children: apiRef.current.getLocaleText('toolbarFilters')
|
|
123
124
|
}))
|
|
124
125
|
}));
|
|
@@ -86,6 +86,7 @@ function GridToolbarQuickFilter(props) {
|
|
|
86
86
|
apiRef.current.setQuickFilterValues(newQuickFilterValues);
|
|
87
87
|
}, [apiRef, quickFilterParser]);
|
|
88
88
|
const debouncedUpdateSearchValue = React.useMemo(() => (0, _utils.unstable_debounce)(updateSearchValue, debounceMs), [updateSearchValue, debounceMs]);
|
|
89
|
+
React.useEffect(() => debouncedUpdateSearchValue.clear, [debouncedUpdateSearchValue]);
|
|
89
90
|
const handleSearchValueChange = React.useCallback(event => {
|
|
90
91
|
const newSearchValue = event.target.value;
|
|
91
92
|
setSearchValue(newSearchValue);
|
|
@@ -62,5 +62,6 @@ const DATA_GRID_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PROPS_DEFAULT_VALUES =
|
|
|
62
62
|
sortingMode: 'client',
|
|
63
63
|
sortingOrder: ['asc', 'desc', null],
|
|
64
64
|
throttleRowsMs: 0,
|
|
65
|
-
unstable_rowSpanning: false
|
|
65
|
+
unstable_rowSpanning: false,
|
|
66
|
+
virtualizeColumnsWithAutoRowHeight: false
|
|
66
67
|
};
|
|
@@ -9,4 +9,4 @@ var _utils = require("@mui/utils");
|
|
|
9
9
|
function getDataGridUtilityClass(slot) {
|
|
10
10
|
return (0, _utils.unstable_generateUtilityClass)('MuiDataGrid', slot);
|
|
11
11
|
}
|
|
12
|
-
const gridClasses = exports.gridClasses = (0, _utils.unstable_generateUtilityClasses)('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'autosizing', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--flex', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'cellOffsetLeft', 'checkboxInput', 'columnHeader', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader--pinnedLeft', 'columnHeader--pinnedRight', 'columnHeader--last', 'columnHeader--lastUnpinned', 'columnHeader--siblingFocused', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeaders', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementFooter', 'container--top', 'container--bottom', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filler', 'filler--borderBottom', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'main--hasSkeletonLoadingOverlay', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'root--noToolbar', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'row--borderBottom', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'rowSkeleton', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--header', 'scrollbarFiller--borderTop', 'scrollbarFiller--borderBottom', 'scrollbarFiller--pinnedRight', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScroller--hasScrollX', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeader--withLeftBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'treeDataGroupingCellLoadingContainer', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'groupingCriteriaCellLoadingContainer', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
12
|
+
const gridClasses = exports.gridClasses = (0, _utils.unstable_generateUtilityClasses)('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'autosizing', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--flex', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'cellOffsetLeft', 'checkboxInput', 'columnHeader', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader--pinnedLeft', 'columnHeader--pinnedRight', 'columnHeader--last', 'columnHeader--lastUnpinned', 'columnHeader--siblingFocused', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeaders', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementSearchInput', 'columnsManagementFooter', 'container--top', 'container--bottom', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filler', 'filler--borderBottom', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'main--hasSkeletonLoadingOverlay', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'root--noToolbar', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'row--borderBottom', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'rowSkeleton', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--header', 'scrollbarFiller--borderTop', 'scrollbarFiller--borderBottom', 'scrollbarFiller--pinnedRight', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScroller--hasScrollX', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeader--withLeftBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'treeDataGroupingCellLoadingContainer', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'groupingCriteriaCellLoadingContainer', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
@@ -38,6 +38,7 @@ const GRID_DEFAULT_LOCALE_TEXT = exports.GRID_DEFAULT_LOCALE_TEXT = {
|
|
|
38
38
|
columnsManagementNoColumns: 'No columns',
|
|
39
39
|
columnsManagementShowHideAllText: 'Show/Hide All',
|
|
40
40
|
columnsManagementReset: 'Reset',
|
|
41
|
+
columnsManagementDeleteIconLabel: 'Clear',
|
|
41
42
|
// Filter panel text
|
|
42
43
|
filterPanelAddFilter: 'Add filter',
|
|
43
44
|
filterPanelRemoveAll: 'Remove all',
|
|
@@ -291,7 +291,7 @@ const useGridColumnHeaders = props => {
|
|
|
291
291
|
fields: headerInfo.fields,
|
|
292
292
|
colIndex: headerInfo.colIndex,
|
|
293
293
|
depth: depth,
|
|
294
|
-
isLastColumn:
|
|
294
|
+
isLastColumn: index === visibleColumnGroupHeader.length - 1,
|
|
295
295
|
maxDepth: headerGroupingMaxDepth,
|
|
296
296
|
height: dimensions.groupHeaderHeight,
|
|
297
297
|
hasFocus: hasFocus,
|
|
@@ -299,7 +299,7 @@ const useGridColumnHeaders = props => {
|
|
|
299
299
|
pinnedPosition: pinnedPosition,
|
|
300
300
|
style: style,
|
|
301
301
|
indexInSection: indexInSection,
|
|
302
|
-
sectionLength:
|
|
302
|
+
sectionLength: visibleColumnGroupHeader.length,
|
|
303
303
|
gridHasFiller: gridHasFiller
|
|
304
304
|
}, index);
|
|
305
305
|
});
|
|
@@ -76,6 +76,7 @@ function useGridDimensions(apiRef, props) {
|
|
|
76
76
|
const rightPinnedWidth = pinnedColumns.right.reduce((w, col) => w + col.computedWidth, 0);
|
|
77
77
|
const [savedSize, setSavedSize] = React.useState();
|
|
78
78
|
const debouncedSetSavedSize = React.useMemo(() => (0, _throttle.throttle)(setSavedSize, props.resizeThrottleMs), [props.resizeThrottleMs]);
|
|
79
|
+
React.useEffect(() => debouncedSetSavedSize.clear, [debouncedSetSavedSize]);
|
|
79
80
|
const previousSize = React.useRef();
|
|
80
81
|
const getRootDimensions = () => apiRef.current.state.dimensions;
|
|
81
82
|
const setDimensions = (0, _utils.unstable_useEventCallback)(dimensions => {
|
|
@@ -248,7 +249,7 @@ function useGridDimensions(apiRef, props) {
|
|
|
248
249
|
rootDimensionsRef.current = size;
|
|
249
250
|
|
|
250
251
|
// jsdom has no layout capabilities
|
|
251
|
-
const isJSDOM = /jsdom/.test(window.navigator.userAgent);
|
|
252
|
+
const isJSDOM = /jsdom|HappyDOM/.test(window.navigator.userAgent);
|
|
252
253
|
if (size.height === 0 && !errorShown.current && !props.autoHeight && !isJSDOM) {
|
|
253
254
|
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'));
|
|
254
255
|
errorShown.current = true;
|
|
@@ -12,7 +12,7 @@ var _exportAs = require("../../../utils/exportAs");
|
|
|
12
12
|
var _csvSerializer = require("./serializers/csvSerializer");
|
|
13
13
|
var _utils = require("./utils");
|
|
14
14
|
var _pipeProcessing = require("../../core/pipeProcessing");
|
|
15
|
-
var
|
|
15
|
+
var _toolbar = require("../../../components/toolbar");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
/**
|
|
18
18
|
* @requires useGridColumns (state)
|
|
@@ -71,7 +71,7 @@ const useGridCsvExport = (apiRef, props) => {
|
|
|
71
71
|
return initialValue;
|
|
72
72
|
}
|
|
73
73
|
return [...initialValue, {
|
|
74
|
-
component: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
74
|
+
component: /*#__PURE__*/(0, _jsxRuntime.jsx)(_toolbar.GridCsvExportMenuItem, {
|
|
75
75
|
options: options.csvOptions
|
|
76
76
|
}),
|
|
77
77
|
componentName: 'csvExport'
|
|
@@ -19,7 +19,7 @@ var _gridRowsUtils = require("../rows/gridRowsUtils");
|
|
|
19
19
|
var _utils2 = require("./utils");
|
|
20
20
|
var _useGridPaginationModel = require("../pagination/useGridPaginationModel");
|
|
21
21
|
var _pipeProcessing = require("../../core/pipeProcessing");
|
|
22
|
-
var
|
|
22
|
+
var _toolbar = require("../../../components/toolbar");
|
|
23
23
|
var _gridColumnsUtils = require("../columns/gridColumnsUtils");
|
|
24
24
|
var _gridCheckboxSelectionColDef = require("../../../colDef/gridCheckboxSelectionColDef");
|
|
25
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -288,7 +288,7 @@ const useGridPrintExport = (apiRef, props) => {
|
|
|
288
288
|
return initialValue;
|
|
289
289
|
}
|
|
290
290
|
return [...initialValue, {
|
|
291
|
-
component: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
291
|
+
component: /*#__PURE__*/(0, _jsxRuntime.jsx)(_toolbar.GridPrintExportMenuItem, {
|
|
292
292
|
options: options.printOptions
|
|
293
293
|
}),
|
|
294
294
|
componentName: 'printExport'
|
|
@@ -91,6 +91,17 @@ Object.keys(_focus).forEach(function (key) {
|
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
|
+
var _listView = require("./listView");
|
|
95
|
+
Object.keys(_listView).forEach(function (key) {
|
|
96
|
+
if (key === "default" || key === "__esModule") return;
|
|
97
|
+
if (key in exports && exports[key] === _listView[key]) return;
|
|
98
|
+
Object.defineProperty(exports, key, {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function () {
|
|
101
|
+
return _listView[key];
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
94
105
|
var _pagination = require("./pagination");
|
|
95
106
|
Object.keys(_pagination).forEach(function (key) {
|
|
96
107
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.gridListColumnSelector = void 0;
|
|
7
7
|
/**
|
|
8
|
-
* Get
|
|
8
|
+
* Get the list column definition
|
|
9
|
+
* @category List View
|
|
10
|
+
* @ignore - Do not document
|
|
9
11
|
*/
|
|
10
12
|
const gridListColumnSelector = state => state.listViewColumn;
|
|
11
13
|
exports.gridListColumnSelector = gridListColumnSelector;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _gridListViewSelectors = require("./gridListViewSelectors");
|
|
7
|
+
Object.keys(_gridListViewSelectors).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _gridListViewSelectors[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _gridListViewSelectors[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -84,7 +84,7 @@ const useGridPaginationModel = (apiRef, props) => {
|
|
|
84
84
|
pagination: (0, _extends2.default)({}, state.pagination, {
|
|
85
85
|
paginationModel: getDerivedPaginationModel(state.pagination, props.signature, paginationModel)
|
|
86
86
|
})
|
|
87
|
-
}));
|
|
87
|
+
}), 'setPaginationModel');
|
|
88
88
|
}, [apiRef, logger, props.signature]);
|
|
89
89
|
const paginationModelApi = {
|
|
90
90
|
setPage,
|
|
@@ -122,7 +122,7 @@ const useGridPaginationModel = (apiRef, props) => {
|
|
|
122
122
|
pagination: (0, _extends2.default)({}, state.pagination, {
|
|
123
123
|
paginationModel: getDerivedPaginationModel(state.pagination, props.signature, paginationModel)
|
|
124
124
|
})
|
|
125
|
-
}));
|
|
125
|
+
}), 'stateRestorePreProcessing');
|
|
126
126
|
return params;
|
|
127
127
|
}, [apiRef, props.autoPageSize, props.signature]);
|
|
128
128
|
(0, _pipeProcessing.useGridRegisterPipeProcessor)(apiRef, 'exportState', stateExportPreProcessing);
|