@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.
Files changed (94) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/esm/hooks/core/useGridApiInitialization.js +1 -1
  3. package/esm/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +13 -5
  4. package/esm/hooks/features/columnResize/columnResizeSelector.d.ts +3 -1
  5. package/esm/hooks/features/columns/gridColumnsSelector.d.ts +41 -15
  6. package/esm/hooks/features/columns/gridColumnsUtils.js +3 -1
  7. package/esm/hooks/features/dataSource/gridDataSourceSelector.d.ts +4 -2
  8. package/esm/hooks/features/dataSource/useGridDataSourceBase.js +4 -0
  9. package/esm/hooks/features/density/densitySelector.d.ts +3 -1
  10. package/esm/hooks/features/dimensions/gridDimensionsSelectors.d.ts +36 -12
  11. package/esm/hooks/features/editing/gridEditingSelectors.d.ts +8 -4
  12. package/esm/hooks/features/filter/gridFilterSelector.d.ts +51 -17
  13. package/esm/hooks/features/filter/gridFilterState.d.ts +2 -1
  14. package/esm/hooks/features/filter/gridFilterState.js +2 -1
  15. package/esm/hooks/features/filter/useGridFilter.js +1 -1
  16. package/esm/hooks/features/focus/gridFocusStateSelector.d.ts +24 -8
  17. package/esm/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +9 -3
  18. package/esm/hooks/features/pagination/gridPaginationSelector.d.ts +35 -19
  19. package/esm/hooks/features/pivoting/gridPivotingSelectors.d.ts +9 -4
  20. package/esm/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +3 -1
  21. package/esm/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +9 -3
  22. package/esm/hooks/features/rowSelection/utils.d.ts +5 -3
  23. package/esm/hooks/features/rows/gridRowSpanningSelectors.d.ts +9 -3
  24. package/esm/hooks/features/rows/gridRowsSelector.d.ts +50 -29
  25. package/esm/hooks/features/sorting/gridSortingSelector.d.ts +15 -5
  26. package/esm/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +4 -2
  27. package/esm/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +15 -5
  28. package/esm/hooks/features/virtualization/gridVirtualizationSelectors.js +3 -1
  29. package/esm/hooks/utils/useGridSelector.d.ts +2 -4
  30. package/esm/hooks/utils/useGridSelector.js +2 -2
  31. package/esm/index.js +1 -1
  32. package/esm/material/variables.js +1 -2
  33. package/esm/models/api/gridCoreApi.d.ts +1 -1
  34. package/esm/models/gridCellClass.d.ts +2 -0
  35. package/esm/models/gridColumnGrouping.d.ts +2 -0
  36. package/esm/models/gridColumnGrouping.js +2 -0
  37. package/esm/models/gridColumnHeaderClass.d.ts +2 -0
  38. package/esm/models/gridRows.d.ts +2 -0
  39. package/esm/models/gridSortModel.d.ts +5 -0
  40. package/esm/models/params/gridRowParams.d.ts +1 -1
  41. package/esm/models/params/gridRowParams.js +1 -1
  42. package/esm/utils/createSelector.d.ts +3 -11
  43. package/esm/utils/createSelector.js +16 -86
  44. package/hooks/core/useGridApiInitialization.js +2 -2
  45. package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +13 -5
  46. package/hooks/features/columnResize/columnResizeSelector.d.ts +3 -1
  47. package/hooks/features/columns/gridColumnsSelector.d.ts +41 -15
  48. package/hooks/features/columns/gridColumnsUtils.js +3 -1
  49. package/hooks/features/dataSource/gridDataSourceSelector.d.ts +4 -2
  50. package/hooks/features/dataSource/useGridDataSourceBase.js +4 -0
  51. package/hooks/features/density/densitySelector.d.ts +3 -1
  52. package/hooks/features/dimensions/gridDimensionsSelectors.d.ts +36 -12
  53. package/hooks/features/editing/gridEditingSelectors.d.ts +8 -4
  54. package/hooks/features/filter/gridFilterSelector.d.ts +51 -17
  55. package/hooks/features/filter/gridFilterState.d.ts +2 -1
  56. package/hooks/features/filter/gridFilterState.js +2 -1
  57. package/hooks/features/filter/useGridFilter.js +2 -2
  58. package/hooks/features/focus/gridFocusStateSelector.d.ts +24 -8
  59. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +9 -3
  60. package/hooks/features/pagination/gridPaginationSelector.d.ts +35 -19
  61. package/hooks/features/pivoting/gridPivotingSelectors.d.ts +9 -4
  62. package/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +3 -1
  63. package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +9 -3
  64. package/hooks/features/rowSelection/utils.d.ts +5 -3
  65. package/hooks/features/rows/gridRowSpanningSelectors.d.ts +9 -3
  66. package/hooks/features/rows/gridRowsSelector.d.ts +50 -29
  67. package/hooks/features/sorting/gridSortingSelector.d.ts +15 -5
  68. package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +4 -2
  69. package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +15 -5
  70. package/hooks/features/virtualization/gridVirtualizationSelectors.js +3 -1
  71. package/hooks/utils/useGridSelector.d.ts +2 -4
  72. package/hooks/utils/useGridSelector.js +4 -4
  73. package/index.js +1 -1
  74. package/material/variables.js +1 -2
  75. package/models/api/gridCoreApi.d.ts +1 -1
  76. package/models/gridCellClass.d.ts +2 -0
  77. package/models/gridColumnGrouping.d.ts +2 -0
  78. package/models/gridColumnGrouping.js +2 -0
  79. package/models/gridColumnHeaderClass.d.ts +2 -0
  80. package/models/gridRows.d.ts +2 -0
  81. package/models/gridSortModel.d.ts +5 -0
  82. package/models/params/gridRowParams.d.ts +1 -1
  83. package/models/params/gridRowParams.js +1 -1
  84. package/package.json +3 -4
  85. package/utils/createSelector.d.ts +3 -11
  86. package/utils/createSelector.js +18 -88
  87. package/esm/utils/Store.d.ts +0 -11
  88. package/esm/utils/Store.js +0 -24
  89. package/esm/utils/weakMapMemoize.d.ts +0 -20
  90. package/esm/utils/weakMapMemoize.js +0 -128
  91. package/utils/Store.d.ts +0 -11
  92. package/utils/Store.js +0 -31
  93. package/utils/weakMapMemoize.d.ts +0 -20
  94. package/utils/weakMapMemoize.js +0 -134
