@mui/x-data-grid-premium 8.9.0 → 8.9.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 +124 -0
  2. package/DataGridPremium/DataGridPremium.js +27 -10
  3. package/DataGridPremium/useDataGridPremiumComponent.js +4 -0
  4. package/components/GridColumnMenuPivotItem.js +4 -3
  5. package/components/GridDataSourceGroupingCriteriaCell.js +3 -1
  6. package/components/pivotPanel/GridPivotPanelHeader.js +1 -1
  7. package/components/pivotPanel/PivotPanelTrigger.js +6 -1
  8. package/components/sidebar/Sidebar.d.ts +1 -1
  9. package/components/sidebar/Sidebar.js +20 -4
  10. package/esm/DataGridPremium/DataGridPremium.js +29 -12
  11. package/esm/DataGridPremium/useDataGridPremiumComponent.js +5 -1
  12. package/esm/components/GridColumnMenuPivotItem.js +3 -2
  13. package/esm/components/GridDataSourceGroupingCriteriaCell.js +3 -1
  14. package/esm/components/pivotPanel/GridPivotPanelHeader.js +1 -1
  15. package/esm/components/pivotPanel/PivotPanelTrigger.js +6 -1
  16. package/esm/components/sidebar/Sidebar.d.ts +1 -1
  17. package/esm/components/sidebar/Sidebar.js +21 -5
  18. package/esm/hooks/features/aggregation/gridAggregationInterfaces.d.ts +1 -1
  19. package/esm/hooks/features/aiAssistant/api.d.ts +3 -3
  20. package/esm/hooks/features/aiAssistant/api.js +8 -4
  21. package/esm/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +11 -0
  22. package/esm/hooks/features/export/serializer/excelSerializer.js +1 -6
  23. package/esm/hooks/features/index.d.ts +2 -1
  24. package/esm/hooks/features/index.js +2 -1
  25. package/esm/hooks/features/pivoting/gridPivotingInterfaces.d.ts +5 -0
  26. package/esm/hooks/features/pivoting/gridPivotingSelectors.d.ts +4 -1
  27. package/esm/hooks/features/pivoting/gridPivotingSelectors.js +3 -1
  28. package/esm/hooks/features/pivoting/useGridPivoting.d.ts +1 -1
  29. package/esm/hooks/features/pivoting/useGridPivoting.js +28 -9
  30. package/esm/hooks/features/rowGrouping/createGroupingColDef.d.ts +1 -2
  31. package/esm/hooks/features/rowGrouping/createGroupingColDef.js +10 -3
  32. package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +1 -5
  33. package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.js +1 -6
  34. package/esm/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +2 -2
  35. package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +2 -2
  36. package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
  37. package/esm/hooks/features/rows/useGridRowAriaAttributes.d.ts +1 -1
  38. package/esm/hooks/features/rows/useGridRowAriaAttributes.js +2 -2
  39. package/esm/hooks/features/sidebar/gridSidebarInterfaces.d.ts +16 -0
  40. package/esm/hooks/features/sidebar/gridSidebarInterfaces.js +4 -0
  41. package/esm/hooks/features/sidebar/gridSidebarSelector.d.ts +12 -0
  42. package/esm/hooks/features/sidebar/gridSidebarSelector.js +12 -0
  43. package/esm/hooks/features/sidebar/gridSidebarState.d.ts +8 -0
  44. package/esm/hooks/features/sidebar/gridSidebarState.js +1 -0
  45. package/esm/hooks/features/sidebar/index.d.ts +3 -0
  46. package/esm/hooks/features/sidebar/index.js +3 -0
  47. package/esm/hooks/features/sidebar/useGridSidebar.d.ts +6 -0
  48. package/esm/hooks/features/sidebar/useGridSidebar.js +72 -0
  49. package/esm/hooks/utils/useGridAriaAttributes.d.ts +1 -1
  50. package/esm/hooks/utils/useGridAriaAttributes.js +2 -2
  51. package/esm/index.js +1 -1
  52. package/esm/models/dataGridPremiumProps.d.ts +16 -0
  53. package/esm/models/gridApiPremium.d.ts +2 -1
  54. package/esm/models/gridStatePremium.d.ts +3 -0
  55. package/esm/typeOverloads/modules.d.ts +28 -1
  56. package/hooks/features/aggregation/gridAggregationInterfaces.d.ts +1 -1
  57. package/hooks/features/aiAssistant/api.d.ts +3 -3
  58. package/hooks/features/aiAssistant/api.js +8 -4
  59. package/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +11 -0
  60. package/hooks/features/export/serializer/excelSerializer.js +1 -6
  61. package/hooks/features/index.d.ts +2 -1
  62. package/hooks/features/index.js +11 -0
  63. package/hooks/features/pivoting/gridPivotingInterfaces.d.ts +5 -0
  64. package/hooks/features/pivoting/gridPivotingSelectors.d.ts +4 -1
  65. package/hooks/features/pivoting/gridPivotingSelectors.js +3 -8
  66. package/hooks/features/pivoting/useGridPivoting.d.ts +1 -1
  67. package/hooks/features/pivoting/useGridPivoting.js +28 -9
  68. package/hooks/features/rowGrouping/createGroupingColDef.d.ts +1 -2
  69. package/hooks/features/rowGrouping/createGroupingColDef.js +13 -6
  70. package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +1 -5
  71. package/hooks/features/rowGrouping/gridRowGroupingUtils.js +3 -8
  72. package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +6 -6
  73. package/hooks/features/rowGrouping/useGridRowGrouping.js +1 -1
  74. package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +7 -7
  75. package/hooks/features/rows/useGridRowAriaAttributes.d.ts +1 -1
  76. package/hooks/features/rows/useGridRowAriaAttributes.js +4 -4
  77. package/hooks/features/sidebar/gridSidebarInterfaces.d.ts +16 -0
  78. package/hooks/features/sidebar/gridSidebarInterfaces.js +10 -0
  79. package/hooks/features/sidebar/gridSidebarSelector.d.ts +12 -0
  80. package/hooks/features/sidebar/gridSidebarSelector.js +18 -0
  81. package/hooks/features/sidebar/gridSidebarState.d.ts +8 -0
  82. package/hooks/features/sidebar/gridSidebarState.js +5 -0
  83. package/hooks/features/sidebar/index.d.ts +3 -0
  84. package/hooks/features/sidebar/index.js +38 -0
  85. package/hooks/features/sidebar/useGridSidebar.d.ts +6 -0
  86. package/hooks/features/sidebar/useGridSidebar.js +82 -0
  87. package/hooks/utils/useGridAriaAttributes.d.ts +1 -1
  88. package/hooks/utils/useGridAriaAttributes.js +4 -4
  89. package/index.js +1 -1
  90. package/models/dataGridPremiumProps.d.ts +16 -0
  91. package/models/gridApiPremium.d.ts +2 -1
  92. package/models/gridStatePremium.d.ts +3 -0
  93. package/package.json +7 -8
  94. package/typeOverloads/modules.d.ts +28 -1
