@mui/x-data-grid 7.0.0-beta.0 → 7.0.0-beta.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 (162) hide show
  1. package/CHANGELOG.md +406 -1
  2. package/DataGrid/DataGrid.d.ts +1 -1
  3. package/DataGrid/DataGrid.js +1 -1
  4. package/DataGrid/useDataGridComponent.js +1 -1
  5. package/DataGrid/useDataGridProps.js +3 -1
  6. package/colDef/gridBooleanColDef.js +3 -6
  7. package/colDef/gridCheckboxSelectionColDef.js +4 -3
  8. package/colDef/gridDateColDef.d.ts +3 -4
  9. package/colDef/gridDateColDef.js +10 -16
  10. package/colDef/gridNumericColDef.js +1 -3
  11. package/colDef/gridSingleSelectColDef.js +7 -12
  12. package/components/GridPagination.d.ts +1 -1
  13. package/components/GridPagination.js +12 -2
  14. package/components/GridRow.js +7 -5
  15. package/components/GridScrollbarFillerCell.js +0 -3
  16. package/components/base/GridFooterPlaceholder.js +1 -1
  17. package/components/cell/GridActionsCell.js +3 -3
  18. package/components/cell/GridActionsCellItem.d.ts +13 -1
  19. package/components/cell/GridActionsCellItem.js +27 -15
  20. package/components/cell/GridEditInputCell.js +1 -1
  21. package/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
  22. package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
  23. package/components/columnsManagement/GridColumnsManagement.d.ts +7 -0
  24. package/components/columnsManagement/GridColumnsManagement.js +26 -21
  25. package/components/columnsManagement/utils.d.ts +1 -1
  26. package/components/containers/GridRootStyles.js +10 -2
  27. package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  28. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
  29. package/components/panel/filterPanel/GridFilterPanel.js +1 -1
  30. package/constants/gridClasses.d.ts +5 -0
  31. package/constants/gridClasses.js +1 -1
  32. package/hooks/features/columns/useGridColumnSpanning.js +3 -1
  33. package/hooks/features/editing/useGridCellEditing.js +2 -5
  34. package/hooks/features/editing/useGridRowEditing.js +2 -5
  35. package/hooks/features/filter/gridFilterUtils.js +1 -1
  36. package/hooks/features/rows/gridRowsUtils.js +1 -1
  37. package/hooks/features/rows/useGridParamsApi.d.ts +1 -2
  38. package/hooks/features/rows/useGridParamsApi.js +14 -49
  39. package/hooks/features/rows/useGridRows.js +2 -2
  40. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -1
  41. package/hooks/features/virtualization/useGridVirtualScroller.js +9 -10
  42. package/index.js +1 -1
  43. package/internals/utils/propValidation.js +1 -1
  44. package/joy/joySlots.js +2 -2
  45. package/legacy/DataGrid/DataGrid.js +1 -1
  46. package/legacy/DataGrid/useDataGridComponent.js +1 -1
  47. package/legacy/DataGrid/useDataGridProps.js +3 -1
  48. package/legacy/colDef/gridBooleanColDef.js +3 -5
  49. package/legacy/colDef/gridCheckboxSelectionColDef.js +4 -3
  50. package/legacy/colDef/gridDateColDef.js +10 -14
  51. package/legacy/colDef/gridNumericColDef.js +1 -2
  52. package/legacy/colDef/gridSingleSelectColDef.js +7 -10
  53. package/legacy/components/GridPagination.js +10 -2
  54. package/legacy/components/GridRow.js +7 -5
  55. package/legacy/components/GridScrollbarFillerCell.js +1 -3
  56. package/legacy/components/base/GridFooterPlaceholder.js +1 -1
  57. package/legacy/components/cell/GridActionsCell.js +3 -3
  58. package/legacy/components/cell/GridActionsCellItem.js +30 -17
  59. package/legacy/components/cell/GridEditInputCell.js +1 -1
  60. package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
  61. package/legacy/components/columnsManagement/GridColumnsManagement.js +38 -31
  62. package/legacy/components/containers/GridRootStyles.js +9 -3
  63. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  64. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
  65. package/legacy/components/panel/filterPanel/GridFilterPanel.js +1 -1
  66. package/legacy/constants/gridClasses.js +1 -1
  67. package/legacy/hooks/features/columns/useGridColumnSpanning.js +3 -1
  68. package/legacy/hooks/features/editing/useGridCellEditing.js +2 -5
  69. package/legacy/hooks/features/editing/useGridRowEditing.js +2 -5
  70. package/legacy/hooks/features/filter/gridFilterUtils.js +2 -2
  71. package/legacy/hooks/features/rows/gridRowsUtils.js +1 -1
  72. package/legacy/hooks/features/rows/useGridParamsApi.js +14 -47
  73. package/legacy/hooks/features/rows/useGridRows.js +2 -2
  74. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +9 -10
  75. package/legacy/index.js +1 -1
  76. package/legacy/internals/utils/propValidation.js +1 -1
  77. package/legacy/joy/joySlots.js +2 -2
  78. package/legacy/locales/daDK.js +12 -12
  79. package/legacy/locales/heIL.js +7 -8
  80. package/locales/daDK.js +12 -12
  81. package/locales/heIL.js +7 -8
  82. package/models/api/gridApiCommon.d.ts +1 -1
  83. package/models/api/gridFilterApi.d.ts +1 -1
  84. package/models/api/gridLocaleTextApi.d.ts +3 -3
  85. package/models/colDef/gridColDef.d.ts +11 -17
  86. package/models/colDef/index.d.ts +1 -1
  87. package/models/events/gridEventLookup.d.ts +1 -1
  88. package/models/gridSlotsComponent.d.ts +34 -36
  89. package/models/gridSlotsComponentsProps.d.ts +73 -54
  90. package/models/params/gridCellParams.d.ts +0 -26
  91. package/models/props/DataGridProps.d.ts +2 -2
  92. package/modern/DataGrid/DataGrid.js +1 -1
  93. package/modern/DataGrid/useDataGridComponent.js +1 -1
  94. package/modern/DataGrid/useDataGridProps.js +3 -1
  95. package/modern/colDef/gridBooleanColDef.js +3 -6
  96. package/modern/colDef/gridCheckboxSelectionColDef.js +4 -3
  97. package/modern/colDef/gridDateColDef.js +10 -16
  98. package/modern/colDef/gridNumericColDef.js +1 -3
  99. package/modern/colDef/gridSingleSelectColDef.js +7 -12
  100. package/modern/components/GridPagination.js +12 -2
  101. package/modern/components/GridRow.js +6 -5
  102. package/modern/components/GridScrollbarFillerCell.js +0 -3
  103. package/modern/components/base/GridFooterPlaceholder.js +1 -1
  104. package/modern/components/cell/GridActionsCell.js +3 -3
  105. package/modern/components/cell/GridActionsCellItem.js +27 -15
  106. package/modern/components/cell/GridEditInputCell.js +1 -1
  107. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
  108. package/modern/components/columnsManagement/GridColumnsManagement.js +26 -21
  109. package/modern/components/containers/GridRootStyles.js +10 -2
  110. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  111. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
  112. package/modern/components/panel/filterPanel/GridFilterPanel.js +1 -1
  113. package/modern/constants/gridClasses.js +1 -1
  114. package/modern/hooks/features/columns/useGridColumnSpanning.js +3 -1
  115. package/modern/hooks/features/editing/useGridCellEditing.js +2 -5
  116. package/modern/hooks/features/editing/useGridRowEditing.js +2 -5
  117. package/modern/hooks/features/filter/gridFilterUtils.js +1 -1
  118. package/modern/hooks/features/rows/gridRowsUtils.js +1 -1
  119. package/modern/hooks/features/rows/useGridParamsApi.js +14 -47
  120. package/modern/hooks/features/rows/useGridRows.js +2 -2
  121. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +9 -10
  122. package/modern/index.js +1 -1
  123. package/modern/internals/utils/propValidation.js +1 -1
  124. package/modern/joy/joySlots.js +2 -2
  125. package/modern/locales/daDK.js +12 -12
  126. package/modern/locales/heIL.js +7 -8
  127. package/node/DataGrid/DataGrid.js +1 -1
  128. package/node/DataGrid/useDataGridComponent.js +1 -1
  129. package/node/DataGrid/useDataGridProps.js +3 -1
  130. package/node/colDef/gridBooleanColDef.js +3 -6
  131. package/node/colDef/gridCheckboxSelectionColDef.js +4 -3
  132. package/node/colDef/gridDateColDef.js +13 -19
  133. package/node/colDef/gridNumericColDef.js +1 -3
  134. package/node/colDef/gridSingleSelectColDef.js +7 -12
  135. package/node/components/GridPagination.js +12 -2
  136. package/node/components/GridRow.js +6 -5
  137. package/node/components/GridScrollbarFillerCell.js +0 -3
  138. package/node/components/base/GridFooterPlaceholder.js +1 -1
  139. package/node/components/cell/GridActionsCell.js +3 -3
  140. package/node/components/cell/GridActionsCellItem.js +27 -15
  141. package/node/components/cell/GridEditInputCell.js +1 -1
  142. package/node/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
  143. package/node/components/columnsManagement/GridColumnsManagement.js +26 -21
  144. package/node/components/containers/GridRootStyles.js +10 -2
  145. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  146. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
  147. package/node/components/panel/filterPanel/GridFilterPanel.js +1 -1
  148. package/node/constants/gridClasses.js +1 -1
  149. package/node/hooks/features/columns/useGridColumnSpanning.js +3 -1
  150. package/node/hooks/features/editing/useGridCellEditing.js +2 -5
  151. package/node/hooks/features/editing/useGridRowEditing.js +2 -5
  152. package/node/hooks/features/filter/gridFilterUtils.js +1 -1
  153. package/node/hooks/features/rows/gridRowsUtils.js +2 -2
  154. package/node/hooks/features/rows/useGridParamsApi.js +14 -47
  155. package/node/hooks/features/rows/useGridRows.js +2 -2
  156. package/node/hooks/features/virtualization/useGridVirtualScroller.js +9 -10
  157. package/node/index.js +1 -1
  158. package/node/internals/utils/propValidation.js +1 -1
  159. package/node/joy/joySlots.js +2 -2
  160. package/node/locales/daDK.js +12 -12
  161. package/node/locales/heIL.js +7 -8
  162. package/package.json +5 -5