@@ -1,5 +1,11 @@
1
1
  import { GridStateCommunity } from "../../../models/gridStateCommunity.js";
2
2
  export declare const gridHeaderFilteringStateSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, unknown, import("../../../models/gridHeaderFilteringModel.js").GridHeaderFilteringState>;
3
- export declare const gridHeaderFilteringEnabledSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("../../../models/gridHeaderFilteringModel.js").GridHeaderFilteringState, boolean>;
4
- export declare const gridHeaderFilteringEditFieldSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("../../../models/gridHeaderFilteringModel.js").GridHeaderFilteringState, string | null>;
5
- export declare const gridHeaderFilteringMenuSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("../../../models/gridHeaderFilteringModel.js").GridHeaderFilteringState, string | null>;
3
+ export declare const gridHeaderFilteringEnabledSelector: (args_0: import("react").RefObject<{
4
+ state: GridStateCommunity;
5
+ } | null>) => boolean;
6
+ export declare const gridHeaderFilteringEditFieldSelector: (args_0: import("react").RefObject<{
7
+ state: GridStateCommunity;
8
+ } | null>) => string | null;
9
+ export declare const gridHeaderFilteringMenuSelector: (args_0: import("react").RefObject<{
10
+ state: GridStateCommunity;
11
+ } | null>) => string | null;
@@ -9,71 +9,87 @@ export declare const gridPaginationSelector: import("@mui/x-data-grid").OutputSe
9
9
  * @category Pagination
10
10
  * @ignore - do not document.
11
11
  */
12
- export declare const gridPaginationEnabledClientSideSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridPaginationState, boolean>;
12
+ export declare const gridPaginationEnabledClientSideSelector: (args_0: import("react").RefObject<{
13
+ state: GridStateCommunity;
14
+ } | null>) => boolean;
13
15
  /**
14
16
  * Get the pagination model
15
17
  * @category Pagination
16
18
  */
17
- export declare const gridPaginationModelSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridPaginationState, import("@mui/x-data-grid").GridPaginationModel>;
19
+ export declare const gridPaginationModelSelector: (args_0: import("react").RefObject<{
20
+ state: GridStateCommunity;
21
+ } | null>) => import("@mui/x-data-grid").GridPaginationModel;
18
22
  /**
19
23
  * Get the row count
20
24
  * @category Pagination
21
25
  */
22
- export declare const gridPaginationRowCountSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridPaginationState, number>;
26
+ export declare const gridPaginationRowCountSelector: (args_0: import("react").RefObject<{
27
+ state: GridStateCommunity;
28
+ } | null>) => number;
23
29
  /**
24
30
  * Get the pagination meta
25
31
  * @category Pagination
26
32
  */
27
- export declare const gridPaginationMetaSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridPaginationState, import("@mui/x-data-grid").GridPaginationMeta>;
33
+ export declare const gridPaginationMetaSelector: (args_0: import("react").RefObject<{
34
+ state: GridStateCommunity;
35
+ } | null>) => import("@mui/x-data-grid").GridPaginationMeta;
28
36
  /**
29
37
  * Get the index of the page to render if the pagination is enabled
30
38
  * @category Pagination
31
39
  */
32
- export declare const gridPageSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridPaginationModel, number>;
40
+ export declare const gridPageSelector: (args_0: import("react").RefObject<{
41
+ state: GridStateCommunity;
42
+ } | null>) => number;
33
43
  /**
34
44
  * Get the maximum amount of rows to display on a single page if the pagination is enabled
35
45
  * @category Pagination
36
46
  */
37
- export declare const gridPageSizeSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridPaginationModel, number>;
47
+ export declare const gridPageSizeSelector: (args_0: import("react").RefObject<{
48
+ state: GridStateCommunity;
49
+ } | null>) => number;
38
50
  /**
39
51
  * Get the amount of pages needed to display all the rows if the pagination is enabled
40
52
  * @category Pagination
41
53
  */
42
- export declare const gridPageCountSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, number, number>;
54
+ export declare const gridPageCountSelector: (args_0: import("react").RefObject<{
55
+ state: GridStateCommunity;
56
+ } | null>) => number;
43
57
  /**
44
58
  * Get the index of the first and the last row to include in the current page if the pagination is enabled.
45
59
  * @category Pagination
46
60
  */
