@mui/x-data-grid 6.3.1 → 6.4.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.
Files changed (134) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/DataGrid/DataGrid.js +20 -1
  3. package/DataGrid/useDataGridComponent.js +2 -2
  4. package/DataGrid/useDataGridProps.js +3 -1
  5. package/colDef/gridBooleanColDef.js +19 -1
  6. package/colDef/gridDateColDef.js +6 -2
  7. package/colDef/gridSingleSelectColDef.js +21 -1
  8. package/components/base/GridBody.js +2 -1
  9. package/components/containers/GridRootStyles.js +1 -0
  10. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
  11. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
  12. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +12 -1
  13. package/hooks/features/clipboard/useGridClipboard.d.ts +2 -1
  14. package/hooks/features/clipboard/useGridClipboard.js +43 -26
  15. package/hooks/features/dimensions/useGridDimensions.js +2 -4
  16. package/hooks/features/editing/useGridCellEditing.js +7 -3
  17. package/hooks/features/editing/useGridRowEditing.js +7 -3
  18. package/hooks/features/export/serializers/csvSerializer.d.ts +5 -0
  19. package/hooks/features/export/serializers/csvSerializer.js +46 -6
  20. package/hooks/features/export/useGridCsvExport.d.ts +2 -1
  21. package/hooks/features/export/useGridCsvExport.js +7 -5
  22. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +11 -0
  23. package/index.js +1 -1
  24. package/internals/index.d.ts +3 -2
  25. package/internals/index.js +3 -2
  26. package/joy/icons.d.ts +33 -0
  27. package/joy/icons.js +433 -0
  28. package/joy/joySlots.js +114 -4
  29. package/legacy/DataGrid/DataGrid.js +20 -1
  30. package/legacy/DataGrid/useDataGridComponent.js +2 -2
  31. package/legacy/DataGrid/useDataGridProps.js +3 -1
  32. package/legacy/colDef/gridBooleanColDef.js +21 -1
  33. package/legacy/colDef/gridDateColDef.js +10 -2
  34. package/legacy/colDef/gridSingleSelectColDef.js +21 -1
  35. package/legacy/components/base/GridBody.js +2 -1
  36. package/legacy/components/containers/GridRootStyles.js +1 -0
  37. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
  38. package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
  39. package/legacy/hooks/features/clipboard/useGridClipboard.js +44 -26
  40. package/legacy/hooks/features/dimensions/useGridDimensions.js +2 -4
  41. package/legacy/hooks/features/editing/useGridCellEditing.js +7 -3
  42. package/legacy/hooks/features/editing/useGridRowEditing.js +7 -3
  43. package/legacy/hooks/features/export/serializers/csvSerializer.js +43 -6
  44. package/legacy/hooks/features/export/useGridCsvExport.js +8 -5
  45. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +10 -0
  46. package/legacy/index.js +1 -1
  47. package/legacy/internals/index.js +3 -2
  48. package/legacy/joy/icons.js +432 -0
  49. package/legacy/joy/joySlots.js +118 -4
  50. package/legacy/locales/deDE.js +2 -2
  51. package/legacy/locales/frFR.js +6 -6
  52. package/legacy/locales/ptBR.js +1 -1
  53. package/legacy/locales/ukUA.js +8 -9
  54. package/legacy/material/index.js +3 -1
  55. package/legacy/models/api/index.js +0 -1
  56. package/legacy/utils/domUtils.js +14 -1
  57. package/locales/deDE.js +2 -2
  58. package/locales/frFR.js +6 -6
  59. package/locales/ptBR.js +1 -1
  60. package/locales/ukUA.js +8 -9
  61. package/material/index.d.ts +1 -0
  62. package/material/index.js +3 -1
  63. package/models/api/gridApiCommon.d.ts +1 -2
  64. package/models/api/gridCoreApi.d.ts +4 -0
  65. package/models/api/index.d.ts +0 -1
  66. package/models/api/index.js +0 -1
  67. package/models/events/gridEventLookup.d.ts +6 -0
  68. package/models/gridSlotsComponent.d.ts +5 -0
  69. package/models/gridSlotsComponentsProps.d.ts +4 -0
  70. package/models/props/DataGridProps.d.ts +19 -0
  71. package/modern/DataGrid/DataGrid.js +20 -1
  72. package/modern/DataGrid/useDataGridComponent.js +2 -2
  73. package/modern/DataGrid/useDataGridProps.js +3 -1
  74. package/modern/colDef/gridBooleanColDef.js +19 -1
  75. package/modern/colDef/gridDateColDef.js +6 -2
  76. package/modern/colDef/gridSingleSelectColDef.js +21 -1
  77. package/modern/components/base/GridBody.js +2 -1
  78. package/modern/components/containers/GridRootStyles.js +1 -0
  79. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
  80. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
  81. package/modern/hooks/features/clipboard/useGridClipboard.js +43 -26
  82. package/modern/hooks/features/dimensions/useGridDimensions.js +1 -3
  83. package/modern/hooks/features/editing/useGridCellEditing.js +7 -3
  84. package/modern/hooks/features/editing/useGridRowEditing.js +7 -3
  85. package/modern/hooks/features/export/serializers/csvSerializer.js +44 -6
  86. package/modern/hooks/features/export/useGridCsvExport.js +7 -5
  87. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +11 -0
  88. package/modern/index.js +1 -1
  89. package/modern/internals/index.js +3 -2
  90. package/modern/joy/icons.js +433 -0
  91. package/modern/joy/joySlots.js +110 -4
  92. package/modern/locales/deDE.js +2 -2
  93. package/modern/locales/frFR.js +6 -6
  94. package/modern/locales/ptBR.js +1 -1
  95. package/modern/locales/ukUA.js +8 -9
  96. package/modern/material/index.js +3 -1
  97. package/modern/models/api/index.js +0 -1
  98. package/modern/utils/domUtils.js +13 -1
  99. package/node/DataGrid/DataGrid.js +20 -1
  100. package/node/DataGrid/useDataGridComponent.js +2 -2
  101. package/node/DataGrid/useDataGridProps.js +3 -1
  102. package/node/colDef/gridBooleanColDef.js +19 -1
  103. package/node/colDef/gridDateColDef.js +6 -2
  104. package/node/colDef/gridSingleSelectColDef.js +21 -1
  105. package/node/components/base/GridBody.js +2 -1
  106. package/node/components/containers/GridRootStyles.js +1 -0
  107. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
  108. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
  109. package/node/hooks/features/clipboard/useGridClipboard.js +42 -25
  110. package/node/hooks/features/dimensions/useGridDimensions.js +1 -3
  111. package/node/hooks/features/editing/useGridCellEditing.js +7 -3
  112. package/node/hooks/features/editing/useGridRowEditing.js +7 -3
  113. package/node/hooks/features/export/serializers/csvSerializer.js +46 -6
  114. package/node/hooks/features/export/useGridCsvExport.js +6 -3
  115. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +11 -0
  116. package/node/index.js +1 -1
  117. package/node/internals/index.js +23 -1
  118. package/node/joy/icons.js +471 -0
  119. package/node/joy/joySlots.js +110 -3
  120. package/node/locales/deDE.js +2 -2
  121. package/node/locales/frFR.js +6 -6
  122. package/node/locales/ptBR.js +1 -1
  123. package/node/locales/ukUA.js +8 -9
  124. package/node/material/index.js +3 -1
  125. package/node/models/api/index.js +0 -11
  126. package/node/utils/domUtils.js +15 -1
  127. package/package.json +1 -1
  128. package/utils/domUtils.d.ts +1 -0
  129. package/utils/domUtils.js +13 -1
  130. package/legacy/models/api/gridClipboardApi.js +0 -1
  131. package/models/api/gridClipboardApi.d.ts +0 -11
  132. package/models/api/gridClipboardApi.js +0 -1
  133. package/modern/models/api/gridClipboardApi.js +0 -1
  134. package/node/models/api/gridClipboardApi.js +0 -5
