@mui/x-data-grid 6.7.0 → 6.9.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 (205) hide show
  1. package/CHANGELOG.md +145 -5541
  2. package/components/GridColumnHeaders.d.ts +2 -2
  3. package/components/GridColumnHeaders.js +3 -1
  4. package/components/GridPagination.d.ts +2 -2
  5. package/components/GridRow.d.ts +2 -2
  6. package/components/GridRow.js +33 -79
  7. package/components/cell/GridCell.d.ts +24 -15
  8. package/components/cell/GridCell.js +422 -45
  9. package/components/cell/GridEditInputCell.js +9 -9
  10. package/components/cell/index.d.ts +2 -1
  11. package/components/cell/index.js +1 -1
  12. package/components/containers/GridRootStyles.js +30 -16
  13. package/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
  14. package/components/panel/GridPanel.d.ts +1 -1
  15. package/components/toolbar/GridToolbar.js +2 -2
  16. package/components/virtualization/GridVirtualScroller.js +4 -9
  17. package/components/virtualization/GridVirtualScrollerContent.js +11 -20
  18. package/constants/defaultGridSlotsComponents.js +6 -2
  19. package/hooks/core/useGridApiInitialization.js +4 -1
  20. package/hooks/core/useGridStateInitialization.js +2 -9
  21. package/hooks/features/clipboard/useGridClipboard.js +1 -4
  22. package/hooks/features/columnGrouping/gridColumnGroupsSelector.js +4 -4
  23. package/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
  24. package/hooks/features/columns/gridColumnsSelector.js +7 -7
  25. package/hooks/features/dimensions/useGridDimensions.js +6 -12
  26. package/hooks/features/editing/useGridCellEditing.js +5 -3
  27. package/hooks/features/editing/useGridRowEditing.js +14 -6
  28. package/hooks/features/filter/gridFilterSelector.js +8 -8
  29. package/hooks/features/filter/gridFilterUtils.d.ts +4 -1
  30. package/hooks/features/filter/gridFilterUtils.js +19 -13
  31. package/hooks/features/filter/useGridFilter.js +2 -1
  32. package/hooks/features/focus/useGridFocus.js +9 -4
  33. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
  34. package/hooks/features/pagination/gridPaginationSelector.js +4 -4
  35. package/hooks/features/rowSelection/gridRowSelectionSelector.js +3 -3
  36. package/hooks/features/rows/gridRowsSelector.js +3 -3
  37. package/hooks/features/rows/useGridParamsApi.d.ts +2 -0
  38. package/hooks/features/rows/useGridParamsApi.js +7 -15
  39. package/hooks/features/sorting/gridSortingSelector.js +3 -3
  40. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +8 -816
  41. package/hooks/features/virtualization/useGridVirtualScroller.js +40 -38
  42. package/hooks/utils/index.d.ts +1 -1
  43. package/hooks/utils/index.js +1 -1
  44. package/hooks/utils/useGridSelector.d.ts +3 -1
  45. package/hooks/utils/useGridSelector.js +37 -6
  46. package/hooks/utils/useLazyRef.d.ts +2 -0
  47. package/hooks/utils/useLazyRef.js +9 -0
  48. package/hooks/utils/useOnMount.d.ts +2 -0
  49. package/hooks/utils/useOnMount.js +7 -0
  50. package/index.js +1 -1
  51. package/internals/index.d.ts +1 -1
  52. package/internals/index.js +1 -1
  53. package/legacy/components/GridColumnHeaders.js +3 -1
  54. package/legacy/components/GridRow.js +35 -79
  55. package/legacy/components/cell/GridCell.js +425 -46
  56. package/legacy/components/cell/GridEditInputCell.js +9 -9
  57. package/legacy/components/cell/index.js +1 -1
  58. package/legacy/components/containers/GridRootStyles.js +20 -17
  59. package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
  60. package/legacy/components/toolbar/GridToolbar.js +2 -2
  61. package/legacy/components/virtualization/GridVirtualScroller.js +4 -7
  62. package/legacy/components/virtualization/GridVirtualScrollerContent.js +10 -17
  63. package/legacy/constants/defaultGridSlotsComponents.js +6 -2
  64. package/legacy/hooks/core/useGridApiInitialization.js +4 -1
  65. package/legacy/hooks/core/useGridStateInitialization.js +2 -7
  66. package/legacy/hooks/features/clipboard/useGridClipboard.js +1 -4
  67. package/legacy/hooks/features/columnGrouping/gridColumnGroupsSelector.js +4 -4
  68. package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
  69. package/legacy/hooks/features/columns/gridColumnsSelector.js +7 -7
  70. package/legacy/hooks/features/dimensions/useGridDimensions.js +6 -12
  71. package/legacy/hooks/features/editing/useGridCellEditing.js +5 -3
  72. package/legacy/hooks/features/editing/useGridRowEditing.js +15 -7
  73. package/legacy/hooks/features/filter/gridFilterSelector.js +8 -8
  74. package/legacy/hooks/features/filter/gridFilterUtils.js +23 -19
  75. package/legacy/hooks/features/filter/useGridFilter.js +2 -1
  76. package/legacy/hooks/features/focus/useGridFocus.js +9 -4
  77. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
  78. package/legacy/hooks/features/pagination/gridPaginationSelector.js +4 -4
  79. package/legacy/hooks/features/rowSelection/gridRowSelectionSelector.js +3 -3
  80. package/legacy/hooks/features/rows/gridRowsSelector.js +3 -3
  81. package/legacy/hooks/features/rows/useGridParamsApi.js +23 -15
  82. package/legacy/hooks/features/sorting/gridSortingSelector.js +3 -3
  83. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +38 -34
  84. package/legacy/hooks/utils/index.js +1 -1
  85. package/legacy/hooks/utils/useGridSelector.js +43 -5
  86. package/legacy/hooks/utils/useLazyRef.js +9 -0
  87. package/legacy/hooks/utils/useOnMount.js +7 -0
  88. package/legacy/index.js +1 -1
  89. package/legacy/internals/index.js +1 -1
  90. package/legacy/locales/elGR.js +70 -79
  91. package/legacy/locales/ptBR.js +12 -13
  92. package/legacy/utils/Store.js +34 -0
  93. package/legacy/utils/createSelector.js +74 -6
  94. package/legacy/utils/doesSupportPreventScroll.js +13 -0
  95. package/legacy/utils/fastMemo.js +5 -0
  96. package/legacy/utils/fastObjectShallowCompare.js +32 -0
  97. package/legacy/utils/keyboardUtils.js +4 -2
  98. package/locales/elGR.js +66 -79
  99. package/locales/ptBR.js +12 -13
  100. package/models/api/gridCoreApi.d.ts +6 -0
  101. package/models/colDef/gridColDef.d.ts +4 -3
  102. package/models/colDef/gridColType.d.ts +3 -1
  103. package/models/events/gridEventLookup.d.ts +3 -3
  104. package/modern/components/GridColumnHeaders.js +3 -1
  105. package/modern/components/GridRow.js +32 -79
  106. package/modern/components/cell/GridCell.js +421 -45
  107. package/modern/components/cell/GridEditInputCell.js +9 -9
  108. package/modern/components/cell/index.js +1 -1
  109. package/modern/components/containers/GridRootStyles.js +30 -16
  110. package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
  111. package/modern/components/toolbar/GridToolbar.js +2 -2
  112. package/modern/components/virtualization/GridVirtualScroller.js +4 -9
  113. package/modern/components/virtualization/GridVirtualScrollerContent.js +10 -20
  114. package/modern/constants/defaultGridSlotsComponents.js +6 -2
  115. package/modern/hooks/core/useGridApiInitialization.js +4 -1
  116. package/modern/hooks/core/useGridStateInitialization.js +2 -9
  117. package/modern/hooks/features/clipboard/useGridClipboard.js +1 -4
  118. package/modern/hooks/features/columnGrouping/gridColumnGroupsSelector.js +4 -4
  119. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
  120. package/modern/hooks/features/columns/gridColumnsSelector.js +7 -7
  121. package/modern/hooks/features/dimensions/useGridDimensions.js +6 -12
  122. package/modern/hooks/features/editing/useGridCellEditing.js +5 -3
  123. package/modern/hooks/features/editing/useGridRowEditing.js +14 -6
  124. package/modern/hooks/features/filter/gridFilterSelector.js +8 -8
  125. package/modern/hooks/features/filter/gridFilterUtils.js +17 -12
  126. package/modern/hooks/features/filter/useGridFilter.js +2 -1
  127. package/modern/hooks/features/focus/useGridFocus.js +8 -4
  128. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
  129. package/modern/hooks/features/pagination/gridPaginationSelector.js +4 -4
  130. package/modern/hooks/features/rowSelection/gridRowSelectionSelector.js +3 -3
  131. package/modern/hooks/features/rows/gridRowsSelector.js +3 -3
  132. package/modern/hooks/features/rows/useGridParamsApi.js +7 -15
  133. package/modern/hooks/features/sorting/gridSortingSelector.js +3 -3
  134. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +40 -38
  135. package/modern/hooks/utils/index.js +1 -1
  136. package/modern/hooks/utils/useGridSelector.js +37 -6
  137. package/modern/hooks/utils/useLazyRef.js +9 -0
  138. package/modern/hooks/utils/useOnMount.js +7 -0
  139. package/modern/index.js +1 -1
  140. package/modern/internals/index.js +1 -1
  141. package/modern/locales/elGR.js +66 -79
  142. package/modern/locales/ptBR.js +12 -13
  143. package/modern/utils/Store.js +24 -0
  144. package/modern/utils/createSelector.js +74 -6
  145. package/modern/utils/doesSupportPreventScroll.js +13 -0
  146. package/modern/utils/fastMemo.js +5 -0
  147. package/modern/utils/fastObjectShallowCompare.js +32 -0
  148. package/modern/utils/keyboardUtils.js +4 -2
  149. package/node/components/GridColumnHeaders.js +4 -2
  150. package/node/components/GridRow.js +32 -79
  151. package/node/components/cell/GridCell.js +424 -47
  152. package/node/components/cell/GridEditInputCell.js +9 -9
  153. package/node/components/cell/index.js +17 -10
  154. package/node/components/containers/GridRootStyles.js +30 -16
  155. package/node/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
  156. package/node/components/toolbar/GridToolbar.js +2 -2
  157. package/node/components/virtualization/GridVirtualScroller.js +4 -9
  158. package/node/components/virtualization/GridVirtualScrollerContent.js +10 -20
  159. package/node/constants/defaultGridSlotsComponents.js +4 -1
  160. package/node/hooks/core/useGridApiInitialization.js +4 -1
  161. package/node/hooks/core/useGridStateInitialization.js +2 -9
  162. package/node/hooks/features/clipboard/useGridClipboard.js +1 -4
  163. package/node/hooks/features/columnGrouping/gridColumnGroupsSelector.js +3 -3
  164. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +8 -2
  165. package/node/hooks/features/columns/gridColumnsSelector.js +6 -6
  166. package/node/hooks/features/dimensions/useGridDimensions.js +6 -12
  167. package/node/hooks/features/editing/useGridCellEditing.js +5 -3
  168. package/node/hooks/features/editing/useGridRowEditing.js +14 -6
  169. package/node/hooks/features/filter/gridFilterSelector.js +7 -7
  170. package/node/hooks/features/filter/gridFilterUtils.js +17 -12
  171. package/node/hooks/features/filter/useGridFilter.js +2 -1
  172. package/node/hooks/features/focus/useGridFocus.js +8 -4
  173. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
  174. package/node/hooks/features/pagination/gridPaginationSelector.js +3 -3
  175. package/node/hooks/features/rowSelection/gridRowSelectionSelector.js +2 -2
  176. package/node/hooks/features/rows/gridRowsSelector.js +2 -2
  177. package/node/hooks/features/rows/useGridParamsApi.js +9 -15
  178. package/node/hooks/features/sorting/gridSortingSelector.js +2 -2
  179. package/node/hooks/features/virtualization/useGridVirtualScroller.js +40 -36
  180. package/node/hooks/utils/index.js +14 -10
  181. package/node/hooks/utils/useGridSelector.js +41 -7
  182. package/node/hooks/utils/useLazyRef.js +17 -0
  183. package/node/hooks/utils/useOnMount.js +15 -0
  184. package/node/index.js +1 -1
  185. package/node/internals/index.js +7 -0
  186. package/node/locales/elGR.js +66 -79
  187. package/node/locales/ptBR.js +12 -13
  188. package/node/utils/Store.js +31 -0
  189. package/node/utils/createSelector.js +77 -8
  190. package/node/utils/doesSupportPreventScroll.js +19 -0
  191. package/node/utils/fastMemo.js +13 -0
  192. package/node/utils/fastObjectShallowCompare.js +38 -0
  193. package/node/utils/keyboardUtils.js +4 -2
  194. package/package.json +2 -2
  195. package/utils/Store.d.ts +11 -0
  196. package/utils/Store.js +24 -0
  197. package/utils/createSelector.d.ts +1 -0
  198. package/utils/createSelector.js +74 -6
  199. package/utils/doesSupportPreventScroll.d.ts +1 -0
  200. package/utils/doesSupportPreventScroll.js +13 -0
  201. package/utils/fastMemo.d.ts +1 -0
  202. package/utils/fastMemo.js +5 -0
  203. package/utils/fastObjectShallowCompare.d.ts +1 -0
  204. package/utils/fastObjectShallowCompare.js +32 -0
  205. package/utils/keyboardUtils.js +4 -2
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useLazyRef = useLazyRef;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
9
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
10
+ const UNINITIALIZED = {};
11
+ function useLazyRef(init, initArg) {
12
+ const ref = React.useRef(UNINITIALIZED);
13
+ if (ref.current === UNINITIALIZED) {
14
+ ref.current = init(initArg);
15
+ }
16
+ return ref;
17
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useOnMount = useOnMount;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
9
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
10
+ const EMPTY = [];
11
+ function useOnMount(fn) {
12
+ /* eslint-disable react-hooks/exhaustive-deps */
13
+ React.useEffect(fn, EMPTY);
14
+ /* eslint-enable react-hooks/exhaustive-deps */
15
+ }
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v6.7.0
2
+ * @mui/x-data-grid v6.9.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -76,6 +76,7 @@ var _exportNames = {
76
76
  getColumnsToExport: true,
77
77
  defaultGetRowsToExport: true,
78
78
  createSelector: true,
79
+ createSelectorMemoized: true,
79
80
  unstable_resetCreateSelectorCache: true,
80
81
  findParentElementFromClassName: true,
81
82
  getActiveElement: true,
@@ -180,6 +181,12 @@ Object.defineProperty(exports, "createSelector", {
180
181
  return _createSelector.createSelector;
181
182
  }
182
183
  });
184
+ Object.defineProperty(exports, "createSelectorMemoized", {
185
+ enumerable: true,
186
+ get: function () {
187
+ return _createSelector.createSelectorMemoized;
188
+ }
189
+ });
183
190
  Object.defineProperty(exports, "defaultGetRowsToExport", {
184
191
  enumerable: true,
185
192
  get: function () {
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.elGR = void 0;
7
+ var _locale = require("@mui/material/locale");
7
8
  var _getGridLocalization = require("../utils/getGridLocalization");
8
9
  const elGRGrid = {
9
10
  // Root
@@ -25,17 +26,15 @@ const elGRGrid = {
25
26
  toolbarFiltersTooltipShow: 'Εμφάνιση φίλτρων',
26
27
  toolbarFiltersTooltipActive: count => count !== 1 ? `${count} ενεργά φίλτρα` : `${count} ενεργό φίλτρο`,
27
28
  // Quick filter toolbar field
28
- // toolbarQuickFilterPlaceholder: 'Search…',
29
- // toolbarQuickFilterLabel: 'Search',
30
- // toolbarQuickFilterDeleteIconLabel: 'Clear',
31
-
29
+ toolbarQuickFilterPlaceholder: 'Αναζήτηση…',
30
+ toolbarQuickFilterLabel: 'Αναζήτηση',
31
+ toolbarQuickFilterDeleteIconLabel: 'Καθαρισμός',
32
32
  // Export selector toolbar button text
33
33
  toolbarExport: 'Εξαγωγή',
34
34
  toolbarExportLabel: 'Εξαγωγή',
35
35
  toolbarExportCSV: 'Λήψη ως CSV',
36
- // toolbarExportPrint: 'Print',
37
- // toolbarExportExcel: 'Download as Excel',
38
-
36
+ toolbarExportPrint: 'Εκτύπωση',
37
+ toolbarExportExcel: 'Λήψη ως Excel',
39
38
  // Columns panel text
40
39
  columnsPanelTextFieldLabel: 'Εύρεση στήλης',
41
40
  columnsPanelTextFieldPlaceholder: 'Επικεφαλίδα στήλης',
@@ -44,9 +43,9 @@ const elGRGrid = {
44
43
  columnsPanelHideAllButton: 'Απόκρυψη όλων',
45
44
  // Filter panel text
46
45
  filterPanelAddFilter: 'Προσθήκη φίλτρου',
47
- // filterPanelRemoveAll: 'Remove all',
46
+ filterPanelRemoveAll: 'Αφαίρεση όλων',
48
47
  filterPanelDeleteIconLabel: 'Διαγραφή',
49
- // filterPanelLogicOperator: 'Logic operator',
48
+ filterPanelLogicOperator: 'Λογικός τελεστής',
50
49
  filterPanelOperator: 'Τελεστές',
51
50
  filterPanelOperatorAnd: 'Καί',
52
51
  filterPanelOperatorOr: 'Ή',
@@ -66,44 +65,41 @@ const elGRGrid = {
66
65
  filterOperatorOnOrBefore: 'είναι ίσο ή πριν',
67
66
  filterOperatorIsEmpty: 'είναι κενό',
68
67
  filterOperatorIsNotEmpty: 'δεν είναι κενό',
69
- // filterOperatorIsAnyOf: 'is any of',
70
- // 'filterOperator=': '=',
71
- // 'filterOperator!=': '!=',
72
- // 'filterOperator>': '>',
73
- // 'filterOperator>=': '>=',
74
- // 'filterOperator<': '<',
75
- // 'filterOperator<=': '<=',
76
-
68
+ filterOperatorIsAnyOf: 'είναι οποιοδήποτε από',
69
+ 'filterOperator=': '=',
70
+ 'filterOperator!=': '!=',
71
+ 'filterOperator>': '>',
72
+ 'filterOperator>=': '>=',
73
+ 'filterOperator<': '<',
74
+ 'filterOperator<=': '<=',
77
75
  // Header filter operators text
78
- // headerFilterOperatorContains: 'Contains',
79
- // headerFilterOperatorEquals: 'Equals',
80
- // headerFilterOperatorStartsWith: 'Starts with',
81
- // headerFilterOperatorEndsWith: 'Ends with',
82
- // headerFilterOperatorIs: 'Is',
83
- // headerFilterOperatorNot: 'Is not',
84
- // headerFilterOperatorAfter: 'Is after',
85
- // headerFilterOperatorOnOrAfter: 'Is on or after',
86
- // headerFilterOperatorBefore: 'Is before',
87
- // headerFilterOperatorOnOrBefore: 'Is on or before',
88
- // headerFilterOperatorIsEmpty: 'Is empty',
89
- // headerFilterOperatorIsNotEmpty: 'Is not empty',
90
- // headerFilterOperatorIsAnyOf: 'Is any of',
91
- // 'headerFilterOperator=': 'Equals',
92
- // 'headerFilterOperator!=': 'Not equals',
93
- // 'headerFilterOperator>': 'Greater than',
94
- // 'headerFilterOperator>=': 'Greater than or equal to',
95
- // 'headerFilterOperator<': 'Less than',
96
- // 'headerFilterOperator<=': 'Less than or equal to',
97
-
76
+ headerFilterOperatorContains: 'Περιέχει',
77
+ headerFilterOperatorEquals: 'Ισούται',
78
+ headerFilterOperatorStartsWith: 'Ξεκινάει με',
79
+ headerFilterOperatorEndsWith: 'Τελειώνει με',
80
+ headerFilterOperatorIs: 'Είναι',
81
+ headerFilterOperatorNot: 'Δεν είναι',
82
+ headerFilterOperatorAfter: 'Είναι μετά',
83
+ headerFilterOperatorOnOrAfter: 'Είναι ίσο ή μετά',
84
+ headerFilterOperatorBefore: 'Είναι πριν',
85
+ headerFilterOperatorOnOrBefore: 'Είναι ίσο ή πριν',
86
+ headerFilterOperatorIsEmpty: 'Είναι κενό',
87
+ headerFilterOperatorIsNotEmpty: 'Δεν είναι κενό',
88
+ headerFilterOperatorIsAnyOf: 'Είναι οποιοδήποτε από',
89
+ 'headerFilterOperator=': 'Ισούται',
90
+ 'headerFilterOperator!=': 'Δεν ισούται',
91
+ 'headerFilterOperator>': 'Μεγαλύτερο από',
92
+ 'headerFilterOperator>=': 'Μεγαλύτερο ή ίσο με',
93
+ 'headerFilterOperator<': 'Μικρότερο από',
94
+ 'headerFilterOperator<=': 'Μικρότερο ή ίσο με',
98
95
  // Filter values text
99
- // filterValueAny: 'any',
100
- // filterValueTrue: 'true',
101
- // filterValueFalse: 'false',
102
-
96
+ filterValueAny: 'οποιοδήποτε',
97
+ filterValueTrue: 'αληθές',
98
+ filterValueFalse: 'ψευδές',
103
99
  // Column menu text
104
100
  columnMenuLabel: 'Μενού',
105
101
  columnMenuShowColumns: 'Εμφάνιση στηλών',
106
- // columnMenuManageColumns: 'Manage columns',
102
+ columnMenuManageColumns: 'Διαχείριση στηλών',
107
103
  columnMenuFilter: 'Φίλτρο',
108
104
  columnMenuHideColumn: 'Απόκρυψη',
109
105
  columnMenuUnsort: 'Απενεργοποίηση ταξινόμησης',
@@ -120,50 +116,41 @@ const elGRGrid = {
120
116
  // Total visible row amount footer text
121
117
  footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} από ${totalCount.toLocaleString()}`,
122
118
  // Checkbox selection text
123
- // checkboxSelectionHeaderName: 'Checkbox selection',
124
- // checkboxSelectionSelectAllRows: 'Select all rows',
125
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
126
- // checkboxSelectionSelectRow: 'Select row',
127
- // checkboxSelectionUnselectRow: 'Unselect row',
128
-
119
+ checkboxSelectionHeaderName: 'Επιλογή πλαισίου ελέγχου',
120
+ checkboxSelectionSelectAllRows: 'Επιλέξτε όλες τις σειρές',
121
+ checkboxSelectionUnselectAllRows: 'Καταργήση επιλογής όλων των σειρών',
122
+ checkboxSelectionSelectRow: 'Επιλογή γραμμής',
123
+ checkboxSelectionUnselectRow: 'Καταργήση επιλογής γραμμής',
129
124
  // Boolean cell text
130
- // booleanCellTrueLabel: 'yes',
131
- // booleanCellFalseLabel: 'no',
132
-
125
+ booleanCellTrueLabel: 'ναί',
126
+ booleanCellFalseLabel: 'όχι',
133
127
  // Actions cell more text
134
- actionsCellMore: 'περισσότερα'
135
-
128
+ actionsCellMore: 'περισσότερα',
136
129
  // Column pinning text
137
- // pinToLeft: 'Pin to left',
138
- // pinToRight: 'Pin to right',
139
- // unpin: 'Unpin',
140
-
130
+ pinToLeft: 'Καρφιτσώμα στα αριστερά',
131
+ pinToRight: 'Καρφιτσώμα στα δεξιά',
132
+ unpin: 'Ξεκαρφίτσωμα',
141
133
  // Tree Data
142
- // treeDataGroupingHeaderName: 'Group',
143
- // treeDataExpand: 'see children',
144
- // treeDataCollapse: 'hide children',
145
-
134
+ treeDataGroupingHeaderName: 'Ομαδοποίηση',
135
+ treeDataExpand: 'εμφάνιση περιεχομένων',
136
+ treeDataCollapse: 'απόκρυψη περιεχομένων',
146
137
  // Grouping columns
147
- // groupingColumnHeaderName: 'Group',
148
- // groupColumn: name => `Group by ${name}`,
149
- // unGroupColumn: name => `Stop grouping by ${name}`,
150
-
138
+ groupingColumnHeaderName: 'Ομαδοποίηση',
139
+ groupColumn: name => `Ομαδοποίηση κατά ${name}`,
140
+ unGroupColumn: name => `Διακοπή ομαδοποίησης κατά ${name}`,
151
141
  // Master/detail
152
- // detailPanelToggle: 'Detail panel toggle',
153
- // expandDetailPanel: 'Expand',
154
- // collapseDetailPanel: 'Collapse',
155
-
142
+ detailPanelToggle: 'Εναλλαγή πίνακα λεπτομερειών',
143
+ expandDetailPanel: 'Ανάπτυξη',
144
+ collapseDetailPanel: 'Σύμπτυξη',
156
145
  // Row reordering text
157
- // rowReorderingHeaderName: 'Row reordering',
158
-
146
+ rowReorderingHeaderName: 'Αναδιάταξη γραμμών',
159
147
  // Aggregation
160
- // aggregationMenuItemHeader: 'Aggregation',
161
- // aggregationFunctionLabelSum: 'sum',
162
- // aggregationFunctionLabelAvg: 'avg',
163
- // aggregationFunctionLabelMin: 'min',
164
- // aggregationFunctionLabelMax: 'max',
165
- // aggregationFunctionLabelSize: 'size',
148
+ aggregationMenuItemHeader: 'Συσσωμάτωση',
149
+ aggregationFunctionLabelSum: 'άθροισμα',
150
+ aggregationFunctionLabelAvg: 'μέση τιμή',
151
+ aggregationFunctionLabelMin: 'ελάχιστο',
152
+ aggregationFunctionLabelMax: 'μέγιστο',
153
+ aggregationFunctionLabelSize: 'μέγεθος'
166
154
  };
167
-
168
- const elGR = (0, _getGridLocalization.getGridLocalization)(elGRGrid);
155
+ const elGR = (0, _getGridLocalization.getGridLocalization)(elGRGrid, _locale.elGR);
169
156
  exports.elGR = elGR;
@@ -74,12 +74,12 @@ const ptBRGrid = {
74
74
  // 'filterOperator<=': '<=',
75
75
 
76
76
  // Header filter operators text
77
- // headerFilterOperatorContains: 'Contains',
78
- // headerFilterOperatorEquals: 'Equals',
79
- // headerFilterOperatorStartsWith: 'Starts with',
80
- // headerFilterOperatorEndsWith: 'Ends with',
81
- // headerFilterOperatorIs: 'Is',
82
- // headerFilterOperatorNot: 'Is not',
77
+ headerFilterOperatorContains: 'Contém',
78
+ headerFilterOperatorEquals: 'Igual',
79
+ headerFilterOperatorStartsWith: 'Começa com',
80
+ headerFilterOperatorEndsWith: 'Termina com',
81
+ headerFilterOperatorIs: 'É',
82
+ headerFilterOperatorNot: 'Não é',
83
83
  // headerFilterOperatorAfter: 'Is after',
84
84
  // headerFilterOperatorOnOrAfter: 'Is on or after',
85
85
  // headerFilterOperatorBefore: 'Is before',
@@ -87,13 +87,12 @@ const ptBRGrid = {
87
87
  // headerFilterOperatorIsEmpty: 'Is empty',
88
88
  // headerFilterOperatorIsNotEmpty: 'Is not empty',
89
89
  // headerFilterOperatorIsAnyOf: 'Is any of',
90
- // 'headerFilterOperator=': 'Equals',
91
- // 'headerFilterOperator!=': 'Not equals',
92
- // 'headerFilterOperator>': 'Greater than',
93
- // 'headerFilterOperator>=': 'Greater than or equal to',
94
- // 'headerFilterOperator<': 'Less than',
95
- // 'headerFilterOperator<=': 'Less than or equal to',
96
-
90
+ 'headerFilterOperator=': 'Igual',
91
+ 'headerFilterOperator!=': 'Não igual',
92
+ 'headerFilterOperator>': 'Maior que',
93
+ 'headerFilterOperator>=': 'Maior que ou igual a',
94
+ 'headerFilterOperator<': 'Menor que',
95
+ 'headerFilterOperator<=': 'Menor que ou igual a',
97
96
  // Filter values text
98
97
  filterValueAny: 'qualquer',
99
98
  filterValueTrue: 'verdadeiro',
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Store = void 0;
7
+ class Store {
8
+ static create(value) {
9
+ return new Store(value);
10
+ }
11
+ constructor(_value) {
12
+ this.value = void 0;
13
+ this.listeners = void 0;
14
+ this.subscribe = fn => {
15
+ this.listeners.add(fn);
16
+ return () => {
17
+ this.listeners.delete(fn);
18
+ };
19
+ };
20
+ this.getSnapshot = () => {
21
+ return this.value;
22
+ };
23
+ this.update = value => {
24
+ this.value = value;
25
+ this.listeners.forEach(l => l(value));
26
+ };
27
+ this.value = _value;
28
+ this.listeners = new Set();
29
+ }
30
+ }
31
+ exports.Store = Store;
@@ -3,21 +3,90 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.unstable_resetCreateSelectorCache = exports.createSelector = void 0;
6
+ exports.unstable_resetCreateSelectorCache = exports.createSelectorMemoized = exports.createSelector = void 0;
7
7
  var _reselect = require("reselect");
8
8
  var _warning = require("./warning");
9
9
  const cacheContainer = {
10
10
  cache: new WeakMap()
11
11
  };
12
12
  const missingInstanceIdWarning = (0, _warning.buildWarning)(['MUI: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g `mySelector(state, apiRef.current.instanceId)`.']);
13
- const createSelector = (...args) => {
13
+ function checkIsAPIRef(value) {
14
+ return 'current' in value && 'instanceId' in value.current;
15
+ }
16
+ const DEFAULT_INSTANCE_ID = {
17
+ id: 'default'
18
+ };
19
+ const createSelector = (a, b, c, d, e, f, ...rest) => {
20
+ if (rest.length > 0) {
21
+ throw new Error('Unsupported number of selectors');
22
+ }
23
+ let selector;
24
+ if (a && b && c && d && e && f) {
25
+ selector = (stateOrApiRef, instanceIdParam) => {
26
+ const isAPIRef = checkIsAPIRef(stateOrApiRef);
27
+ const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
28
+ const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
29
+ const va = a(state, instanceId);
30
+ const vb = b(state, instanceId);
31
+ const vc = c(state, instanceId);
32
+ const vd = d(state, instanceId);
33
+ const ve = e(state, instanceId);
34
+ return f(va, vb, vc, vd, ve);
35
+ };
36
+ } else if (a && b && c && d && e) {
37
+ selector = (stateOrApiRef, instanceIdParam) => {
38
+ const isAPIRef = checkIsAPIRef(stateOrApiRef);
39
+ const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
40
+ const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
41
+ const va = a(state, instanceId);
42
+ const vb = b(state, instanceId);
43
+ const vc = c(state, instanceId);
44
+ const vd = d(state, instanceId);
45
+ return e(va, vb, vc, vd);
46
+ };
47
+ } else if (a && b && c && d) {
48
+ selector = (stateOrApiRef, instanceIdParam) => {
49
+ const isAPIRef = checkIsAPIRef(stateOrApiRef);
50
+ const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
51
+ const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
52
+ const va = a(state, instanceId);
53
+ const vb = b(state, instanceId);
54
+ const vc = c(state, instanceId);
55
+ return d(va, vb, vc);
56
+ };
57
+ } else if (a && b && c) {
58
+ selector = (stateOrApiRef, instanceIdParam) => {
59
+ const isAPIRef = checkIsAPIRef(stateOrApiRef);
60
+ const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
61
+ const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
62
+ const va = a(state, instanceId);
63
+ const vb = b(state, instanceId);
64
+ return c(va, vb);
65
+ };
66
+ } else if (a && b) {
67
+ selector = (stateOrApiRef, instanceIdParam) => {
68
+ const isAPIRef = checkIsAPIRef(stateOrApiRef);
69
+ const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
70
+ const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
71
+ const va = a(state, instanceId);
72
+ return b(va);
73
+ };
74
+ } else {
75
+ throw new Error('Missing arguments');
76
+ }
77
+
78
+ // We use this property to detect if the selector was created with createSelector
79
+ // or it's only a simple function the receives the state and returns part of it.
80
+ selector.acceptsApiRef = true;
81
+ return selector;
82
+ };
83
+ exports.createSelector = createSelector;
84
+ const createSelectorMemoized = (...args) => {
14
85
  const selector = (...selectorArgs) => {
15
86
  const [stateOrApiRef, instanceId] = selectorArgs;
16
- const isApiRef = !!stateOrApiRef.current;
17
- const cacheKey = isApiRef ? stateOrApiRef.current.instanceId : instanceId ?? {
18
- id: 'default'
19
- };
20
- const state = isApiRef ? stateOrApiRef.current.state : stateOrApiRef;
87
+ const isAPIRef = checkIsAPIRef(stateOrApiRef);
88
+ const cacheKey = isAPIRef ? stateOrApiRef.current.instanceId : instanceId ?? DEFAULT_INSTANCE_ID;
89
+ const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
21
90
  if (process.env.NODE_ENV !== 'production') {
22
91
  if (cacheKey.id === 'default') {
23
92
  missingInstanceIdWarning();
@@ -46,7 +115,7 @@ const createSelector = (...args) => {
46
115
  };
47
116
 
48
117
  // eslint-disable-next-line @typescript-eslint/naming-convention
49
- exports.createSelector = createSelector;
118
+ exports.createSelectorMemoized = createSelectorMemoized;
50
119
  const unstable_resetCreateSelectorCache = () => {
51
120
  cacheContainer.cache = new WeakMap();
52
121
  };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.doesSupportPreventScroll = doesSupportPreventScroll;
7
+ // Based on https://stackoverflow.com/a/59518678
8
+ let cachedSupportsPreventScroll;
9
+ function doesSupportPreventScroll() {
10
+ if (cachedSupportsPreventScroll === undefined) {
11
+ document.createElement('div').focus({
12
+ get preventScroll() {
13
+ cachedSupportsPreventScroll = true;
14
+ return false;
15
+ }
16
+ });
17
+ }
18
+ return cachedSupportsPreventScroll;
19
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fastMemo = fastMemo;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _fastObjectShallowCompare = require("./fastObjectShallowCompare");
9
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
+ function fastMemo(component) {
12
+ return /*#__PURE__*/React.memo(component, _fastObjectShallowCompare.fastObjectShallowCompare);
13
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fastObjectShallowCompare = fastObjectShallowCompare;
7
+ const is = Object.is;
8
+ function fastObjectShallowCompare(a, b) {
9
+ if (a === b) {
10
+ return true;
11
+ }
12
+ if (!(a instanceof Object) || !(b instanceof Object)) {
13
+ return false;
14
+ }
15
+ let aLength = 0;
16
+ let bLength = 0;
17
+
18
+ /* eslint-disable no-restricted-syntax */
19
+ /* eslint-disable guard-for-in */
20
+ for (const key in a) {
21
+ aLength += 1;
22
+ if (!is(a[key], b[key])) {
23
+ return false;
24
+ }
25
+ if (!(key in b)) {
26
+ return false;
27
+ }
28
+ }
29
+
30
+ /* eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars */
31
+ for (const _ in b) {
32
+ bLength += 1;
33
+ }
34
+ /* eslint-enable no-restricted-syntax */
35
+ /* eslint-enable guard-for-in */
36
+
37
+ return aLength === bLength;
38
+ }
@@ -24,12 +24,14 @@ const isDeleteKeys = key => key === 'Delete' || key === 'Backspace';
24
24
 
25
25
  // Non printable keys have a name, e.g. "ArrowRight", see the whole list:
26
26
  // https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
27
- // We need to ignore shortcuts, for example: select all:
27
+ // So event.key.length === 1 is often enough.
28
+ //
29
+ // However, we also need to ignore shortcuts, for example: select all:
28
30
  // - Windows: Ctrl+A, event.ctrlKey is true
29
31
  // - macOS: ⌘ Command+A, event.metaKey is true
30
32
  exports.isDeleteKeys = isDeleteKeys;
31
33
  function isPrintableKey(event) {
32
- return event.key.length === 1 && event.ctrlKey === false && event.metaKey === false;
34
+ return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
33
35
  }
34
36
  const GRID_MULTIPLE_SELECTION_KEYS = ['Meta', 'Control', 'Shift'];
35
37
  exports.GRID_MULTIPLE_SELECTION_KEYS = GRID_MULTIPLE_SELECTION_KEYS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "6.7.0",
3
+ "version": "6.9.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",
@@ -35,7 +35,7 @@
35
35
  "directory": "packages/grid/x-data-grid"
36
36
  },
37
37
  "dependencies": {
38
- "@babel/runtime": "^7.21.0",
38
+ "@babel/runtime": "^7.22.5",
39
39
  "@mui/utils": "^5.13.1",
40
40
  "clsx": "^1.2.1",
41
41
  "prop-types": "^15.8.1",
@@ -0,0 +1,11 @@
1
+ type Listener<T> = (value: T) => void;
2
+ export declare class Store<T> {
3
+ value: T;
4
+ listeners: Set<Listener<T>>;
5
+ static create<T>(value: T): Store<T>;
6
+ constructor(value: T);
7
+ subscribe: (fn: Listener<T>) => () => void;
8
+ getSnapshot: () => T;
9
+ update: (value: T) => void;
10
+ }
11
+ export {};
package/utils/Store.js ADDED
@@ -0,0 +1,24 @@
1
+ export class Store {
2
+ static create(value) {
3
+ return new Store(value);
4
+ }
5
+ constructor(_value) {
6
+ this.value = void 0;
7
+ this.listeners = void 0;
8
+ this.subscribe = fn => {
9
+ this.listeners.add(fn);
10
+ return () => {
11
+ this.listeners.delete(fn);
12
+ };
13
+ };
14
+ this.getSnapshot = () => {
15
+ return this.value;
16
+ };
17
+ this.update = value => {
18
+ this.value = value;
19
+ this.listeners.forEach(l => l(value));
20
+ };
21
+ this.value = _value;
22
+ this.listeners = new Set();
23
+ }
24
+ }
@@ -19,5 +19,6 @@ type StateFromSelectorList<Selectors extends readonly any[]> = Selectors extends
19
19
  type SelectorArgs<Selectors extends ReadonlyArray<Selector<any>>, Result> = [selectors: [...Selectors], combiner: (...args: SelectorResultArray<Selectors>) => Result] | [...Selectors, (...args: SelectorResultArray<Selectors>) => Result];
20
20
  type CreateSelectorFunction = <Selectors extends ReadonlyArray<Selector<any>>, Result>(...items: SelectorArgs<Selectors, Result>) => OutputSelector<StateFromSelectorList<Selectors>, Result>;
21
21
  export declare const createSelector: CreateSelectorFunction;
22
+ export declare const createSelectorMemoized: CreateSelectorFunction;
22
23
  export declare const unstable_resetCreateSelectorCache: () => void;
23
24
  export {};