@mui/x-data-grid 9.4.0 → 9.5.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 +100 -0
- package/colDef/gridColumnTypesRegistry.d.mts +8 -0
- package/colDef/gridColumnTypesRegistry.d.ts +8 -0
- package/colDef/gridColumnTypesRegistry.js +44 -0
- package/colDef/gridColumnTypesRegistry.mjs +34 -0
- package/colDef/gridDefaultColumnTypes.d.mts +1 -1
- package/colDef/gridDefaultColumnTypes.d.ts +1 -1
- package/colDef/gridDefaultColumnTypes.js +11 -23
- package/colDef/gridDefaultColumnTypes.mjs +4 -22
- package/components/cell/GridActionsCell.js +1 -1
- package/components/cell/GridActionsCell.mjs +1 -1
- package/components/cell/GridLongTextCell.js +2 -0
- package/components/cell/GridLongTextCell.mjs +2 -0
- package/components/containers/GridRootStyles.js +29 -0
- package/components/containers/GridRootStyles.mjs +29 -0
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +2 -4
- package/components/panel/filterPanel/GridFilterInputSingleSelect.mjs +2 -4
- package/components/panel/filterPanel/filterPanelUtils.d.mts +3 -2
- package/components/panel/filterPanel/filterPanelUtils.d.ts +3 -2
- package/components/panel/filterPanel/filterPanelUtils.js +4 -0
- package/components/panel/filterPanel/filterPanelUtils.mjs +3 -0
- package/constants/cssVariables.d.mts +3 -0
- package/constants/cssVariables.d.ts +3 -0
- package/constants/cssVariables.js +2 -1
- package/constants/cssVariables.mjs +2 -1
- package/constants/gridClasses.d.mts +48 -0
- package/constants/gridClasses.d.ts +48 -0
- package/constants/gridClasses.js +1 -1
- package/constants/gridClasses.mjs +1 -1
- package/hooks/core/useGridProps.js +5 -3
- package/hooks/core/useGridProps.mjs +5 -3
- package/hooks/features/columns/gridColumnsUtils.js +18 -10
- package/hooks/features/columns/gridColumnsUtils.mjs +19 -11
- package/hooks/features/columns/useGridColumns.js +11 -0
- package/hooks/features/columns/useGridColumns.mjs +11 -0
- package/hooks/features/dataSource/useGridDataSourceBase.js +2 -2
- package/hooks/features/dataSource/useGridDataSourceBase.mjs +2 -2
- package/hooks/features/editing/useGridCellEditing.js +1 -1
- package/hooks/features/editing/useGridCellEditing.mjs +1 -1
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/editing/useGridRowEditing.mjs +1 -1
- package/hooks/features/export/serializers/csvSerializer.js +3 -1
- package/hooks/features/export/serializers/csvSerializer.mjs +3 -1
- package/hooks/features/filter/gridFilterUtils.js +5 -3
- package/hooks/features/filter/gridFilterUtils.mjs +5 -3
- package/hooks/features/listView/useGridListView.js +1 -1
- package/hooks/features/listView/useGridListView.mjs +1 -1
- package/hooks/features/sorting/gridSortingUtils.js +3 -1
- package/hooks/features/sorting/gridSortingUtils.mjs +3 -1
- package/hooks/utils/useGridSelector.js +26 -23
- package/hooks/utils/useGridSelector.mjs +25 -23
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/index.d.mts +9 -4
- package/internals/index.d.ts +9 -4
- package/internals/index.js +62 -2
- package/internals/index.mjs +8 -4
- package/internals/utils/propValidation.js +3 -0
- package/internals/utils/propValidation.mjs +3 -0
- package/material/augmentation.d.mts +4 -0
- package/material/augmentation.d.ts +4 -0
- package/material/index.js +38 -24
- package/material/index.mjs +38 -24
- package/material/variables.js +2 -1
- package/material/variables.mjs +2 -1
- package/models/colDef/gridColDef.d.mts +35 -3
- package/models/colDef/gridColDef.d.ts +35 -3
- package/models/colDef/gridColType.d.mts +1 -0
- package/models/colDef/gridColType.d.ts +1 -0
- package/models/colDef/gridColumnTypesRecord.d.mts +1 -1
- package/models/colDef/gridColumnTypesRecord.d.ts +1 -1
- package/models/colDef/index.d.mts +1 -1
- package/models/colDef/index.d.ts +1 -1
- package/models/gridBaseSlots.d.mts +46 -0
- package/models/gridBaseSlots.d.ts +46 -0
- package/models/gridSlotsComponent.d.mts +5 -0
- package/models/gridSlotsComponent.d.ts +5 -0
- package/models/gridSlotsComponentsProps.d.mts +3 -1
- package/models/gridSlotsComponentsProps.d.ts +3 -1
- package/models/gridStateCommunity.d.mts +1 -1
- package/models/gridStateCommunity.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
5
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
6
|
Object.defineProperty(exports, "__esModule", {
|
|
6
7
|
value: true
|
|
@@ -8,9 +9,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
9
|
exports.objectShallowCompare = void 0;
|
|
9
10
|
exports.useGridSelector = useGridSelector;
|
|
10
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
11
13
|
var _fastObjectShallowCompare = require("@mui/x-internals/fastObjectShallowCompare");
|
|
12
14
|
var _warning = require("@mui/x-internals/warning");
|
|
13
|
-
var _shim = require("use-sync-external-store/shim");
|
|
14
15
|
var _useLazyRef = require("./useLazyRef");
|
|
15
16
|
const defaultCompare = Object.is;
|
|
16
17
|
const objectShallowCompare = exports.objectShallowCompare = _fastObjectShallowCompare.fastObjectShallowCompare;
|
|
@@ -33,12 +34,12 @@ const createRefs = () => ({
|
|
|
33
34
|
state: null,
|
|
34
35
|
equals: null,
|
|
35
36
|
selector: null,
|
|
36
|
-
args: undefined
|
|
37
|
+
args: undefined,
|
|
38
|
+
storeState: null
|
|
37
39
|
});
|
|
38
40
|
const EMPTY = [];
|
|
39
|
-
const emptyGetSnapshot = () => null;
|
|
40
41
|
function useGridSelector(apiRef, selector, args = undefined, equals = defaultCompare) {
|
|
41
|
-
if (!apiRef.current.state) {
|
|
42
|
+
if (process.env.NODE_ENV !== 'production' && !apiRef.current.state) {
|
|
42
43
|
(0, _warning.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.']);
|
|
43
44
|
}
|
|
44
45
|
const refs = (0, _useLazyRef.useLazyRef)(createRefs);
|
|
@@ -47,6 +48,9 @@ function useGridSelector(apiRef, selector, args = undefined, equals = defaultCom
|
|
|
47
48
|
// We don't use an initialization function to avoid allocations
|
|
48
49
|
didInit ? null : selector(apiRef, args));
|
|
49
50
|
refs.current.state = state;
|
|
51
|
+
if (!didInit) {
|
|
52
|
+
refs.current.storeState = apiRef.current.store.state;
|
|
53
|
+
}
|
|
50
54
|
refs.current.equals = equals;
|
|
51
55
|
refs.current.selector = selector;
|
|
52
56
|
const prevArgs = refs.current.args;
|
|
@@ -57,35 +61,34 @@ function useGridSelector(apiRef, selector, args = undefined, equals = defaultCom
|
|
|
57
61
|
refs.current.state = newState;
|
|
58
62
|
setState(newState);
|
|
59
63
|
}
|
|
64
|
+
refs.current.storeState = apiRef.current.store.state;
|
|
60
65
|
}
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
refs.current.subscription = apiRef.current.store.subscribe(() => {
|
|
66
|
+
const updateState = React.useCallback(() => {
|
|
67
|
+
const storeState = apiRef.current.store.state;
|
|
68
|
+
if (refs.current.storeState !== storeState) {
|
|
66
69
|
const newState = refs.current.selector(apiRef, refs.current.args);
|
|
70
|
+
refs.current.storeState = storeState;
|
|
67
71
|
if (!refs.current.equals(refs.current.state, newState)) {
|
|
68
72
|
refs.current.state = newState;
|
|
69
73
|
setState(newState);
|
|
70
74
|
}
|
|
71
|
-
}
|
|
72
|
-
return null;
|
|
75
|
+
}
|
|
73
76
|
},
|
|
74
77
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
75
78
|
EMPTY);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
|
|
80
|
+
// Why subscribe in an effect instead of during render: a component can render without
|
|
81
|
+
// ever mounting (e.g. when it suspends during hydration). If it subscribed during render,
|
|
82
|
+
// it could receive a store update and call `setState` before being mounted (#17077).
|
|
83
|
+
// Effects only run for mounted components, so subscribing here is safe.
|
|
84
|
+
//
|
|
85
|
+
// Using a layout effect because the store may already have changed
|
|
86
|
+
// between render and mount (e.g. from a child's ref callback or layout effect).
|
|
87
|
+
// `updateState()` picks up such changes, so the corrected value is shown right away instead of in a second frame.
|
|
88
|
+
(0, _useEnhancedEffect.default)(() => {
|
|
89
|
+
updateState();
|
|
90
|
+
return apiRef.current.store.subscribe(updateState);
|
|
87
91
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
88
92
|
}, EMPTY);
|
|
89
|
-
(0, _shim.useSyncExternalStore)(unsubscribe, subscribe, emptyGetSnapshot);
|
|
90
93
|
return state;
|
|
91
94
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
4
5
|
import { fastObjectShallowCompare } from '@mui/x-internals/fastObjectShallowCompare';
|
|
5
6
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
6
|
-
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
7
7
|
import { useLazyRef } from "./useLazyRef.mjs";
|
|
8
8
|
const defaultCompare = Object.is;
|
|
9
9
|
export const objectShallowCompare = fastObjectShallowCompare;
|
|
@@ -26,12 +26,12 @@ const createRefs = () => ({
|
|
|
26
26
|
state: null,
|
|
27
27
|
equals: null,
|
|
28
28
|
selector: null,
|
|
29
|
-
args: undefined
|
|
29
|
+
args: undefined,
|
|
30
|
+
storeState: null
|
|
30
31
|
});
|
|
31
32
|
const EMPTY = [];
|
|
32
|
-
const emptyGetSnapshot = () => null;
|
|
33
33
|
export function useGridSelector(apiRef, selector, args = undefined, equals = defaultCompare) {
|
|
34
|
-
if (!apiRef.current.state) {
|
|
34
|
+
if (process.env.NODE_ENV !== 'production' && !apiRef.current.state) {
|
|
35
35
|
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.']);
|
|
36
36
|
}
|
|
37
37
|
const refs = useLazyRef(createRefs);
|
|
@@ -40,6 +40,9 @@ export function useGridSelector(apiRef, selector, args = undefined, equals = def
|
|
|
40
40
|
// We don't use an initialization function to avoid allocations
|
|
41
41
|
didInit ? null : selector(apiRef, args));
|
|
42
42
|
refs.current.state = state;
|
|
43
|
+
if (!didInit) {
|
|
44
|
+
refs.current.storeState = apiRef.current.store.state;
|
|
45
|
+
}
|
|
43
46
|
refs.current.equals = equals;
|
|
44
47
|
refs.current.selector = selector;
|
|
45
48
|
const prevArgs = refs.current.args;
|
|
@@ -50,35 +53,34 @@ export function useGridSelector(apiRef, selector, args = undefined, equals = def
|
|
|
50
53
|
refs.current.state = newState;
|
|
51
54
|
setState(newState);
|
|
52
55
|
}
|
|
56
|
+
refs.current.storeState = apiRef.current.store.state;
|
|
53
57
|
}
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
refs.current.subscription = apiRef.current.store.subscribe(() => {
|
|
58
|
+
const updateState = React.useCallback(() => {
|
|
59
|
+
const storeState = apiRef.current.store.state;
|
|
60
|
+
if (refs.current.storeState !== storeState) {
|
|
59
61
|
const newState = refs.current.selector(apiRef, refs.current.args);
|
|
62
|
+
refs.current.storeState = storeState;
|
|
60
63
|
if (!refs.current.equals(refs.current.state, newState)) {
|
|
61
64
|
refs.current.state = newState;
|
|
62
65
|
setState(newState);
|
|
63
66
|
}
|
|
64
|
-
}
|
|
65
|
-
return null;
|
|
67
|
+
}
|
|
66
68
|
},
|
|
67
69
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
68
70
|
EMPTY);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
|
|
72
|
+
// Why subscribe in an effect instead of during render: a component can render without
|
|
73
|
+
// ever mounting (e.g. when it suspends during hydration). If it subscribed during render,
|
|
74
|
+
// it could receive a store update and call `setState` before being mounted (#17077).
|
|
75
|
+
// Effects only run for mounted components, so subscribing here is safe.
|
|
76
|
+
//
|
|
77
|
+
// Using a layout effect because the store may already have changed
|
|
78
|
+
// between render and mount (e.g. from a child's ref callback or layout effect).
|
|
79
|
+
// `updateState()` picks up such changes, so the corrected value is shown right away instead of in a second frame.
|
|
80
|
+
useEnhancedEffect(() => {
|
|
81
|
+
updateState();
|
|
82
|
+
return apiRef.current.store.subscribe(updateState);
|
|
80
83
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
81
84
|
}, EMPTY);
|
|
82
|
-
useSyncExternalStore(unsubscribe, subscribe, emptyGetSnapshot);
|
|
83
85
|
return state;
|
|
84
86
|
}
|
package/index.js
CHANGED
package/index.mjs
CHANGED
package/internals/index.d.mts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export type { GridBaseColDef, GridStateColDef, GridSingleSelectColDef } from "../models/colDef/gridColDef.mjs";
|
|
2
|
+
export { GRID_STRING_COL_DEF } from "../colDef/gridStringColDef.mjs";
|
|
3
|
+
export { registerGridColumnTypes } from "../colDef/gridColumnTypesRegistry.mjs";
|
|
4
|
+
export { gridRowIdSelector } from "../hooks/core/gridPropsSelectors.mjs";
|
|
2
5
|
export { GridVirtualScroller } from "../components/virtualization/GridVirtualScroller.mjs";
|
|
3
6
|
export { GridVirtualScrollerContent } from "../components/virtualization/GridVirtualScrollerContent.mjs";
|
|
4
7
|
export { GridVirtualScrollerRenderZone } from "../components/virtualization/GridVirtualScrollerRenderZone.mjs";
|
|
@@ -16,7 +19,7 @@ export { vars } from "../constants/cssVariables.mjs";
|
|
|
16
19
|
export { useGridVirtualizer } from "../hooks/core/useGridVirtualizer.mjs";
|
|
17
20
|
export { propsStateInitializer } from "../hooks/core/useGridProps.mjs";
|
|
18
21
|
export { getGridFilter } from "../components/panel/filterPanel/GridFilterPanel.mjs";
|
|
19
|
-
export { getValueOptions } from "../components/panel/filterPanel/filterPanelUtils.mjs";
|
|
22
|
+
export { getValueOptions, getValueFromValueOptions, isMultiSelectColDef } from "../components/panel/filterPanel/filterPanelUtils.mjs";
|
|
20
23
|
export { useGridRegisterPipeProcessor } from "../hooks/core/pipeProcessing/index.mjs";
|
|
21
24
|
export type { GridPipeProcessor } from "../hooks/core/pipeProcessing/index.mjs";
|
|
22
25
|
export { GridStrategyGroup, useGridRegisterStrategyProcessor, GRID_DEFAULT_STRATEGY } from "../hooks/core/strategyProcessing/index.mjs";
|
|
@@ -42,8 +45,8 @@ export { useGridCsvExport } from "../hooks/features/export/useGridCsvExport.mjs"
|
|
|
42
45
|
export { useGridPrintExport } from "../hooks/features/export/useGridPrintExport.mjs";
|
|
43
46
|
export { useGridFilter, filterStateInitializer } from "../hooks/features/filter/useGridFilter.mjs";
|
|
44
47
|
export { defaultGridFilterLookup } from "../hooks/features/filter/gridFilterState.mjs";
|
|
45
|
-
export { passFilterLogic } from "../hooks/features/filter/gridFilterUtils.mjs";
|
|
46
|
-
export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector, gridFilteredSortedDepthRowEntriesSelector } from "../hooks/features/filter/gridFilterSelector.mjs";
|
|
48
|
+
export { passFilterLogic, removeDiacritics } from "../hooks/features/filter/gridFilterUtils.mjs";
|
|
49
|
+
export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector, gridFilteredSortedDepthRowEntriesSelector, gridFilterModelSelector } from "../hooks/features/filter/gridFilterSelector.mjs";
|
|
47
50
|
export { isSingleSelectColDef } from "../components/panel/filterPanel/filterPanelUtils.mjs";
|
|
48
51
|
export type { GridAggregatedFilterItemApplier, GridAggregatedFilterItemApplierResult } from "../hooks/features/filter/gridFilterState.mjs";
|
|
49
52
|
export { useGridFocus, focusStateInitializer } from "../hooks/features/focus/useGridFocus.mjs";
|
|
@@ -90,6 +93,7 @@ export { useGridInitializeState } from "../hooks/utils/useGridInitializeState.mj
|
|
|
90
93
|
export type { GridStateInitializer } from "../hooks/utils/useGridInitializeState.mjs";
|
|
91
94
|
export { usePinnedScrollOffset } from "../hooks/utils/usePinnedScrollOffset.mjs";
|
|
92
95
|
export type * as BaseSlots from "../models/gridBaseSlots.mjs";
|
|
96
|
+
export type { TextFieldProps, AutocompleteProps, SelectProps } from "../models/gridBaseSlots.mjs";
|
|
93
97
|
export type * from "../models/props/DataGridProps.mjs";
|
|
94
98
|
export type { GridAggregationPosition, GridAggregationCellMeta } from "../models/gridAggregation.mjs";
|
|
95
99
|
export type { GridDataSourceApiBase, GridDataSourceApi, GridDataSourceBaseOptions, GridDataSourceFetchRowsParams } from "../hooks/features/dataSource/models.mjs";
|
|
@@ -126,4 +130,5 @@ export type { CellEditableConditionFn } from "../models/configuration/gridCellEd
|
|
|
126
130
|
export * from "../hooks/features/pivoting/index.mjs";
|
|
127
131
|
export { createSvgIcon } from "../material/icons/createSvgIcon.mjs";
|
|
128
132
|
export { useGridPanelContext } from "../components/panel/GridPanelContext.mjs";
|
|
129
|
-
export type { RowReorderDropPosition, RowReorderDragDirection } from "../models/api/gridRowApi.mjs";
|
|
133
|
+
export type { RowReorderDropPosition, RowReorderDragDirection } from "../models/api/gridRowApi.mjs";
|
|
134
|
+
export { useSyncExternalStore } from 'use-sync-external-store/shim';
|
package/internals/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export type { GridBaseColDef, GridStateColDef, GridSingleSelectColDef } from "../models/colDef/gridColDef.js";
|
|
2
|
+
export { GRID_STRING_COL_DEF } from "../colDef/gridStringColDef.js";
|
|
3
|
+
export { registerGridColumnTypes } from "../colDef/gridColumnTypesRegistry.js";
|
|
4
|
+
export { gridRowIdSelector } from "../hooks/core/gridPropsSelectors.js";
|
|
2
5
|
export { GridVirtualScroller } from "../components/virtualization/GridVirtualScroller.js";
|
|
3
6
|
export { GridVirtualScrollerContent } from "../components/virtualization/GridVirtualScrollerContent.js";
|
|
4
7
|
export { GridVirtualScrollerRenderZone } from "../components/virtualization/GridVirtualScrollerRenderZone.js";
|
|
@@ -16,7 +19,7 @@ export { vars } from "../constants/cssVariables.js";
|
|
|
16
19
|
export { useGridVirtualizer } from "../hooks/core/useGridVirtualizer.js";
|
|
17
20
|
export { propsStateInitializer } from "../hooks/core/useGridProps.js";
|
|
18
21
|
export { getGridFilter } from "../components/panel/filterPanel/GridFilterPanel.js";
|
|
19
|
-
export { getValueOptions } from "../components/panel/filterPanel/filterPanelUtils.js";
|
|
22
|
+
export { getValueOptions, getValueFromValueOptions, isMultiSelectColDef } from "../components/panel/filterPanel/filterPanelUtils.js";
|
|
20
23
|
export { useGridRegisterPipeProcessor } from "../hooks/core/pipeProcessing/index.js";
|
|
21
24
|
export type { GridPipeProcessor } from "../hooks/core/pipeProcessing/index.js";
|
|
22
25
|
export { GridStrategyGroup, useGridRegisterStrategyProcessor, GRID_DEFAULT_STRATEGY } from "../hooks/core/strategyProcessing/index.js";
|
|
@@ -42,8 +45,8 @@ export { useGridCsvExport } from "../hooks/features/export/useGridCsvExport.js";
|
|
|
42
45
|
export { useGridPrintExport } from "../hooks/features/export/useGridPrintExport.js";
|
|
43
46
|
export { useGridFilter, filterStateInitializer } from "../hooks/features/filter/useGridFilter.js";
|
|
44
47
|
export { defaultGridFilterLookup } from "../hooks/features/filter/gridFilterState.js";
|
|
45
|
-
export { passFilterLogic } from "../hooks/features/filter/gridFilterUtils.js";
|
|
46
|
-
export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector, gridFilteredSortedDepthRowEntriesSelector } from "../hooks/features/filter/gridFilterSelector.js";
|
|
48
|
+
export { passFilterLogic, removeDiacritics } from "../hooks/features/filter/gridFilterUtils.js";
|
|
49
|
+
export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector, gridFilteredSortedDepthRowEntriesSelector, gridFilterModelSelector } from "../hooks/features/filter/gridFilterSelector.js";
|
|
47
50
|
export { isSingleSelectColDef } from "../components/panel/filterPanel/filterPanelUtils.js";
|
|
48
51
|
export type { GridAggregatedFilterItemApplier, GridAggregatedFilterItemApplierResult } from "../hooks/features/filter/gridFilterState.js";
|
|
49
52
|
export { useGridFocus, focusStateInitializer } from "../hooks/features/focus/useGridFocus.js";
|
|
@@ -90,6 +93,7 @@ export { useGridInitializeState } from "../hooks/utils/useGridInitializeState.js
|
|
|
90
93
|
export type { GridStateInitializer } from "../hooks/utils/useGridInitializeState.js";
|
|
91
94
|
export { usePinnedScrollOffset } from "../hooks/utils/usePinnedScrollOffset.js";
|
|
92
95
|
export type * as BaseSlots from "../models/gridBaseSlots.js";
|
|
96
|
+
export type { TextFieldProps, AutocompleteProps, SelectProps } from "../models/gridBaseSlots.js";
|
|
93
97
|
export type * from "../models/props/DataGridProps.js";
|
|
94
98
|
export type { GridAggregationPosition, GridAggregationCellMeta } from "../models/gridAggregation.js";
|
|
95
99
|
export type { GridDataSourceApiBase, GridDataSourceApi, GridDataSourceBaseOptions, GridDataSourceFetchRowsParams } from "../hooks/features/dataSource/models.js";
|
|
@@ -126,4 +130,5 @@ export type { CellEditableConditionFn } from "../models/configuration/gridCellEd
|
|
|
126
130
|
export * from "../hooks/features/pivoting/index.js";
|
|
127
131
|
export { createSvgIcon } from "../material/icons/createSvgIcon.js";
|
|
128
132
|
export { useGridPanelContext } from "../components/panel/GridPanelContext.js";
|
|
129
|
-
export type { RowReorderDropPosition, RowReorderDragDirection } from "../models/api/gridRowApi.js";
|
|
133
|
+
export type { RowReorderDropPosition, RowReorderDragDirection } from "../models/api/gridRowApi.js";
|
|
134
|
+
export { useSyncExternalStore } from 'use-sync-external-store/shim';
|
package/internals/index.js
CHANGED
|
@@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
+
GRID_STRING_COL_DEF: true,
|
|
8
|
+
registerGridColumnTypes: true,
|
|
9
|
+
gridRowIdSelector: true,
|
|
7
10
|
GridVirtualScroller: true,
|
|
8
11
|
GridVirtualScrollerContent: true,
|
|
9
12
|
GridVirtualScrollerRenderZone: true,
|
|
@@ -19,6 +22,8 @@ var _exportNames = {
|
|
|
19
22
|
propsStateInitializer: true,
|
|
20
23
|
getGridFilter: true,
|
|
21
24
|
getValueOptions: true,
|
|
25
|
+
getValueFromValueOptions: true,
|
|
26
|
+
isMultiSelectColDef: true,
|
|
22
27
|
isSingleSelectColDef: true,
|
|
23
28
|
useGridRegisterPipeProcessor: true,
|
|
24
29
|
GridStrategyGroup: true,
|
|
@@ -45,9 +50,11 @@ var _exportNames = {
|
|
|
45
50
|
filterStateInitializer: true,
|
|
46
51
|
defaultGridFilterLookup: true,
|
|
47
52
|
passFilterLogic: true,
|
|
53
|
+
removeDiacritics: true,
|
|
48
54
|
gridFilteredChildrenCountLookupSelector: true,
|
|
49
55
|
gridExpandedSortedRowTreeLevelPositionLookupSelector: true,
|
|
50
56
|
gridFilteredSortedDepthRowEntriesSelector: true,
|
|
57
|
+
gridFilterModelSelector: true,
|
|
51
58
|
useGridFocus: true,
|
|
52
59
|
focusStateInitializer: true,
|
|
53
60
|
useGridKeyboardNavigation: true,
|
|
@@ -132,7 +139,8 @@ var _exportNames = {
|
|
|
132
139
|
serializeCellValue: true,
|
|
133
140
|
GridSkeletonLoadingOverlayInner: true,
|
|
134
141
|
createSvgIcon: true,
|
|
135
|
-
useGridPanelContext: true
|
|
142
|
+
useGridPanelContext: true,
|
|
143
|
+
useSyncExternalStore: true
|
|
136
144
|
};
|
|
137
145
|
Object.defineProperty(exports, "CacheChunkManager", {
|
|
138
146
|
enumerable: true,
|
|
@@ -164,6 +172,12 @@ Object.defineProperty(exports, "GRID_ID_AUTOGENERATED", {
|
|
|
164
172
|
return _gridRowsUtils.GRID_ID_AUTOGENERATED;
|
|
165
173
|
}
|
|
166
174
|
});
|
|
175
|
+
Object.defineProperty(exports, "GRID_STRING_COL_DEF", {
|
|
176
|
+
enumerable: true,
|
|
177
|
+
get: function () {
|
|
178
|
+
return _gridStringColDef.GRID_STRING_COL_DEF;
|
|
179
|
+
}
|
|
180
|
+
});
|
|
167
181
|
Object.defineProperty(exports, "GridBaseColumnHeaders", {
|
|
168
182
|
enumerable: true,
|
|
169
183
|
get: function () {
|
|
@@ -392,6 +406,12 @@ Object.defineProperty(exports, "getTreeNodeDescendants", {
|
|
|
392
406
|
return _gridRowsUtils.getTreeNodeDescendants;
|
|
393
407
|
}
|
|
394
408
|
});
|
|
409
|
+
Object.defineProperty(exports, "getValueFromValueOptions", {
|
|
410
|
+
enumerable: true,
|
|
411
|
+
get: function () {
|
|
412
|
+
return _filterPanelUtils.getValueFromValueOptions;
|
|
413
|
+
}
|
|
414
|
+
});
|
|
395
415
|
Object.defineProperty(exports, "getValueOptions", {
|
|
396
416
|
enumerable: true,
|
|
397
417
|
get: function () {
|
|
@@ -422,6 +442,12 @@ Object.defineProperty(exports, "gridExpandedSortedRowTreeLevelPositionLookupSele
|
|
|
422
442
|
return _gridFilterSelector.gridExpandedSortedRowTreeLevelPositionLookupSelector;
|
|
423
443
|
}
|
|
424
444
|
});
|
|
445
|
+
Object.defineProperty(exports, "gridFilterModelSelector", {
|
|
446
|
+
enumerable: true,
|
|
447
|
+
get: function () {
|
|
448
|
+
return _gridFilterSelector.gridFilterModelSelector;
|
|
449
|
+
}
|
|
450
|
+
});
|
|
425
451
|
Object.defineProperty(exports, "gridFilteredChildrenCountLookupSelector", {
|
|
426
452
|
enumerable: true,
|
|
427
453
|
get: function () {
|
|
@@ -482,6 +508,12 @@ Object.defineProperty(exports, "gridRowGroupsToFetchSelector", {
|
|
|
482
508
|
return _gridRowsSelector.gridRowGroupsToFetchSelector;
|
|
483
509
|
}
|
|
484
510
|
});
|
|
511
|
+
Object.defineProperty(exports, "gridRowIdSelector", {
|
|
512
|
+
enumerable: true,
|
|
513
|
+
get: function () {
|
|
514
|
+
return _gridPropsSelectors.gridRowIdSelector;
|
|
515
|
+
}
|
|
516
|
+
});
|
|
485
517
|
Object.defineProperty(exports, "gridRowSelector", {
|
|
486
518
|
enumerable: true,
|
|
487
519
|
get: function () {
|
|
@@ -524,6 +556,12 @@ Object.defineProperty(exports, "isFillRightShortcut", {
|
|
|
524
556
|
return _keyboardUtils.isFillRightShortcut;
|
|
525
557
|
}
|
|
526
558
|
});
|
|
559
|
+
Object.defineProperty(exports, "isMultiSelectColDef", {
|
|
560
|
+
enumerable: true,
|
|
561
|
+
get: function () {
|
|
562
|
+
return _filterPanelUtils.isMultiSelectColDef;
|
|
563
|
+
}
|
|
564
|
+
});
|
|
527
565
|
Object.defineProperty(exports, "isNavigationKey", {
|
|
528
566
|
enumerable: true,
|
|
529
567
|
get: function () {
|
|
@@ -584,6 +622,18 @@ Object.defineProperty(exports, "propsStateInitializer", {
|
|
|
584
622
|
return _useGridProps.propsStateInitializer;
|
|
585
623
|
}
|
|
586
624
|
});
|
|
625
|
+
Object.defineProperty(exports, "registerGridColumnTypes", {
|
|
626
|
+
enumerable: true,
|
|
627
|
+
get: function () {
|
|
628
|
+
return _gridColumnTypesRegistry.registerGridColumnTypes;
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
Object.defineProperty(exports, "removeDiacritics", {
|
|
632
|
+
enumerable: true,
|
|
633
|
+
get: function () {
|
|
634
|
+
return _gridFilterUtils.removeDiacritics;
|
|
635
|
+
}
|
|
636
|
+
});
|
|
587
637
|
Object.defineProperty(exports, "rowSelectionStateInitializer", {
|
|
588
638
|
enumerable: true,
|
|
589
639
|
get: function () {
|
|
@@ -896,6 +946,12 @@ Object.defineProperty(exports, "usePinnedScrollOffset", {
|
|
|
896
946
|
return _usePinnedScrollOffset.usePinnedScrollOffset;
|
|
897
947
|
}
|
|
898
948
|
});
|
|
949
|
+
Object.defineProperty(exports, "useSyncExternalStore", {
|
|
950
|
+
enumerable: true,
|
|
951
|
+
get: function () {
|
|
952
|
+
return _shim.useSyncExternalStore;
|
|
953
|
+
}
|
|
954
|
+
});
|
|
899
955
|
Object.defineProperty(exports, "useTimeout", {
|
|
900
956
|
enumerable: true,
|
|
901
957
|
get: function () {
|
|
@@ -908,6 +964,9 @@ Object.defineProperty(exports, "vars", {
|
|
|
908
964
|
return _cssVariables.vars;
|
|
909
965
|
}
|
|
910
966
|
});
|
|
967
|
+
var _gridStringColDef = require("../colDef/gridStringColDef");
|
|
968
|
+
var _gridColumnTypesRegistry = require("../colDef/gridColumnTypesRegistry");
|
|
969
|
+
var _gridPropsSelectors = require("../hooks/core/gridPropsSelectors");
|
|
911
970
|
var _GridVirtualScroller = require("../components/virtualization/GridVirtualScroller");
|
|
912
971
|
var _GridVirtualScrollerContent = require("../components/virtualization/GridVirtualScrollerContent");
|
|
913
972
|
var _GridVirtualScrollerRenderZone = require("../components/virtualization/GridVirtualScrollerRenderZone");
|
|
@@ -1179,4 +1238,5 @@ Object.keys(_pivoting).forEach(function (key) {
|
|
|
1179
1238
|
});
|
|
1180
1239
|
});
|
|
1181
1240
|
var _createSvgIcon = require("../material/icons/createSvgIcon");
|
|
1182
|
-
var _GridPanelContext = require("../components/panel/GridPanelContext");
|
|
1241
|
+
var _GridPanelContext = require("../components/panel/GridPanelContext");
|
|
1242
|
+
var _shim = require("use-sync-external-store/shim");
|
package/internals/index.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { GRID_STRING_COL_DEF } from "../colDef/gridStringColDef.mjs";
|
|
2
|
+
export { registerGridColumnTypes } from "../colDef/gridColumnTypesRegistry.mjs";
|
|
3
|
+
export { gridRowIdSelector } from "../hooks/core/gridPropsSelectors.mjs";
|
|
1
4
|
export { GridVirtualScroller } from "../components/virtualization/GridVirtualScroller.mjs";
|
|
2
5
|
export { GridVirtualScrollerContent } from "../components/virtualization/GridVirtualScrollerContent.mjs";
|
|
3
6
|
export { GridVirtualScrollerRenderZone } from "../components/virtualization/GridVirtualScrollerRenderZone.mjs";
|
|
@@ -12,7 +15,7 @@ export { vars } from "../constants/cssVariables.mjs";
|
|
|
12
15
|
export { useGridVirtualizer } from "../hooks/core/useGridVirtualizer.mjs";
|
|
13
16
|
export { propsStateInitializer } from "../hooks/core/useGridProps.mjs";
|
|
14
17
|
export { getGridFilter } from "../components/panel/filterPanel/GridFilterPanel.mjs";
|
|
15
|
-
export { getValueOptions } from "../components/panel/filterPanel/filterPanelUtils.mjs";
|
|
18
|
+
export { getValueOptions, getValueFromValueOptions, isMultiSelectColDef } from "../components/panel/filterPanel/filterPanelUtils.mjs";
|
|
16
19
|
export { useGridRegisterPipeProcessor } from "../hooks/core/pipeProcessing/index.mjs";
|
|
17
20
|
export { GridStrategyGroup, useGridRegisterStrategyProcessor, GRID_DEFAULT_STRATEGY } from "../hooks/core/strategyProcessing/index.mjs";
|
|
18
21
|
export { useGridInitialization } from "../hooks/core/useGridInitialization.mjs";
|
|
@@ -31,8 +34,8 @@ export { useGridCsvExport } from "../hooks/features/export/useGridCsvExport.mjs"
|
|
|
31
34
|
export { useGridPrintExport } from "../hooks/features/export/useGridPrintExport.mjs";
|
|
32
35
|
export { useGridFilter, filterStateInitializer } from "../hooks/features/filter/useGridFilter.mjs";
|
|
33
36
|
export { defaultGridFilterLookup } from "../hooks/features/filter/gridFilterState.mjs";
|
|
34
|
-
export { passFilterLogic } from "../hooks/features/filter/gridFilterUtils.mjs";
|
|
35
|
-
export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector, gridFilteredSortedDepthRowEntriesSelector } from "../hooks/features/filter/gridFilterSelector.mjs";
|
|
37
|
+
export { passFilterLogic, removeDiacritics } from "../hooks/features/filter/gridFilterUtils.mjs";
|
|
38
|
+
export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector, gridFilteredSortedDepthRowEntriesSelector, gridFilterModelSelector } from "../hooks/features/filter/gridFilterSelector.mjs";
|
|
36
39
|
export { isSingleSelectColDef } from "../components/panel/filterPanel/filterPanelUtils.mjs";
|
|
37
40
|
export { useGridFocus, focusStateInitializer } from "../hooks/features/focus/useGridFocus.mjs";
|
|
38
41
|
export { useGridKeyboardNavigation } from "../hooks/features/keyboardNavigation/useGridKeyboardNavigation.mjs";
|
|
@@ -97,4 +100,5 @@ export * from "./demo/index.mjs";
|
|
|
97
100
|
export { GridSkeletonLoadingOverlayInner } from "../components/GridSkeletonLoadingOverlay.mjs";
|
|
98
101
|
export * from "../hooks/features/pivoting/index.mjs";
|
|
99
102
|
export { createSvgIcon } from "../material/icons/createSvgIcon.mjs";
|
|
100
|
-
export { useGridPanelContext } from "../components/panel/GridPanelContext.mjs";
|
|
103
|
+
export { useGridPanelContext } from "../components/panel/GridPanelContext.mjs";
|
|
104
|
+
export { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
@@ -10,6 +10,9 @@ var _utils = require("../../utils/utils");
|
|
|
10
10
|
var _signature = require("../../constants/signature");
|
|
11
11
|
const propValidatorsDataGrid = exports.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 === _signature.GridSignature.DataGrid && props.paginationMode === 'client' && (0, _utils.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.dataSource && !props.paginationMeta && ["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];
|
|
12
12
|
function validateProps(props, validators) {
|
|
13
|
+
if (process.env.NODE_ENV === 'production') {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
13
16
|
validators.forEach(validator => {
|
|
14
17
|
const message = validator(props);
|
|
15
18
|
if (message) {
|
|
@@ -3,6 +3,9 @@ import { isNumber } from "../../utils/utils.mjs";
|
|
|
3
3
|
import { GridSignature } from "../../constants/signature.mjs";
|
|
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.dataSource && !props.paginationMeta && ["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
|
+
if (process.env.NODE_ENV === 'production') {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
6
9
|
validators.forEach(validator => {
|
|
7
10
|
const message = validator(props);
|
|
8
11
|
if (message) {
|
|
@@ -7,6 +7,7 @@ import type { DividerProps } from '@mui/material/Divider';
|
|
|
7
7
|
import type { LinearProgressProps } from '@mui/material/LinearProgress';
|
|
8
8
|
import type { MenuListProps } from '@mui/material/MenuList';
|
|
9
9
|
import type { MenuItemProps } from '@mui/material/MenuItem';
|
|
10
|
+
import type { ModalProps } from '@mui/material/Modal';
|
|
10
11
|
import type { TextFieldProps } from '@mui/material/TextField';
|
|
11
12
|
import type { SwitchProps } from '@mui/material/Switch';
|
|
12
13
|
import type { ButtonProps } from '@mui/material/Button';
|
|
@@ -51,6 +52,9 @@ declare module '@mui/x-data-grid' {
|
|
|
51
52
|
interface BaseMenuItemPropsOverrides {
|
|
52
53
|
material?: Partial<MenuItemProps>;
|
|
53
54
|
}
|
|
55
|
+
interface BaseModalPropsOverrides {
|
|
56
|
+
material?: Partial<ModalProps>;
|
|
57
|
+
}
|
|
54
58
|
interface BaseTextFieldPropsOverrides {
|
|
55
59
|
material?: Partial<TextFieldProps>;
|
|
56
60
|
}
|
|
@@ -7,6 +7,7 @@ import type { DividerProps } from '@mui/material/Divider';
|
|
|
7
7
|
import type { LinearProgressProps } from '@mui/material/LinearProgress';
|
|
8
8
|
import type { MenuListProps } from '@mui/material/MenuList';
|
|
9
9
|
import type { MenuItemProps } from '@mui/material/MenuItem';
|
|
10
|
+
import type { ModalProps } from '@mui/material/Modal';
|
|
10
11
|
import type { TextFieldProps } from '@mui/material/TextField';
|
|
11
12
|
import type { SwitchProps } from '@mui/material/Switch';
|
|
12
13
|
import type { ButtonProps } from '@mui/material/Button';
|
|
@@ -51,6 +52,9 @@ declare module '@mui/x-data-grid' {
|
|
|
51
52
|
interface BaseMenuItemPropsOverrides {
|
|
52
53
|
material?: Partial<MenuItemProps>;
|
|
53
54
|
}
|
|
55
|
+
interface BaseModalPropsOverrides {
|
|
56
|
+
material?: Partial<ModalProps>;
|
|
57
|
+
}
|
|
54
58
|
interface BaseTextFieldPropsOverrides {
|
|
55
59
|
material?: Partial<TextFieldProps>;
|
|
56
60
|
}
|