47
- export declare const gridPaginationRowRangeSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowEntry<import("@mui/x-data-grid").GridValidRowModel>[], {
61
+ export declare const gridPaginationRowRangeSelector: (args_0: import("react").RefObject<{
62
+ state: GridStateCommunity;
63
+ } | null>) => {
48
64
  firstRowIndex: number;
49
65
  lastRowIndex: number;
50
- } | null>;
66
+ } | null;
51
67
  /**
52
68
  * Get the id and the model of each row to include in the current page if the pagination is enabled.
53
69
  * @category Pagination
54
70
  */
55
- export declare const gridPaginatedVisibleSortedGridRowEntriesSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, {
56
- firstRowIndex: number;
57
- lastRowIndex: number;
58
- } | null, import("@mui/x-data-grid").GridRowEntry<import("@mui/x-data-grid").GridValidRowModel>[]>;
71
+ export declare const gridPaginatedVisibleSortedGridRowEntriesSelector: (args_0: import("react").RefObject<{
72
+ state: GridStateCommunity;
73
+ } | null>) => import("@mui/x-data-grid").GridRowEntry<import("@mui/x-data-grid").GridValidRowModel>[];
59
74
  /**
60
75
  * Get the id of each row to include in the current page if the pagination is enabled.
61
76
  * @category Pagination
62
77
  */
63
- export declare const gridPaginatedVisibleSortedGridRowIdsSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, {
64
- firstRowIndex: number;
65
- lastRowIndex: number;
66
- } | null, GridRowId[]>;
78
+ export declare const gridPaginatedVisibleSortedGridRowIdsSelector: (args_0: import("react").RefObject<{
79
+ state: GridStateCommunity;
80
+ } | null>) => GridRowId[];
67
81
  /**
68
82
  * Get the rows, range and rowIndex lookup map after filtering and sorting.
69
83
  * Does not contain the collapsed children.
70
84
  * @category Pagination
71
85
  */
72
- export declare const gridVisibleRowsSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowEntry<import("@mui/x-data-grid").GridValidRowModel>[], {
86
+ export declare const gridVisibleRowsSelector: (args_0: import("react").RefObject<{
87
+ state: GridStateCommunity;
88
+ } | null>) => {
73
89
  rows: import("@mui/x-data-grid").GridRowEntry<import("@mui/x-data-grid").GridValidRowModel>[];
74
90
  range: {
75
91
  firstRowIndex: number;
76
92
  lastRowIndex: number;
77
93
  } | null;
78
94
  rowIdToIndexMap: Map<GridRowId, number>;
79
- }>;
95
+ };
@@ -1,6 +1,11 @@
1
1
  import type { GridColDef } from "../../../models/colDef/index.js";
2
2
  import type { GridStateCommunity } from "../../../models/gridStateCommunity.js";
3
- import type { GridPivotingStatePartial } from "./gridPivotingInterfaces.js";
4
- export declare const gridPivotActiveSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, GridPivotingStatePartial, boolean>;
5
- export declare const gridPivotInitialColumnsSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, GridPivotingStatePartial, Map<string, GridColDef>>;
6
- export declare const gridPivotPanelOpenSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, GridPivotingStatePartial, boolean>;
3
+ export declare const gridPivotActiveSelector: (args_0: import("react").RefObject<{
4
+ state: GridStateCommunity;
5
+ } | null>) => boolean;
6
+ export declare const gridPivotInitialColumnsSelector: (args_0: import("react").RefObject<{
7
+ state: GridStateCommunity;
8
+ } | null>) => Map<string, GridColDef>;
9
+ export declare const gridPivotPanelOpenSelector: (args_0: import("react").RefObject<{
10
+ state: GridStateCommunity;
11
+ } | null>) => boolean;
@@ -1,3 +1,5 @@
1
1
  import { GridStateCommunity } from "../../../models/gridStateCommunity.js";
2
2
  export declare const gridPreferencePanelStateSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, unknown, import("@mui/x-data-grid").GridPreferencePanelState>;
3
- export declare const gridPreferencePanelSelectorWithLabel: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, string, boolean>;
3
+ export declare const gridPreferencePanelSelectorWithLabel: (args_0: import("react").RefObject<{
4
+ state: GridStateCommunity;
5
+ } | null>, labelId: string | undefined) => boolean;
@@ -1,6 +1,12 @@
1
1
  import { GridStateCommunity } from "../../../models/gridStateCommunity.js";
2
2
  import { GridRowId } from "../../../models/gridRows.js";
3
3
  export declare const gridRowSelectionStateSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, unknown, import("@mui/x-data-grid").GridRowSelectionModel>;
4
- export declare const gridRowSelectionManagerSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowSelectionModel, import("../../../models/gridRowSelectionManager.js").RowSelectionManager>;
5
- export declare const gridRowSelectionCountSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, number, number>;
6
- export declare const gridRowSelectionIdsSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, GridRowId[], Map<GridRowId, import("@mui/x-data-grid").GridValidRowModel>>;
4
+ export declare const gridRowSelectionManagerSelector: (args_0: import("react").RefObject<{
5
+ state: GridStateCommunity;
6
+ } | null>) => import("../../../models/gridRowSelectionManager.js").RowSelectionManager;
7
+ export declare const gridRowSelectionCountSelector: (args_0: import("react").RefObject<{
8
+ state: GridStateCommunity;
9
+ } | null>) => number;
10
+ export declare const gridRowSelectionIdsSelector: (args_0: import("react").RefObject<{
11
+ state: GridStateCommunity;
12
+ } | null>) => Map<GridRowId, import("@mui/x-data-grid").GridValidRowModel>;
@@ -5,13 +5,15 @@ import type { GridPrivateApiCommunity } from "../../../models/api/gridApiCommuni
5
5
  import { type GridRowSelectionPropagation } from "../../../models/gridRowSelectionModel.js";
