@mui/x-data-grid 5.12.2 → 5.13.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.
Files changed (177) hide show
  1. package/CHANGELOG.md +160 -6
  2. package/DataGrid/DataGrid.js +4 -4
  3. package/colDef/gridDateOperators.js +4 -2
  4. package/colDef/gridNumericOperators.js +4 -2
  5. package/colDef/gridStringOperators.d.ts +1 -1
  6. package/colDef/gridStringOperators.js +15 -8
  7. package/components/GridRow.js +1 -1
  8. package/components/cell/GridActionsCellItem.d.ts +2 -2
  9. package/components/cell/GridBooleanCell.js +4 -3
  10. package/components/cell/GridEditBooleanCell.js +4 -3
  11. package/components/cell/GridEditDateCell.js +4 -3
  12. package/components/cell/GridEditInputCell.js +4 -3
  13. package/components/cell/GridEditSingleSelectCell.js +9 -7
  14. package/components/panel/GridColumnsPanel.js +1 -1
  15. package/components/panel/GridPanel.d.ts +1 -1
  16. package/components/panel/filterPanel/GridFilterForm.js +11 -4
  17. package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  18. package/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  19. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +5 -9
  20. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +42 -19
  21. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +3 -7
  22. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +32 -14
  23. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  24. package/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  25. package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +6 -3
  26. package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
  27. package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
  28. package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
  29. package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
  30. package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
  31. package/hooks/features/dimensions/useGridDimensions.js +28 -15
  32. package/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  33. package/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  34. package/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  35. package/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  36. package/hooks/features/filter/gridFilterUtils.js +8 -5
  37. package/hooks/features/filter/useGridFilter.js +19 -1
  38. package/hooks/features/rows/useGridRows.js +16 -3
  39. package/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  40. package/hooks/features/virtualization/useGridVirtualScroller.js +14 -3
  41. package/hooks/utils/useGridApiContext.js +1 -1
  42. package/hooks/utils/useGridRootProps.js +1 -1
  43. package/index.js +1 -1
  44. package/legacy/DataGrid/DataGrid.js +4 -4
  45. package/legacy/colDef/gridDateOperators.js +4 -2
  46. package/legacy/colDef/gridNumericOperators.js +4 -2
  47. package/legacy/colDef/gridStringOperators.js +17 -7
  48. package/legacy/components/GridRow.js +1 -1
  49. package/legacy/components/cell/GridBooleanCell.js +3 -1
  50. package/legacy/components/cell/GridEditBooleanCell.js +4 -2
  51. package/legacy/components/cell/GridEditDateCell.js +4 -2
  52. package/legacy/components/cell/GridEditInputCell.js +4 -2
  53. package/legacy/components/cell/GridEditSingleSelectCell.js +9 -7
  54. package/legacy/components/panel/GridColumnsPanel.js +3 -1
  55. package/legacy/components/panel/filterPanel/GridFilterForm.js +9 -4
  56. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  57. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  58. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +34 -12
  59. package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +24 -7
  60. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  61. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  62. package/legacy/hooks/features/dimensions/useGridDimensions.js +27 -15
  63. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  64. package/legacy/hooks/features/editRows/useGridCellEditing.old.js +16 -8
  65. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  66. package/legacy/hooks/features/editRows/useGridRowEditing.old.js +22 -14
  67. package/legacy/hooks/features/filter/gridFilterUtils.js +8 -5
  68. package/legacy/hooks/features/filter/useGridFilter.js +19 -1
  69. package/legacy/hooks/features/rows/useGridRows.js +18 -3
  70. package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  71. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +19 -8
  72. package/legacy/hooks/utils/useGridApiContext.js +1 -1
  73. package/legacy/hooks/utils/useGridRootProps.js +1 -1
  74. package/legacy/index.js +1 -1
  75. package/legacy/locales/deDE.js +4 -4
  76. package/legacy/locales/frFR.js +11 -11
  77. package/legacy/locales/index.js +3 -0
  78. package/legacy/locales/nlNL.js +15 -15
  79. package/legacy/locales/ptBR.js +11 -11
  80. package/legacy/locales/roRO.js +128 -0
  81. package/legacy/locales/skSK.js +16 -16
  82. package/legacy/locales/svSE.js +128 -0
  83. package/legacy/utils/keyboardUtils.js +4 -3
  84. package/locales/deDE.js +4 -4
  85. package/locales/frFR.js +11 -11
  86. package/locales/index.d.ts +3 -0
  87. package/locales/index.js +3 -0
  88. package/locales/nlNL.js +15 -15
  89. package/locales/ptBR.js +11 -11
  90. package/locales/roRO.d.ts +2 -0
  91. package/locales/roRO.js +116 -0
  92. package/locales/skSK.js +16 -16
  93. package/locales/svSE.d.ts +2 -0
  94. package/locales/svSE.js +116 -0
  95. package/models/gridFilterOperator.d.ts +6 -0
  96. package/modern/DataGrid/DataGrid.js +4 -4
  97. package/modern/colDef/gridDateOperators.js +4 -2
  98. package/modern/colDef/gridNumericOperators.js +4 -2
  99. package/modern/colDef/gridStringOperators.js +15 -8
  100. package/modern/components/GridRow.js +1 -1
  101. package/modern/components/cell/GridBooleanCell.js +4 -3
  102. package/modern/components/cell/GridEditBooleanCell.js +4 -3
  103. package/modern/components/cell/GridEditDateCell.js +4 -3
  104. package/modern/components/cell/GridEditInputCell.js +4 -3
  105. package/modern/components/cell/GridEditSingleSelectCell.js +9 -7
  106. package/modern/components/panel/GridColumnsPanel.js +1 -1
  107. package/modern/components/panel/filterPanel/GridFilterForm.js +11 -4
  108. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  109. package/modern/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  110. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +32 -13
  111. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +22 -8
  112. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  113. package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  114. package/modern/hooks/features/dimensions/useGridDimensions.js +28 -15
  115. package/modern/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  116. package/modern/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  117. package/modern/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  118. package/modern/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  119. package/modern/hooks/features/filter/gridFilterUtils.js +8 -5
  120. package/modern/hooks/features/filter/useGridFilter.js +17 -1
  121. package/modern/hooks/features/rows/useGridRows.js +16 -3
  122. package/modern/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  123. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +10 -3
  124. package/modern/hooks/utils/useGridApiContext.js +1 -1
  125. package/modern/hooks/utils/useGridRootProps.js +1 -1
  126. package/modern/index.js +1 -1
  127. package/modern/locales/deDE.js +4 -4
  128. package/modern/locales/frFR.js +11 -11
  129. package/modern/locales/index.js +3 -0
  130. package/modern/locales/nlNL.js +15 -15
  131. package/modern/locales/ptBR.js +11 -11
  132. package/modern/locales/roRO.js +116 -0
  133. package/modern/locales/skSK.js +16 -16
  134. package/modern/locales/svSE.js +116 -0
  135. package/modern/utils/keyboardUtils.js +4 -3
  136. package/node/DataGrid/DataGrid.js +4 -4
  137. package/node/colDef/gridDateOperators.js +4 -2
  138. package/node/colDef/gridNumericOperators.js +4 -2
  139. package/node/colDef/gridStringOperators.js +15 -8
  140. package/node/components/GridRow.js +1 -1
  141. package/node/components/cell/GridBooleanCell.js +5 -3
  142. package/node/components/cell/GridEditBooleanCell.js +5 -3
  143. package/node/components/cell/GridEditDateCell.js +5 -3
  144. package/node/components/cell/GridEditInputCell.js +5 -3
  145. package/node/components/cell/GridEditSingleSelectCell.js +10 -7
  146. package/node/components/panel/GridColumnsPanel.js +1 -1
  147. package/node/components/panel/filterPanel/GridFilterForm.js +9 -4
  148. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  149. package/node/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  150. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +43 -20
  151. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +33 -15
  152. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  153. package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  154. package/node/hooks/features/dimensions/useGridDimensions.js +28 -15
  155. package/node/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  156. package/node/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  157. package/node/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  158. package/node/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  159. package/node/hooks/features/filter/gridFilterUtils.js +7 -4
  160. package/node/hooks/features/filter/useGridFilter.js +19 -1
  161. package/node/hooks/features/rows/useGridRows.js +16 -3
  162. package/node/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  163. package/node/hooks/features/virtualization/useGridVirtualScroller.js +14 -3
  164. package/node/hooks/utils/useGridApiContext.js +1 -1
  165. package/node/hooks/utils/useGridRootProps.js +1 -1
  166. package/node/index.js +1 -1
  167. package/node/locales/deDE.js +4 -4
  168. package/node/locales/frFR.js +11 -11
  169. package/node/locales/index.js +39 -0
  170. package/node/locales/nlNL.js +15 -15
  171. package/node/locales/ptBR.js +11 -11
  172. package/node/locales/roRO.js +126 -0
  173. package/node/locales/skSK.js +16 -16
  174. package/node/locales/svSE.js +126 -0
  175. package/node/utils/keyboardUtils.js +4 -3
  176. package/package.json +4 -4
  177. package/utils/keyboardUtils.js +4 -3
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.svSE = void 0;
7
+
8
+ var _locale = require("@mui/material/locale");
9
+
10
+ var _getGridLocalization = require("../utils/getGridLocalization");
11
+
12
+ const svSEGrid = {
13
+ // Root
14
+ noRowsLabel: 'Inga rader',
15
+ noResultsOverlayLabel: 'Inga resultat funna.',
16
+ errorOverlayDefaultLabel: 'Ett fel uppstod.',
17
+ // Density selector toolbar button text
18
+ toolbarDensity: 'Densitet',
19
+ toolbarDensityLabel: 'Densitet',
20
+ toolbarDensityCompact: 'Kompakt',
21
+ toolbarDensityStandard: 'Standard',
22
+ toolbarDensityComfortable: 'Bekväm',
23
+ // Columns selector toolbar button text
24
+ toolbarColumns: 'Kolumner',
25
+ toolbarColumnsLabel: 'Välj kolumner',
26
+ // Filters toolbar button text
27
+ toolbarFilters: 'Filter',
28
+ toolbarFiltersLabel: 'Visa filter',
29
+ toolbarFiltersTooltipHide: 'Dölj filter',
30
+ toolbarFiltersTooltipShow: 'Visa filter',
31
+ toolbarFiltersTooltipActive: count => count !== 1 ? `${count} aktiva filter` : `${count} aktivt filter`,
32
+ // Quick filter toolbar field
33
+ toolbarQuickFilterPlaceholder: 'Sök...',
34
+ toolbarQuickFilterLabel: 'Sök',
35
+ toolbarQuickFilterDeleteIconLabel: 'Rensa',
36
+ // Export selector toolbar button text
37
+ toolbarExport: 'Exportera',
38
+ toolbarExportLabel: 'Exportera',
39
+ toolbarExportCSV: 'Ladda ner som CSV',
40
+ toolbarExportPrint: 'Skriv ut',
41
+ toolbarExportExcel: 'Ladda ner som Excel',
42
+ // Columns panel text
43
+ columnsPanelTextFieldLabel: 'Hitta kolumn',
44
+ columnsPanelTextFieldPlaceholder: 'Kolumntitel',
45
+ columnsPanelDragIconLabel: 'Ordna om kolumnen',
46
+ columnsPanelShowAllButton: 'Visa alla',
47
+ columnsPanelHideAllButton: 'Dölj alla',
48
+ // Filter panel text
49
+ filterPanelAddFilter: 'Lägg till filter',
50
+ filterPanelDeleteIconLabel: 'Ta bort',
51
+ filterPanelLinkOperator: 'Logisk operatör',
52
+ filterPanelOperators: 'Operatör',
53
+ // TODO v6: rename to filterPanelOperator
54
+ filterPanelOperatorAnd: 'Och',
55
+ filterPanelOperatorOr: 'Eller',
56
+ filterPanelColumns: 'Kolumner',
57
+ filterPanelInputLabel: 'Värde',
58
+ filterPanelInputPlaceholder: 'Filtervärde',
59
+ // Filter operators text
60
+ filterOperatorContains: 'innehåller',
61
+ filterOperatorEquals: 'är lika med',
62
+ filterOperatorStartsWith: 'börjar med',
63
+ filterOperatorEndsWith: 'slutar med',
64
+ filterOperatorIs: 'är',
65
+ filterOperatorNot: 'är inte',
66
+ filterOperatorAfter: 'är efter',
67
+ filterOperatorOnOrAfter: 'är på eller efter',
68
+ filterOperatorBefore: 'är innan',
69
+ filterOperatorOnOrBefore: 'är på eller innan',
70
+ filterOperatorIsEmpty: 'är tom',
71
+ filterOperatorIsNotEmpty: 'är inte tom',
72
+ filterOperatorIsAnyOf: 'är någon av',
73
+ // Filter values text
74
+ filterValueAny: 'något',
75
+ filterValueTrue: 'sant',
76
+ filterValueFalse: 'falskt',
77
+ // Column menu text
78
+ columnMenuLabel: 'Meny',
79
+ columnMenuShowColumns: 'Visa kolumner',
80
+ columnMenuFilter: 'Filtrera',
81
+ columnMenuHideColumn: 'Dölj',
82
+ columnMenuUnsort: 'Osortera',
83
+ columnMenuSortAsc: 'Sortera stigande',
84
+ columnMenuSortDesc: 'Sortera fallande',
85
+ // Column header text
86
+ columnHeaderFiltersTooltipActive: count => count !== 1 ? `${count} aktiva filter` : `${count} aktivt filter`,
87
+ columnHeaderFiltersLabel: 'Visa filter',
88
+ columnHeaderSortIconLabel: 'Sortera',
89
+ // Rows selected footer text
90
+ footerRowSelected: count => count !== 1 ? `${count.toLocaleString()} rader markerade` : `${count.toLocaleString()} rad markerad`,
91
+ // Total row amount footer text
92
+ footerTotalRows: 'Totalt antal rader:',
93
+ // Total visible row amount footer text
94
+ footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} av ${totalCount.toLocaleString()}`,
95
+ // Checkbox selection text
96
+ checkboxSelectionHeaderName: 'Markering med kryssruta',
97
+ checkboxSelectionSelectAllRows: 'Markera alla rader',
98
+ checkboxSelectionUnselectAllRows: 'Avmarkera alla rader',
99
+ checkboxSelectionSelectRow: 'Markera rad',
100
+ checkboxSelectionUnselectRow: 'Avmarkera rad',
101
+ // Boolean cell text
102
+ booleanCellTrueLabel: 'ja',
103
+ booleanCellFalseLabel: 'nej',
104
+ // Actions cell more text
105
+ actionsCellMore: 'mer',
106
+ // Column pinning text
107
+ pinToLeft: 'Fäst till vänster',
108
+ pinToRight: 'Fäst till höger',
109
+ unpin: 'Ta bort fäste',
110
+ // Tree Data
111
+ treeDataGroupingHeaderName: 'Grupp',
112
+ treeDataExpand: 'visa underordnade',
113
+ treeDataCollapse: 'dölj underordnade',
114
+ // Grouping columns
115
+ groupingColumnHeaderName: 'Grupp',
116
+ groupColumn: name => `Gruppera efter ${name}`,
117
+ unGroupColumn: name => `Sluta gruppera efter ${name}`,
118
+ // Master/detail
119
+ // detailPanelToggle: 'Detail panel toggle',
120
+ expandDetailPanel: 'Expandera',
121
+ collapseDetailPanel: 'Kollapsa',
122
+ // Row reordering text
123
+ rowReorderingHeaderName: 'Ordna om rader'
124
+ };
125
+ const svSE = (0, _getGridLocalization.getGridLocalization)(svSEGrid, _locale.svSE);
126
+ exports.svSE = svSE;
@@ -36,12 +36,13 @@ const isPageKeys = key => key.indexOf('Page') === 0;
36
36
 
37
37
  exports.isPageKeys = isPageKeys;
38
38
 
39
- const isDeleteKeys = key => key === 'Delete' || key === 'Backspace';
39
+ const isDeleteKeys = key => key === 'Delete' || key === 'Backspace'; // Non printable keys have a name, e.g. "ArrowRight", see the whole list:
40
+ // https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
41
+
40
42
 
41
43
  exports.isDeleteKeys = isDeleteKeys;
42
- const printableCharRegex = /^(\p{L}|\p{M}\p{L}|\p{M}|\p{N}|\p{Z}|\p{S}|\p{P})$/iu;
43
44
 
44
- const isPrintableKey = key => printableCharRegex.test(key);
45
+ const isPrintableKey = key => key.length === 1;
45
46
 
46
47
  exports.isPrintableKey = isPrintableKey;
47
48
  const GRID_MULTIPLE_SELECTION_KEYS = ['Meta', 'Control', 'Shift'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "5.12.2",
3
+ "version": "5.13.1",
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,11 +35,11 @@
35
35
  "directory": "packages/grid/x-data-grid"
36
36
  },
37
37
  "dependencies": {
38
- "@babel/runtime": "^7.17.2",
38
+ "@babel/runtime": "^7.18.6",
39
39
  "@mui/utils": "^5.4.1",
40
- "clsx": "^1.1.1",
40
+ "clsx": "^1.2.1",
41
41
  "prop-types": "^15.8.1",
42
- "reselect": "^4.1.5"
42
+ "reselect": "^4.1.6"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@mui/material": "^5.4.1",
@@ -8,9 +8,10 @@ export const isSpaceKey = key => key === ' ';
8
8
  export const isArrowKeys = key => key.indexOf('Arrow') === 0;
9
9
  export const isHomeOrEndKeys = key => key === 'Home' || key === 'End';
10
10
  export const isPageKeys = key => key.indexOf('Page') === 0;
11
- export const isDeleteKeys = key => key === 'Delete' || key === 'Backspace';
12
- const printableCharRegex = /^(\p{L}|\p{M}\p{L}|\p{M}|\p{N}|\p{Z}|\p{S}|\p{P})$/iu;
13
- export const isPrintableKey = key => printableCharRegex.test(key);
11
+ export const isDeleteKeys = key => key === 'Delete' || key === 'Backspace'; // Non printable keys have a name, e.g. "ArrowRight", see the whole list:
12
+ // https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
13
+
14
+ export const isPrintableKey = key => key.length === 1;
14
15
  export const GRID_MULTIPLE_SELECTION_KEYS = ['Meta', 'Control', 'Shift'];
15
16
  export const GRID_CELL_EXIT_EDIT_MODE_KEYS = ['Enter', 'Escape', 'Tab'];
16
17
  export const GRID_CELL_EDIT_COMMIT_KEYS = ['Enter', 'Tab'];