@mui/x-data-grid 7.25.0 → 7.27.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 +133 -0
- package/DataGrid/DataGrid.js +6 -0
- package/DataGrid/useDataGridComponent.js +3 -3
- package/components/GridRow.js +8 -2
- package/components/GridScrollArea.d.ts +5 -2
- package/components/GridScrollArea.js +32 -25
- package/components/GridSkeletonLoadingOverlay.js +2 -1
- package/components/containers/GridRoot.js +11 -9
- package/components/containers/GridRootStyles.js +3 -3
- package/components/virtualization/GridMainContainer.d.ts +2 -2
- package/components/virtualization/GridMainContainer.js +1 -1
- package/components/virtualization/GridVirtualScroller.js +21 -14
- package/constants/dataGridPropsDefaultValues.js +1 -0
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +6 -4
- package/hooks/core/useGridStateInitialization.js +3 -2
- package/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -14
- package/hooks/features/columns/gridColumnsSelector.d.ts +0 -5
- package/hooks/features/columns/gridColumnsSelector.js +0 -12
- package/hooks/features/dimensions/gridDimensionsSelectors.d.ts +16 -0
- package/hooks/features/dimensions/gridDimensionsSelectors.js +26 -1
- package/hooks/features/dimensions/index.d.ts +1 -1
- package/hooks/features/dimensions/index.js +1 -2
- package/hooks/features/dimensions/useGridDimensions.js +97 -70
- package/hooks/features/editing/gridEditingSelectors.d.ts +5 -1
- package/hooks/features/editing/gridEditingSelectors.js +6 -1
- package/hooks/features/editing/useGridRowEditing.js +4 -4
- package/hooks/features/filter/gridFilterState.d.ts +5 -0
- package/hooks/features/filter/gridFilterState.js +5 -0
- package/hooks/features/filter/useGridFilter.js +6 -13
- package/hooks/features/pagination/useGridPagination.js +1 -1
- package/hooks/features/pagination/useGridPaginationModel.d.ts +1 -1
- package/hooks/features/pagination/useGridPaginationModel.js +44 -0
- package/hooks/features/rowSelection/useGridRowSelection.js +1 -1
- package/hooks/features/rowSelection/utils.js +1 -1
- package/hooks/features/rows/gridRowsMetaState.d.ts +8 -0
- package/hooks/features/rows/gridRowsUtils.d.ts +0 -4
- package/hooks/features/rows/gridRowsUtils.js +0 -16
- package/hooks/features/rows/useGridRowsMeta.js +33 -17
- package/hooks/features/sorting/gridSortingSelector.js +10 -9
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +6 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +43 -27
- package/hooks/utils/useGridNativeEventListener.d.ts +0 -1
- package/hooks/utils/useGridNativeEventListener.js +12 -22
- package/hooks/utils/useGridSelector.d.ts +8 -1
- package/hooks/utils/useGridSelector.js +42 -8
- package/hooks/utils/useIsSSR.d.ts +1 -0
- package/hooks/utils/useIsSSR.js +5 -0
- package/index.js +1 -1
- package/internals/index.d.ts +2 -1
- package/internals/index.js +2 -1
- package/locales/plPL.js +31 -35
- package/locales/ukUA.js +9 -10
- package/models/api/gridStateApi.d.ts +1 -0
- package/models/events/gridEventLookup.d.ts +6 -0
- package/models/props/DataGridProps.d.ts +6 -0
- package/modern/DataGrid/DataGrid.js +6 -0
- package/modern/DataGrid/useDataGridComponent.js +3 -3
- package/modern/components/GridRow.js +8 -2
- package/modern/components/GridScrollArea.js +32 -25
- package/modern/components/GridSkeletonLoadingOverlay.js +2 -1
- package/modern/components/containers/GridRoot.js +11 -9
- package/modern/components/containers/GridRootStyles.js +3 -3
- package/modern/components/virtualization/GridMainContainer.js +1 -1
- package/modern/components/virtualization/GridVirtualScroller.js +21 -14
- package/modern/constants/dataGridPropsDefaultValues.js +1 -0
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +6 -4
- package/modern/hooks/core/useGridStateInitialization.js +3 -2
- package/modern/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -14
- package/modern/hooks/features/columns/gridColumnsSelector.js +0 -12
- package/modern/hooks/features/dimensions/gridDimensionsSelectors.js +26 -1
- package/modern/hooks/features/dimensions/index.js +1 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +97 -70
- package/modern/hooks/features/editing/gridEditingSelectors.js +6 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +4 -4
- package/modern/hooks/features/filter/gridFilterState.js +5 -0
- package/modern/hooks/features/filter/useGridFilter.js +6 -13
- package/modern/hooks/features/pagination/useGridPagination.js +1 -1
- package/modern/hooks/features/pagination/useGridPaginationModel.js +44 -0
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +1 -1
- package/modern/hooks/features/rowSelection/utils.js +1 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +0 -16
- package/modern/hooks/features/rows/useGridRowsMeta.js +33 -17
- package/modern/hooks/features/sorting/gridSortingSelector.js +10 -9
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +43 -27
- package/modern/hooks/utils/useGridNativeEventListener.js +12 -22
- package/modern/hooks/utils/useGridSelector.js +42 -8
- package/modern/hooks/utils/useIsSSR.js +5 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -1
- package/modern/locales/plPL.js +31 -35
- package/modern/locales/ukUA.js +9 -10
- package/node/DataGrid/DataGrid.js +6 -0
- package/node/DataGrid/useDataGridComponent.js +3 -3
- package/node/components/GridRow.js +7 -2
- package/node/components/GridScrollArea.js +31 -24
- package/node/components/GridSkeletonLoadingOverlay.js +2 -1
- package/node/components/containers/GridRoot.js +10 -8
- package/node/components/containers/GridRootStyles.js +3 -3
- package/node/components/virtualization/GridMainContainer.js +1 -1
- package/node/components/virtualization/GridVirtualScroller.js +21 -14
- package/node/constants/dataGridPropsDefaultValues.js +1 -0
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +6 -4
- package/node/hooks/core/useGridStateInitialization.js +3 -2
- package/node/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -14
- package/node/hooks/features/columns/gridColumnsSelector.js +1 -13
- package/node/hooks/features/dimensions/gridDimensionsSelectors.js +38 -2
- package/node/hooks/features/dimensions/index.js +13 -11
- package/node/hooks/features/dimensions/useGridDimensions.js +94 -67
- package/node/hooks/features/editing/gridEditingSelectors.js +5 -1
- package/node/hooks/features/editing/useGridRowEditing.js +4 -4
- package/node/hooks/features/filter/gridFilterState.js +6 -1
- package/node/hooks/features/filter/useGridFilter.js +5 -12
- package/node/hooks/features/pagination/useGridPagination.js +1 -1
- package/node/hooks/features/pagination/useGridPaginationModel.js +44 -0
- package/node/hooks/features/rowSelection/useGridRowSelection.js +1 -1
- package/node/hooks/features/rowSelection/utils.js +1 -1
- package/node/hooks/features/rows/gridRowsUtils.js +0 -17
- package/node/hooks/features/rows/useGridRowsMeta.js +31 -15
- package/node/hooks/features/sorting/gridSortingSelector.js +10 -9
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +42 -26
- package/node/hooks/utils/useGridNativeEventListener.js +12 -23
- package/node/hooks/utils/useGridSelector.js +42 -8
- package/node/hooks/utils/useIsSSR.js +12 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +20 -7
- package/node/locales/plPL.js +31 -35
- package/node/locales/ukUA.js +9 -10
- package/package.json +3 -2
package/index.js
CHANGED
package/internals/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export { useGridDensity, densityStateInitializer } from '../hooks/features/densi
|
|
|
30
30
|
export { useGridCsvExport } from '../hooks/features/export/useGridCsvExport';
|
|
31
31
|
export { useGridPrintExport } from '../hooks/features/export/useGridPrintExport';
|
|
32
32
|
export { useGridFilter, filterStateInitializer } from '../hooks/features/filter/useGridFilter';
|
|
33
|
+
export { defaultGridFilterLookup } from '../hooks/features/filter/gridFilterState';
|
|
33
34
|
export { passFilterLogic } from '../hooks/features/filter/gridFilterUtils';
|
|
34
35
|
export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector, } from '../hooks/features/filter/gridFilterSelector';
|
|
35
36
|
export { isSingleSelectColDef } from '../components/panel/filterPanel/filterPanelUtils';
|
|
@@ -52,7 +53,6 @@ export { useGridParamsApi } from '../hooks/features/rows/useGridParamsApi';
|
|
|
52
53
|
export { getRowIdFromRowModel, GRID_ID_AUTOGENERATED } from '../hooks/features/rows/gridRowsUtils';
|
|
53
54
|
export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector, } from '../hooks/features/rows/gridRowsSelector';
|
|
54
55
|
export { headerFilteringStateInitializer, useGridHeaderFiltering, } from '../hooks/features/headerFiltering/useGridHeaderFiltering';
|
|
55
|
-
export { calculatePinnedRowsHeight } from '../hooks/features/rows/gridRowsUtils';
|
|
56
56
|
export { useGridRowSelection, rowSelectionStateInitializer, } from '../hooks/features/rowSelection/useGridRowSelection';
|
|
57
57
|
export { useGridRowSelectionPreProcessors } from '../hooks/features/rowSelection/useGridRowSelectionPreProcessors';
|
|
58
58
|
export { useGridSorting, sortingStateInitializer } from '../hooks/features/sorting/useGridSorting';
|
|
@@ -61,6 +61,7 @@ export { gridSortedRowIndexLookupSelector } from '../hooks/features/sorting/grid
|
|
|
61
61
|
export { useGridScroll } from '../hooks/features/scroll/useGridScroll';
|
|
62
62
|
export { useGridEvents } from '../hooks/features/events/useGridEvents';
|
|
63
63
|
export { dimensionsStateInitializer, useGridDimensions, } from '../hooks/features/dimensions/useGridDimensions';
|
|
64
|
+
export * from '../hooks/features/dimensions/gridDimensionsSelectors';
|
|
64
65
|
export { useGridStatePersistence } from '../hooks/features/statePersistence/useGridStatePersistence';
|
|
65
66
|
export type { GridRestoreStatePreProcessingContext } from '../hooks/features/statePersistence/gridStatePersistenceInterface';
|
|
66
67
|
export { useGridVirtualScroller, EMPTY_DETAIL_PANELS, } from '../hooks/features/virtualization/useGridVirtualScroller';
|
package/internals/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export { useGridDensity, densityStateInitializer } from "../hooks/features/densi
|
|
|
22
22
|
export { useGridCsvExport } from "../hooks/features/export/useGridCsvExport.js";
|
|
23
23
|
export { useGridPrintExport } from "../hooks/features/export/useGridPrintExport.js";
|
|
24
24
|
export { useGridFilter, filterStateInitializer } from "../hooks/features/filter/useGridFilter.js";
|
|
25
|
+
export { defaultGridFilterLookup } from "../hooks/features/filter/gridFilterState.js";
|
|
25
26
|
export { passFilterLogic } from "../hooks/features/filter/gridFilterUtils.js";
|
|
26
27
|
export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector } from "../hooks/features/filter/gridFilterSelector.js";
|
|
27
28
|
export { isSingleSelectColDef } from "../components/panel/filterPanel/filterPanelUtils.js";
|
|
@@ -42,7 +43,6 @@ export { useGridParamsApi } from "../hooks/features/rows/useGridParamsApi.js";
|
|
|
42
43
|
export { getRowIdFromRowModel, GRID_ID_AUTOGENERATED } from "../hooks/features/rows/gridRowsUtils.js";
|
|
43
44
|
export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector } from "../hooks/features/rows/gridRowsSelector.js";
|
|
44
45
|
export { headerFilteringStateInitializer, useGridHeaderFiltering } from "../hooks/features/headerFiltering/useGridHeaderFiltering.js";
|
|
45
|
-
export { calculatePinnedRowsHeight } from "../hooks/features/rows/gridRowsUtils.js";
|
|
46
46
|
export { useGridRowSelection, rowSelectionStateInitializer } from "../hooks/features/rowSelection/useGridRowSelection.js";
|
|
47
47
|
export { useGridRowSelectionPreProcessors } from "../hooks/features/rowSelection/useGridRowSelectionPreProcessors.js";
|
|
48
48
|
export { useGridSorting, sortingStateInitializer } from "../hooks/features/sorting/useGridSorting.js";
|
|
@@ -50,6 +50,7 @@ export { gridSortedRowIndexLookupSelector } from "../hooks/features/sorting/grid
|
|
|
50
50
|
export { useGridScroll } from "../hooks/features/scroll/useGridScroll.js";
|
|
51
51
|
export { useGridEvents } from "../hooks/features/events/useGridEvents.js";
|
|
52
52
|
export { dimensionsStateInitializer, useGridDimensions } from "../hooks/features/dimensions/useGridDimensions.js";
|
|
53
|
+
export * from "../hooks/features/dimensions/gridDimensionsSelectors.js";
|
|
53
54
|
export { useGridStatePersistence } from "../hooks/features/statePersistence/useGridStatePersistence.js";
|
|
54
55
|
export { useGridVirtualScroller, EMPTY_DETAIL_PANELS } from "../hooks/features/virtualization/useGridVirtualScroller.js";
|
|
55
56
|
export * from "../hooks/features/virtualization/index.js";
|
package/locales/plPL.js
CHANGED
|
@@ -30,12 +30,11 @@ const plPLGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'Drukuj',
|
|
31
31
|
toolbarExportExcel: 'Pobierz jako plik Excel',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'Szukaj',
|
|
34
|
+
columnsManagementNoColumns: 'Brak kolumn',
|
|
35
|
+
columnsManagementShowHideAllText: 'Wyświetl/Ukryj wszystkie',
|
|
36
|
+
columnsManagementReset: 'Resetuj',
|
|
37
|
+
columnsManagementDeleteIconLabel: 'Wyczyść',
|
|
39
38
|
// Filter panel text
|
|
40
39
|
filterPanelAddFilter: 'Dodaj filtr',
|
|
41
40
|
filterPanelRemoveAll: 'Usuń wszystkie',
|
|
@@ -63,13 +62,12 @@ const plPLGrid = {
|
|
|
63
62
|
filterOperatorIsEmpty: 'jest pusty',
|
|
64
63
|
filterOperatorIsNotEmpty: 'nie jest pusty',
|
|
65
64
|
filterOperatorIsAnyOf: 'jest jednym z',
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
'filterOperator=': 'równa się',
|
|
66
|
+
'filterOperator!=': 'nie równa się',
|
|
67
|
+
'filterOperator>': 'większy niż',
|
|
68
|
+
'filterOperator>=': 'większy lub równy',
|
|
69
|
+
'filterOperator<': 'mniejszy niż',
|
|
70
|
+
'filterOperator<=': 'mniejszy lub równy',
|
|
73
71
|
// Header filter operators text
|
|
74
72
|
headerFilterOperatorContains: 'Zawiera',
|
|
75
73
|
// headerFilterOperatorDoesNotContain: 'Does not contain',
|
|
@@ -79,20 +77,19 @@ const plPLGrid = {
|
|
|
79
77
|
headerFilterOperatorEndsWith: 'Kończy się na',
|
|
80
78
|
// headerFilterOperatorIs: 'Is',
|
|
81
79
|
headerFilterOperatorNot: 'Niepuste',
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
80
|
+
headerFilterOperatorAfter: 'Jest po',
|
|
81
|
+
headerFilterOperatorOnOrAfter: 'Jest w lub po',
|
|
82
|
+
headerFilterOperatorBefore: 'Jest przed',
|
|
83
|
+
headerFilterOperatorOnOrBefore: 'Jest w lub przed',
|
|
84
|
+
headerFilterOperatorIsEmpty: 'Jest pusty',
|
|
85
|
+
headerFilterOperatorIsNotEmpty: 'Nie jest pusty',
|
|
86
|
+
headerFilterOperatorIsAnyOf: 'Is any of',
|
|
87
|
+
'headerFilterOperator=': 'Równa się',
|
|
88
|
+
'headerFilterOperator!=': 'Nie równa się',
|
|
89
|
+
'headerFilterOperator>': 'Większy niż',
|
|
90
|
+
'headerFilterOperator>=': 'Większy lub równy',
|
|
91
|
+
'headerFilterOperator<': 'Mniejszy niż',
|
|
92
|
+
'headerFilterOperator<=': 'Mniejszy lub równy',
|
|
96
93
|
// Filter values text
|
|
97
94
|
filterValueAny: 'dowolny',
|
|
98
95
|
filterValueTrue: 'prawda',
|
|
@@ -144,14 +141,13 @@ const plPLGrid = {
|
|
|
144
141
|
expandDetailPanel: 'Rozwiń',
|
|
145
142
|
collapseDetailPanel: 'Zwiń',
|
|
146
143
|
// Row reordering text
|
|
147
|
-
rowReorderingHeaderName: 'Porządkowanie wierszy'
|
|
148
|
-
|
|
144
|
+
rowReorderingHeaderName: 'Porządkowanie wierszy',
|
|
149
145
|
// Aggregation
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
146
|
+
aggregationMenuItemHeader: 'Agregacja',
|
|
147
|
+
aggregationFunctionLabelSum: 'suma',
|
|
148
|
+
aggregationFunctionLabelAvg: 'średnia',
|
|
149
|
+
aggregationFunctionLabelMin: 'minimum',
|
|
150
|
+
aggregationFunctionLabelMax: 'maximum',
|
|
151
|
+
aggregationFunctionLabelSize: 'rozmiar'
|
|
156
152
|
};
|
|
157
153
|
export const plPL = getGridLocalization(plPLGrid, plPLCore);
|
package/locales/ukUA.js
CHANGED
|
@@ -45,12 +45,11 @@ const ukUAGrid = {
|
|
|
45
45
|
toolbarExportPrint: 'Друк',
|
|
46
46
|
toolbarExportExcel: 'Завантажити у форматі Excel',
|
|
47
47
|
// Columns management text
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
columnsManagementSearchTitle: 'Пошук',
|
|
49
|
+
columnsManagementNoColumns: 'Немає стовпців',
|
|
50
|
+
columnsManagementShowHideAllText: 'Показати/Приховати всі',
|
|
51
|
+
columnsManagementReset: 'Скинути',
|
|
52
|
+
columnsManagementDeleteIconLabel: 'Очистити',
|
|
54
53
|
// Filter panel text
|
|
55
54
|
filterPanelAddFilter: 'Додати фільтр',
|
|
56
55
|
filterPanelRemoveAll: 'Видалити всі',
|
|
@@ -64,9 +63,9 @@ const ukUAGrid = {
|
|
|
64
63
|
filterPanelInputPlaceholder: 'Значення фільтра',
|
|
65
64
|
// Filter operators text
|
|
66
65
|
filterOperatorContains: 'містить',
|
|
67
|
-
|
|
66
|
+
filterOperatorDoesNotContain: 'не містить',
|
|
68
67
|
filterOperatorEquals: 'дорівнює',
|
|
69
|
-
|
|
68
|
+
filterOperatorDoesNotEqual: 'не дорівнює',
|
|
70
69
|
filterOperatorStartsWith: 'починається з',
|
|
71
70
|
filterOperatorEndsWith: 'закінчується на',
|
|
72
71
|
filterOperatorIs: 'дорівнює',
|
|
@@ -86,9 +85,9 @@ const ukUAGrid = {
|
|
|
86
85
|
'filterOperator<=': '<=',
|
|
87
86
|
// Header filter operators text
|
|
88
87
|
headerFilterOperatorContains: 'Містить',
|
|
89
|
-
|
|
88
|
+
headerFilterOperatorDoesNotContain: 'Не містить',
|
|
90
89
|
headerFilterOperatorEquals: 'Дорівнює',
|
|
91
|
-
|
|
90
|
+
headerFilterOperatorDoesNotEqual: 'Не дорівнює',
|
|
92
91
|
headerFilterOperatorStartsWith: 'Починається з',
|
|
93
92
|
headerFilterOperatorEndsWith: 'Закінчується на',
|
|
94
93
|
headerFilterOperatorIs: 'Дорівнює',
|
|
@@ -401,6 +401,12 @@ export interface GridControlledStateReasonLookup {
|
|
|
401
401
|
pagination: 'setPaginationModel' | 'stateRestorePreProcessing';
|
|
402
402
|
}
|
|
403
403
|
export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEventLookup, GridHeaderFilterEventLookup, GridColumnGroupHeaderEventLookup, GridCellEventLookup, GridControlledStateEventLookup {
|
|
404
|
+
/**
|
|
405
|
+
* Fired when rootElementRef.current becomes available.
|
|
406
|
+
*/
|
|
407
|
+
rootMount: {
|
|
408
|
+
params: HTMLElement;
|
|
409
|
+
};
|
|
404
410
|
/**
|
|
405
411
|
* Fired when the grid is unmounted.
|
|
406
412
|
*/
|
|
@@ -267,6 +267,12 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
|
|
|
267
267
|
* @default "client"
|
|
268
268
|
*/
|
|
269
269
|
paginationMode: GridFeatureMode;
|
|
270
|
+
/**
|
|
271
|
+
* If `true`, the page is set to 0 after each sorting or filtering.
|
|
272
|
+
* This prop will be removed in the next major version and resetting the page will become the default behavior.
|
|
273
|
+
* @default false
|
|
274
|
+
*/
|
|
275
|
+
resetPageOnSortFilter: boolean;
|
|
270
276
|
/**
|
|
271
277
|
* Set of rows of type [[GridRowsProp]].
|
|
272
278
|
* @default []
|
|
@@ -661,6 +661,12 @@ DataGridRaw.propTypes = {
|
|
|
661
661
|
* @returns {Promise<R> | R} The final values to update the row.
|
|
662
662
|
*/
|
|
663
663
|
processRowUpdate: PropTypes.func,
|
|
664
|
+
/**
|
|
665
|
+
* If `true`, the page is set to 0 after each sorting or filtering.
|
|
666
|
+
* This prop will be removed in the next major version and resetting the page will become the default behavior.
|
|
667
|
+
* @default false
|
|
668
|
+
*/
|
|
669
|
+
resetPageOnSortFilter: PropTypes.bool,
|
|
664
670
|
/**
|
|
665
671
|
* The milliseconds throttle delay for resizing the grid.
|
|
666
672
|
* @default 60
|
|
@@ -41,11 +41,10 @@ export const useDataGridComponent = (inputApiRef, props) => {
|
|
|
41
41
|
/**
|
|
42
42
|
* Register all state initializers here.
|
|
43
43
|
*/
|
|
44
|
-
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
45
44
|
useGridInitializeState(rowSelectionStateInitializer, apiRef, props);
|
|
46
45
|
useGridInitializeState(columnsStateInitializer, apiRef, props);
|
|
47
|
-
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
48
46
|
useGridInitializeState(rowsStateInitializer, apiRef, props);
|
|
47
|
+
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
49
48
|
useGridInitializeState(editingStateInitializer, apiRef, props);
|
|
50
49
|
useGridInitializeState(focusStateInitializer, apiRef, props);
|
|
51
50
|
useGridInitializeState(sortingStateInitializer, apiRef, props);
|
|
@@ -54,10 +53,11 @@ export const useDataGridComponent = (inputApiRef, props) => {
|
|
|
54
53
|
useGridInitializeState(rowSpanningStateInitializer, apiRef, props);
|
|
55
54
|
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
56
55
|
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
|
|
57
|
-
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
58
56
|
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
59
57
|
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
|
|
60
58
|
useGridInitializeState(virtualizationStateInitializer, apiRef, props);
|
|
59
|
+
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
60
|
+
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
61
61
|
useGridInitializeState(listViewStateInitializer, apiRef, props);
|
|
62
62
|
useGridKeyboardNavigation(apiRef, props);
|
|
63
63
|
useGridRowSelection(apiRef, props);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
5
|
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "offsetLeft", "columnsTotalWidth", "firstColumnIndex", "lastColumnIndex", "focusedColumnIndex", "isFirstVisible", "isLastVisible", "isNotVisible", "showBottomBorder", "scrollbarWidth", "gridHasFiller", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave", "onMouseOut", "onMouseOver"];
|
|
@@ -78,7 +80,10 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
78
80
|
const isRowReorderingEnabled = useGridSelectorV8(apiRef, isRowReorderingEnabledSelector, rowReordering);
|
|
79
81
|
const handleRef = useForkRef(ref, refProp);
|
|
80
82
|
const rowNode = apiRef.current.getRowNode(rowId);
|
|
81
|
-
const editing = useGridSelectorV8(apiRef, gridRowIsEditingSelector,
|
|
83
|
+
const editing = useGridSelectorV8(apiRef, gridRowIsEditingSelector, {
|
|
84
|
+
rowId,
|
|
85
|
+
editMode: rootProps.editMode
|
|
86
|
+
});
|
|
82
87
|
const editable = rootProps.editMode === GridEditModes.Row;
|
|
83
88
|
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
84
89
|
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < firstColumnIndex;
|
|
@@ -296,7 +301,8 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
296
301
|
role: "presentation",
|
|
297
302
|
className: clsx(gridClasses.cell, gridClasses.cellEmpty)
|
|
298
303
|
}), rightCells, scrollbarWidth !== 0 && /*#__PURE__*/_jsx(ScrollbarFiller, {
|
|
299
|
-
pinnedRight: pinnedColumns.right.length > 0
|
|
304
|
+
pinnedRight: pinnedColumns.right.length > 0,
|
|
305
|
+
borderTop: !isFirstVisible
|
|
300
306
|
})]
|
|
301
307
|
}));
|
|
302
308
|
});
|
|
@@ -8,12 +8,12 @@ import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
|
8
8
|
import { getDataGridUtilityClass, gridClasses } from "../constants/index.js";
|
|
9
9
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
10
10
|
import { useGridApiEventHandler } from "../hooks/utils/useGridApiEventHandler.js";
|
|
11
|
-
import { useGridSelector } from "../hooks/utils/useGridSelector.js";
|
|
12
|
-
import { gridDimensionsSelector } from "../hooks/features/dimensions/gridDimensionsSelectors.js";
|
|
11
|
+
import { useGridSelector, useGridSelectorV8 } from "../hooks/utils/useGridSelector.js";
|
|
12
|
+
import { gridDimensionsSelector, gridColumnsTotalWidthSelector } from "../hooks/features/dimensions/gridDimensionsSelectors.js";
|
|
13
13
|
import { gridDensityFactorSelector } from "../hooks/features/density/densitySelector.js";
|
|
14
|
-
import { gridColumnsTotalWidthSelector } from "../hooks/features/columns/gridColumnsSelector.js";
|
|
15
14
|
import { useTimeout } from "../hooks/utils/useTimeout.js";
|
|
16
15
|
import { getTotalHeaderHeight } from "../hooks/features/columns/gridColumnsUtils.js";
|
|
16
|
+
import { createSelectorV8 } from "../utils/createSelector.js";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
const CLIFF = 1;
|
|
19
19
|
const SLOP = 1.5;
|
|
@@ -48,21 +48,38 @@ const GridScrollAreaRawRoot = styled('div', {
|
|
|
48
48
|
right: 0
|
|
49
49
|
}
|
|
50
50
|
}));
|
|
51
|
-
|
|
51
|
+
const offsetSelector = createSelectorV8(gridDimensionsSelector, (dimensions, direction) => {
|
|
52
|
+
if (direction === 'left') {
|
|
53
|
+
return dimensions.leftPinnedWidth;
|
|
54
|
+
}
|
|
55
|
+
if (direction === 'right') {
|
|
56
|
+
return dimensions.rightPinnedWidth + (dimensions.hasScrollX ? dimensions.scrollbarSize : 0);
|
|
57
|
+
}
|
|
58
|
+
return 0;
|
|
59
|
+
});
|
|
60
|
+
function GridScrollAreaWrapper(props) {
|
|
61
|
+
const apiRef = useGridApiContext();
|
|
62
|
+
const [dragging, setDragging] = React.useState(false);
|
|
63
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragStart', () => setDragging(true));
|
|
64
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragEnd', () => setDragging(false));
|
|
65
|
+
if (!dragging) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
return /*#__PURE__*/_jsx(GridScrollAreaContent, _extends({}, props));
|
|
69
|
+
}
|
|
70
|
+
function GridScrollAreaContent(props) {
|
|
52
71
|
const {
|
|
53
|
-
scrollDirection
|
|
72
|
+
scrollDirection,
|
|
73
|
+
scrollPosition
|
|
54
74
|
} = props;
|
|
55
75
|
const rootRef = React.useRef(null);
|
|
56
76
|
const apiRef = useGridApiContext();
|
|
57
77
|
const timeout = useTimeout();
|
|
58
78
|
const densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);
|
|
59
79
|
const columnsTotalWidth = useGridSelector(apiRef, gridColumnsTotalWidthSelector);
|
|
60
|
-
const
|
|
61
|
-
const scrollPosition = React.useRef({
|
|
62
|
-
left: 0,
|
|
63
|
-
top: 0
|
|
64
|
-
});
|
|
80
|
+
const sideOffset = useGridSelectorV8(apiRef, offsetSelector, scrollDirection);
|
|
65
81
|
const getCanScrollMore = () => {
|
|
82
|
+
const dimensions = gridDimensionsSelector(apiRef.current.state);
|
|
66
83
|
if (scrollDirection === 'left') {
|
|
67
84
|
// Only render if the user has not reached yet the start of the list
|
|
68
85
|
return scrollPosition.current.left > 0;
|
|
@@ -74,7 +91,6 @@ function GridScrollAreaRaw(props) {
|
|
|
74
91
|
}
|
|
75
92
|
return false;
|
|
76
93
|
};
|
|
77
|
-
const [dragging, setDragging] = React.useState(false);
|
|
78
94
|
const [canScrollMore, setCanScrollMore] = React.useState(getCanScrollMore);
|
|
79
95
|
const rootProps = useGridRootProps();
|
|
80
96
|
const ownerState = _extends({}, rootProps, {
|
|
@@ -88,12 +104,11 @@ function GridScrollAreaRaw(props) {
|
|
|
88
104
|
top: totalHeaderHeight - headerHeight
|
|
89
105
|
};
|
|
90
106
|
if (scrollDirection === 'left') {
|
|
91
|
-
style.left =
|
|
107
|
+
style.left = sideOffset;
|
|
92
108
|
} else if (scrollDirection === 'right') {
|
|
93
|
-
style.right =
|
|
109
|
+
style.right = sideOffset;
|
|
94
110
|
}
|
|
95
|
-
const handleScrolling =
|
|
96
|
-
scrollPosition.current = newScrollPosition;
|
|
111
|
+
const handleScrolling = () => {
|
|
97
112
|
setCanScrollMore(getCanScrollMore);
|
|
98
113
|
};
|
|
99
114
|
const handleDragOver = useEventCallback(event => {
|
|
@@ -118,16 +133,8 @@ function GridScrollAreaRaw(props) {
|
|
|
118
133
|
});
|
|
119
134
|
});
|
|
120
135
|
});
|
|
121
|
-
const handleColumnHeaderDragStart = useEventCallback(() => {
|
|
122
|
-
setDragging(true);
|
|
123
|
-
});
|
|
124
|
-
const handleColumnHeaderDragEnd = useEventCallback(() => {
|
|
125
|
-
setDragging(false);
|
|
126
|
-
});
|
|
127
136
|
useGridApiEventHandler(apiRef, 'scrollPositionChange', handleScrolling);
|
|
128
|
-
|
|
129
|
-
useGridApiEventHandler(apiRef, 'columnHeaderDragEnd', handleColumnHeaderDragEnd);
|
|
130
|
-
if (!dragging || !canScrollMore) {
|
|
137
|
+
if (!canScrollMore) {
|
|
131
138
|
return null;
|
|
132
139
|
}
|
|
133
140
|
return /*#__PURE__*/_jsx(GridScrollAreaRawRoot, {
|
|
@@ -138,4 +145,4 @@ function GridScrollAreaRaw(props) {
|
|
|
138
145
|
style: style
|
|
139
146
|
});
|
|
140
147
|
}
|
|
141
|
-
export const GridScrollArea = fastMemo(
|
|
148
|
+
export const GridScrollArea = fastMemo(GridScrollAreaWrapper);
|
|
@@ -8,8 +8,9 @@ import { useRtl } from '@mui/system/RtlProvider';
|
|
|
8
8
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
9
9
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
10
10
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
11
|
-
import { gridColumnPositionsSelector,
|
|
11
|
+
import { gridColumnPositionsSelector, gridDimensionsSelector, gridVisibleColumnDefinitionsSelector, gridVisiblePinnedColumnDefinitionsSelector, useGridApiEventHandler, useGridSelector } from "../hooks/index.js";
|
|
12
12
|
import { PinnedColumnPosition } from "../internals/constants.js";
|
|
13
|
+
import { gridColumnsTotalWidthSelector } from "../hooks/features/dimensions/gridDimensionsSelectors.js";
|
|
13
14
|
import { getDataGridUtilityClass, gridClasses } from "../constants/gridClasses.js";
|
|
14
15
|
import { getPinnedCellOffset } from "../internals/utils/getPinnedCellOffset.js";
|
|
15
16
|
import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from "../utils/cellBorderUtils.js";
|
|
@@ -4,7 +4,7 @@ const _excluded = ["className", "children"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import { unstable_useForkRef as useForkRef,
|
|
7
|
+
import { unstable_useForkRef as useForkRef, unstable_capitalize as capitalize, unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
8
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
9
9
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
10
10
|
import { GridRootStyles } from "./GridRootStyles.js";
|
|
@@ -13,6 +13,7 @@ import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiCon
|
|
|
13
13
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
14
14
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
15
15
|
import { gridDensitySelector } from "../../hooks/features/density/densitySelector.js";
|
|
16
|
+
import { useIsSSR } from "../../hooks/utils/useIsSSR.js";
|
|
16
17
|
import { GridHeader } from "../GridHeader.js";
|
|
17
18
|
import { GridBody, GridFooterPlaceholder } from "../base/index.js";
|
|
18
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -37,16 +38,17 @@ const GridRoot = forwardRef(function GridRoot(props, ref) {
|
|
|
37
38
|
const apiRef = useGridPrivateApiContext();
|
|
38
39
|
const density = useGridSelector(apiRef, gridDensitySelector);
|
|
39
40
|
const rootElementRef = apiRef.current.rootElementRef;
|
|
40
|
-
const
|
|
41
|
+
const rootMountCallback = React.useCallback(node => {
|
|
42
|
+
if (node === null) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
apiRef.current.publishEvent('rootMount', node);
|
|
46
|
+
}, [apiRef]);
|
|
47
|
+
const handleRef = useForkRef(rootElementRef, ref, rootMountCallback);
|
|
41
48
|
const ownerState = rootProps;
|
|
42
49
|
const classes = useUtilityClasses(ownerState, density);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const [mountedState, setMountedState] = React.useState(false);
|
|
46
|
-
useEnhancedEffect(() => {
|
|
47
|
-
setMountedState(true);
|
|
48
|
-
}, []);
|
|
49
|
-
if (!mountedState) {
|
|
50
|
+
const isSSR = useIsSSR();
|
|
51
|
+
if (isSSR) {
|
|
50
52
|
return null;
|
|
51
53
|
}
|
|
52
54
|
return /*#__PURE__*/_jsxs(GridRootStyles, _extends({
|
|
@@ -3,7 +3,6 @@ import { alpha, styled, darken, lighten, decomposeColor, recomposeColor } from '
|
|
|
3
3
|
import { gridClasses as c } from "../../constants/gridClasses.js";
|
|
4
4
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
5
5
|
import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.js";
|
|
6
|
-
import { gridDimensionsSelector } from "../../hooks/features/dimensions/gridDimensionsSelectors.js";
|
|
7
6
|
function getBorderColor(theme) {
|
|
8
7
|
if (theme.vars) {
|
|
9
8
|
return theme.vars.palette.TableCell.border;
|
|
@@ -35,6 +34,7 @@ const separatorIconDragStyles = {
|
|
|
35
34
|
// Emotion thinks it knows better than us which selector we should use.
|
|
36
35
|
// https://github.com/emotion-js/emotion/issues/1105#issuecomment-1722524968
|
|
37
36
|
const ignoreSsrWarning = '/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */';
|
|
37
|
+
const shouldShowBorderTopRightRadiusSelector = state => state.dimensions.hasScrollX && (!state.dimensions.hasScrollY || state.dimensions.scrollbarSize === 0);
|
|
38
38
|
export const GridRootStyles = styled('div', {
|
|
39
39
|
name: 'MuiDataGrid',
|
|
40
40
|
slot: 'Root',
|
|
@@ -265,7 +265,7 @@ export const GridRootStyles = styled('div', {
|
|
|
265
265
|
theme: t
|
|
266
266
|
}) => {
|
|
267
267
|
const apiRef = useGridPrivateApiContext();
|
|
268
|
-
const
|
|
268
|
+
const shouldShowBorderTopRightRadius = useGridSelector(apiRef, shouldShowBorderTopRightRadiusSelector);
|
|
269
269
|
const borderColor = getBorderColor(t);
|
|
270
270
|
const radius = t.shape.borderRadius;
|
|
271
271
|
const containerBackground = t.vars ? t.vars.palette.background.default : t.mixins.MuiDataGrid?.containerBackground ?? t.palette.background.default;
|
|
@@ -417,7 +417,7 @@ export const GridRootStyles = styled('div', {
|
|
|
417
417
|
borderTopLeftRadius: 'calc(var(--unstable_DataGrid-radius) - 1px)'
|
|
418
418
|
},
|
|
419
419
|
[`&.${c['root--noToolbar']} [aria-rowindex="1"] .${c['columnHeader--last']}`]: {
|
|
420
|
-
borderTopRightRadius:
|
|
420
|
+
borderTopRightRadius: shouldShowBorderTopRightRadius ? 'calc(var(--unstable_DataGrid-radius) - 1px)' : undefined
|
|
421
421
|
},
|
|
422
422
|
[`& .${c.columnHeaderCheckbox}, & .${c.cellCheckbox}`]: {
|
|
423
423
|
padding: 0,
|
|
@@ -18,7 +18,7 @@ const Element = styled('div', {
|
|
|
18
18
|
const {
|
|
19
19
|
ownerState
|
|
20
20
|
} = props;
|
|
21
|
-
return [styles.main, ownerState.
|
|
21
|
+
return [styles.main, ownerState.hasPinnedRight && styles['main--hasPinnedRight'], ownerState.loadingOverlayVariant === 'skeleton' && styles['main--hasSkeletonLoadingOverlay']];
|
|
22
22
|
}
|
|
23
23
|
})({
|
|
24
24
|
flexGrow: 1,
|
|
@@ -2,12 +2,12 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { styled } from '@mui/system';
|
|
4
4
|
import composeClasses from '@mui/utils/composeClasses';
|
|
5
|
+
import { gridHasBottomFillerSelector, gridHasScrollXSelector, gridHasScrollYSelector } from "../../hooks/features/dimensions/gridDimensionsSelectors.js";
|
|
5
6
|
import { GridScrollArea } from "../GridScrollArea.js";
|
|
6
7
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
7
8
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
8
9
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
9
10
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
10
|
-
import { gridDimensionsSelector } from "../../hooks/features/dimensions/index.js";
|
|
11
11
|
import { useGridVirtualScroller } from "../../hooks/features/virtualization/useGridVirtualScroller.js";
|
|
12
12
|
import { useGridOverlays } from "../../hooks/features/overlays/useGridOverlays.js";
|
|
13
13
|
import { GridOverlays as Overlays } from "../base/GridOverlays.js";
|
|
@@ -23,12 +23,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
23
23
|
const useUtilityClasses = ownerState => {
|
|
24
24
|
const {
|
|
25
25
|
classes,
|
|
26
|
-
|
|
26
|
+
hasScrollX,
|
|
27
|
+
hasPinnedRight,
|
|
27
28
|
loadingOverlayVariant
|
|
28
29
|
} = ownerState;
|
|
29
30
|
const slots = {
|
|
30
|
-
root: ['main',
|
|
31
|
-
scroller: ['virtualScroller',
|
|
31
|
+
root: ['main', hasPinnedRight && 'main--hasPinnedRight', loadingOverlayVariant === 'skeleton' && 'main--hasSkeletonLoadingOverlay'],
|
|
32
|
+
scroller: ['virtualScroller', hasScrollX && 'virtualScroller--hasScrollX']
|
|
32
33
|
};
|
|
33
34
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
34
35
|
};
|
|
@@ -39,7 +40,7 @@ const Scroller = styled('div', {
|
|
|
39
40
|
const {
|
|
40
41
|
ownerState
|
|
41
42
|
} = props;
|
|
42
|
-
return [styles.virtualScroller, ownerState.
|
|
43
|
+
return [styles.virtualScroller, ownerState.hasScrollX && styles['virtualScroller--hasScrollX']];
|
|
43
44
|
}
|
|
44
45
|
})({
|
|
45
46
|
position: 'relative',
|
|
@@ -58,14 +59,19 @@ const Scroller = styled('div', {
|
|
|
58
59
|
// See https://github.com/mui/mui-x/issues/10547
|
|
59
60
|
zIndex: 0
|
|
60
61
|
});
|
|
62
|
+
const hasPinnedRightSelector = state => state.dimensions.rightPinnedWidth > 0;
|
|
61
63
|
function GridVirtualScroller(props) {
|
|
62
64
|
const apiRef = useGridApiContext();
|
|
63
65
|
const rootProps = useGridRootProps();
|
|
64
|
-
const
|
|
66
|
+
const hasScrollY = useGridSelector(apiRef, gridHasScrollYSelector);
|
|
67
|
+
const hasScrollX = useGridSelector(apiRef, gridHasScrollXSelector);
|
|
68
|
+
const hasPinnedRight = useGridSelector(apiRef, hasPinnedRightSelector);
|
|
69
|
+
const hasBottomFiller = useGridSelector(apiRef, gridHasBottomFillerSelector);
|
|
65
70
|
const overlaysProps = useGridOverlays();
|
|
66
71
|
const ownerState = {
|
|
67
72
|
classes: rootProps.classes,
|
|
68
|
-
|
|
73
|
+
hasScrollX,
|
|
74
|
+
hasPinnedRight,
|
|
69
75
|
loadingOverlayVariant: overlaysProps.loadingOverlayVariant
|
|
70
76
|
};
|
|
71
77
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -77,18 +83,19 @@ function GridVirtualScroller(props) {
|
|
|
77
83
|
getRenderZoneProps,
|
|
78
84
|
getScrollbarVerticalProps,
|
|
79
85
|
getScrollbarHorizontalProps,
|
|
80
|
-
getRows
|
|
86
|
+
getRows,
|
|
87
|
+
getScrollAreaProps
|
|
81
88
|
} = virtualScroller;
|
|
82
89
|
const rows = getRows();
|
|
83
90
|
return /*#__PURE__*/_jsxs(Container, _extends({
|
|
84
91
|
className: classes.root
|
|
85
92
|
}, getContainerProps(), {
|
|
86
93
|
ownerState: ownerState,
|
|
87
|
-
children: [/*#__PURE__*/_jsx(GridScrollArea, {
|
|
94
|
+
children: [/*#__PURE__*/_jsx(GridScrollArea, _extends({
|
|
88
95
|
scrollDirection: "left"
|
|
89
|
-
}), /*#__PURE__*/_jsx(GridScrollArea, {
|
|
96
|
+
}, getScrollAreaProps())), /*#__PURE__*/_jsx(GridScrollArea, _extends({
|
|
90
97
|
scrollDirection: "right"
|
|
91
|
-
}), /*#__PURE__*/_jsxs(Scroller, _extends({
|
|
98
|
+
}, getScrollAreaProps())), /*#__PURE__*/_jsxs(Scroller, _extends({
|
|
92
99
|
className: classes.scroller
|
|
93
100
|
}, getScrollerProps(), {
|
|
94
101
|
ownerState: ownerState,
|
|
@@ -103,7 +110,7 @@ function GridVirtualScroller(props) {
|
|
|
103
110
|
virtualScroller: virtualScroller
|
|
104
111
|
})]
|
|
105
112
|
}))
|
|
106
|
-
})), /*#__PURE__*/_jsx(SpaceFiller, {
|
|
113
|
+
})), hasBottomFiller && /*#__PURE__*/_jsx(SpaceFiller, {
|
|
107
114
|
rowsLength: rows.length
|
|
108
115
|
}), /*#__PURE__*/_jsx(BottomContainer, {
|
|
109
116
|
children: /*#__PURE__*/_jsx(rootProps.slots.pinnedRows, {
|
|
@@ -111,9 +118,9 @@ function GridVirtualScroller(props) {
|
|
|
111
118
|
virtualScroller: virtualScroller
|
|
112
119
|
})
|
|
113
120
|
})]
|
|
114
|
-
})),
|
|
121
|
+
})), hasScrollX && !rootProps.unstable_listView && /*#__PURE__*/_jsx(Scrollbar, _extends({
|
|
115
122
|
position: "horizontal"
|
|
116
|
-
}, getScrollbarHorizontalProps())),
|
|
123
|
+
}, getScrollbarHorizontalProps())), hasScrollY && /*#__PURE__*/_jsx(Scrollbar, _extends({
|
|
117
124
|
position: "vertical"
|
|
118
125
|
}, getScrollbarVerticalProps())), props.children]
|
|
119
126
|
}));
|