@mui/x-data-grid 8.0.0 → 8.1.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 (46) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/components/GridRowCount.js +1 -2
  3. package/components/GridSelectedRowCount.js +1 -2
  4. package/components/GridSkeletonLoadingOverlay.js +1 -2
  5. package/components/base/GridOverlays.js +2 -4
  6. package/components/columnHeaders/GridBaseColumnHeaders.js +1 -2
  7. package/components/columnHeaders/GridColumnHeaderTitle.js +1 -2
  8. package/components/columnHeaders/GridIconButtonContainer.js +1 -2
  9. package/components/containers/GridFooterContainer.js +1 -2
  10. package/components/containers/GridRootStyles.js +14 -12
  11. package/components/panel/GridPanelFooter.js +1 -2
  12. package/components/panel/GridPanelHeader.js +1 -2
  13. package/components/panel/filterPanel/GridFilterForm.js +6 -12
  14. package/components/toolbar/GridToolbarFilterButton.js +1 -2
  15. package/components/virtualization/GridVirtualScrollerRenderZone.js +1 -2
  16. package/esm/components/GridRowCount.js +1 -2
  17. package/esm/components/GridSelectedRowCount.js +1 -2
  18. package/esm/components/GridSkeletonLoadingOverlay.js +1 -2
  19. package/esm/components/base/GridOverlays.js +2 -4
  20. package/esm/components/columnHeaders/GridBaseColumnHeaders.js +1 -2
  21. package/esm/components/columnHeaders/GridColumnHeaderTitle.js +1 -2
  22. package/esm/components/columnHeaders/GridIconButtonContainer.js +1 -2
  23. package/esm/components/containers/GridFooterContainer.js +1 -2
  24. package/esm/components/containers/GridRootStyles.js +14 -12
  25. package/esm/components/panel/GridPanelFooter.js +1 -2
  26. package/esm/components/panel/GridPanelHeader.js +1 -2
  27. package/esm/components/panel/filterPanel/GridFilterForm.js +6 -12
  28. package/esm/components/toolbar/GridToolbarFilterButton.js +1 -2
  29. package/esm/components/virtualization/GridVirtualScrollerRenderZone.js +1 -2
  30. package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -2
  31. package/esm/hooks/features/rowSelection/useGridRowSelection.js +7 -6
  32. package/esm/hooks/features/rows/useGridParamsApi.js +1 -1
  33. package/esm/index.js +1 -1
  34. package/esm/locales/hyAM.d.ts +2 -0
  35. package/esm/locales/hyAM.js +296 -0
  36. package/esm/locales/index.d.ts +1 -0
  37. package/esm/locales/index.js +1 -0
  38. package/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -2
  39. package/hooks/features/rowSelection/useGridRowSelection.js +7 -6
  40. package/hooks/features/rows/useGridParamsApi.js +1 -1
  41. package/index.js +1 -1
  42. package/locales/hyAM.d.ts +2 -0
  43. package/locales/hyAM.js +302 -0
  44. package/locales/index.d.ts +1 -0
  45. package/locales/index.js +11 -0
  46. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ import { Localization } from "../utils/getGridLocalization.js";