@@ -1,11 +1,12 @@
1
1
  import { GridExportDisplayOptions, GridValidRowModel } from '@mui/x-data-grid-pro';
2
- import type { GridControlledStateEventLookupPro, GridApiCachesPro, GridEventLookupPro } from '@mui/x-data-grid-pro/typeOverloads';
2
+ import type { GridPipeProcessingLookupPro, GridControlledStateEventLookupPro, GridApiCachesPro, GridEventLookupPro } from '@mui/x-data-grid-pro/typeOverloads';
3
3
  import type { GridGroupingValueGetter, GridPastedValueParser } from "../models/index.js";
4
4
  import type { GridRowGroupingModel, GridAggregationModel, GridAggregationCellMeta, GridAggregationHeaderMeta, GridCellSelectionModel, Conversation } from "../hooks/index.js";
5
5
  import { GridRowGroupingInternalCache } from "../hooks/features/rowGrouping/gridRowGroupingInterfaces.js";
6
6
  import { GridAggregationInternalCache } from "../hooks/features/aggregation/gridAggregationInterfaces.js";
7
7
  import type { GridExcelExportOptions } from "../hooks/features/export/gridExcelExportInterface.js";
8
8
  import type { GridPivotingInternalCache, GridPivotModel } from "../hooks/features/pivoting/gridPivotingInterfaces.js";
