@mui/x-data-grid 7.12.1 → 7.14.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 +162 -1
- package/DataGrid/DataGrid.js +10 -1
- package/components/GridColumnHeaders.js +1 -1
- package/components/GridConfigurationContext.d.ts +2 -0
- package/components/GridConfigurationContext.js +5 -0
- package/components/GridHeaders.js +1 -1
- package/components/GridRow.js +6 -8
- package/components/GridScrollArea.js +1 -1
- package/components/GridSkeletonLoadingOverlay.js +1 -1
- package/components/cell/GridCell.js +12 -13
- package/components/cell/GridEditSingleSelectCell.js +2 -3
- package/components/cell/GridSkeletonCell.js +2 -2
- package/components/columnHeaders/GridColumnHeaderItem.js +1 -1
- package/components/containers/GridRootStyles.js +9 -2
- package/components/menu/columnMenu/GridColumnMenuContainer.js +2 -2
- package/components/panel/GridPanel.js +1 -2
- package/components/panel/filterPanel/GridFilterForm.js +9 -4
- package/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/components/toolbar/GridToolbarExportContainer.js +2 -2
- package/components/toolbar/GridToolbarQuickFilter.js +5 -3
- package/components/virtualization/GridMainContainer.js +3 -2
- package/components/virtualization/GridVirtualScrollerFiller.js +1 -1
- package/context/GridContextProvider.d.ts +3 -1
- package/context/GridContextProvider.js +12 -7
- package/hooks/core/useGridStateInitialization.js +1 -3
- package/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/hooks/features/export/serializers/csvSerializer.js +4 -3
- package/hooks/features/filter/gridFilterSelector.d.ts +20 -7
- package/hooks/features/filter/gridFilterSelector.js +34 -0
- package/hooks/features/filter/gridFilterState.d.ts +6 -0
- package/hooks/features/filter/index.d.ts +2 -1
- package/hooks/features/filter/index.js +1 -1
- package/hooks/features/filter/useGridFilter.js +3 -0
- package/hooks/features/rowSelection/useGridRowSelection.js +4 -1
- package/hooks/features/rows/useGridParamsApi.js +2 -1
- package/hooks/features/rows/useGridRowAriaAttributes.d.ts +2 -0
- package/hooks/features/rows/useGridRowAriaAttributes.js +19 -0
- package/hooks/utils/useGridAriaAttributes.d.ts +2 -6
- package/hooks/utils/useGridAriaAttributes.js +5 -8
- package/hooks/utils/useGridConfiguration.d.ts +2 -0
- package/hooks/utils/useGridConfiguration.js +9 -0
- package/hooks/utils/useGridSelector.d.ts +5 -2
- package/hooks/utils/useGridSelector.js +39 -1
- package/index.js +1 -1
- package/internals/index.d.ts +5 -2
- package/internals/index.js +5 -2
- package/locales/csCZ.js +4 -5
- package/locales/heIL.js +4 -5
- package/locales/viVN.js +4 -5
- package/models/configuration/gridConfiguration.d.ts +10 -0
- package/models/configuration/gridConfiguration.js +1 -0
- package/models/configuration/gridRowConfiguration.d.ts +12 -0
- package/models/configuration/gridRowConfiguration.js +1 -0
- package/models/gridDataSource.d.ts +8 -7
- package/models/gridRows.d.ts +2 -2
- package/models/params/gridCellParams.d.ts +4 -0
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/DataGrid/DataGrid.js +10 -1
- package/modern/components/GridColumnHeaders.js +1 -1
- package/modern/components/GridConfigurationContext.js +5 -0
- package/modern/components/GridHeaders.js +1 -1
- package/modern/components/GridRow.js +6 -8
- package/modern/components/GridScrollArea.js +1 -1
- package/modern/components/GridSkeletonLoadingOverlay.js +1 -1
- package/modern/components/cell/GridCell.js +12 -13
- package/modern/components/cell/GridEditSingleSelectCell.js +2 -3
- package/modern/components/cell/GridSkeletonCell.js +2 -2
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +1 -1
- package/modern/components/containers/GridRootStyles.js +9 -2
- package/modern/components/menu/columnMenu/GridColumnMenuContainer.js +2 -2
- package/modern/components/panel/GridPanel.js +1 -2
- package/modern/components/panel/filterPanel/GridFilterForm.js +9 -4
- package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/modern/components/toolbar/GridToolbarExportContainer.js +2 -2
- package/modern/components/toolbar/GridToolbarQuickFilter.js +5 -3
- package/modern/components/virtualization/GridMainContainer.js +3 -2
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +1 -1
- package/modern/context/GridContextProvider.js +12 -7
- package/modern/hooks/core/useGridStateInitialization.js +1 -3
- package/modern/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/modern/hooks/features/export/serializers/csvSerializer.js +4 -3
- package/modern/hooks/features/filter/gridFilterSelector.js +34 -0
- package/modern/hooks/features/filter/index.js +1 -1
- package/modern/hooks/features/filter/useGridFilter.js +3 -0
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +4 -1
- package/modern/hooks/features/rows/useGridParamsApi.js +2 -1
- package/modern/hooks/features/rows/useGridRowAriaAttributes.js +19 -0
- package/modern/hooks/utils/useGridAriaAttributes.js +5 -8
- package/modern/hooks/utils/useGridConfiguration.js +9 -0
- package/modern/hooks/utils/useGridSelector.js +39 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +5 -2
- package/modern/locales/csCZ.js +4 -5
- package/modern/locales/heIL.js +4 -5
- package/modern/locales/viVN.js +4 -5
- package/modern/models/configuration/gridConfiguration.js +1 -0
- package/modern/models/configuration/gridRowConfiguration.js +1 -0
- package/modern/utils/createSelector.js +116 -0
- package/modern/utils/keyboardUtils.js +1 -11
- package/node/DataGrid/DataGrid.js +10 -1
- package/node/components/GridColumnHeaders.js +1 -1
- package/node/{utils/fastMemo.js → components/GridConfigurationContext.js} +4 -4
- package/node/components/GridHeaders.js +1 -1
- package/node/components/GridRow.js +6 -8
- package/node/components/GridScrollArea.js +1 -1
- package/node/components/GridSkeletonLoadingOverlay.js +1 -1
- package/node/components/cell/GridCell.js +12 -13
- package/node/components/cell/GridEditSingleSelectCell.js +2 -3
- package/node/components/cell/GridSkeletonCell.js +2 -2
- package/node/components/columnHeaders/GridColumnHeaderItem.js +1 -1
- package/node/components/containers/GridRootStyles.js +9 -2
- package/node/components/menu/columnMenu/GridColumnMenuContainer.js +1 -1
- package/node/components/panel/GridPanel.js +1 -2
- package/node/components/panel/filterPanel/GridFilterForm.js +9 -4
- package/node/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +1 -1
- package/node/components/toolbar/GridToolbarQuickFilter.js +5 -3
- package/node/components/virtualization/GridMainContainer.js +3 -2
- package/node/components/virtualization/GridVirtualScrollerFiller.js +1 -1
- package/node/context/GridContextProvider.js +12 -7
- package/node/hooks/core/useGridStateInitialization.js +1 -3
- package/node/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/node/hooks/features/export/serializers/csvSerializer.js +4 -3
- package/node/hooks/features/filter/gridFilterSelector.js +35 -1
- package/node/hooks/features/filter/index.js +97 -15
- package/node/hooks/features/filter/useGridFilter.js +3 -0
- package/node/hooks/features/rowSelection/useGridRowSelection.js +4 -1
- package/node/hooks/features/rows/useGridParamsApi.js +2 -1
- package/node/hooks/features/rows/useGridRowAriaAttributes.js +28 -0
- package/node/hooks/utils/useGridAriaAttributes.js +4 -7
- package/node/hooks/utils/useGridConfiguration.js +18 -0
- package/node/hooks/utils/useGridSelector.js +42 -3
- package/node/index.js +1 -1
- package/node/internals/index.js +53 -12
- package/node/locales/csCZ.js +4 -5
- package/node/locales/heIL.js +4 -5
- package/node/locales/viVN.js +4 -5
- package/node/models/configuration/gridConfiguration.js +5 -0
- package/node/models/configuration/gridRowConfiguration.js +5 -0
- package/node/utils/createSelector.js +119 -2
- package/node/utils/keyboardUtils.js +2 -15
- package/package.json +4 -4
- package/utils/createSelector.d.ts +19 -0
- package/utils/createSelector.js +116 -0
- package/utils/keyboardUtils.d.ts +1 -9
- package/utils/keyboardUtils.js +1 -11
- package/modern/utils/fastMemo.js +0 -5
- package/modern/utils/fastObjectShallowCompare.js +0 -28
- package/modern/utils/throttle.js +0 -19
- package/node/utils/fastObjectShallowCompare.js +0 -34
- package/node/utils/throttle.js +0 -25
- package/utils/fastMemo.d.ts +0 -1
- package/utils/fastMemo.js +0 -5
- package/utils/fastObjectShallowCompare.d.ts +0 -1
- package/utils/fastObjectShallowCompare.js +0 -28
- package/utils/throttle.d.ts +0 -4
- package/utils/throttle.js +0 -19
|
@@ -32,6 +32,12 @@ export const gridVisibleRowsLookupSelector = state => state.visibleRowsLookup;
|
|
|
32
32
|
*/
|
|
33
33
|
export const gridFilteredRowsLookupSelector = createSelector(gridFilterStateSelector, filterState => filterState.filteredRowsLookup);
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* @category Filtering
|
|
37
|
+
* @ignore - do not document.
|
|
38
|
+
*/
|
|
39
|
+
export const gridFilteredChildrenCountLookupSelector = createSelector(gridFilterStateSelector, filterState => filterState.filteredChildrenCountLookup);
|
|
40
|
+
|
|
35
41
|
/**
|
|
36
42
|
* @category Filtering
|
|
37
43
|
* @ignore - do not document.
|
|
@@ -66,6 +72,34 @@ export const gridFilteredSortedRowEntriesSelector = createSelectorMemoized(gridF
|
|
|
66
72
|
*/
|
|
67
73
|
export const gridFilteredSortedRowIdsSelector = createSelectorMemoized(gridFilteredSortedRowEntriesSelector, filteredSortedRowEntries => filteredSortedRowEntries.map(row => row.id));
|
|
68
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Get the ids to position in the current tree level lookup of the rows accessible after the filtering process.
|
|
77
|
+
* Does not contain the collapsed children.
|
|
78
|
+
* @category Filtering
|
|
79
|
+
* @ignore - do not document.
|
|
80
|
+
*/
|
|
81
|
+
export const gridExpandedSortedRowTreeLevelPositionLookupSelector = createSelectorMemoized(gridExpandedSortedRowIdsSelector, gridRowTreeSelector, (visibleSortedRowIds, rowTree) => {
|
|
82
|
+
const depthPositionCounter = {};
|
|
83
|
+
let lastDepth = 0;
|
|
84
|
+
return visibleSortedRowIds.reduce((acc, rowId) => {
|
|
85
|
+
const rowNode = rowTree[rowId];
|
|
86
|
+
if (!depthPositionCounter[rowNode.depth]) {
|
|
87
|
+
depthPositionCounter[rowNode.depth] = 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// going deeper in the tree should reset the counter
|
|
91
|
+
// since it might have been used in some other branch at the same level, up in the tree
|
|
92
|
+
// going back up should keep the counter and continue where it left off
|
|
93
|
+
if (rowNode.depth > lastDepth) {
|
|
94
|
+
depthPositionCounter[rowNode.depth] = 0;
|
|
95
|
+
}
|
|
96
|
+
lastDepth = rowNode.depth;
|
|
97
|
+
depthPositionCounter[rowNode.depth] += 1;
|
|
98
|
+
acc[rowId] = depthPositionCounter[rowNode.depth];
|
|
99
|
+
return acc;
|
|
100
|
+
}, {});
|
|
101
|
+
});
|
|
102
|
+
|
|
69
103
|
/**
|
|
70
104
|
* Get the id and the model of the top level rows accessible after the filtering process.
|
|
71
105
|
* @category Filtering
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { getDefaultGridFilterModel } from './gridFilterState';
|
|
2
|
-
export
|
|
2
|
+
export { gridFilterModelSelector, gridQuickFilterValuesSelector, gridVisibleRowsLookupSelector, gridFilteredRowsLookupSelector, gridFilteredDescendantCountLookupSelector, gridExpandedSortedRowEntriesSelector, gridExpandedSortedRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, gridFilteredSortedTopLevelRowEntriesSelector, gridExpandedRowCountSelector, gridFilteredTopLevelRowCountSelector, gridFilteredRowCountSelector, gridFilteredDescendantRowCountSelector, gridFilterActiveItemsSelector, gridFilterActiveItemsLookupSelector } from './gridFilterSelector';
|
|
@@ -23,6 +23,7 @@ export const filterStateInitializer = (state, props, apiRef) => {
|
|
|
23
23
|
filter: {
|
|
24
24
|
filterModel: sanitizeFilterModel(filterModel, props.disableMultipleColumnsFiltering, apiRef),
|
|
25
25
|
filteredRowsLookup: {},
|
|
26
|
+
filteredChildrenCountLookup: {},
|
|
26
27
|
filteredDescendantCountLookup: {}
|
|
27
28
|
},
|
|
28
29
|
visibleRowsLookup: {}
|
|
@@ -273,6 +274,7 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
273
274
|
if (props.filterMode !== 'client' || !params.isRowMatchingFilters) {
|
|
274
275
|
return {
|
|
275
276
|
filteredRowsLookup: {},
|
|
277
|
+
filteredChildrenCountLookup: {},
|
|
276
278
|
filteredDescendantCountLookup: {}
|
|
277
279
|
};
|
|
278
280
|
}
|
|
@@ -301,6 +303,7 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
301
303
|
}
|
|
302
304
|
return {
|
|
303
305
|
filteredRowsLookup,
|
|
306
|
+
filteredChildrenCountLookup: {},
|
|
304
307
|
filteredDescendantCountLookup: {}
|
|
305
308
|
};
|
|
306
309
|
}, [apiRef, props.filterMode, getRowId, getRowsRef]);
|
|
@@ -105,6 +105,9 @@ export const useGridRowSelection = (apiRef, props) => {
|
|
|
105
105
|
}, [apiRef, logger, props.rowSelection, props.signature, canHaveMultipleSelection]);
|
|
106
106
|
const isRowSelected = React.useCallback(id => gridRowSelectionStateSelector(apiRef.current.state).includes(id), [apiRef]);
|
|
107
107
|
const isRowSelectable = React.useCallback(id => {
|
|
108
|
+
if (props.rowSelection === false) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
108
111
|
if (propIsRowSelectable && !propIsRowSelectable(apiRef.current.getRowParams(id))) {
|
|
109
112
|
return false;
|
|
110
113
|
}
|
|
@@ -113,7 +116,7 @@ export const useGridRowSelection = (apiRef, props) => {
|
|
|
113
116
|
return false;
|
|
114
117
|
}
|
|
115
118
|
return true;
|
|
116
|
-
}, [apiRef, propIsRowSelectable]);
|
|
119
|
+
}, [apiRef, props.rowSelection, propIsRowSelectable]);
|
|
117
120
|
const getSelectedRows = React.useCallback(() => selectedGridRowsSelector(apiRef), [apiRef]);
|
|
118
121
|
const selectRow = React.useCallback((id, isSelected = true, resetSelection = false) => {
|
|
119
122
|
if (!apiRef.current.isRowSelectable(id)) {
|
|
@@ -51,7 +51,8 @@ export function useGridParamsApi(apiRef) {
|
|
|
51
51
|
tabIndex: cellTabIndex && cellTabIndex.field === field && cellTabIndex.id === id ? 0 : -1,
|
|
52
52
|
value,
|
|
53
53
|
formattedValue: value,
|
|
54
|
-
isEditable: false
|
|
54
|
+
isEditable: false,
|
|
55
|
+
api: {}
|
|
55
56
|
};
|
|
56
57
|
if (colDef && colDef.valueFormatter) {
|
|
57
58
|
params.formattedValue = colDef.valueFormatter(value, row, colDef, apiRef);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { selectedIdsLookupSelector } from '../rowSelection';
|
|
3
|
+
import { useGridSelector } from '../../utils/useGridSelector';
|
|
4
|
+
import { gridColumnGroupsHeaderMaxDepthSelector } from '../columnGrouping/gridColumnGroupsSelector';
|
|
5
|
+
import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext';
|
|
6
|
+
export const useGridRowAriaAttributes = () => {
|
|
7
|
+
const apiRef = useGridPrivateApiContext();
|
|
8
|
+
const selectedIdsLookup = useGridSelector(apiRef, selectedIdsLookupSelector);
|
|
9
|
+
const headerGroupingMaxDepth = useGridSelector(apiRef, gridColumnGroupsHeaderMaxDepthSelector);
|
|
10
|
+
return React.useCallback((rowNode, index) => {
|
|
11
|
+
const ariaAttributes = {};
|
|
12
|
+
const ariaRowIndex = index + headerGroupingMaxDepth + 2; // 1 for the header row and 1 as it's 1-based
|
|
13
|
+
ariaAttributes['aria-rowindex'] = ariaRowIndex;
|
|
14
|
+
if (apiRef.current.isRowSelectable(rowNode.id)) {
|
|
15
|
+
ariaAttributes['aria-selected'] = selectedIdsLookup[rowNode.id] !== undefined;
|
|
16
|
+
}
|
|
17
|
+
return ariaAttributes;
|
|
18
|
+
}, [apiRef, selectedIdsLookup, headerGroupingMaxDepth]);
|
|
19
|
+
};
|
|
@@ -2,24 +2,21 @@ import { gridVisibleColumnDefinitionsSelector } from '../features/columns/gridCo
|
|
|
2
2
|
import { useGridSelector } from './useGridSelector';
|
|
3
3
|
import { useGridRootProps } from './useGridRootProps';
|
|
4
4
|
import { gridColumnGroupsHeaderMaxDepthSelector } from '../features/columnGrouping/gridColumnGroupsSelector';
|
|
5
|
-
import { gridPinnedRowsCountSelector
|
|
5
|
+
import { gridPinnedRowsCountSelector } from '../features/rows/gridRowsSelector';
|
|
6
6
|
import { useGridPrivateApiContext } from './useGridPrivateApiContext';
|
|
7
7
|
import { isMultipleRowSelectionEnabled } from '../features/rowSelection/utils';
|
|
8
|
+
import { gridExpandedRowCountSelector } from '../features/filter/gridFilterSelector';
|
|
8
9
|
export const useGridAriaAttributes = () => {
|
|
9
10
|
const apiRef = useGridPrivateApiContext();
|
|
10
11
|
const rootProps = useGridRootProps();
|
|
11
12
|
const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
|
|
12
|
-
const
|
|
13
|
+
const accessibleRowCount = useGridSelector(apiRef, gridExpandedRowCountSelector);
|
|
13
14
|
const headerGroupingMaxDepth = useGridSelector(apiRef, gridColumnGroupsHeaderMaxDepthSelector);
|
|
14
15
|
const pinnedRowsCount = useGridSelector(apiRef, gridPinnedRowsCountSelector);
|
|
15
|
-
let role = 'grid';
|
|
16
|
-
if (rootProps.treeData) {
|
|
17
|
-
role = 'treegrid';
|
|
18
|
-
}
|
|
19
16
|
return {
|
|
20
|
-
role,
|
|
17
|
+
role: 'grid',
|
|
21
18
|
'aria-colcount': visibleColumns.length,
|
|
22
|
-
'aria-rowcount': headerGroupingMaxDepth + 1 + pinnedRowsCount +
|
|
19
|
+
'aria-rowcount': headerGroupingMaxDepth + 1 + pinnedRowsCount + accessibleRowCount,
|
|
23
20
|
'aria-multiselectable': isMultipleRowSelectionEnabled(rootProps)
|
|
24
21
|
};
|
|
25
22
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridConfigurationContext } from '../../components/GridConfigurationContext';
|
|
3
|
+
export const useGridConfiguration = () => {
|
|
4
|
+
const configuration = React.useContext(GridConfigurationContext);
|
|
5
|
+
if (configuration === undefined) {
|
|
6
|
+
throw new Error(['MUI X: Could not find the data grid configuration context.', 'It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.', 'This can also happen if you are bundling multiple versions of the data grid.'].join('\n'));
|
|
7
|
+
}
|
|
8
|
+
return configuration;
|
|
9
|
+
};
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { fastObjectShallowCompare } from '@mui/x-internals/fastObjectShallowCompare';
|
|
2
3
|
import { useLazyRef } from './useLazyRef';
|
|
3
4
|
import { useOnMount } from './useOnMount';
|
|
4
5
|
import { warnOnce } from '../../internals/utils/warning';
|
|
5
|
-
import { fastObjectShallowCompare } from '../../utils/fastObjectShallowCompare';
|
|
6
6
|
function isOutputSelector(selector) {
|
|
7
7
|
return selector.acceptsApiRef;
|
|
8
8
|
}
|
|
9
|
+
// TODO v8: Remove this function
|
|
9
10
|
function applySelector(apiRef, selector) {
|
|
10
11
|
if (isOutputSelector(selector)) {
|
|
11
12
|
return selector(apiRef);
|
|
12
13
|
}
|
|
13
14
|
return selector(apiRef.current.state);
|
|
14
15
|
}
|
|
16
|
+
|
|
17
|
+
// TODO v8: Rename this function to `applySelector`
|
|
18
|
+
function applySelectorV8(apiRef, selector, args, instanceId) {
|
|
19
|
+
if (isOutputSelector(selector)) {
|
|
20
|
+
return selector(apiRef, args);
|
|
21
|
+
}
|
|
22
|
+
return selector(apiRef.current.state, instanceId);
|
|
23
|
+
}
|
|
15
24
|
const defaultCompare = Object.is;
|
|
16
25
|
export const objectShallowCompare = fastObjectShallowCompare;
|
|
17
26
|
const createRefs = () => ({
|
|
@@ -19,6 +28,8 @@ const createRefs = () => ({
|
|
|
19
28
|
equals: null,
|
|
20
29
|
selector: null
|
|
21
30
|
});
|
|
31
|
+
|
|
32
|
+
// TODO v8: Remove this function
|
|
22
33
|
export const useGridSelector = (apiRef, selector, equals = defaultCompare) => {
|
|
23
34
|
if (process.env.NODE_ENV !== 'production') {
|
|
24
35
|
if (!apiRef.current.state) {
|
|
@@ -43,4 +54,31 @@ export const useGridSelector = (apiRef, selector, equals = defaultCompare) => {
|
|
|
43
54
|
});
|
|
44
55
|
});
|
|
45
56
|
return state;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// TODO v8: Rename this function to `useGridSelector`
|
|
60
|
+
export const useGridSelectorV8 = (apiRef, selector, args = undefined, equals = defaultCompare) => {
|
|
61
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
62
|
+
if (!apiRef.current.state) {
|
|
63
|
+
warnOnce(['MUI X: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const refs = useLazyRef(createRefs);
|
|
67
|
+
const didInit = refs.current.selector !== null;
|
|
68
|
+
const [state, setState] = React.useState(
|
|
69
|
+
// We don't use an initialization function to avoid allocations
|
|
70
|
+
didInit ? null : applySelectorV8(apiRef, selector, args, apiRef.current.instanceId));
|
|
71
|
+
refs.current.state = state;
|
|
72
|
+
refs.current.equals = equals;
|
|
73
|
+
refs.current.selector = selector;
|
|
74
|
+
useOnMount(() => {
|
|
75
|
+
return apiRef.current.store.subscribe(() => {
|
|
76
|
+
const newState = applySelectorV8(apiRef, refs.current.selector, args, apiRef.current.instanceId);
|
|
77
|
+
if (!refs.current.equals(refs.current.state, newState)) {
|
|
78
|
+
refs.current.state = newState;
|
|
79
|
+
setState(newState);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
return state;
|
|
46
84
|
};
|
package/modern/index.js
CHANGED
|
@@ -23,6 +23,7 @@ export { useGridCsvExport } from '../hooks/features/export/useGridCsvExport';
|
|
|
23
23
|
export { useGridPrintExport } from '../hooks/features/export/useGridPrintExport';
|
|
24
24
|
export { useGridFilter, filterStateInitializer } from '../hooks/features/filter/useGridFilter';
|
|
25
25
|
export { passFilterLogic } from '../hooks/features/filter/gridFilterUtils';
|
|
26
|
+
export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector } from '../hooks/features/filter/gridFilterSelector';
|
|
26
27
|
export { isSingleSelectColDef } from '../components/panel/filterPanel/filterPanelUtils';
|
|
27
28
|
export { useGridFocus, focusStateInitializer } from '../hooks/features/focus/useGridFocus';
|
|
28
29
|
export { useGridKeyboardNavigation } from '../hooks/features/keyboardNavigation/useGridKeyboardNavigation';
|
|
@@ -31,6 +32,8 @@ export { useGridPreferencesPanel, preferencePanelStateInitializer } from '../hoo
|
|
|
31
32
|
export { useGridEditing, editingStateInitializer } from '../hooks/features/editing/useGridEditing';
|
|
32
33
|
export { gridEditRowsStateSelector } from '../hooks/features/editing/gridEditingSelectors';
|
|
33
34
|
export { useGridRows, rowsStateInitializer } from '../hooks/features/rows/useGridRows';
|
|
35
|
+
export { useGridAriaAttributes } from '../hooks/utils/useGridAriaAttributes';
|
|
36
|
+
export { useGridRowAriaAttributes } from '../hooks/features/rows/useGridRowAriaAttributes';
|
|
34
37
|
export { useGridRowsPreProcessors } from '../hooks/features/rows/useGridRowsPreProcessors';
|
|
35
38
|
export { getTreeNodeDescendants, buildRootGroup } from '../hooks/features/rows/gridRowsUtils';
|
|
36
39
|
export { useGridRowsMeta, rowsMetaStateInitializer } from '../hooks/features/rows/useGridRowsMeta';
|
|
@@ -54,12 +57,12 @@ export { useGridVisibleRows, getVisibleRows } from '../hooks/utils/useGridVisibl
|
|
|
54
57
|
export { useGridInitializeState } from '../hooks/utils/useGridInitializeState';
|
|
55
58
|
export { getColumnsToExport, defaultGetRowsToExport } from '../hooks/features/export/utils';
|
|
56
59
|
export * from '../utils/createControllablePromise';
|
|
57
|
-
export { createSelector, createSelectorMemoized } from '../utils/createSelector';
|
|
60
|
+
export { createSelector, createSelectorV8, createSelectorMemoized, createSelectorMemoizedV8 } from '../utils/createSelector';
|
|
61
|
+
export { useGridSelectorV8 } from '../hooks/utils/useGridSelector';
|
|
58
62
|
export { gridRowGroupsToFetchSelector } from '../hooks/features/rows/gridRowsSelector';
|
|
59
63
|
export { findParentElementFromClassName, getActiveElement, isEventTargetInPortal } from '../utils/domUtils';
|
|
60
64
|
export { isNavigationKey, isPasteShortcut } from '../utils/keyboardUtils';
|
|
61
65
|
export * from '../utils/utils';
|
|
62
|
-
export * from '../utils/fastMemo';
|
|
63
66
|
export { exportAs } from '../utils/exportAs';
|
|
64
67
|
export * from '../utils/getPublicApiRef';
|
|
65
68
|
export * from '../utils/cellBorderUtils';
|
package/modern/locales/csCZ.js
CHANGED
|
@@ -38,11 +38,10 @@ const csCZGrid = {
|
|
|
38
38
|
toolbarExportPrint: 'Vytisknout',
|
|
39
39
|
toolbarExportExcel: 'Stáhnout jako Excel',
|
|
40
40
|
// Columns management text
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
columnsManagementSearchTitle: 'Hledat sloupce',
|
|
42
|
+
columnsManagementNoColumns: 'Žádné sloupce',
|
|
43
|
+
columnsManagementShowHideAllText: 'Zobrazit/skrýt vše',
|
|
44
|
+
columnsManagementReset: 'Resetovat',
|
|
46
45
|
// Filter panel text
|
|
47
46
|
filterPanelAddFilter: 'Přidat filtr',
|
|
48
47
|
filterPanelRemoveAll: 'Odstranit vše',
|
package/modern/locales/heIL.js
CHANGED
|
@@ -30,11 +30,10 @@ const heILGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'הדפסה',
|
|
31
31
|
toolbarExportExcel: 'ייצוא ל- Excel',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'חיפוש',
|
|
34
|
+
columnsManagementNoColumns: 'אין עמודות',
|
|
35
|
+
columnsManagementShowHideAllText: 'הצג/הסתר הכל',
|
|
36
|
+
columnsManagementReset: 'אתחול',
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'הוסף מסנן',
|
|
40
39
|
filterPanelRemoveAll: 'מחק הכל',
|
package/modern/locales/viVN.js
CHANGED
|
@@ -30,11 +30,10 @@ const viVNGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'In',
|
|
31
31
|
toolbarExportExcel: 'Xuất Excel',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'Tìm kiếm',
|
|
34
|
+
columnsManagementNoColumns: 'Không có cột',
|
|
35
|
+
columnsManagementShowHideAllText: 'Hiện/Ẩn Tất cả',
|
|
36
|
+
columnsManagementReset: 'Đặt lại',
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'Thêm bộ lọc',
|
|
40
39
|
filterPanelRemoveAll: 'Xóa tất cả',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { createSelector as reselectCreateSelector } from 'reselect';
|
|
2
2
|
import { warnOnce } from '../internals/utils/warning';
|
|
3
|
+
|
|
4
|
+
// TODO v8: Remove this type
|
|
5
|
+
|
|
6
|
+
// TODO v8: Rename this type to `OutputSelector`
|
|
7
|
+
|
|
8
|
+
// TODO v8: Remove this type
|
|
9
|
+
|
|
10
|
+
// TODO v8: Rename this type to `SelectorArgs`
|
|
11
|
+
|
|
12
|
+
// TODO v8: Remove this type
|
|
13
|
+
|
|
14
|
+
// TODO v8: Rename this type to `CreateSelectorFunction`
|
|
15
|
+
|
|
3
16
|
const cache = new WeakMap();
|
|
4
17
|
function checkIsAPIRef(value) {
|
|
5
18
|
return 'current' in value && 'instanceId' in value.current;
|
|
@@ -7,6 +20,8 @@ function checkIsAPIRef(value) {
|
|
|
7
20
|
const DEFAULT_INSTANCE_ID = {
|
|
8
21
|
id: 'default'
|
|
9
22
|
};
|
|
23
|
+
|
|
24
|
+
// TODO v8: Remove this function
|
|
10
25
|
export const createSelector = (a, b, c, d, e, f, ...other) => {
|
|
11
26
|
if (other.length > 0) {
|
|
12
27
|
throw new Error('Unsupported number of selectors');
|
|
@@ -71,6 +86,74 @@ export const createSelector = (a, b, c, d, e, f, ...other) => {
|
|
|
71
86
|
selector.acceptsApiRef = true;
|
|
72
87
|
return selector;
|
|
73
88
|
};
|
|
89
|
+
|
|
90
|
+
// TODO v8: Rename this function to `createSelector`
|
|
91
|
+
export const createSelectorV8 = (a, b, c, d, e, f, ...other) => {
|
|
92
|
+
if (other.length > 0) {
|
|
93
|
+
throw new Error('Unsupported number of selectors');
|
|
94
|
+
}
|
|
95
|
+
let selector;
|
|
96
|
+
if (a && b && c && d && e && f) {
|
|
97
|
+
selector = (stateOrApiRef, args, instanceIdParam) => {
|
|
98
|
+
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
99
|
+
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
100
|
+
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
101
|
+
const va = a(state, args, instanceId);
|
|
102
|
+
const vb = b(state, args, instanceId);
|
|
103
|
+
const vc = c(state, args, instanceId);
|
|
104
|
+
const vd = d(state, args, instanceId);
|
|
105
|
+
const ve = e(state, args, instanceId);
|
|
106
|
+
return f(va, vb, vc, vd, ve, args);
|
|
107
|
+
};
|
|
108
|
+
} else if (a && b && c && d && e) {
|
|
109
|
+
selector = (stateOrApiRef, args, instanceIdParam) => {
|
|
110
|
+
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
111
|
+
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
112
|
+
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
113
|
+
const va = a(state, args, instanceId);
|
|
114
|
+
const vb = b(state, args, instanceId);
|
|
115
|
+
const vc = c(state, args, instanceId);
|
|
116
|
+
const vd = d(state, args, instanceId);
|
|
117
|
+
return e(va, vb, vc, vd, args);
|
|
118
|
+
};
|
|
119
|
+
} else if (a && b && c && d) {
|
|
120
|
+
selector = (stateOrApiRef, args, instanceIdParam) => {
|
|
121
|
+
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
122
|
+
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
123
|
+
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
124
|
+
const va = a(state, args, instanceId);
|
|
125
|
+
const vb = b(state, args, instanceId);
|
|
126
|
+
const vc = c(state, args, instanceId);
|
|
127
|
+
return d(va, vb, vc, args);
|
|
128
|
+
};
|
|
129
|
+
} else if (a && b && c) {
|
|
130
|
+
selector = (stateOrApiRef, args, instanceIdParam) => {
|
|
131
|
+
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
132
|
+
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
133
|
+
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
134
|
+
const va = a(state, args, instanceId);
|
|
135
|
+
const vb = b(state, args, instanceId);
|
|
136
|
+
return c(va, vb, args);
|
|
137
|
+
};
|
|
138
|
+
} else if (a && b) {
|
|
139
|
+
selector = (stateOrApiRef, args, instanceIdParam) => {
|
|
140
|
+
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
141
|
+
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
142
|
+
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
143
|
+
const va = a(state, args, instanceId);
|
|
144
|
+
return b(va, args);
|
|
145
|
+
};
|
|
146
|
+
} else {
|
|
147
|
+
throw new Error('Missing arguments');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// We use this property to detect if the selector was created with createSelector
|
|
151
|
+
// or it's only a simple function the receives the state and returns part of it.
|
|
152
|
+
selector.acceptsApiRef = true;
|
|
153
|
+
return selector;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// TODO v8: Remove this function
|
|
74
157
|
export const createSelectorMemoized = (...args) => {
|
|
75
158
|
const selector = (stateOrApiRef, instanceId) => {
|
|
76
159
|
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
@@ -97,6 +180,39 @@ export const createSelectorMemoized = (...args) => {
|
|
|
97
180
|
return fn(state, cacheKey);
|
|
98
181
|
};
|
|
99
182
|
|
|
183
|
+
// We use this property to detect if the selector was created with createSelector
|
|
184
|
+
// or it's only a simple function the receives the state and returns part of it.
|
|
185
|
+
selector.acceptsApiRef = true;
|
|
186
|
+
return selector;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// TODO v8: Rename this function to `createSelectorMemoized`
|
|
190
|
+
export const createSelectorMemoizedV8 = (...args) => {
|
|
191
|
+
const selector = (stateOrApiRef, selectorArgs, instanceId) => {
|
|
192
|
+
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
193
|
+
const cacheKey = isAPIRef ? stateOrApiRef.current.instanceId : instanceId ?? DEFAULT_INSTANCE_ID;
|
|
194
|
+
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
195
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
196
|
+
if (cacheKey.id === 'default') {
|
|
197
|
+
warnOnce(['MUI X: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, for example `mySelector(apiRef)`, or pass the instance ID explicitly, for example `mySelector(state, apiRef.current.instanceId)`.']);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const cacheArgsInit = cache.get(cacheKey);
|
|
201
|
+
const cacheArgs = cacheArgsInit ?? new Map();
|
|
202
|
+
const cacheFn = cacheArgs?.get(args);
|
|
203
|
+
if (cacheArgs && cacheFn) {
|
|
204
|
+
// We pass the cache key because the called selector might have as
|
|
205
|
+
// dependency another selector created with this `createSelector`.
|
|
206
|
+
return cacheFn(state, selectorArgs, cacheKey);
|
|
207
|
+
}
|
|
208
|
+
const fn = reselectCreateSelector(...args);
|
|
209
|
+
if (!cacheArgsInit) {
|
|
210
|
+
cache.set(cacheKey, cacheArgs);
|
|
211
|
+
}
|
|
212
|
+
cacheArgs.set(args, fn);
|
|
213
|
+
return fn(state, selectorArgs, cacheKey);
|
|
214
|
+
};
|
|
215
|
+
|
|
100
216
|
// We use this property to detect if the selector was created with createSelector
|
|
101
217
|
// or it's only a simple function the receives the state and returns part of it.
|
|
102
218
|
selector.acceptsApiRef = true;
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated there is no meaninfuly logic abstracted, use event.key directly.
|
|
3
|
-
*/
|
|
4
|
-
export const isEscapeKey = key => key === 'Escape';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated there is no meaninfuly logic abstracted, use event.key directly.
|
|
8
|
-
*/
|
|
9
|
-
export const isTabKey = key => key === 'Tab';
|
|
10
|
-
|
|
11
1
|
// Non printable keys have a name, for example "ArrowRight", see the whole list:
|
|
12
2
|
// https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
|
|
13
3
|
// So event.key.length === 1 is often enough.
|
|
@@ -27,7 +17,7 @@ export const isCellExitEditModeKeys = key => GRID_CELL_EXIT_EDIT_MODE_KEYS.index
|
|
|
27
17
|
export const isCellEditCommitKeys = key => GRID_CELL_EDIT_COMMIT_KEYS.indexOf(key) > -1;
|
|
28
18
|
export const isNavigationKey = key => key.indexOf('Arrow') === 0 || key.indexOf('Page') === 0 || key === ' ' || key === 'Home' || key === 'End';
|
|
29
19
|
export const isKeyboardEvent = event => !!event.key;
|
|
30
|
-
export const isHideMenuKey = key =>
|
|
20
|
+
export const isHideMenuKey = key => key === 'Tab' || key === 'Escape';
|
|
31
21
|
|
|
32
22
|
// In theory, on macOS, ctrl + v doesn't trigger a paste, so the function should return false.
|
|
33
23
|
// However, maybe it's overkill to fix, so let's be lazy.
|
|
@@ -10,6 +10,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _components = require("../components");
|
|
13
|
+
var _useGridAriaAttributes = require("../hooks/utils/useGridAriaAttributes");
|
|
14
|
+
var _useGridRowAriaAttributes = require("../hooks/features/rows/useGridRowAriaAttributes");
|
|
13
15
|
var _GridContextProvider = require("../context/GridContextProvider");
|
|
14
16
|
var _useDataGridComponent = require("./useDataGridComponent");
|
|
15
17
|
var _useDataGridProps = require("./useDataGridProps");
|
|
@@ -17,6 +19,12 @@ var _propValidation = require("../internals/utils/propValidation");
|
|
|
17
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
|
+
const configuration = {
|
|
23
|
+
hooks: {
|
|
24
|
+
useGridAriaAttributes: _useGridAriaAttributes.useGridAriaAttributes,
|
|
25
|
+
useGridRowAriaAttributes: _useGridRowAriaAttributes.useGridRowAriaAttributes
|
|
26
|
+
}
|
|
27
|
+
};
|
|
20
28
|
let propValidators;
|
|
21
29
|
if (process.env.NODE_ENV !== 'production') {
|
|
22
30
|
propValidators = [..._propValidation.propValidatorsDataGrid,
|
|
@@ -31,6 +39,7 @@ const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref
|
|
|
31
39
|
}
|
|
32
40
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridContextProvider.GridContextProvider, {
|
|
33
41
|
privateApiRef: privateApiRef,
|
|
42
|
+
configuration: configuration,
|
|
34
43
|
props: props,
|
|
35
44
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.GridRoot, (0, _extends2.default)({
|
|
36
45
|
className: props.className,
|
|
@@ -329,7 +338,7 @@ DataGridRaw.propTypes = {
|
|
|
329
338
|
/**
|
|
330
339
|
* Determines if a row can be selected.
|
|
331
340
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
332
|
-
* @returns {boolean} A boolean indicating if the
|
|
341
|
+
* @returns {boolean} A boolean indicating if the row is selectable.
|
|
333
342
|
*/
|
|
334
343
|
isRowSelectable: _propTypes.default.func,
|
|
335
344
|
/**
|
|
@@ -9,7 +9,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _fastMemo = require("
|
|
12
|
+
var _fastMemo = require("@mui/x-internals/fastMemo");
|
|
13
13
|
var _useGridColumnHeaders = require("../hooks/features/columnHeaders/useGridColumnHeaders");
|
|
14
14
|
var _GridBaseColumnHeaders = require("./columnHeaders/GridBaseColumnHeaders");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.GridConfigurationContext = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _fastObjectShallowCompare = require("./fastObjectShallowCompare");
|
|
9
8
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
9
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const GridConfigurationContext = exports.GridConfigurationContext = /*#__PURE__*/React.createContext(undefined);
|
|
11
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
12
|
+
GridConfigurationContext.displayName = 'GridConfigurationContext';
|
|
13
13
|
}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.GridHeaders = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _fastMemo = require("
|
|
10
|
+
var _fastMemo = require("@mui/x-internals/fastMemo");
|
|
11
11
|
var _useGridPrivateApiContext = require("../hooks/utils/useGridPrivateApiContext");
|
|
12
12
|
var _useGridSelector = require("../hooks/utils/useGridSelector");
|
|
13
13
|
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|