2
+ export declare const hyAM: Localization;
@@ -0,0 +1,296 @@
1
+ import { getGridLocalization } from "../utils/getGridLocalization.js";
2
+ const hyAMGrid = {
3
+ // Root
4
+ noRowsLabel: 'Տվյալներ չկան',
5
+ noResultsOverlayLabel: 'Արդյունքներ չեն գտնվել։',
6
+ // noColumnsOverlayLabel: 'No columns',
7
+ // noColumnsOverlayManageColumns: 'Manage columns',
8
+ // emptyPivotOverlayLabel: 'Add fields to rows, columns, and values to create a pivot table',
9
+
10
+ // Density selector toolbar button text
11
+ toolbarDensity: 'Խտություն',
12
+ toolbarDensityLabel: 'Խտություն',
13
+ toolbarDensityCompact: 'Կոմպակտ',
14
+ toolbarDensityStandard: 'Ստանդարտ',
15
+ toolbarDensityComfortable: 'Հարմարավետ',
16
+ // Columns selector toolbar button text
17
+ toolbarColumns: 'Սյունակներ',
18
+ toolbarColumnsLabel: 'Ընտրել սյունակներ',
19
+ // Filters toolbar button text
20
+ toolbarFilters: 'Զտիչներ',
21
+ toolbarFiltersLabel: 'Ցուցադրել զտիչները',
22
+ toolbarFiltersTooltipHide: 'Թաքցնել զտիչները',
23
+ toolbarFiltersTooltipShow: 'Ցուցադրել զտիչները',
24
+ toolbarFiltersTooltipActive: count => {
25
+ let pluralForm = 'ակտիվ զտիչ';
26
+ if (count === 1) {
27
+ pluralForm = 'ակտիվ զտիչ';
28
+ } else {
29
+ pluralForm = 'ակտիվ զտիչներ';
30
+ }
31
+ return `${count} ${pluralForm}`;
32
+ },
33
+ // Quick filter toolbar field
34
+ toolbarQuickFilterPlaceholder: 'Որոնել…',
35
+ toolbarQuickFilterLabel: 'Որոնել',
36
+ toolbarQuickFilterDeleteIconLabel: 'Մաքրել',
37
+ // Export selector toolbar button text
38
+ toolbarExport: 'Արտահանում',
39
+ toolbarExportLabel: 'Արտահանում',
40
+ toolbarExportCSV: 'Ներբեռնել CSV-ով',
41
+ toolbarExportPrint: 'Տպել',
42
+ toolbarExportExcel: 'Ներբեռնել Excel-ով',
43
+ // Toolbar pivot button
44
+ // toolbarPivot: 'Pivot',
45
+
46
+ // Toolbar AI Assistant button
47
+ // toolbarAssistant: 'AI Assistant',
48
+
49
+ // Columns management text
50
+ columnsManagementSearchTitle: 'Որոնել',
51
+ columnsManagementNoColumns: 'Սյունակներ չկան',
52
+ columnsManagementShowHideAllText: 'Ցուցադրել/Թաքցնել բոլորը',
53
+ columnsManagementReset: 'Վերակայել',
54
+ columnsManagementDeleteIconLabel: 'Հեռացնել',
55
+ // Filter panel text
56
+ filterPanelAddFilter: 'Ավելացնել զտիչ',
57
+ filterPanelRemoveAll: 'Հեռացնել բոլորը',
58
+ filterPanelDeleteIconLabel: 'Հեռացնել',
59
+ filterPanelLogicOperator: 'Տրամաբանական օպերատոր',
60
+ filterPanelOperator: 'Օպերատոր',
61
+ filterPanelOperatorAnd: 'Եվ',
62
+ filterPanelOperatorOr: 'Կամ',
63
+ filterPanelColumns: 'Սյունակներ',
64
+ filterPanelInputLabel: 'Արժեք',
65
+ filterPanelInputPlaceholder: 'Զտիչի արժեք',
66
+ // Filter operators text
67
+ filterOperatorContains: 'պարունակում է',
68
+ filterOperatorDoesNotContain: 'չի պարունակում',
69
+ filterOperatorEquals: 'հավասար է',
70
+ filterOperatorDoesNotEqual: 'հավասար չէ',
71
+ filterOperatorStartsWith: 'սկսվում է',
72
+ filterOperatorEndsWith: 'վերջանում է',
73
+ filterOperatorIs: 'է',
74
+ filterOperatorNot: 'չէ',
75
+ filterOperatorAfter: 'հետո է',
76
+ filterOperatorOnOrAfter: 'այդ օրը կամ հետո է',
77
+ filterOperatorBefore: 'մինչ է',
78
+ filterOperatorOnOrBefore: 'այդ օրը կամ առաջ է',
79
+ filterOperatorIsEmpty: 'դատարկ է',
80
+ filterOperatorIsNotEmpty: 'դատարկ չէ',
81
+ filterOperatorIsAnyOf: 'որևէ մեկը',
82
+ 'filterOperator=': '=',
83
+ 'filterOperator!=': '!=',
84
+ 'filterOperator>': '>',
85
+ 'filterOperator>=': '>=',
86
+ 'filterOperator<': '<',
87
+ 'filterOperator<=': '<=',
88
+ // Header filter operators text
89
+ headerFilterOperatorContains: 'Պարունակում է',
90
+ headerFilterOperatorDoesNotContain: 'Չի պարունակում',
91
+ headerFilterOperatorEquals: 'Հավասար է',
92
+ headerFilterOperatorDoesNotEqual: 'Հավասար չէ',
93
+ headerFilterOperatorStartsWith: 'Սկսվում է',
94
+ headerFilterOperatorEndsWith: 'Վերջանում է',
95
+ headerFilterOperatorIs: 'Է',
96
+ headerFilterOperatorNot: 'Չէ',
97
+ headerFilterOperatorAfter: 'Հետո է',
98
+ headerFilterOperatorOnOrAfter: 'Այդ օրը կամ հետո է',
99
+ headerFilterOperatorBefore: 'Մինչ է',
100
+ headerFilterOperatorOnOrBefore: 'Այդ օրը կամ առաջ է',
101
+ headerFilterOperatorIsEmpty: 'Դատարկ է',
102
+ headerFilterOperatorIsNotEmpty: 'Դատարկ չէ',
103
+ headerFilterOperatorIsAnyOf: 'Որևէ մեկը',
104
+ 'headerFilterOperator=': 'Հավասար է',
105
+ 'headerFilterOperator!=': 'Հավասար չէ',
106
+ 'headerFilterOperator>': 'Ավելի մեծ է',
107
+ 'headerFilterOperator>=': 'Ավելի մեծ կամ հավասար է',
108
+ 'headerFilterOperator<': 'Ավելի փոքր է',
109
+ 'headerFilterOperator<=': 'Ավելի փոքր կամ հավասար է',
110
+ // headerFilterClear: 'Clear filter',
111
+
112
+ // Filter values text
113
+ filterValueAny: 'ցանկացած',
114
+ filterValueTrue: 'այո',
115
+ filterValueFalse: 'ոչ',
116
+ // Column menu text
117
+ columnMenuLabel: 'Մենյու',
118
+ columnMenuAriaLabel: columnName => `${columnName} սյունակի մենյու`,
119
+ columnMenuShowColumns: 'Ցուցադրել սյունակները',
120
+ columnMenuManageColumns: 'Կառավարել սյունակները',
121
+ columnMenuFilter: 'Զտիչ',
122
+ columnMenuHideColumn: 'Թաքցնել',
123
+ columnMenuUnsort: 'Մաքրել դասավորումը',
124
+ columnMenuSortAsc: 'Աճման կարգով դասավորել',
125
+ columnMenuSortDesc: 'Նվազման կարգով դասավորել',
126
+ // columnMenuManagePivot: 'Manage pivot',
127
+
128
+ // Column header text
129
+ columnHeaderFiltersTooltipActive: count => {
130
+ let pluralForm = 'ակտիվ զտիչներ';
131
+ if (count === 1) {
132
+ pluralForm = 'ակտիվ զտիչ';
133
+ }
134
+ return `${count} ${pluralForm}`;
135
+ },
136
+ columnHeaderFiltersLabel: 'Ցուցադրել զտիչները',
137
+ columnHeaderSortIconLabel: 'Դասավորել',
138
+ // Rows selected footer text
139
+ footerRowSelected: count => {
140
+ let pluralForm = 'ընտրված տող';
141
+ if (count === 1) {
142
+ pluralForm = 'ընտրված տող';
143
+ } else {
144
+ pluralForm = 'ընտրված տողեր';
145
+ }
146
+ return `${count} ${pluralForm}`;
147
+ },
148
+ // Total row amount footer text
149
+ footerTotalRows: 'Ընդամենը տողեր:',
150
+ // Total visible row amount footer text
151
+ footerTotalVisibleRows: (visibleCount, totalCount) => {
152
+ return `${visibleCount.toLocaleString()} / ${totalCount.toLocaleString()}`;
153
+ },
154
+ // Checkbox selection text
155
+ checkboxSelectionHeaderName: 'Տողի ընտրություն',
156
+ checkboxSelectionSelectAllRows: 'Ընտրել բոլոր տողերը',
157
+ checkboxSelectionUnselectAllRows: 'Չընտրել բոլոր տողերը',
158
+ checkboxSelectionSelectRow: 'Ընտրել տողը',
159
+ checkboxSelectionUnselectRow: 'Չընտրել տողը',
160
+ // Boolean cell text
161
+ booleanCellTrueLabel: 'այո',
162
+ booleanCellFalseLabel: 'ոչ',
163
+ // Actions cell more text
164
+ actionsCellMore: 'ավելին',
165
+ // Column pinning text
166
+ pinToLeft: 'Կցել ձախ',
167
+ pinToRight: 'Կցել աջ',
168
+ unpin: 'Անջատել',
169
+ // Tree Data
170
+ treeDataGroupingHeaderName: 'Խումբ',
171
+ treeDataExpand: 'Բացել ենթատողերը',
172
+ treeDataCollapse: 'Փակել ենթատողերը',
173
+ // Grouping columns
174
+ groupingColumnHeaderName: 'Խմբավորում',
175
+ groupColumn: name => `Խմբավորել ըստ ${name}`,
176
+ unGroupColumn: name => `Չխմբավորել ըստ ${name}`,
177
+ // Master/detail
178
+ detailPanelToggle: 'Փոխարկել մանրամասն տեսքը',
179
+ expandDetailPanel: 'Բացել',
180
+ collapseDetailPanel: 'Փակել',
181
+ // Pagination
182
+ // paginationRowsPerPage: 'Rows per page:',
183
+ // paginationDisplayedRows: ({
184
+ // from,
185
+ // to,
186
+ // count,
187
+ // estimated
188
+ // }) => {
189
+ // if (!estimated) {
190
+ // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
191
+ // }
192
+ // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
193
+ // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
194
+ // },
195
+ // paginationItemAriaLabel: type => {
196
+ // if (type === 'first') {
197
+ // return 'Go to first page';
198
+ // }
199
+ // if (type === 'last') {
200
+ // return 'Go to last page';
201
+ // }
202
+ // if (type === 'next') {
203
+ // return 'Go to next page';
204
+ // }
205
+ // // if (type === 'previous') {
206
+ // return 'Go to previous page';
207
+ // },
208
+
209
+ // Row reordering text
210
+ rowReorderingHeaderName: 'Տողերի վերադասավորում',
211
+ // Aggregation
212
+ aggregationMenuItemHeader: 'Ագրեգացում',
213
+ aggregationFunctionLabelSum: 'գումար',
214
+ aggregationFunctionLabelAvg: 'միջին',
215
+ aggregationFunctionLabelMin: 'մինիմում',
216
+ aggregationFunctionLabelMax: 'մաքսիմում',
217
+ aggregationFunctionLabelSize: 'քանակ'
218
+
219
+ // Pivot panel
220
+ // pivotToggleLabel: 'Pivot',
221
+ // pivotRows: 'Rows',
222
+ // pivotColumns: 'Columns',
223
+ // pivotValues: 'Values',
224
+ // pivotCloseButton: 'Close pivot settings',
225
+ // pivotSearchButton: 'Search fields',
226
+ // pivotSearchControlPlaceholder: 'Search fields',
227
+ // pivotSearchControlLabel: 'Search fields',
228
+ // pivotSearchControlClear: 'Clear search',
229
+ // pivotNoFields: 'No fields',
230
+ // pivotMenuMoveUp: 'Move up',
231
+ // pivotMenuMoveDown: 'Move down',
232
+ // pivotMenuMoveToTop: 'Move to top',
233
+ // pivotMenuMoveToBottom: 'Move to bottom',
234
+ // pivotMenuRows: 'Rows',
235
+ // pivotMenuColumns: 'Columns',
236
+ // pivotMenuValues: 'Values',
237
+ // pivotMenuOptions: 'Field options',
238
+ // pivotMenuAddToRows: 'Add to Rows',
239
+ // pivotMenuAddToColumns: 'Add to Columns',
240
+ // pivotMenuAddToValues: 'Add to Values',
241
+ // pivotMenuRemove: 'Remove',
242
+ // pivotDragToRows: 'Drag here to create rows',
243
+ // pivotDragToColumns: 'Drag here to create columns',
244
+ // pivotDragToValues: 'Drag here to create values',
245
+ // pivotYearColumnHeaderName: '(Year)',
246
+ // pivotQuarterColumnHeaderName: '(Quarter)',
247
+
248
+ // AI Assistant panel
249
+ // aiAssistantPanelTitle: 'AI Assistant',
250
+ // aiAssistantPanelClose: 'Close AI Assistant',
251
+ // aiAssistantPanelNewConversation: 'New conversation',
252
+ // aiAssistantPanelConversationHistory: 'Conversation history',
253
+ // aiAssistantPanelEmptyConversation: 'No prompt history',
254
+ // aiAssistantSuggestions: 'Suggestions',
255
+
256
+ // Prompt field
257
+ // promptFieldLabel: 'Prompt',
258
+ // promptFieldPlaceholder: 'Type a prompt…',
259
+ // promptFieldPlaceholderWithRecording: 'Type or record a prompt…',
260
+ // promptFieldPlaceholderListening: 'Listening for prompt…',
261
+ // promptFieldSpeechRecognitionNotSupported: 'Speech recognition is not supported in this browser',
262
+ // promptFieldSend: 'Send',
263
+ // promptFieldRecord: 'Record',
264
+ // promptFieldStopRecording: 'Stop recording',
265
+
266
+ // Prompt
267
+ // promptRerun: 'Run again',
268
+ // promptProcessing: 'Processing…',
269
+ // promptAppliedChanges: 'Applied changes',
270
+
271
+ // Prompt changes
272
+ // promptChangeGroupDescription: (column: string) => `Group by ${column}`,
273
+ // promptChangeAggregationLabel: (column: string, aggregation: string) => `${column} (${aggregation})`,
274
+ // promptChangeAggregationDescription: (column: string, aggregation: string) => `Aggregate ${column} (${aggregation})`,
275
+ // promptChangeFilterLabel: (column: string, operator: string, value: string) => {
276
+ // if (operator === 'is any of') {
277
+ // return `${column} is any of: ${value}`;
278
+ // }
279
+ // return `${column} ${operator} ${value}`;
280
+ // },
281
+ // promptChangeFilterDescription: (column: string, operator: string, value: string) => {
282
+ // if (operator === 'is any of') {
283
+ // return `Filter where ${column} is any of: ${value}`;
284
+ // }
285
+ // return `Filter where ${column} ${operator} ${value}`;
286
+ // },
287
+ // promptChangeSortDescription: (column: string, direction: string) => `Sort by ${column} (${direction})`,
288
+ // promptChangePivotEnableLabel: 'Pivot',
289
+ // promptChangePivotEnableDescription: 'Enable pivot',
290
+ // promptChangePivotColumnsLabel: (count: number) => `Columns (${count})`,
291
+ // promptChangePivotColumnsDescription: (column: string, direction: string) => `${column}${direction ? ` (${direction})` : ''}`,
292
+ // promptChangePivotRowsLabel: (count: number) => `Rows (${count})`,
293
+ // promptChangePivotValuesLabel: (count: number) => `Values (${count})`,
294
+ // promptChangePivotValuesDescription: (column: string, aggregation: string) => `${column} (${aggregation})`,
295
+ };
296
+ export const hyAM = getGridLocalization(hyAMGrid);
@@ -13,6 +13,7 @@ export * from "./fiFI.js";
13
13
  export * from "./frFR.js";
