@mui/x-data-grid 6.14.0 → 6.16.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 +167 -0
- package/DataGrid/useDataGridComponent.js +43 -40
- package/components/DataGridVirtualScroller.d.ts +1 -4
- package/components/DataGridVirtualScroller.js +3 -5
- package/components/GridRow.js +4 -2
- package/components/base/GridBody.d.ts +0 -1
- package/components/base/GridBody.js +2 -22
- package/components/cell/GridActionsCell.js +2 -2
- package/components/cell/GridActionsCellItem.d.ts +6 -0
- package/components/cell/GridCell.js +4 -2
- package/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/components/menu/GridMenu.d.ts +1 -2
- package/components/menu/GridMenu.js +21 -5
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +11 -8
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +6 -3
- package/hooks/features/export/useGridPrintExport.js +37 -7
- package/hooks/features/filter/gridFilterUtils.js +10 -6
- package/hooks/features/focus/useGridFocus.js +0 -1
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +2 -1
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +16 -0
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +18 -0
- package/hooks/features/virtualization/index.d.ts +2 -0
- package/hooks/features/virtualization/index.js +2 -0
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +53 -36
- package/hooks/features/virtualization/useGridVirtualization.d.ts +12 -0
- package/hooks/features/virtualization/useGridVirtualization.js +47 -0
- package/index.js +1 -1
- package/internals/index.d.ts +4 -0
- package/internals/index.js +4 -0
- package/legacy/DataGrid/useDataGridComponent.js +43 -40
- package/legacy/components/DataGridVirtualScroller.js +2 -4
- package/legacy/components/GridRow.js +4 -2
- package/legacy/components/base/GridBody.js +2 -26
- package/legacy/components/cell/GridActionsCell.js +2 -2
- package/legacy/components/cell/GridCell.js +4 -2
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/legacy/components/menu/GridMenu.js +21 -5
- package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +11 -8
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +2 -1
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +2 -1
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/legacy/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +6 -3
- package/legacy/hooks/features/export/useGridPrintExport.js +44 -12
- package/legacy/hooks/features/filter/gridFilterUtils.js +10 -6
- package/legacy/hooks/features/focus/useGridFocus.js +0 -1
- package/legacy/hooks/features/index.js +2 -1
- package/legacy/hooks/features/virtualization/gridVirtualizationSelectors.js +24 -0
- package/legacy/hooks/features/virtualization/index.js +2 -0
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +61 -39
- package/legacy/hooks/features/virtualization/useGridVirtualization.js +51 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +4 -0
- package/legacy/locales/ruRU.js +26 -28
- package/legacy/models/api/index.js +1 -2
- package/legacy/utils/createControllablePromise.js +11 -0
- package/locales/ruRU.js +26 -28
- package/models/api/gridApiCommon.d.ts +3 -4
- package/models/api/gridVirtualizationApi.d.ts +20 -0
- package/models/api/index.d.ts +1 -2
- package/models/api/index.js +1 -2
- package/models/events/gridEventLookup.d.ts +8 -0
- package/models/gridExport.d.ts +17 -4
- package/models/gridStateCommunity.d.ts +2 -1
- package/models/index.d.ts +1 -1
- package/modern/DataGrid/useDataGridComponent.js +43 -40
- package/modern/components/DataGridVirtualScroller.js +3 -5
- package/modern/components/GridRow.js +4 -2
- package/modern/components/base/GridBody.js +2 -22
- package/modern/components/cell/GridActionsCell.js +2 -2
- package/modern/components/cell/GridCell.js +4 -2
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/modern/components/menu/GridMenu.js +20 -5
- package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +11 -8
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/modern/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +6 -3
- package/modern/hooks/features/export/useGridPrintExport.js +37 -7
- package/modern/hooks/features/filter/gridFilterUtils.js +10 -6
- package/modern/hooks/features/focus/useGridFocus.js +0 -1
- package/modern/hooks/features/index.js +2 -1
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +18 -0
- package/modern/hooks/features/virtualization/index.js +2 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +52 -36
- package/modern/hooks/features/virtualization/useGridVirtualization.js +47 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +4 -0
- package/modern/locales/ruRU.js +26 -28
- package/modern/models/api/index.js +1 -2
- package/modern/utils/createControllablePromise.js +11 -0
- package/node/DataGrid/useDataGridComponent.js +43 -40
- package/node/components/DataGridVirtualScroller.js +3 -5
- package/node/components/GridRow.js +4 -2
- package/node/components/base/GridBody.js +2 -22
- package/node/components/cell/GridActionsCell.js +2 -2
- package/node/components/cell/GridCell.js +4 -2
- package/node/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/node/components/menu/GridMenu.js +19 -4
- package/node/components/menu/columnMenu/GridColumnHeaderMenu.js +10 -7
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/node/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/node/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +8 -5
- package/node/hooks/features/export/useGridPrintExport.js +37 -7
- package/node/hooks/features/filter/gridFilterUtils.js +9 -6
- package/node/hooks/features/focus/useGridFocus.js +0 -1
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +27 -0
- package/node/hooks/features/virtualization/index.js +27 -0
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +51 -37
- package/node/hooks/features/virtualization/useGridVirtualization.js +58 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +44 -0
- package/node/locales/ruRU.js +26 -28
- package/node/models/api/index.js +4 -15
- package/node/utils/createControllablePromise.js +17 -0
- package/package.json +1 -1
- package/utils/createControllablePromise.d.ts +5 -0
- package/utils/createControllablePromise.js +11 -0
- package/models/api/gridDisableVirtualizationApi.d.ts +0 -15
- package/models/api/gridVirtualScrollerApi.d.ts +0 -8
- package/models/api/gridVirtualScrollerApi.js +0 -1
- package/modern/models/api/gridDisableVirtualizationApi.js +0 -1
- package/modern/models/api/gridVirtualScrollerApi.js +0 -1
- package/node/models/api/gridVirtualScrollerApi.js +0 -5
- /package/legacy/models/api/{gridDisableVirtualizationApi.js → gridVirtualizationApi.js} +0 -0
- /package/{legacy/models/api/gridVirtualScrollerApi.js → models/api/gridVirtualizationApi.js} +0 -0
- /package/{models/api/gridDisableVirtualizationApi.js → modern/models/api/gridVirtualizationApi.js} +0 -0
- /package/node/models/api/{gridDisableVirtualizationApi.js → gridVirtualizationApi.js} +0 -0
package/locales/ruRU.js
CHANGED
|
@@ -46,7 +46,7 @@ const ruRUGrid = {
|
|
|
46
46
|
columnsPanelHideAllButton: 'Скрыть все',
|
|
47
47
|
// Filter panel text
|
|
48
48
|
filterPanelAddFilter: 'Добавить фильтр',
|
|
49
|
-
|
|
49
|
+
filterPanelRemoveAll: 'Очистить фильтр',
|
|
50
50
|
filterPanelDeleteIconLabel: 'Удалить',
|
|
51
51
|
filterPanelLogicOperator: 'Логические операторы',
|
|
52
52
|
filterPanelOperator: 'Операторы',
|
|
@@ -69,34 +69,32 @@ const ruRUGrid = {
|
|
|
69
69
|
filterOperatorIsEmpty: 'пустой',
|
|
70
70
|
filterOperatorIsNotEmpty: 'не пустой',
|
|
71
71
|
filterOperatorIsAnyOf: 'любой из',
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
'filterOperator=': '=',
|
|
73
|
+
'filterOperator!=': '!=',
|
|
74
|
+
'filterOperator>': '>',
|
|
75
|
+
'filterOperator>=': '>=',
|
|
76
|
+
'filterOperator<': '<',
|
|
77
|
+
'filterOperator<=': '<=',
|
|
79
78
|
// Header filter operators text
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
79
|
+
headerFilterOperatorContains: 'содержит',
|
|
80
|
+
headerFilterOperatorEquals: 'равен',
|
|
81
|
+
headerFilterOperatorStartsWith: 'начинается с',
|
|
82
|
+
headerFilterOperatorEndsWith: 'заканчивается на',
|
|
83
|
+
headerFilterOperatorIs: 'равен',
|
|
84
|
+
headerFilterOperatorNot: 'не равен',
|
|
85
|
+
headerFilterOperatorAfter: 'больше чем',
|
|
86
|
+
headerFilterOperatorOnOrAfter: 'больше или равно',
|
|
87
|
+
headerFilterOperatorBefore: 'меньше чем',
|
|
88
|
+
headerFilterOperatorOnOrBefore: 'меньше или равно',
|
|
89
|
+
headerFilterOperatorIsEmpty: 'пустой',
|
|
90
|
+
headerFilterOperatorIsNotEmpty: 'не пустой',
|
|
91
|
+
headerFilterOperatorIsAnyOf: 'любой из',
|
|
92
|
+
'headerFilterOperator=': 'содержит',
|
|
93
|
+
'headerFilterOperator!=': 'не содержит',
|
|
94
|
+
'headerFilterOperator>': 'больше чем',
|
|
95
|
+
'headerFilterOperator>=': 'больше или равно',
|
|
96
|
+
'headerFilterOperator<': 'меньше чем',
|
|
97
|
+
'headerFilterOperator<=': 'меньше или равно',
|
|
100
98
|
// Filter values text
|
|
101
99
|
filterValueAny: 'любой',
|
|
102
100
|
filterValueTrue: 'истина',
|
|
@@ -10,7 +10,6 @@ import { GridLocaleTextApi } from './gridLocaleTextApi';
|
|
|
10
10
|
import type { GridParamsApi } from './gridParamsApi';
|
|
11
11
|
import { GridPreferencesPanelApi } from './gridPreferencesPanelApi';
|
|
12
12
|
import { GridPrintExportApi } from './gridPrintExportApi';
|
|
13
|
-
import { GridDisableVirtualizationApi } from './gridDisableVirtualizationApi';
|
|
14
13
|
import { GridRowApi } from './gridRowApi';
|
|
15
14
|
import { GridRowsMetaApi, GridRowsMetaPrivateApi } from './gridRowsMetaApi';
|
|
16
15
|
import { GridRowSelectionApi } from './gridRowSelectionApi';
|
|
@@ -18,7 +17,7 @@ import { GridSortApi } from './gridSortApi';
|
|
|
18
17
|
import { GridStateApi, GridStatePrivateApi } from './gridStateApi';
|
|
19
18
|
import { GridLoggerApi } from './gridLoggerApi';
|
|
20
19
|
import { GridScrollApi } from './gridScrollApi';
|
|
21
|
-
import {
|
|
20
|
+
import { GridVirtualizationApi, GridVirtualizationPrivateApi } from './gridVirtualizationApi';
|
|
22
21
|
import type { GridPipeProcessingApi, GridPipeProcessingPrivateApi } from '../../hooks/core/pipeProcessing';
|
|
23
22
|
import { GridColumnSpanningApi, GridColumnSpanningPrivateApi } from './gridColumnSpanning';
|
|
24
23
|
import type { GridStrategyProcessingApi } from '../../hooks/core/strategyProcessing';
|
|
@@ -28,9 +27,9 @@ import type { GridStatePersistenceApi } from '../../hooks/features/statePersiste
|
|
|
28
27
|
import { GridColumnGroupingApi } from './gridColumnGroupingApi';
|
|
29
28
|
import type { GridInitialStateCommunity, GridStateCommunity } from '../gridStateCommunity';
|
|
30
29
|
import { GridHeaderFilteringApi, GridHeaderFilteringPrivateApi } from './gridHeaderFilteringApi';
|
|
31
|
-
export interface GridApiCommon<GridState extends GridStateCommunity = any, GridInitialState extends GridInitialStateCommunity = any> extends GridCoreApi, GridPipeProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridRowSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi,
|
|
30
|
+
export interface GridApiCommon<GridState extends GridStateCommunity = any, GridInitialState extends GridInitialStateCommunity = any> extends GridCoreApi, GridPipeProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridRowSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridVirtualizationApi, GridLocaleTextApi, GridScrollApi, GridColumnSpanningApi, GridStateApi<GridState>, GridStatePersistenceApi<GridInitialState>, GridColumnGroupingApi, GridHeaderFilteringApi {
|
|
32
31
|
}
|
|
33
|
-
export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon> extends GridCorePrivateApi<Api, PrivateApi>, GridStatePrivateApi<PrivateApi['state']>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi,
|
|
32
|
+
export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon> extends GridCorePrivateApi<Api, PrivateApi>, GridStatePrivateApi<PrivateApi['state']>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi, GridEditingPrivateApi, GridLoggerApi, GridFocusPrivateApi, GridHeaderFilteringPrivateApi, GridVirtualizationPrivateApi {
|
|
34
33
|
}
|
|
35
34
|
export interface GridPrivateApiCommon extends GridApiCommon, GridPrivateOnlyApiCommon<GridApiCommon, GridPrivateApiCommon> {
|
|
36
35
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GridRenderContext } from '../params';
|
|
2
|
+
export interface GridVirtualizationApi {
|
|
3
|
+
/**
|
|
4
|
+
* Enable/disable virtualization.
|
|
5
|
+
* @param {boolean} enabled The enabled value for virtualization
|
|
6
|
+
*/
|
|
7
|
+
unstable_setVirtualization: (enabled: boolean) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Enable/disable column virtualization.
|
|
10
|
+
* @param {boolean} enabled The enabled value for column virtualization
|
|
11
|
+
*/
|
|
12
|
+
unstable_setColumnVirtualization: (enabled: boolean) => void;
|
|
13
|
+
}
|
|
14
|
+
export interface GridVirtualizationPrivateApi {
|
|
15
|
+
/**
|
|
16
|
+
* Get the current grid rendering context.
|
|
17
|
+
* @returns {GridRenderContext} The `GridRenderContext`.
|
|
18
|
+
*/
|
|
19
|
+
getRenderContext: () => GridRenderContext;
|
|
20
|
+
}
|
package/models/api/index.d.ts
CHANGED
|
@@ -15,10 +15,9 @@ export * from './gridFilterApi';
|
|
|
15
15
|
export * from './gridColumnMenuApi';
|
|
16
16
|
export * from './gridPreferencesPanelApi';
|
|
17
17
|
export * from './gridPrintExportApi';
|
|
18
|
-
export * from './gridDisableVirtualizationApi';
|
|
19
18
|
export * from './gridCallbackDetails';
|
|
20
19
|
export * from './gridScrollApi';
|
|
21
|
-
export * from './
|
|
20
|
+
export * from './gridVirtualizationApi';
|
|
22
21
|
export type { GridApiCommon } from './gridApiCommon';
|
|
23
22
|
export type { GridEditingApi, GridCellModesModel, GridRowModesModel } from './gridEditingApi';
|
|
24
23
|
export type GridEditRowApi = GridEditingApi;
|
package/models/api/index.js
CHANGED
|
@@ -10,8 +10,7 @@ export * from './gridFilterApi';
|
|
|
10
10
|
export * from './gridColumnMenuApi';
|
|
11
11
|
export * from './gridPreferencesPanelApi';
|
|
12
12
|
export * from './gridPrintExportApi';
|
|
13
|
-
export * from './gridDisableVirtualizationApi';
|
|
14
13
|
export * from './gridCallbackDetails';
|
|
15
14
|
export * from './gridScrollApi';
|
|
16
|
-
export * from './
|
|
15
|
+
export * from './gridVirtualizationApi';
|
|
17
16
|
export {};
|
|
@@ -173,6 +173,14 @@ export interface GridColumnHeaderEventLookup {
|
|
|
173
173
|
params: GridColumnHeaderParams;
|
|
174
174
|
event: React.DragEvent<HTMLElement>;
|
|
175
175
|
};
|
|
176
|
+
/**
|
|
177
|
+
* Fired when a `dblclick` DOM event happens in the column header separator.
|
|
178
|
+
* @ignore - do not document.
|
|
179
|
+
*/
|
|
180
|
+
columnSeparatorDoubleClick: {
|
|
181
|
+
params: GridColumnHeaderParams;
|
|
182
|
+
event: React.MouseEvent<HTMLElement>;
|
|
183
|
+
};
|
|
176
184
|
/**
|
|
177
185
|
* Fired when a `mousedown` DOM event happens in the column header separator.
|
|
178
186
|
* @ignore - do not document.
|
package/models/gridExport.d.ts
CHANGED
|
@@ -32,9 +32,9 @@ export interface GridFileExportOptions<Api extends GridApiCommon = GridApiCommun
|
|
|
32
32
|
*/
|
|
33
33
|
includeHeaders?: boolean;
|
|
34
34
|
/**
|
|
35
|
-
* Function that returns the
|
|
35
|
+
* Function that returns the list of row ids to export on the order they should be exported.
|
|
36
36
|
* @param {GridGetRowsToExportParams} params With all properties from [[GridGetRowsToExportParams]].
|
|
37
|
-
* @returns {GridRowId[]} The
|
|
37
|
+
* @returns {GridRowId[]} The list of row ids to export.
|
|
38
38
|
*/
|
|
39
39
|
getRowsToExport?: (params: GridGetRowsToExportParams<Api>) => GridRowId[];
|
|
40
40
|
}
|
|
@@ -46,6 +46,8 @@ export interface GridGetRowsToExportParams<Api extends GridApiCommon = GridApiCo
|
|
|
46
46
|
}
|
|
47
47
|
export interface GridCsvGetRowsToExportParams<Api extends GridApiCommon = GridApiCommunity> extends GridGetRowsToExportParams<Api> {
|
|
48
48
|
}
|
|
49
|
+
export interface GridPrintGetRowsToExportParams<Api extends GridApiCommon = GridApiCommunity> extends GridGetRowsToExportParams<Api> {
|
|
50
|
+
}
|
|
49
51
|
/**
|
|
50
52
|
* The options to apply on the CSV export.
|
|
51
53
|
* @demos
|
|
@@ -81,9 +83,9 @@ export interface GridCsvExportOptions extends GridFileExportOptions {
|
|
|
81
83
|
*/
|
|
82
84
|
includeColumnGroupsHeaders?: boolean;
|
|
83
85
|
/**
|
|
84
|
-
* Function that returns the
|
|
86
|
+
* Function that returns the list of row ids to export on the order they should be exported.
|
|
85
87
|
* @param {GridCsvGetRowsToExportParams} params With all properties from [[GridCsvGetRowsToExportParams]].
|
|
86
|
-
* @returns {GridRowId[]} The
|
|
88
|
+
* @returns {GridRowId[]} The list of row ids to export.
|
|
87
89
|
*/
|
|
88
90
|
getRowsToExport?: (params: GridCsvGetRowsToExportParams) => GridRowId[];
|
|
89
91
|
}
|
|
@@ -108,6 +110,11 @@ export interface GridPrintExportOptions extends GridExportOptions {
|
|
|
108
110
|
* @default false
|
|
109
111
|
*/
|
|
110
112
|
hideFooter?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* If `true`, the selection checkboxes will be included when printing.
|
|
115
|
+
* @default false
|
|
116
|
+
*/
|
|
117
|
+
includeCheckboxes?: boolean;
|
|
111
118
|
/**
|
|
112
119
|
* If `false`, all <style> and <link type="stylesheet" /> tags from the <head> will not be copied
|
|
113
120
|
* to the print window.
|
|
@@ -122,6 +129,12 @@ export interface GridPrintExportOptions extends GridExportOptions {
|
|
|
122
129
|
* Provide Print specific styles to the print window.
|
|
123
130
|
*/
|
|
124
131
|
pageStyle?: string | Function;
|
|
132
|
+
/**
|
|
133
|
+
* Function that returns the list of row ids to export in the order they should be exported.
|
|
134
|
+
* @param {GridPrintGetRowsToExportParams} params With all properties from [[GridPrintGetRowsToExportParams]].
|
|
135
|
+
* @returns {GridRowId[]} The list of row ids to export.
|
|
136
|
+
*/
|
|
137
|
+
getRowsToExport?: (params: GridPrintGetRowsToExportParams) => GridRowId[];
|
|
125
138
|
}
|
|
126
139
|
/**
|
|
127
140
|
* Available export formats.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GridColumnMenuState, GridColumnsInitialState, GridColumnsState, GridColumnsGroupingState, GridDensityState, GridFilterInitialState, GridFilterState, GridFocusState, GridPaginationInitialState, GridPaginationState, GridPreferencePanelInitialState, GridPreferencePanelState, GridRowsState, GridSortingInitialState, GridSortingState, GridTabIndexState } from '../hooks';
|
|
1
|
+
import type { GridColumnMenuState, GridColumnsInitialState, GridColumnsState, GridColumnsGroupingState, GridDensityState, GridFilterInitialState, GridFilterState, GridFocusState, GridPaginationInitialState, GridPaginationState, GridPreferencePanelInitialState, GridPreferencePanelState, GridRowsState, GridSortingInitialState, GridSortingState, GridTabIndexState, GridVirtualizationState } from '../hooks';
|
|
2
2
|
import type { GridRowsMetaState } from '../hooks/features/rows/gridRowsMetaState';
|
|
3
3
|
import type { GridEditingState } from './gridEditRowModel';
|
|
4
4
|
import { GridHeaderFilteringState } from './gridHeaderFilteringModel';
|
|
@@ -24,6 +24,7 @@ export interface GridStateCommunity {
|
|
|
24
24
|
filter: GridFilterState;
|
|
25
25
|
preferencePanel: GridPreferencePanelState;
|
|
26
26
|
density: GridDensityState;
|
|
27
|
+
virtualization: GridVirtualizationState;
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* The initial state of `DataGrid`.
|
package/models/index.d.ts
CHANGED
|
@@ -24,5 +24,5 @@ export * from './muiEvent';
|
|
|
24
24
|
export * from './events';
|
|
25
25
|
export * from './gridSortModel';
|
|
26
26
|
export * from './gridColumnGrouping';
|
|
27
|
-
export type { GridExportOptions, GridFileExportOptions, GridGetRowsToExportParams, GridCsvGetRowsToExportParams, GridCsvExportOptions, GridPrintExportOptions, } from './gridExport';
|
|
27
|
+
export type { GridExportOptions, GridFileExportOptions, GridGetRowsToExportParams, GridCsvGetRowsToExportParams, GridPrintGetRowsToExportParams, GridCsvExportOptions, GridPrintExportOptions, } from './gridExport';
|
|
28
28
|
export * from './gridFilterOperator';
|
|
@@ -25,53 +25,56 @@ import { rowsMetaStateInitializer, useGridRowsMeta } from '../hooks/features/row
|
|
|
25
25
|
import { useGridStatePersistence } from '../hooks/features/statePersistence/useGridStatePersistence';
|
|
26
26
|
import { useGridColumnSpanning } from '../hooks/features/columns/useGridColumnSpanning';
|
|
27
27
|
import { useGridColumnGrouping, columnGroupsStateInitializer } from '../hooks/features/columnGrouping/useGridColumnGrouping';
|
|
28
|
+
import { useGridVirtualization, virtualizationStateInitializer } from '../hooks/features/virtualization';
|
|
28
29
|
export const useDataGridComponent = (inputApiRef, props) => {
|
|
29
|
-
const
|
|
30
|
+
const apiRef = useGridInitialization(inputApiRef, props);
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* Register all pre-processors called during state initialization here.
|
|
33
34
|
*/
|
|
34
|
-
useGridRowSelectionPreProcessors(
|
|
35
|
-
useGridRowsPreProcessors(
|
|
35
|
+
useGridRowSelectionPreProcessors(apiRef, props);
|
|
36
|
+
useGridRowsPreProcessors(apiRef);
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
39
|
* Register all state initializers here.
|
|
39
40
|
*/
|
|
40
|
-
useGridInitializeState(rowSelectionStateInitializer,
|
|
41
|
-
useGridInitializeState(columnsStateInitializer,
|
|
42
|
-
useGridInitializeState(rowsStateInitializer,
|
|
43
|
-
useGridInitializeState(editingStateInitializer,
|
|
44
|
-
useGridInitializeState(focusStateInitializer,
|
|
45
|
-
useGridInitializeState(sortingStateInitializer,
|
|
46
|
-
useGridInitializeState(preferencePanelStateInitializer,
|
|
47
|
-
useGridInitializeState(filterStateInitializer,
|
|
48
|
-
useGridInitializeState(densityStateInitializer,
|
|
49
|
-
useGridInitializeState(paginationStateInitializer,
|
|
50
|
-
useGridInitializeState(rowsMetaStateInitializer,
|
|
51
|
-
useGridInitializeState(columnMenuStateInitializer,
|
|
52
|
-
useGridInitializeState(columnGroupsStateInitializer,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
41
|
+
useGridInitializeState(rowSelectionStateInitializer, apiRef, props);
|
|
42
|
+
useGridInitializeState(columnsStateInitializer, apiRef, props);
|
|
43
|
+
useGridInitializeState(rowsStateInitializer, apiRef, props);
|
|
44
|
+
useGridInitializeState(editingStateInitializer, apiRef, props);
|
|
45
|
+
useGridInitializeState(focusStateInitializer, apiRef, props);
|
|
46
|
+
useGridInitializeState(sortingStateInitializer, apiRef, props);
|
|
47
|
+
useGridInitializeState(preferencePanelStateInitializer, apiRef, props);
|
|
48
|
+
useGridInitializeState(filterStateInitializer, apiRef, props);
|
|
49
|
+
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
50
|
+
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
51
|
+
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
52
|
+
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
53
|
+
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
|
|
54
|
+
useGridInitializeState(virtualizationStateInitializer, apiRef, props);
|
|
55
|
+
useGridKeyboardNavigation(apiRef, props);
|
|
56
|
+
useGridRowSelection(apiRef, props);
|
|
57
|
+
useGridColumns(apiRef, props);
|
|
58
|
+
useGridRows(apiRef, props);
|
|
59
|
+
useGridParamsApi(apiRef, props);
|
|
60
|
+
useGridColumnSpanning(apiRef);
|
|
61
|
+
useGridColumnGrouping(apiRef, props);
|
|
62
|
+
useGridEditing(apiRef, props);
|
|
63
|
+
useGridFocus(apiRef, props);
|
|
64
|
+
useGridPreferencesPanel(apiRef, props);
|
|
65
|
+
useGridFilter(apiRef, props);
|
|
66
|
+
useGridSorting(apiRef, props);
|
|
67
|
+
useGridDensity(apiRef, props);
|
|
68
|
+
useGridPagination(apiRef, props);
|
|
69
|
+
useGridRowsMeta(apiRef, props);
|
|
70
|
+
useGridScroll(apiRef, props);
|
|
71
|
+
useGridColumnMenu(apiRef);
|
|
72
|
+
useGridCsvExport(apiRef, props);
|
|
73
|
+
useGridPrintExport(apiRef, props);
|
|
74
|
+
useGridClipboard(apiRef, props);
|
|
75
|
+
useGridDimensions(apiRef, props);
|
|
76
|
+
useGridEvents(apiRef, props);
|
|
77
|
+
useGridStatePersistence(apiRef);
|
|
78
|
+
useGridVirtualization(apiRef, props);
|
|
79
|
+
return apiRef;
|
|
77
80
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["className"
|
|
3
|
+
const _excluded = ["className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { GridVirtualScroller } from './virtualization/GridVirtualScroller';
|
|
6
6
|
import { GridVirtualScrollerContent } from './virtualization/GridVirtualScrollerContent';
|
|
@@ -11,8 +11,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
const DataGridVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGridVirtualScroller(props, ref) {
|
|
13
13
|
const {
|
|
14
|
-
className
|
|
15
|
-
disableVirtualization
|
|
14
|
+
className
|
|
16
15
|
} = props,
|
|
17
16
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
18
17
|
const {
|
|
@@ -21,8 +20,7 @@ const DataGridVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGridV
|
|
|
21
20
|
getRenderZoneProps,
|
|
22
21
|
getRows
|
|
23
22
|
} = useGridVirtualScroller({
|
|
24
|
-
ref
|
|
25
|
-
disableVirtualization
|
|
23
|
+
ref
|
|
26
24
|
});
|
|
27
25
|
return /*#__PURE__*/_jsxs(GridVirtualScroller, _extends({
|
|
28
26
|
className: className
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["selected", "rowId", "row", "index", "style", "position", "rowHeight", "className", "visibleColumns", "renderedColumns", "containerWidth", "firstColumnToRender", "lastColumnToRender", "isLastVisible", "focusedCellColumnIndexNotInRange", "isNotVisible", "focusedCell", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave"];
|
|
3
|
+
const _excluded = ["selected", "hovered", "rowId", "row", "index", "style", "position", "rowHeight", "className", "visibleColumns", "renderedColumns", "containerWidth", "firstColumnToRender", "lastColumnToRender", "isLastVisible", "focusedCellColumnIndexNotInRange", "isNotVisible", "focusedCell", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -57,6 +57,7 @@ function EmptyCell({
|
|
|
57
57
|
const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
58
58
|
const {
|
|
59
59
|
selected,
|
|
60
|
+
hovered,
|
|
60
61
|
rowId,
|
|
61
62
|
row,
|
|
62
63
|
index,
|
|
@@ -92,6 +93,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
92
93
|
|
|
93
94
|
const ownerState = {
|
|
94
95
|
selected,
|
|
96
|
+
hovered,
|
|
95
97
|
isLastVisible,
|
|
96
98
|
classes: rootProps.classes,
|
|
97
99
|
editing: apiRef.current.getRowMode(rowId) === GridRowModes.Edit,
|
|
@@ -326,7 +328,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
326
328
|
"data-id": rowId,
|
|
327
329
|
"data-rowindex": index,
|
|
328
330
|
role: "row",
|
|
329
|
-
className: clsx(...rowClassNames, classes.root, className),
|
|
331
|
+
className: clsx(...rowClassNames, classes.root, className, hovered && 'Mui-hovered'),
|
|
330
332
|
"aria-rowindex": ariaRowIndex,
|
|
331
333
|
"aria-selected": selected,
|
|
332
334
|
style: style
|
|
@@ -39,7 +39,6 @@ function GridBody(props) {
|
|
|
39
39
|
const columnVisibility = useGridSelector(apiRef, gridColumnVisibilityModelSelector);
|
|
40
40
|
const columnGroupsHeaderStructure = useGridSelector(apiRef, gridColumnGroupsHeaderStructureSelector);
|
|
41
41
|
const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null && cellTabIndexState === null);
|
|
42
|
-
const [isVirtualizationDisabled, setIsVirtualizationDisabled] = React.useState(rootProps.disableVirtualization);
|
|
43
42
|
useEnhancedEffect(() => {
|
|
44
43
|
apiRef.current.computeSizeAndPublishResizeEvent();
|
|
45
44
|
const elementToObserve = rootRef.current;
|
|
@@ -49,7 +48,7 @@ function GridBody(props) {
|
|
|
49
48
|
let animationFrame;
|
|
50
49
|
const observer = new ResizeObserver(() => {
|
|
51
50
|
// See https://github.com/mui/mui-x/issues/8733
|
|
52
|
-
animationFrame =
|
|
51
|
+
animationFrame = requestAnimationFrame(() => {
|
|
53
52
|
apiRef.current.computeSizeAndPublishResizeEvent();
|
|
54
53
|
});
|
|
55
54
|
});
|
|
@@ -65,24 +64,6 @@ function GridBody(props) {
|
|
|
65
64
|
}
|
|
66
65
|
};
|
|
67
66
|
}, [apiRef]);
|
|
68
|
-
const disableVirtualization = React.useCallback(() => {
|
|
69
|
-
setIsVirtualizationDisabled(true);
|
|
70
|
-
}, []);
|
|
71
|
-
const enableVirtualization = React.useCallback(() => {
|
|
72
|
-
setIsVirtualizationDisabled(false);
|
|
73
|
-
}, []);
|
|
74
|
-
React.useEffect(() => {
|
|
75
|
-
setIsVirtualizationDisabled(rootProps.disableVirtualization);
|
|
76
|
-
}, [rootProps.disableVirtualization]);
|
|
77
|
-
|
|
78
|
-
// The `useGridApiMethod` hook can't be used here, because it only installs the
|
|
79
|
-
// method if it doesn't exist yet. Once installed, it's never updated again.
|
|
80
|
-
// This break the methods above, since their closure comes from the first time
|
|
81
|
-
// they were installed. Which means that calling `setIsVirtualizationDisabled`
|
|
82
|
-
// will trigger a re-render, but it won't update the state. That can be solved
|
|
83
|
-
// by migrating the virtualization status to the global state.
|
|
84
|
-
apiRef.current.unstable_disableVirtualization = disableVirtualization;
|
|
85
|
-
apiRef.current.unstable_enableVirtualization = enableVirtualization;
|
|
86
67
|
const columnHeadersRef = React.useRef(null);
|
|
87
68
|
const columnsContainerRef = React.useRef(null);
|
|
88
69
|
const virtualScrollerRef = React.useRef(null);
|
|
@@ -119,8 +100,7 @@ function GridBody(props) {
|
|
|
119
100
|
// If this event is published while dimensions haven't been computed,
|
|
120
101
|
// the `onFetchRows` prop won't be called during mount.
|
|
121
102
|
, {
|
|
122
|
-
ref: virtualScrollerRef
|
|
123
|
-
disableVirtualization: isVirtualizationDisabled
|
|
103
|
+
ref: virtualScrollerRef
|
|
124
104
|
}), children]
|
|
125
105
|
});
|
|
126
106
|
}
|
|
@@ -164,11 +164,11 @@ function GridActionsCell(props) {
|
|
|
164
164
|
fontSize: "small"
|
|
165
165
|
})
|
|
166
166
|
})), menuButtons.length > 0 && /*#__PURE__*/_jsx(GridMenu, {
|
|
167
|
-
onClickAway: hideMenu,
|
|
168
|
-
onClick: hideMenu,
|
|
169
167
|
open: open,
|
|
170
168
|
target: buttonRef.current,
|
|
171
169
|
position: position,
|
|
170
|
+
onClose: hideMenu,
|
|
171
|
+
onClick: hideMenu,
|
|
172
172
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
173
173
|
id: menuId,
|
|
174
174
|
className: gridClasses.menuList,
|
|
@@ -231,7 +231,8 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
231
231
|
return {
|
|
232
232
|
padding: 0,
|
|
233
233
|
opacity: 0,
|
|
234
|
-
width: 0
|
|
234
|
+
width: 0,
|
|
235
|
+
border: 0
|
|
235
236
|
};
|
|
236
237
|
}
|
|
237
238
|
const cellStyle = {
|
|
@@ -495,7 +496,8 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
495
496
|
return {
|
|
496
497
|
padding: 0,
|
|
497
498
|
opacity: 0,
|
|
498
|
-
width: 0
|
|
499
|
+
width: 0,
|
|
500
|
+
border: 0
|
|
499
501
|
};
|
|
500
502
|
}
|
|
501
503
|
const cellStyle = {
|
|
@@ -94,7 +94,8 @@ function GridColumnHeaderItem(props) {
|
|
|
94
94
|
onDragEnd: publish('columnHeaderDragEnd')
|
|
95
95
|
} : {}, [isDraggable, publish]);
|
|
96
96
|
const columnHeaderSeparatorProps = React.useMemo(() => ({
|
|
97
|
-
onMouseDown: publish('columnSeparatorMouseDown')
|
|
97
|
+
onMouseDown: publish('columnSeparatorMouseDown'),
|
|
98
|
+
onDoubleClick: publish('columnSeparatorDoubleClick')
|
|
98
99
|
}), [publish]);
|
|
99
100
|
React.useEffect(() => {
|
|
100
101
|
if (!showColumnMenuIcon) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["open", "target", "
|
|
3
|
+
const _excluded = ["open", "target", "onClose", "children", "position", "className", "onExited"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
8
|
-
import { unstable_composeClasses as composeClasses, HTMLElementType } from '@mui/utils';
|
|
8
|
+
import { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect, HTMLElementType } from '@mui/utils';
|
|
9
9
|
import Grow from '@mui/material/Grow';
|
|
10
10
|
import Paper from '@mui/material/Paper';
|
|
11
11
|
import Popper from '@mui/material/Popper';
|
|
@@ -43,7 +43,7 @@ function GridMenu(props) {
|
|
|
43
43
|
const {
|
|
44
44
|
open,
|
|
45
45
|
target,
|
|
46
|
-
|
|
46
|
+
onClose,
|
|
47
47
|
children,
|
|
48
48
|
position,
|
|
49
49
|
className,
|
|
@@ -53,6 +53,15 @@ function GridMenu(props) {
|
|
|
53
53
|
const apiRef = useGridApiContext();
|
|
54
54
|
const rootProps = useGridRootProps();
|
|
55
55
|
const classes = useUtilityClasses(rootProps);
|
|
56
|
+
const savedFocusRef = React.useRef(null);
|
|
57
|
+
useEnhancedEffect(() => {
|
|
58
|
+
if (open) {
|
|
59
|
+
savedFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
60
|
+
} else {
|
|
61
|
+
savedFocusRef.current?.focus?.();
|
|
62
|
+
savedFocusRef.current = null;
|
|
63
|
+
}
|
|
64
|
+
}, [open]);
|
|
56
65
|
React.useEffect(() => {
|
|
57
66
|
// Emit menuOpen or menuClose events
|
|
58
67
|
const eventName = open ? 'menuOpen' : 'menuClose';
|
|
@@ -68,6 +77,12 @@ function GridMenu(props) {
|
|
|
68
77
|
onExited(node);
|
|
69
78
|
}
|
|
70
79
|
};
|
|
80
|
+
const handleClickAway = event => {
|
|
81
|
+
if (event.target && (target === event.target || target?.contains(event.target))) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
onClose(event);
|
|
85
|
+
};
|
|
71
86
|
return /*#__PURE__*/_jsx(GridMenuRoot, _extends({
|
|
72
87
|
as: rootProps.slots.basePopper,
|
|
73
88
|
className: clsx(className, classes.root),
|
|
@@ -81,7 +96,7 @@ function GridMenu(props) {
|
|
|
81
96
|
TransitionProps,
|
|
82
97
|
placement
|
|
83
98
|
}) => /*#__PURE__*/_jsx(ClickAwayListener, {
|
|
84
|
-
onClickAway:
|
|
99
|
+
onClickAway: handleClickAway,
|
|
85
100
|
mouseEvent: "onMouseDown",
|
|
86
101
|
children: /*#__PURE__*/_jsx(Grow, _extends({}, TransitionProps, {
|
|
87
102
|
style: {
|
|
@@ -101,7 +116,7 @@ process.env.NODE_ENV !== "production" ? GridMenu.propTypes = {
|
|
|
101
116
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
102
117
|
// ----------------------------------------------------------------------
|
|
103
118
|
children: PropTypes.node,
|
|
104
|
-
|
|
119
|
+
onClose: PropTypes.func.isRequired,
|
|
105
120
|
onExited: PropTypes.func,
|
|
106
121
|
/**
|
|
107
122
|
* If `true`, the component is shown.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { HTMLElementType } from '@mui/utils';
|
|
4
|
+
import { unstable_useEventCallback as useEventCallback, HTMLElementType } from '@mui/utils';
|
|
5
5
|
import { useGridApiContext } from '../../../hooks/utils/useGridApiContext';
|
|
6
6
|
import { GridMenu } from '../GridMenu';
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -17,13 +17,16 @@ function GridColumnHeaderMenu({
|
|
|
17
17
|
}) {
|
|
18
18
|
const apiRef = useGridApiContext();
|
|
19
19
|
const colDef = apiRef.current.getColumn(field);
|
|
20
|
-
const hideMenu =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const hideMenu = useEventCallback(event => {
|
|
21
|
+
if (event) {
|
|
22
|
+
// Prevent triggering the sorting
|
|
23
|
+
event.stopPropagation();
|
|
24
|
+
if (target?.contains(event.target)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
25
27
|
}
|
|
26
|
-
|
|
28
|
+
apiRef.current.hideColumnMenu();
|
|
29
|
+
});
|
|
27
30
|
if (!target || !colDef) {
|
|
28
31
|
return null;
|
|
29
32
|
}
|
|
@@ -31,7 +34,7 @@ function GridColumnHeaderMenu({
|
|
|
31
34
|
placement: `bottom-${colDef.align === 'right' ? 'start' : 'end'}`,
|
|
32
35
|
open: open,
|
|
33
36
|
target: target,
|
|
34
|
-
|
|
37
|
+
onClose: hideMenu,
|
|
35
38
|
onExited: onExited,
|
|
36
39
|
children: /*#__PURE__*/_jsx(ContentComponent, _extends({
|
|
37
40
|
colDef: colDef,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { refType, unstable_useId as useId } from '@mui/utils';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|