@mui/x-data-grid 8.22.1 → 8.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/colDef/gridBooleanColDef.js +0 -1
  3. package/colDef/gridDateOperators.js +6 -6
  4. package/components/cell/GridBooleanCell.js +9 -1
  5. package/components/cell/GridFooterCell.d.ts +9 -0
  6. package/components/cell/GridFooterCell.js +54 -0
  7. package/components/containers/GridRootStyles.js +4 -0
  8. package/esm/colDef/gridBooleanColDef.js +0 -1
  9. package/esm/colDef/gridDateOperators.js +6 -6
  10. package/esm/components/cell/GridBooleanCell.js +9 -1
  11. package/esm/components/cell/GridFooterCell.d.ts +9 -0
  12. package/esm/components/cell/GridFooterCell.js +48 -0
  13. package/esm/components/containers/GridRootStyles.js +4 -0
  14. package/esm/hooks/features/columnResize/gridColumnResizeApi.d.ts +7 -0
  15. package/esm/hooks/features/columnResize/gridColumnResizeApi.js +1 -0
  16. package/esm/hooks/features/columnResize/useGridColumnResize.js +13 -1
  17. package/esm/hooks/features/columns/gridColumnsUtils.js +1 -4
  18. package/esm/hooks/features/dataSource/useGridDataSourceBase.d.ts +3 -3
  19. package/esm/hooks/features/editing/useGridCellEditing.js +1 -0
  20. package/esm/hooks/features/pagination/gridPaginationSelector.js +3 -0
  21. package/esm/hooks/features/rowSelection/useGridRowSelection.js +17 -15
  22. package/esm/hooks/features/rowSelection/utils.js +2 -2
  23. package/esm/index.js +1 -1
  24. package/esm/internals/index.d.ts +2 -0
  25. package/esm/internals/index.js +1 -0
  26. package/esm/locales/ptPT.d.ts +2 -1
  27. package/esm/locales/ptPT.js +114 -125
  28. package/esm/models/gridAggregation.d.ts +18 -0
  29. package/esm/models/gridAggregation.js +1 -0
  30. package/esm/utils/domUtils.d.ts +1 -0
  31. package/esm/utils/domUtils.js +4 -0
  32. package/esm/utils/utils.d.ts +1 -1
  33. package/esm/utils/utils.js +2 -2
  34. package/hooks/features/columnResize/gridColumnResizeApi.d.ts +7 -0
  35. package/hooks/features/columnResize/gridColumnResizeApi.js +1 -0
  36. package/hooks/features/columnResize/useGridColumnResize.js +12 -0
  37. package/hooks/features/columns/gridColumnsUtils.js +1 -4
  38. package/hooks/features/dataSource/useGridDataSourceBase.d.ts +3 -3
  39. package/hooks/features/editing/useGridCellEditing.js +1 -0
  40. package/hooks/features/pagination/gridPaginationSelector.js +3 -0
  41. package/hooks/features/rowSelection/useGridRowSelection.js +17 -15
  42. package/hooks/features/rowSelection/utils.js +2 -2
  43. package/index.js +1 -1
  44. package/internals/index.d.ts +2 -0
  45. package/internals/index.js +8 -0
  46. package/locales/ptPT.d.ts +2 -1
  47. package/locales/ptPT.js +114 -125
  48. package/models/gridAggregation.d.ts +18 -0
  49. package/models/gridAggregation.js +5 -0
  50. package/package.json +3 -3
  51. package/utils/domUtils.d.ts +1 -0
  52. package/utils/domUtils.js +5 -0
  53. package/utils/utils.d.ts +1 -1
  54. package/utils/utils.js +2 -2
@@ -27,6 +27,7 @@ var _constants = require("../../../internals/constants");
27
27
  var _gridClasses = require("../../../constants/gridClasses");
28
28
  var _domUtils = require("../../../utils/domUtils");
29
29
  var _utils = require("./utils");
30
+ var _utils2 = require("../../../utils/utils");
30
31
  var _gridRowSelectionManager = require("../../../models/gridRowSelectionManager");
31
32
  var _pagination = require("../pagination");