14
14
  export * from "./heIL.js";
15
15
  export * from "./huHU.js";
16
+ export * from "./hyAM.js";
16
17
  export * from "./itIT.js";
17
18
  export * from "./jaJP.js";
18
19
  export * from "./koKR.js";
@@ -14,6 +14,7 @@ export * from "./fiFI.js";
14
14
  export * from "./frFR.js";
15
15
  export * from "./heIL.js";
16
16
  export * from "./huHU.js";
17
+ export * from "./hyAM.js";
17
18
  export * from "./itIT.js";
18
19
  export * from "./jaJP.js";
19
20
  export * from "./koKR.js";
@@ -30,8 +30,7 @@ var _constants = require("../../../internals/constants");
30
30
  var _jsxRuntime = require("react/jsx-runtime");
31
31
  const GridColumnHeaderRow = exports.GridColumnHeaderRow = (0, _styles.styled)('div', {
32
32
  name: 'MuiDataGrid',
33
- slot: 'ColumnHeaderRow',
34
- overridesResolver: (_, styles) => styles.columnHeaderRow
33
+ slot: 'ColumnHeaderRow'
35
34
  })({
36
35
  display: 'flex'
37
36
  });
@@ -383,13 +383,14 @@ const useGridRowSelection = (apiRef, props) => {
383
383
 
384
384
  const isMultipleSelectionDisabled = !checkboxSelection && !hasCtrlKey && !(0, _keyboardUtils.isKeyboardEvent)(event);
385
385
  const resetSelection = !canHaveMultipleSelection || isMultipleSelectionDisabled;
386
+ const isSelected = apiRef.current.isRowSelected(id);
386
387
  const selectedRowsCount = (0, _gridRowSelectionSelector.gridRowSelectionCountSelector)(apiRef);
387
- if (canHaveMultipleSelection && selectedRowsCount > 1 && !hasCtrlKey) {
388
- apiRef.current.selectRow(id, true, resetSelection);
389
- } else {
390
- const isSelected = apiRef.current.isRowSelected(id);
391
- apiRef.current.selectRow(id, !isSelected, resetSelection);
392
- }
388
+
389
+ // Clicking on a row should toggle the selection except when a range of rows is already selected and the selection should reset
390
+ // In that case, we want to keep the current row selected (https://github.com/mui/mui-x/pull/15509#discussion_r1878082687)
391
+ const shouldStaySelected = selectedRowsCount > 1 && resetSelection;
392
+ const newSelectionState = shouldStaySelected || !isSelected;
393
+ apiRef.current.selectRow(id, newSelectionState, resetSelection);
393
394
  }, [apiRef, canHaveMultipleSelection, checkboxSelection]);
394
395
  const handleRowClick = React.useCallback((params, event) => {
395
396
  if (disableRowSelectionOnClick) {
@@ -62,7 +62,7 @@ function useGridParamsApi(apiRef, props) {
62
62
  value,
63
63
  formattedValue: value,
64
64
  isEditable: false,
65
- api: null
65
+ api: apiRef.current
66
66
  };
67
67
  if (colDef && colDef.valueFormatter) {
68
68
  params.formattedValue = colDef.valueFormatter(value, row, colDef, apiRef);
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.0.0
2
+ * @mui/x-data-grid v8.1.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -0,0 +1,2 @@
1
+ import { Localization } from "../utils/getGridLocalization.js";
2
+ export declare const hyAM: Localization;