@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { GridLogicOperator } from '../../../models';
|
|
3
|
-
import { GLOBAL_API_REF, isInternalFilter } from '../../../colDef/utils';
|
|
4
3
|
import { getDefaultGridFilterModel } from './gridFilterState';
|
|
5
4
|
import { buildWarning } from '../../../utils/warning';
|
|
5
|
+
import { getPublicApiRef } from '../../../utils/getPublicApiRef';
|
|
6
6
|
import { gridColumnFieldsSelector, gridColumnLookupSelector, gridVisibleColumnFieldsSelector } from '../columns';
|
|
7
7
|
|
|
8
8
|
// Fixes https://github.com/mui/mui-x/issues/10056
|
|
@@ -79,7 +79,7 @@ export var mergeStateWithFilterModel = function mergeStateWithFilterModel(filter
|
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
-
var removeDiacritics = function removeDiacritics(value) {
|
|
82
|
+
export var removeDiacritics = function removeDiacritics(value) {
|
|
83
83
|
if (typeof value === 'string') {
|
|
84
84
|
return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
|
85
85
|
}
|
|
@@ -120,41 +120,19 @@ var getFilterCallbackFromItem = function getFilterCallbackFromItem(filterItem, a
|
|
|
120
120
|
if (!filterOperator) {
|
|
121
121
|
throw new Error("MUI: No filter operator found for column '".concat(column.field, "' and operator value '").concat(newFilterItem.operator, "'."));
|
|
122
122
|
}
|
|
123
|
-
var
|
|
124
|
-
var hasUserFunctionV7 = !isInternalFilter(filterOperator.getApplyFilterFnV7);
|
|
125
|
-
if (filterOperator.getApplyFilterFnV7 && !(hasUserFunctionLegacy && !hasUserFunctionV7)) {
|
|
126
|
-
var _applyFilterOnRow = filterOperator.getApplyFilterFnV7(newFilterItem, column);
|
|
127
|
-
if (typeof _applyFilterOnRow !== 'function') {
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
return {
|
|
131
|
-
v7: true,
|
|
132
|
-
item: newFilterItem,
|
|
133
|
-
fn: function fn(row) {
|
|
134
|
-
var value = apiRef.current.getRowValue(row, column);
|
|
135
|
-
if (ignoreDiacritics) {
|
|
136
|
-
value = removeDiacritics(value);
|
|
137
|
-
}
|
|
138
|
-
return _applyFilterOnRow(value, row, column, apiRef);
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
}
|
|
123
|
+
var publicApiRef = getPublicApiRef(apiRef);
|
|
142
124
|
var applyFilterOnRow = filterOperator.getApplyFilterFn(newFilterItem, column);
|
|
143
125
|
if (typeof applyFilterOnRow !== 'function') {
|
|
144
126
|
return null;
|
|
145
127
|
}
|
|
146
128
|
return {
|
|
147
|
-
v7: false,
|
|
148
129
|
item: newFilterItem,
|
|
149
|
-
fn: function fn(
|
|
150
|
-
var
|
|
151
|
-
GLOBAL_API_REF.current = apiRef;
|
|
130
|
+
fn: function fn(row) {
|
|
131
|
+
var value = apiRef.current.getRowValue(row, column);
|
|
152
132
|
if (ignoreDiacritics) {
|
|
153
|
-
|
|
133
|
+
value = removeDiacritics(value);
|
|
154
134
|
}
|
|
155
|
-
|
|
156
|
-
GLOBAL_API_REF.current = null;
|
|
157
|
-
return result;
|
|
135
|
+
return applyFilterOnRow(value, row, column, publicApiRef);
|
|
158
136
|
}
|
|
159
137
|
};
|
|
160
138
|
};
|
|
@@ -183,7 +161,7 @@ var buildAggregatedFilterItemsApplier = function buildAggregatedFilterItemsAppli
|
|
|
183
161
|
for (var i = 0; i < appliers.length; i += 1) {
|
|
184
162
|
var applier = appliers[i];
|
|
185
163
|
if (!shouldApplyFilter || shouldApplyFilter(applier.item.field)) {
|
|
186
|
-
resultPerItemId[applier.item.id] = applier.
|
|
164
|
+
resultPerItemId[applier.item.id] = applier.fn(row);
|
|
187
165
|
}
|
|
188
166
|
}
|
|
189
167
|
return resultPerItemId;
|
|
@@ -195,7 +173,7 @@ var buildAggregatedFilterItemsApplier = function buildAggregatedFilterItemsAppli
|
|
|
195
173
|
var filterItemTemplate = "(function filterItem$$(getRowId, appliers, row, shouldApplyFilter) {\n ".concat(appliers.map(function (applier, i) {
|
|
196
174
|
return "const shouldApply".concat(i, " = !shouldApplyFilter || shouldApplyFilter(").concat(JSON.stringify(applier.item.field), ");");
|
|
197
175
|
}).join('\n'), "\n\n const result$$ = {\n ").concat(appliers.map(function (applier, i) {
|
|
198
|
-
return "".concat(JSON.stringify(String(applier.item.id)), ":\n !shouldApply").concat(i, " ?\n false :\n
|
|
176
|
+
return "".concat(JSON.stringify(String(applier.item.id)), ":\n !shouldApply").concat(i, " ?\n false :\n appliers[").concat(i, "].fn(row),\n ");
|
|
199
177
|
}).join('\n'), "};\n\n return result$$;\n })");
|
|
200
178
|
var filterItemCore = evalCode(filterItemTemplate.replaceAll('$$', String(filterItemsApplierId)));
|
|
201
179
|
var filterItem = function filterItem(row, shouldApplyItem) {
|
|
@@ -221,31 +199,17 @@ var buildAggregatedQuickFilterApplier = function buildAggregatedQuickFilterAppli
|
|
|
221
199
|
var columnFields = quickFilterExcludeHiddenColumns ? gridVisibleColumnFieldsSelector(apiRef) : gridColumnFieldsSelector(apiRef);
|
|
222
200
|
var appliersPerField = [];
|
|
223
201
|
var ignoreDiacritics = apiRef.current.rootProps.ignoreDiacritics;
|
|
202
|
+
var publicApiRef = getPublicApiRef(apiRef);
|
|
224
203
|
columnFields.forEach(function (field) {
|
|
225
204
|
var column = apiRef.current.getColumn(field);
|
|
226
205
|
var getApplyQuickFilterFn = column == null ? void 0 : column.getApplyQuickFilterFn;
|
|
227
|
-
|
|
228
|
-
var hasUserFunctionLegacy = !isInternalFilter(getApplyQuickFilterFn);
|
|
229
|
-
var hasUserFunctionV7 = !isInternalFilter(getApplyQuickFilterFnV7);
|
|
230
|
-
if (getApplyQuickFilterFnV7 && !(hasUserFunctionLegacy && !hasUserFunctionV7)) {
|
|
231
|
-
appliersPerField.push({
|
|
232
|
-
column: column,
|
|
233
|
-
appliers: quickFilterValues.map(function (quickFilterValue) {
|
|
234
|
-
var value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
|
|
235
|
-
return {
|
|
236
|
-
v7: true,
|
|
237
|
-
fn: getApplyQuickFilterFnV7(value, column, apiRef)
|
|
238
|
-
};
|
|
239
|
-
})
|
|
240
|
-
});
|
|
241
|
-
} else if (getApplyQuickFilterFn) {
|
|
206
|
+
if (getApplyQuickFilterFn) {
|
|
242
207
|
appliersPerField.push({
|
|
243
208
|
column: column,
|
|
244
209
|
appliers: quickFilterValues.map(function (quickFilterValue) {
|
|
245
210
|
var value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
|
|
246
211
|
return {
|
|
247
|
-
|
|
248
|
-
fn: getApplyQuickFilterFn(value, column, apiRef)
|
|
212
|
+
fn: getApplyQuickFilterFn(value, column, publicApiRef)
|
|
249
213
|
};
|
|
250
214
|
})
|
|
251
215
|
});
|
|
@@ -253,7 +217,6 @@ var buildAggregatedQuickFilterApplier = function buildAggregatedQuickFilterAppli
|
|
|
253
217
|
});
|
|
254
218
|
return function isRowMatchingQuickFilter(row, shouldApplyFilter) {
|
|
255
219
|
var result = {};
|
|
256
|
-
var usedCellParams = {};
|
|
257
220
|
|
|
258
221
|
/* eslint-disable no-restricted-syntax, no-labels */
|
|
259
222
|
outer: for (var v = 0; v < quickFilterValues.length; v += 1) {
|
|
@@ -267,31 +230,17 @@ var buildAggregatedQuickFilterApplier = function buildAggregatedQuickFilterAppli
|
|
|
267
230
|
continue;
|
|
268
231
|
}
|
|
269
232
|
var applier = appliers[v];
|
|
270
|
-
var value = apiRef.current.
|
|
233
|
+
var value = apiRef.current.getRowValue(row, column);
|
|
271
234
|
if (applier.fn === null) {
|
|
272
235
|
continue;
|
|
273
236
|
}
|
|
274
|
-
if (
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
continue outer;
|
|
282
|
-
}
|
|
283
|
-
} else {
|
|
284
|
-
var _usedCellParams$_fiel;
|
|
285
|
-
var cellParams = (_usedCellParams$_fiel = usedCellParams[_field]) != null ? _usedCellParams$_fiel : apiRef.current.getCellParams(apiRef.current.getRowId(row), _field);
|
|
286
|
-
if (ignoreDiacritics) {
|
|
287
|
-
cellParams.value = removeDiacritics(cellParams.value);
|
|
288
|
-
}
|
|
289
|
-
usedCellParams[_field] = cellParams;
|
|
290
|
-
var _isMatching = applier.fn(cellParams);
|
|
291
|
-
if (_isMatching) {
|
|
292
|
-
result[filterValue] = true;
|
|
293
|
-
continue outer;
|
|
294
|
-
}
|
|
237
|
+
if (ignoreDiacritics) {
|
|
238
|
+
value = removeDiacritics(value);
|
|
239
|
+
}
|
|
240
|
+
var isMatching = applier.fn(value, row, column, publicApiRef);
|
|
241
|
+
if (isMatching) {
|
|
242
|
+
result[filterValue] = true;
|
|
243
|
+
continue outer;
|
|
295
244
|
}
|
|
296
245
|
}
|
|
297
246
|
result[filterValue] = false;
|
|
@@ -226,7 +226,8 @@ export var useGridFilter = function useGridFilter(apiRef, props) {
|
|
|
226
226
|
setFilterModel: setFilterModel,
|
|
227
227
|
showFilterPanel: showFilterPanel,
|
|
228
228
|
hideFilterPanel: hideFilterPanel,
|
|
229
|
-
setQuickFilterValues: setQuickFilterValues
|
|
229
|
+
setQuickFilterValues: setQuickFilterValues,
|
|
230
|
+
ignoreDiacritics: props.ignoreDiacritics
|
|
230
231
|
};
|
|
231
232
|
useGridApiMethod(apiRef, filterApi, 'public');
|
|
232
233
|
|
|
@@ -303,7 +303,8 @@ export var useGridRows = function useGridRows(apiRef, props) {
|
|
|
303
303
|
|
|
304
304
|
// Removes potential remaining skeleton rows from the dataRowIds.
|
|
305
305
|
var dataRowIds = rootGroupChildren.filter(function (childId) {
|
|
306
|
-
|
|
306
|
+
var _tree$childId;
|
|
307
|
+
return ((_tree$childId = tree[childId]) == null ? void 0 : _tree$childId.type) === 'leaf';
|
|
307
308
|
});
|
|
308
309
|
apiRef.current.caches.rows.dataRowIdToModelLookup = dataRowIdToModelLookup;
|
|
309
310
|
apiRef.current.caches.rows.dataRowIdToIdLookup = dataRowIdToIdLookup;
|
package/legacy/index.js
CHANGED
|
@@ -59,8 +59,8 @@ export { isNavigationKey } from '../utils/keyboardUtils';
|
|
|
59
59
|
export { clamp, isDeepEqual, isNumber, isFunction, isObject } from '../utils/utils';
|
|
60
60
|
export { buildWarning } from '../utils/warning';
|
|
61
61
|
export { exportAs } from '../utils/exportAs';
|
|
62
|
+
export * from '../utils/getPublicApiRef';
|
|
62
63
|
export { useGridPrivateApiContext } from '../hooks/utils/useGridPrivateApiContext';
|
|
63
64
|
export * from '../hooks/utils/useOnMount';
|
|
64
65
|
export { serializeCellValue } from '../hooks/features/export/serializers/csvSerializer';
|
|
65
|
-
export * from '../colDef/utils';
|
|
66
66
|
export * from './utils';
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { uncapitalizeObjectKeys } from './slotsMigration';
|
|
3
|
-
|
|
4
|
-
// TODO v7: Remove `components` and usages of `UncapitalizeObjectKeys` type
|
|
5
|
-
// after converting keys in Grid(Pro|Premium)SlotsComponent to camelCase.
|
|
6
|
-
// https://github.com/mui/mui-x/issues/7940
|
|
7
2
|
export function computeSlots(_ref) {
|
|
8
3
|
var defaultSlots = _ref.defaultSlots,
|
|
9
|
-
slots = _ref.slots
|
|
10
|
-
|
|
11
|
-
var overrides = slots != null ? slots : components ? uncapitalizeObjectKeys(components) : null;
|
|
4
|
+
slots = _ref.slots;
|
|
5
|
+
var overrides = slots;
|
|
12
6
|
if (!overrides || Object.keys(overrides).length === 0) {
|
|
13
7
|
return defaultSlots;
|
|
14
8
|
}
|
|
15
|
-
|
|
9
|
+
var result = _extends({}, defaultSlots);
|
|
10
|
+
Object.keys(overrides).forEach(function (key) {
|
|
11
|
+
var k = key;
|
|
12
|
+
if (overrides[k] !== undefined) {
|
|
13
|
+
result[k] = overrides[k];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
return result;
|
|
16
17
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
|
|
4
5
|
/** Gathers props for the root element into a single `.forwardedProps` field */
|
|
5
6
|
function groupForwardedProps(props) {
|
|
6
7
|
var _props$forwardedProps;
|
|
@@ -25,9 +26,7 @@ function groupForwardedProps(props) {
|
|
|
25
26
|
}
|
|
26
27
|
export function useProps(allProps) {
|
|
27
28
|
return React.useMemo(function () {
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
themedProps = _objectWithoutProperties(allProps, _excluded);
|
|
31
|
-
return [components, componentsProps, groupForwardedProps(themedProps)];
|
|
29
|
+
var themedProps = _extends({}, (_objectDestructuringEmpty(allProps), allProps));
|
|
30
|
+
return groupForwardedProps(themedProps);
|
|
32
31
|
}, [allProps]);
|
|
33
32
|
}
|
package/legacy/locales/csCZ.js
CHANGED
|
@@ -150,8 +150,8 @@ var csCZGrid = {
|
|
|
150
150
|
// Actions cell more text
|
|
151
151
|
actionsCellMore: 'více',
|
|
152
152
|
// Column pinning text
|
|
153
|
-
pinToLeft: 'Připnout
|
|
154
|
-
pinToRight: 'Připnout
|
|
153
|
+
pinToLeft: 'Připnout vlevo',
|
|
154
|
+
pinToRight: 'Připnout vpravo',
|
|
155
155
|
unpin: 'Odepnout',
|
|
156
156
|
// Tree Data
|
|
157
157
|
treeDataGroupingHeaderName: 'Skupina',
|
package/legacy/material/index.js
CHANGED
|
@@ -15,55 +15,55 @@ import { GridColumnUnsortedIcon } from './icons/GridColumnUnsortedIcon';
|
|
|
15
15
|
import { GridAddIcon, GridArrowDownwardIcon, GridArrowUpwardIcon, GridCheckIcon, GridCloseIcon, GridColumnIcon, GridDragIcon, GridExpandMoreIcon, GridFilterAltIcon, GridFilterListIcon, GridKeyboardArrowRight, GridMoreVertIcon, GridRemoveIcon, GridSaveAltIcon, GridSearchIcon, GridSeparatorIcon, GridTableRowsIcon, GridTripleDotsVerticalIcon, GridViewHeadlineIcon, GridViewStreamIcon, GridVisibilityOffIcon, GridViewColumnIcon, GridClearIcon, GridLoadIcon, GridDeleteForeverIcon } from './icons';
|
|
16
16
|
import MUISelectOption from './components/MUISelectOption';
|
|
17
17
|
var iconSlots = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
18
|
+
booleanCellTrueIcon: GridCheckIcon,
|
|
19
|
+
booleanCellFalseIcon: GridCloseIcon,
|
|
20
|
+
columnMenuIcon: GridTripleDotsVerticalIcon,
|
|
21
|
+
openFilterButtonIcon: GridFilterListIcon,
|
|
22
|
+
filterPanelDeleteIcon: GridCloseIcon,
|
|
23
|
+
columnFilteredIcon: GridFilterAltIcon,
|
|
24
|
+
columnSelectorIcon: GridColumnIcon,
|
|
25
|
+
columnUnsortedIcon: GridColumnUnsortedIcon,
|
|
26
|
+
columnSortedAscendingIcon: GridArrowUpwardIcon,
|
|
27
|
+
columnSortedDescendingIcon: GridArrowDownwardIcon,
|
|
28
|
+
columnResizeIcon: GridSeparatorIcon,
|
|
29
|
+
densityCompactIcon: GridViewHeadlineIcon,
|
|
30
|
+
densityStandardIcon: GridTableRowsIcon,
|
|
31
|
+
densityComfortableIcon: GridViewStreamIcon,
|
|
32
|
+
exportIcon: GridSaveAltIcon,
|
|
33
|
+
moreActionsIcon: GridMoreVertIcon,
|
|
34
|
+
treeDataCollapseIcon: GridExpandMoreIcon,
|
|
35
|
+
treeDataExpandIcon: GridKeyboardArrowRight,
|
|
36
|
+
groupingCriteriaCollapseIcon: GridExpandMoreIcon,
|
|
37
|
+
groupingCriteriaExpandIcon: GridKeyboardArrowRight,
|
|
38
|
+
detailPanelExpandIcon: GridAddIcon,
|
|
39
|
+
detailPanelCollapseIcon: GridRemoveIcon,
|
|
40
|
+
rowReorderIcon: GridDragIcon,
|
|
41
|
+
quickFilterIcon: GridSearchIcon,
|
|
42
|
+
quickFilterClearIcon: GridCloseIcon,
|
|
43
|
+
columnMenuHideIcon: GridVisibilityOffIcon,
|
|
44
|
+
columnMenuSortAscendingIcon: GridArrowUpwardIcon,
|
|
45
|
+
columnMenuSortDescendingIcon: GridArrowDownwardIcon,
|
|
46
|
+
columnMenuFilterIcon: GridFilterAltIcon,
|
|
47
|
+
columnMenuManageColumnsIcon: GridViewColumnIcon,
|
|
48
|
+
columnMenuClearIcon: GridClearIcon,
|
|
49
|
+
loadIcon: GridLoadIcon,
|
|
50
|
+
filterPanelAddIcon: GridAddIcon,
|
|
51
|
+
filterPanelRemoveAllIcon: GridDeleteForeverIcon,
|
|
52
|
+
columnReorderIcon: GridDragIcon
|
|
53
53
|
};
|
|
54
54
|
var materialSlots = _extends({}, iconSlots, {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
baseCheckbox: MUICheckbox,
|
|
56
|
+
baseTextField: MUITextField,
|
|
57
|
+
baseFormControl: MUIFormControl,
|
|
58
|
+
baseSelect: MUISelect,
|
|
59
|
+
baseSwitch: MUISwitch,
|
|
60
|
+
baseButton: MUIButton,
|
|
61
|
+
baseIconButton: MUIIconButton,
|
|
62
|
+
baseInputAdornment: MUIInputAdornment,
|
|
63
|
+
baseTooltip: MUITooltip,
|
|
64
|
+
basePopper: MUIPopper,
|
|
65
|
+
baseInputLabel: MUIInputLabel,
|
|
66
|
+
baseSelectOption: MUISelectOption,
|
|
67
|
+
baseChip: MUIChip
|
|
68
68
|
});
|
|
69
69
|
export default materialSlots;
|
package/locales/csCZ.js
CHANGED
|
@@ -150,8 +150,8 @@ const csCZGrid = {
|
|
|
150
150
|
// Actions cell more text
|
|
151
151
|
actionsCellMore: 'více',
|
|
152
152
|
// Column pinning text
|
|
153
|
-
pinToLeft: 'Připnout
|
|
154
|
-
pinToRight: 'Připnout
|
|
153
|
+
pinToLeft: 'Připnout vlevo',
|
|
154
|
+
pinToRight: 'Připnout vpravo',
|
|
155
155
|
unpin: 'Odepnout',
|
|
156
156
|
// Tree Data
|
|
157
157
|
treeDataGroupingHeaderName: 'Skupina',
|
package/material/index.js
CHANGED
|
@@ -15,55 +15,55 @@ import { GridColumnUnsortedIcon } from './icons/GridColumnUnsortedIcon';
|
|
|
15
15
|
import { GridAddIcon, GridArrowDownwardIcon, GridArrowUpwardIcon, GridCheckIcon, GridCloseIcon, GridColumnIcon, GridDragIcon, GridExpandMoreIcon, GridFilterAltIcon, GridFilterListIcon, GridKeyboardArrowRight, GridMoreVertIcon, GridRemoveIcon, GridSaveAltIcon, GridSearchIcon, GridSeparatorIcon, GridTableRowsIcon, GridTripleDotsVerticalIcon, GridViewHeadlineIcon, GridViewStreamIcon, GridVisibilityOffIcon, GridViewColumnIcon, GridClearIcon, GridLoadIcon, GridDeleteForeverIcon } from './icons';
|
|
16
16
|
import MUISelectOption from './components/MUISelectOption';
|
|
17
17
|
const iconSlots = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
18
|
+
booleanCellTrueIcon: GridCheckIcon,
|
|
19
|
+
booleanCellFalseIcon: GridCloseIcon,
|
|
20
|
+
columnMenuIcon: GridTripleDotsVerticalIcon,
|
|
21
|
+
openFilterButtonIcon: GridFilterListIcon,
|
|
22
|
+
filterPanelDeleteIcon: GridCloseIcon,
|
|
23
|
+
columnFilteredIcon: GridFilterAltIcon,
|
|
24
|
+
columnSelectorIcon: GridColumnIcon,
|
|
25
|
+
columnUnsortedIcon: GridColumnUnsortedIcon,
|
|
26
|
+
columnSortedAscendingIcon: GridArrowUpwardIcon,
|
|
27
|
+
columnSortedDescendingIcon: GridArrowDownwardIcon,
|
|
28
|
+
columnResizeIcon: GridSeparatorIcon,
|
|
29
|
+
densityCompactIcon: GridViewHeadlineIcon,
|
|
30
|
+
densityStandardIcon: GridTableRowsIcon,
|
|
31
|
+
densityComfortableIcon: GridViewStreamIcon,
|
|
32
|
+
exportIcon: GridSaveAltIcon,
|
|
33
|
+
moreActionsIcon: GridMoreVertIcon,
|
|
34
|
+
treeDataCollapseIcon: GridExpandMoreIcon,
|
|
35
|
+
treeDataExpandIcon: GridKeyboardArrowRight,
|
|
36
|
+
groupingCriteriaCollapseIcon: GridExpandMoreIcon,
|
|
37
|
+
groupingCriteriaExpandIcon: GridKeyboardArrowRight,
|
|
38
|
+
detailPanelExpandIcon: GridAddIcon,
|
|
39
|
+
detailPanelCollapseIcon: GridRemoveIcon,
|
|
40
|
+
rowReorderIcon: GridDragIcon,
|
|
41
|
+
quickFilterIcon: GridSearchIcon,
|
|
42
|
+
quickFilterClearIcon: GridCloseIcon,
|
|
43
|
+
columnMenuHideIcon: GridVisibilityOffIcon,
|
|
44
|
+
columnMenuSortAscendingIcon: GridArrowUpwardIcon,
|
|
45
|
+
columnMenuSortDescendingIcon: GridArrowDownwardIcon,
|
|
46
|
+
columnMenuFilterIcon: GridFilterAltIcon,
|
|
47
|
+
columnMenuManageColumnsIcon: GridViewColumnIcon,
|
|
48
|
+
columnMenuClearIcon: GridClearIcon,
|
|
49
|
+
loadIcon: GridLoadIcon,
|
|
50
|
+
filterPanelAddIcon: GridAddIcon,
|
|
51
|
+
filterPanelRemoveAllIcon: GridDeleteForeverIcon,
|
|
52
|
+
columnReorderIcon: GridDragIcon
|
|
53
53
|
};
|
|
54
54
|
const materialSlots = _extends({}, iconSlots, {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
baseCheckbox: MUICheckbox,
|
|
56
|
+
baseTextField: MUITextField,
|
|
57
|
+
baseFormControl: MUIFormControl,
|
|
58
|
+
baseSelect: MUISelect,
|
|
59
|
+
baseSwitch: MUISwitch,
|
|
60
|
+
baseButton: MUIButton,
|
|
61
|
+
baseIconButton: MUIIconButton,
|
|
62
|
+
baseInputAdornment: MUIInputAdornment,
|
|
63
|
+
baseTooltip: MUITooltip,
|
|
64
|
+
basePopper: MUIPopper,
|
|
65
|
+
baseInputLabel: MUIInputLabel,
|
|
66
|
+
baseSelectOption: MUISelectOption,
|
|
67
|
+
baseChip: MUIChip
|
|
68
68
|
});
|
|
69
69
|
export default materialSlots;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GridFilterModel } from '../gridFilterModel';
|
|
2
2
|
import { GridFilterItem, GridLogicOperator } from '../gridFilterItem';
|
|
3
3
|
import { GridControlledStateReasonLookup } from '../events';
|
|
4
|
+
import { DataGridProcessedProps } from '../props/DataGridProps';
|
|
4
5
|
/**
|
|
5
6
|
* The filter API interface that is available in the grid [[apiRef]].
|
|
6
7
|
*/
|
|
@@ -52,4 +53,8 @@ export interface GridFilterApi {
|
|
|
52
53
|
* @param {any[]} values The list of element to quick filter
|
|
53
54
|
*/
|
|
54
55
|
setQuickFilterValues: (values: any[]) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Returns the value of the `ignoreDiacritics` prop.
|
|
58
|
+
*/
|
|
59
|
+
ignoreDiacritics: DataGridProcessedProps['ignoreDiacritics'];
|
|
55
60
|
}
|
|
@@ -24,9 +24,8 @@ export type ValueOptions = string | number | {
|
|
|
24
24
|
* Value that can be used as a key for grouping rows
|
|
25
25
|
*/
|
|
26
26
|
export type GridKeyValue = string | number | boolean;
|
|
27
|
-
export type
|
|
28
|
-
export type
|
|
29
|
-
export type GetApplyQuickFilterFnV7<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: any, colDef: GridStateColDef, apiRef: React.MutableRefObject<GridApiCommunity>) => null | GridApplyQuickFilterV7<R, V>;
|
|
27
|
+
export type GridApplyQuickFilter<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: V, row: R, column: GridColDef, apiRef: React.MutableRefObject<GridApiCommunity>) => boolean;
|
|
28
|
+
export type GetApplyQuickFilterFn<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: any, colDef: GridStateColDef<R, V>, apiRef: React.MutableRefObject<GridApiCommunity>) => null | GridApplyQuickFilter<R, V>;
|
|
30
29
|
/**
|
|
31
30
|
* Column Definition base interface.
|
|
32
31
|
*/
|
|
@@ -208,18 +207,9 @@ export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel,
|
|
|
208
207
|
* @param {any} value The value with which we want to filter the column.
|
|
209
208
|
* @param {GridStateColDef} colDef The column from which we want to filter the rows.
|
|
210
209
|
* @param {React.MutableRefObject<GridApiCommunity>} apiRef Deprecated: The API of the grid.
|
|
211
|
-
* @returns {null |
|
|
210
|
+
* @returns {null | GridApplyQuickFilter} The function to call to check if a row pass this filter value or not.
|
|
212
211
|
*/
|
|
213
|
-
getApplyQuickFilterFn?:
|
|
214
|
-
/**
|
|
215
|
-
* The callback that generates a filtering function for a given quick filter value.
|
|
216
|
-
* This function can return `null` to skip filtering for this value and column.
|
|
217
|
-
* @param {any} value The value with which we want to filter the column.
|
|
218
|
-
* @param {GridStateColDef} colDef The column from which we want to filter the rows.
|
|
219
|
-
* @param {React.MutableRefObject<GridApiCommunity>} apiRef Deprecated: The API of the grid.
|
|
220
|
-
* @returns {null | GridApplyQuickFilterV7} The function to call to check if a row pass this filter value or not.
|
|
221
|
-
*/
|
|
222
|
-
getApplyQuickFilterFnV7?: GetApplyQuickFilterFnV7<R, V>;
|
|
212
|
+
getApplyQuickFilterFn?: GetApplyQuickFilterFn<R, V>;
|
|
223
213
|
/**
|
|
224
214
|
* If `true`, this column cannot be reordered.
|
|
225
215
|
* @default false
|
package/models/colDef/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { GridAlignment, ValueOptions, GridKeyValue, GridColDef, GridColTypeDef, GridColumnsMeta, GridSingleSelectColDef, GridActionsColDef, } from './gridColDef';
|
|
1
|
+
export type { GridAlignment, ValueOptions, GridKeyValue, GridColDef, GridColTypeDef, GridColumnsMeta, GridSingleSelectColDef, GridActionsColDef, GetApplyQuickFilterFn, } from './gridColDef';
|
|
2
2
|
export * from './gridColType';
|
|
3
3
|
export * from './gridColumnTypesRecord';
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridFilterItem } from './gridFilterItem';
|
|
3
|
-
import { GridCellParams } from './params/gridCellParams';
|
|
4
3
|
import type { GridColDef } from './colDef/gridColDef';
|
|
5
4
|
import type { GridValidRowModel } from './gridRows';
|
|
6
5
|
import type { GridApiCommunity } from './api/gridApiCommunity';
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
export type GetApplyFilterFnV7<R extends GridValidRowModel = any, V = any, F = V> = (filterItem: GridFilterItem, column: GridColDef<R, V, F>) => null | ApplyFilterFnV7<R, V, F>;
|
|
10
|
-
export type GetApplyFilterFnLegacy<R extends GridValidRowModel = any, V = any, F = V> = (filterItem: GridFilterItem, column: GridColDef<R, V, F>) => null | ApplyFilterFnLegacy<R, V, F>;
|
|
6
|
+
type ApplyFilterFn<R extends GridValidRowModel = any, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: React.MutableRefObject<GridApiCommunity>) => boolean;
|
|
7
|
+
export type GetApplyFilterFn<R extends GridValidRowModel = any, V = any, F = V> = (filterItem: GridFilterItem, column: GridColDef<R, V, F>) => null | ApplyFilterFn<R, V, F>;
|
|
11
8
|
/**
|
|
12
9
|
* Filter operator definition interface.
|
|
13
10
|
* @demos
|
|
@@ -32,18 +29,9 @@ export interface GridFilterOperator<R extends GridValidRowModel = any, V = any,
|
|
|
32
29
|
* This function can return `null` to skip filtering for this item and column.
|
|
33
30
|
* @param {GridFilterItem} filterItem The filter item with which we want to filter the column.
|
|
34
31
|
* @param {GridColDef} column The column from which we want to filter the rows.
|
|
35
|
-
* @returns {null |
|
|
32
|
+
* @returns {null | ApplyFilterFn} The function to call to check if a row pass this filter item or not.
|
|
36
33
|
*/
|
|
37
|
-
getApplyFilterFn:
|
|
38
|
-
/**
|
|
39
|
-
* The callback that generates a filtering function for a given filter item and column.
|
|
40
|
-
* This function can return `null` to skip filtering for this item and column.
|
|
41
|
-
* This function uses the more performant v7 API.
|
|
42
|
-
* @param {GridFilterItem} filterItem The filter item with which we want to filter the column.
|
|
43
|
-
* @param {GridColDef} column The column from which we want to filter the rows.
|
|
44
|
-
* @returns {null | ApplyFilterFnV7} The function to call to check if a row pass this filter item or not.
|
|
45
|
-
*/
|
|
46
|
-
getApplyFilterFnV7?: GetApplyFilterFnV7<R, V, F>;
|
|
34
|
+
getApplyFilterFn: GetApplyFilterFn<R, V, F>;
|
|
47
35
|
/**
|
|
48
36
|
* The input component to render in the filter panel for this filter operator.
|
|
49
37
|
*/
|