material-react-table 2.0.6 → 2.2.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.
- package/dist/index.d.ts +13 -4
- package/dist/index.esm.js +2331 -2282
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2362 -2310
- package/dist/index.js.map +1 -1
- package/locales/fr/index.esm.js +1 -1
- package/locales/fr/index.js +1 -1
- package/{dist/types/locales/he.d.ts → locales/he/index.d.ts} +2 -1
- package/locales/he/index.esm.d.ts +3 -0
- package/locales/he/index.esm.js +93 -0
- package/locales/he/index.js +97 -0
- package/locales/he/package.json +6 -0
- package/package.json +24 -24
- package/src/body/MRT_TableBody.tsx +16 -123
- package/src/body/MRT_TableBodyCell.tsx +11 -10
- package/src/body/MRT_TableBodyRow.tsx +9 -5
- package/src/head/MRT_TableHeadCell.tsx +4 -1
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +18 -9
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useMRT_ColumnVirtualizer.ts +125 -0
- package/src/hooks/useMRT_DisplayColumns.tsx +2 -0
- package/src/hooks/useMRT_RowVirtualizer.ts +64 -0
- package/src/hooks/useMRT_Rows.ts +94 -0
- package/src/hooks/useMRT_TableOptions.ts +8 -0
- package/src/inputs/MRT_EditCellTextField.tsx +3 -1
- package/src/inputs/MRT_FilterTextField.tsx +1 -1
- package/src/locales/fr.ts +1 -1
- package/src/table/MRT_Table.tsx +17 -107
- package/dist/types/MaterialReactTable.d.ts +0 -7
- package/dist/types/aggregationFns.d.ts +0 -11
- package/dist/types/body/MRT_TableBody.d.ts +0 -13
- package/dist/types/body/MRT_TableBodyCell.d.ts +0 -15
- package/dist/types/body/MRT_TableBodyCellValue.d.ts +0 -8
- package/dist/types/body/MRT_TableBodyRow.d.ts +0 -18
- package/dist/types/body/MRT_TableBodyRowGrabHandle.d.ts +0 -10
- package/dist/types/body/MRT_TableBodyRowPinButton.d.ts +0 -8
- package/dist/types/body/MRT_TableDetailPanel.d.ts +0 -13
- package/dist/types/body/index.d.ts +0 -7
- package/dist/types/buttons/MRT_ColumnPinningButtons.d.ts +0 -8
- package/dist/types/buttons/MRT_CopyButton.d.ts +0 -8
- package/dist/types/buttons/MRT_EditActionButtons.d.ts +0 -9
- package/dist/types/buttons/MRT_ExpandAllButton.d.ts +0 -7
- package/dist/types/buttons/MRT_ExpandButton.d.ts +0 -8
- package/dist/types/buttons/MRT_GrabHandleButton.d.ts +0 -12
- package/dist/types/buttons/MRT_RowPinButton.d.ts +0 -10
- package/dist/types/buttons/MRT_ShowHideColumnsButton.d.ts +0 -7
- package/dist/types/buttons/MRT_ToggleDensePaddingButton.d.ts +0 -7
- package/dist/types/buttons/MRT_ToggleFiltersButton.d.ts +0 -7
- package/dist/types/buttons/MRT_ToggleFullScreenButton.d.ts +0 -7
- package/dist/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +0 -7
- package/dist/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +0 -9
- package/dist/types/buttons/index.d.ts +0 -13
- package/dist/types/column.utils.d.ts +0 -127
- package/dist/types/filterFns.d.ts +0 -69
- package/dist/types/footer/MRT_TableFooter.d.ts +0 -11
- package/dist/types/footer/MRT_TableFooterCell.d.ts +0 -8
- package/dist/types/footer/MRT_TableFooterRow.d.ts +0 -12
- package/dist/types/footer/index.d.ts +0 -3
- package/dist/types/head/MRT_TableHead.d.ts +0 -11
- package/dist/types/head/MRT_TableHeadCell.d.ts +0 -8
- package/dist/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +0 -8
- package/dist/types/head/MRT_TableHeadCellFilterContainer.d.ts +0 -8
- package/dist/types/head/MRT_TableHeadCellFilterLabel.d.ts +0 -8
- package/dist/types/head/MRT_TableHeadCellGrabHandle.d.ts +0 -10
- package/dist/types/head/MRT_TableHeadCellResizeHandle.d.ts +0 -8
- package/dist/types/head/MRT_TableHeadCellSortLabel.d.ts +0 -8
- package/dist/types/head/MRT_TableHeadRow.d.ts +0 -12
- package/dist/types/head/index.d.ts +0 -9
- package/dist/types/hooks/index.d.ts +0 -4
- package/dist/types/hooks/useMRT_DisplayColumns.d.ts +0 -9
- package/dist/types/hooks/useMRT_Effects.d.ts +0 -2
- package/dist/types/hooks/useMRT_TableInstance.d.ts +0 -2
- package/dist/types/hooks/useMRT_TableOptions.d.ts +0 -22
- package/dist/types/icons.d.ts +0 -36
- package/dist/types/index.d.ts +0 -18
- package/dist/types/inputs/MRT_EditCellTextField.d.ts +0 -8
- package/dist/types/inputs/MRT_FilterCheckbox.d.ts +0 -8
- package/dist/types/inputs/MRT_FilterRangeFields.d.ts +0 -8
- package/dist/types/inputs/MRT_FilterRangeSlider.d.ts +0 -8
- package/dist/types/inputs/MRT_FilterTextField.d.ts +0 -9
- package/dist/types/inputs/MRT_GlobalFilterTextField.d.ts +0 -7
- package/dist/types/inputs/MRT_SelectCheckbox.d.ts +0 -9
- package/dist/types/inputs/index.d.ts +0 -7
- package/dist/types/locales/am.d.ts +0 -2
- package/dist/types/locales/ar.d.ts +0 -2
- package/dist/types/locales/az.d.ts +0 -2
- package/dist/types/locales/bg.d.ts +0 -2
- package/dist/types/locales/cs.d.ts +0 -2
- package/dist/types/locales/da.d.ts +0 -2
- package/dist/types/locales/de.d.ts +0 -2
- package/dist/types/locales/en.d.ts +0 -2
- package/dist/types/locales/es.d.ts +0 -2
- package/dist/types/locales/et.d.ts +0 -2
- package/dist/types/locales/fa.d.ts +0 -2
- package/dist/types/locales/fi.d.ts +0 -2
- package/dist/types/locales/fr.d.ts +0 -2
- package/dist/types/locales/hu.d.ts +0 -2
- package/dist/types/locales/hy.d.ts +0 -2
- package/dist/types/locales/id.d.ts +0 -2
- package/dist/types/locales/it.d.ts +0 -2
- package/dist/types/locales/ja.d.ts +0 -2
- package/dist/types/locales/ko.d.ts +0 -2
- package/dist/types/locales/nl.d.ts +0 -2
- package/dist/types/locales/no.d.ts +0 -2
- package/dist/types/locales/np.d.ts +0 -2
- package/dist/types/locales/pl.d.ts +0 -2
- package/dist/types/locales/pt-BR.d.ts +0 -2
- package/dist/types/locales/pt.d.ts +0 -2
- package/dist/types/locales/ro.d.ts +0 -2
- package/dist/types/locales/ru.d.ts +0 -2
- package/dist/types/locales/sk.d.ts +0 -2
- package/dist/types/locales/sr-Cyrl-RS.d.ts +0 -2
- package/dist/types/locales/sr-Latn-RS.d.ts +0 -2
- package/dist/types/locales/sv.d.ts +0 -2
- package/dist/types/locales/tr.d.ts +0 -2
- package/dist/types/locales/uk.d.ts +0 -2
- package/dist/types/locales/vi.d.ts +0 -2
- package/dist/types/locales/zh-Hans.d.ts +0 -2
- package/dist/types/locales/zh-Hant.d.ts +0 -2
- package/dist/types/menus/MRT_ColumnActionMenu.d.ts +0 -20
- package/dist/types/menus/MRT_FilterOptionMenu.d.ts +0 -13
- package/dist/types/menus/MRT_RowActionMenu.d.ts +0 -12
- package/dist/types/menus/MRT_ShowHideColumnsMenu.d.ts +0 -10
- package/dist/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +0 -12
- package/dist/types/menus/index.d.ts +0 -5
- package/dist/types/modals/MRT_EditRowModal.d.ts +0 -8
- package/dist/types/modals/index.d.ts +0 -1
- package/dist/types/sortingFns.d.ts +0 -12
- package/dist/types/style.utils.d.ts +0 -32
- package/dist/types/table/MRT_Table.d.ts +0 -7
- package/dist/types/table/MRT_TableContainer.d.ts +0 -7
- package/dist/types/table/MRT_TableLoadingOverlay.d.ts +0 -7
- package/dist/types/table/MRT_TablePaper.d.ts +0 -7
- package/dist/types/table/index.d.ts +0 -5
- package/dist/types/toolbar/MRT_BottomToolbar.d.ts +0 -7
- package/dist/types/toolbar/MRT_LinearProgressBar.d.ts +0 -8
- package/dist/types/toolbar/MRT_TablePagination.d.ts +0 -15
- package/dist/types/toolbar/MRT_ToolbarAlertBanner.d.ts +0 -8
- package/dist/types/toolbar/MRT_ToolbarDropZone.d.ts +0 -7
- package/dist/types/toolbar/MRT_ToolbarInternalButtons.d.ts +0 -7
- package/dist/types/toolbar/MRT_TopToolbar.d.ts +0 -6
- package/dist/types/toolbar/index.d.ts +0 -7
- package/dist/types/types.d.ts +0 -854
- package/dist/types/useMaterialReactTable.d.ts +0 -2
package/locales/fr/index.esm.js
CHANGED
|
@@ -49,7 +49,7 @@ const MRT_Localization_FR = {
|
|
|
49
49
|
groupByColumn: 'Grouper par {column}',
|
|
50
50
|
groupedBy: 'Groupé par ',
|
|
51
51
|
hideAll: 'Cacher tout',
|
|
52
|
-
hideColumn: 'Cacher {column}
|
|
52
|
+
hideColumn: 'Cacher colonne {column}',
|
|
53
53
|
max: 'Max',
|
|
54
54
|
min: 'Min',
|
|
55
55
|
move: 'Déplacer',
|
package/locales/fr/index.js
CHANGED
|
@@ -53,7 +53,7 @@ const MRT_Localization_FR = {
|
|
|
53
53
|
groupByColumn: 'Grouper par {column}',
|
|
54
54
|
groupedBy: 'Groupé par ',
|
|
55
55
|
hideAll: 'Cacher tout',
|
|
56
|
-
hideColumn: 'Cacher {column}
|
|
56
|
+
hideColumn: 'Cacher colonne {column}',
|
|
57
57
|
max: 'Max',
|
|
58
58
|
min: 'Min',
|
|
59
59
|
move: 'Déplacer',
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const MRT_Localization_HE = {
|
|
2
|
+
actions: 'פעולות',
|
|
3
|
+
and: 'ו',
|
|
4
|
+
cancel: 'ביטול',
|
|
5
|
+
changeFilterMode: 'שינוי מצב סינון',
|
|
6
|
+
changeSearchMode: 'שינוי מצב חיפוש',
|
|
7
|
+
clearFilter: 'נקה סינון',
|
|
8
|
+
clearSearch: 'נקה חיפוש',
|
|
9
|
+
clearSort: 'נקה מיון',
|
|
10
|
+
clickToCopy: 'לחץ להעתקה',
|
|
11
|
+
collapse: 'צמצום',
|
|
12
|
+
collapseAll: 'צמצום הכל',
|
|
13
|
+
columnActions: 'פעולות עמודה',
|
|
14
|
+
copiedToClipboard: 'הועתק ללוח',
|
|
15
|
+
dropToGroupBy: 'גרור לקיבוץ לפי {column}',
|
|
16
|
+
edit: 'ערוך',
|
|
17
|
+
expand: 'הרחב',
|
|
18
|
+
expandAll: 'הרחב הכל',
|
|
19
|
+
filterArrIncludes: 'כולל',
|
|
20
|
+
filterArrIncludesAll: 'כולל הכל',
|
|
21
|
+
filterArrIncludesSome: 'כולל',
|
|
22
|
+
filterBetween: 'בין',
|
|
23
|
+
filterBetweenInclusive: 'בין כולל',
|
|
24
|
+
filterByColumn: 'סנן לפי {column}',
|
|
25
|
+
filterContains: 'מכיל',
|
|
26
|
+
filterEmpty: 'ריק',
|
|
27
|
+
filterEndsWith: 'מסתיים ב',
|
|
28
|
+
filterEquals: 'שווה',
|
|
29
|
+
filterEqualsString: 'שווה',
|
|
30
|
+
filterFuzzy: 'פעיל',
|
|
31
|
+
filterGreaterThan: 'גדול מ',
|
|
32
|
+
filterGreaterThanOrEqualTo: 'גדול או שווה ל',
|
|
33
|
+
filterInNumberRange: 'בין',
|
|
34
|
+
filterIncludesString: 'מכיל',
|
|
35
|
+
filterIncludesStringSensitive: 'מכיל',
|
|
36
|
+
filterLessThan: 'קטן מ',
|
|
37
|
+
filterLessThanOrEqualTo: 'קטן או שווה ל',
|
|
38
|
+
filterMode: 'מצב סינון: {filterType}',
|
|
39
|
+
filterNotEmpty: 'לא ריק',
|
|
40
|
+
filterNotEquals: 'לא שווה',
|
|
41
|
+
filterStartsWith: 'מתחיל ב',
|
|
42
|
+
filterWeakEquals: 'שווה',
|
|
43
|
+
filteringByColumn: 'מסנן לפי {column} - {filterType} {filterValue}',
|
|
44
|
+
goToFirstPage: 'לדף הראשון',
|
|
45
|
+
goToLastPage: 'לדף האחרון',
|
|
46
|
+
goToNextPage: 'לדף הבא',
|
|
47
|
+
goToPreviousPage: 'לדף הקודם',
|
|
48
|
+
grab: 'תפוס',
|
|
49
|
+
groupByColumn: 'קיבוץ לפי {column}',
|
|
50
|
+
groupedBy: 'קובץ לפי',
|
|
51
|
+
hideAll: 'הסתר הכל',
|
|
52
|
+
hideColumn: 'הסתר עמודה {column}',
|
|
53
|
+
max: 'מקסימום',
|
|
54
|
+
min: 'מינימום',
|
|
55
|
+
move: 'הזז',
|
|
56
|
+
noRecordsToDisplay: 'אין רשומות להצגה',
|
|
57
|
+
noResultsFound: 'לא נמצאו תוצאות',
|
|
58
|
+
of: 'מתוך',
|
|
59
|
+
or: 'או',
|
|
60
|
+
pin: 'נעץ',
|
|
61
|
+
pinToLeft: 'נעץ לשמאל',
|
|
62
|
+
pinToRight: 'נעץ לימין',
|
|
63
|
+
resetColumnSize: 'איפוס גודל עמודה',
|
|
64
|
+
resetOrder: 'איפוס סדר',
|
|
65
|
+
rowActions: 'פעולות שורה',
|
|
66
|
+
rowNumber: '#',
|
|
67
|
+
rowNumbers: 'מספרי שורות',
|
|
68
|
+
rowsPerPage: 'שורות לעמוד',
|
|
69
|
+
save: 'שמור',
|
|
70
|
+
search: 'חיפוש',
|
|
71
|
+
selectedCountOfRowCountRowsSelected: '{selectedCount} מתוך {rowCount} שורות נבחרו',
|
|
72
|
+
select: 'בחר',
|
|
73
|
+
showAll: 'הצג הכל',
|
|
74
|
+
showAllColumns: 'הצג את כל העמודות',
|
|
75
|
+
showHideColumns: 'הצג/הסתר עמודות',
|
|
76
|
+
showHideFilters: 'הצג/הסתר סינונים',
|
|
77
|
+
showHideSearch: 'הצג/הסתר חיפוש',
|
|
78
|
+
sortByColumnAsc: 'מיין לפי {column} בסדר עולה',
|
|
79
|
+
sortByColumnDesc: 'מיין לפי {column} בסדר יורד',
|
|
80
|
+
sortedByColumnAsc: 'ממוין לפי {column} בסדר עולה',
|
|
81
|
+
sortedByColumnDesc: 'ממוין לפי {column} בסדר יורד',
|
|
82
|
+
thenBy: ', ואז לפי ',
|
|
83
|
+
toggleDensity: 'שנה צפיפות',
|
|
84
|
+
toggleFullScreen: 'מסך מלא',
|
|
85
|
+
toggleSelectAll: 'בחר/בטל בחירת הכל',
|
|
86
|
+
toggleSelectRow: 'בחר/בטל בחירת שורה',
|
|
87
|
+
toggleVisibility: 'הצג/הסתר',
|
|
88
|
+
ungroupByColumn: 'בטל קיבוץ לפי {column}',
|
|
89
|
+
unpin: 'בטל נעיצה',
|
|
90
|
+
unpinAll: 'בטל נעיצת הכל',
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export { MRT_Localization_HE };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const MRT_Localization_HE = {
|
|
6
|
+
actions: 'פעולות',
|
|
7
|
+
and: 'ו',
|
|
8
|
+
cancel: 'ביטול',
|
|
9
|
+
changeFilterMode: 'שינוי מצב סינון',
|
|
10
|
+
changeSearchMode: 'שינוי מצב חיפוש',
|
|
11
|
+
clearFilter: 'נקה סינון',
|
|
12
|
+
clearSearch: 'נקה חיפוש',
|
|
13
|
+
clearSort: 'נקה מיון',
|
|
14
|
+
clickToCopy: 'לחץ להעתקה',
|
|
15
|
+
collapse: 'צמצום',
|
|
16
|
+
collapseAll: 'צמצום הכל',
|
|
17
|
+
columnActions: 'פעולות עמודה',
|
|
18
|
+
copiedToClipboard: 'הועתק ללוח',
|
|
19
|
+
dropToGroupBy: 'גרור לקיבוץ לפי {column}',
|
|
20
|
+
edit: 'ערוך',
|
|
21
|
+
expand: 'הרחב',
|
|
22
|
+
expandAll: 'הרחב הכל',
|
|
23
|
+
filterArrIncludes: 'כולל',
|
|
24
|
+
filterArrIncludesAll: 'כולל הכל',
|
|
25
|
+
filterArrIncludesSome: 'כולל',
|
|
26
|
+
filterBetween: 'בין',
|
|
27
|
+
filterBetweenInclusive: 'בין כולל',
|
|
28
|
+
filterByColumn: 'סנן לפי {column}',
|
|
29
|
+
filterContains: 'מכיל',
|
|
30
|
+
filterEmpty: 'ריק',
|
|
31
|
+
filterEndsWith: 'מסתיים ב',
|
|
32
|
+
filterEquals: 'שווה',
|
|
33
|
+
filterEqualsString: 'שווה',
|
|
34
|
+
filterFuzzy: 'פעיל',
|
|
35
|
+
filterGreaterThan: 'גדול מ',
|
|
36
|
+
filterGreaterThanOrEqualTo: 'גדול או שווה ל',
|
|
37
|
+
filterInNumberRange: 'בין',
|
|
38
|
+
filterIncludesString: 'מכיל',
|
|
39
|
+
filterIncludesStringSensitive: 'מכיל',
|
|
40
|
+
filterLessThan: 'קטן מ',
|
|
41
|
+
filterLessThanOrEqualTo: 'קטן או שווה ל',
|
|
42
|
+
filterMode: 'מצב סינון: {filterType}',
|
|
43
|
+
filterNotEmpty: 'לא ריק',
|
|
44
|
+
filterNotEquals: 'לא שווה',
|
|
45
|
+
filterStartsWith: 'מתחיל ב',
|
|
46
|
+
filterWeakEquals: 'שווה',
|
|
47
|
+
filteringByColumn: 'מסנן לפי {column} - {filterType} {filterValue}',
|
|
48
|
+
goToFirstPage: 'לדף הראשון',
|
|
49
|
+
goToLastPage: 'לדף האחרון',
|
|
50
|
+
goToNextPage: 'לדף הבא',
|
|
51
|
+
goToPreviousPage: 'לדף הקודם',
|
|
52
|
+
grab: 'תפוס',
|
|
53
|
+
groupByColumn: 'קיבוץ לפי {column}',
|
|
54
|
+
groupedBy: 'קובץ לפי',
|
|
55
|
+
hideAll: 'הסתר הכל',
|
|
56
|
+
hideColumn: 'הסתר עמודה {column}',
|
|
57
|
+
max: 'מקסימום',
|
|
58
|
+
min: 'מינימום',
|
|
59
|
+
move: 'הזז',
|
|
60
|
+
noRecordsToDisplay: 'אין רשומות להצגה',
|
|
61
|
+
noResultsFound: 'לא נמצאו תוצאות',
|
|
62
|
+
of: 'מתוך',
|
|
63
|
+
or: 'או',
|
|
64
|
+
pin: 'נעץ',
|
|
65
|
+
pinToLeft: 'נעץ לשמאל',
|
|
66
|
+
pinToRight: 'נעץ לימין',
|
|
67
|
+
resetColumnSize: 'איפוס גודל עמודה',
|
|
68
|
+
resetOrder: 'איפוס סדר',
|
|
69
|
+
rowActions: 'פעולות שורה',
|
|
70
|
+
rowNumber: '#',
|
|
71
|
+
rowNumbers: 'מספרי שורות',
|
|
72
|
+
rowsPerPage: 'שורות לעמוד',
|
|
73
|
+
save: 'שמור',
|
|
74
|
+
search: 'חיפוש',
|
|
75
|
+
selectedCountOfRowCountRowsSelected: '{selectedCount} מתוך {rowCount} שורות נבחרו',
|
|
76
|
+
select: 'בחר',
|
|
77
|
+
showAll: 'הצג הכל',
|
|
78
|
+
showAllColumns: 'הצג את כל העמודות',
|
|
79
|
+
showHideColumns: 'הצג/הסתר עמודות',
|
|
80
|
+
showHideFilters: 'הצג/הסתר סינונים',
|
|
81
|
+
showHideSearch: 'הצג/הסתר חיפוש',
|
|
82
|
+
sortByColumnAsc: 'מיין לפי {column} בסדר עולה',
|
|
83
|
+
sortByColumnDesc: 'מיין לפי {column} בסדר יורד',
|
|
84
|
+
sortedByColumnAsc: 'ממוין לפי {column} בסדר עולה',
|
|
85
|
+
sortedByColumnDesc: 'ממוין לפי {column} בסדר יורד',
|
|
86
|
+
thenBy: ', ואז לפי ',
|
|
87
|
+
toggleDensity: 'שנה צפיפות',
|
|
88
|
+
toggleFullScreen: 'מסך מלא',
|
|
89
|
+
toggleSelectAll: 'בחר/בטל בחירת הכל',
|
|
90
|
+
toggleSelectRow: 'בחר/בטל בחירת שורה',
|
|
91
|
+
toggleVisibility: 'הצג/הסתר',
|
|
92
|
+
ungroupByColumn: 'בטל קיבוץ לפי {column}',
|
|
93
|
+
unpin: 'בטל נעיצה',
|
|
94
|
+
unpinAll: 'בטל נעיצת הכל',
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
exports.MRT_Localization_HE = MRT_Localization_HE;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.0
|
|
2
|
+
"version": "2.2.0",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "material-react-table",
|
|
5
5
|
"description": "A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript.",
|
|
@@ -61,32 +61,32 @@
|
|
|
61
61
|
"storybook:dev": "storybook dev -p 6006"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@babel/core": "^7.23.
|
|
64
|
+
"@babel/core": "^7.23.7",
|
|
65
65
|
"@babel/preset-react": "^7.23.3",
|
|
66
|
-
"@emotion/react": "^11.11.
|
|
66
|
+
"@emotion/react": "^11.11.3",
|
|
67
67
|
"@emotion/styled": "^11.11.0",
|
|
68
68
|
"@faker-js/faker": "^8.3.1",
|
|
69
|
-
"@mui/icons-material": "^5.15.
|
|
70
|
-
"@mui/material": "^5.15.
|
|
71
|
-
"@mui/x-date-pickers": "^6.18.
|
|
69
|
+
"@mui/icons-material": "^5.15.2",
|
|
70
|
+
"@mui/material": "^5.15.2",
|
|
71
|
+
"@mui/x-date-pickers": "^6.18.6",
|
|
72
72
|
"@rollup/plugin-typescript": "^11.1.5",
|
|
73
73
|
"@size-limit/preset-small-lib": "^11.0.1",
|
|
74
|
-
"@storybook/addon-a11y": "^7.
|
|
75
|
-
"@storybook/addon-essentials": "^7.
|
|
76
|
-
"@storybook/addon-interactions": "^7.
|
|
77
|
-
"@storybook/addon-links": "^7.
|
|
78
|
-
"@storybook/addon-storysource": "^7.
|
|
79
|
-
"@storybook/blocks": "^7.
|
|
80
|
-
"@storybook/react": "^7.
|
|
81
|
-
"@storybook/react-vite": "^7.
|
|
74
|
+
"@storybook/addon-a11y": "^7.6.7",
|
|
75
|
+
"@storybook/addon-essentials": "^7.6.7",
|
|
76
|
+
"@storybook/addon-interactions": "^7.6.7",
|
|
77
|
+
"@storybook/addon-links": "^7.6.7",
|
|
78
|
+
"@storybook/addon-storysource": "^7.6.7",
|
|
79
|
+
"@storybook/blocks": "^7.6.7",
|
|
80
|
+
"@storybook/react": "^7.6.7",
|
|
81
|
+
"@storybook/react-vite": "^7.6.7",
|
|
82
82
|
"@storybook/testing-library": "^0.2.2",
|
|
83
|
-
"@types/node": "^20.10.
|
|
84
|
-
"@types/react": "^18.2.
|
|
85
|
-
"@types/react-dom": "^18.2.
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
87
|
-
"@typescript-eslint/parser": "^6.
|
|
83
|
+
"@types/node": "^20.10.6",
|
|
84
|
+
"@types/react": "^18.2.46",
|
|
85
|
+
"@types/react-dom": "^18.2.18",
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^6.17.0",
|
|
87
|
+
"@typescript-eslint/parser": "^6.17.0",
|
|
88
88
|
"@vitejs/plugin-react": "^4.2.1",
|
|
89
|
-
"eslint": "^8.
|
|
89
|
+
"eslint": "^8.56.0",
|
|
90
90
|
"eslint-plugin-mui-path-imports": "^0.0.15",
|
|
91
91
|
"eslint-plugin-perfectionist": "^2.5.0",
|
|
92
92
|
"prop-types": "^15.8.1",
|
|
@@ -97,11 +97,11 @@
|
|
|
97
97
|
"rollup-plugin-dts": "^6.1.0",
|
|
98
98
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
99
99
|
"size-limit": "^11.0.1",
|
|
100
|
-
"storybook": "^7.
|
|
101
|
-
"storybook-dark-mode": "^3.0.
|
|
100
|
+
"storybook": "^7.6.7",
|
|
101
|
+
"storybook-dark-mode": "^3.0.3",
|
|
102
102
|
"tslib": "^2.6.2",
|
|
103
103
|
"typescript": "^5.3.3",
|
|
104
|
-
"vite": "^5.0.
|
|
104
|
+
"vite": "^5.0.10"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"@emotion/react": ">=11.11",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
},
|
|
115
115
|
"dependencies": {
|
|
116
116
|
"@tanstack/match-sorter-utils": "8.8.4",
|
|
117
|
-
"@tanstack/react-table": "8.
|
|
117
|
+
"@tanstack/react-table": "8.11.2",
|
|
118
118
|
"@tanstack/react-virtual": "3.0.1",
|
|
119
119
|
"highlight-words": "1.2.2"
|
|
120
120
|
}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import { memo,
|
|
2
|
-
import {
|
|
3
|
-
type Range,
|
|
4
|
-
type VirtualItem,
|
|
5
|
-
type Virtualizer,
|
|
6
|
-
useVirtualizer,
|
|
7
|
-
} from '@tanstack/react-virtual';
|
|
1
|
+
import { memo, useMemo } from 'react';
|
|
2
|
+
import { type VirtualItem, type Virtualizer } from '@tanstack/react-virtual';
|
|
8
3
|
import TableBody, { type TableBodyProps } from '@mui/material/TableBody';
|
|
9
4
|
import Typography from '@mui/material/Typography';
|
|
10
5
|
import { MRT_TableBodyRow, Memo_MRT_TableBodyRow } from './MRT_TableBodyRow';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
parseFromValuesOrFunc,
|
|
15
|
-
} from '../column.utils';
|
|
16
|
-
import { rankGlobalFuzzy } from '../sortingFns';
|
|
6
|
+
import { parseFromValuesOrFunc } from '../column.utils';
|
|
7
|
+
import { useMRT_RowVirtualizer } from '../hooks';
|
|
8
|
+
import { useMRT_Rows } from '../hooks/useMRT_Rows';
|
|
17
9
|
import {
|
|
18
10
|
type MRT_Row,
|
|
19
11
|
type MRT_RowData,
|
|
@@ -38,56 +30,30 @@ export const MRT_TableBody = <TData extends MRT_RowData>({
|
|
|
38
30
|
}: Props<TData>) => {
|
|
39
31
|
const {
|
|
40
32
|
getBottomRows,
|
|
41
|
-
getCenterRows,
|
|
42
33
|
getIsSomeRowsPinned,
|
|
43
|
-
getPrePaginationRowModel,
|
|
44
34
|
getRowModel,
|
|
45
35
|
getState,
|
|
46
36
|
getTopRows,
|
|
47
37
|
options: {
|
|
48
38
|
createDisplayMode,
|
|
49
|
-
enableGlobalFilterRankedResults,
|
|
50
|
-
enablePagination,
|
|
51
|
-
enableRowPinning,
|
|
52
|
-
enableRowVirtualization,
|
|
53
39
|
enableStickyFooter,
|
|
54
40
|
enableStickyHeader,
|
|
55
41
|
layoutMode,
|
|
56
42
|
localization,
|
|
57
|
-
manualExpanding,
|
|
58
|
-
manualFiltering,
|
|
59
|
-
manualGrouping,
|
|
60
|
-
manualPagination,
|
|
61
|
-
manualSorting,
|
|
62
43
|
memoMode,
|
|
63
44
|
muiTableBodyProps,
|
|
64
45
|
renderEmptyRowsFallback,
|
|
65
46
|
rowPinningDisplayMode,
|
|
66
|
-
rowVirtualizerInstanceRef,
|
|
67
|
-
rowVirtualizerOptions,
|
|
68
47
|
},
|
|
69
|
-
refs: {
|
|
48
|
+
refs: { tableFooterRef, tableHeadRef, tablePaperRef },
|
|
70
49
|
} = table;
|
|
71
|
-
const {
|
|
72
|
-
|
|
73
|
-
creatingRow,
|
|
74
|
-
density,
|
|
75
|
-
draggingRow,
|
|
76
|
-
expanded,
|
|
77
|
-
globalFilter,
|
|
78
|
-
isFullScreen,
|
|
79
|
-
pagination,
|
|
80
|
-
rowPinning,
|
|
81
|
-
sorting,
|
|
82
|
-
} = getState();
|
|
50
|
+
const { columnFilters, creatingRow, globalFilter, isFullScreen, rowPinning } =
|
|
51
|
+
getState();
|
|
83
52
|
|
|
84
53
|
const tableBodyProps = {
|
|
85
54
|
...parseFromValuesOrFunc(muiTableBodyProps, { table }),
|
|
86
55
|
...rest,
|
|
87
56
|
};
|
|
88
|
-
const rowVirtualizerProps = parseFromValuesOrFunc(rowVirtualizerOptions, {
|
|
89
|
-
table,
|
|
90
|
-
});
|
|
91
57
|
|
|
92
58
|
const tableHeadHeight =
|
|
93
59
|
((enableStickyHeader || isFullScreen) &&
|
|
@@ -96,23 +62,6 @@ export const MRT_TableBody = <TData extends MRT_RowData>({
|
|
|
96
62
|
const tableFooterHeight =
|
|
97
63
|
(enableStickyFooter && tableFooterRef.current?.clientHeight) || 0;
|
|
98
64
|
|
|
99
|
-
const shouldRankRows = useMemo(
|
|
100
|
-
() =>
|
|
101
|
-
getCanRankRows(table) &&
|
|
102
|
-
!Object.values(sorting).some(Boolean) &&
|
|
103
|
-
globalFilter,
|
|
104
|
-
[
|
|
105
|
-
enableGlobalFilterRankedResults,
|
|
106
|
-
expanded,
|
|
107
|
-
globalFilter,
|
|
108
|
-
manualExpanding,
|
|
109
|
-
manualFiltering,
|
|
110
|
-
manualGrouping,
|
|
111
|
-
manualSorting,
|
|
112
|
-
sorting,
|
|
113
|
-
],
|
|
114
|
-
);
|
|
115
|
-
|
|
116
65
|
const pinnedRowIds = useMemo(
|
|
117
66
|
() =>
|
|
118
67
|
getRowModel()
|
|
@@ -121,66 +70,9 @@ export const MRT_TableBody = <TData extends MRT_RowData>({
|
|
|
121
70
|
[rowPinning, table.getRowModel().rows],
|
|
122
71
|
);
|
|
123
72
|
|
|
124
|
-
const rows =
|
|
125
|
-
let rows: MRT_Row<TData>[] = [];
|
|
126
|
-
if (!shouldRankRows) {
|
|
127
|
-
rows =
|
|
128
|
-
!enableRowPinning || rowPinningDisplayMode?.includes('sticky')
|
|
129
|
-
? getRowModel().rows
|
|
130
|
-
: getCenterRows();
|
|
131
|
-
} else {
|
|
132
|
-
rows = getPrePaginationRowModel().rows.sort((a, b) =>
|
|
133
|
-
rankGlobalFuzzy(a, b),
|
|
134
|
-
);
|
|
135
|
-
if (enablePagination && !manualPagination) {
|
|
136
|
-
const start = pagination.pageIndex * pagination.pageSize;
|
|
137
|
-
rows = rows.slice(start, start + pagination.pageSize);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
if (enableRowPinning && rowPinningDisplayMode?.includes('sticky')) {
|
|
141
|
-
rows = [
|
|
142
|
-
...getTopRows().filter((row) => !pinnedRowIds.includes(row.id)),
|
|
143
|
-
...rows,
|
|
144
|
-
...getBottomRows().filter((row) => !pinnedRowIds.includes(row.id)),
|
|
145
|
-
];
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return rows;
|
|
149
|
-
}, [
|
|
150
|
-
shouldRankRows,
|
|
151
|
-
shouldRankRows ? getPrePaginationRowModel().rows : getRowModel().rows,
|
|
152
|
-
pagination.pageIndex,
|
|
153
|
-
pagination.pageSize,
|
|
154
|
-
rowPinning,
|
|
155
|
-
]);
|
|
156
|
-
|
|
157
|
-
const rowVirtualizer:
|
|
158
|
-
| Virtualizer<HTMLDivElement, HTMLTableRowElement>
|
|
159
|
-
| undefined = enableRowVirtualization
|
|
160
|
-
? useVirtualizer({
|
|
161
|
-
count: rows.length,
|
|
162
|
-
estimateSize: () =>
|
|
163
|
-
density === 'compact' ? 37 : density === 'comfortable' ? 58 : 73,
|
|
164
|
-
getScrollElement: () => tableContainerRef.current,
|
|
165
|
-
measureElement:
|
|
166
|
-
typeof window !== 'undefined' &&
|
|
167
|
-
navigator.userAgent.indexOf('Firefox') === -1
|
|
168
|
-
? (element) => element?.getBoundingClientRect().height
|
|
169
|
-
: undefined,
|
|
170
|
-
overscan: 4,
|
|
171
|
-
rangeExtractor: useCallback(
|
|
172
|
-
(range: Range) => {
|
|
173
|
-
return extraIndexRangeExtractor(range, draggingRow?.index ?? 0);
|
|
174
|
-
},
|
|
175
|
-
[draggingRow],
|
|
176
|
-
),
|
|
177
|
-
...rowVirtualizerProps,
|
|
178
|
-
})
|
|
179
|
-
: undefined;
|
|
73
|
+
const rows = useMRT_Rows(table);
|
|
180
74
|
|
|
181
|
-
|
|
182
|
-
rowVirtualizerInstanceRef.current = rowVirtualizer;
|
|
183
|
-
}
|
|
75
|
+
const rowVirtualizer = useMRT_RowVirtualizer(table);
|
|
184
76
|
|
|
185
77
|
const virtualRows = rowVirtualizer
|
|
186
78
|
? rowVirtualizer.getVirtualItems()
|
|
@@ -227,9 +119,10 @@ export const MRT_TableBody = <TData extends MRT_RowData>({
|
|
|
227
119
|
{...tableBodyProps}
|
|
228
120
|
sx={(theme) => ({
|
|
229
121
|
display: layoutMode?.startsWith('grid') ? 'grid' : undefined,
|
|
230
|
-
height:
|
|
231
|
-
|
|
232
|
-
|
|
122
|
+
height:
|
|
123
|
+
rowVirtualizer
|
|
124
|
+
? `${rowVirtualizer.getTotalSize()}px`
|
|
125
|
+
: undefined,
|
|
233
126
|
minHeight: !rows.length ? '100px' : undefined,
|
|
234
127
|
position: 'relative',
|
|
235
128
|
...(parseFromValuesOrFunc(tableBodyProps?.sx, theme) as any),
|
|
@@ -289,11 +182,11 @@ export const MRT_TableBody = <TData extends MRT_RowData>({
|
|
|
289
182
|
};
|
|
290
183
|
return memoMode === 'rows' ? (
|
|
291
184
|
<Memo_MRT_TableBodyRow
|
|
292
|
-
key={`${row.id}
|
|
185
|
+
key={`${row.id}-${row.index}`}
|
|
293
186
|
{...props}
|
|
294
187
|
/>
|
|
295
188
|
) : (
|
|
296
|
-
<MRT_TableBodyRow key={`${row.id}
|
|
189
|
+
<MRT_TableBodyRow key={`${row.id}-${row.index}`} {...props} />
|
|
297
190
|
);
|
|
298
191
|
})}
|
|
299
192
|
</>
|
|
@@ -33,7 +33,7 @@ interface Props<TData extends MRT_RowData> extends TableCellProps {
|
|
|
33
33
|
rowIndex: number;
|
|
34
34
|
rowRef: RefObject<HTMLTableRowElement>;
|
|
35
35
|
table: MRT_TableInstance<TData>;
|
|
36
|
-
|
|
36
|
+
virtualColumnIndex?: number;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
@@ -43,13 +43,14 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
|
43
43
|
rowIndex,
|
|
44
44
|
rowRef,
|
|
45
45
|
table,
|
|
46
|
-
|
|
46
|
+
virtualColumnIndex,
|
|
47
47
|
...rest
|
|
48
48
|
}: Props<TData>) => {
|
|
49
49
|
const theme = useTheme();
|
|
50
50
|
const {
|
|
51
51
|
getState,
|
|
52
52
|
options: {
|
|
53
|
+
columnResizeDirection,
|
|
53
54
|
columnResizeMode,
|
|
54
55
|
createDisplayMode,
|
|
55
56
|
editDisplayMode,
|
|
@@ -119,28 +120,28 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
|
119
120
|
const isFirstColumn = getIsFirstColumn(column, table);
|
|
120
121
|
const isLastColumn = getIsLastColumn(column, table);
|
|
121
122
|
const isLastRow = numRows && rowIndex === numRows - 1;
|
|
123
|
+
const isResizingColumn = columnSizingInfo.isResizingColumn === column.id;
|
|
122
124
|
const showResizeBorder =
|
|
123
|
-
|
|
124
|
-
columnResizeMode === 'onChange';
|
|
125
|
+
isResizingColumn && columnResizeMode === 'onChange';
|
|
125
126
|
|
|
126
127
|
const borderStyle = showResizeBorder
|
|
127
128
|
? `2px solid ${draggingBorderColor} !important`
|
|
128
129
|
: isDraggingColumn || isDraggingRow
|
|
129
130
|
? `1px dashed ${theme.palette.grey[500]} !important`
|
|
130
|
-
: isHoveredColumn ||
|
|
131
|
-
isHoveredRow ||
|
|
132
|
-
columnSizingInfo.isResizingColumn === column.id
|
|
131
|
+
: isHoveredColumn || isHoveredRow || isResizingColumn
|
|
133
132
|
? `2px dashed ${draggingBorderColor} !important`
|
|
134
133
|
: undefined;
|
|
135
134
|
|
|
136
135
|
if (showResizeBorder) {
|
|
137
|
-
return
|
|
136
|
+
return columnResizeDirection === 'ltr'
|
|
137
|
+
? { borderRight: borderStyle }
|
|
138
|
+
: { borderLeft: borderStyle };
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
return borderStyle
|
|
141
142
|
? {
|
|
142
143
|
borderBottom:
|
|
143
|
-
isDraggingRow || isHoveredRow || isLastRow
|
|
144
|
+
isDraggingRow || isHoveredRow || (isLastRow && !isResizingColumn)
|
|
144
145
|
? borderStyle
|
|
145
146
|
: undefined,
|
|
146
147
|
borderLeft:
|
|
@@ -211,7 +212,7 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
|
211
212
|
|
|
212
213
|
return (
|
|
213
214
|
<TableCell
|
|
214
|
-
data-index={
|
|
215
|
+
data-index={virtualColumnIndex}
|
|
215
216
|
ref={(node: HTMLTableCellElement) => {
|
|
216
217
|
if (node) {
|
|
217
218
|
measureElement?.(node);
|
|
@@ -106,10 +106,14 @@ export const MRT_TableBodyRow = <TData extends MRT_RowData>({
|
|
|
106
106
|
|
|
107
107
|
const sx = parseFromValuesOrFunc(tableRowProps?.sx, theme as any);
|
|
108
108
|
|
|
109
|
-
const
|
|
109
|
+
const defaultRowHeight =
|
|
110
|
+
density === 'compact' ? 37 : density === 'comfortable' ? 53 : 69;
|
|
111
|
+
|
|
112
|
+
const customRowHeight =
|
|
110
113
|
// @ts-ignore
|
|
111
|
-
parseInt(tableRowProps?.style?.height ?? sx?.height, 10) ||
|
|
112
|
-
|
|
114
|
+
parseInt(tableRowProps?.style?.height ?? sx?.height, 10) || undefined;
|
|
115
|
+
|
|
116
|
+
const rowHeight = customRowHeight || defaultRowHeight;
|
|
113
117
|
|
|
114
118
|
const handleDragEnter = (_e: DragEvent) => {
|
|
115
119
|
if (enableRowOrdering && draggingRow) {
|
|
@@ -128,7 +132,7 @@ export const MRT_TableBodyRow = <TData extends MRT_RowData>({
|
|
|
128
132
|
return (
|
|
129
133
|
<>
|
|
130
134
|
<TableRow
|
|
131
|
-
data-index={
|
|
135
|
+
data-index={rowIndex}
|
|
132
136
|
data-pinned={!!isPinned || undefined}
|
|
133
137
|
data-selected={row.getIsSelected() || undefined}
|
|
134
138
|
onDragEnter={handleDragEnter}
|
|
@@ -142,7 +146,7 @@ export const MRT_TableBodyRow = <TData extends MRT_RowData>({
|
|
|
142
146
|
{...tableRowProps}
|
|
143
147
|
style={{
|
|
144
148
|
transform: virtualRow
|
|
145
|
-
? `translateY(${virtualRow
|
|
149
|
+
? `translateY(${virtualRow.start}px)`
|
|
146
150
|
: undefined,
|
|
147
151
|
...tableRowProps?.style,
|
|
148
152
|
}}
|
|
@@ -32,6 +32,7 @@ export const MRT_TableHeadCell = <TData extends MRT_RowData>({
|
|
|
32
32
|
getState,
|
|
33
33
|
options: {
|
|
34
34
|
columnFilterDisplayMode,
|
|
35
|
+
columnResizeDirection,
|
|
35
36
|
columnResizeMode,
|
|
36
37
|
enableColumnActions,
|
|
37
38
|
enableColumnDragging,
|
|
@@ -103,7 +104,9 @@ export const MRT_TableHeadCell = <TData extends MRT_RowData>({
|
|
|
103
104
|
: undefined;
|
|
104
105
|
|
|
105
106
|
if (showResizeBorder) {
|
|
106
|
-
return
|
|
107
|
+
return columnResizeDirection === 'ltr'
|
|
108
|
+
? { borderRight: borderStyle }
|
|
109
|
+
: { borderLeft: borderStyle };
|
|
107
110
|
}
|
|
108
111
|
const draggingBorders = borderStyle
|
|
109
112
|
? {
|