@mui/x-data-grid 8.27.3 → 9.0.0-alpha.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 (68) hide show
  1. package/CHANGELOG.md +264 -52
  2. package/components/GridPagination.js +5 -4
  3. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +12 -9
  4. package/components/virtualization/GridVirtualScrollbar.js +1 -52
  5. package/constants/localeTextConstants.js +3 -2
  6. package/esm/components/GridPagination.js +5 -4
  7. package/esm/components/panel/filterPanel/GridFilterInputMultipleValue.js +11 -8
  8. package/esm/components/virtualization/GridVirtualScrollbar.js +1 -52
  9. package/esm/constants/localeTextConstants.js +3 -2
  10. package/esm/hooks/features/columns/gridColumnsSelector.js +5 -14
  11. package/esm/hooks/features/pagination/gridPaginationUtils.js +1 -1
  12. package/esm/hooks/features/pagination/useGridRowCount.js +19 -3
  13. package/esm/index.js +1 -1
  14. package/esm/internals/utils/propValidation.js +1 -1
  15. package/esm/locales/beBY.js +3 -2
  16. package/esm/locales/bgBG.js +3 -2
  17. package/esm/locales/bnBD.js +3 -2
  18. package/esm/locales/csCZ.js +2 -2
  19. package/esm/locales/daDK.js +3 -2
  20. package/esm/locales/elGR.js +3 -2
  21. package/esm/locales/faIR.js +3 -2
  22. package/esm/locales/fiFI.js +3 -2
  23. package/esm/locales/huHU.js +3 -2
  24. package/esm/locales/hyAM.js +3 -2
  25. package/esm/locales/isIS.js +3 -2
  26. package/esm/locales/nlNL.js +3 -2
  27. package/esm/locales/roRO.js +3 -2
  28. package/esm/locales/ruRU.js +3 -2
  29. package/esm/locales/svSE.js +3 -2
  30. package/esm/locales/thTH.d.ts +2 -0
  31. package/esm/locales/thTH.js +297 -0
  32. package/esm/locales/trTR.js +3 -2
  33. package/esm/locales/ukUA.js +13 -12
  34. package/esm/locales/urPK.js +3 -2
  35. package/esm/locales/viVN.js +3 -2
  36. package/esm/material/index.js +1 -1
  37. package/esm/utils/utils.d.ts +2 -2
  38. package/esm/utils/utils.js +2 -2
  39. package/hooks/features/columns/gridColumnsSelector.js +5 -14
  40. package/hooks/features/pagination/gridPaginationUtils.js +1 -1
  41. package/hooks/features/pagination/useGridRowCount.js +19 -3
  42. package/index.js +1 -1
  43. package/internals/utils/propValidation.js +1 -1
  44. package/locales/beBY.js +3 -2
  45. package/locales/bgBG.js +3 -2
  46. package/locales/bnBD.js +3 -2
  47. package/locales/csCZ.js +2 -2
  48. package/locales/daDK.js +3 -2
  49. package/locales/elGR.js +3 -2
  50. package/locales/faIR.js +3 -2
  51. package/locales/fiFI.js +3 -2
  52. package/locales/huHU.js +3 -2
  53. package/locales/hyAM.js +3 -2
  54. package/locales/isIS.js +3 -2
  55. package/locales/nlNL.js +3 -2
  56. package/locales/roRO.js +3 -2
  57. package/locales/ruRU.js +3 -2
  58. package/locales/svSE.js +3 -2
  59. package/locales/thTH.d.ts +2 -0
  60. package/locales/thTH.js +303 -0
  61. package/locales/trTR.js +3 -2
  62. package/locales/ukUA.js +13 -12
  63. package/locales/urPK.js +3 -2
  64. package/locales/viVN.js +3 -2
  65. package/material/index.js +1 -1
  66. package/package.json +16 -8
  67. package/utils/utils.d.ts +2 -2
  68. package/utils/utils.js +2 -2
