@mui/x-data-grid 7.0.0-beta.1 → 7.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +159 -1
- package/DataGrid/DataGrid.d.ts +1 -1
- package/DataGrid/DataGrid.js +1 -1
- package/DataGrid/useDataGridProps.js +3 -1
- package/components/GridPagination.d.ts +1 -1
- package/components/GridPagination.js +12 -2
- package/components/GridRow.js +7 -5
- package/components/GridScrollbarFillerCell.js +0 -3
- package/components/base/GridFooterPlaceholder.js +1 -1
- package/components/cell/GridActionsCell.js +3 -3
- package/components/cell/GridActionsCellItem.d.ts +13 -1
- package/components/cell/GridActionsCellItem.js +27 -15
- package/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/columnsManagement/utils.d.ts +1 -1
- package/components/containers/GridRootStyles.js +10 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/constants/gridClasses.d.ts +5 -0
- package/constants/gridClasses.js +1 -1
- package/hooks/features/rows/gridRowsUtils.js +1 -1
- package/hooks/features/rows/useGridRows.js +2 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +9 -10
- package/index.js +1 -1
- package/internals/utils/propValidation.js +1 -1
- package/joy/joySlots.js +2 -2
- package/legacy/DataGrid/DataGrid.js +1 -1
- package/legacy/DataGrid/useDataGridProps.js +3 -1
- package/legacy/components/GridPagination.js +10 -2
- package/legacy/components/GridRow.js +7 -5
- package/legacy/components/GridScrollbarFillerCell.js +1 -3
- package/legacy/components/base/GridFooterPlaceholder.js +1 -1
- package/legacy/components/cell/GridActionsCell.js +3 -3
- package/legacy/components/cell/GridActionsCellItem.js +30 -17
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/legacy/components/containers/GridRootStyles.js +9 -3
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/hooks/features/rows/gridRowsUtils.js +1 -1
- package/legacy/hooks/features/rows/useGridRows.js +2 -2
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +9 -10
- package/legacy/index.js +1 -1
- package/legacy/internals/utils/propValidation.js +1 -1
- package/legacy/joy/joySlots.js +2 -2
- package/legacy/locales/daDK.js +12 -12
- package/locales/daDK.js +12 -12
- package/models/api/gridApiCommon.d.ts +1 -1
- package/models/api/gridFilterApi.d.ts +1 -1
- package/models/api/gridLocaleTextApi.d.ts +3 -3
- package/models/events/gridEventLookup.d.ts +1 -1
- package/models/gridSlotsComponent.d.ts +34 -36
- package/models/gridSlotsComponentsProps.d.ts +73 -54
- package/models/props/DataGridProps.d.ts +2 -2
- package/modern/DataGrid/DataGrid.js +1 -1
- package/modern/DataGrid/useDataGridProps.js +3 -1
- package/modern/components/GridPagination.js +12 -2
- package/modern/components/GridRow.js +6 -5
- package/modern/components/GridScrollbarFillerCell.js +0 -3
- package/modern/components/base/GridFooterPlaceholder.js +1 -1
- package/modern/components/cell/GridActionsCell.js +3 -3
- package/modern/components/cell/GridActionsCellItem.js +27 -15
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/modern/components/containers/GridRootStyles.js +10 -2
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +2 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +9 -10
- package/modern/index.js +1 -1
- package/modern/internals/utils/propValidation.js +1 -1
- package/modern/joy/joySlots.js +2 -2
- package/modern/locales/daDK.js +12 -12
- package/node/DataGrid/DataGrid.js +1 -1
- package/node/DataGrid/useDataGridProps.js +3 -1
- package/node/components/GridPagination.js +12 -2
- package/node/components/GridRow.js +6 -5
- package/node/components/GridScrollbarFillerCell.js +0 -3
- package/node/components/base/GridFooterPlaceholder.js +1 -1
- package/node/components/cell/GridActionsCell.js +3 -3
- package/node/components/cell/GridActionsCellItem.js +27 -15
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/node/components/containers/GridRootStyles.js +10 -2
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/node/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/rows/gridRowsUtils.js +2 -2
- package/node/hooks/features/rows/useGridRows.js +2 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +9 -10
- package/node/index.js +1 -1
- package/node/internals/utils/propValidation.js +1 -1
- package/node/joy/joySlots.js +2 -2
- package/node/locales/daDK.js +12 -12
- package/package.json +2 -2
|
@@ -12,7 +12,7 @@ exports.getMinimalContentHeight = getMinimalContentHeight;
|
|
|
12
12
|
exports.updateCacheWithNewRows = exports.isAutoGeneratedRow = exports.getTreeNodeDescendants = exports.getTopLevelRowCount = exports.getRowsStateFromCache = exports.getRowIdFromRowModel = void 0;
|
|
13
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
14
|
var _gridRowsSelector = require("./gridRowsSelector");
|
|
15
|
-
var
|
|
15
|
+
var _gridDimensionsSelectors = require("../dimensions/gridDimensionsSelectors");
|
|
16
16
|
const GRID_ROOT_GROUP_ID = exports.GRID_ROOT_GROUP_ID = `auto-generated-group-node-root`;
|
|
17
17
|
const GRID_ID_AUTOGENERATED = exports.GRID_ID_AUTOGENERATED = Symbol('mui.id_autogenerated');
|
|
18
18
|
const buildRootGroup = () => ({
|
|
@@ -299,6 +299,6 @@ function calculatePinnedRowsHeight(apiRef) {
|
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
301
|
function getMinimalContentHeight(apiRef) {
|
|
302
|
-
const dimensions = (0,
|
|
302
|
+
const dimensions = (0, _gridDimensionsSelectors.gridDimensionsSelector)(apiRef.current.state);
|
|
303
303
|
return `var(--DataGrid-overlayHeight, ${2 * dimensions.rowHeight}px)`;
|
|
304
304
|
}
|
|
@@ -131,7 +131,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
131
131
|
}, [logger, props.getRowId, props.loading, props.rowCount, throttledRowsChange, apiRef]);
|
|
132
132
|
const updateRows = React.useCallback(updates => {
|
|
133
133
|
if (props.signature === _useGridApiEventHandler.GridSignature.DataGrid && updates.length > 1) {
|
|
134
|
-
throw new Error([
|
|
134
|
+
throw new Error(['MUI X: You cannot update several rows at once in `apiRef.current.updateRows` on the DataGrid.', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
|
|
135
135
|
}
|
|
136
136
|
const nonPinnedRowsUpdates = [];
|
|
137
137
|
updates.forEach(update => {
|
|
@@ -256,7 +256,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
256
256
|
}, [apiRef, logger]);
|
|
257
257
|
const replaceRows = React.useCallback((firstRowToRender, newRows) => {
|
|
258
258
|
if (props.signature === _useGridApiEventHandler.GridSignature.DataGrid && newRows.length > 1) {
|
|
259
|
-
throw new Error([
|
|
259
|
+
throw new Error(['MUI X: You cannot replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
|
|
260
260
|
}
|
|
261
261
|
if (newRows.length === 0) {
|
|
262
262
|
return;
|
|
@@ -57,7 +57,6 @@ const useGridVirtualScroller = () => {
|
|
|
57
57
|
const gridRootRef = apiRef.current.rootElementRef;
|
|
58
58
|
const mainRef = apiRef.current.mainElementRef;
|
|
59
59
|
const scrollerRef = apiRef.current.virtualScrollerRef;
|
|
60
|
-
const renderZoneRef = React.useRef(null);
|
|
61
60
|
const scrollbarVerticalRef = React.useRef(null);
|
|
62
61
|
const scrollbarHorizontalRef = React.useRef(null);
|
|
63
62
|
const contentHeight = dimensions.contentSize.height;
|
|
@@ -255,6 +254,14 @@ const useGridVirtualScroller = () => {
|
|
|
255
254
|
id,
|
|
256
255
|
model
|
|
257
256
|
} = renderedRows[i];
|
|
257
|
+
const rowIndexInPage = (currentPage?.range?.firstRowIndex || 0) + firstRowToRender + i;
|
|
258
|
+
let index = rowIndexOffset + rowIndexInPage;
|
|
259
|
+
if (isRowWithFocusedCellNotInRange && cellFocus?.id === id) {
|
|
260
|
+
index = indexOfRowWithFocusedCell;
|
|
261
|
+
isRowWithFocusedCellRendered = true;
|
|
262
|
+
} else if (isRowWithFocusedCellRendered) {
|
|
263
|
+
index -= 1;
|
|
264
|
+
}
|
|
258
265
|
const isRowNotVisible = isRowWithFocusedCellNotInRange && cellFocus.id === id;
|
|
259
266
|
const baseRowHeight = !apiRef.current.rowHasAutoHeight(id) ? apiRef.current.unstable_getRowHeight(id) : 'auto';
|
|
260
267
|
let isSelected;
|
|
@@ -265,7 +272,7 @@ const useGridVirtualScroller = () => {
|
|
|
265
272
|
}
|
|
266
273
|
let isFirstVisible = false;
|
|
267
274
|
if (params.position === undefined) {
|
|
268
|
-
isFirstVisible =
|
|
275
|
+
isFirstVisible = rowIndexInPage === 0;
|
|
269
276
|
}
|
|
270
277
|
let isLastVisible = false;
|
|
271
278
|
if (isLastSection) {
|
|
@@ -287,13 +294,6 @@ const useGridVirtualScroller = () => {
|
|
|
287
294
|
const cellParams = apiRef.current.getCellParams(id, cellTabIndex.field);
|
|
288
295
|
tabbableCell = cellParams.cellMode === 'view' ? cellTabIndex.field : null;
|
|
289
296
|
}
|
|
290
|
-
let index = rowIndexOffset + (currentPage?.range?.firstRowIndex || 0) + firstRowToRender + i;
|
|
291
|
-
if (isRowWithFocusedCellNotInRange && cellFocus?.id === id) {
|
|
292
|
-
index = indexOfRowWithFocusedCell;
|
|
293
|
-
isRowWithFocusedCellRendered = true;
|
|
294
|
-
} else if (isRowWithFocusedCellRendered) {
|
|
295
|
-
index -= 1;
|
|
296
|
-
}
|
|
297
297
|
rows.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.row, (0, _extends2.default)({
|
|
298
298
|
row: model,
|
|
299
299
|
rowId: id,
|
|
@@ -394,7 +394,6 @@ const useGridVirtualScroller = () => {
|
|
|
394
394
|
role: 'presentation'
|
|
395
395
|
}),
|
|
396
396
|
getRenderZoneProps: () => ({
|
|
397
|
-
ref: renderZoneRef,
|
|
398
397
|
role: 'rowgroup'
|
|
399
398
|
}),
|
|
400
399
|
getScrollbarVerticalProps: () => ({
|
package/node/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.validateProps = exports.propValidatorsDataGrid = void 0;
|
|
7
|
-
const propValidatorsDataGrid = exports.propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You
|
|
7
|
+
const propValidatorsDataGrid = exports.propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined];
|
|
8
8
|
const warnedOnceMap = new Set();
|
|
9
9
|
const warnOnce = message => {
|
|
10
10
|
if (!warnedOnceMap.has(message)) {
|
package/node/joy/joySlots.js
CHANGED
|
@@ -406,8 +406,8 @@ const joySlots = (0, _extends2.default)({}, _icons.default, {
|
|
|
406
406
|
baseSelect: Select,
|
|
407
407
|
baseSelectOption: Option,
|
|
408
408
|
baseInputLabel: InputLabel,
|
|
409
|
-
baseFormControl: _FormControl.default
|
|
410
|
-
baseTooltip: _Tooltip.default
|
|
409
|
+
baseFormControl: _FormControl.default /* FIXME: typing error */,
|
|
410
|
+
baseTooltip: _Tooltip.default /* FIXME: typing error */,
|
|
411
411
|
pagination: Pagination,
|
|
412
412
|
loadingOverlay: LoadingOverlay
|
|
413
413
|
});
|
package/node/locales/daDK.js
CHANGED
|
@@ -17,8 +17,8 @@ const daDKGrid = {
|
|
|
17
17
|
toolbarDensityStandard: 'Standard',
|
|
18
18
|
toolbarDensityComfortable: 'Luftig',
|
|
19
19
|
// Columns selector toolbar button text
|
|
20
|
-
toolbarColumns: '
|
|
21
|
-
toolbarColumnsLabel: 'Vælg
|
|
20
|
+
toolbarColumns: 'Kolonner',
|
|
21
|
+
toolbarColumnsLabel: 'Vælg kolonner',
|
|
22
22
|
// Filters toolbar button text
|
|
23
23
|
toolbarFilters: 'Filtre',
|
|
24
24
|
toolbarFiltersLabel: 'Vis filtre',
|
|
@@ -45,12 +45,12 @@ const daDKGrid = {
|
|
|
45
45
|
filterPanelRemoveAll: 'Fjern alle',
|
|
46
46
|
filterPanelDeleteIconLabel: 'Slet',
|
|
47
47
|
filterPanelLogicOperator: 'Logisk operator',
|
|
48
|
-
filterPanelOperator: '
|
|
48
|
+
filterPanelOperator: 'Operator',
|
|
49
49
|
filterPanelOperatorAnd: 'Og',
|
|
50
50
|
filterPanelOperatorOr: 'Eller',
|
|
51
|
-
filterPanelColumns: '
|
|
51
|
+
filterPanelColumns: 'Kolonner',
|
|
52
52
|
filterPanelInputLabel: 'Værdi',
|
|
53
|
-
filterPanelInputPlaceholder: '
|
|
53
|
+
filterPanelInputPlaceholder: 'Filterværdi',
|
|
54
54
|
// Filter operators text
|
|
55
55
|
filterOperatorContains: 'indeholder',
|
|
56
56
|
filterOperatorEquals: 'lig med',
|
|
@@ -97,10 +97,10 @@ const daDKGrid = {
|
|
|
97
97
|
filterValueFalse: 'negativ',
|
|
98
98
|
// Column menu text
|
|
99
99
|
columnMenuLabel: 'Menu',
|
|
100
|
-
columnMenuShowColumns: 'Vis
|
|
100
|
+
columnMenuShowColumns: 'Vis kolonner',
|
|
101
101
|
columnMenuManageColumns: 'Administrer kolonner',
|
|
102
|
-
columnMenuFilter: '
|
|
103
|
-
columnMenuHideColumn: 'Skjul',
|
|
102
|
+
columnMenuFilter: 'Filtrer',
|
|
103
|
+
columnMenuHideColumn: 'Skjul kolonne',
|
|
104
104
|
columnMenuUnsort: 'Fjern sortering',
|
|
105
105
|
columnMenuSortAsc: 'Sorter stigende',
|
|
106
106
|
columnMenuSortDesc: 'Sorter faldende',
|
|
@@ -130,13 +130,13 @@ const daDKGrid = {
|
|
|
130
130
|
pinToRight: 'Fastgør til højre',
|
|
131
131
|
unpin: 'Frigiv',
|
|
132
132
|
// Tree Data
|
|
133
|
-
treeDataGroupingHeaderName: '
|
|
133
|
+
treeDataGroupingHeaderName: 'Gruppe',
|
|
134
134
|
treeDataExpand: 'Vis underelementer',
|
|
135
135
|
treeDataCollapse: 'Skjul underelementer',
|
|
136
136
|
// Grouping columns
|
|
137
|
-
groupingColumnHeaderName: '
|
|
137
|
+
groupingColumnHeaderName: 'Gruppe',
|
|
138
138
|
groupColumn: name => `Gruppér efter ${name}`,
|
|
139
|
-
unGroupColumn: name => `Fjern
|
|
139
|
+
unGroupColumn: name => `Fjern gruppering efter ${name}`,
|
|
140
140
|
// Master/detail
|
|
141
141
|
detailPanelToggle: 'Udvid/kollaps detaljepanel',
|
|
142
142
|
expandDetailPanel: 'Udvid',
|
|
@@ -144,7 +144,7 @@ const daDKGrid = {
|
|
|
144
144
|
// Row reordering text
|
|
145
145
|
rowReorderingHeaderName: 'Omarrangering af rækker',
|
|
146
146
|
// Aggregation
|
|
147
|
-
aggregationMenuItemHeader: '
|
|
147
|
+
aggregationMenuItemHeader: 'Aggregering',
|
|
148
148
|
aggregationFunctionLabelSum: 'sum',
|
|
149
149
|
aggregationFunctionLabelAvg: 'gns',
|
|
150
150
|
aggregationFunctionLabelMin: 'min',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.2",
|
|
4
4
|
"description": "The community edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|
|
35
35
|
"url": "https://github.com/mui/mui-x.git",
|
|
36
|
-
"directory": "packages/
|
|
36
|
+
"directory": "packages/x-data-grid"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@babel/runtime": "^7.23.9",
|