@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.
Files changed (41) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/components/GridPagination.d.ts +1 -1
  3. package/components/GridPagination.js +8 -1
  4. package/components/cell/GridActionsCell.js +3 -3
  5. package/components/cell/GridActionsCellItem.d.ts +13 -1
  6. package/components/cell/GridActionsCellItem.js +27 -15
  7. package/components/containers/GridRootStyles.js +6 -0
  8. package/hooks/features/export/useGridPrintExport.js +3 -1
  9. package/hooks/features/filter/gridFilterUtils.js +15 -22
  10. package/index.js +1 -1
  11. package/legacy/components/GridPagination.js +8 -1
  12. package/legacy/components/cell/GridActionsCell.js +3 -3
  13. package/legacy/components/cell/GridActionsCellItem.js +30 -17
  14. package/legacy/components/containers/GridRootStyles.js +5 -1
  15. package/legacy/hooks/features/export/useGridPrintExport.js +11 -7
  16. package/legacy/hooks/features/filter/gridFilterUtils.js +11 -14
  17. package/legacy/index.js +1 -1
  18. package/legacy/locales/daDK.js +12 -12
  19. package/legacy/locales/heIL.js +7 -8
  20. package/locales/daDK.js +12 -12
  21. package/locales/heIL.js +7 -8
  22. package/models/props/DataGridProps.d.ts +1 -1
  23. package/modern/components/GridPagination.js +8 -1
  24. package/modern/components/cell/GridActionsCell.js +3 -3
  25. package/modern/components/cell/GridActionsCellItem.js +27 -15
  26. package/modern/components/containers/GridRootStyles.js +6 -0
  27. package/modern/hooks/features/export/useGridPrintExport.js +3 -1
  28. package/modern/hooks/features/filter/gridFilterUtils.js +15 -22
  29. package/modern/index.js +1 -1
  30. package/modern/locales/daDK.js +12 -12
  31. package/modern/locales/heIL.js +7 -8
  32. package/node/components/GridPagination.js +8 -1
  33. package/node/components/cell/GridActionsCell.js +3 -3
  34. package/node/components/cell/GridActionsCellItem.js +27 -15
  35. package/node/components/containers/GridRootStyles.js +6 -0
  36. package/node/hooks/features/export/useGridPrintExport.js +3 -1
  37. package/node/hooks/features/filter/gridFilterUtils.js +15 -21
  38. package/node/index.js +1 -1
  39. package/node/locales/daDK.js +12 -12
  40. package/node/locales/heIL.js +7 -8
  41. 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
- previousRows.current = apiRef.current.getSortedRows();
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
- const getHasEval = () => {
16
+ function getHasEval() {
20
17
  if (hasEval !== undefined) {
21
18
  return hasEval;
22
19
  }
23
20
  try {
24
- hasEval = evalCode('true');
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 `eval()` to avoid expensive patterns for JS engines
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 filterItemTemplate = `(function filterItem$$(getRowId, appliers, row, shouldApplyFilter) {
199
- ${appliers.map((applier, i) => `const shouldApply${i} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(applier.item.field)});`).join('\n')}
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
- const result$$ = {
202
- ${appliers.map((applier, i) => `${JSON.stringify(String(applier.item.id))}:
203
- !shouldApply${i} ?
204
- false :
205
- ${applier.v7 ? `appliers[${i}].fn(row)` : `appliers[${i}].fn(getRowId(row))`},
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
- return result$$;
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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.19.2
2
+ * @mui/x-data-grid v6.19.4
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -17,8 +17,8 @@ const daDKGrid = {
17
17
  toolbarDensityStandard: 'Standard',
18
18
  toolbarDensityComfortable: 'Luftig',
19
19
  // Columns selector toolbar button text
20
- toolbarColumns: 'Kolonne',
21
- toolbarColumnsLabel: 'Vælg kolonne',
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: 'Operatorer',
49
+ filterPanelOperator: 'Operator',
50
50
  filterPanelOperatorAnd: 'Og',
51
51
  filterPanelOperatorOr: 'Eller',
52
- filterPanelColumns: 'Kolonne',
52
+ filterPanelColumns: 'Kolonner',
53
53
  filterPanelInputLabel: 'Værdi',
54
- filterPanelInputPlaceholder: 'Filter værdi',
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 Kolonner',
101
+ columnMenuShowColumns: 'Vis kolonner',
102
102
  columnMenuManageColumns: 'Administrer kolonner',
103
- columnMenuFilter: 'Filtre',
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: 'Gruppering',
134
+ treeDataGroupingHeaderName: 'Gruppe',
135
135
  treeDataExpand: 'Vis underelementer',
136
136
  treeDataCollapse: 'Skjul underelementer',
137
137
  // Grouping columns
138
- groupingColumnHeaderName: 'Gruppér',
138
+ groupingColumnHeaderName: 'Gruppe',
139
139
  groupColumn: name => `Gruppér efter ${name}`,
140
- unGroupColumn: name => `Fjern gruppéring efter ${name}`,
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: 'Aggregation',
148
+ aggregationMenuItemHeader: 'Aggregering',
149
149
  aggregationFunctionLabelSum: 'sum',
150
150
  aggregationFunctionLabelAvg: 'gns',
151
151
  aggregationFunctionLabelMin: 'min',
@@ -66,13 +66,12 @@ const heILGrid = {
66
66
  filterOperatorIsEmpty: 'ריק',
67
67
  filterOperatorIsNotEmpty: 'אינו ריק',
68
68
  filterOperatorIsAnyOf: 'הוא אחד מ-',
69
- // 'filterOperator=': '=',
70
- // 'filterOperator!=': '!=',
71
- // 'filterOperator>': '>',
72
- // 'filterOperator>=': '>=',
73
- // 'filterOperator<': '<',
74
- // 'filterOperator<=': '<=',
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
- // detailPanelToggle: 'Detail panel toggle',
142
+ detailPanelToggle: 'הצג/הסתר פרטים',
144
143
  expandDetailPanel: 'הרחב',
145
144
  collapseDetailPanel: 'כווץ',
146
145
  // Row reordering text
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "6.19.2",
3
+ "version": "6.19.4",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",