6
6
  import { type RowSelectionManager } from "../../../models/gridRowSelectionManager.js";
7
7
  export declare const ROW_SELECTION_PROPAGATION_DEFAULT: GridRowSelectionPropagation;
8
- export declare const checkboxPropsSelector: import("@mui/x-data-grid").OutputSelector<import("../../../models/gridStateCommunity.js").GridStateCommunity, {
8
+ export declare const checkboxPropsSelector: (args_0: import("react").RefObject<{
9
+ state: import("../../../models/gridStateCommunity.js").GridStateCommunity;
10
+ } | null>, args_1: {
9
11
  groupId: GridRowId;
10
12
  autoSelectParents: boolean;
11
- }, {
13
+ }) => {
12
14
  isIndeterminate: boolean;
13
15
  isChecked: boolean;
14
- }>;
16
+ };
15
17
  export declare function isMultipleRowSelectionEnabled(props: Pick<DataGridProcessedProps, 'signature' | 'disableMultipleRowSelection' | 'checkboxSelection'>): boolean;
16
18
  export declare const findRowsToSelect: (apiRef: RefObject<GridPrivateApiCommunity>, tree: GridRowTreeConfig, selectedRow: GridRowId, autoSelectDescendants: boolean, autoSelectParents: boolean, addRow: (rowId: GridRowId) => void, rowSelectionManager?: RowSelectionManager) => void;
17
19
  export declare const findRowsToDeselect: (apiRef: RefObject<GridPrivateApiCommunity>, tree: GridRowTreeConfig, deselectedRow: GridRowId, autoSelectDescendants: boolean, autoSelectParents: boolean, removeRow: (rowId: GridRowId) => void) => void;
@@ -1,4 +1,10 @@
1
1
  import { GridStateCommunity } from "../../../models/gridStateCommunity.js";
2
- export declare const gridRowSpanningHiddenCellsSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("./useGridRowSpanning.js").GridRowSpanningState, Record<import("@mui/x-data-grid").GridRowId, Record<string, boolean>>>;
3
- export declare const gridRowSpanningSpannedCellsSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("./useGridRowSpanning.js").GridRowSpanningState, Record<import("@mui/x-data-grid").GridRowId, Record<string, number>>>;
4
- export declare const gridRowSpanningHiddenCellsOriginMapSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("./useGridRowSpanning.js").GridRowSpanningState, Record<number, Record<string, number>>>;
2
+ export declare const gridRowSpanningHiddenCellsSelector: (args_0: import("react").RefObject<{
3
+ state: GridStateCommunity;
4
+ } | null>) => Record<import("@mui/x-data-grid").GridRowId, Record<string, boolean>>;
5
+ export declare const gridRowSpanningSpannedCellsSelector: (args_0: import("react").RefObject<{
6
+ state: GridStateCommunity;
7
+ } | null>) => Record<import("@mui/x-data-grid").GridRowId, Record<string, number>>;
8
+ export declare const gridRowSpanningHiddenCellsOriginMapSelector: (args_0: import("react").RefObject<{
9
+ state: GridStateCommunity;
10
+ } | null>) => Record<number, Record<string, number>>;
@@ -1,31 +1,59 @@
1
1
  import { GridRowId } from "../../../models/gridRows.js";
2
2
  import { GridStateCommunity } from "../../../models/gridStateCommunity.js";
3
3
  export declare const gridRowsStateSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, unknown, import("@mui/x-data-grid").GridRowsState>;