32
33
  const emptyModel = {
@@ -46,11 +47,6 @@ const rowSelectionStateInitializer = (state, props) => (0, _extends2.default)({}
46
47
  exports.rowSelectionStateInitializer = rowSelectionStateInitializer;
47
48
  const useGridRowSelection = (apiRef, props) => {
48
49
  const logger = (0, _useGridLogger.useGridLogger)(apiRef, 'useGridSelection');
49
- const runIfRowSelectionIsEnabled = React.useCallback(callback => (...args) => {
50
- if (props.rowSelection) {
51
- callback(...args);
52
- }
53
- }, [props.rowSelection]);
54
50
  const isNestedData = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridRowMaximumTreeDepthSelector) > 1;
55
51
  const applyAutoSelection = props.signature !== _signature.GridSignature.DataGrid && (props.rowSelectionPropagation?.parents || props.rowSelectionPropagation?.descendants) && isNestedData;
56
52
  const propRowSelectionModel = React.useMemo(() => {
@@ -129,6 +125,12 @@ const useGridRowSelection = (apiRef, props) => {
129
125
  if (props.rowSelection === false) {
130
126
  return false;
131
127
  }
128
+
129
+ // If `keepNonExistentRowsSelected` is true, we might run in a case where row selectability is checked for a row that does not exist.
130
+ // Since that row was previously selected (otherwise it would not be checked at this point), we return true.
131
+ if (props.keepNonExistentRowsSelected && !apiRef.current.getRow(id)) {
132
+ return true;
133
+ }
132
134
  if (propIsRowSelectable && !propIsRowSelectable(apiRef.current.getRowParams(id))) {
133
135
  return false;
134
136
  }
@@ -137,7 +139,7 @@ const useGridRowSelection = (apiRef, props) => {
137
139
  return false;
138
140
  }
139
141
  return true;
140
- }, [apiRef, props.rowSelection, propIsRowSelectable]);
142
+ }, [apiRef, props.rowSelection, props.keepNonExistentRowsSelected, propIsRowSelectable]);
141
143
  const getSelectedRows = React.useCallback(() => (0, _gridRowSelectionSelector.gridRowSelectionIdsSelector)(apiRef), [apiRef]);
142
144
  const selectRow = React.useCallback((id, isSelected = true, resetSelection = false) => {
143
145
  if (!apiRef.current.isRowSelectable(id)) {
@@ -311,7 +313,7 @@ const useGridRowSelection = (apiRef, props) => {
311
313
  * EVENTS
312
314
  */
313
315
  const isFirstRender = React.useRef(true);
314
- const removeOutdatedSelection = React.useCallback((sortModelUpdated = false) => {
316
+ const removeOutdatedSelection = React.useCallback(() => {
315
317
  if (isFirstRender.current) {
316
318
  return;
317
319
  }
@@ -365,7 +367,7 @@ const useGridRowSelection = (apiRef, props) => {
365
367
  const shouldReapplyPropagation = isNestedData && props.rowSelectionPropagation?.parents && (newSelectionModel.ids.size > 0 ||
366
368
  // In case of exclude selection, newSelectionModel.ids.size === 0 means all rows are selected
367
369
  newSelectionModel.type === 'exclude');
368
- if (hasChanged || shouldReapplyPropagation && !sortModelUpdated) {
370
+ if (hasChanged || shouldReapplyPropagation) {
369
371
  if (shouldReapplyPropagation) {
370
372
  if (newSelectionModel.type === 'exclude') {
371
373
  const unfilteredSelectedRowIds = getRowsToBeSelected();
@@ -548,12 +550,12 @@ const useGridRowSelection = (apiRef, props) => {
548
550
  }
549
551
  apiRef.current.setRowSelectionModel(propRowSelectionModel);
550
552
  });
551
- (0, _useGridEvent.useGridEvent)(apiRef, 'filteredRowsSet', runIfRowSelectionIsEnabled(() => removeOutdatedSelection()));
552
- (0, _useGridEvent.useGridEvent)(apiRef, 'rowClick', runIfRowSelectionIsEnabled(handleRowClick));
553
- (0, _useGridEvent.useGridEvent)(apiRef, 'rowSelectionCheckboxChange', runIfRowSelectionIsEnabled(handleRowSelectionCheckboxChange));
553
+ (0, _useGridEvent.useGridEvent)(apiRef, 'filteredRowsSet', (0, _utils2.runIf)(props.rowSelection, removeOutdatedSelection));
554
+ (0, _useGridEvent.useGridEvent)(apiRef, 'rowClick', (0, _utils2.runIf)(props.rowSelection, handleRowClick));
555
+ (0, _useGridEvent.useGridEvent)(apiRef, 'rowSelectionCheckboxChange', (0, _utils2.runIf)(props.rowSelection, handleRowSelectionCheckboxChange));
554
556
  (0, _useGridEvent.useGridEvent)(apiRef, 'headerSelectionCheckboxChange', handleHeaderSelectionCheckboxChange);
555
- (0, _useGridEvent.useGridEvent)(apiRef, 'cellMouseDown', runIfRowSelectionIsEnabled(preventSelectionOnShift));
556
- (0, _useGridEvent.useGridEvent)(apiRef, 'cellKeyDown', runIfRowSelectionIsEnabled(handleCellKeyDown));
557
+ (0, _useGridEvent.useGridEvent)(apiRef, 'cellMouseDown', (0, _utils2.runIf)(props.rowSelection, preventSelectionOnShift));
558
+ (0, _useGridEvent.useGridEvent)(apiRef, 'cellKeyDown', (0, _utils2.runIf)(props.rowSelection, handleCellKeyDown));
557
559
 
558
560
  /*
559
561
  * EFFECTS
@@ -596,8 +598,8 @@ const useGridRowSelection = (apiRef, props) => {
596
598
  }
597
599
  }, [apiRef, canHaveMultipleSelection, checkboxSelection, isStateControlled, props.rowSelection]);
598
600
  React.useEffect(() => {
599
- runIfRowSelectionIsEnabled(removeOutdatedSelection);
600
- }, [removeOutdatedSelection, runIfRowSelectionIsEnabled]);
601
+ (0, _utils2.runIf)(props.rowSelection, removeOutdatedSelection);
602
+ }, [props.rowSelection, removeOutdatedSelection]);
601
603
  React.useEffect(() => {
602
604
  if (isFirstRender.current) {
603
605
  isFirstRender.current = false;
@@ -47,7 +47,7 @@ const checkboxPropsSelector = exports.checkboxPropsSelector = (0, _createSelecto
47
47
  columns
48
48
  };
49
49
  let isSelectable = true;
50
- if (typeof isRowSelectable === 'function') {
50
+ if (typeof isRowSelectable === 'function' && rowsLookup[groupId]) {
51
51
  isSelectable = isRowSelectable(rowParams);
52
52
  }
53
53
  if (!groupNode || groupNode.type !== 'group' || rowSelectionManager.has(groupId)) {
@@ -76,7 +76,7 @@ const checkboxPropsSelector = exports.checkboxPropsSelector = (0, _createSelecto
76
76
  row: rowsLookup[itemToTraverseId],
77
77
  columns
78
78
  };
79
- const rowIsSelectable = typeof isRowSelectable === 'function' ? isRowSelectable(descendantRowParams) : true;
79
+ const rowIsSelectable = typeof isRowSelectable === 'function' && rowsLookup[itemToTraverseId] ? isRowSelectable(descendantRowParams) : true;
80
80
 
81
81
  // Only consider selectable rows when determining parent selection state
82
82
  if (rowIsSelectable) {
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.22.1
2
+ * @mui/x-data-grid v8.23.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -8,6 +8,7 @@ export { GridHeaders } from "../components/GridHeaders.js";
8
8
  export { GridToolbar, GridToolbarDivider } from "../components/toolbarV8/GridToolbar.js";
9
9
  export type { GridToolbarProps } from "../components/toolbarV8/GridToolbar.js";
10
10
  export { GridColumnSortButton } from "../components/GridColumnSortButton.js";
11
+ export { GridFooterCell } from "../components/cell/GridFooterCell.js";
11
12
  export { GridBaseColumnHeaders } from "../components/columnHeaders/GridBaseColumnHeaders.js";
12
13
  export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from "../constants/defaultGridSlotsComponents.js";
13
14
  export * from "../constants/signature.js";
@@ -88,6 +89,7 @@ export { useGridInitializeState } from "../hooks/utils/useGridInitializeState.js
88
89
  export type { GridStateInitializer } from "../hooks/utils/useGridInitializeState.js";
89
90
  export type * as BaseSlots from "../models/gridBaseSlots.js";
90
91
  export type * from "../models/props/DataGridProps.js";
92
+ export type { GridAggregationPosition, GridAggregationCellMeta } from "../models/gridAggregation.js";
91
93
  export type { GridDataSourceApiBase, GridDataSourceApi, GridDataSourceBaseOptions, GridDataSourceFetchRowsParams } from "../hooks/features/dataSource/models.js";
92
94
  export { DataSourceRowsUpdateStrategy } from "../hooks/features/dataSource/utils.js";
93
95
  export { useGridDataSourceBase } from "../hooks/features/dataSource/useGridDataSourceBase.js";
@@ -11,6 +11,7 @@ var _exportNames = {
11
11
  GridToolbar: true,
12
12
  GridToolbarDivider: true,
13
13
  GridColumnSortButton: true,
14
+ GridFooterCell: true,
14
15
  GridBaseColumnHeaders: true,
15
16
  DATA_GRID_DEFAULT_SLOTS_COMPONENTS: true,
16
17
  vars: true,
@@ -169,6 +170,12 @@ Object.defineProperty(exports, "GridColumnSortButton", {
169
170
  return _GridColumnSortButton.GridColumnSortButton;
170
171
  }
171
172
  });
173
+ Object.defineProperty(exports, "GridFooterCell", {
174
+ enumerable: true,
175
+ get: function () {
176
+ return _GridFooterCell.GridFooterCell;
177
+ }
178
+ });
172
179
  Object.defineProperty(exports, "GridHeaders", {
173
180
  enumerable: true,
174
181
  get: function () {
@@ -865,6 +872,7 @@ var _GridVirtualScrollerRenderZone = require("../components/virtualization/GridV
865
872
  var _GridHeaders = require("../components/GridHeaders");
866
873
  var _GridToolbar = require("../components/toolbarV8/GridToolbar");
867
874
  var _GridColumnSortButton = require("../components/GridColumnSortButton");
875
+ var _GridFooterCell = require("../components/cell/GridFooterCell");
868
876
  var _GridBaseColumnHeaders = require("../components/columnHeaders/GridBaseColumnHeaders");
869
877
  var _defaultGridSlotsComponents = require("../constants/defaultGridSlotsComponents");
870
878
  var _signature = require("../constants/signature");
package/locales/ptPT.d.ts CHANGED
@@ -1 +1,2 @@
1
- export declare const ptPT: import("../internals/index.js").Localization;
1
+ import { Localization } from "../utils/getGridLocalization.js";
2
+ export declare const ptPT: Localization;
package/locales/ptPT.js CHANGED
@@ -9,10 +9,9 @@ const ptPTGrid = {
9
9
  // Root
10
10
  noRowsLabel: 'Nenhuma linha',
11
11
  noResultsOverlayLabel: 'Nenhum resultado encontrado.',
12
- // noColumnsOverlayLabel: 'No columns',
13
- // noColumnsOverlayManageColumns: 'Manage columns',
14
- // emptyPivotOverlayLabel: 'Add fields to rows, columns, and values to create a pivot table',
15
-
12
+ noColumnsOverlayLabel: 'Sem colunas',
13
+ noColumnsOverlayManageColumns: 'Gerir colunas',
14
+ emptyPivotOverlayLabel: 'Adicione campos às linhas, colunas e valores para criar uma tabela dinâmica',
16
15
  // Density selector toolbar button text
17
16
  toolbarDensity: 'Densidade',
18
17
  toolbarDensityLabel: 'Densidade',
@@ -39,14 +38,11 @@ const ptPTGrid = {
39
38
  toolbarExportPrint: 'Imprimir',
40
39
  toolbarExportExcel: 'Descarregar como Excel',
41
40
  // Toolbar pivot button
42
- // toolbarPivot: 'Pivot',
43
-
41
+ toolbarPivot: 'Pivot',
44
42
  // Toolbar charts button
45
- // toolbarCharts: 'Charts',
46
-
43
+ toolbarCharts: 'Gráficos',
47
44
  // Toolbar AI Assistant button
48
- // toolbarAssistant: 'AI Assistant',
49
-
45
+ toolbarAssistant: 'Assistente de IA',
50
46
  // Columns management text
51
47
  columnsManagementSearchTitle: 'Procurar',
52
48
  columnsManagementNoColumns: 'Sem colunas',
@@ -105,18 +101,17 @@ const ptPTGrid = {
105
101
  'headerFilterOperator=': 'É igual a',
106
102
  'headerFilterOperator!=': 'Não é igual',
107
103
  'headerFilterOperator>': 'Maior que',
108
- 'headerFilterOperator>=': 'Melhor que ou igual a',
104
+ 'headerFilterOperator>=': 'Maior que ou igual a',
109
105
  'headerFilterOperator<': 'Menor que',
110
- 'headerFilterOperator<=': 'Menos que ou igual a',
111
- // headerFilterClear: 'Clear filter',
112
-
106
+ 'headerFilterOperator<=': 'Menor que ou igual a',
107
+ headerFilterClear: 'Limpar filtro',
113
108
  // Filter values text
114
109
  filterValueAny: 'qualquer',
115
110
  filterValueTrue: 'verdadeiro',
116
111
  filterValueFalse: 'falso',
117
112
  // Column menu text
118
113
  columnMenuLabel: 'Menu',
119
- // columnMenuAriaLabel: (columnName: string) => `${columnName} column menu`,
114
+ columnMenuAriaLabel: columnName => `Menu da coluna ${columnName}`,
120
115
  columnMenuShowColumns: 'Mostrar colunas',
121
116
  columnMenuManageColumns: 'Gerir colunas',
122
117
  columnMenuFilter: 'Filtro',
@@ -124,9 +119,8 @@ const ptPTGrid = {
124
119
  columnMenuUnsort: 'Desclassificar',
125
120
  columnMenuSortAsc: 'Classificar por ordem crescente',
126
121
  columnMenuSortDesc: 'Classificar por ordem decrescente',
127
- // columnMenuManagePivot: 'Manage pivot',
128
- // columnMenuManageCharts: 'Manage charts',
129
-
122
+ columnMenuManagePivot: 'Gerir pivot',
123
+ columnMenuManageCharts: 'Gerir gráficos',
130
124
  // Column header text
131
125
  columnHeaderFiltersTooltipActive: count => count !== 1 ? `${count} filtros ativos` : `${count} filtro ativo`,
132
126
  columnHeaderFiltersLabel: 'Mostrar filtros',
@@ -166,18 +160,18 @@ const ptPTGrid = {
166
160
  collapseDetailPanel: 'Colapsar',
167
161
  // Pagination
168
162
  paginationRowsPerPage: 'Linhas por página:',
169
- // paginationDisplayedRows: ({
170
- // from,
171
- // to,
172
- // count,
173
- // estimated
174
- // }) => {
175
- // if (!estimated) {
176
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
177
- // }
178
- // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
179
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
180
- // },
163
+ paginationDisplayedRows: ({
164
+ from,
165
+ to,
166
+ count,
167
+ estimated
168
+ }) => {
169
+ if (!estimated) {
170
+ return `${from}–${to} de ${count !== -1 ? count : `mais do que ${to}`}`;
171
+ }
172
+ const estimatedLabel = estimated && estimated > to ? `cerca de ${estimated}` : `mais do que ${to}`;
173
+ return `${from}–${to} de ${count !== -1 ? count : estimatedLabel}`;
174
+ },
181
175
  paginationItemAriaLabel: type => {
182
176
  if (type === 'first') {
183
177
  return 'Primeira página';
@@ -195,114 +189,109 @@ const ptPTGrid = {
195
189
  rowReorderingHeaderName: 'Reordenação de linhas',
196
190
  // Aggregation
197
191
  aggregationMenuItemHeader: 'Agregação',
198
- // aggregationFunctionLabelNone: 'none',
192
+ aggregationFunctionLabelNone: 'nenhuma',
199
193
  aggregationFunctionLabelSum: 'soma',
200
194
  aggregationFunctionLabelAvg: 'média',
201
195
  aggregationFunctionLabelMin: 'min',
202
196
  aggregationFunctionLabelMax: 'máx.',
203
197
  aggregationFunctionLabelSize: 'tamanho',
204
198
  // Pivot panel
205
- // pivotToggleLabel: 'Pivot',
206
- // pivotRows: 'Rows',
207
- // pivotColumns: 'Columns',
208
- // pivotValues: 'Values',
209
- // pivotCloseButton: 'Close pivot settings',
210
- // pivotSearchButton: 'Search fields',
211
- // pivotSearchControlPlaceholder: 'Search fields',
212
- // pivotSearchControlLabel: 'Search fields',
213
- // pivotSearchControlClear: 'Clear search',
214
- // pivotNoFields: 'No fields',
215
- // pivotMenuMoveUp: 'Move up',
216
- // pivotMenuMoveDown: 'Move down',
217
- // pivotMenuMoveToTop: 'Move to top',
218
- // pivotMenuMoveToBottom: 'Move to bottom',
219
- // pivotMenuRows: 'Rows',
220
- // pivotMenuColumns: 'Columns',
221
- // pivotMenuValues: 'Values',
222
- // pivotMenuOptions: 'Field options',
223
- // pivotMenuAddToRows: 'Add to Rows',
224
- // pivotMenuAddToColumns: 'Add to Columns',
225
- // pivotMenuAddToValues: 'Add to Values',
226
- // pivotMenuRemove: 'Remove',
227
- // pivotDragToRows: 'Drag here to create rows',
228
- // pivotDragToColumns: 'Drag here to create columns',
229
- // pivotDragToValues: 'Drag here to create values',
230
- // pivotYearColumnHeaderName: '(Year)',
231
- // pivotQuarterColumnHeaderName: '(Quarter)',
232
-
199
+ pivotToggleLabel: 'Pivot',
200
+ pivotRows: 'Linhas',
201
+ pivotColumns: 'Colunas',
202
+ pivotValues: 'Valores',
203
+ pivotCloseButton: 'Fechar configurações de pivot',
204
+ pivotSearchButton: 'Pesquisar campos',
205
+ pivotSearchControlPlaceholder: 'Pesquisar campos',
206
+ pivotSearchControlLabel: 'Pesquisar campos',
207
+ pivotSearchControlClear: 'Limpar pesquisa',
208
+ pivotNoFields: 'Nenhum campo',
209
+ pivotMenuMoveUp: 'Mover para cima',
210
+ pivotMenuMoveDown: 'Mover para baixo',
211
+ pivotMenuMoveToTop: 'Mover para o topo',
212
+ pivotMenuMoveToBottom: 'Mover para o fundo',
213
+ pivotMenuRows: 'Linhas',
214
+ pivotMenuColumns: 'Colunas',
215
+ pivotMenuValues: 'Valores',
216
+ pivotMenuOptions: 'Opções do campo',
217
+ pivotMenuAddToRows: 'Adicionar às Linhas',
218
+ pivotMenuAddToColumns: 'Adicionar às Colunas',
219
+ pivotMenuAddToValues: 'Adicionar aos Valores',
220
+ pivotMenuRemove: 'Remover',
221
+ pivotDragToRows: 'Arraste para aqui para criar linhas',
222
+ pivotDragToColumns: 'Arraste para aqui para criar colunas',
223
+ pivotDragToValues: 'Arraste para aqui para criar valores',
224
+ pivotYearColumnHeaderName: '(Ano)',
225
+ pivotQuarterColumnHeaderName: '(Trimestre)',
233
226
  // Charts configuration panel
234
- // chartsNoCharts: 'There are no charts available',
235
- // chartsChartNotSelected: 'Select a chart type to configure its options',
236
- // chartsTabChart: 'Chart',
237
- // chartsTabFields: 'Fields',
238
- // chartsTabCustomize: 'Customize',
239
- // chartsCloseButton: 'Close charts configuration',
240
- // chartsSyncButtonLabel: 'Sync chart',
241
- // chartsSearchPlaceholder: 'Search fields',
242
- // chartsSearchLabel: 'Search fields',
243
- // chartsSearchClear: 'Clear search',
244
- // chartsNoFields: 'No fields',
245
- // chartsFieldBlocked: 'This field cannot be added to any section',
246
- // chartsCategories: 'Categories',
247
- // chartsSeries: 'Series',
248
- // chartsMenuAddToDimensions: (dimensionLabel: string) => `Add to ${dimensionLabel}`,
249
- // chartsMenuAddToValues: (valuesLabel: string) => `Add to ${valuesLabel}`,
250
- // chartsMenuMoveUp: 'Move up',
251
- // chartsMenuMoveDown: 'Move down',
252
- // chartsMenuMoveToTop: 'Move to top',
253
- // chartsMenuMoveToBottom: 'Move to bottom',
254
- // chartsMenuOptions: 'Field options',
255
- // chartsMenuRemove: 'Remove',
256
- // chartsDragToDimensions: (dimensionLabel: string) => `Drag here to use column as ${dimensionLabel}`,
257
- // chartsDragToValues: (valuesLabel: string) => `Drag here to use column as ${valuesLabel}`,
258
-
227
+ chartsNoCharts: 'Não gráficos disponíveis',
228
+ chartsChartNotSelected: 'Selecione um tipo de gráfico para configurar as suas opções',
229
+ chartsTabChart: 'Gráfico',
230
+ chartsTabFields: 'Campos',
231
+ chartsTabCustomize: 'Personalizar',
232
+ chartsCloseButton: 'Fechar configuração de gráficos',
233
+ chartsSyncButtonLabel: 'Sincronizar gráfico',
234
+ chartsSearchPlaceholder: 'Pesquisar campos',
235
+ chartsSearchLabel: 'Pesquisar campos',
236
+ chartsSearchClear: 'Limpar pesquisa',
237
+ chartsNoFields: 'Nenhum campo',
238
+ chartsFieldBlocked: 'Este campo não pode ser adicionado a nenhuma secção',
239
+ chartsCategories: 'Categorias',
240
+ chartsSeries: 'Séries',
241
+ chartsMenuAddToDimensions: dimensionLabel => `Adicionar a ${dimensionLabel}`,
242
+ chartsMenuAddToValues: valuesLabel => `Adicionar a ${valuesLabel}`,
243
+ chartsMenuMoveUp: 'Mover para cima',
244
+ chartsMenuMoveDown: 'Mover para baixo',
245
+ chartsMenuMoveToTop: 'Mover para o topo',
246
+ chartsMenuMoveToBottom: 'Mover para o fundo',
247
+ chartsMenuOptions: 'Opções do campo',
248
+ chartsMenuRemove: 'Remover',
249
+ chartsDragToDimensions: dimensionLabel => `Arraste para aqui para usar a coluna como ${dimensionLabel}`,
250
+ chartsDragToValues: valuesLabel => `Arraste para aqui para usar a coluna como ${valuesLabel}`,
259
251
  // AI Assistant panel
260
- // aiAssistantPanelTitle: 'AI Assistant',
261
- // aiAssistantPanelClose: 'Close AI Assistant',
262
- // aiAssistantPanelNewConversation: 'New conversation',
263
- // aiAssistantPanelConversationHistory: 'Conversation history',
264
- // aiAssistantPanelEmptyConversation: 'No prompt history',
265
- // aiAssistantSuggestions: 'Suggestions',
266
-
252
+ aiAssistantPanelTitle: 'Assistente de IA',
253
+ aiAssistantPanelClose: 'Fechar Assistente de IA',
254
+ aiAssistantPanelNewConversation: 'Nova conversa',
255
+ aiAssistantPanelConversationHistory: 'Histórico de conversas',
256
+ aiAssistantPanelEmptyConversation: 'Nenhum histórico de prompts',
257
+ aiAssistantSuggestions: 'Sugestões',
267
258
  // Prompt field
268
259
  promptFieldLabel: 'Prompt',
269
- promptFieldPlaceholder: 'Digite um prompt',
270
- promptFieldPlaceholderWithRecording: 'Digite ou grave um prompt',
271
- promptFieldPlaceholderListening: 'Ouvindo o prompt',
272
- // promptFieldSpeechRecognitionNotSupported: 'Speech recognition is not supported in this browser',
260
+ promptFieldPlaceholder: 'Digite um prompt',
261
+ promptFieldPlaceholderWithRecording: 'Digite ou grave um prompt',
262
+ promptFieldPlaceholderListening: 'Ouvindo o prompt',
263
+ promptFieldSpeechRecognitionNotSupported: 'Reconhecimento de voz não é suportado neste navegador',
273
264
  promptFieldSend: 'Enviar',
274
265
  promptFieldRecord: 'Gravar',
275
- promptFieldStopRecording: 'Parar gravação'
276
-
266
+ promptFieldStopRecording: 'Parar gravação',
277
267
  // Prompt
278
- // promptRerun: 'Run again',
279
- // promptProcessing: 'Processing…',
280
- // promptAppliedChanges: 'Applied changes',
281
-
268
+ promptRerun: 'Executar novamente',
269
+ promptProcessing: 'Processando…',
270
+ promptAppliedChanges: 'Alterações aplicadas',
282
271
  // Prompt changes
283
- // promptChangeGroupDescription: (column: string) => `Group by ${column}`,
284
- // promptChangeAggregationLabel: (column: string, aggregation: string) => `${column} (${aggregation})`,
285
- // promptChangeAggregationDescription: (column: string, aggregation: string) => `Aggregate ${column} (${aggregation})`,
286
- // promptChangeFilterLabel: (column: string, operator: string, value: string) => {
287
- // if (operator === 'is any of') {
288
- // return `${column} is any of: ${value}`;
289
- // }
290
- // return `${column} ${operator} ${value}`;
291
- // },
292
- // promptChangeFilterDescription: (column: string, operator: string, value: string) => {
293
- // if (operator === 'is any of') {
294
- // return `Filter where ${column} is any of: ${value}`;
295
- // }
296
- // return `Filter where ${column} ${operator} ${value}`;
297
- // },
298
- // promptChangeSortDescription: (column: string, direction: string) => `Sort by ${column} (${direction})`,
299
- // promptChangePivotEnableLabel: 'Pivot',
300
- // promptChangePivotEnableDescription: 'Enable pivot',
301
- // promptChangePivotColumnsLabel: (count: number) => `Columns (${count})`,
302
- // promptChangePivotColumnsDescription: (column: string, direction: string) => `${column}${direction ? ` (${direction})` : ''}`,
303
- // promptChangePivotRowsLabel: (count: number) => `Rows (${count})`,
304
- // promptChangePivotValuesLabel: (count: number) => `Values (${count})`,
305
- // promptChangePivotValuesDescription: (column: string, aggregation: string) => `${column} (${aggregation})`,
306
- // promptChangeChartsLabel: (dimensionsCount: number, valuesCount: number) => `Dimensions (${dimensionsCount}), Values (${valuesCount})`,
272
+ promptChangeGroupDescription: column => `Agrupar por ${column}`,
273
+ promptChangeAggregationLabel: (column, aggregation) => `${column} (${aggregation})`,
274
+ promptChangeAggregationDescription: (column, aggregation) => `Agregar ${column} (${aggregation})`,
275
+ promptChangeFilterLabel: (column, operator, value) => {
276
+ if (operator === 'is any of') {
277
+ return `${column} é um de: ${value}`;
278
+ }
279
+ return `${column} ${operator} ${value}`;
280
+ },
281
+ promptChangeFilterDescription: (column, operator, value) => {
282
+ if (operator === 'is any of') {
283
+ return `Filtrar onde ${column} é um de: ${value}`;
284
+ }
285
+ return `Filtrar onde ${column} ${operator} ${value}`;
286
+ },
287
+ promptChangeSortDescription: (column, direction) => `Ordenar por ${column} (${direction})`,
288
+ promptChangePivotEnableLabel: 'Pivot',
289
+ promptChangePivotEnableDescription: 'Ativar pivot',
290
+ promptChangePivotColumnsLabel: count => `Colunas (${count})`,
291
+ promptChangePivotColumnsDescription: (column, direction) => `${column}${direction ? ` (${direction})` : ''}`,
292
+ promptChangePivotRowsLabel: count => `Linhas (${count})`,
293
+ promptChangePivotValuesLabel: count => `Valores (${count})`,
294
+ promptChangePivotValuesDescription: (column, aggregation) => `${column} (${aggregation})`,
295
+ promptChangeChartsLabel: (dimensionsCount, valuesCount) => `Dimensões (${dimensionsCount}), Valores (${valuesCount})`
307
296
  };
308
297
  const ptPT = exports.ptPT = (0, _getGridLocalization.getGridLocalization)(ptPTGrid);
@@ -0,0 +1,18 @@
1
+ export type GridAggregationPosition = 'inline' | 'footer';
2
+ export interface GridAggregationCellMeta {
3
+ /**
4
+ * If `true`, the current aggregated value has the same unit as the value of the other cells of this row.
5
+ * For instance, "min" / "max" aggregation have the same unit as the other cells.
6
+ * If `false`, the current aggregated value has another unit or not unit.
7
+ * For instance, "size" aggregation has no unit.
8
+ */
9
+ hasCellUnit: boolean;
10
+ /**
11
+ * Name of the aggregation function currently applied on this cell.
12
+ */
13
+ aggregationFunctionName: string;
14
+ /**
15
+ * Position of the aggregated value.
16
+ */
17
+ position: GridAggregationPosition;
18
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "8.22.1",
3
+ "version": "8.23.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The Community plan edition of the MUI X Data Grid components.",
6
6
  "license": "MIT",
@@ -42,8 +42,8 @@
42
42
  "clsx": "^2.1.1",
43
43
  "prop-types": "^15.8.1",
44
44
  "use-sync-external-store": "^1.6.0",
45
- "@mui/x-internals": "8.22.0",
46
- "@mui/x-virtualizer": "0.2.13"
45
+ "@mui/x-internals": "8.23.0",
46
+ "@mui/x-virtualizer": "0.3.0"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@emotion/react": "^11.9.0",
@@ -26,4 +26,5 @@ export declare function findRightPinnedCellsBeforeCol(api: GridPrivateApiCommuni
26
26
  export declare function findLeftPinnedHeadersAfterCol(api: GridPrivateApiCommunity, col: HTMLElement, isRtl: boolean): HTMLElement[];
27
27
  export declare function findRightPinnedHeadersBeforeCol(api: GridPrivateApiCommunity, col: HTMLElement, isRtl: boolean): HTMLElement[];
28
28
  export declare function findGridHeader(api: GridPrivateApiCommunity, field: string): Element | null;
29
+ export declare function findGridHeaderFilter(api: GridPrivateApiCommunity, field: string): Element | null;
29
30
  export declare function findGridCells(api: GridPrivateApiCommunity, field: string): Element[];
package/utils/domUtils.js CHANGED
@@ -8,6 +8,7 @@ exports.findGridCellElementsFromCol = findGridCellElementsFromCol;
8
8
  exports.findGridCells = findGridCells;
9
9
  exports.findGridElement = findGridElement;
10
10
  exports.findGridHeader = findGridHeader;
11
+ exports.findGridHeaderFilter = findGridHeaderFilter;
11
12
  exports.findGroupHeaderElementsFromField = findGroupHeaderElementsFromField;
12
13
  exports.findHeaderElementFromField = findHeaderElementFromField;
13
14
  exports.findLeftPinnedCellsAfterCol = findLeftPinnedCellsAfterCol;
@@ -212,6 +213,10 @@ function findGridHeader(api, field) {
212
213
  const headers = api.columnHeadersContainerRef.current;
213
214
  return headers.querySelector(`:scope > div > [data-field="${escapeOperandAttributeSelector(field)}"][role="columnheader"]`);
214
215
  }
216
+ function findGridHeaderFilter(api, field) {
217
+ const headers = api.columnHeadersContainerRef.current;
218
+ return headers.querySelector(`:scope > .${_gridClasses.gridClasses.headerFilterRow} > [data-field="${escapeOperandAttributeSelector(field)}"]`);
219
+ }
215
220
  function findGridCells(api, field) {
216
221
  const container = api.virtualScrollerRef.current;
217
222
  return Array.from(container.querySelectorAll(`:scope > div > div > div > [data-field="${escapeOperandAttributeSelector(field)}"][role="gridcell"]`));
package/utils/utils.d.ts CHANGED
@@ -27,4 +27,4 @@ export declare function deepClone(obj: Record<string, any>): any;
27
27
  * that hint disables checks on all values instead of just one.
28
28
  */
29
29
  export declare function eslintUseValue(_: any): void;
30
- export declare const runIf: (condition: boolean, fn: Function) => (params: unknown) => void;
30
+ export declare const runIf: (condition: boolean, fn: Function) => (...params: unknown[]) => void;
package/utils/utils.js CHANGED
@@ -92,9 +92,9 @@ function deepClone(obj) {
92
92
  * that hint disables checks on all values instead of just one.
93
93
  */
94
94
  function eslintUseValue(_) {}
95
- const runIf = (condition, fn) => params => {
95
+ const runIf = (condition, fn) => (...params) => {
96
96
  if (condition) {
97
- fn(params);
97
+ fn(...params);
98
98
  }
99
99
  };
100
100
  exports.runIf = runIf;