@mui/x-data-grid 8.3.0 → 8.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 (86) hide show
  1. package/CHANGELOG.md +206 -10
  2. package/DataGrid/DataGrid.js +1 -0
  3. package/components/GridApiContext.js +1 -3
  4. package/components/GridColumnUnsortedIcon.js +2 -1
  5. package/components/GridConfigurationContext.js +1 -3
  6. package/components/GridRow.js +1 -0
  7. package/components/cell/GridActionsCell.js +2 -1
  8. package/components/cell/GridBooleanCell.js +3 -1
  9. package/components/cell/GridEditBooleanCell.js +2 -1
  10. package/components/cell/GridEditDateCell.js +2 -1
  11. package/components/cell/GridEditInputCell.js +2 -1
  12. package/components/cell/GridEditSingleSelectCell.js +2 -1
  13. package/components/columnHeaders/ColumnHeaderMenuIcon.js +2 -1
  14. package/components/columnHeaders/GridColumnHeaderItem.js +1 -1
  15. package/components/columnHeaders/GridColumnHeaderSeparator.js +1 -0
  16. package/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -0
  17. package/components/columnSelection/GridCellCheckboxRenderer.js +4 -2
  18. package/components/containers/GridRootStyles.js +1 -1
  19. package/components/panel/GridPanelContext.js +1 -0
  20. package/components/quickFilter/QuickFilterContext.js +1 -0
  21. package/components/toolbarV8/Toolbar.js +58 -32
  22. package/components/toolbarV8/ToolbarContext.js +1 -0
  23. package/components/toolbarV8/utils.d.ts +5 -0
  24. package/components/toolbarV8/utils.js +23 -0
  25. package/context/GridRootPropsContext.js +1 -3
  26. package/esm/DataGrid/DataGrid.js +1 -0
  27. package/esm/components/GridApiContext.js +1 -3
  28. package/esm/components/GridColumnUnsortedIcon.js +2 -1
  29. package/esm/components/GridConfigurationContext.js +1 -3
  30. package/esm/components/GridRow.js +1 -0
  31. package/esm/components/cell/GridActionsCell.js +2 -1
  32. package/esm/components/cell/GridBooleanCell.js +3 -1
  33. package/esm/components/cell/GridEditBooleanCell.js +2 -1
  34. package/esm/components/cell/GridEditDateCell.js +2 -1
  35. package/esm/components/cell/GridEditInputCell.js +2 -1
  36. package/esm/components/cell/GridEditSingleSelectCell.js +2 -1
  37. package/esm/components/columnHeaders/ColumnHeaderMenuIcon.js +2 -1
  38. package/esm/components/columnHeaders/GridColumnHeaderItem.js +1 -1
  39. package/esm/components/columnHeaders/GridColumnHeaderSeparator.js +1 -0
  40. package/esm/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -0
  41. package/esm/components/columnSelection/GridCellCheckboxRenderer.js +6 -4
  42. package/esm/components/containers/GridRootStyles.js +1 -1
  43. package/esm/components/panel/GridPanelContext.js +1 -0
  44. package/esm/components/quickFilter/QuickFilterContext.js +1 -0
  45. package/esm/components/toolbarV8/Toolbar.js +58 -32
  46. package/esm/components/toolbarV8/ToolbarContext.js +1 -0
  47. package/esm/components/toolbarV8/utils.d.ts +5 -0
  48. package/esm/components/toolbarV8/utils.js +17 -0
  49. package/esm/context/GridRootPropsContext.js +1 -3
  50. package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +3 -1
  51. package/esm/hooks/features/columns/gridColumnsUtils.js +15 -7
  52. package/esm/hooks/features/overlays/useGridOverlays.js +1 -0
  53. package/esm/hooks/features/pagination/useGridPaginationModel.js +1 -1
  54. package/esm/hooks/features/rowSelection/useGridRowSelection.js +7 -7
  55. package/esm/hooks/features/rowSelection/utils.d.ts +4 -1
  56. package/esm/hooks/features/rowSelection/utils.js +33 -32
  57. package/esm/hooks/features/virtualization/useGridVirtualScroller.js +7 -6
  58. package/esm/hooks/utils/useGridPrivateApiContext.js +1 -3
  59. package/esm/index.d.ts +1 -0
  60. package/esm/index.js +2 -1
  61. package/esm/locales/isIS.js +8 -8
  62. package/esm/locales/koKR.js +68 -76
  63. package/esm/locales/nbNO.js +22 -24
  64. package/esm/material/variables.js +5 -0
  65. package/esm/models/api/gridRowSelectionApi.d.ts +4 -2
  66. package/esm/models/events/gridEventLookup.d.ts +10 -0
  67. package/esm/utils/css/context.js +2 -1
  68. package/hooks/features/columnHeaders/useGridColumnHeaders.js +3 -1
  69. package/hooks/features/columns/gridColumnsUtils.js +15 -7
  70. package/hooks/features/overlays/useGridOverlays.js +1 -0
  71. package/hooks/features/pagination/useGridPaginationModel.js +1 -1
  72. package/hooks/features/rowSelection/useGridRowSelection.js +7 -7
  73. package/hooks/features/rowSelection/utils.d.ts +4 -1
  74. package/hooks/features/rowSelection/utils.js +34 -34
  75. package/hooks/features/virtualization/useGridVirtualScroller.js +7 -6
  76. package/hooks/utils/useGridPrivateApiContext.js +1 -3
  77. package/index.d.ts +1 -0
  78. package/index.js +2 -1
  79. package/locales/isIS.js +8 -8
  80. package/locales/koKR.js +68 -76
  81. package/locales/nbNO.js +22 -24
  82. package/material/variables.js +5 -0
  83. package/models/api/gridRowSelectionApi.d.ts +4 -2
  84. package/models/events/gridEventLookup.d.ts +10 -0
  85. package/package.json +2 -2
  86. package/utils/css/context.js +2 -1
