@mui/x-data-grid 8.0.0-alpha.10 → 8.0.0-alpha.11
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 +107 -2
- package/DataGrid/useDataGridComponent.js +2 -2
- package/components/GridRow.js +6 -2
- package/components/GridScrollArea.d.ts +5 -2
- package/components/GridScrollArea.js +31 -24
- package/components/GridSkeletonLoadingOverlay.js +2 -1
- package/components/containers/GridRoot.js +11 -9
- package/components/containers/GridRootStyles.js +3 -3
- package/components/menu/columnMenu/GridColumnMenuContainer.js +5 -2
- package/components/virtualization/GridMainContainer.d.ts +2 -2
- package/components/virtualization/GridMainContainer.js +1 -1
- package/components/virtualization/GridVirtualScroller.js +21 -14
- package/constants/index.d.ts +1 -0
- package/constants/index.js +2 -1
- package/constants/signature.d.ts +9 -0
- package/constants/signature.js +10 -0
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +6 -4
- package/hooks/core/useGridApiInitialization.js +1 -1
- package/hooks/core/useGridStateInitialization.js +3 -2
- 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/columns/useGridColumns.js +2 -1
- 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/gridFilterSelector.d.ts +2 -2
- package/hooks/features/filter/gridFilterSelector.js +4 -3
- package/hooks/features/filter/gridFilterState.d.ts +8 -3
- package/hooks/features/filter/gridFilterState.js +5 -0
- package/hooks/features/filter/useGridFilter.js +9 -14
- package/hooks/features/overlays/useGridOverlays.js +1 -1
- package/hooks/features/pagination/gridPaginationUtils.js +1 -1
- package/hooks/features/pagination/useGridPagination.js +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +3 -2
- package/hooks/features/rowSelection/utils.js +2 -2
- 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/useGridRows.js +4 -2
- 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/index.d.ts +1 -1
- package/hooks/utils/index.js +1 -1
- package/hooks/utils/useGridApiEventHandler.d.ts +7 -17
- package/hooks/utils/useGridApiEventHandler.js +68 -75
- package/hooks/utils/useGridSelector.js +23 -5
- 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 +3 -1
- package/internals/index.js +3 -1
- package/internals/utils/propValidation.js +1 -1
- package/models/api/gridStateApi.d.ts +1 -0
- package/models/events/gridEventLookup.d.ts +6 -0
- package/modern/DataGrid/useDataGridComponent.js +2 -2
- package/modern/components/GridRow.js +6 -2
- package/modern/components/GridScrollArea.js +31 -24
- 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/menu/columnMenu/GridColumnMenuContainer.js +5 -2
- package/modern/components/virtualization/GridMainContainer.js +1 -1
- package/modern/components/virtualization/GridVirtualScroller.js +21 -14
- package/modern/constants/index.js +2 -1
- package/modern/constants/signature.js +10 -0
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +6 -4
- package/modern/hooks/core/useGridApiInitialization.js +1 -1
- package/modern/hooks/core/useGridStateInitialization.js +3 -2
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -14
- package/modern/hooks/features/columns/gridColumnsSelector.js +0 -12
- package/modern/hooks/features/columns/useGridColumns.js +2 -1
- 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/gridFilterSelector.js +4 -3
- package/modern/hooks/features/filter/gridFilterState.js +5 -0
- package/modern/hooks/features/filter/useGridFilter.js +9 -14
- package/modern/hooks/features/overlays/useGridOverlays.js +1 -1
- package/modern/hooks/features/pagination/gridPaginationUtils.js +1 -1
- package/modern/hooks/features/pagination/useGridPagination.js +1 -1
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +3 -2
- package/modern/hooks/features/rowSelection/utils.js +2 -2
- package/modern/hooks/features/rows/gridRowsUtils.js +0 -16
- package/modern/hooks/features/rows/useGridRows.js +4 -2
- 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/index.js +1 -1
- package/modern/hooks/utils/useGridApiEventHandler.js +68 -75
- package/modern/hooks/utils/useGridSelector.js +23 -5
- package/modern/hooks/utils/useIsSSR.js +5 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +3 -1
- package/modern/internals/utils/propValidation.js +1 -1
- package/node/DataGrid/useDataGridComponent.js +2 -2
- package/node/components/GridRow.js +6 -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/menu/columnMenu/GridColumnMenuContainer.js +5 -2
- package/node/components/virtualization/GridMainContainer.js +1 -1
- package/node/components/virtualization/GridVirtualScroller.js +21 -14
- package/node/constants/index.js +11 -0
- package/node/constants/signature.js +16 -0
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +6 -4
- package/node/hooks/core/useGridApiInitialization.js +2 -2
- package/node/hooks/core/useGridStateInitialization.js +3 -2
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -14
- package/node/hooks/features/columns/gridColumnsSelector.js +1 -13
- package/node/hooks/features/columns/useGridColumns.js +2 -1
- 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/gridFilterSelector.js +4 -3
- package/node/hooks/features/filter/gridFilterState.js +6 -1
- package/node/hooks/features/filter/useGridFilter.js +8 -13
- package/node/hooks/features/overlays/useGridOverlays.js +1 -1
- package/node/hooks/features/pagination/gridPaginationUtils.js +2 -2
- package/node/hooks/features/pagination/useGridPagination.js +1 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +5 -4
- package/node/hooks/features/rowSelection/utils.js +3 -3
- package/node/hooks/features/rows/gridRowsUtils.js +0 -17
- package/node/hooks/features/rows/useGridRows.js +6 -4
- 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/index.js +21 -11
- package/node/hooks/utils/useGridApiEventHandler.js +71 -78
- package/node/hooks/utils/useGridSelector.js +23 -5
- package/node/hooks/utils/useIsSSR.js +12 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +32 -7
- package/node/internals/utils/propValidation.js +2 -2
- package/package.json +3 -2
|
@@ -1,32 +1,52 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { TimerBasedCleanupTracking } from "../../utils/cleanupTracking/TimerBasedCleanupTracking.js";
|
|
3
3
|
import { FinalizationRegistryBasedCleanupTracking } from "../../utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.js";
|
|
4
|
-
/**
|
|
5
|
-
* Signal to the underlying logic what version of the public component API
|
|
6
|
-
* of the Data Grid is exposed.
|
|
7
|
-
*/
|
|
8
|
-
var GridSignature = /*#__PURE__*/function (GridSignature) {
|
|
9
|
-
GridSignature["DataGrid"] = "DataGrid";
|
|
10
|
-
GridSignature["DataGridPro"] = "DataGridPro";
|
|
11
|
-
GridSignature["DataGridPremium"] = "DataGridPremium";
|
|
12
|
-
return GridSignature;
|
|
13
|
-
}(GridSignature || {});
|
|
14
|
-
// We use class to make it easier to detect in heap snapshots by name
|
|
15
|
-
class ObjectToBeRetainedByReact {}
|
|
16
|
-
|
|
17
4
|
// Based on https://github.com/Bnaya/use-dispose-uncommitted/blob/main/src/finalization-registry-based-impl.ts
|
|
18
5
|
// Check https://github.com/facebook/react/issues/15317 to get more information
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
6
|
+
|
|
7
|
+
// We use class to make it easier to detect in heap snapshots by name
|
|
8
|
+
class ObjectToBeRetainedByReact {
|
|
9
|
+
static create() {
|
|
10
|
+
return new ObjectToBeRetainedByReact();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const registryContainer = {
|
|
14
|
+
current: createRegistry()
|
|
15
|
+
};
|
|
16
|
+
let cleanupTokensCounter = 0;
|
|
17
|
+
export function useGridApiEventHandler(apiRef, eventName, handler, options) {
|
|
18
|
+
const objectRetainedByReact = React.useState(ObjectToBeRetainedByReact.create)[0];
|
|
19
|
+
const subscription = React.useRef(null);
|
|
20
|
+
const handlerRef = React.useRef(null);
|
|
21
|
+
handlerRef.current = handler;
|
|
22
|
+
const cleanupTokenRef = React.useRef(null);
|
|
23
|
+
if (!subscription.current && handlerRef.current) {
|
|
24
|
+
const enhancedHandler = (params, event, details) => {
|
|
25
|
+
if (!event.defaultMuiPrevented) {
|
|
26
|
+
handlerRef.current?.(params, event, details);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
subscription.current = apiRef.current.subscribeEvent(eventName, enhancedHandler, options);
|
|
30
|
+
cleanupTokensCounter += 1;
|
|
31
|
+
cleanupTokenRef.current = {
|
|
32
|
+
cleanupToken: cleanupTokensCounter
|
|
33
|
+
};
|
|
34
|
+
registryContainer.current.register(objectRetainedByReact,
|
|
35
|
+
// The callback below will be called once this reference stops being retained
|
|
36
|
+
() => {
|
|
37
|
+
subscription.current?.();
|
|
38
|
+
subscription.current = null;
|
|
39
|
+
cleanupTokenRef.current = null;
|
|
40
|
+
}, cleanupTokenRef.current);
|
|
41
|
+
} else if (!handlerRef.current && subscription.current) {
|
|
42
|
+
subscription.current();
|
|
43
|
+
subscription.current = null;
|
|
44
|
+
if (cleanupTokenRef.current) {
|
|
45
|
+
registryContainer.current.unregister(cleanupTokenRef.current);
|
|
46
|
+
cleanupTokenRef.current = null;
|
|
24
47
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const handlerRef = React.useRef(null);
|
|
28
|
-
handlerRef.current = handler;
|
|
29
|
-
const cleanupTokenRef = React.useRef(null);
|
|
48
|
+
}
|
|
49
|
+
React.useEffect(() => {
|
|
30
50
|
if (!subscription.current && handlerRef.current) {
|
|
31
51
|
const enhancedHandler = (params, event, details) => {
|
|
32
52
|
if (!event.defaultMuiPrevented) {
|
|
@@ -34,62 +54,35 @@ export function createUseGridApiEventHandler(registryContainer) {
|
|
|
34
54
|
}
|
|
35
55
|
};
|
|
36
56
|
subscription.current = apiRef.current.subscribeEvent(eventName, enhancedHandler, options);
|
|
37
|
-
cleanupTokensCounter += 1;
|
|
38
|
-
cleanupTokenRef.current = {
|
|
39
|
-
cleanupToken: cleanupTokensCounter
|
|
40
|
-
};
|
|
41
|
-
registryContainer.registry.register(objectRetainedByReact,
|
|
42
|
-
// The callback below will be called once this reference stops being retained
|
|
43
|
-
() => {
|
|
44
|
-
subscription.current?.();
|
|
45
|
-
subscription.current = null;
|
|
46
|
-
cleanupTokenRef.current = null;
|
|
47
|
-
}, cleanupTokenRef.current);
|
|
48
|
-
} else if (!handlerRef.current && subscription.current) {
|
|
49
|
-
subscription.current();
|
|
50
|
-
subscription.current = null;
|
|
51
|
-
if (cleanupTokenRef.current) {
|
|
52
|
-
registryContainer.registry.unregister(cleanupTokenRef.current);
|
|
53
|
-
cleanupTokenRef.current = null;
|
|
54
|
-
}
|
|
55
57
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
// so we can trust the cleanup function to remove the listener.
|
|
68
|
-
registryContainer.registry.unregister(cleanupTokenRef.current);
|
|
69
|
-
cleanupTokenRef.current = null;
|
|
70
|
-
}
|
|
71
|
-
return () => {
|
|
72
|
-
subscription.current?.();
|
|
73
|
-
subscription.current = null;
|
|
74
|
-
};
|
|
75
|
-
}, [apiRef, eventName, options]);
|
|
76
|
-
};
|
|
58
|
+
if (cleanupTokenRef.current && registryContainer.current) {
|
|
59
|
+
// If the effect was called, it means that this render was committed
|
|
60
|
+
// so we can trust the cleanup function to remove the listener.
|
|
61
|
+
registryContainer.current.unregister(cleanupTokenRef.current);
|
|
62
|
+
cleanupTokenRef.current = null;
|
|
63
|
+
}
|
|
64
|
+
return () => {
|
|
65
|
+
subscription.current?.();
|
|
66
|
+
subscription.current = null;
|
|
67
|
+
};
|
|
68
|
+
}, [apiRef, eventName, options]);
|
|
77
69
|
}
|
|
78
|
-
const
|
|
79
|
-
|
|
70
|
+
const OPTIONS_IS_FIRST = {
|
|
71
|
+
isFirst: true
|
|
80
72
|
};
|
|
73
|
+
export function useGridApiOptionHandler(apiRef, eventName, handler) {
|
|
74
|
+
useGridApiEventHandler(apiRef, eventName, handler, OPTIONS_IS_FIRST);
|
|
75
|
+
}
|
|
81
76
|
|
|
82
77
|
// TODO: move to @mui/x-data-grid/internals
|
|
83
78
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
84
|
-
export
|
|
85
|
-
registryContainer.
|
|
86
|
-
registryContainer.
|
|
87
|
-
};
|
|
88
|
-
export const useGridApiEventHandler = createUseGridApiEventHandler(registryContainer);
|
|
89
|
-
const optionsSubscriberOptions = {
|
|
90
|
-
isFirst: true
|
|
91
|
-
};
|
|
92
|
-
export function useGridApiOptionHandler(apiRef, eventName, handler) {
|
|
93
|
-
useGridApiEventHandler(apiRef, eventName, handler, optionsSubscriberOptions);
|
|
79
|
+
export function unstable_resetCleanupTracking() {
|
|
80
|
+
registryContainer.current?.reset();
|
|
81
|
+
registryContainer.current = createRegistry();
|
|
94
82
|
}
|
|
95
|
-
|
|
83
|
+
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
85
|
+
export const internal_registryContainer = registryContainer;
|
|
86
|
+
function createRegistry() {
|
|
87
|
+
return typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistryBasedCleanupTracking() : new TimerBasedCleanupTracking();
|
|
88
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { fastObjectShallowCompare } from '@mui/x-internals/fastObjectShallowCompare';
|
|
3
3
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
4
|
+
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
4
5
|
import { useLazyRef } from "./useLazyRef.js";
|
|
5
|
-
import { useOnMount } from "./useOnMount.js";
|
|
6
6
|
function isOutputSelector(selector) {
|
|
7
7
|
return selector.acceptsApiRef;
|
|
8
8
|
}
|
|
@@ -33,8 +33,10 @@ const createRefs = () => ({
|
|
|
33
33
|
state: null,
|
|
34
34
|
equals: null,
|
|
35
35
|
selector: null,
|
|
36
|
-
args:
|
|
36
|
+
args: undefined
|
|
37
37
|
});
|
|
38
|
+
const EMPTY = [];
|
|
39
|
+
const emptyGetSnapshot = () => null;
|
|
38
40
|
export const useGridSelector = (apiRef, selector, args = undefined, equals = defaultCompare) => {
|
|
39
41
|
if (process.env.NODE_ENV !== 'production') {
|
|
40
42
|
if (!apiRef.current.state) {
|
|
@@ -58,14 +60,30 @@ export const useGridSelector = (apiRef, selector, args = undefined, equals = def
|
|
|
58
60
|
setState(newState);
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
const subscribe = React.useCallback(() => {
|
|
64
|
+
if (refs.current.subscription) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
refs.current.subscription = apiRef.current.store.subscribe(() => {
|
|
63
68
|
const newState = applySelector(apiRef, refs.current.selector, refs.current.args, apiRef.current.instanceId);
|
|
64
69
|
if (!refs.current.equals(refs.current.state, newState)) {
|
|
65
70
|
refs.current.state = newState;
|
|
66
71
|
setState(newState);
|
|
67
72
|
}
|
|
68
73
|
});
|
|
69
|
-
|
|
74
|
+
return null;
|
|
75
|
+
},
|
|
76
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77
|
+
EMPTY);
|
|
78
|
+
const unsubscribe = React.useCallback(() => {
|
|
79
|
+
return () => {
|
|
80
|
+
if (refs.current.subscription) {
|
|
81
|
+
refs.current.subscription();
|
|
82
|
+
refs.current.subscription = undefined;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
86
|
+
}, EMPTY);
|
|
87
|
+
useSyncExternalStore(unsubscribe, subscribe, emptyGetSnapshot);
|
|
70
88
|
return state;
|
|
71
89
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
2
|
+
const emptySubscribe = () => () => {};
|
|
3
|
+
const clientSnapshot = () => false;
|
|
4
|
+
const serverSnapshot = () => true;
|
|
5
|
+
export const useIsSSR = () => useSyncExternalStore(emptySubscribe, clientSnapshot, serverSnapshot);
|
package/modern/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { GridVirtualScrollerRenderZone } from "../components/virtualization/Grid
|
|
|
4
4
|
export { GridHeaders } from "../components/GridHeaders.js";
|
|
5
5
|
export { GridBaseColumnHeaders } from "../components/columnHeaders/GridBaseColumnHeaders.js";
|
|
6
6
|
export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from "../constants/defaultGridSlotsComponents.js";
|
|
7
|
+
export * from "../constants/signature.js";
|
|
7
8
|
export { getGridFilter } from "../components/panel/filterPanel/GridFilterPanel.js";
|
|
8
9
|
export { getValueOptions } from "../components/panel/filterPanel/filterPanelUtils.js";
|
|
9
10
|
export { useGridRegisterPipeProcessor } from "../hooks/core/pipeProcessing/index.js";
|
|
@@ -23,6 +24,7 @@ export { useGridDensity, densityStateInitializer } from "../hooks/features/densi
|
|
|
23
24
|
export { useGridCsvExport } from "../hooks/features/export/useGridCsvExport.js";
|
|
24
25
|
export { useGridPrintExport } from "../hooks/features/export/useGridPrintExport.js";
|
|
25
26
|
export { useGridFilter, filterStateInitializer } from "../hooks/features/filter/useGridFilter.js";
|
|
27
|
+
export { defaultGridFilterLookup } from "../hooks/features/filter/gridFilterState.js";
|
|
26
28
|
export { passFilterLogic } from "../hooks/features/filter/gridFilterUtils.js";
|
|
27
29
|
export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector } from "../hooks/features/filter/gridFilterSelector.js";
|
|
28
30
|
export { isSingleSelectColDef } from "../components/panel/filterPanel/filterPanelUtils.js";
|
|
@@ -43,7 +45,6 @@ export { useGridParamsApi } from "../hooks/features/rows/useGridParamsApi.js";
|
|
|
43
45
|
export { getRowIdFromRowModel, GRID_ID_AUTOGENERATED } from "../hooks/features/rows/gridRowsUtils.js";
|
|
44
46
|
export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector } from "../hooks/features/rows/gridRowsSelector.js";
|
|
45
47
|
export { headerFilteringStateInitializer, useGridHeaderFiltering } from "../hooks/features/headerFiltering/useGridHeaderFiltering.js";
|
|
46
|
-
export { calculatePinnedRowsHeight } from "../hooks/features/rows/gridRowsUtils.js";
|
|
47
48
|
export { useGridRowSelection, rowSelectionStateInitializer } from "../hooks/features/rowSelection/useGridRowSelection.js";
|
|
48
49
|
export { useGridRowSelectionPreProcessors } from "../hooks/features/rowSelection/useGridRowSelectionPreProcessors.js";
|
|
49
50
|
export { useGridSorting, sortingStateInitializer } from "../hooks/features/sorting/useGridSorting.js";
|
|
@@ -51,6 +52,7 @@ export { gridSortedRowIndexLookupSelector } from "../hooks/features/sorting/grid
|
|
|
51
52
|
export { useGridScroll } from "../hooks/features/scroll/useGridScroll.js";
|
|
52
53
|
export { useGridEvents } from "../hooks/features/events/useGridEvents.js";
|
|
53
54
|
export { dimensionsStateInitializer, useGridDimensions } from "../hooks/features/dimensions/useGridDimensions.js";
|
|
55
|
+
export * from "../hooks/features/dimensions/gridDimensionsSelectors.js";
|
|
54
56
|
export { useGridStatePersistence } from "../hooks/features/statePersistence/useGridStatePersistence.js";
|
|
55
57
|
export { useGridVirtualScroller, EMPTY_DETAIL_PANELS } from "../hooks/features/virtualization/useGridVirtualScroller.js";
|
|
56
58
|
export * from "../hooks/features/virtualization/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
2
2
|
import { isNumber } from "../../utils/utils.js";
|
|
3
|
-
import { GridSignature } from "../../
|
|
3
|
+
import { GridSignature } from "../../constants/signature.js";
|
|
4
4
|
export const propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.paginationMode === 'client' && props.paginationMeta != null && ['MUI X: Usage of the `paginationMeta` prop with client-side pagination (`paginationMode="client"`) has no effect.', '`paginationMeta` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.signature === GridSignature.DataGrid && props.paginationMode === 'client' && isNumber(props.rowCount) && ['MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect.', '`rowCount` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.paginationMode === 'server' && props.rowCount == null && !props.unstable_dataSource && ["MUI X: The `rowCount` prop must be passed using `paginationMode='server'`", 'For more detail, see http://mui.com/components/data-grid/pagination/#index-based-pagination'].join('\n') || undefined];
|
|
5
5
|
export function validateProps(props, validators) {
|
|
6
6
|
validators.forEach(validator => {
|
|
@@ -47,7 +47,6 @@ const useDataGridComponent = (inputApiRef, props) => {
|
|
|
47
47
|
/**
|
|
48
48
|
* Register all state initializers here.
|
|
49
49
|
*/
|
|
50
|
-
(0, _useGridInitializeState.useGridInitializeState)(_useGridDimensions.dimensionsStateInitializer, apiRef, props);
|
|
51
50
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowSelection.rowSelectionStateInitializer, apiRef, props);
|
|
52
51
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumns.columnsStateInitializer, apiRef, props);
|
|
53
52
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridPagination.paginationStateInitializer, apiRef, props);
|
|
@@ -60,10 +59,11 @@ const useDataGridComponent = (inputApiRef, props) => {
|
|
|
60
59
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowSpanning.rowSpanningStateInitializer, apiRef, props);
|
|
61
60
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridDensity.densityStateInitializer, apiRef, props);
|
|
62
61
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnResize.columnResizeStateInitializer, apiRef, props);
|
|
63
|
-
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowsMeta.rowsMetaStateInitializer, apiRef, props);
|
|
64
62
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnMenu.columnMenuStateInitializer, apiRef, props);
|
|
65
63
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnGrouping.columnGroupsStateInitializer, apiRef, props);
|
|
66
64
|
(0, _useGridInitializeState.useGridInitializeState)(_virtualization.virtualizationStateInitializer, apiRef, props);
|
|
65
|
+
(0, _useGridInitializeState.useGridInitializeState)(_useGridDimensions.dimensionsStateInitializer, apiRef, props);
|
|
66
|
+
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowsMeta.rowsMetaStateInitializer, apiRef, props);
|
|
67
67
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridListView.listViewStateInitializer, apiRef, props);
|
|
68
68
|
(0, _useGridKeyboardNavigation.useGridKeyboardNavigation)(apiRef, props);
|
|
69
69
|
(0, _useGridRowSelection.useGridRowSelection)(apiRef, props);
|
|
@@ -87,7 +87,10 @@ const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
|
|
|
87
87
|
const isRowReorderingEnabled = (0, _useGridSelector.useGridSelector)(apiRef, isRowReorderingEnabledSelector, rowReordering);
|
|
88
88
|
const handleRef = (0, _utils.unstable_useForkRef)(ref, refProp);
|
|
89
89
|
const rowNode = apiRef.current.getRowNode(rowId);
|
|
90
|
-
const editing = (0, _useGridSelector.useGridSelector)(apiRef, _gridEditingSelectors.gridRowIsEditingSelector,
|
|
90
|
+
const editing = (0, _useGridSelector.useGridSelector)(apiRef, _gridEditingSelectors.gridRowIsEditingSelector, {
|
|
91
|
+
rowId,
|
|
92
|
+
editMode: rootProps.editMode
|
|
93
|
+
});
|
|
91
94
|
const editable = rootProps.editMode === _gridEditRowModel.GridEditModes.Row;
|
|
92
95
|
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
93
96
|
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < firstColumnIndex;
|
|
@@ -305,7 +308,8 @@ const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
|
|
|
305
308
|
role: "presentation",
|
|
306
309
|
className: (0, _clsx.default)(_gridClasses.gridClasses.cell, _gridClasses.gridClasses.cellEmpty)
|
|
307
310
|
}), rightCells, scrollbarWidth !== 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridScrollbarFillerCell.GridScrollbarFillerCell, {
|
|
308
|
-
pinnedRight: pinnedColumns.right.length > 0
|
|
311
|
+
pinnedRight: pinnedColumns.right.length > 0,
|
|
312
|
+
borderTop: !isFirstVisible
|
|
309
313
|
})]
|
|
310
314
|
}));
|
|
311
315
|
});
|
|
@@ -20,9 +20,9 @@ var _useGridApiEventHandler = require("../hooks/utils/useGridApiEventHandler");
|
|
|
20
20
|
var _useGridSelector = require("../hooks/utils/useGridSelector");
|
|
21
21
|
var _gridDimensionsSelectors = require("../hooks/features/dimensions/gridDimensionsSelectors");
|
|
22
22
|
var _densitySelector = require("../hooks/features/density/densitySelector");
|
|
23
|
-
var _gridColumnsSelector = require("../hooks/features/columns/gridColumnsSelector");
|
|
24
23
|
var _useTimeout = require("../hooks/utils/useTimeout");
|
|
25
24
|
var _gridColumnsUtils = require("../hooks/features/columns/gridColumnsUtils");
|
|
25
|
+
var _createSelector = require("../utils/createSelector");
|
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
27
|
const CLIFF = 1;
|
|
28
28
|
const SLOP = 1.5;
|
|
@@ -57,21 +57,38 @@ const GridScrollAreaRawRoot = (0, _system.styled)('div', {
|
|
|
57
57
|
right: 0
|
|
58
58
|
}
|
|
59
59
|
}));
|
|
60
|
-
|
|
60
|
+
const offsetSelector = (0, _createSelector.createSelector)(_gridDimensionsSelectors.gridDimensionsSelector, (dimensions, direction) => {
|
|
61
|
+
if (direction === 'left') {
|
|
62
|
+
return dimensions.leftPinnedWidth;
|
|
63
|
+
}
|
|
64
|
+
if (direction === 'right') {
|
|
65
|
+
return dimensions.rightPinnedWidth + (dimensions.hasScrollX ? dimensions.scrollbarSize : 0);
|
|
66
|
+
}
|
|
67
|
+
return 0;
|
|
68
|
+
});
|
|
69
|
+
function GridScrollAreaWrapper(props) {
|
|
70
|
+
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
71
|
+
const [dragging, setDragging] = React.useState(false);
|
|
72
|
+
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'columnHeaderDragStart', () => setDragging(true));
|
|
73
|
+
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'columnHeaderDragEnd', () => setDragging(false));
|
|
74
|
+
if (!dragging) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridScrollAreaContent, (0, _extends2.default)({}, props));
|
|
78
|
+
}
|
|
79
|
+
function GridScrollAreaContent(props) {
|
|
61
80
|
const {
|
|
62
|
-
scrollDirection
|
|
81
|
+
scrollDirection,
|
|
82
|
+
scrollPosition
|
|
63
83
|
} = props;
|
|
64
84
|
const rootRef = React.useRef(null);
|
|
65
85
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
66
86
|
const timeout = (0, _useTimeout.useTimeout)();
|
|
67
87
|
const densityFactor = (0, _useGridSelector.useGridSelector)(apiRef, _densitySelector.gridDensityFactorSelector);
|
|
68
|
-
const columnsTotalWidth = (0, _useGridSelector.useGridSelector)(apiRef,
|
|
69
|
-
const
|
|
70
|
-
const scrollPosition = React.useRef({
|
|
71
|
-
left: 0,
|
|
72
|
-
top: 0
|
|
73
|
-
});
|
|
88
|
+
const columnsTotalWidth = (0, _useGridSelector.useGridSelector)(apiRef, _gridDimensionsSelectors.gridColumnsTotalWidthSelector);
|
|
89
|
+
const sideOffset = (0, _useGridSelector.useGridSelector)(apiRef, offsetSelector, scrollDirection);
|
|
74
90
|
const getCanScrollMore = () => {
|
|
91
|
+
const dimensions = (0, _gridDimensionsSelectors.gridDimensionsSelector)(apiRef.current.state);
|
|
75
92
|
if (scrollDirection === 'left') {
|
|
76
93
|
// Only render if the user has not reached yet the start of the list
|
|
77
94
|
return scrollPosition.current.left > 0;
|
|
@@ -83,7 +100,6 @@ function GridScrollAreaRaw(props) {
|
|
|
83
100
|
}
|
|
84
101
|
return false;
|
|
85
102
|
};
|
|
86
|
-
const [dragging, setDragging] = React.useState(false);
|
|
87
103
|
const [canScrollMore, setCanScrollMore] = React.useState(getCanScrollMore);
|
|
88
104
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
89
105
|
const ownerState = (0, _extends2.default)({}, rootProps, {
|
|
@@ -97,12 +113,11 @@ function GridScrollAreaRaw(props) {
|
|
|
97
113
|
top: totalHeaderHeight - headerHeight
|
|
98
114
|
};
|
|
99
115
|
if (scrollDirection === 'left') {
|
|
100
|
-
style.left =
|
|
116
|
+
style.left = sideOffset;
|
|
101
117
|
} else if (scrollDirection === 'right') {
|
|
102
|
-
style.right =
|
|
118
|
+
style.right = sideOffset;
|
|
103
119
|
}
|
|
104
|
-
const handleScrolling =
|
|
105
|
-
scrollPosition.current = newScrollPosition;
|
|
120
|
+
const handleScrolling = () => {
|
|
106
121
|
setCanScrollMore(getCanScrollMore);
|
|
107
122
|
};
|
|
108
123
|
const handleDragOver = (0, _utils.unstable_useEventCallback)(event => {
|
|
@@ -127,16 +142,8 @@ function GridScrollAreaRaw(props) {
|
|
|
127
142
|
});
|
|
128
143
|
});
|
|
129
144
|
});
|
|
130
|
-
const handleColumnHeaderDragStart = (0, _utils.unstable_useEventCallback)(() => {
|
|
131
|
-
setDragging(true);
|
|
132
|
-
});
|
|
133
|
-
const handleColumnHeaderDragEnd = (0, _utils.unstable_useEventCallback)(() => {
|
|
134
|
-
setDragging(false);
|
|
135
|
-
});
|
|
136
145
|
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'scrollPositionChange', handleScrolling);
|
|
137
|
-
(
|
|
138
|
-
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'columnHeaderDragEnd', handleColumnHeaderDragEnd);
|
|
139
|
-
if (!dragging || !canScrollMore) {
|
|
146
|
+
if (!canScrollMore) {
|
|
140
147
|
return null;
|
|
141
148
|
}
|
|
142
149
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridScrollAreaRawRoot, {
|
|
@@ -147,4 +154,4 @@ function GridScrollAreaRaw(props) {
|
|
|
147
154
|
style: style
|
|
148
155
|
});
|
|
149
156
|
}
|
|
150
|
-
const GridScrollArea = exports.GridScrollArea = (0, _fastMemo.fastMemo)(
|
|
157
|
+
const GridScrollArea = exports.GridScrollArea = (0, _fastMemo.fastMemo)(GridScrollAreaWrapper);
|
|
@@ -18,6 +18,7 @@ var _useGridApiContext = require("../hooks/utils/useGridApiContext");
|
|
|
18
18
|
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
19
19
|
var _hooks = require("../hooks");
|
|
20
20
|
var _constants = require("../internals/constants");
|
|
21
|
+
var _gridDimensionsSelectors = require("../hooks/features/dimensions/gridDimensionsSelectors");
|
|
21
22
|
var _gridClasses = require("../constants/gridClasses");
|
|
22
23
|
var _getPinnedCellOffset = require("../internals/utils/getPinnedCellOffset");
|
|
23
24
|
var _cellBorderUtils = require("../utils/cellBorderUtils");
|
|
@@ -62,7 +63,7 @@ const GridSkeletonLoadingOverlay = exports.GridSkeletonLoadingOverlay = (0, _for
|
|
|
62
63
|
const dimensions = (0, _hooks.useGridSelector)(apiRef, _hooks.gridDimensionsSelector);
|
|
63
64
|
const viewportHeight = dimensions?.viewportInnerSize.height ?? 0;
|
|
64
65
|
const skeletonRowsCount = Math.ceil(viewportHeight / dimensions.rowHeight);
|
|
65
|
-
const totalWidth = (0, _hooks.useGridSelector)(apiRef,
|
|
66
|
+
const totalWidth = (0, _hooks.useGridSelector)(apiRef, _gridDimensionsSelectors.gridColumnsTotalWidthSelector);
|
|
66
67
|
const positions = (0, _hooks.useGridSelector)(apiRef, _hooks.gridColumnPositionsSelector);
|
|
67
68
|
const inViewportCount = React.useMemo(() => positions.filter(value => value <= totalWidth).length, [totalWidth, positions]);
|
|
68
69
|
const allVisibleColumns = (0, _hooks.useGridSelector)(apiRef, _hooks.gridVisibleColumnDefinitionsSelector);
|
|
@@ -20,6 +20,7 @@ var _useGridPrivateApiContext = require("../../hooks/utils/useGridPrivateApiCont
|
|
|
20
20
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
21
21
|
var _gridClasses = require("../../constants/gridClasses");
|
|
22
22
|
var _densitySelector = require("../../hooks/features/density/densitySelector");
|
|
23
|
+
var _useIsSSR = require("../../hooks/utils/useIsSSR");
|
|
23
24
|
var _GridHeader = require("../GridHeader");
|
|
24
25
|
var _base = require("../base");
|
|
25
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -45,16 +46,17 @@ const GridRoot = (0, _forwardRef.forwardRef)(function GridRoot(props, ref) {
|
|
|
45
46
|
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
46
47
|
const density = (0, _useGridSelector.useGridSelector)(apiRef, _densitySelector.gridDensitySelector);
|
|
47
48
|
const rootElementRef = apiRef.current.rootElementRef;
|
|
48
|
-
const
|
|
49
|
+
const rootMountCallback = React.useCallback(node => {
|
|
50
|
+
if (node === null) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
apiRef.current.publishEvent('rootMount', node);
|
|
54
|
+
}, [apiRef]);
|
|
55
|
+
const handleRef = (0, _utils.unstable_useForkRef)(rootElementRef, ref, rootMountCallback);
|
|
49
56
|
const ownerState = rootProps;
|
|
50
57
|
const classes = useUtilityClasses(ownerState, density);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const [mountedState, setMountedState] = React.useState(false);
|
|
54
|
-
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
55
|
-
setMountedState(true);
|
|
56
|
-
}, []);
|
|
57
|
-
if (!mountedState) {
|
|
58
|
+
const isSSR = (0, _useIsSSR.useIsSSR)();
|
|
59
|
+
if (isSSR) {
|
|
58
60
|
return null;
|
|
59
61
|
}
|
|
60
62
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridRootStyles.GridRootStyles, (0, _extends2.default)({
|
|
@@ -10,7 +10,6 @@ var _styles = require("@mui/material/styles");
|
|
|
10
10
|
var _gridClasses = require("../../constants/gridClasses");
|
|
11
11
|
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
12
12
|
var _useGridPrivateApiContext = require("../../hooks/utils/useGridPrivateApiContext");
|
|
13
|
-
var _gridDimensionsSelectors = require("../../hooks/features/dimensions/gridDimensionsSelectors");
|
|
14
13
|
function getBorderColor(theme) {
|
|
15
14
|
if (theme.vars) {
|
|
16
15
|
return theme.vars.palette.TableCell.border;
|
|
@@ -42,6 +41,7 @@ const separatorIconDragStyles = {
|
|
|
42
41
|
// Emotion thinks it knows better than us which selector we should use.
|
|
43
42
|
// https://github.com/emotion-js/emotion/issues/1105#issuecomment-1722524968
|
|
44
43
|
const ignoreSsrWarning = '/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */';
|
|
44
|
+
const shouldShowBorderTopRightRadiusSelector = state => state.dimensions.hasScrollX && (!state.dimensions.hasScrollY || state.dimensions.scrollbarSize === 0);
|
|
45
45
|
const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
46
46
|
name: 'MuiDataGrid',
|
|
47
47
|
slot: 'Root',
|
|
@@ -272,7 +272,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
272
272
|
theme: t
|
|
273
273
|
}) => {
|
|
274
274
|
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
275
|
-
const
|
|
275
|
+
const shouldShowBorderTopRightRadius = (0, _useGridSelector.useGridSelector)(apiRef, shouldShowBorderTopRightRadiusSelector);
|
|
276
276
|
const borderColor = getBorderColor(t);
|
|
277
277
|
const radius = t.shape.borderRadius;
|
|
278
278
|
const background = (t.vars || t).palette.DataGrid?.bg ?? (t.vars || t).palette.background.default;
|
|
@@ -427,7 +427,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
427
427
|
borderTopLeftRadius: 'calc(var(--unstable_DataGrid-radius) - 1px)'
|
|
428
428
|
},
|
|
429
429
|
[`&.${_gridClasses.gridClasses['root--noToolbar']} [aria-rowindex="1"] .${_gridClasses.gridClasses['columnHeader--last']}`]: {
|
|
430
|
-
borderTopRightRadius:
|
|
430
|
+
borderTopRightRadius: shouldShowBorderTopRightRadius ? 'calc(var(--unstable_DataGrid-radius) - 1px)' : undefined
|
|
431
431
|
},
|
|
432
432
|
[`& .${_gridClasses.gridClasses.columnHeaderCheckbox}, & .${_gridClasses.gridClasses.cellCheckbox}`]: {
|
|
433
433
|
padding: 0,
|
|
@@ -11,14 +11,15 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
11
11
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var React = _interopRequireWildcard(require("react"));
|
|
14
|
-
var _MenuList = _interopRequireDefault(require("@mui/material/MenuList"));
|
|
15
14
|
var _styles = require("@mui/material/styles");
|
|
16
15
|
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
17
16
|
var _keyboardUtils = require("../../../utils/keyboardUtils");
|
|
17
|
+
var _assert = require("../../../utils/assert");
|
|
18
18
|
var _gridClasses = require("../../../constants/gridClasses");
|
|
19
|
+
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
19
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
21
|
const _excluded = ["hideMenu", "colDef", "id", "labelledby", "className", "children", "open"];
|
|
21
|
-
const StyledMenuList = (0, _styles.styled)(
|
|
22
|
+
const StyledMenuList = (0, _styles.styled)(_assert.NotRendered)(() => ({
|
|
22
23
|
minWidth: 248
|
|
23
24
|
}));
|
|
24
25
|
const GridColumnMenuContainer = exports.GridColumnMenuContainer = (0, _forwardRef.forwardRef)(function GridColumnMenuContainer(props, ref) {
|
|
@@ -31,6 +32,7 @@ const GridColumnMenuContainer = exports.GridColumnMenuContainer = (0, _forwardRe
|
|
|
31
32
|
open
|
|
32
33
|
} = props,
|
|
33
34
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
35
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
34
36
|
const handleListKeyDown = React.useCallback(event => {
|
|
35
37
|
if (event.key === 'Tab') {
|
|
36
38
|
event.preventDefault();
|
|
@@ -40,6 +42,7 @@ const GridColumnMenuContainer = exports.GridColumnMenuContainer = (0, _forwardRe
|
|
|
40
42
|
}
|
|
41
43
|
}, [hideMenu]);
|
|
42
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledMenuList, (0, _extends2.default)({
|
|
45
|
+
as: rootProps.slots.baseMenuList,
|
|
43
46
|
id: id,
|
|
44
47
|
className: (0, _clsx.default)(_gridClasses.gridClasses.menuList, className),
|
|
45
48
|
"aria-labelledby": labelledby,
|
|
@@ -26,7 +26,7 @@ const Element = (0, _system.styled)('div', {
|
|
|
26
26
|
const {
|
|
27
27
|
ownerState
|
|
28
28
|
} = props;
|
|
29
|
-
return [styles.main, ownerState.
|
|
29
|
+
return [styles.main, ownerState.hasPinnedRight && styles['main--hasPinnedRight'], ownerState.loadingOverlayVariant === 'skeleton' && styles['main--hasSkeletonLoadingOverlay']];
|
|
30
30
|
}
|
|
31
31
|
})({
|
|
32
32
|
flexGrow: 1,
|