@mui/x-data-grid 8.5.1 → 8.5.2
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 +92 -0
- package/esm/hooks/core/useGridApiInitialization.js +1 -1
- package/esm/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +13 -5
- package/esm/hooks/features/columnResize/columnResizeSelector.d.ts +3 -1
- package/esm/hooks/features/columns/gridColumnsSelector.d.ts +41 -15
- package/esm/hooks/features/columns/gridColumnsUtils.js +3 -1
- package/esm/hooks/features/dataSource/gridDataSourceSelector.d.ts +4 -2
- package/esm/hooks/features/dataSource/useGridDataSourceBase.js +4 -0
- package/esm/hooks/features/density/densitySelector.d.ts +3 -1
- package/esm/hooks/features/dimensions/gridDimensionsSelectors.d.ts +36 -12
- package/esm/hooks/features/editing/gridEditingSelectors.d.ts +8 -4
- package/esm/hooks/features/filter/gridFilterSelector.d.ts +51 -17
- package/esm/hooks/features/filter/gridFilterState.d.ts +2 -1
- package/esm/hooks/features/filter/gridFilterState.js +2 -1
- package/esm/hooks/features/filter/useGridFilter.js +1 -1
- package/esm/hooks/features/focus/gridFocusStateSelector.d.ts +24 -8
- package/esm/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +9 -3
- package/esm/hooks/features/pagination/gridPaginationSelector.d.ts +35 -19
- package/esm/hooks/features/pivoting/gridPivotingSelectors.d.ts +9 -4
- package/esm/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +3 -1
- package/esm/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +9 -3
- package/esm/hooks/features/rowSelection/utils.d.ts +5 -3
- package/esm/hooks/features/rows/gridRowSpanningSelectors.d.ts +9 -3
- package/esm/hooks/features/rows/gridRowsSelector.d.ts +50 -29
- package/esm/hooks/features/sorting/gridSortingSelector.d.ts +15 -5
- package/esm/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +4 -2
- package/esm/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +15 -5
- package/esm/hooks/features/virtualization/gridVirtualizationSelectors.js +3 -1
- package/esm/hooks/utils/useGridSelector.d.ts +2 -4
- package/esm/hooks/utils/useGridSelector.js +2 -2
- package/esm/index.js +1 -1
- package/esm/material/variables.js +1 -2
- package/esm/models/api/gridCoreApi.d.ts +1 -1
- package/esm/models/gridCellClass.d.ts +2 -0
- package/esm/models/gridColumnGrouping.d.ts +2 -0
- package/esm/models/gridColumnGrouping.js +2 -0
- package/esm/models/gridColumnHeaderClass.d.ts +2 -0
- package/esm/models/gridRows.d.ts +2 -0
- package/esm/models/gridSortModel.d.ts +5 -0
- package/esm/models/params/gridRowParams.d.ts +1 -1
- package/esm/models/params/gridRowParams.js +1 -1
- package/esm/utils/createSelector.d.ts +3 -11
- package/esm/utils/createSelector.js +16 -86
- package/hooks/core/useGridApiInitialization.js +2 -2
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +13 -5
- package/hooks/features/columnResize/columnResizeSelector.d.ts +3 -1
- package/hooks/features/columns/gridColumnsSelector.d.ts +41 -15
- package/hooks/features/columns/gridColumnsUtils.js +3 -1
- package/hooks/features/dataSource/gridDataSourceSelector.d.ts +4 -2
- package/hooks/features/dataSource/useGridDataSourceBase.js +4 -0
- package/hooks/features/density/densitySelector.d.ts +3 -1
- package/hooks/features/dimensions/gridDimensionsSelectors.d.ts +36 -12
- package/hooks/features/editing/gridEditingSelectors.d.ts +8 -4
- package/hooks/features/filter/gridFilterSelector.d.ts +51 -17
- package/hooks/features/filter/gridFilterState.d.ts +2 -1
- package/hooks/features/filter/gridFilterState.js +2 -1
- package/hooks/features/filter/useGridFilter.js +2 -2
- package/hooks/features/focus/gridFocusStateSelector.d.ts +24 -8
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +9 -3
- package/hooks/features/pagination/gridPaginationSelector.d.ts +35 -19
- package/hooks/features/pivoting/gridPivotingSelectors.d.ts +9 -4
- package/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +3 -1
- package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +9 -3
- package/hooks/features/rowSelection/utils.d.ts +5 -3
- package/hooks/features/rows/gridRowSpanningSelectors.d.ts +9 -3
- package/hooks/features/rows/gridRowsSelector.d.ts +50 -29
- package/hooks/features/sorting/gridSortingSelector.d.ts +15 -5
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +4 -2
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +15 -5
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +3 -1
- package/hooks/utils/useGridSelector.d.ts +2 -4
- package/hooks/utils/useGridSelector.js +4 -4
- package/index.js +1 -1
- package/material/variables.js +1 -2
- package/models/api/gridCoreApi.d.ts +1 -1
- package/models/gridCellClass.d.ts +2 -0
- package/models/gridColumnGrouping.d.ts +2 -0
- package/models/gridColumnGrouping.js +2 -0
- package/models/gridColumnHeaderClass.d.ts +2 -0
- package/models/gridRows.d.ts +2 -0
- package/models/gridSortModel.d.ts +5 -0
- package/models/params/gridRowParams.d.ts +1 -1
- package/models/params/gridRowParams.js +1 -1
- package/package.json +3 -4
- package/utils/createSelector.d.ts +3 -11
- package/utils/createSelector.js +18 -88
- package/esm/utils/Store.d.ts +0 -11
- package/esm/utils/Store.js +0 -24
- package/esm/utils/weakMapMemoize.d.ts +0 -20
- package/esm/utils/weakMapMemoize.js +0 -128
- package/utils/Store.d.ts +0 -11
- package/utils/Store.js +0 -31
- package/utils/weakMapMemoize.d.ts +0 -20
- package/utils/weakMapMemoize.js +0 -134
|
@@ -1,61 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
argsMemoize: customWeakMapMemoize
|
|
11
|
-
});
|
|
12
|
-
const cache = new WeakMap();
|
|
13
|
-
export const createSelector = (a, b, c, d, e, f, ...other) => {
|
|
14
|
-
if (other.length > 0) {
|
|
15
|
-
throw new Error('Unsupported number of selectors');
|
|
16
|
-
}
|
|
17
|
-
let selector;
|
|
18
|
-
|
|
19
|
-
// eslint-disable-next-line id-denylist
|
|
20
|
-
if (a && b && c && d && e && f) {
|
|
21
|
-
selector = (apiRef, args) => {
|
|
22
|
-
const va = a(apiRef, args);
|
|
23
|
-
const vb = b(apiRef, args);
|
|
24
|
-
const vc = c(apiRef, args);
|
|
25
|
-
const vd = d(apiRef, args);
|
|
26
|
-
const ve = e(apiRef, args);
|
|
27
|
-
return f(va, vb, vc, vd, ve, args);
|
|
28
|
-
};
|
|
29
|
-
// eslint-disable-next-line id-denylist
|
|
30
|
-
} else if (a && b && c && d && e) {
|
|
31
|
-
selector = (apiRef, args) => {
|
|
32
|
-
const va = a(apiRef, args);
|
|
33
|
-
const vb = b(apiRef, args);
|
|
34
|
-
const vc = c(apiRef, args);
|
|
35
|
-
const vd = d(apiRef, args);
|
|
36
|
-
return e(va, vb, vc, vd, args);
|
|
37
|
-
};
|
|
38
|
-
} else if (a && b && c && d) {
|
|
39
|
-
selector = (apiRef, args) => {
|
|
40
|
-
const va = a(apiRef, args);
|
|
41
|
-
const vb = b(apiRef, args);
|
|
42
|
-
const vc = c(apiRef, args);
|
|
43
|
-
return d(va, vb, vc, args);
|
|
44
|
-
};
|
|
45
|
-
} else if (a && b && c) {
|
|
46
|
-
selector = (apiRef, args) => {
|
|
47
|
-
const va = a(apiRef, args);
|
|
48
|
-
const vb = b(apiRef, args);
|
|
49
|
-
return c(va, vb, args);
|
|
50
|
-
};
|
|
51
|
-
} else if (a && b) {
|
|
52
|
-
selector = (apiRef, args) => {
|
|
53
|
-
const va = a(apiRef, args);
|
|
54
|
-
return b(va, args);
|
|
55
|
-
};
|
|
56
|
-
} else {
|
|
57
|
-
throw new Error('Missing arguments');
|
|
58
|
-
}
|
|
1
|
+
import { createSelector as baseCreateSelector, createSelectorMemoized as baseCreateSelectorMemoized } from '@mui/x-internals/store';
|
|
2
|
+
export const createSelector = (...args) => {
|
|
3
|
+
const baseSelector = baseCreateSelector(...args);
|
|
4
|
+
const selector = (apiRef, a1, a2, a3) => baseSelector(unwrapIfNeeded(apiRef), a1, a2, a3);
|
|
5
|
+
return selector;
|
|
6
|
+
};
|
|
7
|
+
export const createSelectorMemoized = (...args) => {
|
|
8
|
+
const baseSelector = baseCreateSelectorMemoized(...args);
|
|
9
|
+
const selector = (apiRef, a1, a2, a3) => baseSelector(unwrapIfNeeded(apiRef), a1, a2, a3);
|
|
59
10
|
return selector;
|
|
60
11
|
};
|
|
61
12
|
|
|
@@ -64,31 +15,10 @@ export const createSelector = (a, b, c, d, e, f, ...other) => {
|
|
|
64
15
|
* and strips from the types the possibility of `apiRef` being `null`.
|
|
65
16
|
* Users are warned about this in our documentation https://mui.com/x/react-data-grid/state/#direct-selector-access
|
|
66
17
|
*/
|
|
67
|
-
export const createRootSelector = fn => (apiRef, args) => fn(apiRef
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (cacheArgs && cacheFn) {
|
|
75
|
-
if (!argsEqual(cacheFn.selectorArgs, selectorArgs)) {
|
|
76
|
-
const reselectArgs = selectorArgs !== undefined ? [...args.slice(0, args.length - 1), () => selectorArgs, args[args.length - 1]] : args;
|
|
77
|
-
const fn = reselectCreateSelector(...reselectArgs);
|
|
78
|
-
fn.selectorArgs = selectorArgs;
|
|
79
|
-
cacheArgs.set(args, fn);
|
|
80
|
-
return fn(apiRef, selectorArgs);
|
|
81
|
-
}
|
|
82
|
-
return cacheFn(apiRef, selectorArgs);
|
|
83
|
-
}
|
|
84
|
-
const reselectArgs = selectorArgs !== undefined ? [...args.slice(0, args.length - 1), () => selectorArgs, args[args.length - 1]] : args;
|
|
85
|
-
const fn = reselectCreateSelector(...reselectArgs);
|
|
86
|
-
fn.selectorArgs = selectorArgs;
|
|
87
|
-
if (!cacheArgsInit) {
|
|
88
|
-
cache.set(cacheKey, cacheArgs);
|
|
89
|
-
}
|
|
90
|
-
cacheArgs.set(args, fn);
|
|
91
|
-
return fn(apiRef, selectorArgs);
|
|
92
|
-
};
|
|
93
|
-
return selector;
|
|
94
|
-
};
|
|
18
|
+
export const createRootSelector = fn => (apiRef, args) => fn(unwrapIfNeeded(apiRef), args);
|
|
19
|
+
function unwrapIfNeeded(refOrState) {
|
|
20
|
+
if ('current' in refOrState) {
|
|
21
|
+
return refOrState.current.state;
|
|
22
|
+
}
|
|
23
|
+
return refOrState;
|
|
24
|
+
}
|
|
@@ -8,7 +8,7 @@ exports.unwrapPrivateAPI = unwrapPrivateAPI;
|
|
|
8
8
|
exports.useGridApiInitialization = useGridApiInitialization;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _EventManager = require("@mui/x-internals/EventManager");
|
|
11
|
-
var
|
|
11
|
+
var _store = require("@mui/x-internals/store");
|
|
12
12
|
var _useGridApiMethod = require("../utils/useGridApiMethod");
|
|
13
13
|
var _signature = require("../../constants/signature");
|
|
14
14
|
const SYMBOL_API_PRIVATE = Symbol('mui.api_private');
|
|
@@ -27,7 +27,7 @@ function createPrivateAPI(publicApiRef) {
|
|
|
27
27
|
const state = {};
|
|
28
28
|
const privateApi = {
|
|
29
29
|
state,
|
|
30
|
-
store:
|
|
30
|
+
store: _store.Store.create(state),
|
|
31
31
|
instanceId: {
|
|
32
32
|
id: globalId
|
|
33
33
|
}
|
|
@@ -4,9 +4,17 @@ import { GridStateCommunity } from "../../../models/gridStateCommunity.js";
|
|
|
4
4
|
* @ignore - do not document.
|
|
5
5
|
*/
|
|
6
6
|
export declare const gridColumnGroupingSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, unknown, import("@mui/x-data-grid").GridColumnsGroupingState>;
|
|
7
|
-
export declare const gridColumnGroupsUnwrappedModelSelector:
|
|
7
|
+
export declare const gridColumnGroupsUnwrappedModelSelector: (args_0: import("react").RefObject<{
|
|
8
|
+
state: GridStateCommunity;
|
|
9
|
+
} | null>) => {
|
|
8
10
|
[columnField: string]: string[];
|
|
9
|
-
}
|
|
10
|
-
export declare const gridColumnGroupsLookupSelector:
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
};
|
|
12
|
+
export declare const gridColumnGroupsLookupSelector: (args_0: import("react").RefObject<{
|
|
13
|
+
state: GridStateCommunity;
|
|
14
|
+
} | null>) => import("./gridColumnGroupsInterfaces.js").GridColumnGroupLookup;
|
|
15
|
+
export declare const gridColumnGroupsHeaderStructureSelector: (args_0: import("react").RefObject<{
|
|
16
|
+
state: GridStateCommunity;
|
|
17
|
+
} | null>) => import("./gridColumnGroupsInterfaces.js").GridGroupingStructure[][];
|
|
18
|
+
export declare const gridColumnGroupsHeaderMaxDepthSelector: (args_0: import("react").RefObject<{
|
|
19
|
+
state: GridStateCommunity;
|
|
20
|
+
} | null>) => number;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { GridStateCommunity } from "../../../models/gridStateCommunity.js";
|
|
2
2
|
export declare const gridColumnResizeSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, unknown, import("@mui/x-data-grid").GridColumnResizeState>;
|
|
3
|
-
export declare const gridResizingColumnFieldSelector:
|
|
3
|
+
export declare const gridResizingColumnFieldSelector: (args_0: import("react").RefObject<{
|
|
4
|
+
state: GridStateCommunity;
|
|
5
|
+
} | null>) => string;
|
|
@@ -9,40 +9,54 @@ export declare const gridColumnsStateSelector: import("@mui/x-data-grid").Output
|
|
|
9
9
|
* Get an array of column fields in the order rendered on screen.
|
|
10
10
|
* @category Columns
|
|
11
11
|
*/
|
|
12
|
-
export declare const gridColumnFieldsSelector:
|
|
12
|
+
export declare const gridColumnFieldsSelector: (args_0: import("react").RefObject<{
|
|
13
|
+
state: GridStateCommunity;
|
|
14
|
+
} | null>) => string[];
|
|
13
15
|
/**
|
|
14
16
|
* Get the columns as a lookup (an object containing the field for keys and the definition for values).
|
|
15
17
|
* @category Columns
|
|
16
18
|
*/
|
|
17
|
-
export declare const gridColumnLookupSelector:
|
|
19
|
+
export declare const gridColumnLookupSelector: (args_0: import("react").RefObject<{
|
|
20
|
+
state: GridStateCommunity;
|
|
21
|
+
} | null>) => GridColumnLookup;
|
|
18
22
|
/**
|
|
19
23
|
* Get an array of column definitions in the order rendered on screen..
|
|
20
24
|
* @category Columns
|
|
21
25
|
*/
|
|
22
|
-
export declare const gridColumnDefinitionsSelector:
|
|
26
|
+
export declare const gridColumnDefinitionsSelector: (args_0: import("react").RefObject<{
|
|
27
|
+
state: GridStateCommunity;
|
|
28
|
+
} | null>) => import("../../../internals/index.js").GridStateColDef[];
|
|
23
29
|
/**
|
|
24
30
|
* Get the column visibility model, containing the visibility status of each column.
|
|
25
31
|
* If a column is not registered in the model, it is visible.
|
|
26
32
|
* @category Visible Columns
|
|
27
33
|
*/
|
|
28
|
-
export declare const gridColumnVisibilityModelSelector:
|
|
34
|
+
export declare const gridColumnVisibilityModelSelector: (args_0: import("react").RefObject<{
|
|
35
|
+
state: GridStateCommunity;
|
|
36
|
+
} | null>) => import("@mui/x-data-grid").GridColumnVisibilityModel;
|
|
29
37
|
/**
|
|
30
38
|
* Get the "initial" column visibility model, containing the visibility status of each column.
|
|
31
39
|
* It is updated when the `columns` prop is updated or when `updateColumns` API method is called.
|
|
32
40
|
* If a column is not registered in the model, it is visible.
|
|
33
41
|
* @category Visible Columns
|
|
34
42
|
*/
|
|
35
|
-
export declare const gridInitialColumnVisibilityModelSelector:
|
|
43
|
+
export declare const gridInitialColumnVisibilityModelSelector: (args_0: import("react").RefObject<{
|
|
44
|
+
state: GridStateCommunity;
|
|
45
|
+
} | null>) => import("@mui/x-data-grid").GridColumnVisibilityModel;
|
|
36
46
|
/**
|
|
37
47
|
* Get the visible columns as a lookup (an object containing the field for keys and the definition for values).
|
|
38
48
|
* @category Visible Columns
|
|
39
49
|
*/
|
|
40
|
-
export declare const gridVisibleColumnDefinitionsSelector:
|
|
50
|
+
export declare const gridVisibleColumnDefinitionsSelector: (args_0: import("react").RefObject<{
|
|
51
|
+
state: GridStateCommunity;
|
|
52
|
+
} | null>) => import("../../../internals/index.js").GridStateColDef[];
|
|
41
53
|
/**
|
|
42
54
|
* Get the field of each visible column.
|
|
43
55
|
* @category Visible Columns
|
|
44
56
|
*/
|
|
45
|
-
export declare const gridVisibleColumnFieldsSelector:
|
|
57
|
+
export declare const gridVisibleColumnFieldsSelector: (args_0: import("react").RefObject<{
|
|
58
|
+
state: GridStateCommunity;
|
|
59
|
+
} | null>) => string[];
|
|
46
60
|
/**
|
|
47
61
|
* Get the visible pinned columns model.
|
|
48
62
|
* @category Visible Columns
|
|
@@ -53,36 +67,48 @@ export declare const gridPinnedColumnsSelector: import("@mui/x-data-grid").Outpu
|
|
|
53
67
|
* @category Pinned Columns
|
|
54
68
|
* @ignore - Do not document
|
|
55
69
|
*/
|
|
56
|
-
export declare const gridExistingPinnedColumnSelector: import("
|
|
70
|
+
export declare const gridExistingPinnedColumnSelector: (args_0: import("react").RefObject<{
|
|
71
|
+
state: GridStateCommunity;
|
|
72
|
+
} | null>) => {
|
|
57
73
|
left: string[];
|
|
58
74
|
right: string[];
|
|
59
|
-
}
|
|
75
|
+
};
|
|
60
76
|
/**
|
|
61
77
|
* Get the visible pinned columns.
|
|
62
78
|
* @category Visible Columns
|
|
63
79
|
*/
|
|
64
|
-
export declare const gridVisiblePinnedColumnDefinitionsSelector: import("
|
|
80
|
+
export declare const gridVisiblePinnedColumnDefinitionsSelector: (args_0: import("react").RefObject<{
|
|
81
|
+
state: GridStateCommunity;
|
|
82
|
+
} | null>) => {
|
|
65
83
|
left: import("../../../internals/index.js").GridStateColDef[];
|
|
66
84
|
right: import("../../../internals/index.js").GridStateColDef[];
|
|
67
|
-
}
|
|
85
|
+
};
|
|
68
86
|
/**
|
|
69
87
|
* Get the left position in pixel of each visible columns relative to the left of the first column.
|
|
70
88
|
* @category Visible Columns
|
|
71
89
|
*/
|
|
72
|
-
export declare const gridColumnPositionsSelector:
|
|
90
|
+
export declare const gridColumnPositionsSelector: (args_0: import("react").RefObject<{
|
|
91
|
+
state: GridStateCommunity;
|
|
92
|
+
} | null>) => number[];
|
|
73
93
|
/**
|
|
74
94
|
* Get the filterable columns as an array.
|
|
75
95
|
* @category Columns
|
|
76
96
|
*/
|
|
77
|
-
export declare const gridFilterableColumnDefinitionsSelector:
|
|
97
|
+
export declare const gridFilterableColumnDefinitionsSelector: (args_0: import("react").RefObject<{
|
|
98
|
+
state: GridStateCommunity;
|
|
99
|
+
} | null>) => import("../../../internals/index.js").GridStateColDef[];
|
|
78
100
|
/**
|
|
79
101
|
* Get the filterable columns as a lookup (an object containing the field for keys and the definition for values).
|
|
80
102
|
* @category Columns
|
|
81
103
|
*/
|
|
82
|
-
export declare const gridFilterableColumnLookupSelector:
|
|
104
|
+
export declare const gridFilterableColumnLookupSelector: (args_0: import("react").RefObject<{
|
|
105
|
+
state: GridStateCommunity;
|
|
106
|
+
} | null>) => GridColumnLookup;
|
|
83
107
|
/**
|
|
84
108
|
* Checks if some column has a colSpan field.
|
|
85
109
|
* @category Columns
|
|
86
110
|
* @ignore - Do not document
|
|
87
111
|
*/
|
|
88
|
-
export declare const gridHasColSpanSelector:
|
|
112
|
+
export declare const gridHasColSpanSelector: (args_0: import("react").RefObject<{
|
|
113
|
+
state: GridStateCommunity;
|
|
114
|
+
} | null>) => boolean;
|
|
@@ -166,7 +166,9 @@ const hydrateColumnsWidth = (rawState, dimensions) => {
|
|
|
166
166
|
flexColumns
|
|
167
167
|
});
|
|
168
168
|
Object.keys(computedColumnWidths).forEach(field => {
|
|
169
|
-
columnsLookup[field]
|
|
169
|
+
columnsLookup[field] = (0, _extends2.default)({}, columnsLookup[field], {
|
|
170
|
+
computedWidth: computedColumnWidths[field].computedWidth
|
|
171
|
+
});
|
|
170
172
|
});
|
|
171
173
|
}
|
|
172
174
|
return (0, _extends2.default)({}, rawState, {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export declare const gridGetRowsParamsSelector:
|
|
1
|
+
export declare const gridGetRowsParamsSelector: (args_0: import("react").RefObject<{
|
|
2
|
+
state: import("../../../models/gridStateCommunity.js").GridStateCommunity;
|
|
3
|
+
} | null>) => {
|
|
2
4
|
groupKeys: never[];
|
|
3
5
|
paginationModel: import("@mui/x-data-grid").GridPaginationModel;
|
|
4
6
|
sortModel: import("@mui/x-data-grid").GridSortModel;
|
|
5
7
|
filterModel: import("@mui/x-data-grid").GridFilterModel;
|
|
6
8
|
start: number;
|
|
7
9
|
end: number;
|
|
8
|
-
}
|
|
10
|
+
};
|
|
@@ -181,6 +181,10 @@ const useGridDataSourceBase = (apiRef, props, options = {}) => {
|
|
|
181
181
|
apiRef.current.dataSource.cache.clear();
|
|
182
182
|
apiRef.current.dataSource.fetchRows();
|
|
183
183
|
}
|
|
184
|
+
return () => {
|
|
185
|
+
// ignore the current request on unmount
|
|
186
|
+
lastRequestId.current += 1;
|
|
187
|
+
};
|
|
184
188
|
}, [apiRef, props.dataSource]);
|
|
185
189
|
return {
|
|
186
190
|
api: {
|
|
@@ -3,4 +3,6 @@ import { GridDensity } from "../../../models/gridDensity.js";
|
|
|
3
3
|
export declare const COMPACT_DENSITY_FACTOR = 0.7;
|
|
4
4
|
export declare const COMFORTABLE_DENSITY_FACTOR = 1.3;
|
|
5
5
|
export declare const gridDensitySelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, unknown, GridDensity>;
|
|
6
|
-
export declare const gridDensityFactorSelector: import("
|
|
6
|
+
export declare const gridDensityFactorSelector: (args_0: import("react").RefObject<{
|
|
7
|
+
state: GridStateCommunity;
|
|
8
|
+
} | null>) => number;
|
|
@@ -4,15 +4,39 @@ export declare const gridDimensionsSelector: import("@mui/x-data-grid").OutputSe
|
|
|
4
4
|
* Get the summed width of all the visible columns.
|
|
5
5
|
* @category Visible Columns
|
|
6
6
|
*/
|
|
7
|
-
export declare const gridColumnsTotalWidthSelector:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export declare const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export declare const
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
export declare const gridColumnsTotalWidthSelector: (args_0: import("react").RefObject<{
|
|
8
|
+
state: GridStateCommunity;
|
|
9
|
+
} | null>) => number;
|
|
10
|
+
export declare const gridRowHeightSelector: (args_0: import("react").RefObject<{
|
|
11
|
+
state: GridStateCommunity;
|
|
12
|
+
} | null>) => number;
|
|
13
|
+
export declare const gridContentHeightSelector: (args_0: import("react").RefObject<{
|
|
14
|
+
state: GridStateCommunity;
|
|
15
|
+
} | null>) => number;
|
|
16
|
+
export declare const gridHasScrollXSelector: (args_0: import("react").RefObject<{
|
|
17
|
+
state: GridStateCommunity;
|
|
18
|
+
} | null>) => boolean;
|
|
19
|
+
export declare const gridHasScrollYSelector: (args_0: import("react").RefObject<{
|
|
20
|
+
state: GridStateCommunity;
|
|
21
|
+
} | null>) => boolean;
|
|
22
|
+
export declare const gridHasFillerSelector: (args_0: import("react").RefObject<{
|
|
23
|
+
state: GridStateCommunity;
|
|
24
|
+
} | null>) => boolean;
|
|
25
|
+
export declare const gridHeaderHeightSelector: (args_0: import("react").RefObject<{
|
|
26
|
+
state: GridStateCommunity;
|
|
27
|
+
} | null>) => number;
|
|
28
|
+
export declare const gridGroupHeaderHeightSelector: (args_0: import("react").RefObject<{
|
|
29
|
+
state: GridStateCommunity;
|
|
30
|
+
} | null>) => number;
|
|
31
|
+
export declare const gridHeaderFilterHeightSelector: (args_0: import("react").RefObject<{
|
|
32
|
+
state: GridStateCommunity;
|
|
33
|
+
} | null>) => number;
|
|
34
|
+
export declare const gridHorizontalScrollbarHeightSelector: (args_0: import("react").RefObject<{
|
|
35
|
+
state: GridStateCommunity;
|
|
36
|
+
} | null>) => number;
|
|
37
|
+
export declare const gridVerticalScrollbarWidthSelector: (args_0: import("react").RefObject<{
|
|
38
|
+
state: GridStateCommunity;
|
|
39
|
+
} | null>) => number;
|
|
40
|
+
export declare const gridHasBottomFillerSelector: (args_0: import("react").RefObject<{
|
|
41
|
+
state: GridStateCommunity;
|
|
42
|
+
} | null>) => boolean;
|
|
@@ -5,11 +5,15 @@ import { GridEditMode } from "../../../models/gridEditRowModel.js";
|
|
|
5
5
|
* Select the row editing state.
|
|
6
6
|
*/
|
|
7
7
|
export declare const gridEditRowsStateSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, unknown, import("@mui/x-data-grid").GridEditingState>;
|
|
8
|
-
export declare const gridRowIsEditingSelector: import("
|
|
8
|
+
export declare const gridRowIsEditingSelector: (args_0: import("react").RefObject<{
|
|
9
|
+
state: GridStateCommunity;
|
|
10
|
+
} | null>, args_1: {
|
|
9
11
|
rowId: GridRowId;
|
|
10
12
|
editMode: GridEditMode;
|
|
11
|
-
}
|
|
12
|
-
export declare const gridEditCellStateSelector: import("
|
|
13
|
+
}) => boolean;
|
|
14
|
+
export declare const gridEditCellStateSelector: (args_0: import("react").RefObject<{
|
|
15
|
+
state: GridStateCommunity;
|
|
16
|
+
} | null>, args_1: {
|
|
13
17
|
rowId: GridRowId;
|
|
14
18
|
field: string;
|
|
15
|
-
}
|
|
19
|
+
}) => import("@mui/x-data-grid").GridEditCellProps<any>;
|
|
@@ -5,12 +5,16 @@ import { GridFilterItem } from "../../../models/gridFilterItem.js";
|
|
|
5
5
|
* Get the current filter model.
|
|
6
6
|
* @category Filtering
|
|
7
7
|
*/
|
|
8
|
-
export declare const gridFilterModelSelector:
|
|
8
|
+
export declare const gridFilterModelSelector: (args_0: import("react").RefObject<{
|
|
9
|
+
state: GridStateCommunity;
|
|
10
|
+
} | null>) => import("@mui/x-data-grid").GridFilterModel;
|
|
9
11
|
/**
|
|
10
12
|
* Get the current quick filter values.
|
|
11
13
|
* @category Filtering
|
|
12
14
|
*/
|
|
13
|
-
export declare const gridQuickFilterValuesSelector:
|
|
15
|
+
export declare const gridQuickFilterValuesSelector: (args_0: import("react").RefObject<{
|
|
16
|
+
state: GridStateCommunity;
|
|
17
|
+
} | null>) => any[] | undefined;
|
|
14
18
|
/**
|
|
15
19
|
* @category Visible rows
|
|
16
20
|
* @ignore - do not document.
|
|
@@ -20,79 +24,107 @@ export declare const gridVisibleRowsLookupSelector: import("@mui/x-data-grid").O
|
|
|
20
24
|
* @category Filtering
|
|
21
25
|
* @ignore - do not document.
|
|
22
26
|
*/
|
|
23
|
-
export declare const gridFilteredRowsLookupSelector:
|
|
27
|
+
export declare const gridFilteredRowsLookupSelector: (args_0: import("react").RefObject<{
|
|
28
|
+
state: GridStateCommunity;
|
|
29
|
+
} | null>) => Record<GridRowId, false>;
|
|
24
30
|
/**
|
|
25
31
|
* @category Filtering
|
|
26
32
|
* @ignore - do not document.
|
|
27
33
|
*/
|
|
28
|
-
export declare const gridFilteredChildrenCountLookupSelector:
|
|
34
|
+
export declare const gridFilteredChildrenCountLookupSelector: (args_0: import("react").RefObject<{
|
|
35
|
+
state: GridStateCommunity;
|
|
36
|
+
} | null>) => Record<GridRowId, number>;
|
|
29
37
|
/**
|
|
30
38
|
* @category Filtering
|
|
31
39
|
* @ignore - do not document.
|
|
32
40
|
*/
|
|
33
|
-
export declare const gridFilteredDescendantCountLookupSelector:
|
|
41
|
+
export declare const gridFilteredDescendantCountLookupSelector: (args_0: import("react").RefObject<{
|
|
42
|
+
state: GridStateCommunity;
|
|
43
|
+
} | null>) => Record<GridRowId, number>;
|
|
34
44
|
/**
|
|
35
45
|
* Get the id and the model of the rows accessible after the filtering process.
|
|
36
46
|
* Does not contain the collapsed children.
|
|
37
47
|
* @category Filtering
|
|
38
48
|
*/
|
|
39
|
-
export declare const gridExpandedSortedRowEntriesSelector:
|
|
49
|
+
export declare const gridExpandedSortedRowEntriesSelector: (args_0: import("react").RefObject<{
|
|
50
|
+
state: GridStateCommunity;
|
|
51
|
+
} | null>) => import("@mui/x-data-grid").GridRowEntry<import("@mui/x-data-grid").GridValidRowModel>[];
|
|
40
52
|
/**
|
|
41
53
|
* Get the id of the rows accessible after the filtering process.
|
|
42
54
|
* Does not contain the collapsed children.
|
|
43
55
|
* @category Filtering
|
|
44
56
|
*/
|
|
45
|
-
export declare const gridExpandedSortedRowIdsSelector:
|
|
57
|
+
export declare const gridExpandedSortedRowIdsSelector: (args_0: import("react").RefObject<{
|
|
58
|
+
state: GridStateCommunity;
|
|
59
|
+
} | null>) => GridRowId[];
|
|
46
60
|
/**
|
|
47
61
|
* Get the id and the model of the rows accessible after the filtering process.
|
|
48
62
|
* Contains the collapsed children.
|
|
49
63
|
* @category Filtering
|
|
50
64
|
*/
|
|
51
|
-
export declare const gridFilteredSortedRowEntriesSelector:
|
|
65
|
+
export declare const gridFilteredSortedRowEntriesSelector: (args_0: import("react").RefObject<{
|
|
66
|
+
state: GridStateCommunity;
|
|
67
|
+
} | null>) => import("@mui/x-data-grid").GridRowEntry<import("@mui/x-data-grid").GridValidRowModel>[];
|
|
52
68
|
/**
|
|
53
69
|
* Get the id of the rows accessible after the filtering process.
|
|
54
70
|
* Contains the collapsed children.
|
|
55
71
|
* @category Filtering
|
|
56
72
|
*/
|
|
57
|
-
export declare const gridFilteredSortedRowIdsSelector:
|
|
73
|
+
export declare const gridFilteredSortedRowIdsSelector: (args_0: import("react").RefObject<{
|
|
74
|
+
state: GridStateCommunity;
|
|
75
|
+
} | null>) => GridRowId[];
|
|
58
76
|
/**
|
|
59
77
|
* Get the ids to position in the current tree level lookup of the rows accessible after the filtering process.
|
|
60
78
|
* Does not contain the collapsed children.
|
|
61
79
|
* @category Filtering
|
|
62
80
|
* @ignore - do not document.
|
|
63
81
|
*/
|
|
64
|
-
export declare const gridExpandedSortedRowTreeLevelPositionLookupSelector:
|
|
82
|
+
export declare const gridExpandedSortedRowTreeLevelPositionLookupSelector: (args_0: import("react").RefObject<{
|
|
83
|
+
state: GridStateCommunity;
|
|
84
|
+
} | null>) => Record<GridRowId, number>;
|
|
65
85
|
/**
|
|
66
86
|
* Get the id and the model of the top level rows accessible after the filtering process.
|
|
67
87
|
* @category Filtering
|
|
68
88
|
*/
|
|
69
|
-
export declare const gridFilteredSortedTopLevelRowEntriesSelector:
|
|
89
|
+
export declare const gridFilteredSortedTopLevelRowEntriesSelector: (args_0: import("react").RefObject<{
|
|
90
|
+
state: GridStateCommunity;
|
|
91
|
+
} | null>) => import("@mui/x-data-grid").GridRowEntry<import("@mui/x-data-grid").GridValidRowModel>[];
|
|
70
92
|
/**
|
|
71
93
|
* Get the amount of rows accessible after the filtering process.
|
|
72
94
|
* @category Filtering
|
|
73
95
|
*/
|
|
74
|
-
export declare const gridExpandedRowCountSelector:
|
|
96
|
+
export declare const gridExpandedRowCountSelector: (args_0: import("react").RefObject<{
|
|
97
|
+
state: GridStateCommunity;
|
|
98
|
+
} | null>) => number;
|
|
75
99
|
/**
|
|
76
100
|
* Get the amount of top level rows accessible after the filtering process.
|
|
77
101
|
* @category Filtering
|
|
78
102
|
*/
|
|
79
|
-
export declare const gridFilteredTopLevelRowCountSelector:
|
|
103
|
+
export declare const gridFilteredTopLevelRowCountSelector: (args_0: import("react").RefObject<{
|
|
104
|
+
state: GridStateCommunity;
|
|
105
|
+
} | null>) => number;
|
|
80
106
|
/**
|
|
81
107
|
* Get the amount of rows accessible after the filtering process.
|
|
82
108
|
* Includes top level and descendant rows.
|
|
83
109
|
* @category Filtering
|
|
84
110
|
*/
|
|
85
|
-
export declare const gridFilteredRowCountSelector:
|
|
111
|
+
export declare const gridFilteredRowCountSelector: (args_0: import("react").RefObject<{
|
|
112
|
+
state: GridStateCommunity;
|
|
113
|
+
} | null>) => number;
|
|
86
114
|
/**
|
|
87
115
|
* Get the amount of descendant rows accessible after the filtering process.
|
|
88
116
|
* @category Filtering
|
|
89
117
|
*/
|
|
90
|
-
export declare const gridFilteredDescendantRowCountSelector: import("
|
|
118
|
+
export declare const gridFilteredDescendantRowCountSelector: (args_0: import("react").RefObject<{
|
|
119
|
+
state: GridStateCommunity;
|
|
120
|
+
} | null>) => number;
|
|
91
121
|
/**
|
|
92
122
|
* @category Filtering
|
|
93
123
|
* @ignore - do not document.
|
|
94
124
|
*/
|
|
95
|
-
export declare const gridFilterActiveItemsSelector:
|
|
125
|
+
export declare const gridFilterActiveItemsSelector: (args_0: import("react").RefObject<{
|
|
126
|
+
state: GridStateCommunity;
|
|
127
|
+
} | null>) => GridFilterItem[];
|
|
96
128
|
export type GridFilterActiveItemsLookup = {
|
|
97
129
|
[field: string]: GridFilterItem[];
|
|
98
130
|
};
|
|
@@ -100,4 +132,6 @@ export type GridFilterActiveItemsLookup = {
|
|
|
100
132
|
* @category Filtering
|
|
101
133
|
* @ignore - do not document.
|
|
102
134
|
*/
|
|
103
|
-
export declare const gridFilterActiveItemsLookupSelector: import("
|
|
135
|
+
export declare const gridFilterActiveItemsLookupSelector: (args_0: import("react").RefObject<{
|
|
136
|
+
state: GridStateCommunity;
|
|
137
|
+
} | null>) => GridFilterActiveItemsLookup;
|
|
@@ -44,8 +44,9 @@ export interface GridAggregatedFilterItemApplierResult {
|
|
|
44
44
|
passingQuickFilterValues: null | GridQuickFilterValueResult;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* @param {
|
|
47
|
+
* @param {GridValidRowModel} row The model of the row we want to filter.
|
|
48
48
|
* @param {(filterItem: GridFilterItem) => boolean} shouldApplyItem An optional callback to allow the filtering engine to only apply some items.
|
|
49
|
+
* @param {GridAggregatedFilterItemApplierResult} result The previous result of the filtering engine.
|
|
49
50
|
*/
|
|
50
51
|
export type GridAggregatedFilterItemApplier = (row: GridValidRowModel, shouldApplyItem: ((field: string) => boolean) | undefined, result: GridAggregatedFilterItemApplierResult) => void;
|
|
51
52
|
export interface GridFilteringMethodParams {
|
|
@@ -18,8 +18,9 @@ const getDefaultGridFilterModel = () => ({
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {GridValidRowModel} row The model of the row we want to filter.
|
|
22
22
|
* @param {(filterItem: GridFilterItem) => boolean} shouldApplyItem An optional callback to allow the filtering engine to only apply some items.
|
|
23
|
+
* @param {GridAggregatedFilterItemApplierResult} result The previous result of the filtering engine.
|
|
23
24
|
*/
|
|
24
25
|
|
|
25
26
|
/**
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.useGridFilter = exports.filterStateInitializer = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
var
|
|
11
|
+
var _lruMemoize = require("@mui/x-internals/lruMemoize");
|
|
12
12
|
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
13
13
|
var _isDeepEqual = require("@mui/x-internals/isDeepEqual");
|
|
14
14
|
var _useLazyRef = require("../../utils/useLazyRef");
|
|
@@ -46,7 +46,7 @@ function getVisibleRowsLookupState(apiRef, state) {
|
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
function createMemoizedValues() {
|
|
49
|
-
return (0,
|
|
49
|
+
return (0, _lruMemoize.lruMemoize)(Object.values);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/**
|