package/locales/daDK.js CHANGED
@@ -11,8 +11,8 @@ const daDKGrid = {
11
11
  toolbarDensityStandard: 'Standard',
12
12
  toolbarDensityComfortable: 'Luftig',
13
13
  // Columns selector toolbar button text
14
- toolbarColumns: 'Kolonne',
15
- toolbarColumnsLabel: 'Vælg kolonne',
14
+ toolbarColumns: 'Kolonner',
15
+ toolbarColumnsLabel: 'Vælg kolonner',
16
16
  // Filters toolbar button text
17
17
  toolbarFilters: 'Filtre',
18
18
  toolbarFiltersLabel: 'Vis filtre',
@@ -39,12 +39,12 @@ const daDKGrid = {
39
39
  filterPanelRemoveAll: 'Fjern alle',
40
40
  filterPanelDeleteIconLabel: 'Slet',
41
41
  filterPanelLogicOperator: 'Logisk operator',
42
- filterPanelOperator: 'Operatorer',
42
+ filterPanelOperator: 'Operator',
43
43
  filterPanelOperatorAnd: 'Og',
44
44
  filterPanelOperatorOr: 'Eller',
45
- filterPanelColumns: 'Kolonne',
45
+ filterPanelColumns: 'Kolonner',
46
46
  filterPanelInputLabel: 'Værdi',
47
- filterPanelInputPlaceholder: 'Filter værdi',
47
+ filterPanelInputPlaceholder: 'Filterværdi',
48
48
  // Filter operators text
49
49
  filterOperatorContains: 'indeholder',
50
50
  filterOperatorEquals: 'lig med',
@@ -91,10 +91,10 @@ const daDKGrid = {
91
91
  filterValueFalse: 'negativ',
92
92
  // Column menu text
93
93
  columnMenuLabel: 'Menu',
94
- columnMenuShowColumns: 'Vis Kolonner',
94
+ columnMenuShowColumns: 'Vis kolonner',
95
95
  columnMenuManageColumns: 'Administrer kolonner',
96
- columnMenuFilter: 'Filtre',
97
- columnMenuHideColumn: 'Skjul',
96
+ columnMenuFilter: 'Filtrer',
97
+ columnMenuHideColumn: 'Skjul kolonne',
98
98
  columnMenuUnsort: 'Fjern sortering',
99
99
  columnMenuSortAsc: 'Sorter stigende',
100
100
  columnMenuSortDesc: 'Sorter faldende',
@@ -124,13 +124,13 @@ const daDKGrid = {
124
124
  pinToRight: 'Fastgør til højre',
125
125
  unpin: 'Frigiv',
126
126
  // Tree Data
127
- treeDataGroupingHeaderName: 'Gruppering',
127
+ treeDataGroupingHeaderName: 'Gruppe',
128
128
  treeDataExpand: 'Vis underelementer',
129
129
  treeDataCollapse: 'Skjul underelementer',
130
130
  // Grouping columns
131
- groupingColumnHeaderName: 'Gruppér',
131
+ groupingColumnHeaderName: 'Gruppe',
132
132
  groupColumn: name => `Gruppér efter ${name}`,
133
- unGroupColumn: name => `Fjern gruppéring efter ${name}`,
133
+ unGroupColumn: name => `Fjern gruppering efter ${name}`,
134
134
  // Master/detail
135
135
  detailPanelToggle: 'Udvid/kollaps detaljepanel',
136
136
  expandDetailPanel: 'Udvid',
@@ -138,7 +138,7 @@ const daDKGrid = {
138
138
  // Row reordering text
139
139
  rowReorderingHeaderName: 'Omarrangering af rækker',
140
140
  // Aggregation
141
- aggregationMenuItemHeader: 'Aggregation',
141
+ aggregationMenuItemHeader: 'Aggregering',
142
142
  aggregationFunctionLabelSum: 'sum',
143
143
  aggregationFunctionLabelAvg: 'gns',
144
144
  aggregationFunctionLabelMin: 'min',
package/locales/heIL.js CHANGED
@@ -59,13 +59,12 @@ const heILGrid = {
59
59
  filterOperatorIsEmpty: 'ריק',
60
60
  filterOperatorIsNotEmpty: 'אינו ריק',
61
61
  filterOperatorIsAnyOf: 'הוא אחד מ-',
62
- // 'filterOperator=': '=',
63
- // 'filterOperator!=': '!=',
64
- // 'filterOperator>': '>',
65
- // 'filterOperator>=': '>=',
66
- // 'filterOperator<': '<',
67
- // 'filterOperator<=': '<=',
68
-
62
+ 'filterOperator=': '=',
63
+ 'filterOperator!=': '!=',
64
+ 'filterOperator>': '>',
65
+ 'filterOperator>=': '>=',
66
+ 'filterOperator<': '<',
67
+ 'filterOperator<=': '<=',
69
68
  // Header filter operators text
70
69
  headerFilterOperatorContains: 'מכיל',
71
70
  headerFilterOperatorEquals: 'שווה',
@@ -133,7 +132,7 @@ const heILGrid = {
133
132
  groupColumn: name => `קבץ לפי ${name}`,
134
133
  unGroupColumn: name => `הפסק לקבץ לפי ${name}`,
135
134
  // Master/detail
136
- // detailPanelToggle: 'Detail panel toggle',
135
+ detailPanelToggle: 'הצג/הסתר פרטים',
137
136
  expandDetailPanel: 'הרחב',
138
137
  collapseDetailPanel: 'כווץ',
139
138
  // Row reordering text
@@ -4,7 +4,7 @@ import { GridCoreApi, GridCorePrivateApi } from './gridCoreApi';
4
4
  import { GridCsvExportApi } from './gridCsvExportApi';
5
5
  import { GridDensityApi } from './gridDensityApi';
6
6
  import { GridEditingApi, GridEditingPrivateApi } from './gridEditingApi';
7
- import { GridFilterApi } from './gridFilterApi';
7
+ import type { GridFilterApi } from './gridFilterApi';
8
8
  import { GridFocusApi, GridFocusPrivateApi } from './gridFocusApi';
9
9
  import { GridLocaleTextApi } from './gridLocaleTextApi';
10
10
  import type { GridParamsApi } from './gridParamsApi';
@@ -1,7 +1,7 @@
1
1
  import { GridFilterModel } from '../gridFilterModel';
2
2
  import { GridFilterItem, GridLogicOperator } from '../gridFilterItem';
3
3
  import { GridControlledStateReasonLookup } from '../events';
4
- import { DataGridProcessedProps } from '../props/DataGridProps';
4
+ import type { DataGridProcessedProps } from '../props/DataGridProps';
5
5
  /**
6
6
  * The filter API interface that is available in the grid [[apiRef]].
7
7
  */
@@ -27,9 +27,9 @@ export interface GridLocaleText {
27
27
  toolbarExportCSV: React.ReactNode;
28
28
  toolbarExportPrint: React.ReactNode;
29
29
  toolbarExportExcel: string;
30
- columnsManagementSearchTitle: React.ReactNode;
31
- columnsManagementNoColumns: React.ReactNode;
32
- columnsManagementShowHideAllText: React.ReactNode;
30
+ columnsManagementSearchTitle: string;
31
+ columnsManagementNoColumns: string;
32
+ columnsManagementShowHideAllText: string;
33
33
  filterPanelAddFilter: React.ReactNode;
34
34
  filterPanelRemoveAll: React.ReactNode;
35
35
  filterPanelDeleteIconLabel: string;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { GridCellClassNamePropType } from '../gridCellClass';
3
3
  import { GridColumnHeaderClassNamePropType } from '../gridColumnHeaderClass';
4
4
  import type { GridFilterOperator } from '../gridFilterOperator';
5
- import { GridCellParams, GridRenderCellParams, GridRenderEditCellParams, GridValueFormatterParams, GridValueGetterParams, GridValueSetterParams, GridPreProcessEditCellProps } from '../params/gridCellParams';
5
+ import { GridRenderCellParams, GridRenderEditCellParams, GridPreProcessEditCellProps } from '../params/gridCellParams';
6
6
  import { GridColumnHeaderParams } from '../params/gridColumnHeaderParams';
7
7
  import { GridComparatorFn, GridSortDirection } from '../gridSortModel';
8
8
  import { GridColType } from './gridColType';
@@ -26,6 +26,11 @@ export type ValueOptions = string | number | {
26
26
  export type GridKeyValue = string | number | boolean;
27
27
  export type GridApplyQuickFilter<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: V, row: R, column: GridColDef, apiRef: React.MutableRefObject<GridApiCommunity>) => boolean;
28
28
  export type GetApplyQuickFilterFn<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: any, colDef: GridStateColDef<R, V>, apiRef: React.MutableRefObject<GridApiCommunity>) => null | GridApplyQuickFilter<R, V>;
29
+ export type GridValueGetter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V, TValue = never> = (value: TValue, row: R, column: GridColDef<R, V, F>, apiRef: React.MutableRefObject<GridApiCommunity>) => V;
30
+ export type GridValueFormatter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V, TValue = never> = (value: TValue, row: R, column: GridColDef<R, V, F>, apiRef: React.MutableRefObject<GridApiCommunity>) => F;
31
+ export type GridValueSetter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: React.MutableRefObject<GridApiCommunity>) => R;
32
+ export type GridValueParser<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: F | undefined, row: R | undefined, column: GridColDef<R, V, F>, apiRef: React.MutableRefObject<GridApiCommunity>) => V;
33
+ export type GridColSpanFn<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: React.MutableRefObject<GridApiCommunity>) => number | undefined;
29
34
  /**
30
35
  * Column Definition base interface.
31
36
  */
@@ -115,34 +120,23 @@ export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel,
115
120
  align?: GridAlignment;
116
121
  /**
117
122
  * Function that allows to get a specific data instead of field to render in the cell.
118
- * @template R, V
119
- * @param {GridValueGetterParams<R, any>} params Object containing parameters for the getter.
120
- * @returns {V} The cell value.
121
123
  */
122
- valueGetter?: (params: GridValueGetterParams<R, any>) => V;
124
+ valueGetter?: GridValueGetter<R, V, F>;
123
125
  /**
124
126
  * Function that allows to customize how the entered value is stored in the row.
125
127
  * It only works with cell/row editing.
126
- * @template R, V
127
- * @param {GridValueSetterParams<R, V>} params Object containing parameters for the setter.
128
128
  * @returns {R} The row with the updated field.
129
129
  */
130
- valueSetter?: (params: GridValueSetterParams<R, V>) => R;
130
+ valueSetter?: GridValueSetter<R, V, F>;
131
131
  /**
132
132
  * Function that allows to apply a formatter before rendering its value.
133
- * @template V, F
134
- * @param {GridValueFormatterParams<V>} params Object containing parameters for the formatter.
135
- * @returns {F} The formatted value.
136
133
  */
137
- valueFormatter?: (params: GridValueFormatterParams<V>) => F;
134
+ valueFormatter?: GridValueFormatter<R, V, F>;
138
135
  /**
139
136
  * Function that takes the user-entered value and converts it to a value used internally.
140
- * @template R, V, F
141
- * @param {F | undefined} value The user-entered value.
142
- * @param {GridCellParams<R, V, F>} params The params when called before saving the value.
143
137
  * @returns {V} The converted value to use internally.
144
138
  */
145
- valueParser?: (value: F | undefined, params?: GridCellParams<R, V, F>) => V;
139
+ valueParser?: GridValueParser<R, V, F>;
146
140
  /**
147
141
  * Class name that will be added in cells for that column.
148
142
  */
@@ -224,7 +218,7 @@ export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel,
224
218
  * Number of columns a cell should span.
225
219
  * @default 1
226
220
  */
227
- colSpan?: number | ((params: GridCellParams<R, V, F>) => number | undefined);
221
+ colSpan?: number | GridColSpanFn<R, V, F>;
228
222
  }
229
223
  /**
230
224
  * Column Definition interface used for columns with the `actions` type.
@@ -1,3 +1,3 @@
1
- export type { GridAlignment, ValueOptions, GridKeyValue, GridColDef, GridColTypeDef, GridColumnsMeta, GridSingleSelectColDef, GridActionsColDef, GetApplyQuickFilterFn, } from './gridColDef';
1
+ export type { GridAlignment, ValueOptions, GridKeyValue, GridColDef, GridColTypeDef, GridColumnsMeta, GridSingleSelectColDef, GridActionsColDef, GetApplyQuickFilterFn, GridValueGetter, GridValueFormatter, GridValueSetter, GridValueParser, GridColSpanFn, } from './gridColDef';
2
2
  export * from './gridColType';
3
3
  export * from './gridColumnTypesRecord';
@@ -371,7 +371,7 @@ export interface GridControlledStateEventLookup {
371
371
  };
372
372
  }
373
373
  export interface GridControlledStateReasonLookup {
374
- filter: 'upsertFilterItem' | 'upsertFilterItems' | 'deleteFilterItem' | 'changeLogicOperator' | 'restoreState';
374
+ filter: 'upsertFilterItem' | 'upsertFilterItems' | 'deleteFilterItem' | 'changeLogicOperator' | 'restoreState' | 'removeAllFilterItems';
375
375
  pagination: 'setPaginationModel' | 'stateRestorePreProcessing';
376
376
  }
377
377
  export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEventLookup, GridHeaderFilterEventLookup, GridColumnGroupHeaderEventLookup, GridCellEventLookup, GridControlledStateEventLookup {
@@ -1,75 +1,73 @@
1
1
  import * as React from 'react';
2
+ import type { GridSlotProps } from './gridSlotsComponentsProps';
2
3
  import type { GridIconSlotsComponent } from './gridIconSlotsComponent';
3
- import type { GridRowProps } from '../components/GridRow';
4
- import type { GridDetailPanelsProps } from '../components/GridDetailPanels';
5
- import type { GridPinnedRowsProps } from '../components/GridPinnedRows';
6
- import type { GridColumnHeadersProps } from '../components/GridColumnHeaders';
4
+ export type { GridSlotProps } from './gridSlotsComponentsProps';
7
5
  export interface GridBaseSlots {
8
6
  /**
9
7
  * The custom Checkbox component used in the grid for both header and cells.
10
8
  * @default Checkbox
11
9
  */
12
- baseCheckbox: React.JSXElementConstructor<any>;
10
+ baseCheckbox: React.JSXElementConstructor<GridSlotProps['baseCheckbox']>;
13
11
  /**
14
12
  * The custom Chip component used in the grid.
15
13
  * @default Chip
16
14
  */
17
- baseChip: React.JSXElementConstructor<any>;
15
+ baseChip: React.JSXElementConstructor<GridSlotProps['baseChip']>;
18
16
  /**
19
17
  * The custom InputAdornment component used in the grid.
20
18
  * @default InputAdornment
21
19
  */
22
- baseInputAdornment: React.JSXElementConstructor<any>;
20
+ baseInputAdornment: React.JSXElementConstructor<GridSlotProps['baseInputAdornment']>;
23
21
  /**
24
22
  * The custom TextField component used in the grid.
25
23
  * @default TextField
26
24
  */
27
- baseTextField: React.JSXElementConstructor<any>;
25
+ baseTextField: React.JSXElementConstructor<GridSlotProps['baseTextField']>;
28
26
  /**
29
27
  * The custom FormControl component used in the grid.
30
28
  * @default FormControl
31
29
  */
32
- baseFormControl: React.JSXElementConstructor<any>;
30
+ baseFormControl: React.JSXElementConstructor<GridSlotProps['baseFormControl']>;
33
31
  /**
34
32
  * The custom Select component used in the grid.
35
33
  * @default Select
36
34
  */
37
- baseSelect: React.JSXElementConstructor<any>;
35
+ baseSelect: React.JSXElementConstructor<GridSlotProps['baseSelect']>;
38
36
  /**
39
37
  * The custom Switch component used in the grid.
40
38
  * @default Switch
41
39
  */
42
- baseSwitch: React.JSXElementConstructor<any>;
40
+ baseSwitch: React.JSXElementConstructor<GridSlotProps['baseSwitch']>;
43
41
  /**
44
42
  * The custom Button component used in the grid.
45
43
  * @default Button
46
44
  */
47
- baseButton: React.JSXElementConstructor<any>;
45
+ baseButton: React.JSXElementConstructor<GridSlotProps['baseButton']>;
48
46
  /**
49
47
  * The custom IconButton component used in the grid.
50
48
  * @default IconButton
51
49
  */
52
- baseIconButton: React.JSXElementConstructor<any>;
50
+ baseIconButton: React.JSXElementConstructor<GridSlotProps['baseIconButton']>;
53
51
  /**
54
52
  * The custom Tooltip component used in the grid.
55
53
  * @default Tooltip
56
54
  */
57
- baseTooltip: React.JSXElementConstructor<any>;
55
+ baseTooltip: React.JSXElementConstructor<GridSlotProps['baseTooltip']>;
58
56
  /**
59
57
  * The custom Popper component used in the grid.
60
58
  * @default Popper
61
59
  */
62
- basePopper: React.JSXElementConstructor<any>;
60
+ basePopper: React.JSXElementConstructor<GridSlotProps['basePopper']>;
63
61
  /**
64
62
  * The custom InputLabel component used in the grid.
65
63
  * @default InputLabel
66
64
  */
67
- baseInputLabel: React.JSXElementConstructor<any>;
65
+ baseInputLabel: React.JSXElementConstructor<GridSlotProps['baseInputLabel']>;
68
66
  /**
69
67
  * The custom SelectOption component used in the grid.
70
68
  * @default MenuItem
71
69
  */
72
- baseSelectOption: React.JSXElementConstructor<any>;
70
+ baseSelectOption: React.JSXElementConstructor<GridSlotProps['baseSelectOption']>;
73
71
  }
74
72
  /**
75
73
  * Grid components React prop interface containing all the overridable components.
@@ -79,87 +77,87 @@ export interface GridSlotsComponent extends GridBaseSlots, GridIconSlotsComponen
79
77
  * The custom Chip component used in the grid.
80
78
  * @default Chip
81
79
  */
82
- baseChip: React.JSXElementConstructor<any>;
80
+ baseChip: React.JSXElementConstructor<GridSlotProps['baseChip']>;
83
81
  /**
84
82
  * Component rendered for each cell.
85
83
  * @default GridCell
86
84
  */
87
- cell: React.JSXElementConstructor<any>;
85
+ cell: React.JSXElementConstructor<GridSlotProps['cell']>;
88
86
  /**
89
87
  * Component rendered for each skeleton cell.
90
88
  * @default GridSkeletonCell
91
89
  */
92
- skeletonCell: React.JSXElementConstructor<any>;
90
+ skeletonCell: React.JSXElementConstructor<GridSlotProps['skeletonCell']>;
93
91
  /**
94
92
  * Filter icon component rendered in each column header.
95
93
  * @default GridColumnHeaderFilterIconButton
96
94
  */
97
- columnHeaderFilterIconButton: React.JSXElementConstructor<any>;
95
+ columnHeaderFilterIconButton: React.JSXElementConstructor<GridSlotProps['columnHeaderFilterIconButton']>;
98
96
  /**
99
97
  * Column menu component rendered by clicking on the 3 dots "kebab" icon in column headers.
100
98
  * @default GridColumnMenu
101
99
  */
102
- columnMenu: React.JSXElementConstructor<any>;
100
+ columnMenu: React.JSXElementConstructor<GridSlotProps['columnMenu']>;
103
101
  /**
104
102
  * Component responsible for rendering the column headers.
105
103
  * @default DataGridColumnHeaders
106
104
  */
107
- columnHeaders: React.JSXElementConstructor<GridColumnHeadersProps>;
105
+ columnHeaders: React.JSXElementConstructor<GridSlotProps['columnHeaders']>;
108
106
  /**
109
107
  * Component responsible for rendering the detail panels.
110
108
  * @default GridDetailPanels
111
109
  */
112
- detailPanels: React.JSXElementConstructor<GridDetailPanelsProps>;
110
+ detailPanels: React.JSXElementConstructor<GridSlotProps['detailPanels']>;
113
111
  /**
114
112
  * Footer component rendered at the bottom of the grid viewport.
115
113
  * @default GridFooter
116
114
  */
117
- footer: React.JSXElementConstructor<any>;
115
+ footer: React.JSXElementConstructor<GridSlotProps['footer']>;
118
116
  /**
119
117
  * Row count component rendered in the footer
120
118
  * @default GridRowCount
121
119
  */
122
- footerRowCount: React.JSXElementConstructor<any>;
120
+ footerRowCount: React.JSXElementConstructor<GridSlotProps['footerRowCount']>;
123
121
  /**
124
122
  * Toolbar component rendered inside the Header component.
125
123
  * @default null
126
124
  */
127
- toolbar: React.JSXElementConstructor<any> | null;
125
+ toolbar: React.JSXElementConstructor<GridSlotProps['toolbar']> | null;
128
126
  /**
129
127
  * Pinned rows container.
130
128
  * @ignore - do not document
131
129
  */
132
- pinnedRows: React.JSXElementConstructor<GridPinnedRowsProps>;
130
+ pinnedRows: React.JSXElementConstructor<GridSlotProps['pinnedRows']>;
133
131
  /**
134
132
  * Loading overlay component rendered when the grid is in a loading state.
135
133
  * @default GridLoadingOverlay
136
134
  */
137
- loadingOverlay: React.JSXElementConstructor<any>;
135
+ loadingOverlay: React.JSXElementConstructor<GridSlotProps['loadingOverlay']>;
138
136
  /**
139
137
  * No results overlay component rendered when the grid has no results after filtering.
140
138
  * @default GridNoResultsOverlay
141
139
  */
142
- noResultsOverlay: React.JSXElementConstructor<any>;
140
+ noResultsOverlay: React.JSXElementConstructor<GridSlotProps['noResultsOverlay']>;
143
141
  /**
144
142
  * No rows overlay component rendered when the grid has no rows.
145
143
  * @default GridNoRowsOverlay
146
144
  */
147
- noRowsOverlay: React.JSXElementConstructor<any>;
145
+ noRowsOverlay: React.JSXElementConstructor<GridSlotProps['noRowsOverlay']>;
148
146
  /**
149
147
  * Pagination component rendered in the grid footer by default.
150
148
  * @default Pagination
151
149
  */
152
- pagination: React.JSXElementConstructor<any> | null;
150
+ pagination: React.JSXElementConstructor<GridSlotProps['pagination']> | null;
153
151
  /**
154
152
  * Filter panel component rendered when clicking the filter button.
155
153
  * @default GridFilterPanel
156
154
  */
157
- filterPanel: React.JSXElementConstructor<any>;
155
+ filterPanel: React.JSXElementConstructor<GridSlotProps['filterPanel']>;
158
156
  /**
159
157
  * GridColumns panel component rendered when clicking the columns button.
160
158
  * @default GridColumnsPanel
161
159
  */
162
- columnsPanel: React.JSXElementConstructor<any>;
160
+ columnsPanel: React.JSXElementConstructor<GridSlotProps['columnsPanel']>;
163
161
  /**
164
162
  * Component used inside Grid Columns panel to manage columns.
165
163
  * @default GridColumnsManagement
@@ -169,10 +167,10 @@ export interface GridSlotsComponent extends GridBaseSlots, GridIconSlotsComponen
169
167
  * Panel component wrapping the filters and columns panels.
170
168
  * @default GridPanel
171
169
  */
172
- panel: React.JSXElementConstructor<any>;
170
+ panel: React.JSXElementConstructor<GridSlotProps['panel']>;
173
171
  /**
174
172
  * Component rendered for each row.
175
173
  * @default GridRow
176
174
  */
177
- row: React.JSXElementConstructor<GridRowProps>;
175
+ row: React.JSXElementConstructor<GridSlotProps['row']>;
178
176
  }
@@ -1,26 +1,31 @@
1
1
  import * as React from 'react';
2
- import { CheckboxProps } from '@mui/material/Checkbox';
3
- import { TextFieldProps } from '@mui/material/TextField';
4
- import { FormControlProps } from '@mui/material/FormControl';
5
- import { SelectProps } from '@mui/material/Select';
6
- import { SwitchProps } from '@mui/material/Switch';
7
- import { ButtonProps } from '@mui/material/Button';
8
- import { IconButtonProps } from '@mui/material/IconButton';
9
- import { TooltipProps } from '@mui/material/Tooltip';
2
+ import type { CheckboxProps } from '@mui/material/Checkbox';
3
+ import type { TextFieldProps } from '@mui/material/TextField';
4
+ import type { FormControlProps } from '@mui/material/FormControl';
5
+ import type { SelectProps } from '@mui/material/Select';
6
+ import type { SwitchProps } from '@mui/material/Switch';
7
+ import type { ButtonProps } from '@mui/material/Button';
8
+ import type { IconButtonProps } from '@mui/material/IconButton';
9
+ import type { InputAdornmentProps } from '@mui/material/InputAdornment';
10
+ import type { TooltipProps } from '@mui/material/Tooltip';
10
11
  import type { InputLabelProps } from '@mui/material/InputLabel';
11
- import { PopperProps } from '@mui/material/Popper';
12
- import { TablePaginationProps } from '@mui/material/TablePagination';
13
- import { ChipProps } from '@mui/material/Chip';
14
- import { GridToolbarProps } from '../components/toolbar/GridToolbar';
15
- import { ColumnHeaderFilterIconButtonProps } from '../components/columnHeaders/GridColumnHeaderFilterIconButton';
16
- import { GridColumnMenuProps } from '../components/menu/columnMenu/GridColumnMenuProps';
17
- import { GridColumnsPanelProps } from '../components/panel/GridColumnsPanel';
18
- import { GridFilterPanelProps } from '../components/panel/filterPanel/GridFilterPanel';
19
- import { GridFooterContainerProps } from '../components/containers/GridFooterContainer';
20
- import { GridOverlayProps } from '../components/containers/GridOverlay';
21
- import { GridPanelProps } from '../components/panel/GridPanel';
12
+ import type { PopperProps } from '@mui/material/Popper';
13
+ import type { TablePaginationProps } from '@mui/material/TablePagination';
14
+ import type { ChipProps } from '@mui/material/Chip';
15
+ import type { GridToolbarProps } from '../components/toolbar/GridToolbar';
16
+ import type { ColumnHeaderFilterIconButtonProps } from '../components/columnHeaders/GridColumnHeaderFilterIconButton';
17
+ import type { GridColumnMenuProps } from '../components/menu/columnMenu/GridColumnMenuProps';
18
+ import type { GridColumnsPanelProps } from '../components/panel/GridColumnsPanel';
19
+ import type { GridFilterPanelProps } from '../components/panel/filterPanel/GridFilterPanel';
20
+ import type { GridFooterContainerProps } from '../components/containers/GridFooterContainer';
21
+ import type { GridOverlayProps } from '../components/containers/GridOverlay';
22
+ import type { GridPanelProps } from '../components/panel/GridPanel';
23
+ import type { GridSkeletonCellProps } from '../components/cell/GridSkeletonCell';
22
24
  import type { GridRowProps } from '../components/GridRow';
23
25
  import type { GridCellProps } from '../components/cell/GridCell';
26
+ import type { GridColumnHeadersProps } from '../components/GridColumnHeaders';
27
+ import type { GridDetailPanelsProps } from '../components/GridDetailPanels';
28
+ import type { GridPinnedRowsProps } from '../components/GridPinnedRows';
24
29
  import type { GridColumnsManagementProps } from '../components/columnsManagement/GridColumnsManagement';
25
30
  import type { GridRowCountProps } from '../components';
26
31
  export interface BaseCheckboxPropsOverrides {
@@ -37,6 +42,8 @@ export interface BaseButtonPropsOverrides {
37
42
  }
38
43
  export interface BaseIconButtonPropsOverrides {
39
44
  }
45
+ export interface BaseInputAdornmentPropsOverrides {
46
+ }
40
47
  export interface BaseTooltipPropsOverrides {
41
48
  }
42
49
  export interface BasePopperPropsOverrides {
@@ -57,6 +64,8 @@ export interface ColumnMenuPropsOverrides {
57
64
  }
58
65
  export interface ColumnsPanelPropsOverrides {
59
66
  }
67
+ export interface DetailPanelsPropsOverrides {
68
+ }
60
69
  export interface ColumnsManagementPropsOverrides {
61
70
  }
62
71
  export interface FilterPanelPropsOverrides {
@@ -75,43 +84,53 @@ export interface NoRowsOverlayPropsOverrides {
75
84
  }
76
85
  export interface PanelPropsOverrides {
77
86
  }
87
+ export interface PinnedRowsPropsOverrides {
88
+ }
89
+ export interface SkeletonCellPropsOverrides {
90
+ }
78
91
  export interface RowPropsOverrides {
79
92
  }
80
- type SlotProps<Props, Overrides> = Partial<Props & Overrides>;
81
- /**
82
- * Overridable components props dynamically passed to the component at rendering.
83
- */
84
- export interface GridSlotsComponentsProps {
85
- baseCheckbox?: SlotProps<CheckboxProps, BaseCheckboxPropsOverrides>;
86
- baseTextField?: SlotProps<TextFieldProps, BaseTextFieldPropsOverrides>;
87
- baseFormControl?: SlotProps<FormControlProps, BaseFormControlPropsOverrides>;
88
- baseSelect?: SlotProps<SelectProps, BaseSelectPropsOverrides>;
89
- baseSwitch?: SlotProps<SwitchProps, BaseSwitchPropsOverrides>;
90
- baseButton?: SlotProps<ButtonProps, BaseButtonPropsOverrides>;
91
- baseIconButton?: SlotProps<IconButtonProps, BaseIconButtonPropsOverrides>;
92
- basePopper?: SlotProps<PopperProps, BasePopperPropsOverrides>;
93
- baseTooltip?: SlotProps<TooltipProps, BaseTooltipPropsOverrides>;
94
- baseInputLabel?: SlotProps<InputLabelProps, BaseInputLabelPropsOverrides>;
95
- baseSelectOption?: SlotProps<{
93
+ export interface GridSlotProps {
94
+ baseCheckbox: CheckboxProps & BaseCheckboxPropsOverrides;
95
+ baseTextField: TextFieldProps & BaseTextFieldPropsOverrides;
96
+ baseFormControl: FormControlProps & BaseFormControlPropsOverrides;
97
+ baseSelect: SelectProps & BaseSelectPropsOverrides;
98
+ baseSwitch: SwitchProps & BaseSwitchPropsOverrides;
99
+ baseButton: ButtonProps & BaseButtonPropsOverrides;
100
+ baseIconButton: IconButtonProps & BaseIconButtonPropsOverrides;
101
+ basePopper: PopperProps & BasePopperPropsOverrides;
102
+ baseTooltip: TooltipProps & BaseTooltipPropsOverrides;
103
+ baseInputLabel: InputLabelProps & BaseInputLabelPropsOverrides;
104
+ baseInputAdornment: InputAdornmentProps & BaseInputAdornmentPropsOverrides;
105
+ baseSelectOption: {
96
106
  native: boolean;
97
107
  value: any;
98
108
  children?: React.ReactNode;
99
- }, BaseSelectOptionPropsOverrides>;
100
- baseChip?: SlotProps<ChipProps, BaseChipPropsOverrides>;
101
- cell?: SlotProps<GridCellProps, CellPropsOverrides>;
102
- columnHeaderFilterIconButton?: SlotProps<ColumnHeaderFilterIconButtonProps, ColumnHeaderFilterIconButtonPropsOverrides>;
103
- columnMenu?: SlotProps<GridColumnMenuProps, ColumnMenuPropsOverrides>;
104
- columnsPanel?: SlotProps<GridColumnsPanelProps, ColumnsPanelPropsOverrides>;
105
- columnsManagement?: SlotProps<GridColumnsManagementProps, ColumnsManagementPropsOverrides>;
106
- filterPanel?: SlotProps<GridFilterPanelProps, FilterPanelPropsOverrides>;
107
- footer?: SlotProps<GridFooterContainerProps, FooterPropsOverrides>;
108
- footerRowCount?: SlotProps<GridRowCountProps, FooterRowCountOverrides>;
109
- loadingOverlay?: SlotProps<GridOverlayProps, LoadingOverlayPropsOverrides>;
110
- noResultsOverlay?: SlotProps<GridOverlayProps, NoResultsOverlayPropsOverrides>;
111
- noRowsOverlay?: SlotProps<GridOverlayProps, NoRowsOverlayPropsOverrides>;
112
- pagination?: SlotProps<TablePaginationProps, PaginationPropsOverrides>;
113
- panel?: SlotProps<GridPanelProps, PanelPropsOverrides>;
114
- row?: SlotProps<GridRowProps, RowPropsOverrides>;
115
- toolbar?: SlotProps<GridToolbarProps, ToolbarPropsOverrides>;
116
- }
117
- export {};
109
+ } & BaseSelectOptionPropsOverrides;
110
+ baseChip: ChipProps & BaseChipPropsOverrides;
111
+ cell: GridCellProps & CellPropsOverrides;
112
+ columnHeaders: GridColumnHeadersProps;
113
+ columnHeaderFilterIconButton: ColumnHeaderFilterIconButtonProps & ColumnHeaderFilterIconButtonPropsOverrides;
114
+ columnMenu: GridColumnMenuProps & ColumnMenuPropsOverrides;
115
+ columnsPanel: GridColumnsPanelProps & ColumnsPanelPropsOverrides;
116
+ columnsManagement: GridColumnsManagementProps & ColumnsManagementPropsOverrides;
117
+ detailPanels: GridDetailPanelsProps & DetailPanelsPropsOverrides;
118
+ filterPanel: GridFilterPanelProps & FilterPanelPropsOverrides;
119
+ footer: GridFooterContainerProps & FooterPropsOverrides;
120
+ footerRowCount: GridRowCountProps & FooterRowCountOverrides;
121
+ loadingOverlay: GridOverlayProps & LoadingOverlayPropsOverrides;
122
+ noResultsOverlay: GridOverlayProps & NoResultsOverlayPropsOverrides;
123
+ noRowsOverlay: GridOverlayProps & NoRowsOverlayPropsOverrides;
124
+ pagination: Partial<TablePaginationProps> & PaginationPropsOverrides;
125
+ panel: GridPanelProps & PanelPropsOverrides;
126
+ pinnedRows: GridPinnedRowsProps & PinnedRowsPropsOverrides;
127
+ row: GridRowProps & RowPropsOverrides;
128
+ skeletonCell: GridSkeletonCellProps & SkeletonCellPropsOverrides;
129
+ toolbar: GridToolbarProps & ToolbarPropsOverrides;
130
+ }
131
+ /**
132
+ * Overridable components props dynamically passed to the component at rendering.
133
+ */
134
+ export type GridSlotsComponentsProps = Partial<{
135
+ [K in keyof GridSlotProps]: Partial<GridSlotProps[K]>;
136
+ }>;
@@ -81,32 +81,6 @@ export interface GridRenderEditCellParams<R extends GridValidRowModel = any, V =
81
81
  */
82
82
  api: GridApiCommunity;
83
83
  }
84
- /**
85
- * Parameters passed to `colDef.valueGetter`.
86
- */
87
- export interface GridValueGetterParams<R extends GridValidRowModel = any, V = any, N extends GridTreeNodeWithRender = GridTreeNodeWithRender> extends Omit<GridCellParams<R, V, any, N>, 'formattedValue' | 'isEditable'> {
88
- /**
89
- * GridApi that let you manipulate the grid.
90
- */
91
- api: GridApiCommunity;
92
- /**
93
- * The default value for the cell that the `valueGetter` is overriding.
94
- */
95
- value: GridCellParams<R, V, any>['value'];
96
- }
97
- /**
98
- * Object passed as parameter in the column [[GridColDef]] value setter callback.
99
- */
100
- export interface GridValueSetterParams<R extends GridValidRowModel = any, V = any> {
101
- /**
102
- * The new cell value.
103
- */
104
- value: V;
105
- /**
106
- * The row that is being edited.
107
- */
108
- row: R;
109
- }
110
84
  /**
111
85
  * Object passed as parameter in the column [[GridColDef]] value formatter callback.
112
86
  */
@@ -64,7 +64,7 @@ export interface DataGridPropsWithComplexDefaultValueBeforeProcessing {
64
64
  slots?: Partial<GridSlotsComponent>;
65
65
  /**
66
66
  * Set the locale text of the Data Grid.
67
- * You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/HEAD/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
67
+ * You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/HEAD/packages/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
68
68
  */
69
69
  localeText?: Partial<GridLocaleText>;
70
70
  }
@@ -268,7 +268,7 @@ export interface DataGridPropsWithDefaultValues {
268
268
  * Select the pageSize dynamically using the component UI.
269
269
  * @default [25, 50, 100]
270
270
  */
271
- pageSizeOptions: Array<number | {
271
+ pageSizeOptions: ReadonlyArray<number | {
272
272
  value: number;
273
273
  label: string;
274
274
  }>;