9
+ import { GridSidebarValue } from "../hooks/features/sidebar/gridSidebarInterfaces.js";
9
10
  export interface GridControlledStateEventLookupPremium {
10
11
  /**
11
12
  * Fired when the aggregation model changes.
@@ -40,6 +41,9 @@ export interface GridControlledStateEventLookupPremium {
40
41
  pivotModeChange: {
41
42
  params: boolean;
42
43
  };
44
+ /**
45
+ * @deprecated Use the `sidebarOpen` and `sidebarClose` events instead.
46
+ */
43
47
  pivotPanelOpenChange: {
44
48
  params: boolean;
45
49
  };
@@ -69,6 +73,22 @@ interface GridEventLookupPremium extends GridEventLookupPro {
69
73
  * Fired when the clipboard paste operation ends.
70
74
  */
71
75
  clipboardPasteEnd: {};
76
+ /**
77
+ * Fired when the sidebar is opened.
78
+ */
79
+ sidebarOpen: {
80
+ params: {
81
+ value: GridSidebarValue;
82
+ };
83
+ };
84
+ /**
85
+ * Fired when the sidebar is closed.
86
+ */
87
+ sidebarClose: {
88
+ params: {
89
+ value: GridSidebarValue;
90
+ };
91
+ };
72
92
  }
73
93
  export interface GridColDefPremium<R extends GridValidRowModel = any, V = any, F = V> {
74
94
  /**
@@ -109,8 +129,15 @@ export interface GridApiCachesPremium extends GridApiCachesPro {
109
129
  rowGrouping: GridRowGroupingInternalCache;
110
130
  aggregation: GridAggregationInternalCache;
111
131
  }
132
+ export interface GridPipeProcessingLookupPremium {
133
+ sidebar: {
134
+ value: React.ReactNode;
135
+ context: GridSidebarValue;
136
+ };
137
+ }
112
138
  declare module '@mui/x-data-grid-pro' {
113
139
  interface GridEventLookup extends GridEventLookupPremium {}
140
+ interface GridPipeProcessingLookup extends GridPipeProcessingLookupPro, GridPipeProcessingLookupPremium {}
114
141
  interface GridControlledStateEventLookup extends GridControlledStateEventLookupPro, GridControlledStateEventLookupPremium {}
115
142
  interface GridRenderCellParams<R, V, F> extends GridRenderCellParamsPremium<R, V, F> {}
116
143
  interface GridColumnHeaderParams<R, V, F> extends GridColumnHeaderParamsPremium<R, V, F> {}
@@ -47,7 +47,7 @@ export interface GridAggregationFunction<V = any, AV = V> {
47
47
  * @param {GridApiPremium} api The grid API.
48
48
  * @returns {AV} The aggregated value.
49
49
  */
50
- apply: (params: GridAggregationParams<V>, api: GridApiPremium) => AV | null | undefined;
50
+ apply: (params: GridAggregationParams<V>, api?: GridApiPremium) => AV | null | undefined;
51
51
  /**
52
52
  * Label of the aggregation function.
53
53
  * Used for adding a label to the footer of the grouping column when this aggregation function is the only one being used.
@@ -1,4 +1,4 @@
1
- import { PromptResponse } from "./gridAiAssistantInterfaces.js";
1
+ import { PromptResponse, PromptResolverOptions } from "./gridAiAssistantInterfaces.js";
2
2
  /**
3
3
  * Prompt resolver for the <DataGridPremium /> component.
4
4
  * @param {string} url The URL to send the request to.
@@ -6,7 +6,7 @@ import { PromptResponse } from "./gridAiAssistantInterfaces.js";
6
6
  * @param {string} context The prompt context containing necessary information about the current columns definition.
7
7
  * Either use the `context` parameter of the `onPrompt` callback or the return value of the `unstable_getPromptContext()` API method.
8
8
  * @param {string} conversationId The id of the conversation the prompt is part of. If not passed, prompt response will return a new conversation id that can be used to continue the newly started conversation.
9
- * @param {string} additionalContext Optional, additional context to make the processing results more accurate.
9
+ * @param {string | PromptResolverOptions} optionsOrAdditionalContext Optional, includes settings to extend and customize the prompt resolver's behaviour, or additional context string for backward compatibility.
10
10
  * @returns {Promise<PromptResponse>} The grid state updates to be applied.
11
11
  */
12
- export declare function gridDefaultPromptResolver(url: string, query: string, context: string, conversationId?: string, additionalContext?: string): Promise<PromptResponse>;
12
+ export declare function gridDefaultPromptResolver(url: string, query: string, context: string, conversationId?: string, optionsOrAdditionalContext?: string | PromptResolverOptions): Promise<PromptResponse>;
@@ -11,10 +11,14 @@ exports.gridDefaultPromptResolver = gridDefaultPromptResolver;
11
11
  * @param {string} context The prompt context containing necessary information about the current columns definition.
12
12
  * Either use the `context` parameter of the `onPrompt` callback or the return value of the `unstable_getPromptContext()` API method.
13
13
  * @param {string} conversationId The id of the conversation the prompt is part of. If not passed, prompt response will return a new conversation id that can be used to continue the newly started conversation.
14
- * @param {string} additionalContext Optional, additional context to make the processing results more accurate.
14
+ * @param {string | PromptResolverOptions} optionsOrAdditionalContext Optional, includes settings to extend and customize the prompt resolver's behaviour, or additional context string for backward compatibility.
15
15
  * @returns {Promise<PromptResponse>} The grid state updates to be applied.
16
16
  */
17
- function gridDefaultPromptResolver(url, query, context, conversationId, additionalContext = '') {
17
+ function gridDefaultPromptResolver(url, query, context, conversationId, optionsOrAdditionalContext = '') {
18
+ // Handle backward compatibility: if string is passed, treat it as additionalContext
19
+ const options = typeof optionsOrAdditionalContext === 'string' ? {
20
+ additionalContext: optionsOrAdditionalContext
21
+ } : optionsOrAdditionalContext;
18
22
  return fetch(url, {
19
23
  mode: 'cors',
20
24
  method: 'POST',
@@ -25,8 +29,8 @@ function gridDefaultPromptResolver(url, query, context, conversationId, addition
25
29
  body: JSON.stringify({
26
30
  context,
27
31
  query,
28
- additionalContext,
29
- conversationId
32
+ conversationId,
33
+ options
30
34
  })
31
35
  }).then(result => result.json()).then(result => {
32
36
  if (result.ok === false) {
@@ -49,6 +49,17 @@ export type PromptResponse = {
49
49
  grouping: Grouping[];
50
50
  pivoting: Pivoting;
51
51
  };
52
+ export type PromptResolverOptions = {
53
+ /**
54
+ * By default, MUI's prompt resolver service stores the queries made to the service to analyze potential errors and improve the service (data is never stored). Enable private mode to make the service only keep track of the token count, without any query related data.
55
+ * @default false
56
+ */
57
+ privateMode?: boolean;
58
+ /**
59
+ * Additional context to make the processing results more accurate.
60
+ */
61
+ additionalContext?: string;
62
+ };
52
63
  /**
53
64
  * The prompt API interface that is available in the grid [[apiRef]].
54
65
  */
@@ -58,12 +58,7 @@ const serializeRowUnsafe = (id, columns, apiRef, defaultValueOptionsFormulae, op
58
58
  const hasColSpan = (0, _internals.gridHasColSpanSelector)(apiRef);
59
59
  if (hasColSpan) {
60
60
  // `colSpan` is only calculated for rendered rows, so we need to calculate it during export for every row
61
- apiRef.current.calculateColSpan({
62
- rowId: id,
63
- minFirstColumn: 0,
64
- maxLastColumn: columns.length,
65
- columns
66
- });
61
+ apiRef.current.calculateColSpan(id, 0, columns.length, columns);
67
62
  }
68
63
  columns.forEach((column, colIndex) => {
69
64
  const colSpanInfo = hasColSpan ? apiRef.current.unstable_getCellColSpanInfo(id, colIndex) : undefined;
@@ -2,4 +2,5 @@ export * from "./aggregation/index.js";
2
2
  export * from "./rowGrouping/index.js";
3
3
  export * from "./export/index.js";
4
4
  export * from "./cellSelection/index.js";
5
- export * from "./aiAssistant/index.js";
5
+ export * from "./aiAssistant/index.js";
6
+ export * from "./sidebar/index.js";
@@ -57,4 +57,15 @@ Object.keys(_aiAssistant).forEach(function (key) {
57
57
  return _aiAssistant[key];
58
58
  }
59
59
  });
60
+ });
61
+ var _sidebar = require("./sidebar");
62
+ Object.keys(_sidebar).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _sidebar[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function () {
68
+ return _sidebar[key];
69
+ }
70
+ });
60
71
  });
@@ -23,6 +23,10 @@ export interface GridPivotingState extends GridPivotingStatePartial {
23
23
  export interface GridPivotingInitialState {
24
24
  model?: GridPivotModel;
25
25
  enabled?: boolean;
26
+ /**
27
+ * To open the pivot sidebar on init, set sidebar's `openValue` to `GridSidebarValue.Pivot`.
28
+ * @deprecated Use sidebar state instead.
29
+ */
26
30
  panelOpen?: boolean;
27
31
  }
28
32
  export interface GridPivotModel {
@@ -55,6 +59,7 @@ export interface GridPivotingApi {
55
59
  setPivotActive: (active: boolean | ((prev: boolean) => boolean)) => void;
56
60
  /**
57
61
  * Sets whether the pivot panel is open.
62
+ * @deprecated Use the `showSidebar` method instead. Using this method will not trigger the `sidebarOpen` and `sidebarClose` events.
58
63
  * @param {boolean | ((prev: boolean) => boolean)} open - The new value of the pivot panel open state.
59
64
  */
60
65
  setPivotPanelOpen: (open: boolean | ((prev: boolean) => boolean)) => void;
@@ -1,8 +1,11 @@
1
1
  import type { GridStatePremium } from "../../../models/gridStatePremium.js";
2
+ export declare const gridPivotPanelOpenSelector: (args_0: import("react").RefObject<{
3
+ state: GridStatePremium;
4
+ } | null>) => boolean;
2
5
  export declare const gridPivotModelSelector: (args_0: import("react").RefObject<{
3
6
  state: GridStatePremium;
4
7
  } | null>) => import("./gridPivotingInterfaces.js").GridPivotModel;
5
8
  export declare const gridPivotPropsOverridesSelector: (args_0: import("react").RefObject<{
6
9
  state: GridStatePremium;
7
10
  } | null>) => import("./gridPivotingInterfaces.js").GridPivotingPropsOverrides | undefined;
8
- export { gridPivotActiveSelector, gridPivotInitialColumnsSelector, gridPivotPanelOpenSelector } from '@mui/x-data-grid/internals';
11
+ export { gridPivotActiveSelector, gridPivotInitialColumnsSelector } from '@mui/x-data-grid/internals';
@@ -15,16 +15,11 @@ Object.defineProperty(exports, "gridPivotInitialColumnsSelector", {
15
15
  return _internals2.gridPivotInitialColumnsSelector;
16
16
  }
17
17
  });
18
- exports.gridPivotModelSelector = void 0;
19
- Object.defineProperty(exports, "gridPivotPanelOpenSelector", {
20
- enumerable: true,
21
- get: function () {
22
- return _internals2.gridPivotPanelOpenSelector;
23
- }
24
- });
25
- exports.gridPivotPropsOverridesSelector = void 0;
18
+ exports.gridPivotPropsOverridesSelector = exports.gridPivotPanelOpenSelector = exports.gridPivotModelSelector = void 0;
26
19
  var _internals = require("@mui/x-data-grid-pro/internals");
20
+ var _sidebar = require("../sidebar");
27
21
  var _internals2 = require("@mui/x-data-grid/internals");
28
22
  const gridPivotingStateSelector = (0, _internals.createRootSelector)(state => state.pivoting);
23
+ const gridPivotPanelOpenSelector = exports.gridPivotPanelOpenSelector = (0, _internals.createSelector)(_sidebar.gridSidebarStateSelector, sidebar => sidebar.value === _sidebar.GridSidebarValue.Pivot && sidebar.open);
29
24
  const gridPivotModelSelector = exports.gridPivotModelSelector = (0, _internals.createSelector)(gridPivotingStateSelector, pivoting => pivoting?.model);
30
25
  const gridPivotPropsOverridesSelector = exports.gridPivotPropsOverridesSelector = (0, _internals.createSelector)(gridPivotingStateSelector, pivoting => pivoting?.active ? pivoting.propsOverrides : undefined);
@@ -3,6 +3,6 @@ import { RefObject } from '@mui/x-internals/types';
3
3
  import { GridStateInitializer } from '@mui/x-data-grid-pro/internals';
4
4
  import type { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
5
5
  import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
6
- export declare const pivotingStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'pivotActive' | 'pivotModel' | 'pivotPanelOpen' | 'initialState' | 'disablePivoting' | 'getPivotDerivedColumns' | 'columns'>>;
6
+ export declare const pivotingStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'pivotActive' | 'pivotModel' | 'pivotPanelOpen' | 'initialState' | 'disablePivoting' | 'getPivotDerivedColumns' | 'columns'>, GridPrivateApiPremium>;
7
7
  export declare const useGridPivoting: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "pivotActive" | "onPivotActiveChange" | "pivotModel" | "onPivotModelChange" | "pivotPanelOpen" | "onPivotPanelOpenChange" | "disablePivoting" | "getPivotDerivedColumns" | "pivotingColDef" | "groupingColDef" | "aggregationFunctions">, originalColumnsProp: readonly GridColDef[], originalRowsProp: readonly GridRowModel[]) => void;
8
8
  export declare const useGridPivotingExportState: (apiRef: RefObject<GridPrivateApiPremium>) => void;
@@ -12,9 +12,12 @@ var _xDataGridPro = require("@mui/x-data-grid-pro");
12
12
  var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
13
13
  var _useOnMount = _interopRequireDefault(require("@mui/utils/useOnMount"));
14
14
  var _internals = require("@mui/x-data-grid-pro/internals");
15
+ var _pivotPanel = require("../../../components/pivotPanel");
15
16
  var _gridPivotingSelectors = require("./gridPivotingSelectors");
16
17
  var _utils = require("./utils");
17
18
  var _gridAggregationUtils = require("../aggregation/gridAggregationUtils");
19
+ var _sidebar = require("../sidebar");
20
+ var _jsxRuntime = require("react/jsx-runtime");
18
21
  const emptyPivotModel = {
19
22
  rows: [],
20
23
  columns: [],
@@ -33,19 +36,23 @@ const pivotingStateInitializer = (state, props, apiRef) => {
33
36
  return (0, _extends2.default)({}, state, {
34
37
  pivoting: {
35
38
  active: false,
36
- model: emptyPivotModel,
37
- panelOpen: false
39
+ model: emptyPivotModel
38
40
  }
39
41
  });
40
42
  }
41
43
  const initialColumns = (0, _utils.getInitialColumns)(props.columns ?? [], props.getPivotDerivedColumns, apiRef.current.getLocaleText);
44
+ const open = props.pivotPanelOpen ?? props.initialState?.pivoting?.panelOpen ?? false;
45
+ const sidebarStateUpdate = open ? {
46
+ open,
47
+ value: _sidebar.GridSidebarValue.Pivot
48
+ } : {};
42
49
  return (0, _extends2.default)({}, state, {
43
50
  pivoting: {
44
51
  active: props.pivotActive ?? props.initialState?.pivoting?.enabled ?? false,
45
52
  model: props.pivotModel ?? props.initialState?.pivoting?.model ?? emptyPivotModel,
46
- panelOpen: props.pivotPanelOpen ?? props.initialState?.pivoting?.panelOpen ?? false,
47
53
  initialColumns
48
- }
54
+ },
55
+ sidebar: (0, _extends2.default)({}, state.sidebar, sidebarStateUpdate)
49
56
  });
50
57
  };
51
58
  exports.pivotingStateInitializer = pivotingStateInitializer;
@@ -258,11 +265,16 @@ const useGridPivoting = (apiRef, props, originalColumnsProp, originalRowsProp) =
258
265
  if (!isPivotingAvailable) {
259
266
  return;
260
267
  }
261
- apiRef.current.setState(state => (0, _extends2.default)({}, state, {
262
- pivoting: (0, _extends2.default)({}, state.pivoting, {
263
- panelOpen: typeof callback === 'function' ? callback(state.pivoting?.panelOpen) : callback
264
- })
265
- }));
268
+ const panelOpen = (0, _gridPivotingSelectors.gridPivotPanelOpenSelector)(apiRef);
269
+ const newPanelOpen = typeof callback === 'function' ? callback(panelOpen) : callback;
270
+ if (panelOpen === newPanelOpen) {
271
+ return;
272
+ }
273
+ if (newPanelOpen) {
274
+ apiRef.current.showSidebar(_sidebar.GridSidebarValue.Pivot);
275
+ } else {
276
+ apiRef.current.hideSidebar();
277
+ }
266
278
  }, [apiRef, isPivotingAvailable]);
267
279
  const addColumnMenuButton = React.useCallback(menuItems => {
268
280
  if (isPivotingAvailable) {
@@ -318,6 +330,13 @@ const useGridPivoting = (apiRef, props, originalColumnsProp, originalRowsProp) =
318
330
  });
319
331
  });
320
332
  }, [apiRef, computePivotingState, isPivotingAvailable, nonPivotDataRef]);
333
+ const addPivotingPanel = React.useCallback((initialValue, value) => {
334
+ if (isPivotingAvailable && value === _sidebar.GridSidebarValue.Pivot) {
335
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pivotPanel.GridPivotPanel, {});
336
+ }
337
+ return initialValue;
338
+ }, [isPivotingAvailable]);
339
+ (0, _internals.useGridRegisterPipeProcessor)(apiRef, 'sidebar', addPivotingPanel);
321
340
  (0, _internals.useGridApiMethod)(apiRef, {
322
341
  setPivotModel,
323
342
  setPivotActive,
@@ -1,8 +1,7 @@
1
1
  import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridColDef, GridGroupingColDefOverride } from '@mui/x-data-grid-pro';
3
- import { GridColumnRawLookup } from '@mui/x-data-grid-pro/internals';
3
+ import { GridColumnRawLookup, RowGroupingStrategy } from '@mui/x-data-grid-pro/internals';
4
4
  import { GridApiPremium } from "../../../models/gridApiPremium.js";
5
- import { RowGroupingStrategy } from "./gridRowGroupingUtils.js";
6
5
  interface CreateGroupingColDefMonoCriteriaParams {
7
6
  columnsLookup: GridColumnRawLookup;
8
7
  /**
@@ -73,7 +73,14 @@ const getLeafProperties = leafColDef => ({
73
73
  return groupingFieldIndexComparator(v1, v2, cellParams1, cellParams2);
74
74
  }
75
75
  });
76
- const groupedByColValueFormatter = groupedByColDef => (value, row, _, apiRef) => groupedByColDef.valueFormatter(value, row, groupedByColDef, apiRef);
76
+ const groupedByColValueFormatter = groupedByColDef => (value, row, _, apiRef) => {
77
+ const rowId = (0, _xDataGridPro.gridRowIdSelector)(apiRef, row);
78
+ const rowNode = (0, _xDataGridPro.gridRowNodeSelector)(apiRef, rowId);
79
+ if (rowNode.type === 'group' && rowNode.groupingField === groupedByColDef.field) {
80
+ return groupedByColDef.valueFormatter(value, row, groupedByColDef, apiRef);
81
+ }
82
+ return value;
83
+ };
77
84
  const getGroupingCriteriaProperties = (groupedByColDef, applyHeaderName) => {
78
85
  const properties = {
79
86
  sortable: groupedByColDef.sortable,
@@ -103,7 +110,7 @@ const createGroupingColDefForOneGroupingCriteria = ({
103
110
  groupedByColDef,
104
111
  groupingCriteria,
105
112
  colDefOverride,
106
- strategy = _gridRowGroupingUtils.RowGroupingStrategy.Default
113
+ strategy = _internals.RowGroupingStrategy.Default
107
114
  }) => {
108
115
  const _ref = colDefOverride ?? {},
109
116
  {
@@ -113,7 +120,7 @@ const createGroupingColDefForOneGroupingCriteria = ({
113
120
  } = _ref,
114
121
  colDefOverrideProperties = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
115
122
  const leafColDef = leafField ? columnsLookup[leafField] : null;
116
- const CriteriaCell = strategy === _gridRowGroupingUtils.RowGroupingStrategy.Default ? _GridGroupingCriteriaCell.GridGroupingCriteriaCell : _GridDataSourceGroupingCriteriaCell.GridDataSourceGroupingCriteriaCell;
123
+ const CriteriaCell = strategy === _internals.RowGroupingStrategy.Default ? _GridGroupingCriteriaCell.GridGroupingCriteriaCell : _GridDataSourceGroupingCriteriaCell.GridDataSourceGroupingCriteriaCell;
117
124
 
118
125
  // The properties that do not depend on the presence of a `leafColDef` and that can be overridden by `colDefOverride`
119
126
  const commonProperties = {
@@ -198,7 +205,7 @@ const createGroupingColDefForAllGroupingCriteria = ({
198
205
  columnsLookup,
199
206
  rowGroupingModel,
200
207
  colDefOverride,
201
- strategy = _gridRowGroupingUtils.RowGroupingStrategy.Default
208
+ strategy = _internals.RowGroupingStrategy.Default
202
209
  }) => {
203
210
  const _ref2 = colDefOverride ?? {},
204
211
  {
@@ -208,7 +215,7 @@ const createGroupingColDefForAllGroupingCriteria = ({
208
215
  } = _ref2,
209
216
  colDefOverrideProperties = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded2);
210
217
  const leafColDef = leafField ? columnsLookup[leafField] : null;
211
- const CriteriaCell = strategy === _gridRowGroupingUtils.RowGroupingStrategy.Default ? _GridGroupingCriteriaCell.GridGroupingCriteriaCell : _GridDataSourceGroupingCriteriaCell.GridDataSourceGroupingCriteriaCell;
218
+ const CriteriaCell = strategy === _internals.RowGroupingStrategy.Default ? _GridGroupingCriteriaCell.GridGroupingCriteriaCell : _GridDataSourceGroupingCriteriaCell.GridDataSourceGroupingCriteriaCell;
212
219
 
213
220
  // The properties that do not depend on the presence of a `leafColDef` and that can be overridden by `colDefOverride`
214
221
  const commonProperties = {
@@ -277,7 +284,7 @@ const createGroupingColDefForAllGroupingCriteria = ({
277
284
  // The properties that can't be overridden with `colDefOverride`
278
285
  const forcedProperties = (0, _extends2.default)({
279
286
  field: _gridRowGroupingUtils.GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD
280
- }, strategy === _gridRowGroupingUtils.RowGroupingStrategy.Default ? GROUPING_COL_DEF_FORCED_PROPERTIES_DEFAULT : GROUPING_COL_DEF_FORCED_PROPERTIES_DATA_SOURCE);
287
+ }, strategy === _internals.RowGroupingStrategy.Default ? GROUPING_COL_DEF_FORCED_PROPERTIES_DEFAULT : GROUPING_COL_DEF_FORCED_PROPERTIES_DATA_SOURCE);
281
288
  return (0, _extends2.default)({}, GROUPING_COL_DEF_DEFAULT_PROPERTIES, commonProperties, sourceProperties, colDefOverrideProperties, forcedProperties);
282
289
  };
283
290
  exports.createGroupingColDefForAllGroupingCriteria = createGroupingColDefForAllGroupingCriteria;
@@ -1,15 +1,11 @@
1
1
  import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridRowTreeConfig, GridFilterState, GridFilterModel, GridRowModel, GridColDef, GridKeyValue, GridDataSource } from '@mui/x-data-grid-pro';
3
- import { GridAggregatedFilterItemApplier, GridColumnRawLookup, GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, getRowGroupingCriteriaFromGroupingField, isGroupingColumn } from '@mui/x-data-grid-pro/internals';
3
+ import { GridAggregatedFilterItemApplier, GridColumnRawLookup, GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, getRowGroupingCriteriaFromGroupingField, isGroupingColumn, RowGroupingStrategy } from '@mui/x-data-grid-pro/internals';
4
4
  import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
5
5
  import { GridGroupingRule, GridGroupingRules, GridRowGroupingModel } from "./gridRowGroupingInterfaces.js";
6
6
  import { GridStatePremium } from "../../../models/gridStatePremium.js";
7
7
  import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
8
8
  export { GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, getRowGroupingCriteriaFromGroupingField, isGroupingColumn };
9
- export declare enum RowGroupingStrategy {
10
- Default = "grouping-columns",
11
- DataSource = "grouping-columns-data-source",
12
- }
13
9
  export declare const getRowGroupingFieldFromGroupingCriteria: (groupingCriteria: string | null) => string;
14
10
  interface FilterRowTreeFromTreeDataParams {
15
11
  rowTree: GridRowTreeConfig;
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD", {
10
10
  return _internals.GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD;
11
11
  }
12
12
  });
13
- exports.getGroupingRules = exports.getColDefOverrides = exports.getCellGroupingCriteria = exports.filterRowTreeFromGroupingColumns = exports.areGroupingRulesEqual = exports.RowGroupingStrategy = void 0;
13
+ exports.getGroupingRules = exports.getColDefOverrides = exports.getCellGroupingCriteria = exports.filterRowTreeFromGroupingColumns = exports.areGroupingRulesEqual = void 0;
14
14
  Object.defineProperty(exports, "getRowGroupingCriteriaFromGroupingField", {
15
15
  enumerable: true,
16
16
  get: function () {
@@ -28,11 +28,6 @@ exports.setStrategyAvailability = exports.mergeStateWithRowGroupingModel = void
28
28
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
29
29
  var _internals = require("@mui/x-data-grid-pro/internals");
30
30
  var _gridRowGroupingSelector = require("./gridRowGroupingSelector");
31
- let RowGroupingStrategy = exports.RowGroupingStrategy = /*#__PURE__*/function (RowGroupingStrategy) {
32
- RowGroupingStrategy["Default"] = "grouping-columns";
33
- RowGroupingStrategy["DataSource"] = "grouping-columns-data-source";
34
- return RowGroupingStrategy;
35
- }({});
36
31
  const getRowGroupingFieldFromGroupingCriteria = groupingCriteria => {
37
32
  if (groupingCriteria === null) {
38
33
  return _internals.GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD;
@@ -132,7 +127,7 @@ exports.filterRowTreeFromGroupingColumns = filterRowTreeFromGroupingColumns;
132
127
  const getColDefOverrides = (groupingColDefProp, fields, strategy) => {
133
128
  if (typeof groupingColDefProp === 'function') {
134
129
  return groupingColDefProp({
135
- groupingName: strategy ?? RowGroupingStrategy.Default,
130
+ groupingName: strategy ?? _internals.RowGroupingStrategy.Default,
136
131
  fields
137
132
  });
138
133
  }
@@ -146,7 +141,7 @@ const mergeStateWithRowGroupingModel = rowGroupingModel => state => (0, _extends
146
141
  });
147
142
  exports.mergeStateWithRowGroupingModel = mergeStateWithRowGroupingModel;
148
143
  const setStrategyAvailability = (privateApiRef, disableRowGrouping, dataSource) => {
149
- const strategy = dataSource ? RowGroupingStrategy.DataSource : RowGroupingStrategy.Default;
144
+ const strategy = dataSource ? _internals.RowGroupingStrategy.DataSource : _internals.RowGroupingStrategy.Default;
150
145
  if (privateApiRef.current.getActiveStrategy(_internals.GridStrategyGroup.RowTree) === strategy) {
151
146
  // If the strategy is already active, we don't need to set it again
152
147
  return;
@@ -45,7 +45,7 @@ const useGridDataSourceRowGroupingPreProcessors = (apiRef, props) => {
45
45
  nodes: params.updates.rows.map(getRowTreeBuilderNode),
46
46
  defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
47
47
  isGroupExpandedByDefault: props.isGroupExpandedByDefault,
48
- groupingName: _gridRowGroupingUtils.RowGroupingStrategy.DataSource
48
+ groupingName: _internals.RowGroupingStrategy.DataSource
49
49
  });
50
50
  }
51
51
  return (0, _internals.updateRowTree)({
@@ -59,7 +59,7 @@ const useGridDataSourceRowGroupingPreProcessors = (apiRef, props) => {
59
59
  previousTreeDepth: params.previousTreeDepths,
60
60
  defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
61
61
  isGroupExpandedByDefault: props.isGroupExpandedByDefault,
62
- groupingName: _gridRowGroupingUtils.RowGroupingStrategy.DataSource
62
+ groupingName: _internals.RowGroupingStrategy.DataSource
63
63
  });
64
64
  }, [apiRef, props.dataSource, props.defaultGroupingExpansionDepth, props.isGroupExpandedByDefault]);
65
65
  const filterRows = React.useCallback(() => {
@@ -70,9 +70,9 @@ const useGridDataSourceRowGroupingPreProcessors = (apiRef, props) => {
70
70
  const rowTree = (0, _xDataGridPro.gridRowTreeSelector)(apiRef);
71
71
  return (0, _internals.skipSorting)(rowTree);
72
72
  }, [apiRef]);
73
- (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.RowGroupingStrategy.DataSource, 'rowTreeCreation', createRowTreeForRowGrouping);
74
- (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.RowGroupingStrategy.DataSource, 'filtering', filterRows);
75
- (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.RowGroupingStrategy.DataSource, 'sorting', sortRows);
76
- (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.RowGroupingStrategy.DataSource, 'visibleRowsLookupCreation', _internals.getVisibleRowsLookup);
73
+ (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _internals.RowGroupingStrategy.DataSource, 'rowTreeCreation', createRowTreeForRowGrouping);
74
+ (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _internals.RowGroupingStrategy.DataSource, 'filtering', filterRows);
75
+ (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _internals.RowGroupingStrategy.DataSource, 'sorting', sortRows);
76
+ (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _internals.RowGroupingStrategy.DataSource, 'visibleRowsLookupCreation', _internals.getVisibleRowsLookup);
77
77
  };
78
78
  exports.useGridDataSourceRowGroupingPreProcessors = useGridDataSourceRowGroupingPreProcessors;
@@ -171,7 +171,7 @@ const useGridRowGrouping = (apiRef, props) => {
171
171
 
172
172
  // Refresh the row tree creation strategy processing
173
173
  // TODO: Add a clean way to re-run a strategy processing without publishing a private event
174
- if (apiRef.current.getActiveStrategy(_internals.GridStrategyGroup.RowTree) === _gridRowGroupingUtils.RowGroupingStrategy.Default) {
174
+ if (apiRef.current.getActiveStrategy(_internals.GridStrategyGroup.RowTree) === _internals.RowGroupingStrategy.Default) {
175
175
  apiRef.current.publishEvent('activeStrategyProcessorChange', 'rowTreeCreation');
176
176
  }
177
177
  }
@@ -17,7 +17,7 @@ const useGridRowGroupingPreProcessors = (apiRef, props) => {
17
17
  if (props.disableRowGrouping) {
18
18
  return [];
19
19
  }
20
- const strategy = props.dataSource ? _gridRowGroupingUtils.RowGroupingStrategy.DataSource : _gridRowGroupingUtils.RowGroupingStrategy.Default;
20
+ const strategy = props.dataSource ? _internals.RowGroupingStrategy.DataSource : _internals.RowGroupingStrategy.Default;
21
21
  const groupingColDefProp = props.groupingColDef;
22
22
 
23
23
  // We can't use `gridGroupingRowsSanitizedModelSelector` here because the new columns are not in the state yet
@@ -110,7 +110,7 @@ const useGridRowGroupingPreProcessors = (apiRef, props) => {
110
110
  nodes: params.updates.rows.map(getRowTreeBuilderNode),
111
111
  defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
112
112
  isGroupExpandedByDefault: props.isGroupExpandedByDefault,
113
- groupingName: _gridRowGroupingUtils.RowGroupingStrategy.Default
113
+ groupingName: _internals.RowGroupingStrategy.Default
114
114
  });
115
115
  }
116
116
  return (0, _internals.updateRowTree)({
@@ -123,7 +123,7 @@ const useGridRowGroupingPreProcessors = (apiRef, props) => {
123
123
  previousTreeDepth: params.previousTreeDepths,
124
124
  defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
125
125
  isGroupExpandedByDefault: props.isGroupExpandedByDefault,
126
- groupingName: _gridRowGroupingUtils.RowGroupingStrategy.Default
126
+ groupingName: _internals.RowGroupingStrategy.Default
127
127
  });
128
128
  }, [apiRef, props.defaultGroupingExpansionDepth, props.isGroupExpandedByDefault]);
129
129
  const filterRows = React.useCallback(params => {
@@ -145,10 +145,10 @@ const useGridRowGroupingPreProcessors = (apiRef, props) => {
145
145
  });
146
146
  }, [apiRef]);
147
147
  (0, _internals.useGridRegisterPipeProcessor)(apiRef, 'hydrateColumns', updateGroupingColumn);
148
- (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.RowGroupingStrategy.Default, 'rowTreeCreation', createRowTreeForRowGrouping);
149
- (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.RowGroupingStrategy.Default, 'filtering', filterRows);
150
- (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.RowGroupingStrategy.Default, 'sorting', sortRows);
151
- (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _gridRowGroupingUtils.RowGroupingStrategy.Default, 'visibleRowsLookupCreation', _internals.getVisibleRowsLookup);
148
+ (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _internals.RowGroupingStrategy.Default, 'rowTreeCreation', createRowTreeForRowGrouping);
149
+ (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _internals.RowGroupingStrategy.Default, 'filtering', filterRows);
150
+ (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _internals.RowGroupingStrategy.Default, 'sorting', sortRows);
151
+ (0, _internals.useGridRegisterStrategyProcessor)(apiRef, _internals.RowGroupingStrategy.Default, 'visibleRowsLookupCreation', _internals.getVisibleRowsLookup);
152
152
  (0, _xDataGridPro.useFirstRender)(() => {
153
153
  (0, _gridRowGroupingUtils.setStrategyAvailability)(apiRef, props.disableRowGrouping, props.dataSource);
154
154
  });
@@ -1 +1 @@
1
- export declare const useGridRowAriaAttributes: () => (rowNode: import("@mui/x-data-grid").GridTreeNode, index: number) => React.HTMLAttributes<HTMLElement>;
1
+ export declare const useGridRowAriaAttributesPremium: () => (rowNode: import("@mui/x-data-grid").GridTreeNode, index: number) => React.HTMLAttributes<HTMLElement>;
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useGridRowAriaAttributes = void 0;
6
+ exports.useGridRowAriaAttributesPremium = void 0;
7
7
  var _internals = require("@mui/x-data-grid-pro/internals");
8
8
  var _useGridPrivateApiContext = require("../../utils/useGridPrivateApiContext");
9
9
  var _gridRowGroupingSelector = require("../rowGrouping/gridRowGroupingSelector");
10
- const useGridRowAriaAttributes = () => {
10
+ const useGridRowAriaAttributesPremium = () => {
11
11
  const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
12
12
  const gridRowGroupingModel = (0, _internals.useGridSelector)(apiRef, _gridRowGroupingSelector.gridRowGroupingSanitizedModelSelector);
13
- return (0, _internals.useGridRowAriaAttributes)(gridRowGroupingModel.length > 0);
13
+ return (0, _internals.useGridRowAriaAttributesPro)(gridRowGroupingModel.length > 0);
14
14
  };
15
- exports.useGridRowAriaAttributes = useGridRowAriaAttributes;
15
+ exports.useGridRowAriaAttributesPremium = useGridRowAriaAttributesPremium;
@@ -0,0 +1,16 @@
1
+ export declare enum GridSidebarValue {
2
+ Pivot = "pivot",
3
+ }
4
+ export interface GridSidebarApi {
5
+ /**
6
+ * Displays the sidebar. The `newValue` argument controls the content of the sidebar.
7
+ * @param {GridSidebarValue} newValue The sidebar to open.
8
+ * @param {string} sidebarId The unique sidebar id
9
+ * @param {string} labelId The unique button id
10
+ */
11
+ showSidebar: (newValue: GridSidebarValue, sidebarId?: string, labelId?: string) => void;
12
+ /**
13
+ * Hides the sidebar.
14
+ */
15
+ hideSidebar: () => void;
16
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.GridSidebarValue = void 0;
7
+ let GridSidebarValue = exports.GridSidebarValue = /*#__PURE__*/function (GridSidebarValue) {
8
+ GridSidebarValue["Pivot"] = "pivot";
9
+ return GridSidebarValue;
10
+ }({});
@@ -0,0 +1,12 @@
1
+ import { GridStatePremium } from "../../../models/gridStatePremium.js";
2
+ export declare const gridSidebarStateSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, unknown, import("./gridSidebarState.js").GridSidebarState>;
3
+ export declare const gridSidebarOpenSelector: (args_0: import("react").RefObject<{
4
+ state: GridStatePremium;
5
+ } | null>) => boolean;
6
+ export declare const gridSidebarContentSelector: (args_0: import("react").RefObject<{
7
+ state: GridStatePremium;
8
+ } | null>) => {
9
+ sidebarId: string | undefined;
10
+ labelId: string | undefined;
11
+ value: import("./gridSidebarInterfaces.js").GridSidebarValue | undefined;
12
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.gridSidebarStateSelector = exports.gridSidebarOpenSelector = exports.gridSidebarContentSelector = void 0;
7
+ var _internals = require("@mui/x-data-grid-pro/internals");
8
+ const gridSidebarStateSelector = exports.gridSidebarStateSelector = (0, _internals.createRootSelector)(state => state.sidebar);
9
+ const gridSidebarOpenSelector = exports.gridSidebarOpenSelector = (0, _internals.createSelector)(gridSidebarStateSelector, state => state.open);
10
+ const gridSidebarContentSelector = exports.gridSidebarContentSelector = (0, _internals.createSelector)(gridSidebarStateSelector, ({
11
+ sidebarId,
12
+ labelId,
13
+ value
14
+ }) => ({
15
+ sidebarId,
16
+ labelId,
17
+ value
18
+ }));
@@ -0,0 +1,8 @@
1
+ import { GridSidebarValue } from "./gridSidebarInterfaces.js";
2
+ export interface GridSidebarState {
3
+ open: boolean;
4
+ sidebarId?: string;
5
+ labelId?: string;
6
+ value?: GridSidebarValue;
7
+ }
8
+ export type GridSidebarInitialState = GridSidebarState;