@mui/x-data-grid 5.14.0 → 5.15.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 +147 -5
- package/DataGrid/DataGrid.js +7 -1
- package/DataGrid/useDataGridProps.js +1 -0
- package/colDef/gridStringColDef.js +1 -1
- package/components/GridRow.js +5 -1
- package/components/base/GridOverlays.js +2 -2
- package/components/cell/GridEditInputCell.d.ts +2 -5
- package/components/cell/GridEditInputCell.js +13 -14
- package/components/cell/GridEditSingleSelectCell.d.ts +4 -0
- package/components/cell/GridEditSingleSelectCell.js +11 -4
- package/components/columnSelection/GridCellCheckboxRenderer.js +5 -0
- package/components/containers/GridRoot.js +4 -2
- package/components/toolbar/GridToolbarDensitySelector.js +13 -4
- package/components/toolbar/GridToolbarExportContainer.js +13 -2
- package/constants/envConstants.d.ts +1 -1
- package/constants/envConstants.js +2 -11
- package/constants/gridClasses.d.ts +16 -0
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +6 -1
- package/hooks/features/editRows/useGridCellEditing.new.d.ts +1 -1
- package/hooks/features/editRows/useGridCellEditing.new.js +26 -16
- package/hooks/features/editRows/useGridCellEditing.old.js +2 -2
- package/hooks/features/editRows/useGridEditing.new.d.ts +1 -1
- package/hooks/features/editRows/useGridEditing.new.js +4 -0
- package/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/hooks/features/editRows/useGridRowEditing.new.d.ts +1 -1
- package/hooks/features/editRows/useGridRowEditing.new.js +16 -10
- package/hooks/features/export/utils.js +8 -1
- package/hooks/features/filter/gridFilterState.d.ts +12 -1
- package/hooks/features/filter/gridFilterUtils.d.ts +8 -5
- package/hooks/features/filter/gridFilterUtils.js +74 -43
- package/hooks/features/filter/useGridFilter.js +16 -3
- package/hooks/features/focus/useGridFocus.js +11 -6
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +42 -34
- package/hooks/features/pagination/useGridPageSize.js +3 -1
- package/hooks/features/rows/gridRowsSelector.d.ts +14 -0
- package/hooks/features/rows/gridRowsSelector.js +20 -1
- package/hooks/features/rows/gridRowsState.d.ts +8 -1
- package/hooks/features/rows/gridRowsUtils.d.ts +4 -0
- package/hooks/features/rows/gridRowsUtils.js +21 -3
- package/hooks/features/rows/index.d.ts +1 -1
- package/hooks/features/rows/index.js +1 -1
- package/hooks/features/rows/useGridRows.js +5 -2
- package/hooks/features/rows/useGridRowsMeta.js +19 -4
- package/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
- package/hooks/features/scroll/useGridScroll.js +7 -2
- package/hooks/features/selection/useGridSelection.js +7 -3
- package/hooks/features/sorting/useGridSorting.js +8 -0
- package/hooks/features/statePersistence/gridStatePersistenceInterface.d.ts +3 -0
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +31 -16
- package/index.js +1 -1
- package/internals/index.d.ts +5 -1
- package/internals/index.js +4 -0
- package/legacy/DataGrid/DataGrid.js +7 -1
- package/legacy/DataGrid/useDataGridProps.js +1 -0
- package/legacy/colDef/gridStringColDef.js +1 -1
- package/legacy/components/GridRow.js +5 -1
- package/legacy/components/base/GridOverlays.js +2 -2
- package/legacy/components/cell/GridEditInputCell.js +13 -14
- package/legacy/components/cell/GridEditSingleSelectCell.js +11 -3
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +5 -0
- package/legacy/components/containers/GridRoot.js +4 -2
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +14 -5
- package/legacy/components/toolbar/GridToolbarExportContainer.js +15 -2
- package/legacy/constants/envConstants.js +2 -11
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/constants/localeTextConstants.js +1 -1
- package/legacy/hooks/features/dimensions/useGridDimensions.js +6 -1
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +27 -17
- package/legacy/hooks/features/editRows/useGridCellEditing.old.js +2 -2
- package/legacy/hooks/features/editRows/useGridEditing.new.js +4 -0
- package/legacy/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +16 -10
- package/legacy/hooks/features/export/utils.js +13 -1
- package/legacy/hooks/features/filter/gridFilterUtils.js +84 -55
- package/legacy/hooks/features/filter/useGridFilter.js +16 -3
- package/legacy/hooks/features/focus/useGridFocus.js +11 -6
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +47 -34
- package/legacy/hooks/features/pagination/useGridPageSize.js +3 -1
- package/legacy/hooks/features/rows/gridRowsSelector.js +23 -0
- package/legacy/hooks/features/rows/gridRowsUtils.js +21 -3
- package/legacy/hooks/features/rows/index.js +1 -1
- package/legacy/hooks/features/rows/useGridRows.js +5 -2
- package/legacy/hooks/features/rows/useGridRowsMeta.js +19 -4
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
- package/legacy/hooks/features/scroll/useGridScroll.js +7 -2
- package/legacy/hooks/features/selection/useGridSelection.js +7 -3
- package/legacy/hooks/features/sorting/useGridSorting.js +8 -0
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +32 -16
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +4 -0
- package/legacy/locales/arSD.js +1 -1
- package/legacy/locales/bgBG.js +1 -1
- package/legacy/locales/csCZ.js +1 -1
- package/legacy/locales/daDK.js +1 -1
- package/legacy/locales/deDE.js +9 -9
- package/legacy/locales/elGR.js +1 -1
- package/legacy/locales/esES.js +1 -1
- package/legacy/locales/faIR.js +1 -1
- package/legacy/locales/fiFI.js +1 -1
- package/legacy/locales/frFR.js +1 -1
- package/legacy/locales/heIL.js +1 -1
- package/legacy/locales/huHU.js +1 -1
- package/legacy/locales/itIT.js +15 -15
- package/legacy/locales/jaJP.js +3 -3
- package/legacy/locales/koKR.js +34 -30
- package/legacy/locales/nbNO.js +1 -1
- package/legacy/locales/nlNL.js +1 -1
- package/legacy/locales/plPL.js +1 -1
- package/legacy/locales/ptBR.js +1 -1
- package/legacy/locales/roRO.js +1 -1
- package/legacy/locales/ruRU.js +1 -1
- package/legacy/locales/skSK.js +1 -1
- package/legacy/locales/svSE.js +1 -1
- package/legacy/locales/trTR.js +1 -1
- package/legacy/locales/ukUA.js +1 -1
- package/legacy/locales/viVN.js +1 -1
- package/legacy/locales/zhCN.js +37 -33
- package/legacy/locales/zhTW.js +1 -1
- package/legacy/utils/keyboardUtils.js +8 -5
- package/locales/arSD.js +1 -1
- package/locales/bgBG.js +1 -1
- package/locales/csCZ.js +1 -1
- package/locales/daDK.js +1 -1
- package/locales/deDE.js +9 -9
- package/locales/elGR.js +1 -1
- package/locales/esES.js +1 -1
- package/locales/faIR.js +1 -1
- package/locales/fiFI.js +1 -1
- package/locales/frFR.js +1 -1
- package/locales/heIL.js +1 -1
- package/locales/huHU.js +1 -1
- package/locales/itIT.js +15 -15
- package/locales/jaJP.js +3 -3
- package/locales/koKR.js +30 -30
- package/locales/nbNO.js +1 -1
- package/locales/nlNL.js +1 -1
- package/locales/plPL.js +1 -1
- package/locales/ptBR.js +1 -1
- package/locales/roRO.js +1 -1
- package/locales/ruRU.js +1 -1
- package/locales/skSK.js +1 -1
- package/locales/svSE.js +1 -1
- package/locales/trTR.js +1 -1
- package/locales/ukUA.js +1 -1
- package/locales/viVN.js +1 -1
- package/locales/zhCN.js +33 -33
- package/locales/zhTW.js +1 -1
- package/models/gridRows.d.ts +5 -0
- package/models/props/DataGridProps.d.ts +8 -3
- package/modern/DataGrid/DataGrid.js +7 -1
- package/modern/DataGrid/useDataGridProps.js +1 -0
- package/modern/colDef/gridStringColDef.js +1 -1
- package/modern/components/GridRow.js +5 -1
- package/modern/components/base/GridOverlays.js +2 -2
- package/modern/components/cell/GridEditInputCell.js +13 -14
- package/modern/components/cell/GridEditSingleSelectCell.js +11 -4
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +5 -0
- package/modern/components/containers/GridRoot.js +4 -2
- package/modern/components/toolbar/GridToolbarDensitySelector.js +11 -4
- package/modern/components/toolbar/GridToolbarExportContainer.js +11 -2
- package/modern/constants/envConstants.js +2 -11
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +1 -1
- package/modern/hooks/features/dimensions/useGridDimensions.js +6 -1
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +24 -16
- package/modern/hooks/features/editRows/useGridCellEditing.old.js +2 -2
- package/modern/hooks/features/editRows/useGridEditing.new.js +4 -0
- package/modern/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +16 -10
- package/modern/hooks/features/export/utils.js +6 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +73 -42
- package/modern/hooks/features/filter/useGridFilter.js +16 -3
- package/modern/hooks/features/focus/useGridFocus.js +11 -6
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +42 -30
- package/modern/hooks/features/pagination/useGridPageSize.js +3 -1
- package/modern/hooks/features/rows/gridRowsSelector.js +18 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +19 -3
- package/modern/hooks/features/rows/index.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +5 -2
- package/modern/hooks/features/rows/useGridRowsMeta.js +17 -4
- package/modern/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
- package/modern/hooks/features/scroll/useGridScroll.js +5 -2
- package/modern/hooks/features/selection/useGridSelection.js +7 -1
- package/modern/hooks/features/sorting/useGridSorting.js +8 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +30 -15
- package/modern/index.js +1 -1
- package/modern/internals/index.js +4 -0
- package/modern/locales/arSD.js +1 -1
- package/modern/locales/bgBG.js +1 -1
- package/modern/locales/csCZ.js +1 -1
- package/modern/locales/daDK.js +1 -1
- package/modern/locales/deDE.js +9 -9
- package/modern/locales/elGR.js +1 -1
- package/modern/locales/esES.js +1 -1
- package/modern/locales/faIR.js +1 -1
- package/modern/locales/fiFI.js +1 -1
- package/modern/locales/frFR.js +1 -1
- package/modern/locales/heIL.js +1 -1
- package/modern/locales/huHU.js +1 -1
- package/modern/locales/itIT.js +15 -15
- package/modern/locales/jaJP.js +3 -3
- package/modern/locales/koKR.js +30 -30
- package/modern/locales/nbNO.js +1 -1
- package/modern/locales/nlNL.js +1 -1
- package/modern/locales/plPL.js +1 -1
- package/modern/locales/ptBR.js +1 -1
- package/modern/locales/roRO.js +1 -1
- package/modern/locales/ruRU.js +1 -1
- package/modern/locales/skSK.js +1 -1
- package/modern/locales/svSE.js +1 -1
- package/modern/locales/trTR.js +1 -1
- package/modern/locales/ukUA.js +1 -1
- package/modern/locales/viVN.js +1 -1
- package/modern/locales/zhCN.js +33 -33
- package/modern/locales/zhTW.js +1 -1
- package/modern/utils/keyboardUtils.js +7 -2
- package/node/DataGrid/DataGrid.js +7 -1
- package/node/DataGrid/useDataGridProps.js +1 -0
- package/node/colDef/gridStringColDef.js +1 -1
- package/node/components/GridRow.js +5 -1
- package/node/components/base/GridOverlays.js +2 -2
- package/node/components/cell/GridEditInputCell.js +15 -16
- package/node/components/cell/GridEditSingleSelectCell.js +10 -4
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +5 -0
- package/node/components/containers/GridRoot.js +3 -1
- package/node/components/toolbar/GridToolbarDensitySelector.js +13 -4
- package/node/components/toolbar/GridToolbarExportContainer.js +13 -2
- package/node/constants/envConstants.js +2 -13
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +1 -1
- package/node/hooks/features/dimensions/useGridDimensions.js +7 -1
- package/node/hooks/features/editRows/useGridCellEditing.new.js +26 -16
- package/node/hooks/features/editRows/useGridCellEditing.old.js +2 -2
- package/node/hooks/features/editRows/useGridEditing.new.js +4 -0
- package/node/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/node/hooks/features/editRows/useGridRowEditing.new.js +16 -10
- package/node/hooks/features/export/utils.js +7 -0
- package/node/hooks/features/filter/gridFilterUtils.js +81 -47
- package/node/hooks/features/filter/useGridFilter.js +15 -2
- package/node/hooks/features/focus/useGridFocus.js +11 -6
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +43 -34
- package/node/hooks/features/pagination/useGridPageSize.js +4 -1
- package/node/hooks/features/rows/gridRowsSelector.js +24 -2
- package/node/hooks/features/rows/gridRowsUtils.js +23 -2
- package/node/hooks/features/rows/index.js +70 -12
- package/node/hooks/features/rows/useGridRows.js +5 -2
- package/node/hooks/features/rows/useGridRowsMeta.js +20 -4
- package/node/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
- package/node/hooks/features/scroll/useGridScroll.js +7 -1
- package/node/hooks/features/selection/useGridSelection.js +7 -3
- package/node/hooks/features/sorting/useGridSorting.js +8 -0
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +31 -16
- package/node/index.js +1 -1
- package/node/internals/index.js +36 -0
- package/node/locales/arSD.js +1 -1
- package/node/locales/bgBG.js +1 -1
- package/node/locales/csCZ.js +1 -1
- package/node/locales/daDK.js +1 -1
- package/node/locales/deDE.js +9 -9
- package/node/locales/elGR.js +1 -1
- package/node/locales/esES.js +1 -1
- package/node/locales/faIR.js +1 -1
- package/node/locales/fiFI.js +1 -1
- package/node/locales/frFR.js +1 -1
- package/node/locales/heIL.js +1 -1
- package/node/locales/huHU.js +1 -1
- package/node/locales/itIT.js +15 -15
- package/node/locales/jaJP.js +3 -3
- package/node/locales/koKR.js +30 -30
- package/node/locales/nbNO.js +1 -1
- package/node/locales/nlNL.js +1 -1
- package/node/locales/plPL.js +1 -1
- package/node/locales/ptBR.js +1 -1
- package/node/locales/roRO.js +1 -1
- package/node/locales/ruRU.js +1 -1
- package/node/locales/skSK.js +1 -1
- package/node/locales/svSE.js +1 -1
- package/node/locales/trTR.js +1 -1
- package/node/locales/ukUA.js +1 -1
- package/node/locales/viVN.js +1 -1
- package/node/locales/zhCN.js +33 -33
- package/node/locales/zhTW.js +1 -1
- package/node/utils/keyboardUtils.js +10 -4
- package/package.json +1 -1
- package/utils/keyboardUtils.d.ts +2 -2
- package/utils/keyboardUtils.js +7 -2
|
@@ -170,10 +170,8 @@ export const useGridVirtualScroller = props => {
|
|
|
170
170
|
React.useEffect(() => {
|
|
171
171
|
setContainerWidth(rootRef.current.clientWidth);
|
|
172
172
|
}, [rowsMeta.currentPageTotalHeight]);
|
|
173
|
-
const handleResize = React.useCallback(
|
|
174
|
-
|
|
175
|
-
setContainerWidth(rootRef.current.clientWidth);
|
|
176
|
-
}
|
|
173
|
+
const handleResize = React.useCallback(params => {
|
|
174
|
+
setContainerWidth(params.width);
|
|
177
175
|
}, []);
|
|
178
176
|
useGridApiEventHandler(apiRef, 'resize', handleResize);
|
|
179
177
|
const updateRenderZonePosition = React.useCallback(nextRenderContext => {
|
|
@@ -289,10 +287,11 @@ export const useGridVirtualScroller = props => {
|
|
|
289
287
|
minFirstColumn = renderZoneMinColumnIndex,
|
|
290
288
|
maxLastColumn = renderZoneMaxColumnIndex,
|
|
291
289
|
availableSpace = containerWidth,
|
|
292
|
-
ignoreAutoHeight
|
|
290
|
+
ignoreAutoHeight,
|
|
291
|
+
rowIndexOffset = 0
|
|
293
292
|
} = params;
|
|
294
293
|
|
|
295
|
-
if (!
|
|
294
|
+
if (!nextRenderContext || availableSpace == null) {
|
|
296
295
|
return null;
|
|
297
296
|
}
|
|
298
297
|
|
|
@@ -307,15 +306,31 @@ export const useGridVirtualScroller = props => {
|
|
|
307
306
|
});
|
|
308
307
|
const renderedRows = [];
|
|
309
308
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
309
|
+
if (params.rows) {
|
|
310
|
+
params.rows.forEach(row => {
|
|
311
|
+
renderedRows.push(row);
|
|
312
|
+
apiRef.current.unstable_calculateColSpan({
|
|
313
|
+
rowId: row.id,
|
|
314
|
+
minFirstColumn,
|
|
315
|
+
maxLastColumn,
|
|
316
|
+
columns: visibleColumns
|
|
317
|
+
});
|
|
318
318
|
});
|
|
319
|
+
} else {
|
|
320
|
+
if (!currentPage.range) {
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
for (let i = firstRowToRender; i < lastRowToRender; i += 1) {
|
|
325
|
+
const row = currentPage.rows[i];
|
|
326
|
+
renderedRows.push(row);
|
|
327
|
+
apiRef.current.unstable_calculateColSpan({
|
|
328
|
+
rowId: row.id,
|
|
329
|
+
minFirstColumn,
|
|
330
|
+
maxLastColumn,
|
|
331
|
+
columns: visibleColumns
|
|
332
|
+
});
|
|
333
|
+
}
|
|
319
334
|
}
|
|
320
335
|
|
|
321
336
|
const [initialFirstColumnToRender, lastColumnToRender] = getRenderableIndexes({
|
|
@@ -336,7 +351,7 @@ export const useGridVirtualScroller = props => {
|
|
|
336
351
|
const rows = [];
|
|
337
352
|
|
|
338
353
|
for (let i = 0; i < renderedRows.length; i += 1) {
|
|
339
|
-
var _rootProps$components;
|
|
354
|
+
var _currentPage$range5, _rootProps$components;
|
|
340
355
|
|
|
341
356
|
const {
|
|
342
357
|
id,
|
|
@@ -367,7 +382,7 @@ export const useGridVirtualScroller = props => {
|
|
|
367
382
|
firstColumnToRender: firstColumnToRender,
|
|
368
383
|
lastColumnToRender: lastColumnToRender,
|
|
369
384
|
selected: isSelected,
|
|
370
|
-
index: currentPage.range.firstRowIndex + firstRowToRender + i,
|
|
385
|
+
index: rowIndexOffset + ((currentPage == null ? void 0 : (_currentPage$range5 = currentPage.range) == null ? void 0 : _currentPage$range5.firstRowIndex) || 0) + firstRowToRender + i,
|
|
371
386
|
containerWidth: availableSpace,
|
|
372
387
|
isLastVisible: lastVisibleRowIndex
|
|
373
388
|
}, typeof getRowProps === 'function' ? getRowProps(id, model) : {}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.row), id));
|
package/index.js
CHANGED
package/internals/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { useGridDensity, densityStateInitializer } from '../hooks/features/densi
|
|
|
18
18
|
export { useGridCsvExport } from '../hooks/features/export/useGridCsvExport';
|
|
19
19
|
export { useGridPrintExport } from '../hooks/features/export/useGridPrintExport';
|
|
20
20
|
export { useGridFilter, filterStateInitializer } from '../hooks/features/filter/useGridFilter';
|
|
21
|
+
export { passFilterLogic } from '../hooks/features/filter/gridFilterUtils';
|
|
21
22
|
export type { GridAggregatedFilterItemApplier } from '../hooks/features/filter/gridFilterState';
|
|
22
23
|
export { useGridFocus, focusStateInitializer } from '../hooks/features/focus/useGridFocus';
|
|
23
24
|
export { useGridKeyboardNavigation } from '../hooks/features/keyboardNavigation/useGridKeyboardNavigation';
|
|
@@ -27,9 +28,12 @@ export { useGridEditing as useGridEditing_new, editingStateInitializer as editin
|
|
|
27
28
|
export { useGridEditing as useGridEditing_old, editingStateInitializer as editingStateInitializer_old, } from '../hooks/features/editRows/useGridEditing.old';
|
|
28
29
|
export { useGridRows, rowsStateInitializer } from '../hooks/features/rows/useGridRows';
|
|
29
30
|
export { useGridRowsPreProcessors } from '../hooks/features/rows/useGridRowsPreProcessors';
|
|
30
|
-
export type { GridRowTreeCreationParams, GridRowTreeCreationValue, } from '../hooks/features/rows/gridRowsState';
|
|
31
|
+
export type { GridRowTreeCreationParams, GridRowTreeCreationValue, GridHydrateRowsValue, GridPinnedRowsState, } from '../hooks/features/rows/gridRowsState';
|
|
31
32
|
export { useGridRowsMeta, rowsMetaStateInitializer } from '../hooks/features/rows/useGridRowsMeta';
|
|
32
33
|
export { useGridParamsApi } from '../hooks/features/rows/useGridParamsApi';
|
|
34
|
+
export { getRowIdFromRowModel } from '../hooks/features/rows/gridRowsUtils';
|
|
35
|
+
export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector, } from '../hooks/features/rows/gridRowsSelector';
|
|
36
|
+
export { calculatePinnedRowsHeight } from '../hooks/features/rows/gridRowsUtils';
|
|
33
37
|
export { useGridSelection, selectionStateInitializer, } from '../hooks/features/selection/useGridSelection';
|
|
34
38
|
export { useGridSelectionPreProcessors } from '../hooks/features/selection/useGridSelectionPreProcessors';
|
|
35
39
|
export { useGridSorting, sortingStateInitializer } from '../hooks/features/sorting/useGridSorting';
|
package/internals/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export { useGridDensity, densityStateInitializer } from '../hooks/features/densi
|
|
|
15
15
|
export { useGridCsvExport } from '../hooks/features/export/useGridCsvExport';
|
|
16
16
|
export { useGridPrintExport } from '../hooks/features/export/useGridPrintExport';
|
|
17
17
|
export { useGridFilter, filterStateInitializer } from '../hooks/features/filter/useGridFilter';
|
|
18
|
+
export { passFilterLogic } from '../hooks/features/filter/gridFilterUtils';
|
|
18
19
|
export { useGridFocus, focusStateInitializer } from '../hooks/features/focus/useGridFocus';
|
|
19
20
|
export { useGridKeyboardNavigation } from '../hooks/features/keyboardNavigation/useGridKeyboardNavigation';
|
|
20
21
|
export { useGridPagination, paginationStateInitializer } from '../hooks/features/pagination/useGridPagination';
|
|
@@ -25,6 +26,9 @@ export { useGridRows, rowsStateInitializer } from '../hooks/features/rows/useGri
|
|
|
25
26
|
export { useGridRowsPreProcessors } from '../hooks/features/rows/useGridRowsPreProcessors';
|
|
26
27
|
export { useGridRowsMeta, rowsMetaStateInitializer } from '../hooks/features/rows/useGridRowsMeta';
|
|
27
28
|
export { useGridParamsApi } from '../hooks/features/rows/useGridParamsApi';
|
|
29
|
+
export { getRowIdFromRowModel } from '../hooks/features/rows/gridRowsUtils';
|
|
30
|
+
export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector } from '../hooks/features/rows/gridRowsSelector';
|
|
31
|
+
export { calculatePinnedRowsHeight } from '../hooks/features/rows/gridRowsUtils';
|
|
28
32
|
export { useGridSelection, selectionStateInitializer } from '../hooks/features/selection/useGridSelection';
|
|
29
33
|
export { useGridSelectionPreProcessors } from '../hooks/features/selection/useGridSelectionPreProcessors';
|
|
30
34
|
export { useGridSorting, sortingStateInitializer } from '../hooks/features/sorting/useGridSorting';
|
|
@@ -157,6 +157,12 @@ DataGridRaw.propTypes = {
|
|
|
157
157
|
*/
|
|
158
158
|
disableExtendRowFullWidth: PropTypes.bool,
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* If `true`, modification to a cell will not be discarded if the mode is changed from "edit" to "view" while processing props.
|
|
162
|
+
* @default false
|
|
163
|
+
*/
|
|
164
|
+
disableIgnoreModificationsIfProcessingProps: PropTypes.bool,
|
|
165
|
+
|
|
160
166
|
/**
|
|
161
167
|
* If `true`, the selection on click on a row or cell is disabled.
|
|
162
168
|
* @default false
|
|
@@ -641,7 +647,7 @@ DataGridRaw.propTypes = {
|
|
|
641
647
|
* @param {GridState} state The new state.
|
|
642
648
|
* @param {MuiEvent<{}>} event The event object.
|
|
643
649
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
644
|
-
* @
|
|
650
|
+
* @ignore - do not document.
|
|
645
651
|
*/
|
|
646
652
|
onStateChange: PropTypes.func,
|
|
647
653
|
|
|
@@ -42,6 +42,7 @@ export var DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
42
42
|
disableMultipleColumnsSorting: false,
|
|
43
43
|
disableSelectionOnClick: false,
|
|
44
44
|
disableVirtualization: false,
|
|
45
|
+
disableIgnoreModificationsIfProcessingProps: false,
|
|
45
46
|
editMode: GridEditModes.Cell,
|
|
46
47
|
filterMode: GridFeatureModeConstant.client,
|
|
47
48
|
headerHeight: 56,
|
|
@@ -120,7 +120,11 @@ function GridRow(props) {
|
|
|
120
120
|
// doesn't care about pagination and considers the rows from the current page only, so the
|
|
121
121
|
// first row always has index=0. We need to subtract the index of the first row to make it
|
|
122
122
|
// compatible with the index used by the virtualization.
|
|
123
|
-
apiRef.current.
|
|
123
|
+
var rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(rowId); // pinned rows are not part of the visible rows
|
|
124
|
+
|
|
125
|
+
if (rowIndex != null) {
|
|
126
|
+
apiRef.current.unstable_setLastMeasuredRowIndex(rowIndex);
|
|
127
|
+
}
|
|
124
128
|
}
|
|
125
129
|
|
|
126
130
|
var rootElement = ref.current;
|
|
@@ -51,8 +51,8 @@ function GridOverlayWrapper(props) {
|
|
|
51
51
|
position: 'absolute',
|
|
52
52
|
top: headerHeight,
|
|
53
53
|
bottom: height === 'auto' ? 0 : undefined,
|
|
54
|
-
zIndex:
|
|
55
|
-
// should be above pinned columns and detail panel
|
|
54
|
+
zIndex: 4,
|
|
55
|
+
// should be above pinned columns, pinned rows and detail panel
|
|
56
56
|
pointerEvents: 'none'
|
|
57
57
|
}
|
|
58
58
|
}, props));
|
|
@@ -41,8 +41,7 @@ var GridEditInputCellRoot = styled(InputBase, {
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
|
-
|
|
45
|
-
function GridEditInputCell(props) {
|
|
44
|
+
var GridEditInputCell = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
46
45
|
var _rootProps$experiment;
|
|
47
46
|
|
|
48
47
|
var rootProps = useGridRootProps();
|
|
@@ -126,6 +125,7 @@ function GridEditInputCell(props) {
|
|
|
126
125
|
}
|
|
127
126
|
}, [hasFocus]);
|
|
128
127
|
return /*#__PURE__*/_jsx(GridEditInputCellRoot, _extends({
|
|
128
|
+
ref: ref,
|
|
129
129
|
inputRef: inputRef,
|
|
130
130
|
className: classes.root,
|
|
131
131
|
fullWidth: true,
|
|
@@ -134,8 +134,7 @@ function GridEditInputCell(props) {
|
|
|
134
134
|
onChange: handleChange,
|
|
135
135
|
endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(GridLoadIcon, {}) : undefined
|
|
136
136
|
}, other));
|
|
137
|
-
}
|
|
138
|
-
|
|
137
|
+
});
|
|
139
138
|
process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
140
139
|
// ----------------------------- Warning --------------------------------
|
|
141
140
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -146,23 +145,23 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
146
145
|
* GridApi that let you manipulate the grid.
|
|
147
146
|
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
148
147
|
*/
|
|
149
|
-
api: PropTypes.any
|
|
148
|
+
api: PropTypes.any,
|
|
150
149
|
|
|
151
150
|
/**
|
|
152
151
|
* The mode of the cell.
|
|
153
152
|
*/
|
|
154
|
-
cellMode: PropTypes.oneOf(['edit', 'view'])
|
|
153
|
+
cellMode: PropTypes.oneOf(['edit', 'view']),
|
|
155
154
|
|
|
156
155
|
/**
|
|
157
156
|
* The column of the row that the current cell belongs to.
|
|
158
157
|
*/
|
|
159
|
-
colDef: PropTypes.object
|
|
158
|
+
colDef: PropTypes.object,
|
|
160
159
|
debounceMs: PropTypes.number,
|
|
161
160
|
|
|
162
161
|
/**
|
|
163
162
|
* The column field of the cell that triggered the event.
|
|
164
163
|
*/
|
|
165
|
-
field: PropTypes.string
|
|
164
|
+
field: PropTypes.string,
|
|
166
165
|
|
|
167
166
|
/**
|
|
168
167
|
* The cell value formatted with the column valueFormatter.
|
|
@@ -176,17 +175,17 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
176
175
|
* @returns {any} The cell value.
|
|
177
176
|
* @deprecated Use `params.row` to directly access the fields you want instead.
|
|
178
177
|
*/
|
|
179
|
-
getValue: PropTypes.func
|
|
178
|
+
getValue: PropTypes.func,
|
|
180
179
|
|
|
181
180
|
/**
|
|
182
181
|
* If true, the cell is the active element.
|
|
183
182
|
*/
|
|
184
|
-
hasFocus: PropTypes.bool
|
|
183
|
+
hasFocus: PropTypes.bool,
|
|
185
184
|
|
|
186
185
|
/**
|
|
187
186
|
* The grid row id.
|
|
188
187
|
*/
|
|
189
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
188
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
190
189
|
|
|
191
190
|
/**
|
|
192
191
|
* If true, the cell is editable.
|
|
@@ -206,17 +205,17 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
206
205
|
/**
|
|
207
206
|
* The row model of the row that the current cell belongs to.
|
|
208
207
|
*/
|
|
209
|
-
row: PropTypes.object
|
|
208
|
+
row: PropTypes.object,
|
|
210
209
|
|
|
211
210
|
/**
|
|
212
211
|
* The node of the row that the current cell belongs to.
|
|
213
212
|
*/
|
|
214
|
-
rowNode: PropTypes.object
|
|
213
|
+
rowNode: PropTypes.object,
|
|
215
214
|
|
|
216
215
|
/**
|
|
217
216
|
* the tabIndex value.
|
|
218
217
|
*/
|
|
219
|
-
tabIndex: PropTypes.oneOf([-1, 0])
|
|
218
|
+
tabIndex: PropTypes.oneOf([-1, 0]),
|
|
220
219
|
|
|
221
220
|
/**
|
|
222
221
|
* The cell value, but if the column has valueGetter, use getValue.
|
|
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
6
|
-
var _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange"];
|
|
6
|
+
var _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange", "initialOpen"];
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
@@ -30,6 +30,8 @@ var renderSingleSelectOptions = function renderSingleSelectOptions(option, Optio
|
|
|
30
30
|
function GridEditSingleSelectCell(props) {
|
|
31
31
|
var _rootProps$components, _baseSelectProps$nati, _rootProps$components2;
|
|
32
32
|
|
|
33
|
+
var rootProps = useGridRootProps();
|
|
34
|
+
|
|
33
35
|
var id = props.id,
|
|
34
36
|
value = props.value,
|
|
35
37
|
formattedValue = props.formattedValue,
|
|
@@ -48,14 +50,15 @@ function GridEditSingleSelectCell(props) {
|
|
|
48
50
|
isProcessingProps = props.isProcessingProps,
|
|
49
51
|
error = props.error,
|
|
50
52
|
onValueChange = props.onValueChange,
|
|
53
|
+
_props$initialOpen = props.initialOpen,
|
|
54
|
+
initialOpen = _props$initialOpen === void 0 ? rootProps.editMode === GridEditModes.Cell : _props$initialOpen,
|
|
51
55
|
other = _objectWithoutProperties(props, _excluded);
|
|
52
56
|
|
|
53
57
|
var apiRef = useGridApiContext();
|
|
54
58
|
var ref = React.useRef();
|
|
55
59
|
var inputRef = React.useRef();
|
|
56
|
-
var rootProps = useGridRootProps();
|
|
57
60
|
|
|
58
|
-
var _React$useState = React.useState(
|
|
61
|
+
var _React$useState = React.useState(initialOpen),
|
|
59
62
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
60
63
|
open = _React$useState2[0],
|
|
61
64
|
setOpen = _React$useState2[1];
|
|
@@ -274,6 +277,11 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
|
|
|
274
277
|
*/
|
|
275
278
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
276
279
|
|
|
280
|
+
/**
|
|
281
|
+
* If true, the select opens by default.
|
|
282
|
+
*/
|
|
283
|
+
initialOpen: PropTypes.bool,
|
|
284
|
+
|
|
277
285
|
/**
|
|
278
286
|
* If true, the cell is editable.
|
|
279
287
|
*/
|
|
@@ -88,6 +88,11 @@ var GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCell
|
|
|
88
88
|
|
|
89
89
|
var isSelectable = apiRef.current.isRowSelectable(id);
|
|
90
90
|
var label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');
|
|
91
|
+
|
|
92
|
+
if (rowNode.isPinned) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
|
|
91
96
|
return /*#__PURE__*/_jsx(rootProps.components.BaseCheckbox, _extends({
|
|
92
97
|
ref: handleRef,
|
|
93
98
|
tabIndex: tabIndex,
|
|
@@ -13,7 +13,7 @@ import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
|
13
13
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
14
14
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
15
15
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
16
|
-
import { gridRowCountSelector } from '../../hooks/features/rows/gridRowsSelector';
|
|
16
|
+
import { gridPinnedRowsCountSelector, gridRowCountSelector } from '../../hooks/features/rows/gridRowsSelector';
|
|
17
17
|
import { gridDensityValueSelector } from '../../hooks/features/density/densitySelector';
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
|
|
@@ -40,6 +40,7 @@ var GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
40
40
|
var densityValue = useGridSelector(apiRef, gridDensityValueSelector);
|
|
41
41
|
var rootContainerRef = React.useRef(null);
|
|
42
42
|
var handleRef = useForkRef(rootContainerRef, ref);
|
|
43
|
+
var pinnedRowsCount = useGridSelector(apiRef, gridPinnedRowsCountSelector);
|
|
43
44
|
var ownerState = {
|
|
44
45
|
density: densityValue,
|
|
45
46
|
classes: rootProps.classes,
|
|
@@ -71,7 +72,8 @@ var GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
71
72
|
className: clsx(className, classes.root),
|
|
72
73
|
role: "grid",
|
|
73
74
|
"aria-colcount": visibleColumns.length,
|
|
74
|
-
"aria-rowcount": totalRowCount
|
|
75
|
+
"aria-rowcount": totalRowCount + pinnedRowsCount + 1 // +1 for the header row
|
|
76
|
+
,
|
|
75
77
|
"aria-multiselectable": !rootProps.disableMultipleSelection,
|
|
76
78
|
"aria-label": rootProps['aria-label'],
|
|
77
79
|
"aria-labelledby": rootProps['aria-labelledby']
|
|
@@ -63,12 +63,21 @@ export var GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function G
|
|
|
63
63
|
}, [densityValue, rootProps]);
|
|
64
64
|
|
|
65
65
|
var handleDensitySelectorOpen = function handleDensitySelectorOpen(event) {
|
|
66
|
-
setOpen(
|
|
66
|
+
setOpen(function (prevOpen) {
|
|
67
|
+
return !prevOpen;
|
|
68
|
+
});
|
|
67
69
|
onClick == null ? void 0 : onClick(event);
|
|
68
70
|
};
|
|
69
71
|
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
+
var handleDensitySelectorClickAway = function handleDensitySelectorClickAway(event) {
|
|
73
|
+
var _buttonRef$current;
|
|
74
|
+
|
|
75
|
+
if (buttonRef.current === event.target || // if user clicked on the icon
|
|
76
|
+
(_buttonRef$current = buttonRef.current) != null && _buttonRef$current.contains(event.target)) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
setOpen(false);
|
|
72
81
|
};
|
|
73
82
|
|
|
74
83
|
var handleDensityUpdate = function handleDensityUpdate(newDensity) {
|
|
@@ -82,7 +91,7 @@ export var GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function G
|
|
|
82
91
|
}
|
|
83
92
|
|
|
84
93
|
if (isHideMenuKey(event.key)) {
|
|
85
|
-
|
|
94
|
+
setOpen(false);
|
|
86
95
|
}
|
|
87
96
|
}; // Disable the button if the corresponding is disabled
|
|
88
97
|
|
|
@@ -119,7 +128,7 @@ export var GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function G
|
|
|
119
128
|
})), /*#__PURE__*/_jsx(GridMenu, {
|
|
120
129
|
open: open,
|
|
121
130
|
target: buttonRef.current,
|
|
122
|
-
onClickAway:
|
|
131
|
+
onClickAway: handleDensitySelectorClickAway,
|
|
123
132
|
position: "bottom-start",
|
|
124
133
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
125
134
|
id: densityMenuId,
|
|
@@ -33,7 +33,9 @@ export var GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function G
|
|
|
33
33
|
var handleRef = useForkRef(ref, buttonRef);
|
|
34
34
|
|
|
35
35
|
var handleMenuOpen = function handleMenuOpen(event) {
|
|
36
|
-
setOpen(
|
|
36
|
+
setOpen(function (prevOpen) {
|
|
37
|
+
return !prevOpen;
|
|
38
|
+
});
|
|
37
39
|
onClick == null ? void 0 : onClick(event);
|
|
38
40
|
};
|
|
39
41
|
|
|
@@ -51,6 +53,17 @@ export var GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function G
|
|
|
51
53
|
}
|
|
52
54
|
};
|
|
53
55
|
|
|
56
|
+
var handleMenuClickAway = function handleMenuClickAway(event) {
|
|
57
|
+
var _buttonRef$current;
|
|
58
|
+
|
|
59
|
+
if (buttonRef.current === event.target || // if user clicked on the icon
|
|
60
|
+
(_buttonRef$current = buttonRef.current) != null && _buttonRef$current.contains(event.target)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
setOpen(false);
|
|
65
|
+
};
|
|
66
|
+
|
|
54
67
|
if (children == null) {
|
|
55
68
|
return null;
|
|
56
69
|
}
|
|
@@ -72,7 +85,7 @@ export var GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function G
|
|
|
72
85
|
})), /*#__PURE__*/_jsx(GridMenu, {
|
|
73
86
|
open: open,
|
|
74
87
|
target: buttonRef.current,
|
|
75
|
-
onClickAway:
|
|
88
|
+
onClickAway: handleMenuClickAway,
|
|
76
89
|
position: "bottom-start",
|
|
77
90
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
78
91
|
id: menuId,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// A guide to feature toggling (deprecated)
|
|
2
2
|
//
|
|
3
3
|
// The feature toggle is:
|
|
4
4
|
// - independent from the NODE_ENV
|
|
@@ -15,13 +15,4 @@ import { localStorageAvailable } from '../utils/utils'; // A guide to feature to
|
|
|
15
15
|
//
|
|
16
16
|
// Developers (users) are discouraged to enable the experimental feature by setting the GRID_EXPERIMENTAL_ENABLED env.
|
|
17
17
|
// Instead, prefer exposing experimental APIs, for instance, a prop or a new `unstable_` module.
|
|
18
|
-
|
|
19
|
-
var experimentalEnabled = false;
|
|
20
|
-
|
|
21
|
-
if (typeof process !== 'undefined' && process.env.GRID_EXPERIMENTAL_ENABLED !== undefined && localStorageAvailable() && window.localStorage.getItem('GRID_EXPERIMENTAL_ENABLED')) {
|
|
22
|
-
experimentalEnabled = window.localStorage.getItem('GRID_EXPERIMENTAL_ENABLED') === 'true';
|
|
23
|
-
} else if (typeof process !== 'undefined') {
|
|
24
|
-
experimentalEnabled = process.env.GRID_EXPERIMENTAL_ENABLED === 'true';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export var GRID_EXPERIMENTAL_ENABLED = experimentalEnabled;
|
|
18
|
+
export var GRID_EXPERIMENTAL_ENABLED = false;
|
|
@@ -2,4 +2,4 @@ import { generateUtilityClasses, generateUtilityClass } from '@mui/material';
|
|
|
2
2
|
export function getDataGridUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiDataGrid', slot);
|
|
4
4
|
}
|
|
5
|
-
export var gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell', 'cellContent', 'cellCheckbox', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLinkOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle']);
|
|
5
|
+
export var gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell', 'cellContent', 'cellCheckbox', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLinkOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
@@ -21,7 +21,7 @@ export var GRID_DEFAULT_LOCALE_TEXT = {
|
|
|
21
21
|
return count !== 1 ? "".concat(count, " active filters") : "".concat(count, " active filter");
|
|
22
22
|
},
|
|
23
23
|
// Quick filter toolbar field
|
|
24
|
-
toolbarQuickFilterPlaceholder: 'Search
|
|
24
|
+
toolbarQuickFilterPlaceholder: 'Search…',
|
|
25
25
|
toolbarQuickFilterLabel: 'Search',
|
|
26
26
|
toolbarQuickFilterDeleteIconLabel: 'Clear',
|
|
27
27
|
// Export selector toolbar button text
|
|
@@ -8,6 +8,7 @@ import { gridDensityHeaderHeightSelector, gridDensityRowHeightSelector } from '.
|
|
|
8
8
|
import { useGridSelector } from '../../utils';
|
|
9
9
|
import { getVisibleRows } from '../../utils/useGridVisibleRows';
|
|
10
10
|
import { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';
|
|
11
|
+
import { calculatePinnedRowsHeight } from '../rows/gridRowsUtils';
|
|
11
12
|
var isTestEnvironment = process.env.NODE_ENV === 'test';
|
|
12
13
|
|
|
13
14
|
var hasScroll = function hasScroll(_ref) {
|
|
@@ -46,6 +47,7 @@ export function useGridDimensions(apiRef, props) {
|
|
|
46
47
|
|
|
47
48
|
var rootElement = (_apiRef$current$rootE = apiRef.current.rootElementRef) == null ? void 0 : _apiRef$current$rootE.current;
|
|
48
49
|
var columnsTotalWidth = gridColumnsTotalWidthSelector(apiRef);
|
|
50
|
+
var pinnedRowsHeight = calculatePinnedRowsHeight(apiRef);
|
|
49
51
|
|
|
50
52
|
if (!rootDimensionsRef.current) {
|
|
51
53
|
return;
|
|
@@ -91,7 +93,10 @@ export function useGridDimensions(apiRef, props) {
|
|
|
91
93
|
width: Math.round(columnsTotalWidth),
|
|
92
94
|
height: rowsMeta.currentPageTotalHeight
|
|
93
95
|
},
|
|
94
|
-
container:
|
|
96
|
+
container: {
|
|
97
|
+
width: viewportOuterSize.width,
|
|
98
|
+
height: viewportOuterSize.height - pinnedRowsHeight.top - pinnedRowsHeight.bottom
|
|
99
|
+
},
|
|
95
100
|
scrollBarSize: scrollBarSize
|
|
96
101
|
});
|
|
97
102
|
hasScrollY = scrollInformation.hasScrollY;
|