@@ -57,7 +57,7 @@ const ukUAGrid = {
57
57
  columnsPanelHideAllButton: 'Приховати всі',
58
58
  // Filter panel text
59
59
  filterPanelAddFilter: 'Додати фільтр',
60
- // filterPanelRemoveAll: 'Remove all',
60
+ filterPanelRemoveAll: 'Видалити всі',
61
61
  filterPanelDeleteIconLabel: 'Видалити',
62
62
  filterPanelLogicOperator: 'Логічна функція',
63
63
  filterPanelOperator: 'Оператори',
@@ -87,7 +87,7 @@ const ukUAGrid = {
87
87
  // Column menu text
88
88
  columnMenuLabel: 'Меню',
89
89
  columnMenuShowColumns: 'Показати стовпці',
90
- // columnMenuManageColumns: 'Manage columns',
90
+ columnMenuManageColumns: 'Керування стовпцями',
91
91
  columnMenuFilter: 'Фільтр',
92
92
  columnMenuHideColumn: 'Приховати',
93
93
  columnMenuUnsort: 'Скасувати сортування',
@@ -141,13 +141,12 @@ const ukUAGrid = {
141
141
  // Row reordering text
142
142
  rowReorderingHeaderName: 'Порядок рядків',
143
143
  // Aggregation
144
- aggregationMenuItemHeader: 'Агрегація'
145
- // aggregationFunctionLabelSum: 'sum',
146
- // aggregationFunctionLabelAvg: 'avg',
147
- // aggregationFunctionLabelMin: 'min',
148
- // aggregationFunctionLabelMax: 'max',
149
- // aggregationFunctionLabelSize: 'size',
144
+ aggregationMenuItemHeader: 'Агрегація',
145
+ aggregationFunctionLabelSum: 'сума',
146
+ aggregationFunctionLabelAvg: 'сер',
147
+ aggregationFunctionLabelMin: 'мін',
148
+ aggregationFunctionLabelMax: 'макс',
149
+ aggregationFunctionLabelSize: 'кількість'
150
150
  };
151
-
152
151
  const ukUA = (0, _getGridLocalization.getGridLocalization)(ukUAGrid, _locale.ukUA);
153
152
  exports.ukUA = ukUA;
@@ -16,6 +16,7 @@ var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
16
16
  var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
17
17
  var _Popper = _interopRequireDefault(require("@mui/material/Popper"));
18
18
  var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
19
+ var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
19
20
  var _GridColumnUnsortedIcon = require("./icons/GridColumnUnsortedIcon");
20
21
  var _icons = require("./icons");
21
22
  var _MUISelectOption = _interopRequireDefault(require("./components/MUISelectOption"));
@@ -67,7 +68,8 @@ const materialSlots = (0, _extends2.default)({}, iconSlots, {
67
68
  BaseTooltip: _Tooltip.default,
68
69
  BasePopper: _Popper.default,
69
70
  BaseInputLabel: _InputLabel.default,
70
- BaseSelectOption: _MUISelectOption.default
71
+ BaseSelectOption: _MUISelectOption.default,
72
+ BaseChip: _Chip.default
71
73
  });
72
74
  var _default = materialSlots;
73
75
  exports.default = _default;
@@ -146,17 +146,6 @@ Object.keys(_gridDisableVirtualizationApi).forEach(function (key) {
146
146
  }
147
147
  });
148
148
  });
