@mui/x-data-grid 6.18.0 → 7.0.0-alpha.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 +212 -5
- package/DataGrid/DataGrid.js +0 -10
- package/DataGrid/useDataGridProps.js +9 -14
- package/colDef/gridActionsColDef.js +1 -2
- package/colDef/gridBooleanColDef.js +0 -1
- package/colDef/gridBooleanOperators.js +3 -4
- package/colDef/gridCheckboxSelectionColDef.js +0 -1
- package/colDef/gridDateOperators.js +10 -11
- package/colDef/gridNumericColDef.js +1 -3
- package/colDef/gridNumericOperators.d.ts +2 -2
- package/colDef/gridNumericOperators.js +13 -14
- package/colDef/gridSingleSelectOperators.js +5 -6
- package/colDef/gridStringColDef.js +1 -3
- package/colDef/gridStringOperators.d.ts +2 -2
- package/colDef/gridStringOperators.js +17 -13
- package/components/cell/GridActionsCell.js +19 -12
- package/components/cell/GridCell.js +4 -4
- package/constants/defaultGridSlotsComponents.js +17 -17
- package/hooks/features/export/useGridPrintExport.js +7 -10
- package/hooks/features/filter/gridFilterUtils.d.ts +1 -0
- package/hooks/features/filter/gridFilterUtils.js +20 -71
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/filter/useGridFilter.js +2 -1
- package/hooks/features/rows/useGridRows.js +4 -1
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/internals/utils/computeSlots.d.ts +4 -6
- package/internals/utils/computeSlots.js +10 -9
- package/internals/utils/index.d.ts +0 -1
- package/internals/utils/index.js +0 -1
- package/internals/utils/useProps.d.ts +1 -8
- package/internals/utils/useProps.js +5 -8
- package/joy/icons.d.ts +1 -2
- package/joy/joySlots.d.ts +1 -2
- package/legacy/DataGrid/DataGrid.js +0 -10
- package/legacy/DataGrid/useDataGridProps.js +10 -18
- package/legacy/colDef/gridActionsColDef.js +1 -2
- package/legacy/colDef/gridBooleanColDef.js +0 -1
- package/legacy/colDef/gridBooleanOperators.js +3 -4
- package/legacy/colDef/gridCheckboxSelectionColDef.js +0 -1
- package/legacy/colDef/gridDateOperators.js +10 -11
- package/legacy/colDef/gridNumericColDef.js +1 -3
- package/legacy/colDef/gridNumericOperators.js +13 -14
- package/legacy/colDef/gridSingleSelectOperators.js +5 -6
- package/legacy/colDef/gridStringColDef.js +1 -3
- package/legacy/colDef/gridStringOperators.js +17 -13
- package/legacy/components/cell/GridActionsCell.js +21 -12
- package/legacy/components/cell/GridCell.js +6 -4
- package/legacy/constants/defaultGridSlotsComponents.js +17 -17
- package/legacy/hooks/features/export/useGridPrintExport.js +7 -10
- package/legacy/hooks/features/filter/gridFilterUtils.js +20 -71
- package/legacy/hooks/features/filter/useGridFilter.js +2 -1
- package/legacy/hooks/features/rows/useGridRows.js +2 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +1 -1
- package/legacy/internals/utils/computeSlots.js +10 -9
- package/legacy/internals/utils/index.js +0 -1
- package/legacy/internals/utils/useProps.js +5 -6
- package/legacy/locales/csCZ.js +2 -2
- package/legacy/material/index.js +48 -48
- package/legacy/utils/getPublicApiRef.js +5 -0
- package/locales/csCZ.js +2 -2
- package/material/index.js +48 -48
- package/models/api/gridFilterApi.d.ts +5 -0
- package/models/colDef/gridColDef.d.ts +4 -14
- package/models/colDef/index.d.ts +1 -1
- package/models/gridFilterOperator.d.ts +4 -16
- package/models/gridIconSlotsComponent.d.ts +35 -36
- package/models/gridSlotsComponent.d.ts +31 -34
- package/models/index.d.ts +1 -1
- package/models/props/DataGridProps.d.ts +3 -14
- package/modern/DataGrid/DataGrid.js +0 -10
- package/modern/DataGrid/useDataGridProps.js +7 -9
- package/modern/colDef/gridActionsColDef.js +1 -2
- package/modern/colDef/gridBooleanColDef.js +0 -1
- package/modern/colDef/gridBooleanOperators.js +3 -4
- package/modern/colDef/gridCheckboxSelectionColDef.js +0 -1
- package/modern/colDef/gridDateOperators.js +10 -11
- package/modern/colDef/gridNumericColDef.js +1 -3
- package/modern/colDef/gridNumericOperators.js +13 -14
- package/modern/colDef/gridSingleSelectOperators.js +5 -6
- package/modern/colDef/gridStringColDef.js +1 -3
- package/modern/colDef/gridStringOperators.js +17 -13
- package/modern/components/cell/GridActionsCell.js +18 -12
- package/modern/components/cell/GridCell.js +3 -3
- package/modern/constants/defaultGridSlotsComponents.js +17 -17
- package/modern/hooks/features/export/useGridPrintExport.js +6 -10
- package/modern/hooks/features/filter/gridFilterUtils.js +20 -70
- package/modern/hooks/features/filter/useGridFilter.js +2 -1
- package/modern/hooks/features/rows/useGridRows.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/internals/utils/computeSlots.js +10 -9
- package/modern/internals/utils/index.js +0 -1
- package/modern/internals/utils/useProps.js +5 -8
- package/modern/locales/csCZ.js +2 -2
- package/modern/material/index.js +48 -48
- package/modern/utils/getPublicApiRef.js +5 -0
- package/node/DataGrid/DataGrid.js +0 -10
- package/node/DataGrid/useDataGridProps.js +6 -8
- package/node/colDef/gridActionsColDef.js +1 -2
- package/node/colDef/gridBooleanColDef.js +0 -1
- package/node/colDef/gridBooleanOperators.js +3 -4
- package/node/colDef/gridCheckboxSelectionColDef.js +0 -1
- package/node/colDef/gridDateOperators.js +10 -11
- package/node/colDef/gridNumericColDef.js +1 -3
- package/node/colDef/gridNumericOperators.js +14 -14
- package/node/colDef/gridSingleSelectOperators.js +5 -6
- package/node/colDef/gridStringColDef.js +1 -3
- package/node/colDef/gridStringOperators.js +18 -13
- package/node/components/cell/GridActionsCell.js +18 -12
- package/node/components/cell/GridCell.js +3 -3
- package/node/constants/defaultGridSlotsComponents.js +17 -17
- package/node/hooks/features/export/useGridPrintExport.js +5 -9
- package/node/hooks/features/filter/gridFilterUtils.js +21 -70
- package/node/hooks/features/filter/useGridFilter.js +2 -1
- package/node/hooks/features/rows/useGridRows.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +13 -13
- package/node/internals/utils/computeSlots.js +10 -8
- package/node/internals/utils/index.js +0 -11
- package/node/internals/utils/useProps.js +4 -8
- package/node/locales/csCZ.js +2 -2
- package/node/material/index.js +48 -48
- package/node/utils/getPublicApiRef.js +11 -0
- package/package.json +1 -1
- package/utils/getPublicApiRef.d.ts +3 -0
- package/utils/getPublicApiRef.js +5 -0
- package/colDef/utils.d.ts +0 -21
- package/colDef/utils.js +0 -51
- package/internals/utils/slotsMigration.d.ts +0 -4
- package/internals/utils/slotsMigration.js +0 -13
- package/legacy/colDef/utils.js +0 -51
- package/legacy/internals/utils/slotsMigration.js +0 -14
- package/modern/colDef/utils.js +0 -51
- package/modern/internals/utils/slotsMigration.js +0 -13
- package/node/colDef/utils.js +0 -63
- package/node/internals/utils/slotsMigration.js +0 -21
|
@@ -447,8 +447,8 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
447
447
|
value,
|
|
448
448
|
formattedValue
|
|
449
449
|
} = cellParamsWithAPI;
|
|
450
|
-
const
|
|
451
|
-
const tabIndex = (cellMode === 'view' || !isEditable) && !
|
|
450
|
+
const canManageOwnFocus = column.type === 'actions' && column.getActions?.(apiRef.current.getRowParams(rowId)).some(action => !action.props.disabled);
|
|
451
|
+
const tabIndex = (cellMode === 'view' || !isEditable) && !canManageOwnFocus ? cellParamsWithAPI.tabIndex : -1;
|
|
452
452
|
const {
|
|
453
453
|
classes: rootClasses,
|
|
454
454
|
getCellClassName
|
|
@@ -586,7 +586,7 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
586
586
|
children: valueString
|
|
587
587
|
});
|
|
588
588
|
}
|
|
589
|
-
if ( /*#__PURE__*/React.isValidElement(children) &&
|
|
589
|
+
if ( /*#__PURE__*/React.isValidElement(children) && canManageOwnFocus) {
|
|
590
590
|
children = /*#__PURE__*/React.cloneElement(children, {
|
|
591
591
|
focusElementRef
|
|
592
592
|
});
|
|
@@ -15,21 +15,21 @@ var _material = _interopRequireDefault(require("../material"));
|
|
|
15
15
|
// TODO: camelCase these key. It's a private helper now.
|
|
16
16
|
// Remove then need to call `uncapitalizeObjectKeys`.
|
|
17
17
|
const DATA_GRID_DEFAULT_SLOTS_COMPONENTS = exports.DATA_GRID_DEFAULT_SLOTS_COMPONENTS = (0, _extends2.default)({}, _material.default, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
cell: _GridCell.GridCellV7,
|
|
19
|
+
skeletonCell: _components.GridSkeletonCell,
|
|
20
|
+
columnHeaderFilterIconButton: _components.GridColumnHeaderFilterIconButton,
|
|
21
|
+
columnMenu: _GridColumnMenu.GridColumnMenu,
|
|
22
|
+
columnHeaders: _GridColumnHeaders.GridColumnHeaders,
|
|
23
|
+
footer: _components.GridFooter,
|
|
24
|
+
footerRowCount: _components.GridRowCount,
|
|
25
|
+
toolbar: null,
|
|
26
|
+
preferencesPanel: _components.GridPreferencesPanel,
|
|
27
|
+
loadingOverlay: _components.GridLoadingOverlay,
|
|
28
|
+
noResultsOverlay: _GridNoResultsOverlay.GridNoResultsOverlay,
|
|
29
|
+
noRowsOverlay: _components.GridNoRowsOverlay,
|
|
30
|
+
pagination: _components.GridPagination,
|
|
31
|
+
filterPanel: _components.GridFilterPanel,
|
|
32
|
+
columnsPanel: _components.GridColumnsPanel,
|
|
33
|
+
panel: _components.GridPanel,
|
|
34
|
+
row: _components.GridRow
|
|
35
35
|
});
|
|
@@ -127,12 +127,10 @@ const useGridPrintExport = (apiRef, props) => {
|
|
|
127
127
|
// the footer is always being placed at the bottom of the page as if all rows are exported
|
|
128
128
|
// so if getRowsToExport is being used to only export a subset of rows then we need to
|
|
129
129
|
// adjust the footer position to be correctly placed at the bottom of the grid
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
gridFooterElement.style.top = `${computedTotalHeight - gridFooterElementHeight}px`;
|
|
135
|
-
}
|
|
130
|
+
const gridFooterElement = gridClone.querySelector(`.${_gridClasses.gridClasses.footerContainer}`);
|
|
131
|
+
gridFooterElement.style.position = 'absolute';
|
|
132
|
+
gridFooterElement.style.width = '100%';
|
|
133
|
+
gridFooterElement.style.top = `${computedTotalHeight - gridFooterElementHeight}px`;
|
|
136
134
|
|
|
137
135
|
// printDoc.body.appendChild(gridClone); should be enough but a clone isolation bug in Safari
|
|
138
136
|
// prevents us to do it
|
|
@@ -235,9 +233,7 @@ const useGridPrintExport = (apiRef, props) => {
|
|
|
235
233
|
apiRef.current.forceUpdate();
|
|
236
234
|
}
|
|
237
235
|
await updateGridColumnsForPrint(options?.fields, options?.allColumns, options?.includeCheckboxes);
|
|
238
|
-
|
|
239
|
-
updateGridRowsForPrint(options.getRowsToExport);
|
|
240
|
-
}
|
|
236
|
+
updateGridRowsForPrint(options?.getRowsToExport ?? _utils2.defaultGetRowsToExport);
|
|
241
237
|
apiRef.current.unstable_setVirtualization(false);
|
|
242
238
|
await raf(); // wait for the state changes to take action
|
|
243
239
|
const printWindow = buildPrintWindow(options?.fileName);
|
|
@@ -4,12 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.sanitizeFilterModel = exports.passFilterLogic = exports.mergeStateWithFilterModel = exports.cleanFilterItem = exports.buildAggregatedFilterApplier = void 0;
|
|
7
|
+
exports.sanitizeFilterModel = exports.removeDiacritics = exports.passFilterLogic = exports.mergeStateWithFilterModel = exports.cleanFilterItem = exports.buildAggregatedFilterApplier = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _models = require("../../../models");
|
|
10
|
-
var _utils = require("../../../colDef/utils");
|
|
11
10
|
var _gridFilterState = require("./gridFilterState");
|
|
12
11
|
var _warning = require("../../../utils/warning");
|
|
12
|
+
var _getPublicApiRef = require("../../../utils/getPublicApiRef");
|
|
13
13
|
var _columns = require("../columns");
|
|
14
14
|
// Fixes https://github.com/mui/mui-x/issues/10056
|
|
15
15
|
const globalScope = typeof window === 'undefined' ? globalThis : window;
|
|
@@ -84,6 +84,7 @@ const removeDiacritics = value => {
|
|
|
84
84
|
}
|
|
85
85
|
return value;
|
|
86
86
|
};
|
|
87
|
+
exports.removeDiacritics = removeDiacritics;
|
|
87
88
|
const getFilterCallbackFromItem = (filterItem, apiRef) => {
|
|
88
89
|
if (!filterItem.field || !filterItem.operator) {
|
|
89
90
|
return null;
|
|
@@ -116,41 +117,19 @@ const getFilterCallbackFromItem = (filterItem, apiRef) => {
|
|
|
116
117
|
if (!filterOperator) {
|
|
117
118
|
throw new Error(`MUI: No filter operator found for column '${column.field}' and operator value '${newFilterItem.operator}'.`);
|
|
118
119
|
}
|
|
119
|
-
const
|
|
120
|
-
const hasUserFunctionV7 = !(0, _utils.isInternalFilter)(filterOperator.getApplyFilterFnV7);
|
|
121
|
-
if (filterOperator.getApplyFilterFnV7 && !(hasUserFunctionLegacy && !hasUserFunctionV7)) {
|
|
122
|
-
const applyFilterOnRow = filterOperator.getApplyFilterFnV7(newFilterItem, column);
|
|
123
|
-
if (typeof applyFilterOnRow !== 'function') {
|
|
124
|
-
return null;
|
|
125
|
-
}
|
|
126
|
-
return {
|
|
127
|
-
v7: true,
|
|
128
|
-
item: newFilterItem,
|
|
129
|
-
fn: row => {
|
|
130
|
-
let value = apiRef.current.getRowValue(row, column);
|
|
131
|
-
if (ignoreDiacritics) {
|
|
132
|
-
value = removeDiacritics(value);
|
|
133
|
-
}
|
|
134
|
-
return applyFilterOnRow(value, row, column, apiRef);
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
}
|
|
120
|
+
const publicApiRef = (0, _getPublicApiRef.getPublicApiRef)(apiRef);
|
|
138
121
|
const applyFilterOnRow = filterOperator.getApplyFilterFn(newFilterItem, column);
|
|
139
122
|
if (typeof applyFilterOnRow !== 'function') {
|
|
140
123
|
return null;
|
|
141
124
|
}
|
|
142
125
|
return {
|
|
143
|
-
v7: false,
|
|
144
126
|
item: newFilterItem,
|
|
145
|
-
fn:
|
|
146
|
-
|
|
147
|
-
_utils.GLOBAL_API_REF.current = apiRef;
|
|
127
|
+
fn: row => {
|
|
128
|
+
let value = apiRef.current.getRowValue(row, column);
|
|
148
129
|
if (ignoreDiacritics) {
|
|
149
|
-
|
|
130
|
+
value = removeDiacritics(value);
|
|
150
131
|
}
|
|
151
|
-
|
|
152
|
-
_utils.GLOBAL_API_REF.current = null;
|
|
153
|
-
return result;
|
|
132
|
+
return applyFilterOnRow(value, row, column, publicApiRef);
|
|
154
133
|
}
|
|
155
134
|
};
|
|
156
135
|
};
|
|
@@ -177,7 +156,7 @@ const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) =>
|
|
|
177
156
|
for (let i = 0; i < appliers.length; i += 1) {
|
|
178
157
|
const applier = appliers[i];
|
|
179
158
|
if (!shouldApplyFilter || shouldApplyFilter(applier.item.field)) {
|
|
180
|
-
resultPerItemId[applier.item.id] = applier.
|
|
159
|
+
resultPerItemId[applier.item.id] = applier.fn(row);
|
|
181
160
|
}
|
|
182
161
|
}
|
|
183
162
|
return resultPerItemId;
|
|
@@ -193,7 +172,7 @@ const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) =>
|
|
|
193
172
|
${appliers.map((applier, i) => `${JSON.stringify(String(applier.item.id))}:
|
|
194
173
|
!shouldApply${i} ?
|
|
195
174
|
false :
|
|
196
|
-
|
|
175
|
+
appliers[${i}].fn(row),
|
|
197
176
|
`).join('\n')}};
|
|
198
177
|
|
|
199
178
|
return result$$;
|
|
@@ -223,31 +202,17 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
223
202
|
const {
|
|
224
203
|
ignoreDiacritics
|
|
225
204
|
} = apiRef.current.rootProps;
|
|
205
|
+
const publicApiRef = (0, _getPublicApiRef.getPublicApiRef)(apiRef);
|
|
226
206
|
columnFields.forEach(field => {
|
|
227
207
|
const column = apiRef.current.getColumn(field);
|
|
228
208
|
const getApplyQuickFilterFn = column?.getApplyQuickFilterFn;
|
|
229
|
-
|
|
230
|
-
const hasUserFunctionLegacy = !(0, _utils.isInternalFilter)(getApplyQuickFilterFn);
|
|
231
|
-
const hasUserFunctionV7 = !(0, _utils.isInternalFilter)(getApplyQuickFilterFnV7);
|
|
232
|
-
if (getApplyQuickFilterFnV7 && !(hasUserFunctionLegacy && !hasUserFunctionV7)) {
|
|
233
|
-
appliersPerField.push({
|
|
234
|
-
column,
|
|
235
|
-
appliers: quickFilterValues.map(quickFilterValue => {
|
|
236
|
-
const value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
|
|
237
|
-
return {
|
|
238
|
-
v7: true,
|
|
239
|
-
fn: getApplyQuickFilterFnV7(value, column, apiRef)
|
|
240
|
-
};
|
|
241
|
-
})
|
|
242
|
-
});
|
|
243
|
-
} else if (getApplyQuickFilterFn) {
|
|
209
|
+
if (getApplyQuickFilterFn) {
|
|
244
210
|
appliersPerField.push({
|
|
245
211
|
column,
|
|
246
212
|
appliers: quickFilterValues.map(quickFilterValue => {
|
|
247
213
|
const value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
|
|
248
214
|
return {
|
|
249
|
-
|
|
250
|
-
fn: getApplyQuickFilterFn(value, column, apiRef)
|
|
215
|
+
fn: getApplyQuickFilterFn(value, column, publicApiRef)
|
|
251
216
|
};
|
|
252
217
|
})
|
|
253
218
|
});
|
|
@@ -255,7 +220,6 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
255
220
|
});
|
|
256
221
|
return function isRowMatchingQuickFilter(row, shouldApplyFilter) {
|
|
257
222
|
const result = {};
|
|
258
|
-
const usedCellParams = {};
|
|
259
223
|
|
|
260
224
|
/* eslint-disable no-restricted-syntax, no-labels */
|
|
261
225
|
outer: for (let v = 0; v < quickFilterValues.length; v += 1) {
|
|
@@ -272,30 +236,17 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
272
236
|
continue;
|
|
273
237
|
}
|
|
274
238
|
const applier = appliers[v];
|
|
275
|
-
let value = apiRef.current.
|
|
239
|
+
let value = apiRef.current.getRowValue(row, column);
|
|
276
240
|
if (applier.fn === null) {
|
|
277
241
|
continue;
|
|
278
242
|
}
|
|
279
|
-
if (
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
continue outer;
|
|
287
|
-
}
|
|
288
|
-
} else {
|
|
289
|
-
const cellParams = usedCellParams[field] ?? apiRef.current.getCellParams(apiRef.current.getRowId(row), field);
|
|
290
|
-
if (ignoreDiacritics) {
|
|
291
|
-
cellParams.value = removeDiacritics(cellParams.value);
|
|
292
|
-
}
|
|
293
|
-
usedCellParams[field] = cellParams;
|
|
294
|
-
const isMatching = applier.fn(cellParams);
|
|
295
|
-
if (isMatching) {
|
|
296
|
-
result[filterValue] = true;
|
|
297
|
-
continue outer;
|
|
298
|
-
}
|
|
243
|
+
if (ignoreDiacritics) {
|
|
244
|
+
value = removeDiacritics(value);
|
|
245
|
+
}
|
|
246
|
+
const isMatching = applier.fn(value, row, column, publicApiRef);
|
|
247
|
+
if (isMatching) {
|
|
248
|
+
result[filterValue] = true;
|
|
249
|
+
continue outer;
|
|
299
250
|
}
|
|
300
251
|
}
|
|
301
252
|
result[filterValue] = false;
|
|
@@ -222,7 +222,8 @@ const useGridFilter = (apiRef, props) => {
|
|
|
222
222
|
setFilterModel,
|
|
223
223
|
showFilterPanel,
|
|
224
224
|
hideFilterPanel,
|
|
225
|
-
setQuickFilterValues
|
|
225
|
+
setQuickFilterValues,
|
|
226
|
+
ignoreDiacritics: props.ignoreDiacritics
|
|
226
227
|
};
|
|
227
228
|
(0, _useGridApiMethod.useGridApiMethod)(apiRef, filterApi, 'public');
|
|
228
229
|
|
|
@@ -293,7 +293,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
293
293
|
});
|
|
294
294
|
|
|
295
295
|
// Removes potential remaining skeleton rows from the dataRowIds.
|
|
296
|
-
const dataRowIds = rootGroupChildren.filter(childId => tree[childId]
|
|
296
|
+
const dataRowIds = rootGroupChildren.filter(childId => tree[childId]?.type === 'leaf');
|
|
297
297
|
apiRef.current.caches.rows.dataRowIdToModelLookup = dataRowIdToModelLookup;
|
|
298
298
|
apiRef.current.caches.rows.dataRowIdToIdLookup = dataRowIdToIdLookup;
|
|
299
299
|
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
package/node/index.js
CHANGED
package/node/internals/index.js
CHANGED
|
@@ -716,6 +716,18 @@ var _keyboardUtils = require("../utils/keyboardUtils");
|
|
|
716
716
|
var _utils2 = require("../utils/utils");
|
|
717
717
|
var _warning = require("../utils/warning");
|
|
718
718
|
var _exportAs = require("../utils/exportAs");
|
|
719
|
+
var _getPublicApiRef = require("../utils/getPublicApiRef");
|
|
720
|
+
Object.keys(_getPublicApiRef).forEach(function (key) {
|
|
721
|
+
if (key === "default" || key === "__esModule") return;
|
|
722
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
723
|
+
if (key in exports && exports[key] === _getPublicApiRef[key]) return;
|
|
724
|
+
Object.defineProperty(exports, key, {
|
|
725
|
+
enumerable: true,
|
|
726
|
+
get: function () {
|
|
727
|
+
return _getPublicApiRef[key];
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
});
|
|
719
731
|
var _useGridPrivateApiContext = require("../hooks/utils/useGridPrivateApiContext");
|
|
720
732
|
var _useOnMount = require("../hooks/utils/useOnMount");
|
|
721
733
|
Object.keys(_useOnMount).forEach(function (key) {
|
|
@@ -730,7 +742,7 @@ Object.keys(_useOnMount).forEach(function (key) {
|
|
|
730
742
|
});
|
|
731
743
|
});
|
|
732
744
|
var _csvSerializer = require("../hooks/features/export/serializers/csvSerializer");
|
|
733
|
-
var _utils3 = require("
|
|
745
|
+
var _utils3 = require("./utils");
|
|
734
746
|
Object.keys(_utils3).forEach(function (key) {
|
|
735
747
|
if (key === "default" || key === "__esModule") return;
|
|
736
748
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -741,16 +753,4 @@ Object.keys(_utils3).forEach(function (key) {
|
|
|
741
753
|
return _utils3[key];
|
|
742
754
|
}
|
|
743
755
|
});
|
|
744
|
-
});
|
|
745
|
-
var _utils4 = require("./utils");
|
|
746
|
-
Object.keys(_utils4).forEach(function (key) {
|
|
747
|
-
if (key === "default" || key === "__esModule") return;
|
|
748
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
749
|
-
if (key in exports && exports[key] === _utils4[key]) return;
|
|
750
|
-
Object.defineProperty(exports, key, {
|
|
751
|
-
enumerable: true,
|
|
752
|
-
get: function () {
|
|
753
|
-
return _utils4[key];
|
|
754
|
-
}
|
|
755
|
-
});
|
|
756
756
|
});
|
|
@@ -6,18 +6,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.computeSlots = computeSlots;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _slotsMigration = require("./slotsMigration");
|
|
10
|
-
// TODO v7: Remove `components` and usages of `UncapitalizeObjectKeys` type
|
|
11
|
-
// after converting keys in Grid(Pro|Premium)SlotsComponent to camelCase.
|
|
12
|
-
// https://github.com/mui/mui-x/issues/7940
|
|
13
9
|
function computeSlots({
|
|
14
10
|
defaultSlots,
|
|
15
|
-
slots
|
|
16
|
-
components
|
|
11
|
+
slots
|
|
17
12
|
}) {
|
|
18
|
-
const overrides = slots
|
|
13
|
+
const overrides = slots;
|
|
19
14
|
if (!overrides || Object.keys(overrides).length === 0) {
|
|
20
15
|
return defaultSlots;
|
|
21
16
|
}
|
|
22
|
-
|
|
17
|
+
const result = (0, _extends2.default)({}, defaultSlots);
|
|
18
|
+
Object.keys(overrides).forEach(key => {
|
|
19
|
+
const k = key;
|
|
20
|
+
if (overrides[k] !== undefined) {
|
|
21
|
+
result[k] = overrides[k];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return result;
|
|
23
25
|
}
|
|
@@ -14,17 +14,6 @@ Object.keys(_computeSlots).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
-
var _slotsMigration = require("./slotsMigration");
|
|
18
|
-
Object.keys(_slotsMigration).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _slotsMigration[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _slotsMigration[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
17
|
var _useProps = require("./useProps");
|
|
29
18
|
Object.keys(_useProps).forEach(function (key) {
|
|
30
19
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.useProps = useProps;
|
|
8
|
-
var
|
|
8
|
+
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
const _excluded = ["components", "componentsProps"];
|
|
11
11
|
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); }
|
|
12
12
|
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 && Object.prototype.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; }
|
|
13
13
|
/** Gathers props for the root element into a single `.forwardedProps` field */
|
|
@@ -31,11 +31,7 @@ function groupForwardedProps(props) {
|
|
|
31
31
|
}
|
|
32
32
|
function useProps(allProps) {
|
|
33
33
|
return React.useMemo(() => {
|
|
34
|
-
const {
|
|
35
|
-
|
|
36
|
-
componentsProps
|
|
37
|
-
} = allProps,
|
|
38
|
-
themedProps = (0, _objectWithoutPropertiesLoose2.default)(allProps, _excluded);
|
|
39
|
-
return [components, componentsProps, groupForwardedProps(themedProps)];
|
|
34
|
+
const themedProps = (0, _extends2.default)({}, ((0, _objectDestructuringEmpty2.default)(allProps), allProps));
|
|
35
|
+
return groupForwardedProps(themedProps);
|
|
40
36
|
}, [allProps]);
|
|
41
37
|
}
|
package/node/locales/csCZ.js
CHANGED
|
@@ -156,8 +156,8 @@ const csCZGrid = {
|
|
|
156
156
|
// Actions cell more text
|
|
157
157
|
actionsCellMore: 'více',
|
|
158
158
|
// Column pinning text
|
|
159
|
-
pinToLeft: 'Připnout
|
|
160
|
-
pinToRight: 'Připnout
|
|
159
|
+
pinToLeft: 'Připnout vlevo',
|
|
160
|
+
pinToRight: 'Připnout vpravo',
|
|
161
161
|
unpin: 'Odepnout',
|
|
162
162
|
// Tree Data
|
|
163
163
|
treeDataGroupingHeaderName: 'Skupina',
|
package/node/material/index.js
CHANGED
|
@@ -22,55 +22,55 @@ var _GridColumnUnsortedIcon = require("./icons/GridColumnUnsortedIcon");
|
|
|
22
22
|
var _icons = require("./icons");
|
|
23
23
|
var _MUISelectOption = _interopRequireDefault(require("./components/MUISelectOption"));
|
|
24
24
|
const iconSlots = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
25
|
+
booleanCellTrueIcon: _icons.GridCheckIcon,
|
|
26
|
+
booleanCellFalseIcon: _icons.GridCloseIcon,
|
|
27
|
+
columnMenuIcon: _icons.GridTripleDotsVerticalIcon,
|
|
28
|
+
openFilterButtonIcon: _icons.GridFilterListIcon,
|
|
29
|
+
filterPanelDeleteIcon: _icons.GridCloseIcon,
|
|
30
|
+
columnFilteredIcon: _icons.GridFilterAltIcon,
|
|
31
|
+
columnSelectorIcon: _icons.GridColumnIcon,
|
|
32
|
+
columnUnsortedIcon: _GridColumnUnsortedIcon.GridColumnUnsortedIcon,
|
|
33
|
+
columnSortedAscendingIcon: _icons.GridArrowUpwardIcon,
|
|
34
|
+
columnSortedDescendingIcon: _icons.GridArrowDownwardIcon,
|
|
35
|
+
columnResizeIcon: _icons.GridSeparatorIcon,
|
|
36
|
+
densityCompactIcon: _icons.GridViewHeadlineIcon,
|
|
37
|
+
densityStandardIcon: _icons.GridTableRowsIcon,
|
|
38
|
+
densityComfortableIcon: _icons.GridViewStreamIcon,
|
|
39
|
+
exportIcon: _icons.GridSaveAltIcon,
|
|
40
|
+
moreActionsIcon: _icons.GridMoreVertIcon,
|
|
41
|
+
treeDataCollapseIcon: _icons.GridExpandMoreIcon,
|
|
42
|
+
treeDataExpandIcon: _icons.GridKeyboardArrowRight,
|
|
43
|
+
groupingCriteriaCollapseIcon: _icons.GridExpandMoreIcon,
|
|
44
|
+
groupingCriteriaExpandIcon: _icons.GridKeyboardArrowRight,
|
|
45
|
+
detailPanelExpandIcon: _icons.GridAddIcon,
|
|
46
|
+
detailPanelCollapseIcon: _icons.GridRemoveIcon,
|
|
47
|
+
rowReorderIcon: _icons.GridDragIcon,
|
|
48
|
+
quickFilterIcon: _icons.GridSearchIcon,
|
|
49
|
+
quickFilterClearIcon: _icons.GridCloseIcon,
|
|
50
|
+
columnMenuHideIcon: _icons.GridVisibilityOffIcon,
|
|
51
|
+
columnMenuSortAscendingIcon: _icons.GridArrowUpwardIcon,
|
|
52
|
+
columnMenuSortDescendingIcon: _icons.GridArrowDownwardIcon,
|
|
53
|
+
columnMenuFilterIcon: _icons.GridFilterAltIcon,
|
|
54
|
+
columnMenuManageColumnsIcon: _icons.GridViewColumnIcon,
|
|
55
|
+
columnMenuClearIcon: _icons.GridClearIcon,
|
|
56
|
+
loadIcon: _icons.GridLoadIcon,
|
|
57
|
+
filterPanelAddIcon: _icons.GridAddIcon,
|
|
58
|
+
filterPanelRemoveAllIcon: _icons.GridDeleteForeverIcon,
|
|
59
|
+
columnReorderIcon: _icons.GridDragIcon
|
|
60
60
|
};
|
|
61
61
|
const materialSlots = (0, _extends2.default)({}, iconSlots, {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
baseCheckbox: _Checkbox.default,
|
|
63
|
+
baseTextField: _TextField.default,
|
|
64
|
+
baseFormControl: _FormControl.default,
|
|
65
|
+
baseSelect: _Select.default,
|
|
66
|
+
baseSwitch: _Switch.default,
|
|
67
|
+
baseButton: _Button.default,
|
|
68
|
+
baseIconButton: _IconButton.default,
|
|
69
|
+
baseInputAdornment: _InputAdornment.default,
|
|
70
|
+
baseTooltip: _Tooltip.default,
|
|
71
|
+
basePopper: _Popper.default,
|
|
72
|
+
baseInputLabel: _InputLabel.default,
|
|
73
|
+
baseSelectOption: _MUISelectOption.default,
|
|
74
|
+
baseChip: _Chip.default
|
|
75
75
|
});
|
|
76
76
|
var _default = exports.default = materialSlots;
|
package/package.json
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { GridPrivateApiCommunity } from '../models/api/gridApiCommunity';
|
|
3
|
+
export declare function getPublicApiRef<PrivateApi extends GridPrivateApiCommunity>(apiRef: React.MutableRefObject<PrivateApi>): import("react").MutableRefObject<ReturnType<PrivateApi["getPublicApi"]>>;
|
package/colDef/utils.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { GridApiCommunity } from '../models/api/gridApiCommunity';
|
|
3
|
-
import { GetApplyFilterFnV7, GetApplyFilterFnLegacy, GridFilterOperator } from '../models';
|
|
4
|
-
import { GetApplyQuickFilterFnV7, GetApplyQuickFilterFnLegacy } from '../models/colDef/gridColDef';
|
|
5
|
-
/**
|
|
6
|
-
* A global API ref, for v7-to-legacy converter
|
|
7
|
-
*/
|
|
8
|
-
export declare const GLOBAL_API_REF: {
|
|
9
|
-
current: React.MutableRefObject<GridApiCommunity> | null;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* A tagger to determine if the filter is internal or custom user-supplied.
|
|
13
|
-
* To be a valid internal filter, the v7 function *must* be defined/redefined at
|
|
14
|
-
* the same time as the legacy one.
|
|
15
|
-
* https://github.com/mui/mui-x/pull/9254#discussion_r1231095551
|
|
16
|
-
*/
|
|
17
|
-
export declare function tagInternalFilter<T>(fn: T): T;
|
|
18
|
-
export declare function isInternalFilter(fn: Function | undefined): boolean;
|
|
19
|
-
export declare function convertFilterV7ToLegacy(fn: GetApplyFilterFnV7): GetApplyFilterFnLegacy;
|
|
20
|
-
export declare function convertLegacyOperators(ops: Omit<GridFilterOperator, 'getApplyFilterFn'>[]): GridFilterOperator[];
|
|
21
|
-
export declare function convertQuickFilterV7ToLegacy(fn: GetApplyQuickFilterFnV7): GetApplyQuickFilterFnLegacy<any, any, any>;
|
package/colDef/utils.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
/**
|
|
3
|
-
* A global API ref, for v7-to-legacy converter
|
|
4
|
-
*/
|
|
5
|
-
export const GLOBAL_API_REF = {
|
|
6
|
-
current: null
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A tagger to determine if the filter is internal or custom user-supplied.
|
|
11
|
-
* To be a valid internal filter, the v7 function *must* be defined/redefined at
|
|
12
|
-
* the same time as the legacy one.
|
|
13
|
-
* https://github.com/mui/mui-x/pull/9254#discussion_r1231095551
|
|
14
|
-
*/
|
|
15
|
-
export function tagInternalFilter(fn) {
|
|
16
|
-
fn.isInternal = true;
|
|
17
|
-
return fn;
|
|
18
|
-
}
|
|
19
|
-
export function isInternalFilter(fn) {
|
|
20
|
-
return fn !== undefined && fn.isInternal === true;
|
|
21
|
-
}
|
|
22
|
-
export function convertFilterV7ToLegacy(fn) {
|
|
23
|
-
return tagInternalFilter((filterItem, column) => {
|
|
24
|
-
const filterFn = fn(filterItem, column);
|
|
25
|
-
if (!filterFn) {
|
|
26
|
-
return filterFn;
|
|
27
|
-
}
|
|
28
|
-
return cellParams => {
|
|
29
|
-
return filterFn(cellParams.value, cellParams.row, column, GLOBAL_API_REF.current);
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
export function convertLegacyOperators(ops) {
|
|
34
|
-
return ops.map(op => {
|
|
35
|
-
return _extends({}, op, {
|
|
36
|
-
getApplyFilterFn: convertFilterV7ToLegacy(op.getApplyFilterFnV7),
|
|
37
|
-
getApplyFilterFnV7: tagInternalFilter(op.getApplyFilterFnV7)
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
export function convertQuickFilterV7ToLegacy(fn) {
|
|
42
|
-
return tagInternalFilter((filterItem, column, apiRef) => {
|
|
43
|
-
const filterFn = fn(filterItem, column, apiRef);
|
|
44
|
-
if (!filterFn) {
|
|
45
|
-
return filterFn;
|
|
46
|
-
}
|
|
47
|
-
return cellParams => {
|
|
48
|
-
return filterFn(cellParams.value, cellParams.row, column, apiRef);
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export type UncapitalizeObjectKeys<T extends object> = {
|
|
2
|
-
[K in keyof T as K extends string ? Uncapitalize<K> : K]: T[K];
|
|
3
|
-
};
|
|
4
|
-
export declare const uncapitalizeObjectKeys: <TInputType extends object>(capitalizedObject: TInputType) => UncapitalizeObjectKeys<TInputType> | undefined;
|