4
- export declare const gridRowCountSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowsState, number>;
5
- export declare const gridRowsLoadingSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowsState, boolean | undefined>;
6
- export declare const gridTopLevelRowCountSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowsState, number>;
7
- export declare const gridRowsLookupSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowsState, import("@mui/x-data-grid").GridRowIdToModelLookup<import("@mui/x-data-grid").GridValidRowModel>>;
8
- export declare const gridRowSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, GridRowId, import("@mui/x-data-grid").GridValidRowModel>;
9
- export declare const gridRowTreeSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowsState, import("@mui/x-data-grid").GridRowTreeConfig>;
10
- export declare const gridRowNodeSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, GridRowId, import("@mui/x-data-grid").GridTreeNode>;
11
- export declare const gridRowGroupsToFetchSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowsState, GridRowId[] | undefined>;
12
- export declare const gridRowGroupingNameSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowsState, string>;
13
- export declare const gridRowTreeDepthsSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowsState, import("./gridRowsInterfaces.js").GridTreeDepths>;
14
- export declare const gridRowMaximumTreeDepthSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowsState, number>;
15
- export declare const gridDataRowIdsSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowsState, GridRowId[]>;
16
- export declare const gridDataRowsSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowIdToModelLookup<import("@mui/x-data-grid").GridValidRowModel>, import("@mui/x-data-grid").GridValidRowModel[]>;
4
+ export declare const gridRowCountSelector: (args_0: import("react").RefObject<{
5
+ state: GridStateCommunity;
6
+ } | null>) => number;
7
+ export declare const gridRowsLoadingSelector: (args_0: import("react").RefObject<{
8
+ state: GridStateCommunity;
9
+ } | null>) => boolean | undefined;
10
+ export declare const gridTopLevelRowCountSelector: (args_0: import("react").RefObject<{
11
+ state: GridStateCommunity;
12
+ } | null>) => number;
13
+ export declare const gridRowsLookupSelector: (args_0: import("react").RefObject<{
14
+ state: GridStateCommunity;
15
+ } | null>) => import("@mui/x-data-grid").GridRowIdToModelLookup<import("@mui/x-data-grid").GridValidRowModel>;
16
+ export declare const gridRowSelector: (args_0: import("react").RefObject<{
17
+ state: GridStateCommunity;
18
+ } | null>, id: GridRowId) => import("@mui/x-data-grid").GridValidRowModel;
19
+ export declare const gridRowTreeSelector: (args_0: import("react").RefObject<{
20
+ state: GridStateCommunity;
21
+ } | null>) => import("@mui/x-data-grid").GridRowTreeConfig;
22
+ export declare const gridRowNodeSelector: (args_0: import("react").RefObject<{
23
+ state: GridStateCommunity;
24
+ } | null>, rowId: GridRowId) => import("@mui/x-data-grid").GridTreeNode;
25
+ export declare const gridRowGroupsToFetchSelector: (args_0: import("react").RefObject<{
26
+ state: GridStateCommunity;
27
+ } | null>) => GridRowId[] | undefined;
28
+ export declare const gridRowGroupingNameSelector: (args_0: import("react").RefObject<{
29
+ state: GridStateCommunity;
30
+ } | null>) => string;
31
+ export declare const gridRowTreeDepthsSelector: (args_0: import("react").RefObject<{
32
+ state: GridStateCommunity;
33
+ } | null>) => import("./gridRowsInterfaces.js").GridTreeDepths;
34
+ export declare const gridRowMaximumTreeDepthSelector: (args_0: import("react").RefObject<{
35
+ state: GridStateCommunity;
36
+ } | null>) => number;
37
+ export declare const gridDataRowIdsSelector: (args_0: import("react").RefObject<{
38
+ state: GridStateCommunity;
39
+ } | null>) => GridRowId[];
40
+ export declare const gridDataRowsSelector: (args_0: import("react").RefObject<{
41
+ state: GridStateCommunity;
42
+ } | null>) => import("@mui/x-data-grid").GridValidRowModel[];
17
43
  /**
18
44
  * @ignore - do not document.
19
45
  */
20
- export declare const gridAdditionalRowGroupsSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowsState, {
46
+ export declare const gridAdditionalRowGroupsSelector: (args_0: import("react").RefObject<{
47
+ state: GridStateCommunity;
48
+ } | null>) => {
21
49
  pinnedRows?: import("./gridRowsInterfaces.js").GridPinnedRowsState;
22
- } | undefined>;
50
+ } | undefined;
23
51
  /**
24
52
  * @ignore - do not document.
25
53
  */
26
- export declare const gridPinnedRowsSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, {
27
- pinnedRows?: import("./gridRowsInterfaces.js").GridPinnedRowsState;
28
- } | undefined, {
54
+ export declare const gridPinnedRowsSelector: (args_0: import("react").RefObject<{
55
+ state: GridStateCommunity;
56
+ } | null>) => {
29
57
  bottom: {
30
58
  id: GridRowId;
31
59
  model: import("@mui/x-data-grid").GridValidRowModel;
@@ -34,17 +62,10 @@ export declare const gridPinnedRowsSelector: import("@mui/x-data-grid").OutputSe
34
62
  id: GridRowId;
35
63
  model: import("@mui/x-data-grid").GridValidRowModel;
36
64
  }[];
37
- }>;
65
+ };
38
66
  /**
39
67
  * @ignore - do not document.
40
68
  */
41
- export declare const gridPinnedRowsCountSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, {
42
- bottom: {
43
- id: GridRowId;
44
- model: import("@mui/x-data-grid").GridValidRowModel;
45
- }[];
46
- top: {
47
- id: GridRowId;
48
- model: import("@mui/x-data-grid").GridValidRowModel;
49
- }[];
50
- }, number>;
69
+ export declare const gridPinnedRowsCountSelector: (args_0: import("react").RefObject<{
70
+ state: GridStateCommunity;
71
+ } | null>) => number;
@@ -5,17 +5,23 @@ import { GridStateCommunity } from "../../../models/gridStateCommunity.js";
5
5
  * Get the id of the rows after the sorting process.
6
6
  * @category Sorting
7
7
  */
8
- export declare const gridSortedRowIdsSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridSortingState, GridRowId[]>;
8
+ export declare const gridSortedRowIdsSelector: (args_0: import("react").RefObject<{
9
+ state: GridStateCommunity;
10
+ } | null>) => GridRowId[];
9
11
  /**
10
12
  * Get the id and the model of the rows after the sorting process.
11
13
  * @category Sorting
12
14
  */
13
- export declare const gridSortedRowEntriesSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridRowTreeConfig, GridRowEntry<GridValidRowModel>[]>;
15
+ export declare const gridSortedRowEntriesSelector: (args_0: import("react").RefObject<{
16
+ state: GridStateCommunity;
17
+ } | null>) => GridRowEntry<GridValidRowModel>[];
14
18
  /**
15
19
  * Get the current sorting model.
16
20
  * @category Sorting
17
21
  */
