@mui/x-data-grid 6.19.2 → 6.19.4
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 +105 -0
- package/components/GridPagination.d.ts +1 -1
- package/components/GridPagination.js +8 -1
- package/components/cell/GridActionsCell.js +3 -3
- package/components/cell/GridActionsCellItem.d.ts +13 -1
- package/components/cell/GridActionsCellItem.js +27 -15
- package/components/containers/GridRootStyles.js +6 -0
- package/hooks/features/export/useGridPrintExport.js +3 -1
- package/hooks/features/filter/gridFilterUtils.js +15 -22
- package/index.js +1 -1
- package/legacy/components/GridPagination.js +8 -1
- package/legacy/components/cell/GridActionsCell.js +3 -3
- package/legacy/components/cell/GridActionsCellItem.js +30 -17
- package/legacy/components/containers/GridRootStyles.js +5 -1
- package/legacy/hooks/features/export/useGridPrintExport.js +11 -7
- package/legacy/hooks/features/filter/gridFilterUtils.js +11 -14
- package/legacy/index.js +1 -1
- package/legacy/locales/daDK.js +12 -12
- package/legacy/locales/heIL.js +7 -8
- package/locales/daDK.js +12 -12
- package/locales/heIL.js +7 -8
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/components/GridPagination.js +8 -1
- package/modern/components/cell/GridActionsCell.js +3 -3
- package/modern/components/cell/GridActionsCellItem.js +27 -15
- package/modern/components/containers/GridRootStyles.js +6 -0
- package/modern/hooks/features/export/useGridPrintExport.js +3 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +15 -22
- package/modern/index.js +1 -1
- package/modern/locales/daDK.js +12 -12
- package/modern/locales/heIL.js +7 -8
- package/node/components/GridPagination.js +8 -1
- package/node/components/cell/GridActionsCell.js +3 -3
- package/node/components/cell/GridActionsCellItem.js +27 -15
- package/node/components/containers/GridRootStyles.js +6 -0
- package/node/hooks/features/export/useGridPrintExport.js +3 -1
- package/node/hooks/features/filter/gridFilterUtils.js +15 -21
- package/node/index.js +1 -1
- package/node/locales/daDK.js +12 -12
- package/node/locales/heIL.js +7 -8
- package/package.json +1 -1
|
@@ -20,6 +20,7 @@ var _pipeProcessing = require("../../core/pipeProcessing");
|
|
|
20
20
|
var _GridToolbarExport = require("../../../components/toolbar/GridToolbarExport");
|
|
21
21
|
var _gridColumnsUtils = require("../columns/gridColumnsUtils");
|
|
22
22
|
var _gridCheckboxSelectionColDef = require("../../../colDef/gridCheckboxSelectionColDef");
|
|
23
|
+
var _gridRowsSelector = require("../rows/gridRowsSelector");
|
|
23
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
25
|
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); }
|
|
25
26
|
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; }
|
|
@@ -222,7 +223,8 @@ const useGridPrintExport = (apiRef, props) => {
|
|
|
222
223
|
previousGridState.current = apiRef.current.exportState();
|
|
223
224
|
// It appends that the visibility model is not exported, especially if columnVisibility is not controlled
|
|
224
225
|
previousColumnVisibility.current = (0, _gridColumnsSelector.gridColumnVisibilityModelSelector)(apiRef);
|
|
225
|
-
|
|
226
|
+
const gridRowsLookup = (0, _gridRowsSelector.gridRowsLookupSelector)(apiRef);
|
|
227
|
+
previousRows.current = (0, _gridRowsSelector.gridDataRowIdsSelector)(apiRef).map(rowId => gridRowsLookup[rowId]);
|
|
226
228
|
if (props.pagination) {
|
|
227
229
|
const visibleRowCount = (0, _gridFilterSelector.gridExpandedRowCountSelector)(apiRef);
|
|
228
230
|
const paginationModel = {
|
|
@@ -12,21 +12,18 @@ var _gridFilterState = require("./gridFilterState");
|
|
|
12
12
|
var _warning = require("../../../utils/warning");
|
|
13
13
|
var _getPublicApiRef = require("../../../utils/getPublicApiRef");
|
|
14
14
|
var _columns = require("../columns");
|
|
15
|
-
// Fixes https://github.com/mui/mui-x/issues/10056
|
|
16
|
-
const globalScope = typeof window === 'undefined' ? globalThis : window;
|
|
17
|
-
const evalCode = globalScope[atob('ZXZhbA==')];
|
|
18
15
|
let hasEval;
|
|
19
|
-
|
|
16
|
+
function getHasEval() {
|
|
20
17
|
if (hasEval !== undefined) {
|
|
21
18
|
return hasEval;
|
|
22
19
|
}
|
|
23
20
|
try {
|
|
24
|
-
hasEval =
|
|
21
|
+
hasEval = new Function('return true')();
|
|
25
22
|
} catch (_) {
|
|
26
23
|
hasEval = false;
|
|
27
24
|
}
|
|
28
25
|
return hasEval;
|
|
29
|
-
}
|
|
26
|
+
}
|
|
30
27
|
/**
|
|
31
28
|
* Adds default values to the optional fields of a filter items.
|
|
32
29
|
* @param {GridFilterItem} item The raw filter item.
|
|
@@ -193,25 +190,22 @@ const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) =>
|
|
|
193
190
|
};
|
|
194
191
|
}
|
|
195
192
|
|
|
196
|
-
// We generate a new function with `
|
|
193
|
+
// We generate a new function with `new Function()` to avoid expensive patterns for JS engines
|
|
197
194
|
// such as a dynamic object assignment, e.g. `{ [dynamicKey]: value }`.
|
|
198
|
-
const
|
|
199
|
-
|
|
195
|
+
const filterItemCore = new Function('getRowId', 'appliers', 'row', 'shouldApplyFilter', `"use strict";
|
|
196
|
+
${appliers.map((applier, i) => `const shouldApply${i} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(applier.item.field)});`).join('\n')}
|
|
200
197
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
`).join('\n')}};
|
|
198
|
+
const result$$ = {
|
|
199
|
+
${appliers.map((applier, i) => ` ${JSON.stringify(String(applier.item.id))}: !shouldApply${i}
|
|
200
|
+
? false
|
|
201
|
+
: ${applier.v7 ? `appliers[${i}].fn(row)` : `appliers[${i}].fn(getRowId(row))`},`).join('\n')}
|
|
202
|
+
};
|
|
207
203
|
|
|
208
|
-
|
|
209
|
-
})`;
|
|
210
|
-
const filterItemCore = evalCode(filterItemTemplate.replaceAll('$$', String(filterItemsApplierId)));
|
|
211
|
-
const filterItem = (row, shouldApplyItem) => {
|
|
212
|
-
return filterItemCore(apiRef.current.getRowId, appliers, row, shouldApplyItem);
|
|
213
|
-
};
|
|
204
|
+
return result$$;`.replaceAll('$$', String(filterItemsApplierId)));
|
|
214
205
|
filterItemsApplierId += 1;
|
|
206
|
+
|
|
207
|
+
// Assign to the arrow function a name to help debugging
|
|
208
|
+
const filterItem = (row, shouldApplyItem) => filterItemCore(apiRef.current.getRowId, appliers, row, shouldApplyItem);
|
|
215
209
|
return filterItem;
|
|
216
210
|
};
|
|
217
211
|
|
package/node/index.js
CHANGED
package/node/locales/daDK.js
CHANGED
|
@@ -17,8 +17,8 @@ const daDKGrid = {
|
|
|
17
17
|
toolbarDensityStandard: 'Standard',
|
|
18
18
|
toolbarDensityComfortable: 'Luftig',
|
|
19
19
|
// Columns selector toolbar button text
|
|
20
|
-
toolbarColumns: '
|
|
21
|
-
toolbarColumnsLabel: 'Vælg
|
|
20
|
+
toolbarColumns: 'Kolonner',
|
|
21
|
+
toolbarColumnsLabel: 'Vælg kolonner',
|
|
22
22
|
// Filters toolbar button text
|
|
23
23
|
toolbarFilters: 'Filtre',
|
|
24
24
|
toolbarFiltersLabel: 'Vis filtre',
|
|
@@ -46,12 +46,12 @@ const daDKGrid = {
|
|
|
46
46
|
filterPanelRemoveAll: 'Fjern alle',
|
|
47
47
|
filterPanelDeleteIconLabel: 'Slet',
|
|
48
48
|
filterPanelLogicOperator: 'Logisk operator',
|
|
49
|
-
filterPanelOperator: '
|
|
49
|
+
filterPanelOperator: 'Operator',
|
|
50
50
|
filterPanelOperatorAnd: 'Og',
|
|
51
51
|
filterPanelOperatorOr: 'Eller',
|
|
52
|
-
filterPanelColumns: '
|
|
52
|
+
filterPanelColumns: 'Kolonner',
|
|
53
53
|
filterPanelInputLabel: 'Værdi',
|
|
54
|
-
filterPanelInputPlaceholder: '
|
|
54
|
+
filterPanelInputPlaceholder: 'Filterværdi',
|
|
55
55
|
// Filter operators text
|
|
56
56
|
filterOperatorContains: 'indeholder',
|
|
57
57
|
filterOperatorEquals: 'lig med',
|
|
@@ -98,10 +98,10 @@ const daDKGrid = {
|
|
|
98
98
|
filterValueFalse: 'negativ',
|
|
99
99
|
// Column menu text
|
|
100
100
|
columnMenuLabel: 'Menu',
|
|
101
|
-
columnMenuShowColumns: 'Vis
|
|
101
|
+
columnMenuShowColumns: 'Vis kolonner',
|
|
102
102
|
columnMenuManageColumns: 'Administrer kolonner',
|
|
103
|
-
columnMenuFilter: '
|
|
104
|
-
columnMenuHideColumn: 'Skjul',
|
|
103
|
+
columnMenuFilter: 'Filtrer',
|
|
104
|
+
columnMenuHideColumn: 'Skjul kolonne',
|
|
105
105
|
columnMenuUnsort: 'Fjern sortering',
|
|
106
106
|
columnMenuSortAsc: 'Sorter stigende',
|
|
107
107
|
columnMenuSortDesc: 'Sorter faldende',
|
|
@@ -131,13 +131,13 @@ const daDKGrid = {
|
|
|
131
131
|
pinToRight: 'Fastgør til højre',
|
|
132
132
|
unpin: 'Frigiv',
|
|
133
133
|
// Tree Data
|
|
134
|
-
treeDataGroupingHeaderName: '
|
|
134
|
+
treeDataGroupingHeaderName: 'Gruppe',
|
|
135
135
|
treeDataExpand: 'Vis underelementer',
|
|
136
136
|
treeDataCollapse: 'Skjul underelementer',
|
|
137
137
|
// Grouping columns
|
|
138
|
-
groupingColumnHeaderName: '
|
|
138
|
+
groupingColumnHeaderName: 'Gruppe',
|
|
139
139
|
groupColumn: name => `Gruppér efter ${name}`,
|
|
140
|
-
unGroupColumn: name => `Fjern
|
|
140
|
+
unGroupColumn: name => `Fjern gruppering efter ${name}`,
|
|
141
141
|
// Master/detail
|
|
142
142
|
detailPanelToggle: 'Udvid/kollaps detaljepanel',
|
|
143
143
|
expandDetailPanel: 'Udvid',
|
|
@@ -145,7 +145,7 @@ const daDKGrid = {
|
|
|
145
145
|
// Row reordering text
|
|
146
146
|
rowReorderingHeaderName: 'Omarrangering af rækker',
|
|
147
147
|
// Aggregation
|
|
148
|
-
aggregationMenuItemHeader: '
|
|
148
|
+
aggregationMenuItemHeader: 'Aggregering',
|
|
149
149
|
aggregationFunctionLabelSum: 'sum',
|
|
150
150
|
aggregationFunctionLabelAvg: 'gns',
|
|
151
151
|
aggregationFunctionLabelMin: 'min',
|
package/node/locales/heIL.js
CHANGED
|
@@ -66,13 +66,12 @@ const heILGrid = {
|
|
|
66
66
|
filterOperatorIsEmpty: 'ריק',
|
|
67
67
|
filterOperatorIsNotEmpty: 'אינו ריק',
|
|
68
68
|
filterOperatorIsAnyOf: 'הוא אחד מ-',
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
'filterOperator=': '=',
|
|
70
|
+
'filterOperator!=': '!=',
|
|
71
|
+
'filterOperator>': '>',
|
|
72
|
+
'filterOperator>=': '>=',
|
|
73
|
+
'filterOperator<': '<',
|
|
74
|
+
'filterOperator<=': '<=',
|
|
76
75
|
// Header filter operators text
|
|
77
76
|
headerFilterOperatorContains: 'מכיל',
|
|
78
77
|
headerFilterOperatorEquals: 'שווה',
|
|
@@ -140,7 +139,7 @@ const heILGrid = {
|
|
|
140
139
|
groupColumn: name => `קבץ לפי ${name}`,
|
|
141
140
|
unGroupColumn: name => `הפסק לקבץ לפי ${name}`,
|
|
142
141
|
// Master/detail
|
|
143
|
-
|
|
142
|
+
detailPanelToggle: 'הצג/הסתר פרטים',
|
|
144
143
|
expandDetailPanel: 'הרחב',
|
|
145
144
|
collapseDetailPanel: 'כווץ',
|
|
146
145
|
// Row reordering text
|