@@ -0,0 +1,297 @@
1
+ import { getGridLocalization } from "../utils/getGridLocalization.js";
2
+ const thTHGrid = {
3
+ // Root
4
+ noRowsLabel: 'ไม่มีข้อมูล',
5
+ noResultsOverlayLabel: 'ไม่พบผลลัพธ์',
6
+ noColumnsOverlayLabel: 'ไม่มีคอลัมน์',
7
+ noColumnsOverlayManageColumns: 'จัดการคอลัมน์',
8
+ emptyPivotOverlayLabel: 'เพิ่มฟิลด์ไปยังแถว คอลัมน์ และค่า เพื่อสร้างตาราง Pivot',
9
+ // Density selector toolbar button text
10
+ toolbarDensity: 'ความหนาแน่น',
11
+ toolbarDensityLabel: 'ความหนาแน่น',
12
+ toolbarDensityCompact: 'กะทัดรัด',
13
+ toolbarDensityStandard: 'มาตรฐาน',
14
+ toolbarDensityComfortable: 'สบายตา',
15
+ // Undo/redo toolbar button text
16
+ toolbarUndo: 'เลิกทำ',
17
+ toolbarRedo: 'ทำซ้ำ',
18
+ // Columns selector toolbar button text
19
+ toolbarColumns: 'คอลัมน์',
20
+ toolbarColumnsLabel: 'เลือกคอลัมน์',
21
+ // Filters toolbar button text
22
+ toolbarFilters: 'ตัวกรอง',
23
+ toolbarFiltersLabel: 'แสดงตัวกรอง',
24
+ toolbarFiltersTooltipHide: 'ซ่อนตัวกรอง',
25
+ toolbarFiltersTooltipShow: 'แสดงตัวกรอง',
26
+ toolbarFiltersTooltipActive: count => `ตัวกรองที่ใช้งาน ${count} รายการ`,
27
+ // Quick filter toolbar field
28
+ toolbarQuickFilterPlaceholder: 'ค้นหา…',
29
+ toolbarQuickFilterLabel: 'ค้นหา',
30
+ toolbarQuickFilterDeleteIconLabel: 'ล้าง',
31
+ // Export selector toolbar button text
32
+ toolbarExport: 'ส่งออก',
33
+ toolbarExportLabel: 'ส่งออก',
34
+ toolbarExportCSV: 'ดาวน์โหลดเป็น CSV',
35
+ toolbarExportPrint: 'พิมพ์',
36
+ toolbarExportExcel: 'ดาวน์โหลดเป็น Excel',
37
+ // Toolbar pivot button
38
+ toolbarPivot: 'Pivot',
39
+ // Toolbar charts button
40
+ toolbarCharts: 'แผนภูมิ',
41
+ // Toolbar AI Assistant button
42
+ toolbarAssistant: 'ผู้ช่วย AI',
43
+ // Columns management text
44
+ columnsManagementSearchTitle: 'ค้นหา',
45
+ columnsManagementNoColumns: 'ไม่มีคอลัมน์',
46
+ columnsManagementShowHideAllText: 'แสดง/ซ่อนทั้งหมด',
47
+ columnsManagementReset: 'รีเซ็ต',
48
+ columnsManagementDeleteIconLabel: 'ล้าง',
49
+ // Filter panel text
50
+ filterPanelAddFilter: 'เพิ่มตัวกรอง',
51
+ filterPanelRemoveAll: 'ลบทั้งหมด',
52
+ filterPanelDeleteIconLabel: 'ลบ',
53
+ filterPanelLogicOperator: 'ตัวดำเนินการตรรกะ',
54
+ filterPanelOperator: 'ตัวดำเนินการ',
55
+ filterPanelOperatorAnd: 'และ',
56
+ filterPanelOperatorOr: 'หรือ',
57
+ filterPanelColumns: 'คอลัมน์',
58
+ filterPanelInputLabel: 'ค่า',
59
+ filterPanelInputPlaceholder: 'ค่าตัวกรอง',
60
+ // Filter operators text
61
+ filterOperatorContains: 'ประกอบด้วย',
62
+ filterOperatorDoesNotContain: 'ไม่ประกอบด้วย',
63
+ filterOperatorEquals: 'เท่ากับ',
64
+ filterOperatorDoesNotEqual: 'ไม่เท่ากับ',
65
+ filterOperatorStartsWith: 'เริ่มต้นด้วย',
66
+ filterOperatorEndsWith: 'ลงท้ายด้วย',
67
+ filterOperatorIs: 'คือ',
68
+ filterOperatorNot: 'ไม่ใช่',
69
+ filterOperatorAfter: 'หลังจาก',
70
+ filterOperatorOnOrAfter: 'ตั้งแต่หรือหลังจาก',
71
+ filterOperatorBefore: 'ก่อน',
72
+ filterOperatorOnOrBefore: 'ตั้งแต่หรือก่อน',
73
+ filterOperatorIsEmpty: 'ว่างเปล่า',
74
+ filterOperatorIsNotEmpty: 'ไม่ว่างเปล่า',
75
+ filterOperatorIsAnyOf: 'เป็นหนึ่งใน',
76
+ 'filterOperator=': '=',
77
+ 'filterOperator!=': '!=',
78
+ 'filterOperator>': '>',
79
+ 'filterOperator>=': '>=',
80
+ 'filterOperator<': '<',
81
+ 'filterOperator<=': '<=',
82
+ // Header filter operators text
83
+ headerFilterOperatorContains: 'ประกอบด้วย',
84
+ headerFilterOperatorDoesNotContain: 'ไม่ประกอบด้วย',
85
+ headerFilterOperatorEquals: 'เท่ากับ',
86
+ headerFilterOperatorDoesNotEqual: 'ไม่เท่ากับ',
87
+ headerFilterOperatorStartsWith: 'เริ่มต้นด้วย',
88
+ headerFilterOperatorEndsWith: 'ลงท้ายด้วย',
89
+ headerFilterOperatorIs: 'คือ',
90
+ headerFilterOperatorNot: 'ไม่ใช่',
91
+ headerFilterOperatorAfter: 'หลังจาก',
92
+ headerFilterOperatorOnOrAfter: 'ตั้งแต่หรือหลังจาก',
93
+ headerFilterOperatorBefore: 'ก่อน',
94
+ headerFilterOperatorOnOrBefore: 'ตั้งแต่หรือก่อน',
95
+ headerFilterOperatorIsEmpty: 'ว่างเปล่า',
96
+ headerFilterOperatorIsNotEmpty: 'ไม่ว่างเปล่า',
97
+ headerFilterOperatorIsAnyOf: 'เป็นหนึ่งใน',
98
+ 'headerFilterOperator=': 'เท่ากับ',
99
+ 'headerFilterOperator!=': 'ไม่เท่ากับ',
100
+ 'headerFilterOperator>': 'มากกว่า',
101
+ 'headerFilterOperator>=': 'มากกว่าหรือเท่ากับ',
102
+ 'headerFilterOperator<': 'น้อยกว่า',
103
+ 'headerFilterOperator<=': 'น้อยกว่าหรือเท่ากับ',
104
+ headerFilterClear: 'ล้างตัวกรอง',
105
+ // Filter values text
106
+ filterValueAny: 'ใดๆ',
107
+ filterValueTrue: 'จริง',
108
+ filterValueFalse: 'เท็จ',
109
+ // Column menu text
110
+ columnMenuLabel: 'เมนู',
111
+ columnMenuAriaLabel: columnName => `เมนูคอลัมน์ ${columnName}`,
112
+ columnMenuShowColumns: 'แสดงคอลัมน์',
113
+ columnMenuManageColumns: 'จัดการคอลัมน์',
114
+ columnMenuFilter: 'กรอง',
115
+ columnMenuHideColumn: 'ซ่อนคอลัมน์',
116
+ columnMenuUnsort: 'ยกเลิกการเรียงลำดับ',
117
+ columnMenuSortAsc: 'เรียงจากน้อยไปมาก',
118
+ columnMenuSortDesc: 'เรียงจากมากไปน้อย',
119
+ columnMenuManagePivot: 'จัดการ Pivot',
120
+ columnMenuManageCharts: 'จัดการแผนภูมิ',
121
+ // Column header text
122
+ columnHeaderFiltersTooltipActive: count => `ตัวกรองที่ใช้งาน ${count} รายการ`,
123
+ columnHeaderFiltersLabel: 'แสดงตัวกรอง',
124
+ columnHeaderSortIconLabel: 'เรียงลำดับ',
125
+ // Rows selected footer text
126
+ footerRowSelected: count => `เลือกแล้ว ${count.toLocaleString()} แถว`,
127
+ // Total row amount footer text
128
+ footerTotalRows: 'จำนวนแถวทั้งหมด:',
129
+ // Total visible row amount footer text
130
+ footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} จาก ${totalCount.toLocaleString()}`,
131
+ // Checkbox selection text
132
+ checkboxSelectionHeaderName: 'เลือกด้วยช่องทำเครื่องหมาย',
133
+ checkboxSelectionSelectAllRows: 'เลือกทุกแถว',
134
+ checkboxSelectionUnselectAllRows: 'ยกเลิกเลือกทุกแถว',
135
+ checkboxSelectionSelectRow: 'เลือกแถว',
136
+ checkboxSelectionUnselectRow: 'ยกเลิกเลือกแถว',
137
+ // Boolean cell text
138
+ booleanCellTrueLabel: 'ใช่',
139
+ booleanCellFalseLabel: 'ไม่ใช่',
140
+ // Long text cell
141
+ longTextCellExpandLabel: 'ขยาย',
142
+ longTextCellCollapseLabel: 'ย่อ',
143
+ // Actions cell more text
144
+ actionsCellMore: 'เพิ่มเติม',
145
+ // Column pinning text
146
+ pinToLeft: 'ปักหมุดทางซ้าย',
147
+ pinToRight: 'ปักหมุดทางขวา',
148
+ unpin: 'เลิกปักหมุด',
149
+ // Tree Data
150
+ treeDataGroupingHeaderName: 'กลุ่ม',
151
+ treeDataExpand: 'ดูรายการย่อย',
152
+ treeDataCollapse: 'ซ่อนรายการย่อย',
153
+ // Grouping columns
154
+ groupingColumnHeaderName: 'กลุ่ม',
155
+ groupColumn: name => `จัดกลุ่มตาม ${name}`,
156
+ unGroupColumn: name => `ยกเลิกจัดกลุ่มตาม ${name}`,
157
+ // Master/detail
158
+ detailPanelToggle: 'สลับแผงรายละเอียด',
159
+ expandDetailPanel: 'ขยาย',
160
+ collapseDetailPanel: 'ย่อ',
161
+ // Pagination
162
+ paginationRowsPerPage: 'แถวต่อหน้า:',
163
+ paginationDisplayedRows: ({
164
+ from,
165
+ to,
166
+ count,
167
+ estimated
168
+ }) => {
169
+ if (!estimated) {
170
+ return `${from}–${to} จาก ${count !== -1 ? count : `มากกว่า ${to}`}`;
171
+ }
172
+ const estimatedLabel = estimated > to ? `ประมาณ ${estimated}` : `มากกว่า ${to}`;
173
+ return `${from}–${to} จาก ${count !== -1 ? count : estimatedLabel}`;
174
+ },
175
+ paginationItemAriaLabel: type => {
176
+ if (type === 'first') {
177
+ return 'ไปหน้าแรก';
178
+ }
179
+ if (type === 'last') {
180
+ return 'ไปหน้าสุดท้าย';
181
+ }
182
+ if (type === 'next') {
183
+ return 'ไปหน้าถัดไป';
184
+ }
185
+ // if (type === 'previous') {
186
+ return 'ไปหน้าก่อนหน้า';
187
+ },
188
+ // Row reordering text
189
+ rowReorderingHeaderName: 'จัดเรียงแถวใหม่',
190
+ // Aggregation
191
+ aggregationMenuItemHeader: 'การรวมค่า',
192
+ aggregationFunctionLabelNone: 'ไม่มี',
193
+ aggregationFunctionLabelSum: 'ผลรวม',
194
+ aggregationFunctionLabelAvg: 'ค่าเฉลี่ย',
195
+ aggregationFunctionLabelMin: 'ค่าต่ำสุด',
196
+ aggregationFunctionLabelMax: 'ค่าสูงสุด',
197
+ aggregationFunctionLabelSize: 'จำนวน',
198
+ // Pivot panel
199
+ pivotToggleLabel: 'Pivot',
200
+ pivotRows: 'แถว',
201
+ pivotColumns: 'คอลัมน์',
202
+ pivotValues: 'ค่า',
203
+ pivotCloseButton: 'ปิดการตั้งค่า Pivot',
204
+ pivotSearchButton: 'ค้นหาฟิลด์',
205
+ pivotSearchControlPlaceholder: 'ค้นหาฟิลด์',
206
+ pivotSearchControlLabel: 'ค้นหาฟิลด์',
207
+ pivotSearchControlClear: 'ล้างการค้นหา',
208
+ pivotNoFields: 'ไม่มีฟิลด์',
209
+ pivotMenuMoveUp: 'ย้ายขึ้น',
210
+ pivotMenuMoveDown: 'ย้ายลง',
211
+ pivotMenuMoveToTop: 'ย้ายไปบนสุด',
212
+ pivotMenuMoveToBottom: 'ย้ายไปล่างสุด',
213
+ pivotMenuRows: 'แถว',
214
+ pivotMenuColumns: 'คอลัมน์',
215
+ pivotMenuValues: 'ค่า',
216
+ pivotMenuOptions: 'ตัวเลือกฟิลด์',
217
+ pivotMenuAddToRows: 'เพิ่มไปยังแถว',
218
+ pivotMenuAddToColumns: 'เพิ่มไปยังคอลัมน์',
219
+ pivotMenuAddToValues: 'เพิ่มไปยังค่า',
220
+ pivotMenuRemove: 'ลบ',
221
+ pivotDragToRows: 'ลากมาที่นี่เพื่อสร้างแถว',
222
+ pivotDragToColumns: 'ลากมาที่นี่เพื่อสร้างคอลัมน์',
223
+ pivotDragToValues: 'ลากมาที่นี่เพื่อสร้างค่า',
224
+ pivotYearColumnHeaderName: '(ปี)',
225
+ pivotQuarterColumnHeaderName: '(ไตรมาส)',
226
+ // Charts configuration panel
227
+ chartsNoCharts: 'ไม่มีแผนภูมิที่ใช้งานได้',
228
+ chartsChartNotSelected: 'เลือกประเภทแผนภูมิเพื่อกำหนดค่าตัวเลือก',
229
+ chartsTabChart: 'แผนภูมิ',
230
+ chartsTabFields: 'ฟิลด์',
231
+ chartsTabCustomize: 'ปรับแต่ง',
232
+ chartsCloseButton: 'ปิดการตั้งค่าแผนภูมิ',
233
+ chartsSyncButtonLabel: 'ซิงค์แผนภูมิ',
234
+ chartsSearchPlaceholder: 'ค้นหาฟิลด์',
235
+ chartsSearchLabel: 'ค้นหาฟิลด์',
236
+ chartsSearchClear: 'ล้างการค้นหา',
237
+ chartsNoFields: 'ไม่มีฟิลด์',
238
+ chartsFieldBlocked: 'ไม่สามารถเพิ่มฟิลด์นี้ไปยังส่วนใดได้',
239
+ chartsCategories: 'หมวดหมู่',
240
+ chartsSeries: 'ชุดข้อมูล',
241
+ chartsMenuAddToDimensions: dimensionLabel => `เพิ่มไปยัง${dimensionLabel}`,
242
+ chartsMenuAddToValues: valuesLabel => `เพิ่มไปยัง${valuesLabel}`,
243
+ chartsMenuMoveUp: 'ย้ายขึ้น',
244
+ chartsMenuMoveDown: 'ย้ายลง',
245
+ chartsMenuMoveToTop: 'ย้ายไปบนสุด',
246
+ chartsMenuMoveToBottom: 'ย้ายไปล่างสุด',
247
+ chartsMenuOptions: 'ตัวเลือกฟิลด์',
248
+ chartsMenuRemove: 'ลบ',
249
+ chartsDragToDimensions: dimensionLabel => `ลากมาที่นี่เพื่อใช้คอลัมน์เป็น${dimensionLabel}`,
250
+ chartsDragToValues: valuesLabel => `ลากมาที่นี่เพื่อใช้คอลัมน์เป็น${valuesLabel}`,
251
+ // AI Assistant panel
252
+ aiAssistantPanelTitle: 'ผู้ช่วย AI',
253
+ aiAssistantPanelClose: 'ปิดผู้ช่วย AI',
254
+ aiAssistantPanelNewConversation: 'บทสนทนาใหม่',
255
+ aiAssistantPanelConversationHistory: 'ประวัติบทสนทนา',
256
+ aiAssistantPanelEmptyConversation: 'ไม่มีประวัติคำสั่ง',
257
+ aiAssistantSuggestions: 'คำแนะนำ',
258
+ // Prompt field
259
+ promptFieldLabel: 'คำสั่ง',
260
+ promptFieldPlaceholder: 'พิมพ์คำสั่ง…',
261
+ promptFieldPlaceholderWithRecording: 'พิมพ์หรือบันทึกเสียงคำสั่ง…',
262
+ promptFieldPlaceholderListening: 'กำลังฟังคำสั่ง…',
263
+ promptFieldSpeechRecognitionNotSupported: 'เบราว์เซอร์นี้ไม่รองรับการรู้จำเสียง',
264
+ promptFieldSend: 'ส่ง',
265
+ promptFieldRecord: 'บันทึกเสียง',
266
+ promptFieldStopRecording: 'หยุดบันทึกเสียง',
267
+ // Prompt
268
+ promptRerun: 'รันอีกครั้ง',
269
+ promptProcessing: 'กำลังประมวลผล…',
270
+ promptAppliedChanges: 'นำการเปลี่ยนแปลงไปใช้แล้ว',
271
+ // Prompt changes
272
+ promptChangeGroupDescription: column => `จัดกลุ่มตาม ${column}`,
273
+ promptChangeAggregationLabel: (column, aggregation) => `${column} (${aggregation})`,
274
+ promptChangeAggregationDescription: (column, aggregation) => `รวมค่า ${column} (${aggregation})`,
275
+ promptChangeFilterLabel: (column, operator, value) => {
276
+ if (operator === 'is any of') {
277
+ return `${column} เป็นหนึ่งใน: ${value}`;
278
+ }
279
+ return `${column} ${operator} ${value}`;
280
+ },
281
+ promptChangeFilterDescription: (column, operator, value) => {
282
+ if (operator === 'is any of') {
283
+ return `กรองโดยที่ ${column} เป็นหนึ่งใน: ${value}`;
284
+ }
285
+ return `กรองโดยที่ ${column} ${operator} ${value}`;
286
+ },
287
+ promptChangeSortDescription: (column, direction) => `เรียงตาม ${column} (${direction})`,
288
+ promptChangePivotEnableLabel: 'Pivot',
289
+ promptChangePivotEnableDescription: 'เปิดใช้งาน Pivot',
290
+ promptChangePivotColumnsLabel: count => `คอลัมน์ (${count})`,
291
+ promptChangePivotColumnsDescription: (column, direction) => `${column}${direction ? ` (${direction})` : ''}`,
292
+ promptChangePivotRowsLabel: count => `แถว (${count})`,
293
+ promptChangePivotValuesLabel: count => `ค่า (${count})`,
294
+ promptChangePivotValuesDescription: (column, aggregation) => `${column} (${aggregation})`,
295
+ promptChangeChartsLabel: (dimensionsCount, valuesCount) => `มิติ (${dimensionsCount}), ค่า (${valuesCount})`
296
+ };
297
+ export const thTH = getGridLocalization(thTHGrid);
@@ -172,11 +172,12 @@ const trTRGrid = {
172
172
  // count,
173
173
  // estimated
174
174
  // }) => {
175
+ // const unknownRowCount = count == null || count === -1;
175
176
  // if (!estimated) {
176
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
177
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
177
178
  // }
178
179
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
179
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
180
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
180
181
  // },
181
182
  paginationItemAriaLabel: type => {
182
183
  if (type === 'first') {
@@ -188,18 +188,19 @@ const ukUAGrid = {
188
188
  collapseDetailPanel: 'Приховати',
189
189
  // Pagination
190
190
  paginationRowsPerPage: 'Рядків на сторінці:',
191
- // paginationDisplayedRows: ({
192
- // from,
193
- // to,
194
- // count,
195
- // estimated
196
- // }) => {
197
- // if (!estimated) {
198
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
199
- // }
200
- // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
201
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
202
- // },
191
+ paginationDisplayedRows: ({
192
+ from,
193
+ to,
194
+ count,
195
+ estimated
196
+ }) => {
197
+ const unknownRowCount = count == null || count === -1;
198
+ if (!estimated) {
199
+ return `${from}–${to} з ${!unknownRowCount ? count : `більше ніж ${to}`}`;
200
+ }
201
+ const estimatedLabel = estimated && estimated > to ? `близько ${estimated}` : `більше ніж ${to}`;
202
+ return `${from}–${to} з ${!unknownRowCount ? count : estimatedLabel}`;
203
+ },
203
204
  paginationItemAriaLabel: type => {
204
205
  if (type === 'first') {
205
206
  return 'Перейти на першу сторінку';
@@ -172,11 +172,12 @@ const urPKGrid = {
172
172
  // count,
173
173
  // estimated
174
174
  // }) => {
175
+ // const unknownRowCount = count == null || count === -1;
175
176
  // if (!estimated) {
176
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
177
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
177
178
  // }
178
179
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
179
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
180
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
180
181
  // },
181
182
  paginationItemAriaLabel: type => {
182
183
  if (type === 'first') {
@@ -173,11 +173,12 @@ const viVNGrid = {
173
173
  // count,
174
174
  // estimated
175
175
  // }) => {
176
+ // const unknownRowCount = count == null || count === -1;
176
177
  // if (!estimated) {
177
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
178
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
178
179
  // }
179
180
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
180
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
181
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
181
182
  // },
182
183
  paginationItemAriaLabel: type => {
183
184
  if (type === 'first') {
@@ -74,7 +74,7 @@ import "./augmentation.js";
74
74
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
75
75
  export { useMaterialCSSVariables } from "./variables.js";
76
76
 
77
- /* eslint-disable material-ui/disallow-react-api-in-server-components */
77
+ /* eslint-disable mui/disallow-react-api-in-server-components */
78
78
 
79
79
  const InputAdornment = styled(MUIInputAdornment, {
80
80
  slot: 'internal'
@@ -4,8 +4,8 @@ export declare function isObject<TObject = Record<PropertyKey, any>>(value: unkn
4
4
  export declare function localStorageAvailable(): boolean;
5
5
  export declare function escapeRegExp(value: string): string;
6
6
  /**
7
- * Follows the CSS specification behavior for min and max
8
- * If min > max, then the min have priority
7
+ * Follows the CSS specification behavior for min and max.
8
+ * If min > max, then min has priority.
9
9
  */
10
10
  export declare const clamp: (value: number, min: number, max: number) => number;
11
11
  /**
@@ -25,8 +25,8 @@ export function escapeRegExp(value) {
25
25
  }
26
26
 
27
27
  /**
28
- * Follows the CSS specification behavior for min and max
29
- * If min > max, then the min have priority
28
+ * Follows the CSS specification behavior for min and max.
29
+ * If min > max, then min has priority.
30
30
  */
31
31
  export const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
32
32
 
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.gridVisiblePinnedColumnDefinitionsSelector = exports.gridVisibleColumnFieldsSelector = exports.gridVisibleColumnDefinitionsSelector = exports.gridPinnedColumnsSelector = exports.gridInitialColumnVisibilityModelSelector = exports.gridHasColSpanSelector = exports.gridFilterableColumnLookupSelector = exports.gridFilterableColumnDefinitionsSelector = exports.gridExistingPinnedColumnSelector = exports.gridColumnsStateSelector = exports.gridColumnVisibilityModelSelector = exports.gridColumnPositionsSelector = exports.gridColumnLookupSelector = exports.gridColumnFieldsSelector = exports.gridColumnDefinitionsSelector = void 0;
7
7
  var _createSelector = require("../../../utils/createSelector");
8
8
  var _gridColumnsInterfaces = require("./gridColumnsInterfaces");
9
- var _gridCoreSelector = require("../../core/gridCoreSelector");
10
9
  var _listView = require("../listView");
11
10
  /**
12
11
  * Get the columns state
@@ -70,24 +69,24 @@ const gridPinnedColumnsSelector = exports.gridPinnedColumnsSelector = (0, _creat
70
69
  * @category Pinned Columns
71
70
  * @ignore - Do not document
72
71
  */
73
- const gridExistingPinnedColumnSelector = exports.gridExistingPinnedColumnSelector = (0, _createSelector.createSelectorMemoized)(gridPinnedColumnsSelector, gridColumnFieldsSelector, _gridCoreSelector.gridIsRtlSelector, (model, orderedFields, isRtl) => filterMissingColumns(model, orderedFields, isRtl));
72
+ const gridExistingPinnedColumnSelector = exports.gridExistingPinnedColumnSelector = (0, _createSelector.createSelectorMemoized)(gridPinnedColumnsSelector, gridColumnFieldsSelector, (model, orderedFields) => filterMissingColumns(model, orderedFields));
74
73
 
75
74
  /**
76
75
  * Get the visible pinned columns.
77
76
  * @category Visible Columns
78
77
  */
79
- const gridVisiblePinnedColumnDefinitionsSelector = exports.gridVisiblePinnedColumnDefinitionsSelector = (0, _createSelector.createSelectorMemoized)(gridColumnsStateSelector, gridPinnedColumnsSelector, gridVisibleColumnFieldsSelector, _gridCoreSelector.gridIsRtlSelector, _listView.gridListViewSelector, (columnsState, model, visibleColumnFields, isRtl, listView) => {
78
+ const gridVisiblePinnedColumnDefinitionsSelector = exports.gridVisiblePinnedColumnDefinitionsSelector = (0, _createSelector.createSelectorMemoized)(gridColumnsStateSelector, gridPinnedColumnsSelector, gridVisibleColumnFieldsSelector, _listView.gridListViewSelector, (columnsState, model, visibleColumnFields, listView) => {
80
79
  if (listView) {
81
80
  return _gridColumnsInterfaces.EMPTY_PINNED_COLUMN_FIELDS;
82
81
  }
83
- const visiblePinnedFields = filterMissingColumns(model, visibleColumnFields, isRtl);
82
+ const visiblePinnedFields = filterMissingColumns(model, visibleColumnFields);
84
83
  const visiblePinnedColumns = {
85
84
  left: visiblePinnedFields.left.map(field => columnsState.lookup[field]),
86
85
  right: visiblePinnedFields.right.map(field => columnsState.lookup[field])
87
86
  };
88
87
  return visiblePinnedColumns;
89
88
  });
90
- function filterMissingColumns(pinnedColumns, columns, invert) {
89
+ function filterMissingColumns(pinnedColumns, columns) {
91
90
  if (!Array.isArray(pinnedColumns.left) && !Array.isArray(pinnedColumns.right)) {
92
91
  return _gridColumnsInterfaces.EMPTY_PINNED_COLUMN_FIELDS;
93
92
  }
@@ -101,16 +100,8 @@ function filterMissingColumns(pinnedColumns, columns, invert) {
101
100
  return newPinnedColumns.filter(field => remainingColumns.includes(field));
102
101
  };
103
102
  const leftPinnedColumns = filter(pinnedColumns.left, columns);
104
- const columnsWithoutLeftPinnedColumns = columns.filter(
105
- // Filter out from the remaining columns those columns already pinned to the left
106
- field => !leftPinnedColumns.includes(field));
103
+ const columnsWithoutLeftPinnedColumns = columns.filter(field => !leftPinnedColumns.includes(field));
107
104
  const rightPinnedColumns = filter(pinnedColumns.right, columnsWithoutLeftPinnedColumns);
108
- if (invert) {
109
- return {
110
- left: rightPinnedColumns,
111
- right: leftPinnedColumns
112
- };
113
- }
114
105
  return {
115
106
  left: leftPinnedColumns,
116
107
  right: rightPinnedColumns
@@ -12,7 +12,7 @@ const getPageCount = (rowCount, pageSize, page) => {
12
12
  if (pageSize > 0 && rowCount > 0) {
13
13
  return Math.ceil(rowCount / pageSize);
14
14
  }
15
- if (rowCount === -1) {
15
+ if (rowCount === -1 || rowCount == null) {
16
16
  // With unknown row-count, we can assume a page after the current one
17
17
  return page + 2;
18
18
  }
@@ -18,10 +18,11 @@ var _gridPaginationSelector = require("./gridPaginationSelector");
18
18
  const useGridRowCount = (apiRef, props) => {
19
19
  const logger = (0, _utils.useGridLogger)(apiRef, 'useGridRowCount');
20
20
  const previousPageSize = (0, _useLazyRef.default)(() => (0, _gridPaginationSelector.gridPaginationModelSelector)(apiRef).pageSize);
21
+ const onRowCountChangeProp = props.onRowCountChange;
21
22
  apiRef.current.registerControlState({
22
23
  stateId: 'paginationRowCount',
23
24
  propModel: props.rowCount,
24
- propOnChange: props.onRowCountChange,
25
+ propOnChange: onRowCountChangeProp,
25
26
  stateSelector: _gridPaginationSelector.gridPaginationRowCountSelector,
26
27
  changeEvent: 'rowCountChange'
27
28
  });
@@ -35,12 +36,26 @@ const useGridRowCount = (apiRef, props) => {
35
36
  return;
36
37
  }
37
38
  logger.debug("Setting 'rowCount' to", newRowCount);
39
+ if (rowCountState == null || rowCountState === -1) {
40
+ const newState = (0, _extends2.default)({}, apiRef.current.state, {
41
+ pagination: (0, _extends2.default)({}, apiRef.current.state.pagination, {
42
+ rowCount: newRowCount
43
+ })
44
+ });
45
+ apiRef.current.state = newState;
46
+ apiRef.current.store.update(newState);
47
+ apiRef.current.publishEvent('rowCountChange', newRowCount);
48
+ if (onRowCountChangeProp) {
49
+ onRowCountChangeProp(newRowCount);
50
+ }
51
+ return;
52
+ }
38
53
  apiRef.current.setState(state => (0, _extends2.default)({}, state, {
39
54
  pagination: (0, _extends2.default)({}, state.pagination, {
40
55
  rowCount: newRowCount
41
56
  })
42
57
  }));
43
- }, [apiRef, logger]);
58
+ }, [apiRef, logger, onRowCountChangeProp]);
44
59
  const paginationRowCountApi = {
45
60
  setRowCount
46
61
  };
@@ -117,7 +132,8 @@ const useGridRowCount = (apiRef, props) => {
117
132
  }
118
133
  return undefined;
119
134
  }, (_, isLastPageOrRowCount) => {
120
- if (isLastPageOrRowCount === true && (0, _gridPaginationSelector.gridPaginationRowCountSelector)(apiRef) !== -1) {
135
+ const rowCount = (0, _gridPaginationSelector.gridPaginationRowCountSelector)(apiRef);
136
+ if (isLastPageOrRowCount === true && (rowCount == null || rowCount === -1)) {
121
137
  const visibleTopLevelRowCount = (0, _filter.gridFilteredTopLevelRowCountSelector)(apiRef);
122
138
  const paginationModel = (0, _gridPaginationSelector.gridPaginationModelSelector)(apiRef);
123
139
  apiRef.current.setRowCount(paginationModel.pageSize * paginationModel.page + visibleTopLevelRowCount);
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.27.3
2
+ * @mui/x-data-grid v9.0.0-alpha.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -8,7 +8,7 @@ exports.validateProps = validateProps;
8
8
  var _warning = require("@mui/x-internals/warning");
9
9
  var _utils = require("../../utils/utils");
10
10
  var _signature = require("../../constants/signature");
11
- const propValidatorsDataGrid = exports.propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.paginationMode === 'client' && props.paginationMeta != null && ['MUI X: Usage of the `paginationMeta` prop with client-side pagination (`paginationMode="client"`) has no effect.', '`paginationMeta` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.signature === _signature.GridSignature.DataGrid && props.paginationMode === 'client' && (0, _utils.isNumber)(props.rowCount) && ['MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect.', '`rowCount` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.paginationMode === 'server' && props.rowCount == null && !props.dataSource && ["MUI X: The `rowCount` prop must be passed using `paginationMode='server'`", 'For more detail, see http://mui.com/components/data-grid/pagination/#index-based-pagination'].join('\n') || undefined];
11
+ const propValidatorsDataGrid = exports.propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.paginationMode === 'client' && props.paginationMeta != null && ['MUI X: Usage of the `paginationMeta` prop with client-side pagination (`paginationMode="client"`) has no effect.', '`paginationMeta` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.signature === _signature.GridSignature.DataGrid && props.paginationMode === 'client' && (0, _utils.isNumber)(props.rowCount) && ['MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect.', '`rowCount` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.paginationMode === 'server' && props.rowCount == null && !props.dataSource && !props.paginationMeta && ["MUI X: The `rowCount` prop must be passed using `paginationMode='server'`", 'For more detail, see http://mui.com/components/data-grid/pagination/#index-based-pagination'].join('\n') || undefined];
12
12
  function validateProps(props, validators) {
13
13
  validators.forEach(validator => {
14
14
  const message = validator(props);
package/locales/beBY.js CHANGED
@@ -202,11 +202,12 @@ const beBYGrid = {
202
202
  // count,
203
203
  // estimated
204
204
  // }) => {
205
+ // const unknownRowCount = count == null || count === -1;
205
206
  // if (!estimated) {
206
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
207
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
207
208
  // }
208
209
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
209
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
210
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
210
211
  // },
211
212
  paginationItemAriaLabel: type => {
212
213
  if (type === 'first') {
package/locales/bgBG.js CHANGED
@@ -179,11 +179,12 @@ const bgBGGrid = {
179
179
  // count,
180
180
  // estimated
181
181
  // }) => {
182
+ // const unknownRowCount = count == null || count === -1;
182
183
  // if (!estimated) {
183
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
184
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
184
185
  // }
185
186
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
186
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
187
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
187
188
  // },
188
189
  paginationItemAriaLabel: type => {
189
190
  if (type === 'first') {
package/locales/bnBD.js CHANGED
@@ -178,11 +178,12 @@ const bnBDGrid = {
178
178
  // count,
179
179
  // estimated
180
180
  // }) => {
181
+ // const unknownRowCount = count == null || count === -1;
181
182
  // if (!estimated) {
182
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
183
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
183
184
  // }
184
185
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
185
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
186
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
186
187
  // },
187
188
  paginationItemAriaLabel: type => {
188
189
  if (type === 'first') {
package/locales/csCZ.js CHANGED
@@ -131,7 +131,7 @@ const csCZGrid = {
131
131
  columnMenuManageColumns: 'Spravovat sloupce',
132
132
  columnMenuFilter: 'Filtr',
133
133
  columnMenuHideColumn: 'Skrýt',
134
- columnMenuUnsort: 'Zrušit filtry',
134
+ columnMenuUnsort: 'Zrušit řazení',
135
135
  columnMenuSortAsc: 'Seřadit vzestupně',
136
136
  columnMenuSortDesc: 'Seřadit sestupně',
137
137
  // columnMenuManagePivot: 'Manage pivot',
@@ -148,7 +148,7 @@ const csCZGrid = {
148
148
  return `${count} ${pluralForm}`;
149
149
  },
150
150
  columnHeaderFiltersLabel: 'Zobrazit filtry',
151
- columnHeaderSortIconLabel: 'Filtrovat',
151
+ columnHeaderSortIconLabel: 'Řadit',
152
152
  // Rows selected footer text
153
153
  footerRowSelected: count => {
154
154
  let pluralForm = 'vybraných záznamů';
package/locales/daDK.js CHANGED
@@ -178,11 +178,12 @@ const daDKGrid = {
178
178
  // count,
179
179
  // estimated
180
180
  // }) => {
181
+ // const unknownRowCount = count == null || count === -1;
181
182
  // if (!estimated) {
182
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
183
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
183
184
  // }
184
185
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
185
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
186
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
186
187
  // },
187
188
  paginationItemAriaLabel: type => {
188
189
  if (type === 'first') {