149
- var _gridClipboardApi = require("./gridClipboardApi");
150
- Object.keys(_gridClipboardApi).forEach(function (key) {
151
- if (key === "default" || key === "__esModule") return;
152
- if (key in exports && exports[key] === _gridClipboardApi[key]) return;
153
- Object.defineProperty(exports, key, {
154
- enumerable: true,
155
- get: function () {
156
- return _gridClipboardApi[key];
157
- }
158
- });
159
- });
160
149
  var _gridCallbackDetails = require("./gridCallbackDetails");
161
150
  Object.keys(_gridCallbackDetails).forEach(function (key) {
162
151
  if (key === "default" || key === "__esModule") return;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.findParentElementFromClassName = findParentElementFromClassName;
7
+ exports.getActiveElement = void 0;
7
8
  exports.getGridCellElement = getGridCellElement;
8
9
  exports.getGridColumnHeaderElement = getGridColumnHeaderElement;
9
10
  exports.getGridRowElement = getGridRowElement;
@@ -52,4 +53,17 @@ function getGridCellElement(root, {
52
53
  const cellSelector = `.${_gridClasses.gridClasses.cell}[data-field="${escapeOperandAttributeSelector(field)}"]`;
53
54
  const selector = `${rowSelector} ${cellSelector}`;
54
55
  return root.querySelector(selector);
55
- }
56
+ }
57
+
58
+ // https://www.abeautifulsite.net/posts/finding-the-active-element-in-a-shadow-root/
59
+ const getActiveElement = (root = document) => {
60
+ const activeEl = root.activeElement;
61
+ if (!activeEl) {
62
+ return null;
63
+ }
64
+ if (activeEl.shadowRoot) {
65
+ return getActiveElement(activeEl.shadowRoot);
66
+ }
67
+ return activeEl;
68
+ };
69
+ exports.getActiveElement = getActiveElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "6.3.1",
3
+ "version": "6.4.0",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -10,3 +10,4 @@ export declare function getGridCellElement(root: Element, { id, field }: {
10
10
  id: GridRowId;
11
11
  field: string;
12
12
  }): HTMLDivElement | null;
13
+ export declare const getActiveElement: (root?: Document | ShadowRoot) => Element | null;
package/utils/domUtils.js CHANGED
@@ -39,4 +39,16 @@ export function getGridCellElement(root, {
39
39
  const cellSelector = `.${gridClasses.cell}[data-field="${escapeOperandAttributeSelector(field)}"]`;
40
40
  const selector = `${rowSelector} ${cellSelector}`;
41
41
  return root.querySelector(selector);
42
- }
42
+ }
43
+
44
+ // https://www.abeautifulsite.net/posts/finding-the-active-element-in-a-shadow-root/
45
+ export const getActiveElement = (root = document) => {
46
+ const activeEl = root.activeElement;
47
+ if (!activeEl) {
48
+ return null;
49
+ }
50
+ if (activeEl.shadowRoot) {
51
+ return getActiveElement(activeEl.shadowRoot);
52
+ }
53
+ return activeEl;
54
+ };
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- /**
2
- * The Clipboard API interface that is available in the grid [[apiRef]].
3
- */
4
- export interface GridClipboardApi {
5
- /**
6
- * Copies the selected rows to the clipboard.
7
- * The fields will be separated by the TAB character.
8
- * @ignore - do not document.
9
- */
10
- unstable_copySelectedRowsToClipboard: () => void;
11
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });