@mui/x-data-grid 8.22.0 → 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.
- package/CHANGELOG.md +202 -0
- package/colDef/gridBooleanColDef.js +0 -1
- package/colDef/gridDateOperators.js +6 -6
- package/components/cell/GridBooleanCell.js +9 -1
- package/components/cell/GridFooterCell.d.ts +9 -0
- package/components/cell/GridFooterCell.js +54 -0
- package/components/columnSelection/GridCellCheckboxRenderer.js +4 -3
- package/components/containers/GridRootStyles.js +4 -0
- package/esm/colDef/gridBooleanColDef.js +0 -1
- package/esm/colDef/gridDateOperators.js +6 -6
- package/esm/components/cell/GridBooleanCell.js +9 -1
- package/esm/components/cell/GridFooterCell.d.ts +9 -0
- package/esm/components/cell/GridFooterCell.js +48 -0
- package/esm/components/columnSelection/GridCellCheckboxRenderer.js +4 -3
- package/esm/components/containers/GridRootStyles.js +4 -0
- package/esm/hooks/core/useGridProps.js +2 -1
- package/esm/hooks/features/columnResize/gridColumnResizeApi.d.ts +7 -0
- package/esm/hooks/features/columnResize/gridColumnResizeApi.js +1 -0
- package/esm/hooks/features/columnResize/useGridColumnResize.js +29 -2
- package/esm/hooks/features/columns/gridColumnsUtils.js +12 -7
- package/esm/hooks/features/dataSource/useGridDataSourceBase.d.ts +3 -3
- package/esm/hooks/features/editing/useGridCellEditing.js +1 -0
- package/esm/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +1 -1
- package/esm/hooks/features/pagination/gridPaginationSelector.js +3 -0
- package/esm/hooks/features/rowSelection/useGridRowSelection.js +17 -15
- package/esm/hooks/features/rowSelection/utils.js +36 -9
- package/esm/hooks/features/rows/useGridRowSpanning.js +1 -0
- package/esm/index.js +1 -1
- package/esm/internals/index.d.ts +2 -0
- package/esm/internals/index.js +1 -0
- package/esm/locales/ptPT.d.ts +2 -1
- package/esm/locales/ptPT.js +114 -125
- package/esm/locales/svSE.js +2 -2
- package/esm/models/gridAggregation.d.ts +18 -0
- package/esm/models/gridAggregation.js +1 -0
- package/esm/utils/domUtils.d.ts +1 -0
- package/esm/utils/domUtils.js +4 -0
- package/esm/utils/utils.d.ts +1 -1
- package/esm/utils/utils.js +2 -2
- package/hooks/core/useGridProps.js +2 -1
- package/hooks/features/columnResize/gridColumnResizeApi.d.ts +7 -0
- package/hooks/features/columnResize/gridColumnResizeApi.js +1 -0
- package/hooks/features/columnResize/useGridColumnResize.js +28 -1
- package/hooks/features/columns/gridColumnsUtils.js +12 -7
- package/hooks/features/dataSource/useGridDataSourceBase.d.ts +3 -3
- package/hooks/features/editing/useGridCellEditing.js +1 -0
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +1 -1
- package/hooks/features/pagination/gridPaginationSelector.js +3 -0
- package/hooks/features/rowSelection/useGridRowSelection.js +17 -15
- package/hooks/features/rowSelection/utils.js +36 -9
- package/hooks/features/rows/useGridRowSpanning.js +1 -0
- package/index.js +1 -1
- package/internals/index.d.ts +2 -0
- package/internals/index.js +8 -0
- package/locales/ptPT.d.ts +2 -1
- package/locales/ptPT.js +114 -125
- package/locales/svSE.js +2 -2
- package/models/gridAggregation.d.ts +18 -0
- package/models/gridAggregation.js +5 -0
- package/package.json +3 -3
- package/utils/domUtils.d.ts +1 -0
- package/utils/domUtils.js +5 -0
- package/utils/utils.d.ts +1 -1
- 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((
|
|
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
|
|
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',
|
|
552
|
-
(0, _useGridEvent.useGridEvent)(apiRef, 'rowClick',
|
|
553
|
-
(0, _useGridEvent.useGridEvent)(apiRef, 'rowSelectionCheckboxChange',
|
|
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',
|
|
556
|
-
(0, _useGridEvent.useGridEvent)(apiRef, 'cellKeyDown',
|
|
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
|
-
|
|
600
|
-
}, [
|
|
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)) {
|
|
@@ -70,10 +70,21 @@ const checkboxPropsSelector = exports.checkboxPropsSelector = (0, _createSelecto
|
|
|
70
70
|
if (node?.type === 'group') {
|
|
71
71
|
node.children.forEach(traverseDescendants);
|
|
72
72
|
}
|
|
73
|
-
if
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
// Check if row is selectable before considering it for parent selection state
|
|
74
|
+
const descendantRowParams = {
|
|
75
|
+
id: itemToTraverseId,
|
|
76
|
+
row: rowsLookup[itemToTraverseId],
|
|
77
|
+
columns
|
|
78
|
+
};
|
|
79
|
+
const rowIsSelectable = typeof isRowSelectable === 'function' && rowsLookup[itemToTraverseId] ? isRowSelectable(descendantRowParams) : true;
|
|
80
|
+
|
|
81
|
+
// Only consider selectable rows when determining parent selection state
|
|
82
|
+
if (rowIsSelectable) {
|
|
83
|
+
if (rowSelectionManager.has(itemToTraverseId)) {
|
|
84
|
+
hasSelectedDescendant = true;
|
|
85
|
+
} else {
|
|
86
|
+
hasUnSelectedDescendant = true;
|
|
87
|
+
}
|
|
77
88
|
}
|
|
78
89
|
};
|
|
79
90
|
traverseDescendants(groupId);
|
|
@@ -133,21 +144,37 @@ const findRowsToSelect = (apiRef, tree, selectedRow, autoSelectDescendants, auto
|
|
|
133
144
|
}
|
|
134
145
|
if (autoSelectParents) {
|
|
135
146
|
const checkAllDescendantsSelected = rowId => {
|
|
136
|
-
if (!rowSelectionManager.has(rowId) && !selectedDescendants.has(rowId)) {
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
147
|
const node = tree[rowId];
|
|
140
148
|
if (!node) {
|
|
141
149
|
return false;
|
|
142
150
|
}
|
|
151
|
+
// For non-group nodes, check if it's selected or if it's non-selectable
|
|
143
152
|
if (node.type !== 'group') {
|
|
153
|
+
// If the row is selectable, it must be selected
|
|
154
|
+
if (apiRef.current.isRowSelectable(rowId)) {
|
|
155
|
+
return rowSelectionManager.has(rowId) || selectedDescendants.has(rowId);
|
|
156
|
+
}
|
|
157
|
+
// Non-selectable rows don't affect parent selection
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
// For group nodes, check if it's selected or all its children are selected
|
|
161
|
+
if (rowSelectionManager.has(rowId) || selectedDescendants.has(rowId)) {
|
|
144
162
|
return true;
|
|
145
163
|
}
|
|
164
|
+
// Recursively check all children
|
|
146
165
|
return node.children.every(checkAllDescendantsSelected);
|
|
147
166
|
};
|
|
148
167
|
const traverseParents = rowId => {
|
|
149
168
|
const siblings = getFilteredRowNodeSiblings(tree, filteredRows, rowId);
|
|
150
|
-
|
|
169
|
+
// Check if all selectable siblings are selected
|
|
170
|
+
const allSelectableSiblingsSelected = siblings.every(siblingId => {
|
|
171
|
+
// Non-selectable siblings don't affect parent selection
|
|
172
|
+
if (!apiRef.current.isRowSelectable(siblingId)) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
return checkAllDescendantsSelected(siblingId);
|
|
176
|
+
});
|
|
177
|
+
if (siblings.length === 0 || allSelectableSiblingsSelected) {
|
|
151
178
|
const rowNode = tree[rowId];
|
|
152
179
|
const parent = rowNode?.parent;
|
|
153
180
|
if (parent != null && parent !== _gridRowsUtils.GRID_ROOT_GROUP_ID && apiRef.current.isRowSelectable(parent)) {
|
|
@@ -199,6 +199,7 @@ const useGridRowSpanning = (apiRef, props) => {
|
|
|
199
199
|
(0, _useGridEvent.useGridEvent)(apiRef, 'paginationModelChange', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
|
|
200
200
|
(0, _useGridEvent.useGridEvent)(apiRef, 'filteredRowsSet', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
|
|
201
201
|
(0, _useGridEvent.useGridEvent)(apiRef, 'columnsChange', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
|
|
202
|
+
(0, _useGridEvent.useGridEvent)(apiRef, 'rowExpansionChange', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
|
|
202
203
|
React.useEffect(() => {
|
|
203
204
|
const store = apiRef.current.virtualizer?.store;
|
|
204
205
|
if (!store) {
|
package/index.js
CHANGED
package/internals/index.d.ts
CHANGED
|
@@ -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";
|
package/internals/index.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
43
|
-
|
|
41
|
+
toolbarPivot: 'Pivot',
|
|
44
42
|
// Toolbar charts button
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
toolbarCharts: 'Gráficos',
|
|
47
44
|
// Toolbar AI Assistant button
|
|
48
|
-
|
|
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>=': '
|
|
104
|
+
'headerFilterOperator>=': 'Maior que ou igual a',
|
|
109
105
|
'headerFilterOperator<': 'Menor que',
|
|
110
|
-
'headerFilterOperator<=': '
|
|
111
|
-
|
|
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
|
-
|
|
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
|
-
|
|
128
|
-
|
|
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
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
-
|
|
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
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
227
|
+
chartsNoCharts: 'Não há 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
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
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
|
-
|
|
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
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
268
|
+
promptRerun: 'Executar novamente',
|
|
269
|
+
promptProcessing: 'Processando…',
|
|
270
|
+
promptAppliedChanges: 'Alterações aplicadas',
|
|
282
271
|
// Prompt changes
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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);
|
package/locales/svSE.js
CHANGED
|
@@ -9,8 +9,8 @@ const svSEGrid = {
|
|
|
9
9
|
// Root
|
|
10
10
|
noRowsLabel: 'Inga rader',
|
|
11
11
|
noResultsOverlayLabel: 'Inga resultat funna.',
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
noColumnsOverlayLabel: 'Inga kolumner',
|
|
13
|
+
noColumnsOverlayManageColumns: 'Hantera kolumner',
|
|
14
14
|
// emptyPivotOverlayLabel: 'Add fields to rows, columns, and values to create a pivot table',
|
|
15
15
|
|
|
16
16
|
// Density selector toolbar button text
|
|
@@ -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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "8.
|
|
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.
|
|
46
|
-
"@mui/x-virtualizer": "0.
|
|
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",
|
package/utils/domUtils.d.ts
CHANGED
|
@@ -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;
|