@@ -3,8 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.findRowsToSelect = exports.findRowsToDeselect = exports.ROW_SELECTION_PROPAGATION_DEFAULT = void 0;
7
- exports.getCheckboxPropsSelector = getCheckboxPropsSelector;
6
+ exports.findRowsToSelect = exports.findRowsToDeselect = exports.checkboxPropsSelector = exports.ROW_SELECTION_PROPAGATION_DEFAULT = void 0;
8
7
  exports.isMultipleRowSelectionEnabled = isMultipleRowSelectionEnabled;
9
8
  var _signature = require("../../../constants/signature");
10
9
  var _gridRowsUtils = require("../rows/gridRowsUtils");
@@ -35,41 +34,42 @@ function getGridRowGroupSelectableDescendants(apiRef, groupId) {
35
34
  }
36
35
  return descendants;
37
36
  }
38
-
39
- // TODO v8: Use `createSelectorV8`
40
- function getCheckboxPropsSelector(groupId, autoSelectParents) {
41
- return (0, _createSelector.createSelector)(_gridRowsSelector.gridRowTreeSelector, _gridSortingSelector.gridSortedRowIdsSelector, _gridFilterSelector.gridFilteredRowsLookupSelector, _gridRowSelectionSelector.gridRowSelectionManagerSelector, (rowTree, sortedRowIds, filteredRowsLookup, rowSelectionManager) => {
42
- const groupNode = rowTree[groupId];
43
- if (!groupNode || groupNode.type !== 'group') {
44
- return {
45
- isIndeterminate: false,
46
- isChecked: rowSelectionManager.has(groupId)
47
- };
37
+ const checkboxPropsSelector = exports.checkboxPropsSelector = (0, _createSelector.createSelector)(_gridRowsSelector.gridRowTreeSelector, _gridFilterSelector.gridFilteredRowsLookupSelector, _gridRowSelectionSelector.gridRowSelectionManagerSelector, (rowTree, filteredRowsLookup, rowSelectionManager, {
38
+ groupId,
39
+ autoSelectParents
40
+ }) => {
41
+ const groupNode = rowTree[groupId];
42
+ if (!groupNode || groupNode.type !== 'group' || rowSelectionManager.has(groupId)) {
43
+ return {
44
+ isIndeterminate: false,
45
+ isChecked: rowSelectionManager.has(groupId)
46
+ };
47
+ }
48
+ let hasSelectedDescendant = false;
49
+ let hasUnSelectedDescendant = false;
50
+ const traverseDescendants = itemToTraverseId => {
51
+ if (filteredRowsLookup[itemToTraverseId] === false ||
52
+ // Perf: Skip checking the rest of the descendants if we already
53
+ // know that there is a selected and an unselected descendant
54
+ hasSelectedDescendant && hasUnSelectedDescendant) {
55
+ return;
48
56
  }
49
- if (rowSelectionManager.has(groupId)) {
50
- return {
51
- isIndeterminate: false,
52
- isChecked: true
53
- };
57
+ const node = rowTree[itemToTraverseId];
58
+ if (node?.type === 'group') {
59
+ node.children.forEach(traverseDescendants);
54
60
  }
55
- let selectableDescendantsCount = 0;
56
- let selectedDescendantsCount = 0;
57
- const startIndex = sortedRowIds.findIndex(id => id === groupId) + 1;
58
- for (let index = startIndex; index < sortedRowIds.length && rowTree[sortedRowIds[index]]?.depth > groupNode.depth; index += 1) {
59
- const id = sortedRowIds[index];
60
- if (filteredRowsLookup[id] !== false) {
61
- selectableDescendantsCount += 1;
62
- if (rowSelectionManager.has(id)) {
63
- selectedDescendantsCount += 1;
64
- }
65
- }
61
+ if (rowSelectionManager.has(itemToTraverseId)) {
62
+ hasSelectedDescendant = true;
63
+ } else {
64
+ hasUnSelectedDescendant = true;
66
65
  }
67
- return {
68
- isIndeterminate: selectedDescendantsCount > 0 && (selectedDescendantsCount < selectableDescendantsCount || !rowSelectionManager.has(groupId)),
69
- isChecked: autoSelectParents ? selectedDescendantsCount > 0 : rowSelectionManager.has(groupId)
70
- };
71
- });
72
- }
66
+ };
67
+ traverseDescendants(groupId);
68
+ return {
69
+ isIndeterminate: hasSelectedDescendant && hasUnSelectedDescendant,
70
+ isChecked: autoSelectParents ? hasSelectedDescendant && !hasUnSelectedDescendant : false
71
+ };
72
+ });
73
73
  function isMultipleRowSelectionEnabled(props) {
74
74
  if (props.signature === _signature.GridSignature.DataGrid) {
75
75
  // DataGrid Community has multiple row selection enabled only if checkbox selection is enabled.
@@ -229,12 +229,13 @@ const useGridVirtualScroller = () => {
229
229
  scrollCache.buffer = bufferForDirection(isRtl, direction, rootProps.rowBufferPx, rootProps.columnBufferPx, rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6);
230
230
  const inputs = inputsSelector(apiRef, rootProps, enabledForRows, enabledForColumns);
231
231
  const nextRenderContext = computeRenderContext(inputs, scrollPosition.current, scrollCache);
232
-
233
- // Prevents batching render context changes
234
- ReactDOM.flushSync(() => {
235
- updateRenderContext(nextRenderContext);
236
- });
237
- scrollTimeout.start(1000, triggerUpdateRenderContext);
232
+ if (!areRenderContextsEqual(nextRenderContext, renderContext)) {
233
+ // Prevents batching render context changes
234
+ ReactDOM.flushSync(() => {
235
+ updateRenderContext(nextRenderContext);
236
+ });
237
+ scrollTimeout.start(1000, triggerUpdateRenderContext);
238
+ }
238
239
  return nextRenderContext;
239
240
  });
240
241
  const forceUpdateRenderContext = () => {
@@ -8,9 +8,7 @@ exports.GridPrivateApiContext = void 0;
8
8
  exports.useGridPrivateApiContext = useGridPrivateApiContext;
9
9
  var React = _interopRequireWildcard(require("react"));
10
10
  const GridPrivateApiContext = exports.GridPrivateApiContext = /*#__PURE__*/React.createContext(undefined);
11
- if (process.env.NODE_ENV !== 'production') {
12
- GridPrivateApiContext.displayName = 'GridPrivateApiContext';
13
- }
11
+ if (process.env.NODE_ENV !== "production") GridPrivateApiContext.displayName = "GridPrivateApiContext";
14
12
  function useGridPrivateApiContext() {
15
13
  const privateApiRef = React.useContext(GridPrivateApiContext);
16
14
  if (privateApiRef === undefined) {
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { GridApiCommunity } from "./models/api/gridApiCommunity.js";
2
2
  import { GridInitialStateCommunity, GridStateCommunity } from "./models/gridStateCommunity.js";
3
+ import "./material/index.js";
3
4
  export { useGridApiContext } from "./hooks/utils/useGridApiContext.js";
4
5
  export { useGridApiRef } from "./hooks/utils/useGridApiRef.js";
5
6
  export { useGridRootProps } from "./hooks/utils/useGridRootProps.js";
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.3.0
2
+ * @mui/x-data-grid v8.4.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -61,6 +61,7 @@ Object.defineProperty(exports, "useGridRootProps", {
61
61
  return _useGridRootProps.useGridRootProps;
62
62
  }
63
63
  });
64
+ require("./material");
64
65
  var _useGridApiContext = require("./hooks/utils/useGridApiContext");
65
66
  var _useGridApiRef = require("./hooks/utils/useGridApiRef");
66
67
  var _useGridRootProps = require("./hooks/utils/useGridRootProps");
package/locales/isIS.js CHANGED
@@ -64,11 +64,11 @@ const isISGrid = {
64
64
  filterPanelInputPlaceholder: 'Síu gildi',
65
65
  // Filter operators text
66
66
  filterOperatorContains: 'inniheldur',
67
- // filterOperatorDoesNotContain: 'does not contain',
67
+ filterOperatorDoesNotContain: 'inniheldur ekki',
68
68
  filterOperatorEquals: 'jafnt og',
69
- // filterOperatorDoesNotEqual: 'does not equal',
70
- filterOperatorStartsWith: 'byrjar með',
71
- filterOperatorEndsWith: 'endar með',
69
+ filterOperatorDoesNotEqual: 'ekki jafnt og',
70
+ filterOperatorStartsWith: 'byrjar á',
71
+ filterOperatorEndsWith: 'endar á',
72
72
  filterOperatorIs: 'er líka með',
73
73
  filterOperatorNot: 'er ekki líka með',
74
74
  filterOperatorAfter: 'eftir',
@@ -86,11 +86,11 @@ const isISGrid = {
86
86
  'filterOperator<=': '<=',
87
87
  // Header filter operators text
88
88
  headerFilterOperatorContains: 'Inniheldur',
89
- // headerFilterOperatorDoesNotContain: 'Does not contain',
89
+ headerFilterOperatorDoesNotContain: 'Inniheldur ekki',
90
90
  headerFilterOperatorEquals: 'Jafnt og',
91
- // headerFilterOperatorDoesNotEqual: 'Does not equal',
92
- headerFilterOperatorStartsWith: 'Byrjar með',
93
- headerFilterOperatorEndsWith: 'Endar með',
91
+ headerFilterOperatorDoesNotEqual: 'Ekki jafnt og',
92
+ headerFilterOperatorStartsWith: 'Byrjar á',
93
+ headerFilterOperatorEndsWith: 'Endar á',
94
94
  headerFilterOperatorIs: 'Er jafnt og',
95
95
  headerFilterOperatorNot: 'Er ekki jafnt og',
96
96
  headerFilterOperatorAfter: 'Eftir',
package/locales/koKR.js CHANGED
@@ -9,10 +9,9 @@ const koKRGrid = {
9
9
  // Root
10
10
  noRowsLabel: '행이 없습니다.',
11
11
  noResultsOverlayLabel: '결과값이 없습니다.',
12
- // noColumnsOverlayLabel: 'No columns',
13
- // noColumnsOverlayManageColumns: 'Manage columns',
14
- // emptyPivotOverlayLabel: 'Add fields to rows, columns, and values to create a pivot table',
15
-
12
+ noColumnsOverlayLabel: '열이 없습니다',
13
+ noColumnsOverlayManageColumns: ' 관리하기',
14
+ emptyPivotOverlayLabel: '행, 열, 값을 추가하여 피벗 테이블을 만듭니다.',
16
15
  // Density selector toolbar button text
17
16
  toolbarDensity: '행 간격',
18
17
  toolbarDensityLabel: '행 간격',
@@ -39,11 +38,9 @@ const koKRGrid = {
39
38
  toolbarExportPrint: '프린트',
40
39
  toolbarExportExcel: 'Excel로 내보내기',
41
40
  // Toolbar pivot button
42
- // toolbarPivot: 'Pivot',
43
-
41
+ toolbarPivot: '피벗',
44
42
  // Toolbar AI Assistant button
45
- // toolbarAssistant: 'AI Assistant',
46
-
43
+ toolbarAssistant: 'AI 어시스턴트',
47
44
  // Columns management text
48
45
  columnsManagementSearchTitle: '검색',
49
46
  columnsManagementNoColumns: '열이 없습니다.',
@@ -105,15 +102,14 @@ const koKRGrid = {
105
102
  'headerFilterOperator>=': '같거나 더 큰',
106
103
  'headerFilterOperator<': '더 작은',
107
104
  'headerFilterOperator<=': '같거나 더 작은',
108
- // headerFilterClear: 'Clear filter',
109
-
105
+ headerFilterClear: '필터 초기화',
110
106
  // Filter values text
111
107
  filterValueAny: '아무값',
112
108
  filterValueTrue: '참',
113
109
  filterValueFalse: '거짓',
114
110
  // Column menu text
115
111
  columnMenuLabel: '메뉴',
116
- // columnMenuAriaLabel: (columnName: string) => `${columnName} column menu`,
112
+ columnMenuAriaLabel: columnName => `${columnName} 메뉴`,
117
113
  columnMenuShowColumns: '열 표시',
118
114
  columnMenuManageColumns: '열 관리',
119
115
  columnMenuFilter: '필터',
@@ -162,18 +158,18 @@ const koKRGrid = {
162
158
  collapseDetailPanel: '접기',
163
159
  // Pagination
164
160
  paginationRowsPerPage: '페이지 당 행:',
165
- // paginationDisplayedRows: ({
166
- // from,
167
- // to,
168
- // count,
169
- // estimated
170
- // }) => {
171
- // if (!estimated) {
172
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
173
- // }
174
- // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
175
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
176
- // },
161
+ paginationDisplayedRows: ({
162
+ from,
163
+ to,
164
+ count,
165
+ estimated
166
+ }) => {
167
+ if (!estimated) {
168
+ return `${from}–${to} of ${count !== -1 ? count : `${to} 이상`}`;
169
+ }
170
+ const estimatedLabel = estimated && estimated > to ? `약 ${estimated}` : `${to} 이상`;
171
+ return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
172
+ },
177
173
  paginationItemAriaLabel: type => {
178
174
  if (type === 'first') {
179
175
  return '첫 번째 페이지로 이동';
@@ -197,61 +193,57 @@ const koKRGrid = {
197
193
  aggregationFunctionLabelMax: '최대값',
198
194
  aggregationFunctionLabelSize: '크기',
199
195
  // Pivot panel
200
- // pivotToggleLabel: 'Pivot',
201
- // pivotRows: 'Rows',
202
- // pivotColumns: 'Columns',
203
- // pivotValues: 'Values',
204
- // pivotCloseButton: 'Close pivot settings',
205
- // pivotSearchButton: 'Search fields',
206
- // pivotSearchControlPlaceholder: 'Search fields',
207
- // pivotSearchControlLabel: 'Search fields',
208
- // pivotSearchControlClear: 'Clear search',
209
- // pivotNoFields: 'No fields',
210
- // pivotMenuMoveUp: 'Move up',
211
- // pivotMenuMoveDown: 'Move down',
212
- // pivotMenuMoveToTop: 'Move to top',
213
- // pivotMenuMoveToBottom: 'Move to bottom',
214
- // pivotMenuRows: 'Rows',
215
- // pivotMenuColumns: 'Columns',
216
- // pivotMenuValues: 'Values',
217
- // pivotMenuOptions: 'Field options',
218
- // pivotMenuAddToRows: 'Add to Rows',
219
- // pivotMenuAddToColumns: 'Add to Columns',
220
- // pivotMenuAddToValues: 'Add to Values',
221
- // pivotMenuRemove: 'Remove',
222
- // pivotDragToRows: 'Drag here to create rows',
223
- // pivotDragToColumns: 'Drag here to create columns',
224
- // pivotDragToValues: 'Drag here to create values',
225
- // pivotYearColumnHeaderName: '(Year)',
226
- // pivotQuarterColumnHeaderName: '(Quarter)',
227
-
196
+ pivotToggleLabel: '피벗',
197
+ pivotRows: '',
198
+ pivotColumns: '',
199
+ pivotValues: '',
200
+ pivotCloseButton: '피벗 설정 닫기',
201
+ pivotSearchButton: '필드 검색',
202
+ pivotSearchControlPlaceholder: '필드 검색',
203
+ pivotSearchControlLabel: '필드 검색',
204
+ pivotSearchControlClear: '검색 초기화',
205
+ pivotNoFields: '필드가 없습니다.',
206
+ pivotMenuMoveUp: '위로 이동',
207
+ pivotMenuMoveDown: '아래로 이동',
208
+ pivotMenuMoveToTop: '위로 이동',
209
+ pivotMenuMoveToBottom: '아래로 이동',
210
+ pivotMenuRows: '',
211
+ pivotMenuColumns: '',
212
+ pivotMenuValues: '',
213
+ pivotMenuOptions: '필드 옵션',
214
+ pivotMenuAddToRows: '행에 추가',
215
+ pivotMenuAddToColumns: '열에 추가',
216
+ pivotMenuAddToValues: '값에 추가',
217
+ pivotMenuRemove: '제거',
218
+ pivotDragToRows: ' 생성',
219
+ pivotDragToColumns: ' 생성',
220
+ pivotDragToValues: ' 생성',
221
+ pivotYearColumnHeaderName: '()',
222
+ pivotQuarterColumnHeaderName: '(분기)',
228
223
  // AI Assistant panel
229
- // aiAssistantPanelTitle: 'AI Assistant',
230
- // aiAssistantPanelClose: 'Close AI Assistant',
231
- // aiAssistantPanelNewConversation: 'New conversation',
232
- // aiAssistantPanelConversationHistory: 'Conversation history',
233
- // aiAssistantPanelEmptyConversation: 'No prompt history',
234
- // aiAssistantSuggestions: 'Suggestions',
235
-
224
+ aiAssistantPanelTitle: 'AI 어시스턴트',
225
+ aiAssistantPanelClose: 'AI 어시스턴트 닫기',
226
+ aiAssistantPanelNewConversation: ' 대화',
227
+ aiAssistantPanelConversationHistory: '대화 기록',
228
+ aiAssistantPanelEmptyConversation: '프롬프트 내역이 없습니다.',
229
+ aiAssistantSuggestions: '제안',
236
230
  // Prompt field
237
231
  promptFieldLabel: '프롬프트 입력',
238
232
  promptFieldPlaceholder: '프롬프트 입력…',
239
233
  promptFieldPlaceholderWithRecording: '프롬프트 입력 또는 녹음…',
240
234
  promptFieldPlaceholderListening: '녹음 중…',
241
- // promptFieldSpeechRecognitionNotSupported: 'Speech recognition is not supported in this browser',
235
+ promptFieldSpeechRecognitionNotSupported: ' 브라우저에서 음성 인식을 지원하지 않습니다.',
242
236
  promptFieldSend: '전송',
243
237
  promptFieldRecord: '녹음',
244
- promptFieldStopRecording: '녹음 정지'
245
-
238
+ promptFieldStopRecording: '녹음 정지',
246
239
  // Prompt
247
- // promptRerun: 'Run again',
248
- // promptProcessing: 'Processing…',
249
- // promptAppliedChanges: 'Applied changes',
250
-
240
+ promptRerun: '다시 실행',
241
+ promptProcessing: '처리 중…',
242
+ promptAppliedChanges: '변경사항 적용하기',
251
243
  // Prompt changes
252
- // promptChangeGroupDescription: (column: string) => `Group by ${column}`,
253
- // promptChangeAggregationLabel: (column: string, aggregation: string) => `${column} (${aggregation})`,
254
- // promptChangeAggregationDescription: (column: string, aggregation: string) => `Aggregate ${column} (${aggregation})`,
244
+ promptChangeGroupDescription: column => `${column} 값으로 그룹 생성`,
245
+ promptChangeAggregationLabel: (column, aggregation) => `${column} (${aggregation})`,
246
+ promptChangeAggregationDescription: (column, aggregation) => `${column} (${aggregation}) 집계`,
255
247
  // promptChangeFilterLabel: (column: string, operator: string, value: string) => {
256
248
  // if (operator === 'is any of') {
257
249
  // return `${column} is any of: ${value}`;
@@ -264,13 +256,13 @@ const koKRGrid = {
264
256
  // }
265
257
  // return `Filter where ${column} ${operator} ${value}`;
266
258
  // },
267
- // promptChangeSortDescription: (column: string, direction: string) => `Sort by ${column} (${direction})`,
268
- // promptChangePivotEnableLabel: 'Pivot',
269
- // promptChangePivotEnableDescription: 'Enable pivot',
270
- // promptChangePivotColumnsLabel: (count: number) => `Columns (${count})`,
271
- // promptChangePivotColumnsDescription: (column: string, direction: string) => `${column}${direction ? ` (${direction})` : ''}`,
272
- // promptChangePivotRowsLabel: (count: number) => `Rows (${count})`,
273
- // promptChangePivotValuesLabel: (count: number) => `Values (${count})`,
274
- // promptChangePivotValuesDescription: (column: string, aggregation: string) => `${column} (${aggregation})`,
259
+ promptChangeSortDescription: (column, direction) => `${column} (${direction}) 기준으로 정렬`,
260
+ promptChangePivotEnableLabel: '피벗',
261
+ promptChangePivotEnableDescription: '피벗 활성화',
262
+ promptChangePivotColumnsLabel: count => `(${count}) 개의 열`,
263
+ promptChangePivotColumnsDescription: (column, direction) => `${column}${direction ? ` (${direction})` : ''}`,
264
+ promptChangePivotRowsLabel: count => `(${count}) 개의 행`,
265
+ promptChangePivotValuesLabel: count => `(${count}) 개의 값`,
266
+ promptChangePivotValuesDescription: (column, aggregation) => `${column} (${aggregation})`
275
267
  };
276
268
  const koKR = exports.koKR = (0, _getGridLocalization.getGridLocalization)(koKRGrid);
package/locales/nbNO.js CHANGED
@@ -9,8 +9,8 @@ const nbNOGrid = {
9
9
  // Root
10
10
  noRowsLabel: 'Ingen rader',
11
11
  noResultsOverlayLabel: 'Fant ingen resultat.',
12
- // noColumnsOverlayLabel: 'No columns',
13
- // noColumnsOverlayManageColumns: 'Manage columns',
12
+ noColumnsOverlayLabel: 'Ingen kolonner',
13
+ noColumnsOverlayManageColumns: 'Velg kolonner',
14
14
  // emptyPivotOverlayLabel: 'Add fields to rows, columns, and values to create a pivot table',
15
15
 
16
16
  // Density selector toolbar button text
@@ -49,8 +49,7 @@ const nbNOGrid = {
49
49
  columnsManagementNoColumns: 'Ingen kolonner',
50
50
  columnsManagementShowHideAllText: 'Vis/skjul alle',
51
51
  columnsManagementReset: 'Nullstill',
52
- // columnsManagementDeleteIconLabel: 'Clear',
53
-
52
+ columnsManagementDeleteIconLabel: 'Tøm',
54
53
  // Filter panel text
55
54
  filterPanelAddFilter: 'Legg til filter',
56
55
  filterPanelRemoveAll: 'Fjern alle',
@@ -64,9 +63,9 @@ const nbNOGrid = {
64
63
  filterPanelInputPlaceholder: 'Filter verdi',
65
64
  // Filter operators text
66
65
  filterOperatorContains: 'inneholder',
67
- // filterOperatorDoesNotContain: 'does not contain',
66
+ filterOperatorDoesNotContain: 'inneholder ikke',
68
67
  filterOperatorEquals: 'er lik',
69
- // filterOperatorDoesNotEqual: 'does not equal',
68
+ filterOperatorDoesNotEqual: 'er ikke lik',
70
69
  filterOperatorStartsWith: 'starter med',
71
70
  filterOperatorEndsWith: 'slutter med',
72
71
  filterOperatorIs: 'er',
@@ -86,9 +85,9 @@ const nbNOGrid = {
86
85
  'filterOperator<=': '<=',
87
86
  // Header filter operators text
88
87
  headerFilterOperatorContains: 'Inneholder',
89
- // headerFilterOperatorDoesNotContain: 'Does not contain',
90
- headerFilterOperatorEquals: 'Lik',
91
- // headerFilterOperatorDoesNotEqual: 'Does not equal',
88
+ headerFilterOperatorDoesNotContain: 'Inneholder ikke',
89
+ headerFilterOperatorEquals: 'Er lik',
90
+ headerFilterOperatorDoesNotEqual: 'Er ikke lik',
92
91
  headerFilterOperatorStartsWith: 'Starter på',
93
92
  headerFilterOperatorEndsWith: 'Slutter på',
94
93
  headerFilterOperatorIs: 'Er',
@@ -106,15 +105,14 @@ const nbNOGrid = {
106
105
  'headerFilterOperator>=': 'Større enn eller lik',
107
106
  'headerFilterOperator<': 'Mindre enn',
108
107
  'headerFilterOperator<=': 'Mindre enn eller lik',
109
- // headerFilterClear: 'Clear filter',
110
-
108
+ headerFilterClear: 'Tøm filter',
111
109
  // Filter values text
112
110
  filterValueAny: 'noen',
113
111
  filterValueTrue: 'sant',
114
112
  filterValueFalse: 'usant',
115
113
  // Column menu text
116
114
  columnMenuLabel: 'Meny',
117
- // columnMenuAriaLabel: (columnName: string) => `${columnName} column menu`,
115
+ columnMenuAriaLabel: columnName => `${columnName} kolonnemeny`,
118
116
  columnMenuShowColumns: 'Vis kolonner',
119
117
  columnMenuManageColumns: 'Administrer kolonner',
120
118
  columnMenuFilter: 'Filter',
@@ -163,18 +161,18 @@ const nbNOGrid = {
163
161
  collapseDetailPanel: 'Kollaps',
164
162
  // Pagination
165
163
  paginationRowsPerPage: 'Rader per side:',
166
- // paginationDisplayedRows: ({
167
- // from,
168
- // to,
169
- // count,
170
- // estimated
171
- // }) => {
172
- // if (!estimated) {
173
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
174
- // }
175
- // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
176
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
177
- // },
164
+ paginationDisplayedRows: ({
165
+ from,
166
+ to,
167
+ count,
168
+ estimated
169
+ }) => {
170
+ if (!estimated) {
171
+ return `${from}–${to} av ${count !== -1 ? count : `mer enn ${to}`}`;
172
+ }
173
+ const estimatedLabel = estimated && estimated > to ? `omtrent ${estimated}` : `mer enn ${to}`;
174
+ return `${from}–${to} av ${count !== -1 ? count : estimatedLabel}`;
175
+ },
178
176
  paginationItemAriaLabel: type => {
179
177
  if (type === 'first') {
180
178
  return 'Gå til første side';
@@ -99,5 +99,10 @@ function removeOpacity(color) {
99
99
  return setOpacity(color, 1);
100
100
  }
101
101
  function formatFont(font) {
102
+ // Accounts for disabled typography variants
103
+ // See: https://github.com/mui/mui-x/issues/17812
104
+ if (!font) {
105
+ return undefined;
106
+ }
102
107
  return `${font.fontWeight} ${font.fontSize} / ${font.lineHeight} ${font.fontFamily}`;
103
108
  }
@@ -1,5 +1,6 @@
1
1
  import type { GridRowId, GridRowModel } from "../gridRows.js";
2
2
  import type { GridRowSelectionModel } from "../gridRowSelectionModel.js";
3
+ import { GridControlledStateReasonLookup } from "../events/index.js";
3
4
  /**
4
5
  * The selection API interface that is available in the grid [[apiRef]].
5
6
  */
@@ -34,9 +35,10 @@ export interface GridRowSelectionApi {
34
35
  *
35
36
  * ⚠️ Caution: `setRowSelectionModel` doesn't apply the selection propagation automatically.
36
37
  * Pass model returned by API method `getPropagatedRowSelectionModel` instead to apply the selection propagation.
37
- * @param {gridRowSelectionModel} rowSelectionModel The new row selection model
38
+ * @param {gridRowSelectionModel} rowSelectionModel The new row selection model.
39
+ * @param {string} reason The reason for the state change.
38
40
  */
39
- setRowSelectionModel: (rowSelectionModel: GridRowSelectionModel) => void;
41
+ setRowSelectionModel: (rowSelectionModel: GridRowSelectionModel, reason?: GridControlledStateReasonLookup['rowSelection']) => void;
40
42
  }
41
43
  export interface GridRowMultiSelectionApi {
42
44
  /**
@@ -195,6 +195,15 @@ export interface GridColumnHeaderEventLookup {
195
195
  params: GridColumnHeaderParams;
196
196
  event: React.DragEvent<HTMLElement>;
197
197
  };
198
+ /**
199
+ * Fired when the dragging of a column header ends.
200
+ * Same as `columnHeaderDragEnd`, but also fires when the DOM element is unmounted.
201
+ * @ignore - do not document.
202
+ */
203
+ columnHeaderDragEndNative: {
204
+ params: GridColumnHeaderParams;
205
+ event: DragEvent;
206
+ };
198
207
  /**
199
208
  * Fired when a `dblclick` DOM event happens in the column header separator.
200
209
  * @ignore - do not document.
@@ -400,6 +409,7 @@ export interface GridControlledStateReasonLookup {
400
409
  filter: 'upsertFilterItem' | 'upsertFilterItems' | 'deleteFilterItem' | 'changeLogicOperator' | 'restoreState' | 'removeAllFilterItems';
401
410
  pagination: 'setPaginationModel' | 'stateRestorePreProcessing';
402
411
  rows: 'addSkeletonRows';
412
+ rowSelection: 'singleRowSelection' | 'multipleRowsSelection';
403
413
  }
404
414
  export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEventLookup, GridHeaderFilterEventLookup, GridColumnGroupHeaderEventLookup, GridCellEventLookup, GridControlledStateEventLookup {
405
415
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "8.3.0",
3
+ "version": "8.4.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The Community plan edition of the MUI X Data Grid components.",
6
6
  "main": "./index.js",
@@ -45,7 +45,7 @@
45
45
  "prop-types": "^15.8.1",
46
46
  "reselect": "^5.1.1",
47
47
  "use-sync-external-store": "^1.5.0",
48
- "@mui/x-internals": "8.3.0"
48
+ "@mui/x-internals": "8.4.0"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@emotion/react": "^11.9.0",
@@ -19,6 +19,7 @@ const CSSVariablesContext = /*#__PURE__*/React.createContext({
19
19
  href: "/unset"
20
20
  })
21
21
  });
22
+ if (process.env.NODE_ENV !== "production") CSSVariablesContext.displayName = "CSSVariablesContext";
22
23
  function useCSSVariablesClass() {
23
24
  return React.useContext(CSSVariablesContext).className;
24
25
  }
@@ -59,7 +60,7 @@ function GridCSSVariablesContext(props) {
59
60
  function variablesToString(variables) {
60
61
  let output = '';
61
62
  for (const key in variables) {
62
- if (Object.hasOwn(variables, key)) {
63
+ if (Object.hasOwn(variables, key) && variables[key] !== undefined) {
63
64
  output += `${key}:${variables[key]};`;
64
65
  }
65
66
  }