@mui/x-data-grid 7.7.0 → 7.8.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 +181 -0
- package/DataGrid/useDataGridComponent.d.ts +0 -1
- package/components/GridFooter.d.ts +1 -1
- package/components/GridLoadingOverlay.d.ts +1 -1
- package/components/GridNoResultsOverlay.d.ts +1 -1
- package/components/GridNoRowsOverlay.d.ts +1 -1
- package/components/GridRowCount.d.ts +1 -1
- package/components/GridSelectedRowCount.d.ts +1 -1
- package/components/cell/GridActionsCellItem.d.ts +3 -3
- package/components/columnHeaders/GridColumnHeaderItem.js +3 -3
- package/components/columnHeaders/GridColumnHeaderSortIcon.d.ts +1 -0
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +11 -6
- package/components/containers/GridFooterContainer.d.ts +1 -1
- package/components/containers/GridOverlay.d.ts +1 -1
- package/components/containers/GridRootStyles.d.ts +0 -1
- package/components/containers/GridRootStyles.js +8 -0
- package/components/containers/GridToolbarContainer.d.ts +1 -1
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/components/virtualization/GridMainContainer.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollerContent.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +1 -1
- package/constants/defaultGridSlotsComponents.js +2 -1
- package/constants/gridClasses.d.ts +5 -0
- package/constants/gridClasses.js +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +2 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +2 -2
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +2 -2
- package/hooks/core/useGridInitialization.d.ts +1 -1
- package/hooks/core/useGridLocaleText.d.ts +1 -1
- package/hooks/core/useGridLoggerFactory.d.ts +1 -1
- package/hooks/features/clipboard/useGridClipboard.d.ts +1 -1
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
- package/hooks/features/density/useGridDensity.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +15 -15
- package/hooks/features/editing/useGridCellEditing.d.ts +1 -1
- package/hooks/features/editing/useGridEditing.d.ts +1 -1
- package/hooks/features/editing/useGridRowEditing.d.ts +1 -1
- package/hooks/features/export/serializers/csvSerializer.d.ts +1 -2
- package/hooks/features/export/serializers/csvSerializer.js +13 -15
- package/hooks/features/export/useGridCsvExport.d.ts +1 -1
- package/hooks/features/export/useGridPrintExport.d.ts +1 -1
- package/hooks/features/export/useGridPrintExport.js +9 -8
- package/hooks/features/filter/gridFilterUtils.d.ts +1 -1
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/focus/useGridFocus.d.ts +1 -1
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/pagination/gridPaginationUtils.d.ts +1 -1
- package/hooks/features/pagination/index.d.ts +1 -1
- package/hooks/features/pagination/useGridPaginationMeta.d.ts +1 -1
- package/hooks/features/pagination/useGridPaginationModel.d.ts +2 -2
- package/hooks/features/pagination/useGridRowCount.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
- package/hooks/features/rows/gridRowsInterfaces.d.ts +10 -2
- package/hooks/features/rows/gridRowsSelector.d.ts +2 -1
- package/hooks/features/rows/gridRowsSelector.js +1 -0
- package/hooks/features/rows/gridRowsUtils.d.ts +8 -6
- package/hooks/features/rows/gridRowsUtils.js +30 -6
- package/hooks/features/rows/useGridRows.d.ts +2 -2
- package/hooks/features/rows/useGridRows.js +39 -21
- package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
- package/hooks/features/scroll/useGridScroll.d.ts +1 -1
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/utils/useGridApiEventHandler.d.ts +2 -2
- package/hooks/utils/useGridApiRef.d.ts +1 -1
- package/hooks/utils/useGridInitializeState.d.ts +1 -1
- package/hooks/utils/useGridRootProps.d.ts +1 -1
- package/hooks/utils/useGridSelector.d.ts +1 -1
- package/hooks/utils/useGridVisibleRows.d.ts +2 -2
- package/index.js +1 -1
- package/internals/index.d.ts +2 -0
- package/internals/index.js +1 -0
- package/internals/utils/propValidation.js +1 -1
- package/locales/ptPT.js +13 -14
- package/models/api/gridApiCommon.d.ts +2 -2
- package/models/api/gridInfiniteLoaderApi.d.ts +0 -1
- package/models/api/gridRowApi.d.ts +14 -0
- package/models/gridColumnGrouping.d.ts +0 -1
- package/models/gridDataSource.d.ts +87 -0
- package/models/gridDataSource.js +1 -0
- package/models/gridRows.d.ts +10 -0
- package/models/gridSlotsComponent.d.ts +5 -0
- package/models/gridSlotsComponentsProps.d.ts +5 -1
- package/models/props/DataGridProps.d.ts +2 -0
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +3 -3
- package/modern/components/columnHeaders/GridColumnHeaderSortIcon.js +11 -6
- package/modern/components/containers/GridRootStyles.js +8 -0
- package/modern/constants/defaultGridSlotsComponents.js +2 -1
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/dimensions/useGridDimensions.js +15 -15
- package/modern/hooks/features/export/serializers/csvSerializer.js +13 -15
- package/modern/hooks/features/export/useGridPrintExport.js +9 -8
- package/modern/hooks/features/rows/gridRowsSelector.js +1 -0
- package/modern/hooks/features/rows/gridRowsUtils.js +30 -6
- package/modern/hooks/features/rows/useGridRows.js +39 -21
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -0
- package/modern/internals/utils/propValidation.js +1 -1
- package/modern/locales/ptPT.js +13 -14
- package/modern/models/gridDataSource.js +1 -0
- package/node/components/columnHeaders/GridColumnHeaderItem.js +3 -3
- package/node/components/columnHeaders/GridColumnHeaderSortIcon.js +11 -6
- package/node/components/containers/GridRootStyles.js +8 -0
- package/node/constants/defaultGridSlotsComponents.js +1 -0
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/dimensions/useGridDimensions.js +15 -15
- package/node/hooks/features/export/serializers/csvSerializer.js +13 -15
- package/node/hooks/features/export/useGridPrintExport.js +9 -8
- package/node/hooks/features/rows/gridRowsSelector.js +2 -1
- package/node/hooks/features/rows/gridRowsUtils.js +31 -6
- package/node/hooks/features/rows/useGridRows.js +37 -19
- package/node/index.js +1 -1
- package/node/internals/index.js +7 -0
- package/node/internals/utils/propValidation.js +1 -1
- package/node/locales/ptPT.js +13 -14
- package/node/models/gridDataSource.js +5 -0
- package/package.json +3 -3
- package/utils/cleanupTracking/TimerBasedCleanupTracking.d.ts +0 -1
- package/utils/domUtils.d.ts +0 -1
- package/utils/getPublicApiRef.d.ts +1 -2
- package/utils/keyboardUtils.d.ts +1 -1
- package/utils/warning.d.ts +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.gridTopLevelRowCountSelector = exports.gridRowsLookupSelector = exports.gridRowsLoadingSelector = exports.gridRowsDataRowIdToIdLookupSelector = exports.gridRowTreeSelector = exports.gridRowTreeDepthsSelector = exports.gridRowMaximumTreeDepthSelector = exports.gridRowGroupingNameSelector = exports.gridRowCountSelector = exports.gridPinnedRowsSelector = exports.gridPinnedRowsCountSelector = exports.gridDataRowIdsSelector = exports.gridAdditionalRowGroupsSelector = void 0;
|
|
6
|
+
exports.gridTopLevelRowCountSelector = exports.gridRowsLookupSelector = exports.gridRowsLoadingSelector = exports.gridRowsDataRowIdToIdLookupSelector = exports.gridRowTreeSelector = exports.gridRowTreeDepthsSelector = exports.gridRowMaximumTreeDepthSelector = exports.gridRowGroupsToFetchSelector = exports.gridRowGroupingNameSelector = exports.gridRowCountSelector = exports.gridPinnedRowsSelector = exports.gridPinnedRowsCountSelector = exports.gridDataRowIdsSelector = exports.gridAdditionalRowGroupsSelector = void 0;
|
|
7
7
|
var _createSelector = require("../../../utils/createSelector");
|
|
8
8
|
const gridRowsStateSelector = state => state.rows;
|
|
9
9
|
const gridRowCountSelector = exports.gridRowCountSelector = (0, _createSelector.createSelector)(gridRowsStateSelector, rows => rows.totalRowCount);
|
|
@@ -14,6 +14,7 @@ const gridTopLevelRowCountSelector = exports.gridTopLevelRowCountSelector = (0,
|
|
|
14
14
|
const gridRowsLookupSelector = exports.gridRowsLookupSelector = (0, _createSelector.createSelector)(gridRowsStateSelector, rows => rows.dataRowIdToModelLookup);
|
|
15
15
|
const gridRowsDataRowIdToIdLookupSelector = exports.gridRowsDataRowIdToIdLookupSelector = (0, _createSelector.createSelector)(gridRowsStateSelector, rows => rows.dataRowIdToIdLookup);
|
|
16
16
|
const gridRowTreeSelector = exports.gridRowTreeSelector = (0, _createSelector.createSelector)(gridRowsStateSelector, rows => rows.tree);
|
|
17
|
+
const gridRowGroupsToFetchSelector = exports.gridRowGroupsToFetchSelector = (0, _createSelector.createSelector)(gridRowsStateSelector, rows => rows.groupsToFetch);
|
|
17
18
|
const gridRowGroupingNameSelector = exports.gridRowGroupingNameSelector = (0, _createSelector.createSelector)(gridRowsStateSelector, rows => rows.groupingName);
|
|
18
19
|
const gridRowTreeDepthsSelector = exports.gridRowTreeDepthsSelector = (0, _createSelector.createSelector)(gridRowsStateSelector, rows => rows.treeDepths);
|
|
19
20
|
const gridRowMaximumTreeDepthSelector = exports.gridRowMaximumTreeDepthSelector = (0, _createSelector.createSelectorMemoized)(gridRowsStateSelector, rows => {
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.buildRootGroup = exports.GRID_ROOT_GROUP_ID = exports.GRID_ID_AUTOGENERATED = void 0;
|
|
8
8
|
exports.calculatePinnedRowsHeight = calculatePinnedRowsHeight;
|
|
9
9
|
exports.checkGridRowIdIsValid = checkGridRowIdIsValid;
|
|
10
|
+
exports.computeRowsUpdates = computeRowsUpdates;
|
|
10
11
|
exports.createRowsInternalCache = void 0;
|
|
11
12
|
exports.getMinimalContentHeight = getMinimalContentHeight;
|
|
12
13
|
exports.updateCacheWithNewRows = exports.isAutoGeneratedRow = exports.getTreeNodeDescendants = exports.getTopLevelRowCount = exports.getRowsStateFromCache = exports.getRowIdFromRowModel = void 0;
|
|
@@ -88,7 +89,8 @@ const getRowsStateFromCache = ({
|
|
|
88
89
|
rowCountProp = 0,
|
|
89
90
|
loadingProp,
|
|
90
91
|
previousTree,
|
|
91
|
-
previousTreeDepths
|
|
92
|
+
previousTreeDepths,
|
|
93
|
+
previousGroupsToFetch
|
|
92
94
|
}) => {
|
|
93
95
|
const cache = apiRef.current.caches.rows;
|
|
94
96
|
|
|
@@ -97,13 +99,15 @@ const getRowsStateFromCache = ({
|
|
|
97
99
|
tree: unProcessedTree,
|
|
98
100
|
treeDepths: unProcessedTreeDepths,
|
|
99
101
|
dataRowIds: unProcessedDataRowIds,
|
|
100
|
-
groupingName
|
|
102
|
+
groupingName,
|
|
103
|
+
groupsToFetch = []
|
|
101
104
|
} = apiRef.current.applyStrategyProcessor('rowTreeCreation', {
|
|
102
105
|
previousTree,
|
|
103
106
|
previousTreeDepths,
|
|
104
107
|
updates: cache.updates,
|
|
105
108
|
dataRowIdToIdLookup: cache.dataRowIdToIdLookup,
|
|
106
|
-
dataRowIdToModelLookup: cache.dataRowIdToModelLookup
|
|
109
|
+
dataRowIdToModelLookup: cache.dataRowIdToModelLookup,
|
|
110
|
+
previousGroupsToFetch
|
|
107
111
|
});
|
|
108
112
|
|
|
109
113
|
// 2. Apply the "hydrateRows" pipe-processing.
|
|
@@ -132,7 +136,8 @@ const getRowsStateFromCache = ({
|
|
|
132
136
|
rowCountProp
|
|
133
137
|
}),
|
|
134
138
|
groupingName,
|
|
135
|
-
loading: loadingProp
|
|
139
|
+
loading: loadingProp,
|
|
140
|
+
groupsToFetch
|
|
136
141
|
});
|
|
137
142
|
};
|
|
138
143
|
exports.getRowsStateFromCache = getRowsStateFromCache;
|
|
@@ -163,7 +168,8 @@ exports.getTreeNodeDescendants = getTreeNodeDescendants;
|
|
|
163
168
|
const updateCacheWithNewRows = ({
|
|
164
169
|
previousCache,
|
|
165
170
|
getRowId,
|
|
166
|
-
updates
|
|
171
|
+
updates,
|
|
172
|
+
groupKeys
|
|
167
173
|
}) => {
|
|
168
174
|
if (previousCache.updates.type === 'full') {
|
|
169
175
|
throw new Error('MUI X: Unable to prepare a partial update if a full update is not applied yet.');
|
|
@@ -187,7 +193,8 @@ const updateCacheWithNewRows = ({
|
|
|
187
193
|
modify: [...(previousCache.updates.actions.modify ?? [])],
|
|
188
194
|
remove: [...(previousCache.updates.actions.remove ?? [])]
|
|
189
195
|
},
|
|
190
|
-
idToActionLookup: (0, _extends2.default)({}, previousCache.updates.idToActionLookup)
|
|
196
|
+
idToActionLookup: (0, _extends2.default)({}, previousCache.updates.idToActionLookup),
|
|
197
|
+
groupKeys
|
|
191
198
|
};
|
|
192
199
|
const dataRowIdToModelLookup = (0, _extends2.default)({}, previousCache.dataRowIdToModelLookup);
|
|
193
200
|
const dataRowIdToIdLookup = (0, _extends2.default)({}, previousCache.dataRowIdToIdLookup);
|
|
@@ -301,4 +308,22 @@ function calculatePinnedRowsHeight(apiRef) {
|
|
|
301
308
|
function getMinimalContentHeight(apiRef) {
|
|
302
309
|
const dimensions = (0, _gridDimensionsSelectors.gridDimensionsSelector)(apiRef.current.state);
|
|
303
310
|
return `var(--DataGrid-overlayHeight, ${2 * dimensions.rowHeight}px)`;
|
|
311
|
+
}
|
|
312
|
+
function computeRowsUpdates(apiRef, updates, getRowId) {
|
|
313
|
+
const nonPinnedRowsUpdates = [];
|
|
314
|
+
updates.forEach(update => {
|
|
315
|
+
const id = getRowIdFromRowModel(update, getRowId, 'A row was provided without id when calling updateRows():');
|
|
316
|
+
const rowNode = apiRef.current.getRowNode(id);
|
|
317
|
+
if (rowNode?.type === 'pinnedRow') {
|
|
318
|
+
// @ts-ignore because otherwise `release:build` doesn't work
|
|
319
|
+
const pinnedRowsCache = apiRef.current.caches.pinnedRows;
|
|
320
|
+
const prevModel = pinnedRowsCache.idLookup[id];
|
|
321
|
+
if (prevModel) {
|
|
322
|
+
pinnedRowsCache.idLookup[id] = (0, _extends2.default)({}, prevModel, update);
|
|
323
|
+
}
|
|
324
|
+
} else {
|
|
325
|
+
nonPinnedRowsUpdates.push(update);
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
return nonPinnedRowsUpdates;
|
|
304
329
|
}
|
|
@@ -20,8 +20,9 @@ var _pipeProcessing = require("../../core/pipeProcessing");
|
|
|
20
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
22
|
const rowsStateInitializer = (state, props, apiRef) => {
|
|
23
|
+
const isDataSourceAvailable = !!props.unstable_dataSource;
|
|
23
24
|
apiRef.current.caches.rows = (0, _gridRowsUtils.createRowsInternalCache)({
|
|
24
|
-
rows: props.rows,
|
|
25
|
+
rows: isDataSourceAvailable ? [] : props.rows,
|
|
25
26
|
getRowId: props.getRowId,
|
|
26
27
|
loading: props.loading,
|
|
27
28
|
rowCount: props.rowCount
|
|
@@ -30,7 +31,7 @@ const rowsStateInitializer = (state, props, apiRef) => {
|
|
|
30
31
|
rows: (0, _gridRowsUtils.getRowsStateFromCache)({
|
|
31
32
|
apiRef,
|
|
32
33
|
rowCountProp: props.rowCount,
|
|
33
|
-
loadingProp: props.loading,
|
|
34
|
+
loadingProp: isDataSourceAvailable ? true : props.loading,
|
|
34
35
|
previousTree: null,
|
|
35
36
|
previousTreeDepths: null
|
|
36
37
|
})
|
|
@@ -92,7 +93,8 @@ const useGridRows = (apiRef, props) => {
|
|
|
92
93
|
rowCountProp: props.rowCount,
|
|
93
94
|
loadingProp: props.loading,
|
|
94
95
|
previousTree: (0, _gridRowsSelector.gridRowTreeSelector)(apiRef),
|
|
95
|
-
previousTreeDepths: (0, _gridRowsSelector.gridRowTreeDepthsSelector)(apiRef)
|
|
96
|
+
previousTreeDepths: (0, _gridRowsSelector.gridRowTreeDepthsSelector)(apiRef),
|
|
97
|
+
previousGroupsToFetch: (0, _gridRowsSelector.gridRowGroupsToFetchSelector)(apiRef)
|
|
96
98
|
})
|
|
97
99
|
}));
|
|
98
100
|
apiRef.current.publishEvent('rowsSet');
|
|
@@ -134,21 +136,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
134
136
|
if (props.signature === _useGridApiEventHandler.GridSignature.DataGrid && updates.length > 1) {
|
|
135
137
|
throw new Error(['MUI X: You cannot update several rows at once in `apiRef.current.updateRows` on the DataGrid.', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
|
|
136
138
|
}
|
|
137
|
-
const nonPinnedRowsUpdates =
|
|
138
|
-
updates.forEach(update => {
|
|
139
|
-
const id = (0, _gridRowsUtils.getRowIdFromRowModel)(update, props.getRowId, 'A row was provided without id when calling updateRows():');
|
|
140
|
-
const rowNode = apiRef.current.getRowNode(id);
|
|
141
|
-
if (rowNode?.type === 'pinnedRow') {
|
|
142
|
-
// @ts-ignore because otherwise `release:build` doesn't work
|
|
143
|
-
const pinnedRowsCache = apiRef.current.caches.pinnedRows;
|
|
144
|
-
const prevModel = pinnedRowsCache.idLookup[id];
|
|
145
|
-
if (prevModel) {
|
|
146
|
-
pinnedRowsCache.idLookup[id] = (0, _extends2.default)({}, prevModel, update);
|
|
147
|
-
}
|
|
148
|
-
} else {
|
|
149
|
-
nonPinnedRowsUpdates.push(update);
|
|
150
|
-
}
|
|
151
|
-
});
|
|
139
|
+
const nonPinnedRowsUpdates = (0, _gridRowsUtils.computeRowsUpdates)(apiRef, updates, props.getRowId);
|
|
152
140
|
const cache = (0, _gridRowsUtils.updateCacheWithNewRows)({
|
|
153
141
|
updates: nonPinnedRowsUpdates,
|
|
154
142
|
getRowId: props.getRowId,
|
|
@@ -159,6 +147,31 @@ const useGridRows = (apiRef, props) => {
|
|
|
159
147
|
throttle: true
|
|
160
148
|
});
|
|
161
149
|
}, [props.signature, props.getRowId, throttledRowsChange, apiRef]);
|
|
150
|
+
const updateServerRows = React.useCallback((updates, groupKeys) => {
|
|
151
|
+
const nonPinnedRowsUpdates = (0, _gridRowsUtils.computeRowsUpdates)(apiRef, updates, props.getRowId);
|
|
152
|
+
const cache = (0, _gridRowsUtils.updateCacheWithNewRows)({
|
|
153
|
+
updates: nonPinnedRowsUpdates,
|
|
154
|
+
getRowId: props.getRowId,
|
|
155
|
+
previousCache: apiRef.current.caches.rows,
|
|
156
|
+
groupKeys: groupKeys ?? []
|
|
157
|
+
});
|
|
158
|
+
throttledRowsChange({
|
|
159
|
+
cache,
|
|
160
|
+
throttle: false
|
|
161
|
+
});
|
|
162
|
+
}, [props.getRowId, throttledRowsChange, apiRef]);
|
|
163
|
+
const setLoading = React.useCallback(loading => {
|
|
164
|
+
if (loading === props.loading) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
logger.debug(`Setting loading to ${loading}`);
|
|
168
|
+
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
169
|
+
rows: (0, _extends2.default)({}, state.rows, {
|
|
170
|
+
loading
|
|
171
|
+
})
|
|
172
|
+
}));
|
|
173
|
+
apiRef.current.caches.rows.loadingPropBeforePartialUpdates = loading;
|
|
174
|
+
}, [props.loading, apiRef, logger]);
|
|
162
175
|
const getRowModels = React.useCallback(() => {
|
|
163
176
|
const dataRows = (0, _gridRowsSelector.gridDataRowIdsSelector)(apiRef);
|
|
164
177
|
const idRowsLookup = (0, _gridRowsSelector.gridRowsLookupSelector)(apiRef);
|
|
@@ -313,6 +326,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
313
326
|
}, [apiRef, props.signature, props.getRowId]);
|
|
314
327
|
const rowApi = {
|
|
315
328
|
getRow,
|
|
329
|
+
setLoading,
|
|
316
330
|
getRowId,
|
|
317
331
|
getRowModels,
|
|
318
332
|
getRowsCount,
|
|
@@ -328,6 +342,9 @@ const useGridRows = (apiRef, props) => {
|
|
|
328
342
|
setRowChildrenExpansion,
|
|
329
343
|
getRowGroupChildren
|
|
330
344
|
};
|
|
345
|
+
const rowProPrivateApi = {
|
|
346
|
+
updateServerRows
|
|
347
|
+
};
|
|
331
348
|
|
|
332
349
|
/**
|
|
333
350
|
* EVENTS
|
|
@@ -402,6 +419,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
402
419
|
(0, _pipeProcessing.useGridRegisterPipeApplier)(apiRef, 'hydrateRows', applyHydrateRowsProcessor);
|
|
403
420
|
(0, _useGridApiMethod.useGridApiMethod)(apiRef, rowApi, 'public');
|
|
404
421
|
(0, _useGridApiMethod.useGridApiMethod)(apiRef, rowProApi, props.signature === _useGridApiEventHandler.GridSignature.DataGrid ? 'private' : 'public');
|
|
422
|
+
(0, _useGridApiMethod.useGridApiMethod)(apiRef, rowProPrivateApi, 'private');
|
|
405
423
|
|
|
406
424
|
// The effect do not track any value defined synchronously during the 1st render by hooks called after `useGridRows`
|
|
407
425
|
// As a consequence, the state generated by the 1st run of this useEffect will always be equal to the initialization one
|
|
@@ -446,7 +464,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
446
464
|
return;
|
|
447
465
|
}
|
|
448
466
|
}
|
|
449
|
-
logger.debug(`Updating all rows, new length ${props.rows
|
|
467
|
+
logger.debug(`Updating all rows, new length ${props.rows?.length}`);
|
|
450
468
|
throttledRowsChange({
|
|
451
469
|
cache: (0, _gridRowsUtils.createRowsInternalCache)({
|
|
452
470
|
rows: props.rows,
|
package/node/index.js
CHANGED
package/node/internals/index.js
CHANGED
|
@@ -57,6 +57,7 @@ var _exportNames = {
|
|
|
57
57
|
useGridParamsApi: true,
|
|
58
58
|
gridAdditionalRowGroupsSelector: true,
|
|
59
59
|
gridPinnedRowsSelector: true,
|
|
60
|
+
gridRowGroupsToFetchSelector: true,
|
|
60
61
|
headerFilteringStateInitializer: true,
|
|
61
62
|
useGridHeaderFiltering: true,
|
|
62
63
|
useGridRowSelection: true,
|
|
@@ -313,6 +314,12 @@ Object.defineProperty(exports, "gridPinnedRowsSelector", {
|
|
|
313
314
|
return _gridRowsSelector.gridPinnedRowsSelector;
|
|
314
315
|
}
|
|
315
316
|
});
|
|
317
|
+
Object.defineProperty(exports, "gridRowGroupsToFetchSelector", {
|
|
318
|
+
enumerable: true,
|
|
319
|
+
get: function () {
|
|
320
|
+
return _gridRowsSelector.gridRowGroupsToFetchSelector;
|
|
321
|
+
}
|
|
322
|
+
});
|
|
316
323
|
Object.defineProperty(exports, "headerFilteringStateInitializer", {
|
|
317
324
|
enumerable: true,
|
|
318
325
|
get: function () {
|
|
@@ -8,7 +8,7 @@ exports.propValidatorsDataGrid = void 0;
|
|
|
8
8
|
exports.validateProps = validateProps;
|
|
9
9
|
var _utils = require("../../utils/utils");
|
|
10
10
|
var _useGridApiEventHandler = require("../../hooks/utils/useGridApiEventHandler");
|
|
11
|
-
const propValidatorsDataGrid = exports.propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.paginationMode === 'client' && props.paginationMeta != null && ['MUI X: Usage of the `paginationMeta` prop with client-side pagination (`paginationMode="client"`) has no effect.', '`paginationMeta` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.signature === _useGridApiEventHandler.GridSignature.DataGrid && props.paginationMode === 'client' && (0, _utils.isNumber)(props.rowCount) && ['MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect.', '`rowCount` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.paginationMode === 'server' && props.rowCount == null && ["MUI X: The `rowCount` prop must be passed using `paginationMode='server'`", 'For more detail, see http://mui.com/components/data-grid/pagination/#index-based-pagination'].join('\n') || undefined];
|
|
11
|
+
const propValidatorsDataGrid = exports.propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.paginationMode === 'client' && props.paginationMeta != null && ['MUI X: Usage of the `paginationMeta` prop with client-side pagination (`paginationMode="client"`) has no effect.', '`paginationMeta` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.signature === _useGridApiEventHandler.GridSignature.DataGrid && props.paginationMode === 'client' && (0, _utils.isNumber)(props.rowCount) && ['MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect.', '`rowCount` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.paginationMode === 'server' && props.rowCount == null && !props.unstable_dataSource && ["MUI X: The `rowCount` prop must be passed using `paginationMode='server'`", 'For more detail, see http://mui.com/components/data-grid/pagination/#index-based-pagination'].join('\n') || undefined];
|
|
12
12
|
const warnedOnceCache = new Set();
|
|
13
13
|
function warnOnce(message) {
|
|
14
14
|
if (!warnedOnceCache.has(message)) {
|
package/node/locales/ptPT.js
CHANGED
|
@@ -32,18 +32,17 @@ const ptPTGrid = {
|
|
|
32
32
|
// Export selector toolbar button text
|
|
33
33
|
toolbarExport: 'Exportar',
|
|
34
34
|
toolbarExportLabel: 'Exportar',
|
|
35
|
-
toolbarExportCSV: '
|
|
35
|
+
toolbarExportCSV: 'Descarregar como CSV',
|
|
36
36
|
toolbarExportPrint: 'Imprimir',
|
|
37
|
-
toolbarExportExcel: '
|
|
37
|
+
toolbarExportExcel: 'Descarregar como Excel',
|
|
38
38
|
// Columns management text
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
columnsManagementSearchTitle: 'Procurar',
|
|
40
|
+
columnsManagementNoColumns: 'Sem colunas',
|
|
41
|
+
columnsManagementShowHideAllText: 'Mostrar/Ocultar Todas',
|
|
42
|
+
columnsManagementReset: 'Repor',
|
|
44
43
|
// Filter panel text
|
|
45
44
|
filterPanelAddFilter: 'Adicionar filtro',
|
|
46
|
-
filterPanelRemoveAll: '
|
|
45
|
+
filterPanelRemoveAll: 'Excluir todos',
|
|
47
46
|
filterPanelDeleteIconLabel: 'Excluir',
|
|
48
47
|
filterPanelLogicOperator: 'Operador lógico',
|
|
49
48
|
filterPanelOperator: 'Operador',
|
|
@@ -97,9 +96,9 @@ const ptPTGrid = {
|
|
|
97
96
|
filterValueTrue: 'verdadeiro',
|
|
98
97
|
filterValueFalse: 'falso',
|
|
99
98
|
// Column menu text
|
|
100
|
-
columnMenuLabel: '
|
|
99
|
+
columnMenuLabel: 'Menu',
|
|
101
100
|
columnMenuShowColumns: 'Mostrar colunas',
|
|
102
|
-
columnMenuManageColumns: '
|
|
101
|
+
columnMenuManageColumns: 'Gerir colunas',
|
|
103
102
|
columnMenuFilter: 'Filtro',
|
|
104
103
|
columnMenuHideColumn: 'Ocultar coluna',
|
|
105
104
|
columnMenuUnsort: 'Desclassificar',
|
|
@@ -129,10 +128,10 @@ const ptPTGrid = {
|
|
|
129
128
|
// Column pinning text
|
|
130
129
|
pinToLeft: 'Fixar à esquerda',
|
|
131
130
|
pinToRight: 'Fixar à direita',
|
|
132
|
-
unpin: '
|
|
131
|
+
unpin: 'Desafixar',
|
|
133
132
|
// Tree Data
|
|
134
|
-
treeDataGroupingHeaderName: '
|
|
135
|
-
treeDataExpand: '
|
|
133
|
+
treeDataGroupingHeaderName: 'Grupo',
|
|
134
|
+
treeDataExpand: 'ver crianças',
|
|
136
135
|
treeDataCollapse: 'esconder crianças',
|
|
137
136
|
// Grouping columns
|
|
138
137
|
groupingColumnHeaderName: 'Grupo',
|
|
@@ -141,7 +140,7 @@ const ptPTGrid = {
|
|
|
141
140
|
// Master/detail
|
|
142
141
|
detailPanelToggle: 'Alternar painel de detalhes',
|
|
143
142
|
expandDetailPanel: 'Expandir',
|
|
144
|
-
collapseDetailPanel: '
|
|
143
|
+
collapseDetailPanel: 'Colapsar',
|
|
145
144
|
// Row reordering text
|
|
146
145
|
rowReorderingHeaderName: 'Reordenação de linhas',
|
|
147
146
|
// Aggregation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.8.0",
|
|
4
4
|
"description": "The Community plan edition of the Data Grid components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@babel/runtime": "^7.24.7",
|
|
41
|
-
"@mui/system": "^5.15.
|
|
42
|
-
"@mui/utils": "^5.15.
|
|
41
|
+
"@mui/system": "^5.15.20",
|
|
42
|
+
"@mui/utils": "^5.15.20",
|
|
43
43
|
"clsx": "^2.1.1",
|
|
44
44
|
"prop-types": "^15.8.1",
|
|
45
45
|
"reselect": "^4.1.8"
|
package/utils/domUtils.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { GridPrivateApiCommunity } from '../models/api/gridApiCommunity';
|
|
3
|
-
export declare function getPublicApiRef<PrivateApi extends GridPrivateApiCommunity>(apiRef: React.MutableRefObject<PrivateApi>):
|
|
2
|
+
export declare function getPublicApiRef<PrivateApi extends GridPrivateApiCommunity>(apiRef: React.MutableRefObject<PrivateApi>): React.MutableRefObject<ReturnType<PrivateApi["getPublicApi"]>>;
|
package/utils/keyboardUtils.d.ts
CHANGED
|
@@ -17,5 +17,5 @@ export declare const isCellExitEditModeKeys: (key: string) => boolean;
|
|
|
17
17
|
export declare const isCellEditCommitKeys: (key: string) => boolean;
|
|
18
18
|
export declare const isNavigationKey: (key: string) => boolean;
|
|
19
19
|
export declare const isKeyboardEvent: (event: any) => event is React.KeyboardEvent<HTMLElement>;
|
|
20
|
-
export declare const isHideMenuKey: (key: React.KeyboardEvent[
|
|
20
|
+
export declare const isHideMenuKey: (key: React.KeyboardEvent["key"]) => boolean;
|
|
21
21
|
export declare function isPasteShortcut(event: React.KeyboardEvent): boolean;
|
package/utils/warning.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const buildWarning: (message: string | string[], gravity?:
|
|
1
|
+
export declare const buildWarning: (message: string | string[], gravity?: "warning" | "error") => () => void;
|
|
2
2
|
export declare const wrapWithWarningOnCall: <F extends Function>(method: F, message: string | string[]) => F | ((...args: any[]) => any);
|