@mui/x-data-grid 7.18.0 → 7.20.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 +213 -11
- package/DataGrid/DataGrid.js +12 -0
- package/components/cell/GridCell.js +7 -8
- package/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
- package/components/columnHeaders/GridColumnHeaderItem.js +1 -0
- package/components/columnSelection/GridCellCheckboxRenderer.js +12 -4
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/containers/GridRoot.js +1 -1
- package/components/containers/GridRootStyles.js +32 -23
- package/components/containers/GridToolbarContainer.js +1 -1
- package/components/menu/GridMenu.js +1 -1
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/GridPanel.js +1 -1
- package/components/panel/GridPanelContent.js +1 -1
- package/components/panel/GridPanelFooter.js +1 -1
- package/components/panel/GridPanelHeader.js +1 -1
- package/components/panel/GridPanelWrapper.js +1 -1
- package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
- package/components/toolbar/GridToolbarQuickFilter.js +1 -1
- package/components/virtualization/GridBottomContainer.d.ts +1 -1
- package/components/virtualization/GridBottomContainer.js +18 -1
- package/components/virtualization/GridMainContainer.js +3 -1
- package/components/virtualization/GridTopContainer.d.ts +1 -1
- package/components/virtualization/GridTopContainer.js +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +1 -7
- package/components/virtualization/GridVirtualScroller.js +1 -0
- package/components/virtualization/GridVirtualScrollerFiller.js +3 -4
- package/hooks/core/useGridRefs.js +4 -0
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +4 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
- package/hooks/features/columnResize/columnResizeSelector.d.ts +1 -1
- package/hooks/features/columns/gridColumnsSelector.d.ts +12 -12
- package/hooks/features/columns/gridColumnsUtils.js +3 -2
- package/hooks/features/density/densitySelector.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/hooks/features/editing/useGridCellEditing.js +4 -2
- package/hooks/features/editing/useGridRowEditing.js +4 -2
- package/hooks/features/events/useGridEvents.d.ts +1 -1
- package/hooks/features/events/useGridEvents.js +1 -0
- package/hooks/features/filter/gridFilterSelector.d.ts +17 -17
- package/hooks/features/filter/gridFilterUtils.js +1 -1
- package/hooks/features/focus/gridFocusStateSelector.d.ts +8 -8
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
- package/hooks/features/keyboardNavigation/utils.d.ts +1 -1
- package/hooks/features/pagination/gridPaginationSelector.d.ts +9 -9
- package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +105 -29
- package/hooks/features/rowSelection/utils.d.ts +10 -0
- package/hooks/features/rowSelection/utils.js +156 -1
- package/hooks/features/rows/gridRowSpanningSelectors.d.ts +3 -3
- package/hooks/features/rows/gridRowsSelector.d.ts +14 -14
- package/hooks/features/rows/gridRowsUtils.js +1 -1
- package/hooks/features/rows/useGridRowSpanning.js +1 -1
- package/hooks/features/rows/useGridRows.d.ts +1 -1
- package/hooks/features/rows/useGridRows.js +7 -1
- package/hooks/features/scroll/useGridScroll.js +26 -22
- package/hooks/features/sorting/gridSortingSelector.d.ts +4 -4
- package/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +5 -5
- package/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/hooks/utils/useGridApiContext.js +1 -1
- package/hooks/utils/useGridApiEventHandler.d.ts +1 -1
- package/hooks/utils/useGridApiEventHandler.js +1 -1
- package/hooks/utils/useGridConfiguration.js +1 -1
- package/hooks/utils/useGridPrivateApiContext.js +1 -1
- package/hooks/utils/useGridVisibleRows.d.ts +2 -2
- package/index.d.ts +2 -2
- package/index.js +3 -3
- package/internals/index.d.ts +1 -0
- package/internals/index.js +1 -0
- package/joy/icons.js +0 -1
- package/locales/bgBG.js +8 -9
- package/locales/deDE.js +4 -4
- package/locales/frFR.js +4 -4
- package/locales/hrHR.d.ts +1 -1
- package/locales/hrHR.js +69 -46
- package/locales/jaJP.js +5 -6
- package/locales/ptPT.d.ts +1 -1
- package/locales/ptPT.js +4 -4
- package/locales/viVN.js +20 -20
- package/locales/zhHK.d.ts +1 -1
- package/models/api/gridApiCommunity.d.ts +1 -1
- package/models/api/gridCoreApi.d.ts +9 -1
- package/models/api/gridFilterApi.d.ts +1 -1
- package/models/events/gridEventLookup.d.ts +7 -0
- package/models/gridRowSelectionModel.d.ts +4 -0
- package/models/gridStateCommunity.d.ts +2 -2
- package/models/props/DataGridProps.d.ts +38 -10
- package/modern/DataGrid/DataGrid.js +12 -0
- package/modern/components/cell/GridCell.js +7 -8
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +1 -0
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +12 -4
- package/modern/components/containers/GridRoot.js +1 -1
- package/modern/components/containers/GridRootStyles.js +32 -23
- package/modern/components/containers/GridToolbarContainer.js +1 -1
- package/modern/components/menu/GridMenu.js +1 -1
- package/modern/components/panel/GridPanel.js +1 -1
- package/modern/components/panel/GridPanelContent.js +1 -1
- package/modern/components/panel/GridPanelFooter.js +1 -1
- package/modern/components/panel/GridPanelHeader.js +1 -1
- package/modern/components/panel/GridPanelWrapper.js +1 -1
- package/modern/components/toolbar/GridToolbarQuickFilter.js +1 -1
- package/modern/components/virtualization/GridBottomContainer.js +18 -1
- package/modern/components/virtualization/GridMainContainer.js +3 -1
- package/modern/components/virtualization/GridTopContainer.js +1 -1
- package/modern/components/virtualization/GridVirtualScrollbar.js +1 -7
- package/modern/components/virtualization/GridVirtualScroller.js +1 -0
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +3 -4
- package/modern/hooks/core/useGridRefs.js +4 -0
- package/modern/hooks/features/columns/gridColumnsUtils.js +3 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/modern/hooks/features/editing/useGridCellEditing.js +4 -2
- package/modern/hooks/features/editing/useGridRowEditing.js +4 -2
- package/modern/hooks/features/events/useGridEvents.js +1 -0
- package/modern/hooks/features/filter/gridFilterUtils.js +1 -1
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +105 -29
- package/modern/hooks/features/rowSelection/utils.js +156 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +1 -1
- package/modern/hooks/features/rows/useGridRowSpanning.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +7 -1
- package/modern/hooks/features/scroll/useGridScroll.js +26 -22
- package/modern/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/modern/hooks/utils/useGridApiContext.js +1 -1
- package/modern/hooks/utils/useGridApiEventHandler.js +1 -1
- package/modern/hooks/utils/useGridConfiguration.js +1 -1
- package/modern/hooks/utils/useGridPrivateApiContext.js +1 -1
- package/modern/index.js +3 -3
- package/modern/internals/index.js +1 -0
- package/modern/joy/icons.js +0 -1
- package/modern/locales/bgBG.js +8 -9
- package/modern/locales/deDE.js +4 -4
- package/modern/locales/frFR.js +4 -4
- package/modern/locales/hrHR.js +69 -46
- package/modern/locales/jaJP.js +5 -6
- package/modern/locales/ptPT.js +4 -4
- package/modern/locales/viVN.js +20 -20
- package/modern/utils/createSelector.js +6 -0
- package/modern/utils/domUtils.js +1 -1
- package/node/DataGrid/DataGrid.js +12 -0
- package/node/components/cell/GridCell.js +7 -8
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
- package/node/components/columnHeaders/GridColumnHeaderItem.js +1 -0
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +12 -4
- package/node/components/containers/GridRoot.js +1 -1
- package/node/components/containers/GridRootStyles.js +32 -23
- package/node/components/containers/GridToolbarContainer.js +1 -1
- package/node/components/menu/GridMenu.js +1 -1
- package/node/components/panel/GridPanel.js +1 -1
- package/node/components/panel/GridPanelContent.js +1 -1
- package/node/components/panel/GridPanelFooter.js +1 -1
- package/node/components/panel/GridPanelHeader.js +1 -1
- package/node/components/panel/GridPanelWrapper.js +1 -1
- package/node/components/toolbar/GridToolbarQuickFilter.js +1 -1
- package/node/components/virtualization/GridBottomContainer.js +18 -1
- package/node/components/virtualization/GridMainContainer.js +3 -1
- package/node/components/virtualization/GridTopContainer.js +1 -1
- package/node/components/virtualization/GridVirtualScrollbar.js +1 -7
- package/node/components/virtualization/GridVirtualScroller.js +1 -0
- package/node/components/virtualization/GridVirtualScrollerFiller.js +3 -4
- package/node/hooks/core/useGridRefs.js +4 -0
- package/node/hooks/features/columns/gridColumnsUtils.js +3 -2
- package/node/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/node/hooks/features/editing/useGridCellEditing.js +4 -2
- package/node/hooks/features/editing/useGridRowEditing.js +4 -2
- package/node/hooks/features/events/useGridEvents.js +1 -0
- package/node/hooks/features/filter/gridFilterUtils.js +1 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +102 -26
- package/node/hooks/features/rowSelection/utils.js +160 -1
- package/node/hooks/features/rows/gridRowsUtils.js +1 -1
- package/node/hooks/features/rows/useGridRowSpanning.js +1 -1
- package/node/hooks/features/rows/useGridRows.js +7 -1
- package/node/hooks/features/scroll/useGridScroll.js +26 -22
- package/node/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/node/hooks/utils/useGridApiContext.js +1 -1
- package/node/hooks/utils/useGridApiEventHandler.js +1 -1
- package/node/hooks/utils/useGridConfiguration.js +1 -1
- package/node/hooks/utils/useGridPrivateApiContext.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +23 -15
- package/node/joy/icons.js +0 -1
- package/node/locales/bgBG.js +8 -9
- package/node/locales/deDE.js +4 -4
- package/node/locales/frFR.js +4 -4
- package/node/locales/hrHR.js +69 -46
- package/node/locales/jaJP.js +5 -6
- package/node/locales/ptPT.js +4 -4
- package/node/locales/viVN.js +20 -20
- package/node/utils/createSelector.js +6 -0
- package/node/utils/domUtils.js +1 -1
- package/package.json +4 -4
- package/utils/createSelector.js +6 -0
- package/utils/domUtils.js +1 -1
package/locales/jaJP.js
CHANGED
|
@@ -33,8 +33,7 @@ const jaJPGrid = {
|
|
|
33
33
|
columnsManagementSearchTitle: '検索',
|
|
34
34
|
columnsManagementNoColumns: 'カラムなし',
|
|
35
35
|
columnsManagementShowHideAllText: 'すべて表示/非表示',
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
columnsManagementReset: 'リセット',
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'フィルター追加',
|
|
40
39
|
filterPanelRemoveAll: 'すべて削除',
|
|
@@ -48,9 +47,9 @@ const jaJPGrid = {
|
|
|
48
47
|
filterPanelInputPlaceholder: '値を入力…',
|
|
49
48
|
// Filter operators text
|
|
50
49
|
filterOperatorContains: '...を含む',
|
|
51
|
-
|
|
50
|
+
filterOperatorDoesNotContain: '...を含まない',
|
|
52
51
|
filterOperatorEquals: '...に等しい',
|
|
53
|
-
|
|
52
|
+
filterOperatorDoesNotEqual: '...に等しくない',
|
|
54
53
|
filterOperatorStartsWith: '...で始まる',
|
|
55
54
|
filterOperatorEndsWith: '...で終わる',
|
|
56
55
|
filterOperatorIs: '...である',
|
|
@@ -70,9 +69,9 @@ const jaJPGrid = {
|
|
|
70
69
|
'filterOperator<=': '<=',
|
|
71
70
|
// Header filter operators text
|
|
72
71
|
headerFilterOperatorContains: '含む',
|
|
73
|
-
|
|
72
|
+
headerFilterOperatorDoesNotContain: '含まない',
|
|
74
73
|
headerFilterOperatorEquals: '等しい',
|
|
75
|
-
|
|
74
|
+
headerFilterOperatorDoesNotEqual: '等しくない',
|
|
76
75
|
headerFilterOperatorStartsWith: 'で始まる',
|
|
77
76
|
headerFilterOperatorEndsWith: 'で終わる',
|
|
78
77
|
headerFilterOperatorIs: 'である',
|
package/locales/ptPT.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ptPT: import("../
|
|
1
|
+
export declare const ptPT: import("../internals").Localization;
|
package/locales/ptPT.js
CHANGED
|
@@ -47,9 +47,9 @@ const ptPTGrid = {
|
|
|
47
47
|
filterPanelInputPlaceholder: 'Valor do filtro',
|
|
48
48
|
// Filter operators text
|
|
49
49
|
filterOperatorContains: 'contém',
|
|
50
|
-
|
|
50
|
+
filterOperatorDoesNotContain: 'não contém',
|
|
51
51
|
filterOperatorEquals: 'é igual a',
|
|
52
|
-
|
|
52
|
+
filterOperatorDoesNotEqual: 'não é igual a',
|
|
53
53
|
filterOperatorStartsWith: 'começa com',
|
|
54
54
|
filterOperatorEndsWith: 'termina com',
|
|
55
55
|
filterOperatorIs: 'é',
|
|
@@ -69,9 +69,9 @@ const ptPTGrid = {
|
|
|
69
69
|
'filterOperator<=': '<=',
|
|
70
70
|
// Header filter operators text
|
|
71
71
|
headerFilterOperatorContains: 'Contém',
|
|
72
|
-
|
|
72
|
+
headerFilterOperatorDoesNotContain: 'Não contém',
|
|
73
73
|
headerFilterOperatorEquals: 'É igual a',
|
|
74
|
-
|
|
74
|
+
headerFilterOperatorDoesNotEqual: 'Não é igual',
|
|
75
75
|
headerFilterOperatorStartsWith: 'Começa com',
|
|
76
76
|
headerFilterOperatorEndsWith: 'Termina com',
|
|
77
77
|
headerFilterOperatorIs: 'É',
|
package/locales/viVN.js
CHANGED
|
@@ -46,21 +46,21 @@ const viVNGrid = {
|
|
|
46
46
|
filterPanelInputLabel: 'Giá trị',
|
|
47
47
|
filterPanelInputPlaceholder: 'Lọc giá trị',
|
|
48
48
|
// Filter operators text
|
|
49
|
-
filterOperatorContains: '
|
|
50
|
-
|
|
51
|
-
filterOperatorEquals: '
|
|
52
|
-
|
|
53
|
-
filterOperatorStartsWith: '
|
|
54
|
-
filterOperatorEndsWith: '
|
|
55
|
-
filterOperatorIs: '
|
|
56
|
-
filterOperatorNot: '
|
|
57
|
-
filterOperatorAfter: '
|
|
49
|
+
filterOperatorContains: 'chứa',
|
|
50
|
+
filterOperatorDoesNotContain: 'không chứa',
|
|
51
|
+
filterOperatorEquals: 'bằng',
|
|
52
|
+
filterOperatorDoesNotEqual: 'không bằng',
|
|
53
|
+
filterOperatorStartsWith: 'bắt đầu với',
|
|
54
|
+
filterOperatorEndsWith: 'kết thúc với',
|
|
55
|
+
filterOperatorIs: 'là',
|
|
56
|
+
filterOperatorNot: 'không phải là',
|
|
57
|
+
filterOperatorAfter: 'sau',
|
|
58
58
|
filterOperatorOnOrAfter: 'bằng hoặc sau',
|
|
59
|
-
filterOperatorBefore: '
|
|
59
|
+
filterOperatorBefore: 'trước',
|
|
60
60
|
filterOperatorOnOrBefore: 'bằng hoặc trước',
|
|
61
|
-
filterOperatorIsEmpty: '
|
|
62
|
-
filterOperatorIsNotEmpty: '
|
|
63
|
-
filterOperatorIsAnyOf: '
|
|
61
|
+
filterOperatorIsEmpty: 'rỗng',
|
|
62
|
+
filterOperatorIsNotEmpty: 'khác rỗng',
|
|
63
|
+
filterOperatorIsAnyOf: 'là một trong',
|
|
64
64
|
'filterOperator=': '=',
|
|
65
65
|
'filterOperator!=': '!=',
|
|
66
66
|
'filterOperator>': '>',
|
|
@@ -69,20 +69,20 @@ const viVNGrid = {
|
|
|
69
69
|
'filterOperator<=': '<=',
|
|
70
70
|
// Header filter operators text
|
|
71
71
|
headerFilterOperatorContains: 'Chứa',
|
|
72
|
-
|
|
72
|
+
headerFilterOperatorDoesNotContain: 'Không chứa',
|
|
73
73
|
headerFilterOperatorEquals: 'Bằng',
|
|
74
|
-
|
|
74
|
+
headerFilterOperatorDoesNotEqual: 'Không bằng',
|
|
75
75
|
headerFilterOperatorStartsWith: 'Bắt đầu với',
|
|
76
76
|
headerFilterOperatorEndsWith: 'Kết thúc với',
|
|
77
|
-
headerFilterOperatorIs: '
|
|
78
|
-
headerFilterOperatorNot: 'Không là',
|
|
77
|
+
headerFilterOperatorIs: 'Là',
|
|
78
|
+
headerFilterOperatorNot: 'Không phải là',
|
|
79
79
|
headerFilterOperatorAfter: 'Sau',
|
|
80
|
-
headerFilterOperatorOnOrAfter: '
|
|
80
|
+
headerFilterOperatorOnOrAfter: 'Bằng hoặc sau',
|
|
81
81
|
headerFilterOperatorBefore: 'Trước',
|
|
82
|
-
headerFilterOperatorOnOrBefore: '
|
|
82
|
+
headerFilterOperatorOnOrBefore: 'Bằng hoặc trước',
|
|
83
83
|
headerFilterOperatorIsEmpty: 'Rỗng',
|
|
84
84
|
headerFilterOperatorIsNotEmpty: 'Khác rỗng',
|
|
85
|
-
headerFilterOperatorIsAnyOf: '
|
|
85
|
+
headerFilterOperatorIsAnyOf: 'Là một trong',
|
|
86
86
|
'headerFilterOperator=': 'Bằng',
|
|
87
87
|
'headerFilterOperator!=': 'Khác',
|
|
88
88
|
'headerFilterOperator>': 'Lớn hơn',
|
package/locales/zhHK.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const zhHK: import("../
|
|
1
|
+
export declare const zhHK: import("../internals").Localization;
|
|
@@ -5,7 +5,7 @@ import type { GridColumnReorderApi } from './gridColumnApi';
|
|
|
5
5
|
import { GridRowProApi } from './gridRowApi';
|
|
6
6
|
import { GridRowMultiSelectionApi } from './gridRowSelectionApi';
|
|
7
7
|
/**
|
|
8
|
-
* The api of
|
|
8
|
+
* The api of Data Grid.
|
|
9
9
|
*/
|
|
10
10
|
export interface GridApiCommunity extends GridApiCommon<GridStateCommunity, GridInitialStateCommunity> {
|
|
11
11
|
}
|
|
@@ -61,9 +61,17 @@ export interface GridCorePrivateApi<GridPublicApi extends GridApiCommon, GridPri
|
|
|
61
61
|
*/
|
|
62
62
|
mainElementRef: React.RefObject<HTMLDivElement>;
|
|
63
63
|
/**
|
|
64
|
-
* The React ref of the grid virtual scroller container element.
|
|
64
|
+
* The React ref of the grid's virtual scroller container element.
|
|
65
65
|
*/
|
|
66
66
|
virtualScrollerRef: React.RefObject<HTMLDivElement>;
|
|
67
|
+
/**
|
|
68
|
+
* The React ref of the grid's vertical virtual scrollbar container element.
|
|
69
|
+
*/
|
|
70
|
+
virtualScrollbarVerticalRef: React.RefObject<HTMLDivElement>;
|
|
71
|
+
/**
|
|
72
|
+
* The React ref of the grid's horizontal virtual scrollbar container element.
|
|
73
|
+
*/
|
|
74
|
+
virtualScrollbarHorizontalRef: React.RefObject<HTMLDivElement>;
|
|
67
75
|
/**
|
|
68
76
|
* The React ref of the grid column container virtualized div element.
|
|
69
77
|
*/
|
|
@@ -59,7 +59,7 @@ export interface GridFilterApi {
|
|
|
59
59
|
*/
|
|
60
60
|
ignoreDiacritics: DataGridProcessedProps['ignoreDiacritics'];
|
|
61
61
|
/**
|
|
62
|
-
* Returns the filter state for the given filter model without applying it to the
|
|
62
|
+
* Returns the filter state for the given filter model without applying it to the Data Grid.
|
|
63
63
|
* @param {GridFilterModel} filterModel The filter model to get the state for.
|
|
64
64
|
* @returns {GridStateCommunity['filter']} The filter state.
|
|
65
65
|
*/
|
|
@@ -92,6 +92,13 @@ export interface GridColumnHeaderEventLookup {
|
|
|
92
92
|
params: GridColumnHeaderParams;
|
|
93
93
|
event: React.MouseEvent<HTMLElement>;
|
|
94
94
|
};
|
|
95
|
+
/**
|
|
96
|
+
* Fired when the user attempts to open a context menu in the column header.
|
|
97
|
+
*/
|
|
98
|
+
columnHeaderContextMenu: {
|
|
99
|
+
params: GridColumnHeaderParams;
|
|
100
|
+
event: React.MouseEvent<HTMLElement>;
|
|
101
|
+
};
|
|
95
102
|
/**
|
|
96
103
|
* Fired when a column header is double-clicked.
|
|
97
104
|
*/
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { GridRowId } from './gridRows';
|
|
2
|
+
export type GridRowSelectionPropagation = {
|
|
3
|
+
descendants?: boolean;
|
|
4
|
+
parents?: boolean;
|
|
5
|
+
};
|
|
2
6
|
export type GridInputRowSelectionModel = readonly GridRowId[] | GridRowId;
|
|
3
7
|
export type GridRowSelectionModel = readonly GridRowId[];
|
|
@@ -7,7 +7,7 @@ import type { GridVisibleRowsLookupState } from '../hooks/features/filter/gridFi
|
|
|
7
7
|
import type { GridColumnResizeState } from '../hooks/features/columnResize';
|
|
8
8
|
import type { GridRowSpanningState } from '../hooks/features/rows/useGridRowSpanning';
|
|
9
9
|
/**
|
|
10
|
-
* The state of
|
|
10
|
+
* The state of Data Grid.
|
|
11
11
|
*/
|
|
12
12
|
export interface GridStateCommunity {
|
|
13
13
|
isRtl: boolean;
|
|
@@ -34,7 +34,7 @@ export interface GridStateCommunity {
|
|
|
34
34
|
rowSpanning: GridRowSpanningState;
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
* The initial state of
|
|
37
|
+
* The initial state of Data Grid.
|
|
38
38
|
*/
|
|
39
39
|
export interface GridInitialStateCommunity {
|
|
40
40
|
pagination?: GridPaginationInitialState;
|
|
@@ -8,7 +8,7 @@ import { GridFeatureMode } from '../gridFeatureMode';
|
|
|
8
8
|
import { Logger } from '../logger';
|
|
9
9
|
import { GridSortDirection, GridSortModel } from '../gridSortModel';
|
|
10
10
|
import { GridSlotsComponent } from '../gridSlotsComponent';
|
|
11
|
-
import { GridRowIdGetter, GridRowsProp, GridValidRowModel } from '../gridRows';
|
|
11
|
+
import { GridRowId, GridRowIdGetter, GridRowsProp, GridValidRowModel } from '../gridRows';
|
|
12
12
|
import { GridEventListener } from '../events';
|
|
13
13
|
import { GridCallbackDetails, GridLocaleText } from '../api';
|
|
14
14
|
import { GridApiCommunity } from '../api/gridApiCommunity';
|
|
@@ -26,6 +26,7 @@ import { GridColumnGroupingModel } from '../gridColumnGrouping';
|
|
|
26
26
|
import { GridPaginationMeta, GridPaginationModel } from '../gridPaginationProps';
|
|
27
27
|
import type { GridAutosizeOptions } from '../../hooks/features/columnResize';
|
|
28
28
|
import type { GridDataSource } from '../gridDataSource';
|
|
29
|
+
import type { GridRowSelectionPropagation } from '../gridRowSelectionModel';
|
|
29
30
|
export interface GridExperimentalFeatures {
|
|
30
31
|
/**
|
|
31
32
|
* Emits a warning if the cell receives focus without also syncing the focus state.
|
|
@@ -34,25 +35,25 @@ export interface GridExperimentalFeatures {
|
|
|
34
35
|
warnIfFocusStateIsNotSynced: boolean;
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
|
-
* The props users can give to the
|
|
38
|
+
* The props users can give to the Data Grid component.
|
|
38
39
|
*/
|
|
39
40
|
export type DataGridProps<R extends GridValidRowModel = any> = Omit<Partial<DataGridPropsWithDefaultValues<R>> & DataGridPropsWithComplexDefaultValueBeforeProcessing & DataGridPropsWithoutDefaultValue<R>, DataGridForcedPropsKey> & {
|
|
40
41
|
pagination?: true;
|
|
41
42
|
};
|
|
42
43
|
/**
|
|
43
|
-
* The props of the
|
|
44
|
+
* The props of the Data Grid component after the pre-processing phase that the user should not be able to override.
|
|
44
45
|
* Those are usually used in feature-hook for which the pro-plan has more advanced features (eg: multi-sorting, multi-filtering, ...).
|
|
45
46
|
*/
|
|
46
47
|
export type DataGridForcedPropsKey = 'checkboxSelectionVisibleOnly' | 'disableMultipleColumnsFiltering' | 'disableMultipleColumnsSorting' | 'disableColumnReorder' | 'keepColumnPositionIfDraggedOutside' | 'throttleRowsMs' | 'hideFooterRowCount' | 'pagination' | 'signature';
|
|
47
48
|
/**
|
|
48
|
-
* The
|
|
49
|
+
* The Data Grid options with a default value that must be merged with the value given through props.
|
|
49
50
|
*/
|
|
50
51
|
export interface DataGridPropsWithComplexDefaultValueAfterProcessing {
|
|
51
52
|
slots: GridSlotsComponent;
|
|
52
53
|
localeText: GridLocaleText;
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
55
|
-
* The
|
|
56
|
+
* The Data Grid options with a default value that must be merged with the value given through props.
|
|
56
57
|
*/
|
|
57
58
|
export interface DataGridPropsWithComplexDefaultValueBeforeProcessing {
|
|
58
59
|
/**
|
|
@@ -66,7 +67,7 @@ export interface DataGridPropsWithComplexDefaultValueBeforeProcessing {
|
|
|
66
67
|
localeText?: Partial<GridLocaleText>;
|
|
67
68
|
}
|
|
68
69
|
/**
|
|
69
|
-
* The
|
|
70
|
+
* The Data Grid options with a default value overridable through props
|
|
70
71
|
* None of the entry of this interface should be optional, they all have default values and `DataGridProps` already applies a `Partial<DataGridSimpleOptions>` for the public interface
|
|
71
72
|
* The controlled model do not have a default value at the prop processing level, so they must be defined in `DataGridOtherProps`
|
|
72
73
|
* TODO: add multiSortKey
|
|
@@ -75,6 +76,11 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
|
|
|
75
76
|
/**
|
|
76
77
|
* If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
|
|
77
78
|
* @default false
|
|
79
|
+
* @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
|
|
80
|
+
* @example
|
|
81
|
+
* <div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
82
|
+
* <DataGrid />
|
|
83
|
+
* </div>
|
|
78
84
|
*/
|
|
79
85
|
autoHeight: boolean;
|
|
80
86
|
/**
|
|
@@ -364,7 +370,7 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
|
|
|
364
370
|
unstable_rowSpanning: boolean;
|
|
365
371
|
}
|
|
366
372
|
/**
|
|
367
|
-
* The
|
|
373
|
+
* The Data Grid props with no default value.
|
|
368
374
|
*/
|
|
369
375
|
export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel = any> extends CommonProps {
|
|
370
376
|
/**
|
|
@@ -509,6 +515,12 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
509
515
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
510
516
|
*/
|
|
511
517
|
onColumnHeaderClick?: GridEventListener<'columnHeaderClick'>;
|
|
518
|
+
/**
|
|
519
|
+
* Callback fired when a contextmenu event comes from a column header element.
|
|
520
|
+
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
521
|
+
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
522
|
+
*/
|
|
523
|
+
onColumnHeaderContextMenu?: GridEventListener<'columnHeaderContextMenu'>;
|
|
512
524
|
/**
|
|
513
525
|
* Callback fired when a double click event comes from a column header element.
|
|
514
526
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
@@ -744,9 +756,12 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
744
756
|
* @template R
|
|
745
757
|
* @param {R} newRow Row object with the new values.
|
|
746
758
|
* @param {R} oldRow Row object with the old values.
|
|
759
|
+
* @param {{ rowId: GridRowId }} params Additional parameters.
|
|
747
760
|
* @returns {Promise<R> | R} The final values to update the row.
|
|
748
761
|
*/
|
|
749
|
-
processRowUpdate?: (newRow: R, oldRow: R
|
|
762
|
+
processRowUpdate?: (newRow: R, oldRow: R, params: {
|
|
763
|
+
rowId: GridRowId;
|
|
764
|
+
}) => Promise<R> | R;
|
|
750
765
|
/**
|
|
751
766
|
* Callback called when `processRowUpdate` throws an error or rejects.
|
|
752
767
|
* @param {any} error The error thrown.
|
|
@@ -784,10 +799,23 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
784
799
|
}
|
|
785
800
|
export interface DataGridProSharedPropsWithDefaultValue {
|
|
786
801
|
/**
|
|
787
|
-
* If `true`,
|
|
802
|
+
* If `true`, the header filters feature is enabled.
|
|
788
803
|
* @default false
|
|
789
804
|
*/
|
|
790
805
|
headerFilters: boolean;
|
|
806
|
+
/**
|
|
807
|
+
* When `rowSelectionPropagation.descendants` is set to `true`.
|
|
808
|
+
* - Selecting a parent selects all its filtered descendants automatically.
|
|
809
|
+
* - Deselecting a parent row deselects all its filtered descendants automatically.
|
|
810
|
+
*
|
|
811
|
+
* When `rowSelectionPropagation.parents` is set to `true`
|
|
812
|
+
* - Selecting all the filtered descendants of a parent selects the parent automatically.
|
|
813
|
+
* - Deselecting a descendant of a selected parent deselects the parent automatically.
|
|
814
|
+
*
|
|
815
|
+
* Works with tree data and row grouping on the client-side only.
|
|
816
|
+
* @default { parents: false, descendants: false }
|
|
817
|
+
*/
|
|
818
|
+
rowSelectionPropagation: GridRowSelectionPropagation;
|
|
791
819
|
}
|
|
792
820
|
export interface DataGridProSharedPropsWithoutDefaultValue {
|
|
793
821
|
/**
|
|
@@ -804,7 +832,7 @@ export interface DataGridPremiumSharedPropsWithDefaultValue {
|
|
|
804
832
|
cellSelection: boolean;
|
|
805
833
|
}
|
|
806
834
|
/**
|
|
807
|
-
* The props of the
|
|
835
|
+
* The props of the Data Grid component after the pre-processing phase.
|
|
808
836
|
*/
|
|
809
837
|
export interface DataGridProcessedProps<R extends GridValidRowModel = any> extends DataGridPropsWithDefaultValues, DataGridPropsWithComplexDefaultValueAfterProcessing, DataGridPropsWithoutDefaultValue<R>, DataGridProSharedPropsWithoutDefaultValue, Partial<DataGridProSharedPropsWithDefaultValue>, Partial<DataGridPremiumSharedPropsWithDefaultValue> {
|
|
810
838
|
}
|
|
@@ -73,6 +73,11 @@ DataGridRaw.propTypes = {
|
|
|
73
73
|
/**
|
|
74
74
|
* If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
|
|
75
75
|
* @default false
|
|
76
|
+
* @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
|
|
77
|
+
* @example
|
|
78
|
+
* <div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
79
|
+
* <DataGrid />
|
|
80
|
+
* </div>
|
|
76
81
|
*/
|
|
77
82
|
autoHeight: PropTypes.bool,
|
|
78
83
|
/**
|
|
@@ -433,6 +438,12 @@ DataGridRaw.propTypes = {
|
|
|
433
438
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
434
439
|
*/
|
|
435
440
|
onColumnHeaderClick: PropTypes.func,
|
|
441
|
+
/**
|
|
442
|
+
* Callback fired when a contextmenu event comes from a column header element.
|
|
443
|
+
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
444
|
+
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
445
|
+
*/
|
|
446
|
+
onColumnHeaderContextMenu: PropTypes.func,
|
|
436
447
|
/**
|
|
437
448
|
* Callback fired when a double click event comes from a column header element.
|
|
438
449
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
@@ -650,6 +661,7 @@ DataGridRaw.propTypes = {
|
|
|
650
661
|
* @template R
|
|
651
662
|
* @param {R} newRow Row object with the new values.
|
|
652
663
|
* @param {R} oldRow Row object with the old values.
|
|
664
|
+
* @param {{ rowId: GridRowId }} params Additional parameters.
|
|
653
665
|
* @returns {Promise<R> | R} The final values to update the row.
|
|
654
666
|
*/
|
|
655
667
|
processRowUpdate: PropTypes.func,
|
|
@@ -118,11 +118,11 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
118
118
|
const result = apiRef.current.getCellParams(rowId, field);
|
|
119
119
|
result.api = apiRef.current;
|
|
120
120
|
return result;
|
|
121
|
-
} catch (
|
|
122
|
-
if (
|
|
121
|
+
} catch (error) {
|
|
122
|
+
if (error instanceof MissingRowIdError) {
|
|
123
123
|
return EMPTY_CELL_PARAMS;
|
|
124
124
|
}
|
|
125
|
-
throw
|
|
125
|
+
throw error;
|
|
126
126
|
}
|
|
127
127
|
}, objectShallowCompare);
|
|
128
128
|
const isSelected = useGridSelector(apiRef, () => apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {
|
|
@@ -255,10 +255,9 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
255
255
|
return /*#__PURE__*/_jsx("div", {
|
|
256
256
|
"data-colindex": colIndex,
|
|
257
257
|
role: "presentation",
|
|
258
|
-
style: _extends({
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
})
|
|
258
|
+
style: _extends({
|
|
259
|
+
width: 'var(--width)'
|
|
260
|
+
}, style)
|
|
262
261
|
});
|
|
263
262
|
}
|
|
264
263
|
if (cellParams === EMPTY_CELL_PARAMS) {
|
|
@@ -315,7 +314,7 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
315
314
|
};
|
|
316
315
|
return /*#__PURE__*/_jsx("div", _extends({
|
|
317
316
|
ref: handleRef,
|
|
318
|
-
className: clsx(
|
|
317
|
+
className: clsx(classes.root, classNames, className),
|
|
319
318
|
role: "gridcell",
|
|
320
319
|
"data-field": field,
|
|
321
320
|
"data-colindex": colIndex,
|
|
@@ -36,7 +36,7 @@ export const GridBaseColumnHeaders = /*#__PURE__*/React.forwardRef(function Grid
|
|
|
36
36
|
const classes = useUtilityClasses(rootProps);
|
|
37
37
|
return /*#__PURE__*/_jsx(GridColumnHeadersRoot, _extends({
|
|
38
38
|
ref: ref,
|
|
39
|
-
className: clsx(
|
|
39
|
+
className: clsx(classes.root, className),
|
|
40
40
|
ownerState: rootProps
|
|
41
41
|
}, other, {
|
|
42
42
|
role: "presentation"
|
|
@@ -92,6 +92,7 @@ function GridColumnHeaderItem(props) {
|
|
|
92
92
|
}, [apiRef, colDef.field]);
|
|
93
93
|
const mouseEventsHandlers = React.useMemo(() => ({
|
|
94
94
|
onClick: publish('columnHeaderClick'),
|
|
95
|
+
onContextMenu: publish('columnHeaderContextMenu'),
|
|
95
96
|
onDoubleClick: publish('columnHeaderDoubleClick'),
|
|
96
97
|
onMouseOver: publish('columnHeaderOver'),
|
|
97
98
|
// TODO remove as it's not used
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["field", "id", "
|
|
3
|
+
const _excluded = ["field", "id", "formattedValue", "row", "rowNode", "colDef", "isEditable", "cellMode", "hasFocus", "tabIndex", "api"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_composeClasses as composeClasses, unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
7
7
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
8
8
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
9
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
10
|
+
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
11
|
+
import { getCheckboxPropsSelector } from "../../hooks/features/rowSelection/utils.js";
|
|
10
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
13
|
const useUtilityClasses = ownerState => {
|
|
12
14
|
const {
|
|
@@ -21,7 +23,6 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
21
23
|
const {
|
|
22
24
|
field,
|
|
23
25
|
id,
|
|
24
|
-
value: isChecked,
|
|
25
26
|
rowNode,
|
|
26
27
|
hasFocus,
|
|
27
28
|
tabIndex
|
|
@@ -69,21 +70,28 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
69
70
|
event.stopPropagation();
|
|
70
71
|
}
|
|
71
72
|
}, []);
|
|
73
|
+
const isSelectable = apiRef.current.isRowSelectable(id);
|
|
74
|
+
const checkboxPropsSelector = getCheckboxPropsSelector(id, rootProps.rowSelectionPropagation?.parents ?? false);
|
|
75
|
+
const {
|
|
76
|
+
isIndeterminate,
|
|
77
|
+
isChecked
|
|
78
|
+
} = useGridSelector(apiRef, checkboxPropsSelector);
|
|
72
79
|
if (rowNode.type === 'footer' || rowNode.type === 'pinnedRow') {
|
|
73
80
|
return null;
|
|
74
81
|
}
|
|
75
|
-
const isSelectable = apiRef.current.isRowSelectable(id);
|
|
76
82
|
const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');
|
|
83
|
+
const checked = rootProps.indeterminateCheckboxAction === 'select' ? isChecked && !isIndeterminate : isChecked;
|
|
77
84
|
return /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({
|
|
78
85
|
ref: handleRef,
|
|
79
86
|
tabIndex: tabIndex,
|
|
80
|
-
checked:
|
|
87
|
+
checked: checked,
|
|
81
88
|
onChange: handleChange,
|
|
82
89
|
className: classes.root,
|
|
83
90
|
inputProps: {
|
|
84
91
|
'aria-label': label
|
|
85
92
|
},
|
|
86
93
|
onKeyDown: handleKeyDown,
|
|
94
|
+
indeterminate: isIndeterminate,
|
|
87
95
|
disabled: !isSelectable,
|
|
88
96
|
touchRippleRef: rippleRef /* FIXME: typing error */
|
|
89
97
|
}, rootProps.slotProps?.baseCheckbox, other));
|
|
@@ -46,7 +46,7 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
46
46
|
}
|
|
47
47
|
return /*#__PURE__*/_jsx(GridRootStyles, _extends({
|
|
48
48
|
ref: handleRef,
|
|
49
|
-
className: clsx(
|
|
49
|
+
className: clsx(classes.root, className),
|
|
50
50
|
ownerState: ownerState
|
|
51
51
|
}, other));
|
|
52
52
|
});
|
|
@@ -170,14 +170,28 @@ export const GridRootStyles = styled('div', {
|
|
|
170
170
|
const hoverOpacity = (t.vars || t).palette.action.hoverOpacity;
|
|
171
171
|
const hoverColor = (t.vars || t).palette.action.hover;
|
|
172
172
|
const selectedOpacity = (t.vars || t).palette.action.selectedOpacity;
|
|
173
|
+
const selectedHoverOpacity = t.vars ? `calc(${hoverOpacity} + ${selectedOpacity})` // TODO: Improve type
|
|
174
|
+
: hoverOpacity + selectedOpacity;
|
|
173
175
|
const selectedBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / ${selectedOpacity})` : alpha(t.palette.primary.main, selectedOpacity);
|
|
174
|
-
const selectedHoverBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} /
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
176
|
+
const selectedHoverBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / ${selectedHoverOpacity})` : alpha(t.palette.primary.main, selectedHoverOpacity);
|
|
177
|
+
const blendFn = t.vars ? blendCssVars : blend;
|
|
178
|
+
const getPinnedBackgroundStyles = backgroundColor => ({
|
|
179
|
+
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
180
|
+
backgroundColor,
|
|
181
|
+
'&.Mui-selected': {
|
|
182
|
+
backgroundColor: blendFn(backgroundColor, selectedBackground, selectedOpacity),
|
|
183
|
+
'&:hover': {
|
|
184
|
+
backgroundColor: blendFn(backgroundColor, selectedBackground, selectedHoverOpacity)
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
const pinnedBackgroundColor = blendFn(pinnedBackground, hoverColor, hoverOpacity);
|
|
190
|
+
const pinnedHoverStyles = getPinnedBackgroundStyles(pinnedBackgroundColor);
|
|
191
|
+
const pinnedSelectedBackgroundColor = blendFn(pinnedBackground, selectedBackground, selectedOpacity);
|
|
192
|
+
const pinnedSelectedStyles = getPinnedBackgroundStyles(pinnedSelectedBackgroundColor);
|
|
193
|
+
const pinnedSelectedHoverBackgroundColor = blendFn(pinnedBackground, selectedHoverBackground, selectedHoverOpacity);
|
|
194
|
+
const pinnedSelectedHoverStyles = getPinnedBackgroundStyles(pinnedSelectedHoverBackgroundColor);
|
|
181
195
|
const selectedStyles = {
|
|
182
196
|
backgroundColor: selectedBackground,
|
|
183
197
|
'&:hover': {
|
|
@@ -617,24 +631,15 @@ export const GridRootStyles = styled('div', {
|
|
|
617
631
|
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
618
632
|
position: 'sticky',
|
|
619
633
|
zIndex: 3,
|
|
620
|
-
background: 'var(--DataGrid-pinnedBackground)'
|
|
634
|
+
background: 'var(--DataGrid-pinnedBackground)',
|
|
635
|
+
'&.Mui-selected': {
|
|
636
|
+
backgroundColor: pinnedSelectedBackgroundColor
|
|
637
|
+
}
|
|
621
638
|
},
|
|
622
639
|
[`& .${c.virtualScrollerContent} .${c.row}`]: {
|
|
623
|
-
'&:hover':
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}
|
|
627
|
-
},
|
|
628
|
-
[`&.Mui-selected`]: {
|
|
629
|
-
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
630
|
-
backgroundColor: pinnedSelectedBackground
|
|
631
|
-
},
|
|
632
|
-
'&:hover': {
|
|
633
|
-
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
634
|
-
backgroundColor: pinnedSelectedHoverBackground
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
}
|
|
640
|
+
'&:hover': pinnedHoverStyles,
|
|
641
|
+
'&.Mui-selected': pinnedSelectedStyles,
|
|
642
|
+
'&.Mui-selected:hover': pinnedSelectedHoverStyles
|
|
638
643
|
},
|
|
639
644
|
[`& .${c.cellOffsetLeft}`]: {
|
|
640
645
|
flex: '0 0 auto',
|
|
@@ -747,4 +752,8 @@ function blend(background, overlay, opacity, gamma = 1) {
|
|
|
747
752
|
type: 'rgb',
|
|
748
753
|
values: rgb
|
|
749
754
|
});
|
|
755
|
+
}
|
|
756
|
+
const removeOpacity = color => `rgb(from ${color} r g b / 1)`;
|
|
757
|
+
function blendCssVars(background, overlay, opacity) {
|
|
758
|
+
return `color-mix(in srgb,${background}, ${removeOpacity(overlay)} calc(${opacity} * 100%))`;
|
|
750
759
|
}
|
|
@@ -44,7 +44,7 @@ const GridToolbarContainer = /*#__PURE__*/React.forwardRef(function GridToolbarC
|
|
|
44
44
|
}
|
|
45
45
|
return /*#__PURE__*/_jsx(GridToolbarContainerRoot, _extends({
|
|
46
46
|
ref: ref,
|
|
47
|
-
className: clsx(
|
|
47
|
+
className: clsx(classes.root, className),
|
|
48
48
|
ownerState: rootProps
|
|
49
49
|
}, other, {
|
|
50
50
|
children: children
|
|
@@ -85,7 +85,7 @@ function GridMenu(props) {
|
|
|
85
85
|
};
|
|
86
86
|
return /*#__PURE__*/_jsx(GridMenuRoot, _extends({
|
|
87
87
|
as: rootProps.slots.basePopper,
|
|
88
|
-
className: clsx(
|
|
88
|
+
className: clsx(classes.root, className),
|
|
89
89
|
ownerState: rootProps,
|
|
90
90
|
open: open,
|
|
91
91
|
anchorEl: target,
|
|
@@ -84,7 +84,7 @@ const GridPanel = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
84
84
|
return /*#__PURE__*/_jsx(GridPanelRoot, _extends({
|
|
85
85
|
ref: ref,
|
|
86
86
|
placement: "bottom-start",
|
|
87
|
-
className: clsx(
|
|
87
|
+
className: clsx(classes.panel, className),
|
|
88
88
|
ownerState: rootProps,
|
|
89
89
|
anchorEl: anchorEl,
|
|
90
90
|
modifiers: modifiers
|
|
@@ -37,7 +37,7 @@ function GridPanelContent(props) {
|
|
|
37
37
|
const rootProps = useGridRootProps();
|
|
38
38
|
const classes = useUtilityClasses(rootProps);
|
|
39
39
|
return /*#__PURE__*/_jsx(GridPanelContentRoot, _extends({
|
|
40
|
-
className: clsx(
|
|
40
|
+
className: clsx(classes.root, className),
|
|
41
41
|
ownerState: rootProps
|
|
42
42
|
}, other));
|
|
43
43
|
}
|
|
@@ -37,7 +37,7 @@ function GridPanelFooter(props) {
|
|
|
37
37
|
const rootProps = useGridRootProps();
|
|
38
38
|
const classes = useUtilityClasses(rootProps);
|
|
39
39
|
return /*#__PURE__*/_jsx(GridPanelFooterRoot, _extends({
|
|
40
|
-
className: clsx(
|
|
40
|
+
className: clsx(classes.root, className),
|
|
41
41
|
ownerState: rootProps
|
|
42
42
|
}, other));
|
|
43
43
|
}
|
|
@@ -35,7 +35,7 @@ function GridPanelHeader(props) {
|
|
|
35
35
|
const rootProps = useGridRootProps();
|
|
36
36
|
const classes = useUtilityClasses(rootProps);
|
|
37
37
|
return /*#__PURE__*/_jsx(GridPanelHeaderRoot, _extends({
|
|
38
|
-
className: clsx(
|
|
38
|
+
className: clsx(classes.root, className),
|
|
39
39
|
ownerState: rootProps
|
|
40
40
|
}, other));
|
|
41
41
|
}
|