@mui/x-data-grid 6.18.1 → 7.0.0-alpha.1
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 +558 -1
- 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 +11 -12
- package/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/constants/defaultGridSlotsComponents.js +17 -17
- package/hooks/features/export/useGridPrintExport.js +7 -10
- package/hooks/features/filter/gridFilterUtils.js +14 -68
- package/hooks/features/rows/useGridRows.js +4 -1
- package/index.js +1 -1
- package/internals/index.d.ts +0 -1
- package/internals/index.js +0 -1
- package/internals/utils/computeSlots.d.ts +4 -6
- package/internals/utils/computeSlots.js +2 -8
- 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 +11 -12
- package/legacy/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/legacy/constants/defaultGridSlotsComponents.js +17 -17
- package/legacy/hooks/features/export/useGridPrintExport.js +7 -10
- package/legacy/hooks/features/filter/gridFilterUtils.js +14 -68
- package/legacy/hooks/features/rows/useGridRows.js +2 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +0 -1
- package/legacy/internals/utils/computeSlots.js +2 -8
- 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/locales/csCZ.js +2 -2
- package/material/index.js +48 -48
- 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 +11 -12
- package/modern/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/modern/constants/defaultGridSlotsComponents.js +17 -17
- package/modern/hooks/features/export/useGridPrintExport.js +6 -10
- package/modern/hooks/features/filter/gridFilterUtils.js +14 -67
- package/modern/hooks/features/rows/useGridRows.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +0 -1
- package/modern/internals/utils/computeSlots.js +2 -8
- 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/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 +12 -12
- package/node/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/node/constants/defaultGridSlotsComponents.js +17 -17
- package/node/hooks/features/export/useGridPrintExport.js +5 -9
- package/node/hooks/features/filter/gridFilterUtils.js +14 -67
- package/node/hooks/features/rows/useGridRows.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +1 -13
- package/node/internals/utils/computeSlots.js +2 -7
- 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/package.json +1 -1
- 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
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
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");
|
|
13
12
|
var _getPublicApiRef = require("../../../utils/getPublicApiRef");
|
|
@@ -118,42 +117,19 @@ const getFilterCallbackFromItem = (filterItem, apiRef) => {
|
|
|
118
117
|
if (!filterOperator) {
|
|
119
118
|
throw new Error(`MUI: No filter operator found for column '${column.field}' and operator value '${newFilterItem.operator}'.`);
|
|
120
119
|
}
|
|
121
|
-
const hasUserFunctionLegacy = !(0, _utils.isInternalFilter)(filterOperator.getApplyFilterFn);
|
|
122
|
-
const hasUserFunctionV7 = !(0, _utils.isInternalFilter)(filterOperator.getApplyFilterFnV7);
|
|
123
120
|
const publicApiRef = (0, _getPublicApiRef.getPublicApiRef)(apiRef);
|
|
124
|
-
if (filterOperator.getApplyFilterFnV7 && !(hasUserFunctionLegacy && !hasUserFunctionV7)) {
|
|
125
|
-
const applyFilterOnRow = filterOperator.getApplyFilterFnV7(newFilterItem, column);
|
|
126
|
-
if (typeof applyFilterOnRow !== 'function') {
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
v7: true,
|
|
131
|
-
item: newFilterItem,
|
|
132
|
-
fn: row => {
|
|
133
|
-
let value = apiRef.current.getRowValue(row, column);
|
|
134
|
-
if (ignoreDiacritics) {
|
|
135
|
-
value = removeDiacritics(value);
|
|
136
|
-
}
|
|
137
|
-
return applyFilterOnRow(value, row, column, publicApiRef);
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
121
|
const applyFilterOnRow = filterOperator.getApplyFilterFn(newFilterItem, column);
|
|
142
122
|
if (typeof applyFilterOnRow !== 'function') {
|
|
143
123
|
return null;
|
|
144
124
|
}
|
|
145
125
|
return {
|
|
146
|
-
v7: false,
|
|
147
126
|
item: newFilterItem,
|
|
148
|
-
fn:
|
|
149
|
-
|
|
150
|
-
_utils.GLOBAL_API_REF.current = publicApiRef;
|
|
127
|
+
fn: row => {
|
|
128
|
+
let value = apiRef.current.getRowValue(row, column);
|
|
151
129
|
if (ignoreDiacritics) {
|
|
152
|
-
|
|
130
|
+
value = removeDiacritics(value);
|
|
153
131
|
}
|
|
154
|
-
|
|
155
|
-
_utils.GLOBAL_API_REF.current = null;
|
|
156
|
-
return result;
|
|
132
|
+
return applyFilterOnRow(value, row, column, publicApiRef);
|
|
157
133
|
}
|
|
158
134
|
};
|
|
159
135
|
};
|
|
@@ -180,7 +156,7 @@ const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) =>
|
|
|
180
156
|
for (let i = 0; i < appliers.length; i += 1) {
|
|
181
157
|
const applier = appliers[i];
|
|
182
158
|
if (!shouldApplyFilter || shouldApplyFilter(applier.item.field)) {
|
|
183
|
-
resultPerItemId[applier.item.id] = applier.
|
|
159
|
+
resultPerItemId[applier.item.id] = applier.fn(row);
|
|
184
160
|
}
|
|
185
161
|
}
|
|
186
162
|
return resultPerItemId;
|
|
@@ -196,7 +172,7 @@ const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) =>
|
|
|
196
172
|
${appliers.map((applier, i) => `${JSON.stringify(String(applier.item.id))}:
|
|
197
173
|
!shouldApply${i} ?
|
|
198
174
|
false :
|
|
199
|
-
|
|
175
|
+
appliers[${i}].fn(row),
|
|
200
176
|
`).join('\n')}};
|
|
201
177
|
|
|
202
178
|
return result$$;
|
|
@@ -230,27 +206,12 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
230
206
|
columnFields.forEach(field => {
|
|
231
207
|
const column = apiRef.current.getColumn(field);
|
|
232
208
|
const getApplyQuickFilterFn = column?.getApplyQuickFilterFn;
|
|
233
|
-
|
|
234
|
-
const hasUserFunctionLegacy = !(0, _utils.isInternalFilter)(getApplyQuickFilterFn);
|
|
235
|
-
const hasUserFunctionV7 = !(0, _utils.isInternalFilter)(getApplyQuickFilterFnV7);
|
|
236
|
-
if (getApplyQuickFilterFnV7 && !(hasUserFunctionLegacy && !hasUserFunctionV7)) {
|
|
209
|
+
if (getApplyQuickFilterFn) {
|
|
237
210
|
appliersPerField.push({
|
|
238
211
|
column,
|
|
239
212
|
appliers: quickFilterValues.map(quickFilterValue => {
|
|
240
213
|
const value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
|
|
241
214
|
return {
|
|
242
|
-
v7: true,
|
|
243
|
-
fn: getApplyQuickFilterFnV7(value, column, publicApiRef)
|
|
244
|
-
};
|
|
245
|
-
})
|
|
246
|
-
});
|
|
247
|
-
} else if (getApplyQuickFilterFn) {
|
|
248
|
-
appliersPerField.push({
|
|
249
|
-
column,
|
|
250
|
-
appliers: quickFilterValues.map(quickFilterValue => {
|
|
251
|
-
const value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
|
|
252
|
-
return {
|
|
253
|
-
v7: false,
|
|
254
215
|
fn: getApplyQuickFilterFn(value, column, publicApiRef)
|
|
255
216
|
};
|
|
256
217
|
})
|
|
@@ -259,7 +220,6 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
259
220
|
});
|
|
260
221
|
return function isRowMatchingQuickFilter(row, shouldApplyFilter) {
|
|
261
222
|
const result = {};
|
|
262
|
-
const usedCellParams = {};
|
|
263
223
|
|
|
264
224
|
/* eslint-disable no-restricted-syntax, no-labels */
|
|
265
225
|
outer: for (let v = 0; v < quickFilterValues.length; v += 1) {
|
|
@@ -280,26 +240,13 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
280
240
|
if (applier.fn === null) {
|
|
281
241
|
continue;
|
|
282
242
|
}
|
|
283
|
-
if (
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
continue outer;
|
|
291
|
-
}
|
|
292
|
-
} else {
|
|
293
|
-
const cellParams = usedCellParams[field] ?? apiRef.current.getCellParams(apiRef.current.getRowId(row), field);
|
|
294
|
-
if (ignoreDiacritics) {
|
|
295
|
-
cellParams.value = removeDiacritics(cellParams.value);
|
|
296
|
-
}
|
|
297
|
-
usedCellParams[field] = cellParams;
|
|
298
|
-
const isMatching = applier.fn(cellParams);
|
|
299
|
-
if (isMatching) {
|
|
300
|
-
result[filterValue] = true;
|
|
301
|
-
continue outer;
|
|
302
|
-
}
|
|
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;
|
|
303
250
|
}
|
|
304
251
|
}
|
|
305
252
|
result[filterValue] = false;
|
|
@@ -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
|
@@ -742,7 +742,7 @@ Object.keys(_useOnMount).forEach(function (key) {
|
|
|
742
742
|
});
|
|
743
743
|
});
|
|
744
744
|
var _csvSerializer = require("../hooks/features/export/serializers/csvSerializer");
|
|
745
|
-
var _utils3 = require("
|
|
745
|
+
var _utils3 = require("./utils");
|
|
746
746
|
Object.keys(_utils3).forEach(function (key) {
|
|
747
747
|
if (key === "default" || key === "__esModule") return;
|
|
748
748
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -753,16 +753,4 @@ Object.keys(_utils3).forEach(function (key) {
|
|
|
753
753
|
return _utils3[key];
|
|
754
754
|
}
|
|
755
755
|
});
|
|
756
|
-
});
|
|
757
|
-
var _utils4 = require("./utils");
|
|
758
|
-
Object.keys(_utils4).forEach(function (key) {
|
|
759
|
-
if (key === "default" || key === "__esModule") return;
|
|
760
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
761
|
-
if (key in exports && exports[key] === _utils4[key]) return;
|
|
762
|
-
Object.defineProperty(exports, key, {
|
|
763
|
-
enumerable: true,
|
|
764
|
-
get: function () {
|
|
765
|
-
return _utils4[key];
|
|
766
|
-
}
|
|
767
|
-
});
|
|
768
756
|
});
|
|
@@ -6,16 +6,11 @@ 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
|
}
|
|
@@ -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
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;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
// TODO v7: This file exist only to simplify typing between
|
|
3
|
-
// components/componentsProps and slots/slotProps
|
|
4
|
-
// Should be deleted when components/componentsProps are removed
|
|
5
|
-
|
|
6
|
-
export const uncapitalizeObjectKeys = capitalizedObject => {
|
|
7
|
-
if (capitalizedObject === undefined) {
|
|
8
|
-
return undefined;
|
|
9
|
-
}
|
|
10
|
-
return Object.keys(capitalizedObject).reduce((acc, key) => _extends({}, acc, {
|
|
11
|
-
[`${key.charAt(0).toLowerCase()}${key.slice(1)}`]: capitalizedObject[key]
|
|
12
|
-
}), {});
|
|
13
|
-
};
|
package/legacy/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 var 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(function (filterItem, column) {
|
|
24
|
-
var filterFn = fn(filterItem, column);
|
|
25
|
-
if (!filterFn) {
|
|
26
|
-
return filterFn;
|
|
27
|
-
}
|
|
28
|
-
return function (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(function (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(function (filterItem, column, apiRef) {
|
|
43
|
-
var filterFn = fn(filterItem, column, apiRef);
|
|
44
|
-
if (!filterFn) {
|
|
45
|
-
return filterFn;
|
|
46
|
-
}
|
|
47
|
-
return function (cellParams) {
|
|
48
|
-
return filterFn(cellParams.value, cellParams.row, column, apiRef);
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
// TODO v7: This file exist only to simplify typing between
|
|
4
|
-
// components/componentsProps and slots/slotProps
|
|
5
|
-
// Should be deleted when components/componentsProps are removed
|
|
6
|
-
|
|
7
|
-
export var uncapitalizeObjectKeys = function uncapitalizeObjectKeys(capitalizedObject) {
|
|
8
|
-
if (capitalizedObject === undefined) {
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
return Object.keys(capitalizedObject).reduce(function (acc, key) {
|
|
12
|
-
return _extends({}, acc, _defineProperty({}, "".concat(key.charAt(0).toLowerCase()).concat(key.slice(1)), capitalizedObject[key]));
|
|
13
|
-
}, {});
|
|
14
|
-
};
|
package/modern/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,13 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
// TODO v7: This file exist only to simplify typing between
|
|
3
|
-
// components/componentsProps and slots/slotProps
|
|
4
|
-
// Should be deleted when components/componentsProps are removed
|
|
5
|
-
|
|
6
|
-
export const uncapitalizeObjectKeys = capitalizedObject => {
|
|
7
|
-
if (capitalizedObject === undefined) {
|
|
8
|
-
return undefined;
|
|
9
|
-
}
|
|
10
|
-
return Object.keys(capitalizedObject).reduce((acc, key) => _extends({}, acc, {
|
|
11
|
-
[`${key.charAt(0).toLowerCase()}${key.slice(1)}`]: capitalizedObject[key]
|
|
12
|
-
}), {});
|
|
13
|
-
};
|