@mui/x-data-grid 7.20.0 → 7.22.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 +200 -31
- package/DataGrid/DataGrid.js +1 -0
- package/DataGrid/index.d.ts +0 -1
- package/DataGrid/index.js +1 -2
- package/DataGrid/useDataGridComponent.js +4 -1
- package/DataGrid/useDataGridProps.d.ts +1 -5
- package/DataGrid/useDataGridProps.js +3 -62
- package/components/GridPagination.js +1 -0
- package/components/GridRow.js +25 -36
- package/components/base/GridOverlays.js +8 -0
- package/components/cell/GridBooleanCell.d.ts +3 -3
- package/components/cell/GridBooleanCell.js +11 -1
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +1 -2
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/components/containers/GridRootStyles.js +5 -2
- package/components/menu/columnMenu/GridColumnMenu.js +32 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/components/panel/filterPanel/GridFilterInputValue.js +2 -2
- package/components/toolbar/GridToolbar.js +2 -3
- package/components/toolbar/GridToolbarExport.d.ts +9 -3
- package/components/toolbar/GridToolbarExport.js +43 -3
- package/components/toolbar/GridToolbarFilterButton.js +1 -2
- package/components/virtualization/GridBottomContainer.js +0 -17
- package/components/virtualization/GridMainContainer.js +2 -1
- package/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/components/virtualization/GridVirtualScroller.js +4 -2
- package/constants/dataGridPropsDefaultValues.d.ts +5 -0
- package/constants/dataGridPropsDefaultValues.js +60 -0
- package/constants/gridClasses.d.ts +5 -0
- package/constants/gridClasses.js +1 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +6 -1
- package/hooks/features/clipboard/useGridClipboard.js +2 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +3 -1
- package/hooks/features/columnMenu/useGridColumnMenuSlots.js +4 -3
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
- package/hooks/features/columns/gridColumnsUtils.js +3 -0
- package/hooks/features/dimensions/useGridDimensions.js +4 -2
- package/hooks/features/focus/useGridFocus.js +18 -3
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +9 -5
- package/hooks/features/listView/gridListViewSelectors.d.ts +5 -0
- package/hooks/features/listView/gridListViewSelectors.js +4 -0
- package/hooks/features/listView/useGridListView.d.ts +10 -0
- package/hooks/features/listView/useGridListView.js +54 -0
- package/hooks/features/pagination/gridPaginationSelector.js +2 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +11 -2
- package/hooks/features/rowSelection/utils.js +1 -1
- package/hooks/features/rows/gridRowsMetaInterfaces.d.ts +16 -0
- package/hooks/features/rows/gridRowsMetaInterfaces.js +1 -0
- package/hooks/features/rows/gridRowsUtils.d.ts +3 -0
- package/hooks/features/rows/gridRowsUtils.js +14 -1
- package/hooks/features/rows/useGridParamsApi.d.ts +2 -1
- package/hooks/features/rows/useGridParamsApi.js +4 -3
- package/hooks/features/rows/useGridRowsMeta.js +135 -154
- package/hooks/features/scroll/useGridScroll.d.ts +1 -1
- package/hooks/features/scroll/useGridScroll.js +3 -2
- package/hooks/features/virtualization/useGridVirtualScroller.js +25 -10
- package/hooks/utils/useGridApiMethod.js +2 -1
- package/index.d.ts +1 -0
- package/index.js +2 -1
- package/internals/index.d.ts +2 -1
- package/internals/index.js +2 -1
- package/joy/joySlots.js +45 -27
- package/locales/daDK.js +5 -6
- package/locales/itIT.js +27 -28
- package/locales/ptBR.js +4 -4
- package/material/index.js +4 -0
- package/models/api/gridRowsMetaApi.d.ts +15 -14
- package/models/colDef/gridColDef.d.ts +6 -0
- package/models/colDef/index.d.ts +1 -1
- package/models/gridApiCaches.d.ts +2 -0
- package/models/gridExport.d.ts +1 -1
- package/models/gridSlotsComponent.d.ts +10 -0
- package/models/gridSlotsComponentsProps.d.ts +9 -0
- package/models/gridStateCommunity.d.ts +2 -0
- package/models/props/DataGridProps.d.ts +14 -3
- package/modern/DataGrid/DataGrid.js +1 -0
- package/modern/DataGrid/index.js +1 -2
- package/modern/DataGrid/useDataGridComponent.js +4 -1
- package/modern/DataGrid/useDataGridProps.js +3 -62
- package/modern/components/GridPagination.js +1 -0
- package/modern/components/GridRow.js +25 -36
- package/modern/components/base/GridOverlays.js +8 -0
- package/modern/components/cell/GridBooleanCell.js +11 -1
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +1 -2
- package/modern/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/modern/components/containers/GridRootStyles.js +5 -2
- package/modern/components/menu/columnMenu/GridColumnMenu.js +32 -0
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +2 -2
- package/modern/components/toolbar/GridToolbar.js +2 -3
- package/modern/components/toolbar/GridToolbarExport.js +43 -3
- package/modern/components/toolbar/GridToolbarFilterButton.js +1 -2
- package/modern/components/virtualization/GridBottomContainer.js +0 -17
- package/modern/components/virtualization/GridMainContainer.js +2 -1
- package/modern/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/modern/components/virtualization/GridVirtualScroller.js +4 -2
- package/modern/constants/dataGridPropsDefaultValues.js +60 -0
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +2 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +3 -1
- package/modern/hooks/features/columnMenu/useGridColumnMenuSlots.js +4 -3
- package/modern/hooks/features/columns/gridColumnsUtils.js +3 -0
- package/modern/hooks/features/dimensions/useGridDimensions.js +4 -2
- package/modern/hooks/features/focus/useGridFocus.js +18 -3
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +9 -5
- package/modern/hooks/features/listView/gridListViewSelectors.js +4 -0
- package/modern/hooks/features/listView/useGridListView.js +54 -0
- package/modern/hooks/features/pagination/gridPaginationSelector.js +2 -1
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +11 -2
- package/modern/hooks/features/rowSelection/utils.js +1 -1
- package/modern/hooks/features/rows/gridRowsMetaInterfaces.js +1 -0
- package/modern/hooks/features/rows/gridRowsUtils.js +14 -1
- package/modern/hooks/features/rows/useGridParamsApi.js +4 -3
- package/modern/hooks/features/rows/useGridRowsMeta.js +135 -154
- package/modern/hooks/features/scroll/useGridScroll.js +3 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +25 -10
- package/modern/hooks/utils/useGridApiMethod.js +2 -1
- package/modern/index.js +2 -1
- package/modern/internals/index.js +2 -1
- package/modern/joy/joySlots.js +45 -27
- package/modern/locales/daDK.js +5 -6
- package/modern/locales/itIT.js +27 -28
- package/modern/locales/ptBR.js +4 -4
- package/modern/material/index.js +4 -0
- package/modern/utils/ResizeObserver.js +10 -0
- package/modern/utils/keyboardUtils.js +12 -4
- package/node/DataGrid/DataGrid.js +1 -0
- package/node/DataGrid/index.js +1 -12
- package/node/DataGrid/useDataGridComponent.js +4 -1
- package/node/DataGrid/useDataGridProps.js +6 -65
- package/node/components/GridPagination.js +1 -0
- package/node/components/GridRow.js +25 -36
- package/node/components/base/GridOverlays.js +8 -0
- package/node/components/cell/GridBooleanCell.js +11 -1
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +1 -2
- package/node/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/node/components/containers/GridRootStyles.js +5 -2
- package/node/components/menu/columnMenu/GridColumnMenu.js +32 -0
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/node/components/panel/filterPanel/GridFilterInputValue.js +2 -2
- package/node/components/toolbar/GridToolbar.js +2 -3
- package/node/components/toolbar/GridToolbarExport.js +40 -0
- package/node/components/toolbar/GridToolbarFilterButton.js +1 -2
- package/node/components/virtualization/GridBottomContainer.js +0 -17
- package/node/components/virtualization/GridMainContainer.js +2 -1
- package/node/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/node/components/virtualization/GridVirtualScroller.js +4 -2
- package/node/constants/dataGridPropsDefaultValues.js +66 -0
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/clipboard/useGridClipboard.js +2 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +3 -1
- package/node/hooks/features/columnMenu/useGridColumnMenuSlots.js +4 -3
- package/node/hooks/features/columns/gridColumnsUtils.js +3 -0
- package/node/hooks/features/dimensions/useGridDimensions.js +3 -1
- package/node/hooks/features/focus/useGridFocus.js +18 -3
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +9 -5
- package/node/hooks/features/listView/gridListViewSelectors.js +11 -0
- package/node/hooks/features/listView/useGridListView.js +64 -0
- package/node/hooks/features/pagination/gridPaginationSelector.js +3 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +11 -2
- package/node/hooks/features/rowSelection/utils.js +1 -1
- package/node/hooks/features/rows/gridRowsMetaInterfaces.js +5 -0
- package/node/hooks/features/rows/gridRowsUtils.js +16 -2
- package/node/hooks/features/rows/useGridParamsApi.js +4 -3
- package/node/hooks/features/rows/useGridRowsMeta.js +136 -154
- package/node/hooks/features/scroll/useGridScroll.js +3 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +25 -10
- package/node/hooks/utils/useGridApiMethod.js +3 -1
- package/node/index.js +13 -1
- package/node/internals/index.js +22 -0
- package/node/joy/joySlots.js +45 -27
- package/node/locales/daDK.js +5 -6
- package/node/locales/itIT.js +27 -28
- package/node/locales/ptBR.js +4 -4
- package/node/material/index.js +4 -0
- package/node/utils/ResizeObserver.js +16 -0
- package/node/utils/keyboardUtils.js +15 -5
- package/package.json +2 -2
- package/utils/ResizeObserver.d.ts +4 -0
- package/utils/ResizeObserver.js +10 -0
- package/utils/keyboardUtils.d.ts +1 -0
- package/utils/keyboardUtils.js +12 -4
package/components/GridRow.js
CHANGED
|
@@ -7,7 +7,6 @@ import clsx from 'clsx';
|
|
|
7
7
|
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
8
8
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
9
9
|
import { GridEditModes, GridRowModes, GridCellModes } from "../models/gridEditRowModel.js";
|
|
10
|
-
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
11
10
|
import { gridClasses } from "../constants/gridClasses.js";
|
|
12
11
|
import { composeGridClasses } from "../utils/composeGridClasses.js";
|
|
13
12
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
@@ -25,6 +24,7 @@ import { PinnedPosition, gridPinnedColumnPositionLookup } from "./cell/GridCell.
|
|
|
25
24
|
import { GridScrollbarFillerCell as ScrollbarFiller } from "./GridScrollbarFillerCell.js";
|
|
26
25
|
import { getPinnedCellOffset } from "../internals/utils/getPinnedCellOffset.js";
|
|
27
26
|
import { useGridConfiguration } from "../hooks/utils/useGridConfiguration.js";
|
|
27
|
+
import { useGridPrivateApiContext } from "../hooks/utils/useGridPrivateApiContext.js";
|
|
28
28
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
29
|
function EmptyCell({
|
|
30
30
|
width
|
|
@@ -40,6 +40,13 @@ function EmptyCell({
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
+
process.env.NODE_ENV !== "production" ? EmptyCell.propTypes = {
|
|
44
|
+
// ----------------------------- Warning --------------------------------
|
|
45
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
46
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
47
|
+
// ----------------------------------------------------------------------
|
|
48
|
+
width: PropTypes.number.isRequired
|
|
49
|
+
} : void 0;
|
|
43
50
|
const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
44
51
|
const {
|
|
45
52
|
selected,
|
|
@@ -67,7 +74,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
67
74
|
onMouseOver
|
|
68
75
|
} = props,
|
|
69
76
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
70
|
-
const apiRef =
|
|
77
|
+
const apiRef = useGridPrivateApiContext();
|
|
71
78
|
const configuration = useGridConfiguration();
|
|
72
79
|
const ref = React.useRef(null);
|
|
73
80
|
const rootProps = useGridRootProps();
|
|
@@ -91,30 +98,17 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
91
98
|
const getRowAriaAttributes = configuration.hooks.useGridRowAriaAttributes();
|
|
92
99
|
React.useLayoutEffect(() => {
|
|
93
100
|
if (currentPage.range) {
|
|
94
|
-
// The index prop is relative to the rows from all pages. As example, the index prop of the
|
|
95
|
-
// first row is 5 if `paginationModel.pageSize=5` and `paginationModel.page=1`. However, the index used by the virtualization
|
|
96
|
-
// doesn't care about pagination and considers the rows from the current page only, so the
|
|
97
|
-
// first row always has index=0. We need to subtract the index of the first row to make it
|
|
98
|
-
// compatible with the index used by the virtualization.
|
|
99
101
|
const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(rowId);
|
|
100
|
-
//
|
|
101
|
-
if (rowIndex
|
|
102
|
+
// Pinned rows are not part of the visible rows
|
|
103
|
+
if (rowIndex !== undefined) {
|
|
102
104
|
apiRef.current.unstable_setLastMeasuredRowIndex(rowIndex);
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (!rootElement || hasFixedHeight || typeof ResizeObserver === 'undefined') {
|
|
108
|
-
return undefined;
|
|
107
|
+
if (ref.current && rowHeight === 'auto') {
|
|
108
|
+
return apiRef.current.observeRowHeight(ref.current, rowId);
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const height = entry.borderBoxSize && entry.borderBoxSize.length > 0 ? entry.borderBoxSize[0].blockSize : entry.contentRect.height;
|
|
113
|
-
apiRef.current.unstable_storeRowHeightMeasurement(rowId, height);
|
|
114
|
-
});
|
|
115
|
-
resizeObserver.observe(rootElement);
|
|
116
|
-
return () => resizeObserver.disconnect();
|
|
117
|
-
}, [apiRef, currentPage.range, index, rowHeight, rowId]);
|
|
110
|
+
return undefined;
|
|
111
|
+
}, [apiRef, currentPage.range, rowHeight, rowId]);
|
|
118
112
|
const publish = React.useCallback((eventName, propHandler) => event => {
|
|
119
113
|
// Ignore portal
|
|
120
114
|
if (isEventTargetInPortal(event)) {
|
|
@@ -171,15 +165,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
171
165
|
disableColumnReorder
|
|
172
166
|
} = rootProps;
|
|
173
167
|
const rowReordering = rootProps.rowReordering;
|
|
174
|
-
const
|
|
175
|
-
let minHeight = rowHeight;
|
|
176
|
-
if (minHeight === 'auto' && sizes) {
|
|
177
|
-
const numberOfBaseSizes = 1;
|
|
178
|
-
const maximumSize = sizes.baseCenter ?? 0;
|
|
179
|
-
if (maximumSize > 0 && numberOfBaseSizes > 1) {
|
|
180
|
-
minHeight = maximumSize;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
168
|
+
const heightEntry = useGridSelector(apiRef, () => _extends({}, apiRef.current.getRowHeightEntry(rowId)), objectShallowCompare);
|
|
183
169
|
const style = React.useMemo(() => {
|
|
184
170
|
if (isNotVisible) {
|
|
185
171
|
return {
|
|
@@ -191,25 +177,25 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
191
177
|
const rowStyle = _extends({}, styleProp, {
|
|
192
178
|
maxHeight: rowHeight === 'auto' ? 'none' : rowHeight,
|
|
193
179
|
// max-height doesn't support "auto"
|
|
194
|
-
minHeight,
|
|
180
|
+
minHeight: rowHeight,
|
|
195
181
|
'--height': typeof rowHeight === 'number' ? `${rowHeight}px` : rowHeight
|
|
196
182
|
});
|
|
197
|
-
if (
|
|
183
|
+
if (heightEntry.spacingTop) {
|
|
198
184
|
const property = rootProps.rowSpacingType === 'border' ? 'borderTopWidth' : 'marginTop';
|
|
199
|
-
rowStyle[property] =
|
|
185
|
+
rowStyle[property] = heightEntry.spacingTop;
|
|
200
186
|
}
|
|
201
|
-
if (
|
|
187
|
+
if (heightEntry.spacingBottom) {
|
|
202
188
|
const property = rootProps.rowSpacingType === 'border' ? 'borderBottomWidth' : 'marginBottom';
|
|
203
189
|
let propertyValue = rowStyle[property];
|
|
204
190
|
// avoid overriding existing value
|
|
205
191
|
if (typeof propertyValue !== 'number') {
|
|
206
192
|
propertyValue = parseInt(propertyValue || '0', 10);
|
|
207
193
|
}
|
|
208
|
-
propertyValue +=
|
|
194
|
+
propertyValue += heightEntry.spacingBottom;
|
|
209
195
|
rowStyle[property] = propertyValue;
|
|
210
196
|
}
|
|
211
197
|
return rowStyle;
|
|
212
|
-
}, [isNotVisible, rowHeight, styleProp,
|
|
198
|
+
}, [isNotVisible, rowHeight, styleProp, heightEntry, rootProps.rowSpacingType]);
|
|
213
199
|
const rowClassNames = apiRef.current.unstable_applyPipeProcessors('rowClassName', [], rowId);
|
|
214
200
|
const ariaAttributes = rowNode ? getRowAriaAttributes(rowNode, index) : undefined;
|
|
215
201
|
if (typeof rootProps.getRowClassName === 'function') {
|
|
@@ -287,6 +273,9 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
287
273
|
for (let i = renderContext.firstColumnIndex; i < renderContext.lastColumnIndex; i += 1) {
|
|
288
274
|
const column = visibleColumns[i];
|
|
289
275
|
const indexInSection = i - pinnedColumns.left.length;
|
|
276
|
+
if (!column) {
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
290
279
|
cells.push(getCell(column, indexInSection, i, middleColumnsLength));
|
|
291
280
|
}
|
|
292
281
|
if (hasVirtualFocusCellRight) {
|
|
@@ -74,6 +74,14 @@ function GridOverlayWrapper(props) {
|
|
|
74
74
|
}, props))
|
|
75
75
|
}));
|
|
76
76
|
}
|
|
77
|
+
process.env.NODE_ENV !== "production" ? GridOverlayWrapper.propTypes = {
|
|
78
|
+
// ----------------------------- Warning --------------------------------
|
|
79
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
80
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
81
|
+
// ----------------------------------------------------------------------
|
|
82
|
+
loadingOverlayVariant: PropTypes.oneOf(['circular-progress', 'linear-progress', 'skeleton']),
|
|
83
|
+
overlayType: PropTypes.oneOf(['loadingOverlay', 'noResultsOverlay', 'noRowsOverlay'])
|
|
84
|
+
} : void 0;
|
|
77
85
|
process.env.NODE_ENV !== "production" ? GridOverlays.propTypes = {
|
|
78
86
|
// ----------------------------- Warning --------------------------------
|
|
79
87
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SvgIconProps } from '@mui/material/SvgIcon';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { GridColDef } from '../../models/colDef/gridColDef';
|
|
4
|
+
import type { GridRenderCellParams } from '../../models/params/gridCellParams';
|
|
5
5
|
interface GridBooleanCellProps extends GridRenderCellParams, Omit<SvgIconProps, 'tabIndex' | 'id'> {
|
|
6
6
|
hideDescendantCount?: boolean;
|
|
7
7
|
}
|
|
8
|
-
declare function GridBooleanCellRaw(props: GridBooleanCellProps): React.JSX.Element;
|
|
8
|
+
declare function GridBooleanCellRaw(props: GridBooleanCellProps): React.JSX.Element | null;
|
|
9
9
|
declare namespace GridBooleanCellRaw {
|
|
10
10
|
var propTypes: any;
|
|
11
11
|
}
|
|
@@ -4,6 +4,8 @@ const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowN
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
+
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
8
|
+
import { gridRowMaximumTreeDepthSelector } from "../../hooks/features/rows/gridRowsSelector.js";
|
|
7
9
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
8
10
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
11
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
@@ -20,7 +22,8 @@ const useUtilityClasses = ownerState => {
|
|
|
20
22
|
};
|
|
21
23
|
function GridBooleanCellRaw(props) {
|
|
22
24
|
const {
|
|
23
|
-
value
|
|
25
|
+
value,
|
|
26
|
+
rowNode
|
|
24
27
|
} = props,
|
|
25
28
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
26
29
|
const apiRef = useGridApiContext();
|
|
@@ -29,7 +32,14 @@ function GridBooleanCellRaw(props) {
|
|
|
29
32
|
classes: rootProps.classes
|
|
30
33
|
};
|
|
31
34
|
const classes = useUtilityClasses(ownerState);
|
|
35
|
+
const maxDepth = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector);
|
|
36
|
+
const isServerSideRowGroupingRow =
|
|
37
|
+
// @ts-expect-error - Access tree data prop
|
|
38
|
+
maxDepth > 0 && rowNode.type === 'group' && rootProps.treeData === false;
|
|
32
39
|
const Icon = React.useMemo(() => value ? rootProps.slots.booleanCellTrueIcon : rootProps.slots.booleanCellFalseIcon, [rootProps.slots.booleanCellFalseIcon, rootProps.slots.booleanCellTrueIcon, value]);
|
|
40
|
+
if (isServerSideRowGroupingRow && value === undefined) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
33
43
|
return /*#__PURE__*/_jsx(Icon, _extends({
|
|
34
44
|
fontSize: "small",
|
|
35
45
|
className: classes.root,
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils';
|
|
5
|
-
import Badge from '@mui/material/Badge';
|
|
6
5
|
import { useGridSelector } from "../../hooks/index.js";
|
|
7
6
|
import { gridPreferencePanelStateSelector } from "../../hooks/features/preferencesPanel/gridPreferencePanelSelector.js";
|
|
8
7
|
import { GridPreferencePanelsValue } from "../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js";
|
|
@@ -76,7 +75,7 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
76
75
|
enterDelay: 1000
|
|
77
76
|
}, rootProps.slotProps?.baseTooltip, {
|
|
78
77
|
children: /*#__PURE__*/_jsxs(GridIconButtonContainer, {
|
|
79
|
-
children: [counter > 1 && /*#__PURE__*/_jsx(
|
|
78
|
+
children: [counter > 1 && /*#__PURE__*/_jsx(rootProps.slots.baseBadge, {
|
|
80
79
|
badgeContent: counter,
|
|
81
80
|
color: "default",
|
|
82
81
|
children: iconButton
|
|
@@ -4,7 +4,6 @@ const _excluded = ["direction", "index", "sortingOrder", "disabled"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import Badge from '@mui/material/Badge';
|
|
8
7
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
9
8
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
10
9
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
@@ -63,7 +62,7 @@ function GridColumnHeaderSortIconRaw(props) {
|
|
|
63
62
|
children: iconElement
|
|
64
63
|
}));
|
|
65
64
|
return /*#__PURE__*/_jsxs(GridIconButtonContainer, {
|
|
66
|
-
children: [index != null && /*#__PURE__*/_jsx(
|
|
65
|
+
children: [index != null && /*#__PURE__*/_jsx(rootProps.slots.baseBadge, {
|
|
67
66
|
badgeContent: index,
|
|
68
67
|
color: "default",
|
|
69
68
|
overlap: "circular",
|
|
@@ -152,6 +152,8 @@ export const GridRootStyles = styled('div', {
|
|
|
152
152
|
[`& .${c.treeDataGroupingCellToggle}`]: styles.treeDataGroupingCellToggle
|
|
153
153
|
}, {
|
|
154
154
|
[`& .${c.treeDataGroupingCellLoadingContainer}`]: styles.treeDataGroupingCellLoadingContainer
|
|
155
|
+
}, {
|
|
156
|
+
[`& .${c.groupingCriteriaCellLoadingContainer}`]: styles.groupingCriteriaCellLoadingContainer
|
|
155
157
|
}, {
|
|
156
158
|
[`& .${c.detailPanelToggleCell}`]: styles.detailPanelToggleCell
|
|
157
159
|
}, {
|
|
@@ -513,6 +515,7 @@ export const GridRootStyles = styled('div', {
|
|
|
513
515
|
},
|
|
514
516
|
/* Cell styles */
|
|
515
517
|
[`& .${c.cell}`]: {
|
|
518
|
+
flex: '0 0 auto',
|
|
516
519
|
height: 'var(--height)',
|
|
517
520
|
width: 'var(--width)',
|
|
518
521
|
lineHeight: 'calc(var(--height) - 1px)',
|
|
@@ -684,7 +687,7 @@ export const GridRootStyles = styled('div', {
|
|
|
684
687
|
alignSelf: 'stretch',
|
|
685
688
|
marginRight: t.spacing(2)
|
|
686
689
|
},
|
|
687
|
-
[`& .${c.treeDataGroupingCellLoadingContainer}`]: {
|
|
690
|
+
[`& .${c.treeDataGroupingCellLoadingContainer}, .${c.groupingCriteriaCellLoadingContainer}`]: {
|
|
688
691
|
display: 'flex',
|
|
689
692
|
alignItems: 'center',
|
|
690
693
|
justifyContent: 'center',
|
|
@@ -717,7 +720,7 @@ export const GridRootStyles = styled('div', {
|
|
|
717
720
|
}
|
|
718
721
|
},
|
|
719
722
|
[`& .${c.filler}`]: {
|
|
720
|
-
flex: 1
|
|
723
|
+
flex: '1 0 auto'
|
|
721
724
|
},
|
|
722
725
|
[`& .${c['filler--borderBottom']}`]: {
|
|
723
726
|
borderBottom: '1px solid var(--DataGrid-rowBorderColor)'
|
|
@@ -45,6 +45,38 @@ const GridGenericColumnMenu = /*#__PURE__*/React.forwardRef(function GridGeneric
|
|
|
45
45
|
children: orderedSlots.map(([Component, otherProps], index) => /*#__PURE__*/_jsx(Component, _extends({}, otherProps), index))
|
|
46
46
|
}));
|
|
47
47
|
});
|
|
48
|
+
process.env.NODE_ENV !== "production" ? GridGenericColumnMenu.propTypes = {
|
|
49
|
+
// ----------------------------- Warning --------------------------------
|
|
50
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
51
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
52
|
+
// ----------------------------------------------------------------------
|
|
53
|
+
colDef: PropTypes.object.isRequired,
|
|
54
|
+
/**
|
|
55
|
+
* Initial `slotProps` - it is internal, to be overrriden by Pro or Premium packages
|
|
56
|
+
* @ignore - do not document.
|
|
57
|
+
*/
|
|
58
|
+
defaultSlotProps: PropTypes.object.isRequired,
|
|
59
|
+
/**
|
|
60
|
+
* Initial `slots` - it is internal, to be overrriden by Pro or Premium packages
|
|
61
|
+
* @ignore - do not document.
|
|
62
|
+
*/
|
|
63
|
+
defaultSlots: PropTypes.object.isRequired,
|
|
64
|
+
hideMenu: PropTypes.func.isRequired,
|
|
65
|
+
id: PropTypes.string,
|
|
66
|
+
labelledby: PropTypes.string,
|
|
67
|
+
open: PropTypes.bool.isRequired,
|
|
68
|
+
/**
|
|
69
|
+
* Could be used to pass new props or override props specific to a column menu component
|
|
70
|
+
* e.g. `displayOrder`
|
|
71
|
+
*/
|
|
72
|
+
slotProps: PropTypes.object,
|
|
73
|
+
/**
|
|
74
|
+
* `slots` could be used to add new and (or) override default column menu items
|
|
75
|
+
* If you register a nee component you must pass it's `displayOrder` in `slotProps`
|
|
76
|
+
* or it will be placed in the end of the list
|
|
77
|
+
*/
|
|
78
|
+
slots: PropTypes.object
|
|
79
|
+
} : void 0;
|
|
48
80
|
const GridColumnMenu = /*#__PURE__*/React.forwardRef(function GridColumnMenu(props, ref) {
|
|
49
81
|
return /*#__PURE__*/_jsx(GridGenericColumnMenu, _extends({}, props, {
|
|
50
82
|
ref: ref,
|
|
@@ -39,9 +39,9 @@ function GridFilterInputMultipleValue(props) {
|
|
|
39
39
|
const handleChange = React.useCallback((event, value) => {
|
|
40
40
|
setFilterValueState(value.map(String));
|
|
41
41
|
applyValue(_extends({}, item, {
|
|
42
|
-
value: [...value]
|
|
42
|
+
value: [...value.map(filterItemValue => type === 'number' ? Number(filterItemValue) : filterItemValue)]
|
|
43
43
|
}));
|
|
44
|
-
}, [applyValue, item]);
|
|
44
|
+
}, [applyValue, item, type]);
|
|
45
45
|
return /*#__PURE__*/_jsx(Autocomplete, _extends({
|
|
46
46
|
multiple: true,
|
|
47
47
|
freeSolo: true,
|
|
@@ -34,13 +34,13 @@ function GridFilterInputValue(props) {
|
|
|
34
34
|
setIsApplying(true);
|
|
35
35
|
filterTimeout.start(rootProps.filterDebounceMs, () => {
|
|
36
36
|
const newItem = _extends({}, item, {
|
|
37
|
-
value,
|
|
37
|
+
value: type === 'number' ? Number(value) : value,
|
|
38
38
|
fromInput: id
|
|
39
39
|
});
|
|
40
40
|
applyValue(newItem);
|
|
41
41
|
setIsApplying(false);
|
|
42
42
|
});
|
|
43
|
-
}, [
|
|
43
|
+
}, [filterTimeout, rootProps.filterDebounceMs, item, type, id, applyValue]);
|
|
44
44
|
React.useEffect(() => {
|
|
45
45
|
const itemPlusTag = item;
|
|
46
46
|
if (itemPlusTag.fromInput !== id || item.value === undefined) {
|
|
@@ -3,7 +3,6 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["className", "csvOptions", "printOptions", "excelOptions", "showQuickFilter", "quickFilterProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import Box from '@mui/material/Box';
|
|
7
6
|
import { GridToolbarContainer } from "../containers/GridToolbarContainer.js";
|
|
8
7
|
import { GridToolbarColumnsButton } from "./GridToolbarColumnsButton.js";
|
|
9
8
|
import { GridToolbarDensitySelector } from "./GridToolbarDensitySelector.js";
|
|
@@ -36,8 +35,8 @@ const GridToolbar = /*#__PURE__*/React.forwardRef(function GridToolbar(props, re
|
|
|
36
35
|
// TODO: remove the reference to excelOptions in community package
|
|
37
36
|
,
|
|
38
37
|
excelOptions: excelOptions
|
|
39
|
-
}), /*#__PURE__*/_jsx(
|
|
40
|
-
|
|
38
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
39
|
+
style: {
|
|
41
40
|
flex: 1
|
|
42
41
|
}
|
|
43
42
|
}), showQuickFilter && /*#__PURE__*/_jsx(GridToolbarQuickFilter, _extends({}, quickFilterProps))]
|
|
@@ -28,7 +28,13 @@ export interface GridToolbarExportProps {
|
|
|
28
28
|
};
|
|
29
29
|
[key: string]: any;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
declare function GridCsvExportMenuItem(props: GridCsvExportMenuItemProps): React.JSX.Element;
|
|
32
|
+
declare namespace GridCsvExportMenuItem {
|
|
33
|
+
var propTypes: any;
|
|
34
|
+
}
|
|
35
|
+
declare function GridPrintExportMenuItem(props: GridPrintExportMenuItemProps): React.JSX.Element;
|
|
36
|
+
declare namespace GridPrintExportMenuItem {
|
|
37
|
+
var propTypes: any;
|
|
38
|
+
}
|
|
33
39
|
declare const GridToolbarExport: React.ForwardRefExoticComponent<Omit<GridToolbarExportProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
34
|
-
export { GridToolbarExport };
|
|
40
|
+
export { GridToolbarExport, GridCsvExportMenuItem, GridPrintExportMenuItem };
|
|
@@ -9,7 +9,7 @@ import MenuItem from '@mui/material/MenuItem';
|
|
|
9
9
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
10
10
|
import { GridToolbarExportContainer } from "./GridToolbarExportContainer.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
|
|
12
|
+
function GridCsvExportMenuItem(props) {
|
|
13
13
|
const apiRef = useGridApiContext();
|
|
14
14
|
const {
|
|
15
15
|
hideMenu,
|
|
@@ -25,7 +25,27 @@ export function GridCsvExportMenuItem(props) {
|
|
|
25
25
|
children: apiRef.current.getLocaleText('toolbarExportCSV')
|
|
26
26
|
}));
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
process.env.NODE_ENV !== "production" ? GridCsvExportMenuItem.propTypes = {
|
|
29
|
+
// ----------------------------- Warning --------------------------------
|
|
30
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
31
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
32
|
+
// ----------------------------------------------------------------------
|
|
33
|
+
hideMenu: PropTypes.func,
|
|
34
|
+
options: PropTypes.shape({
|
|
35
|
+
allColumns: PropTypes.bool,
|
|
36
|
+
delimiter: PropTypes.string,
|
|
37
|
+
disableToolbarButton: PropTypes.bool,
|
|
38
|
+
escapeFormulas: PropTypes.bool,
|
|
39
|
+
fields: PropTypes.arrayOf(PropTypes.string),
|
|
40
|
+
fileName: PropTypes.string,
|
|
41
|
+
getRowsToExport: PropTypes.func,
|
|
42
|
+
includeColumnGroupsHeaders: PropTypes.bool,
|
|
43
|
+
includeHeaders: PropTypes.bool,
|
|
44
|
+
shouldAppendQuotes: PropTypes.bool,
|
|
45
|
+
utf8WithBom: PropTypes.bool
|
|
46
|
+
})
|
|
47
|
+
} : void 0;
|
|
48
|
+
function GridPrintExportMenuItem(props) {
|
|
29
49
|
const apiRef = useGridApiContext();
|
|
30
50
|
const {
|
|
31
51
|
hideMenu,
|
|
@@ -41,6 +61,26 @@ export function GridPrintExportMenuItem(props) {
|
|
|
41
61
|
children: apiRef.current.getLocaleText('toolbarExportPrint')
|
|
42
62
|
}));
|
|
43
63
|
}
|
|
64
|
+
process.env.NODE_ENV !== "production" ? GridPrintExportMenuItem.propTypes = {
|
|
65
|
+
// ----------------------------- Warning --------------------------------
|
|
66
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
67
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
68
|
+
// ----------------------------------------------------------------------
|
|
69
|
+
hideMenu: PropTypes.func,
|
|
70
|
+
options: PropTypes.shape({
|
|
71
|
+
allColumns: PropTypes.bool,
|
|
72
|
+
bodyClassName: PropTypes.string,
|
|
73
|
+
copyStyles: PropTypes.bool,
|
|
74
|
+
disableToolbarButton: PropTypes.bool,
|
|
75
|
+
fields: PropTypes.arrayOf(PropTypes.string),
|
|
76
|
+
fileName: PropTypes.string,
|
|
77
|
+
getRowsToExport: PropTypes.func,
|
|
78
|
+
hideFooter: PropTypes.bool,
|
|
79
|
+
hideToolbar: PropTypes.bool,
|
|
80
|
+
includeCheckboxes: PropTypes.bool,
|
|
81
|
+
pageStyle: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
82
|
+
})
|
|
83
|
+
} : void 0;
|
|
44
84
|
const GridToolbarExport = /*#__PURE__*/React.forwardRef(function GridToolbarExport(props, ref) {
|
|
45
85
|
const {
|
|
46
86
|
csvOptions = {},
|
|
@@ -77,4 +117,4 @@ process.env.NODE_ENV !== "production" ? GridToolbarExport.propTypes = {
|
|
|
77
117
|
*/
|
|
78
118
|
slotProps: PropTypes.object
|
|
79
119
|
} : void 0;
|
|
80
|
-
export { GridToolbarExport };
|
|
120
|
+
export { GridToolbarExport, GridCsvExportMenuItem, GridPrintExportMenuItem };
|
|
@@ -3,7 +3,6 @@ import * as React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize, unstable_useId as useId } from '@mui/utils';
|
|
6
|
-
import Badge from '@mui/material/Badge';
|
|
7
6
|
import { gridColumnLookupSelector } from "../../hooks/features/columns/gridColumnsSelector.js";
|
|
8
7
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
9
8
|
import { gridFilterActiveItemsSelector } from "../../hooks/features/filter/gridFilterSelector.js";
|
|
@@ -104,7 +103,7 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
104
103
|
"aria-controls": isOpen ? filterPanelId : undefined,
|
|
105
104
|
"aria-expanded": isOpen,
|
|
106
105
|
"aria-haspopup": true,
|
|
107
|
-
startIcon: /*#__PURE__*/_jsx(
|
|
106
|
+
startIcon: /*#__PURE__*/_jsx(rootProps.slots.baseBadge, {
|
|
108
107
|
badgeContent: activeFilters.length,
|
|
109
108
|
color: "primary",
|
|
110
109
|
children: /*#__PURE__*/_jsx(rootProps.slots.openFilterButtonIcon, {})
|
|
@@ -4,9 +4,6 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { styled } from '@mui/system';
|
|
5
5
|
import composeClasses from '@mui/utils/composeClasses';
|
|
6
6
|
import { gridClasses, getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
7
|
-
import { gridDimensionsSelector } from "../../hooks/features/dimensions/gridDimensionsSelectors.js";
|
|
8
|
-
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
9
|
-
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
10
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
8
|
const useUtilityClasses = () => {
|
|
12
9
|
const slots = {
|
|
@@ -21,22 +18,8 @@ const Element = styled('div')({
|
|
|
21
18
|
});
|
|
22
19
|
export function GridBottomContainer(props) {
|
|
23
20
|
const classes = useUtilityClasses();
|
|
24
|
-
const apiRef = useGridApiContext();
|
|
25
|
-
const {
|
|
26
|
-
viewportOuterSize,
|
|
27
|
-
minimumSize,
|
|
28
|
-
hasScrollX,
|
|
29
|
-
scrollbarSize
|
|
30
|
-
} = useGridSelector(apiRef, gridDimensionsSelector);
|
|
31
|
-
const scrollHeight = hasScrollX ? scrollbarSize : 0;
|
|
32
|
-
const offset = Math.max(viewportOuterSize.height - minimumSize.height -
|
|
33
|
-
// Subtract scroll height twice to account for GridVirtualScrollerFiller and horizontal scrollbar
|
|
34
|
-
2 * scrollHeight, 0);
|
|
35
21
|
return /*#__PURE__*/_jsx(Element, _extends({}, props, {
|
|
36
22
|
className: clsx(classes.root, gridClasses['container--bottom']),
|
|
37
|
-
style: {
|
|
38
|
-
transform: `translateY(${offset}px)`
|
|
39
|
-
},
|
|
40
23
|
role: "presentation"
|
|
41
24
|
}));
|
|
42
25
|
}
|
|
@@ -7,7 +7,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
const GridPanelAnchor = styled('div')({
|
|
8
8
|
position: 'absolute',
|
|
9
9
|
top: `var(--DataGrid-headersTotalHeight)`,
|
|
10
|
-
left: 0
|
|
10
|
+
left: 0,
|
|
11
|
+
width: 'calc(100% - (var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))'
|
|
11
12
|
});
|
|
12
13
|
const Element = styled('div', {
|
|
13
14
|
name: 'MuiDataGrid',
|
|
@@ -119,6 +119,10 @@ const GridVirtualScrollbar = /*#__PURE__*/React.forwardRef(function GridVirtualS
|
|
|
119
119
|
return /*#__PURE__*/_jsx(Container, {
|
|
120
120
|
ref: useForkRef(ref, scrollbarRef),
|
|
121
121
|
className: classes.root,
|
|
122
|
+
style: props.position === 'vertical' && rootProps.unstable_listView ? {
|
|
123
|
+
height: '100%',
|
|
124
|
+
top: 0
|
|
125
|
+
} : undefined,
|
|
122
126
|
tabIndex: -1,
|
|
123
127
|
"aria-hidden": "true",
|
|
124
128
|
children: /*#__PURE__*/_jsx("div", {
|
|
@@ -40,6 +40,8 @@ const Scroller = styled('div', {
|
|
|
40
40
|
flexGrow: 1,
|
|
41
41
|
overflow: 'scroll',
|
|
42
42
|
scrollbarWidth: 'none' /* Firefox */,
|
|
43
|
+
display: 'flex',
|
|
44
|
+
flexDirection: 'column',
|
|
43
45
|
'&::-webkit-scrollbar': {
|
|
44
46
|
display: 'none' /* Safari and Chrome */
|
|
45
47
|
},
|
|
@@ -78,7 +80,7 @@ function GridVirtualScroller(props) {
|
|
|
78
80
|
}, getScrollerProps(), {
|
|
79
81
|
ownerState: rootProps,
|
|
80
82
|
children: [/*#__PURE__*/_jsxs(TopContainer, {
|
|
81
|
-
children: [/*#__PURE__*/_jsx(GridHeaders, {}), /*#__PURE__*/_jsx(rootProps.slots.pinnedRows, {
|
|
83
|
+
children: [!rootProps.unstable_listView && /*#__PURE__*/_jsx(GridHeaders, {}), /*#__PURE__*/_jsx(rootProps.slots.pinnedRows, {
|
|
82
84
|
position: "top",
|
|
83
85
|
virtualScroller: virtualScroller
|
|
84
86
|
})]
|
|
@@ -98,7 +100,7 @@ function GridVirtualScroller(props) {
|
|
|
98
100
|
})]
|
|
99
101
|
})), dimensions.hasScrollY && /*#__PURE__*/_jsx(Scrollbar, _extends({
|
|
100
102
|
position: "vertical"
|
|
101
|
-
}, getScrollbarVerticalProps())), dimensions.hasScrollX && /*#__PURE__*/_jsx(Scrollbar, _extends({
|
|
103
|
+
}, getScrollbarVerticalProps())), dimensions.hasScrollX && !rootProps.unstable_listView && /*#__PURE__*/_jsx(Scrollbar, _extends({
|
|
102
104
|
position: "horizontal"
|
|
103
105
|
}, getScrollbarHorizontalProps())), props.children]
|
|
104
106
|
}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DataGridPropsWithDefaultValues } from '../models/props/DataGridProps';
|
|
2
|
+
/**
|
|
3
|
+
* The default values of `DataGridPropsWithDefaultValues` to inject in the props of DataGrid.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DATA_GRID_PROPS_DEFAULT_VALUES: DataGridPropsWithDefaultValues;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { GridEditModes } from "../models/gridEditRowModel.js";
|
|
2
|
+
/**
|
|
3
|
+
* The default values of `DataGridPropsWithDefaultValues` to inject in the props of DataGrid.
|
|
4
|
+
*/
|
|
5
|
+
export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
6
|
+
autoHeight: false,
|
|
7
|
+
autoPageSize: false,
|
|
8
|
+
autosizeOnMount: false,
|
|
9
|
+
checkboxSelection: false,
|
|
10
|
+
checkboxSelectionVisibleOnly: false,
|
|
11
|
+
clipboardCopyCellDelimiter: '\t',
|
|
12
|
+
columnBufferPx: 150,
|
|
13
|
+
columnHeaderHeight: 56,
|
|
14
|
+
disableAutosize: false,
|
|
15
|
+
disableColumnFilter: false,
|
|
16
|
+
disableColumnMenu: false,
|
|
17
|
+
disableColumnReorder: false,
|
|
18
|
+
disableColumnResize: false,
|
|
19
|
+
disableColumnSelector: false,
|
|
20
|
+
disableColumnSorting: false,
|
|
21
|
+
disableDensitySelector: false,
|
|
22
|
+
disableEval: false,
|
|
23
|
+
disableMultipleColumnsFiltering: false,
|
|
24
|
+
disableMultipleColumnsSorting: false,
|
|
25
|
+
disableMultipleRowSelection: false,
|
|
26
|
+
disableRowSelectionOnClick: false,
|
|
27
|
+
disableVirtualization: false,
|
|
28
|
+
editMode: GridEditModes.Cell,
|
|
29
|
+
filterDebounceMs: 150,
|
|
30
|
+
filterMode: 'client',
|
|
31
|
+
hideFooter: false,
|
|
32
|
+
hideFooterPagination: false,
|
|
33
|
+
hideFooterRowCount: false,
|
|
34
|
+
hideFooterSelectedRowCount: false,
|
|
35
|
+
ignoreDiacritics: false,
|
|
36
|
+
ignoreValueFormatterDuringExport: false,
|
|
37
|
+
// TODO v8: Update to 'select'
|
|
38
|
+
indeterminateCheckboxAction: 'deselect',
|
|
39
|
+
keepColumnPositionIfDraggedOutside: false,
|
|
40
|
+
keepNonExistentRowsSelected: false,
|
|
41
|
+
loading: false,
|
|
42
|
+
logger: console,
|
|
43
|
+
logLevel: process.env.NODE_ENV === 'production' ? 'error' : 'warn',
|
|
44
|
+
pageSizeOptions: [25, 50, 100],
|
|
45
|
+
pagination: false,
|
|
46
|
+
paginationMode: 'client',
|
|
47
|
+
resizeThrottleMs: 60,
|
|
48
|
+
rowBufferPx: 150,
|
|
49
|
+
rowHeight: 52,
|
|
50
|
+
rowPositionsDebounceMs: 166,
|
|
51
|
+
rows: [],
|
|
52
|
+
rowSelection: true,
|
|
53
|
+
rowSpacingType: 'margin',
|
|
54
|
+
showCellVerticalBorder: false,
|
|
55
|
+
showColumnVerticalBorder: false,
|
|
56
|
+
sortingMode: 'client',
|
|
57
|
+
sortingOrder: ['asc', 'desc', null],
|
|
58
|
+
throttleRowsMs: 0,
|
|
59
|
+
unstable_rowSpanning: false
|
|
60
|
+
};
|
|
@@ -625,6 +625,11 @@ export interface GridClasses {
|
|
|
625
625
|
* Styles applied to the toggle of the grouping criteria cell
|
|
626
626
|
*/
|
|
627
627
|
groupingCriteriaCellToggle: string;
|
|
628
|
+
/**
|
|
629
|
+
* Styles applied to the loading container of the grouping cell of the tree data.
|
|
630
|
+
* @ignore - do not document.
|
|
631
|
+
*/
|
|
632
|
+
groupingCriteriaCellLoadingContainer: string;
|
|
628
633
|
/**
|
|
629
634
|
* Styles applied to the pinned rows container.
|
|
630
635
|
*/
|