18
- export declare const gridSortModelSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridSortingState, GridSortModel>;
22
+ export declare const gridSortModelSelector: (args_0: import("react").RefObject<{
23
+ state: GridStateCommunity;
24
+ } | null>) => GridSortModel;
19
25
  export type GridSortColumnLookup = Record<string, {
20
26
  sortDirection: GridSortDirection;
21
27
  sortIndex?: number;
@@ -24,9 +30,13 @@ export type GridSortColumnLookup = Record<string, {
24
30
  * @category Sorting
25
31
  * @ignore - do not document.
26
32
  */
27
- export declare const gridSortColumnLookupSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, GridSortModel, GridSortColumnLookup>;
33
+ export declare const gridSortColumnLookupSelector: (args_0: import("react").RefObject<{
34
+ state: GridStateCommunity;
35
+ } | null>) => GridSortColumnLookup;
28
36
  /**
29
37
  * @category Sorting
30
38
  * @ignore - do not document.
31
39
  */
32
- export declare const gridSortedRowIndexLookupSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, GridRowId[], Record<GridRowId, number>>;
40
+ export declare const gridSortedRowIndexLookupSelector: (args_0: import("react").RefObject<{
41
+ state: GridStateCommunity;
42
+ } | null>) => Record<GridRowId, number>;
@@ -1,6 +1,8 @@
1
- export declare const gridFocusedVirtualCellSelector: import("@mui/x-data-grid").OutputSelector<import("../../../models/gridStateCommunity.js").GridStateCommunity, import("@mui/x-data-grid").GridCellCoordinates | null, {
1
+ export declare const gridFocusedVirtualCellSelector: (args_0: import("react").RefObject<{
2
+ state: import("../../../models/gridStateCommunity.js").GridStateCommunity;
3
+ } | null>) => {
2
4
  rowIndex: number;
3
5
  columnIndex: number;
4
6
  id?: import("@mui/x-data-grid").GridRowId | undefined;
5
7
  field?: string | undefined;
6
- } | null>;
8
+ } | null;
@@ -10,27 +10,37 @@ export declare const gridVirtualizationSelector: import("@mui/x-data-grid").Outp
10
10
  * @category Virtualization
11
11
  * @deprecated Use `gridVirtualizationColumnEnabledSelector` and `gridVirtualizationRowEnabledSelector`
12
12
  */
13
- export declare const gridVirtualizationEnabledSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridVirtualizationState, boolean>;
13
+ export declare const gridVirtualizationEnabledSelector: (args_0: import("react").RefObject<{
14
+ state: GridStateCommunity;
15
+ } | null>) => boolean;
14
16
  /**
15
17
  * Get the enabled state for column virtualization
16
18
  * @category Virtualization
17
19
  */
18
- export declare const gridVirtualizationColumnEnabledSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridVirtualizationState, boolean>;
20
+ export declare const gridVirtualizationColumnEnabledSelector: (args_0: import("react").RefObject<{
21
+ state: GridStateCommunity;
22
+ } | null>) => boolean;
19
23
  /**
20
24
  * Get the enabled state for row virtualization
21
25
  * @category Virtualization
22
26
  */
23
- export declare const gridVirtualizationRowEnabledSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridVirtualizationState, boolean>;
27
+ export declare const gridVirtualizationRowEnabledSelector: (args_0: import("react").RefObject<{
28
+ state: GridStateCommunity;
29
+ } | null>) => boolean;
24
30
  /**
25
31
  * Get the render context
26
32
  * @category Virtualization
27
33
  * @ignore - do not document.
28
34
  */
29
- export declare const gridRenderContextSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, import("@mui/x-data-grid").GridVirtualizationState, import("@mui/x-data-grid").GridRenderContext>;
35
+ export declare const gridRenderContextSelector: (args_0: import("react").RefObject<{
36
+ state: GridStateCommunity;
37
+ } | null>) => import("@mui/x-data-grid").GridRenderContext;
30
38
  /**
31
39
  * Get the render context, with only columns filled in.
32
40
  * This is cached, so it can be used to only re-render when the column interval changes.
33
41
  * @category Virtualization
34
42
  * @ignore - do not document.
35
43
  */
36
- export declare const gridRenderContextColumnsSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, number, GridColumnsRenderContext>;
44
+ export declare const gridRenderContextColumnsSelector: (args_0: import("react").RefObject<{
45
+ state: GridStateCommunity;
46
+ } | null>) => GridColumnsRenderContext;
@@ -30,6 +30,8 @@ export const gridVirtualizationRowEnabledSelector = createSelector(gridVirtualiz
30
30
  * @ignore - do not document.
31
31
  */
32
32
  export const gridRenderContextSelector = createSelector(gridVirtualizationSelector, state => state.renderContext);
33
+ const firstColumnIndexSelector = createRootSelector(state => state.virtualization.renderContext.firstColumnIndex);
34
+ const lastColumnIndexSelector = createRootSelector(state => state.virtualization.renderContext.lastColumnIndex);
33
35
 
34
36
  /**
35
37
  * Get the render context, with only columns filled in.
@@ -37,7 +39,7 @@ export const gridRenderContextSelector = createSelector(gridVirtualizationSelect
37
39
  * @category Virtualization
38
40
  * @ignore - do not document.
39
41
  */
40
- export const gridRenderContextColumnsSelector = createSelectorMemoized(apiRef => apiRef.current.state.virtualization.renderContext.firstColumnIndex, apiRef => apiRef.current.state.virtualization.renderContext.lastColumnIndex, (firstColumnIndex, lastColumnIndex) => ({
42
+ export const gridRenderContextColumnsSelector = createSelectorMemoized(firstColumnIndexSelector, lastColumnIndexSelector, (firstColumnIndex, lastColumnIndex) => ({
41
43
  firstColumnIndex,
42
44
  lastColumnIndex
43
45
  }));
@@ -1,8 +1,6 @@
1
1
  import { RefObject } from '@mui/x-internals/types';
2
2
  import type { GridApiCommon } from "../../models/api/gridApiCommon.js";
3
- import type { OutputSelector } from "../../utils/createSelector.js";
4
- type Selector<Api extends GridApiCommon, Args, T> = ((apiRef: RefObject<Api>) => T) | ((apiRef: RefObject<Api | null>) => T) | OutputSelector<Api['state'], Args, T>;
5
3
  export declare const objectShallowCompare: (a: unknown, b: unknown) => boolean;
6
4
  export declare const argsEqual: (prev: any, curr: any) => boolean;
7
- export declare const useGridSelector: <Api extends GridApiCommon, Args, T>(apiRef: RefObject<Api>, selector: Selector<Api, Args, T>, args?: Args, equals?: <U = T>(a: U, b: U) => boolean) => T;
8
- export {};
5
+ export declare function useGridSelector<Api extends GridApiCommon, T>(apiRef: RefObject<Api>, selector: (apiRef: RefObject<Api>) => T, args?: undefined, equals?: <U = T>(a: U, b: U) => boolean): T;
6
+ export declare function useGridSelector<Api extends GridApiCommon, T, Args>(apiRef: RefObject<Api>, selector: (apiRef: RefObject<Api>, a1: Args) => T, args: Args, equals?: <U = T>(a: U, b: U) => boolean): T;
@@ -28,7 +28,7 @@ const createRefs = () => ({
28
28
  });
29
29
  const EMPTY = [];
30
30
  const emptyGetSnapshot = () => null;
31
- export const useGridSelector = (apiRef, selector, args = undefined, equals = defaultCompare) => {
31
+ export function useGridSelector(apiRef, selector, args = undefined, equals = defaultCompare) {
32
32
  if (process.env.NODE_ENV !== 'production') {
33
33
  if (!apiRef.current.state) {
34
34
  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.']);
@@ -77,4 +77,4 @@ export const useGridSelector = (apiRef, selector, args = undefined, equals = def
77
77
  }, EMPTY);
78
78
  useSyncExternalStore(unsubscribe, subscribe, emptyGetSnapshot);
79
79
  return state;
80
- };
80
+ }
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.5.1
2
+ * @mui/x-data-grid v8.5.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -16,8 +16,7 @@ export function useMaterialCSSVariables() {
16
16
  }
17
17
  function transformTheme(t) {
18
18
  const borderColor = getBorderColor(t);
19
- const dataGridPalette = t.palette.DataGrid; // FIXME: docs typecheck error
20
-
19
+ const dataGridPalette = (t.vars || t).palette.DataGrid;
21
20
  const backgroundBase = dataGridPalette?.bg ?? (t.vars || t).palette.background.default;
22
21
  const backgroundHeader = dataGridPalette?.headerBg ?? backgroundBase;
23
22
  const backgroundPinned = dataGridPalette?.pinnedBg ?? backgroundBase;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { EventManager, EventListenerOptions } from '@mui/x-internals/EventManager';
3
+ import type { Store } from '@mui/x-internals/store';
3
4
  import type { GridEventPublisher, GridEventListener, GridEvents } from "../events/index.js";
4
- import { Store } from "../../utils/Store.js";
5
5
  import type { GridApiCaches } from "../gridApiCaches.js";
6
6
  import type { GridApiCommon, GridPrivateApiCommon } from "./gridApiCommon.js";
7
7
  import type { DataGridProcessedProps } from "../props/DataGridProps.js";
@@ -2,6 +2,8 @@ import { GridValidRowModel } from "./gridRows.js";
2
2
  import { GridCellParams } from "./params/gridCellParams.js";
3
3
  /**
4
4
  * A function used to process cellClassName params.
5
+ * @param {GridCellParams<R, V>} params The parameters of the cell.
6
+ * @returns {string} The class name to be added to the cell.
5
7
  */
6
8
  export type GridCellClassFn<R extends GridValidRowModel = any, V = unknown> = (params: GridCellParams<R, V>) => string;
7
9
  /**
@@ -7,6 +7,8 @@ export type GridColumnNode = GridColumnGroup | GridLeafColumn;
7
7
  export declare function isLeaf(node: GridColumnNode): node is GridLeafColumn;
8
8
  /**
9
9
  * A function used to process headerClassName params.
10
+ * @param {GridColumnGroupHeaderParams} params The parameters of the column group header.
11
+ * @returns {string} The class name to be added to the column group header cell.
10
12
  */
11
13
  export type GridColumnGroupHeaderClassFn = (params: GridColumnGroupHeaderParams) => string;
12
14
  /**
@@ -4,6 +4,8 @@ export function isLeaf(node) {
4
4
 
5
5
  /**
6
6
  * A function used to process headerClassName params.
7
+ * @param {GridColumnGroupHeaderParams} params The parameters of the column group header.
8
+ * @returns {string} The class name to be added to the column group header cell.
7
9
  */
8
10
 
9
11
  /**
@@ -1,6 +1,8 @@
1
1
  import { GridColumnHeaderParams } from "./params/gridColumnHeaderParams.js";
2
2
  /**
3
3
  * A function used to process headerClassName params.
4
+ * @param {GridColumnHeaderParams} params The parameters of the column header.
5
+ * @returns {string} The class name to be added to the column header cell.
4
6
  */
5
7
  export type GridColumnHeaderClassFn = (params: GridColumnHeaderParams) => string;
6
8
  /**
@@ -173,6 +173,8 @@ export interface GridRowEntry<R extends GridValidRowModel = GridValidRowModel> {
173
173
  }
174
174
  /**
175
175
  * The function to retrieve the id of a [[GridRowModel]].
176
+ * @param {R} row The row model.
177
+ * @returns {GridRowId} The id of the row.
176
178
  */
177
179
  export type GridRowIdGetter<R extends GridValidRowModel = GridValidRowModel> = (row: R) => GridRowId;
178
180
  export {};
@@ -9,6 +9,11 @@ export interface GridSortCellParams<V = any> {
9
9
  }
10
10
  /**
11
11
  * The type of the sort comparison function.
12
+ * @param {V} v1 The first value to compare.
13
+ * @param {V} v2 The second value to compare.
14
+ * @param {GridSortCellParams<V>} cellParams1 The parameters of the first cell.
15
+ * @param {GridSortCellParams<V>} cellParams2 The parameters of the second cell.
16
+ * @returns {number} The result of the comparison.
12
17
  */
13
18
  export type GridComparatorFn<V = any> = (v1: V, v2: V, cellParams1: GridSortCellParams<V>, cellParams2: GridSortCellParams<V>) => number;
14
19
  /**
@@ -3,7 +3,7 @@ import type { GridColDef } from "../colDef/gridColDef.js";
3
3
  /**
4
4
  * Object passed as parameter in the row callbacks.
5
5
  * @demos
6
- * - [Master detail](/x/react-data-grid/master-detail/)
6
+ * - [Master-detail row panels](/x/react-data-grid/master-detail/)
7
7
  */
8
8
  export interface GridRowParams<R extends GridValidRowModel = any> {
9
9
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Object passed as parameter in the row callbacks.
3
3
  * @demos
4
- * - [Master detail](/x/react-data-grid/master-detail/)
4
+ * - [Master-detail row panels](/x/react-data-grid/master-detail/)
5
5
  */
6
6
  /**
7
7
  * Object passed as parameter in the row `getRowClassName` callback prop.
@@ -1,23 +1,15 @@
1
1
  import { RefObject } from '@mui/x-internals/types';
2
- import { Selector, SelectorResultArray } from 'reselect';
2
+ import { CreateSelectorFunction } from '@mui/x-internals/store';
3
3
  export interface OutputSelector<State, Args, Result> {
4
4
  (apiRef: RefObject<{
5
5
  state: State;
6
6
  } | null>, args?: Args): Result;
7
7
  }
8
- type StateFromSelector<T> = T extends ((first: infer F, ...args: any[]) => any) ? F extends RefObject<{
9
- state: infer F2;
10
- } | null> ? F2 : F : never;
11
- type StateFromSelectorList<Selectors extends readonly any[]> = Selectors extends [f: infer F, ...other: infer R] ? StateFromSelector<F> extends StateFromSelectorList<R> ? StateFromSelector<F> : StateFromSelectorList<R> : {};
12
- type SelectorResultArrayWithArgs<Selectors extends ReadonlyArray<Selector<any>>, Args> = [...SelectorResultArray<Selectors>, Args];
13
- type SelectorArgs<Selectors extends ReadonlyArray<Selector<any>>, Args, Result> = [selectors: [...Selectors], combiner: (...args: SelectorResultArrayWithArgs<Selectors, Args>) => Result] | [...Selectors, (...args: SelectorResultArrayWithArgs<Selectors, Args>) => Result];
14
- type CreateSelectorFunction = <Selectors extends ReadonlyArray<Selector<any>>, Args, Result>(...items: SelectorArgs<Selectors, Args, Result>) => OutputSelector<StateFromSelectorList<Selectors>, Args, Result>;
15
8
  export declare const createSelector: CreateSelectorFunction;
9
+ export declare const createSelectorMemoized: CreateSelectorFunction;
16
10
  /**
17
11
  * Used to create the root selector for a feature. It assumes that the state is already initialized
18
12
  * and strips from the types the possibility of `apiRef` being `null`.
19
13
  * Users are warned about this in our documentation https://mui.com/x/react-data-grid/state/#direct-selector-access
20
14
  */
21
- export declare const createRootSelector: <State, Args, Result>(fn: (state: State, args: Args) => Result) => OutputSelector<State, Args, Result>;
22
- export declare const createSelectorMemoized: CreateSelectorFunction;
23
- export {};
15
+ export declare const createRootSelector: <State, Args, Result>(fn: (state: State, args: Args) => Result) => OutputSelector<State, Args, Result>;