material-react-table 2.9.2 → 2.11.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/README.md +3 -2
- package/dist/index.d.ts +222 -152
- package/dist/index.esm.js +906 -769
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +910 -768
- package/dist/index.js.map +1 -1
- package/locales/ar/index.esm.js +2 -0
- package/locales/ar/index.js +2 -0
- package/locales/az/index.esm.js +2 -0
- package/locales/az/index.js +2 -0
- package/locales/bg/index.esm.js +2 -0
- package/locales/bg/index.js +2 -0
- package/locales/cs/index.esm.js +2 -0
- package/locales/cs/index.js +2 -0
- package/locales/da/index.esm.js +2 -0
- package/locales/da/index.js +2 -0
- package/locales/de/index.esm.js +2 -0
- package/locales/de/index.js +2 -0
- package/locales/en/index.esm.js +2 -0
- package/locales/en/index.js +2 -0
- package/locales/es/index.esm.js +2 -0
- package/locales/es/index.js +2 -0
- package/locales/et/index.esm.js +2 -0
- package/locales/et/index.js +2 -0
- package/locales/fa/index.esm.js +2 -0
- package/locales/fa/index.js +2 -0
- package/locales/fi/index.esm.js +2 -0
- package/locales/fi/index.js +2 -0
- package/locales/fr/index.esm.js +2 -0
- package/locales/fr/index.js +2 -0
- package/locales/he/index.esm.js +2 -0
- package/locales/he/index.js +2 -0
- package/locales/hu/index.esm.js +2 -0
- package/locales/hu/index.js +2 -0
- package/locales/hy/index.esm.js +2 -0
- package/locales/hy/index.js +2 -0
- package/locales/id/index.esm.js +2 -0
- package/locales/id/index.js +2 -0
- package/locales/it/index.esm.js +2 -0
- package/locales/it/index.js +2 -0
- package/locales/ja/index.esm.js +2 -0
- package/locales/ja/index.js +2 -0
- package/locales/ko/index.esm.js +2 -0
- package/locales/ko/index.js +2 -0
- package/locales/nl/index.esm.js +2 -0
- package/locales/nl/index.js +2 -0
- package/locales/no/index.esm.js +2 -0
- package/locales/no/index.js +2 -0
- package/locales/np/index.esm.js +2 -0
- package/locales/np/index.js +2 -0
- package/locales/pl/index.esm.js +2 -0
- package/locales/pl/index.js +2 -0
- package/locales/pt/index.esm.js +2 -0
- package/locales/pt/index.js +2 -0
- package/locales/pt-BR/index.esm.js +2 -0
- package/locales/pt-BR/index.js +2 -0
- package/locales/ro/index.esm.js +2 -0
- package/locales/ro/index.js +2 -0
- package/locales/ru/index.esm.js +2 -0
- package/locales/ru/index.js +2 -0
- package/locales/sk/index.esm.js +2 -0
- package/locales/sk/index.js +2 -0
- package/locales/sr-Cyrl-RS/index.esm.js +2 -0
- package/locales/sr-Cyrl-RS/index.js +2 -0
- package/locales/sr-Latn-RS/index.esm.js +2 -0
- package/locales/sr-Latn-RS/index.js +2 -0
- package/locales/sv/index.esm.js +2 -0
- package/locales/sv/index.js +2 -0
- package/locales/tr/index.esm.js +2 -0
- package/locales/tr/index.js +2 -0
- package/locales/uk/index.esm.js +2 -0
- package/locales/uk/index.js +2 -0
- package/locales/vi/index.esm.js +2 -0
- package/locales/vi/index.js +2 -0
- package/locales/zh-Hans/index.esm.js +2 -0
- package/locales/zh-Hans/index.js +2 -0
- package/locales/zh-Hant/index.esm.js +2 -0
- package/locales/zh-Hant/index.js +2 -0
- package/package.json +20 -20
- package/src/components/MaterialReactTable.tsx +3 -3
- package/src/components/body/MRT_TableBody.tsx +3 -2
- package/src/components/body/MRT_TableBodyCell.tsx +45 -34
- package/src/components/body/MRT_TableBodyCellValue.tsx +5 -2
- package/src/components/body/MRT_TableBodyRow.tsx +13 -12
- package/src/components/body/MRT_TableBodyRowGrabHandle.tsx +4 -3
- package/src/components/body/MRT_TableBodyRowPinButton.tsx +3 -2
- package/src/components/body/MRT_TableDetailPanel.tsx +3 -2
- package/src/components/buttons/MRT_ColumnPinningButtons.tsx +3 -2
- package/src/components/buttons/MRT_CopyButton.tsx +4 -2
- package/src/components/buttons/MRT_EditActionButtons.tsx +3 -2
- package/src/components/buttons/MRT_ExpandAllButton.tsx +3 -2
- package/src/components/buttons/MRT_ExpandButton.tsx +3 -2
- package/src/components/buttons/MRT_GrabHandleButton.tsx +9 -15
- package/src/components/buttons/MRT_RowPinButton.tsx +3 -2
- package/src/components/buttons/MRT_ShowHideColumnsButton.tsx +3 -2
- package/src/components/buttons/MRT_ToggleDensePaddingButton.tsx +3 -2
- package/src/components/buttons/MRT_ToggleFiltersButton.tsx +3 -2
- package/src/components/buttons/MRT_ToggleFullScreenButton.tsx +3 -2
- package/src/components/buttons/MRT_ToggleGlobalFilterButton.tsx +3 -2
- package/src/components/buttons/MRT_ToggleRowActionMenuButton.tsx +3 -2
- package/src/components/footer/MRT_TableFooter.tsx +3 -2
- package/src/components/footer/MRT_TableFooterCell.tsx +3 -2
- package/src/components/footer/MRT_TableFooterRow.tsx +5 -3
- package/src/components/head/MRT_TableHead.tsx +3 -2
- package/src/components/head/MRT_TableHeadCell.tsx +9 -5
- package/src/components/head/MRT_TableHeadCellColumnActionsButton.tsx +4 -2
- package/src/components/head/MRT_TableHeadCellFilterContainer.tsx +4 -2
- package/src/components/head/MRT_TableHeadCellFilterLabel.tsx +4 -2
- package/src/components/head/MRT_TableHeadCellGrabHandle.tsx +4 -3
- package/src/components/head/MRT_TableHeadCellResizeHandle.tsx +3 -2
- package/src/components/head/MRT_TableHeadCellSortLabel.tsx +3 -2
- package/src/components/head/MRT_TableHeadRow.tsx +4 -2
- package/src/components/inputs/MRT_EditCellTextField.tsx +3 -2
- package/src/components/inputs/MRT_FilterCheckbox.tsx +3 -2
- package/src/components/inputs/MRT_FilterRangeFields.tsx +3 -2
- package/src/components/inputs/MRT_FilterRangeSlider.tsx +3 -2
- package/src/components/inputs/MRT_FilterTextField.tsx +15 -6
- package/src/components/inputs/MRT_GlobalFilterTextField.tsx +3 -2
- package/src/components/inputs/MRT_SelectCheckbox.tsx +26 -33
- package/src/components/menus/MRT_ActionMenuItem.tsx +61 -0
- package/src/components/menus/MRT_CellActionMenu.tsx +109 -0
- package/src/components/menus/MRT_ColumnActionMenu.tsx +92 -172
- package/src/components/menus/MRT_FilterOptionMenu.tsx +9 -16
- package/src/components/menus/MRT_RowActionMenu.tsx +10 -17
- package/src/components/menus/MRT_ShowHideColumnsMenu.tsx +11 -3
- package/src/components/menus/MRT_ShowHideColumnsMenuItems.tsx +7 -5
- package/src/components/modals/MRT_EditRowModal.tsx +3 -2
- package/src/components/table/MRT_Table.tsx +2 -2
- package/src/components/table/MRT_TableContainer.tsx +7 -2
- package/src/components/table/MRT_TableLoadingOverlay.tsx +11 -8
- package/src/components/table/MRT_TablePaper.tsx +3 -2
- package/src/components/toolbar/MRT_BottomToolbar.tsx +3 -2
- package/src/components/toolbar/MRT_LinearProgressBar.tsx +3 -2
- package/src/components/toolbar/MRT_TablePagination.tsx +2 -2
- package/src/components/toolbar/MRT_ToolbarAlertBanner.tsx +30 -13
- package/src/components/toolbar/MRT_ToolbarDropZone.tsx +3 -2
- package/src/components/toolbar/MRT_ToolbarInternalButtons.tsx +3 -2
- package/src/components/toolbar/MRT_TopToolbar.tsx +2 -2
- package/src/hooks/display-columns/getMRT_RowActionsColumnDef.tsx +1 -8
- package/src/hooks/display-columns/getMRT_RowDragColumnDef.tsx +1 -8
- package/src/hooks/display-columns/getMRT_RowExpandColumnDef.tsx +1 -8
- package/src/hooks/display-columns/getMRT_RowNumbersColumnDef.tsx +1 -8
- package/src/hooks/display-columns/getMRT_RowPinningColumnDef.tsx +1 -8
- package/src/hooks/display-columns/getMRT_RowSelectColumnDef.tsx +1 -8
- package/src/hooks/display-columns/getMRT_RowSpacerColumnDef.tsx +1 -8
- package/src/hooks/useMRT_Effects.ts +14 -4
- package/src/hooks/useMRT_Rows.ts +11 -79
- package/src/hooks/useMRT_TableInstance.ts +114 -59
- package/src/hooks/useMRT_TableOptions.ts +2 -0
- package/src/icons.ts +2 -0
- package/src/index.ts +2 -0
- package/src/locales/ar.ts +2 -0
- package/src/locales/az.ts +2 -0
- package/src/locales/bg.ts +2 -0
- package/src/locales/cs.ts +2 -0
- package/src/locales/da.ts +2 -0
- package/src/locales/de.ts +2 -0
- package/src/locales/en.ts +2 -0
- package/src/locales/es.ts +2 -0
- package/src/locales/et.ts +2 -0
- package/src/locales/fa.ts +2 -0
- package/src/locales/fi.ts +2 -0
- package/src/locales/fr.ts +2 -0
- package/src/locales/he.ts +2 -0
- package/src/locales/hu.ts +2 -0
- package/src/locales/hy.ts +2 -0
- package/src/locales/id.ts +2 -0
- package/src/locales/it.ts +2 -0
- package/src/locales/ja.ts +2 -0
- package/src/locales/ko.ts +2 -0
- package/src/locales/nl.ts +2 -0
- package/src/locales/no.ts +2 -0
- package/src/locales/np.ts +2 -0
- package/src/locales/pl.ts +2 -0
- package/src/locales/pt-BR.ts +2 -0
- package/src/locales/pt.ts +2 -0
- package/src/locales/ro.ts +2 -0
- package/src/locales/ru.ts +2 -0
- package/src/locales/sk.ts +2 -0
- package/src/locales/sr-Cyrl-RS.ts +2 -0
- package/src/locales/sr-Latn-RS.ts +2 -0
- package/src/locales/sv.ts +2 -0
- package/src/locales/tr.ts +2 -0
- package/src/locales/uk.ts +2 -0
- package/src/locales/vi.ts +2 -0
- package/src/locales/zh-Hans.ts +2 -0
- package/src/locales/zh-Hant.ts +2 -0
- package/src/types.ts +51 -13
- package/src/utils/cell.utils.ts +50 -0
- package/src/utils/column.utils.ts +4 -6
- package/src/utils/displayColumn.utils.ts +39 -21
- package/src/utils/row.utils.ts +179 -21
- package/locales/am/index.d.ts +0 -3
- package/locales/am/index.esm.d.ts +0 -3
- package/locales/am/index.esm.js +0 -93
- package/locales/am/index.js +0 -97
- package/locales/am/package.json +0 -6
- package/src/hooks/display-columns/getMRT_DisplayColumns.tsx +0 -26
- package/src/locales/am.ts +0 -94
package/locales/ru/index.esm.js
CHANGED
|
@@ -6,8 +6,10 @@ const MRT_Localization_RU = {
|
|
|
6
6
|
changeSearchMode: 'Изменить режим поиска',
|
|
7
7
|
clearFilter: 'Очистить фильтр',
|
|
8
8
|
clearSearch: 'Очистить поиск',
|
|
9
|
+
clearSelection: 'Очистить выбор',
|
|
9
10
|
clearSort: 'Очистить сортировку',
|
|
10
11
|
clickToCopy: 'Нажмите, чтобы скопировать',
|
|
12
|
+
copy: 'Копировать',
|
|
11
13
|
columnActions: 'Действие колонки',
|
|
12
14
|
copiedToClipboard: 'Скопировано в буфер обмена',
|
|
13
15
|
collapse: 'Свернуть',
|
package/locales/ru/index.js
CHANGED
|
@@ -10,8 +10,10 @@ const MRT_Localization_RU = {
|
|
|
10
10
|
changeSearchMode: 'Изменить режим поиска',
|
|
11
11
|
clearFilter: 'Очистить фильтр',
|
|
12
12
|
clearSearch: 'Очистить поиск',
|
|
13
|
+
clearSelection: 'Очистить выбор',
|
|
13
14
|
clearSort: 'Очистить сортировку',
|
|
14
15
|
clickToCopy: 'Нажмите, чтобы скопировать',
|
|
16
|
+
copy: 'Копировать',
|
|
15
17
|
columnActions: 'Действие колонки',
|
|
16
18
|
copiedToClipboard: 'Скопировано в буфер обмена',
|
|
17
19
|
collapse: 'Свернуть',
|
package/locales/sk/index.esm.js
CHANGED
|
@@ -6,8 +6,10 @@ const MRT_Localization_SK = {
|
|
|
6
6
|
changeSearchMode: 'Zmeniť režim hľadania',
|
|
7
7
|
clearFilter: 'Vyčistiť filter',
|
|
8
8
|
clearSearch: 'Vyčistiť hľadanie',
|
|
9
|
+
clearSelection: 'Vyčistiť výber',
|
|
9
10
|
clearSort: 'Vyčistiť zoradenie',
|
|
10
11
|
clickToCopy: 'Kliknutím skopírovať',
|
|
12
|
+
copy: 'Kopírovať',
|
|
11
13
|
collapse: 'Zbaliť',
|
|
12
14
|
collapseAll: 'Zbaliť všetko',
|
|
13
15
|
columnActions: 'Akcie stĺpca',
|
package/locales/sk/index.js
CHANGED
|
@@ -10,8 +10,10 @@ const MRT_Localization_SK = {
|
|
|
10
10
|
changeSearchMode: 'Zmeniť režim hľadania',
|
|
11
11
|
clearFilter: 'Vyčistiť filter',
|
|
12
12
|
clearSearch: 'Vyčistiť hľadanie',
|
|
13
|
+
clearSelection: 'Vyčistiť výber',
|
|
13
14
|
clearSort: 'Vyčistiť zoradenie',
|
|
14
15
|
clickToCopy: 'Kliknutím skopírovať',
|
|
16
|
+
copy: 'Kopírovať',
|
|
15
17
|
collapse: 'Zbaliť',
|
|
16
18
|
collapseAll: 'Zbaliť všetko',
|
|
17
19
|
columnActions: 'Akcie stĺpca',
|
|
@@ -6,8 +6,10 @@ const MRT_Localization_SR_CYRL_RS = {
|
|
|
6
6
|
changeSearchMode: 'Промени режим претраге',
|
|
7
7
|
clearFilter: 'Поништи филтер',
|
|
8
8
|
clearSearch: 'Поништи претрагу',
|
|
9
|
+
clearSelection: 'Поништи избор',
|
|
9
10
|
clearSort: 'Поништи сортирање',
|
|
10
11
|
clickToCopy: 'Кликни да копираш',
|
|
12
|
+
copy: 'Копирај',
|
|
11
13
|
collapse: 'Рашири',
|
|
12
14
|
collapseAll: 'Рашири све',
|
|
13
15
|
columnActions: 'Акције над колонама',
|
|
@@ -10,8 +10,10 @@ const MRT_Localization_SR_CYRL_RS = {
|
|
|
10
10
|
changeSearchMode: 'Промени режим претраге',
|
|
11
11
|
clearFilter: 'Поништи филтер',
|
|
12
12
|
clearSearch: 'Поништи претрагу',
|
|
13
|
+
clearSelection: 'Поништи избор',
|
|
13
14
|
clearSort: 'Поништи сортирање',
|
|
14
15
|
clickToCopy: 'Кликни да копираш',
|
|
16
|
+
copy: 'Копирај',
|
|
15
17
|
collapse: 'Рашири',
|
|
16
18
|
collapseAll: 'Рашири све',
|
|
17
19
|
columnActions: 'Акције над колонама',
|
|
@@ -6,8 +6,10 @@ const MRT_Localization_SR_LATN_RS = {
|
|
|
6
6
|
changeSearchMode: 'Promeni režim pretrage',
|
|
7
7
|
clearFilter: 'Poništi filter',
|
|
8
8
|
clearSearch: 'Poništi pretragu',
|
|
9
|
+
clearSelection: 'Poništi izbor',
|
|
9
10
|
clearSort: 'Poništi sortiranje',
|
|
10
11
|
clickToCopy: 'Klikni da kopiraš',
|
|
12
|
+
copy: 'Kopiraj',
|
|
11
13
|
collapse: 'Raširi',
|
|
12
14
|
collapseAll: 'Raširi sve',
|
|
13
15
|
columnActions: 'Akcije nad kolonama',
|
|
@@ -10,8 +10,10 @@ const MRT_Localization_SR_LATN_RS = {
|
|
|
10
10
|
changeSearchMode: 'Promeni režim pretrage',
|
|
11
11
|
clearFilter: 'Poništi filter',
|
|
12
12
|
clearSearch: 'Poništi pretragu',
|
|
13
|
+
clearSelection: 'Poništi izbor',
|
|
13
14
|
clearSort: 'Poništi sortiranje',
|
|
14
15
|
clickToCopy: 'Klikni da kopiraš',
|
|
16
|
+
copy: 'Kopiraj',
|
|
15
17
|
collapse: 'Raširi',
|
|
16
18
|
collapseAll: 'Raširi sve',
|
|
17
19
|
columnActions: 'Akcije nad kolonama',
|
package/locales/sv/index.esm.js
CHANGED
|
@@ -6,8 +6,10 @@ const MRT_Localization_SV = {
|
|
|
6
6
|
changeSearchMode: 'Ändra sökläge',
|
|
7
7
|
clearFilter: 'Rensa filter',
|
|
8
8
|
clearSearch: 'Rensa sök',
|
|
9
|
+
clearSelection: 'Rensa val',
|
|
9
10
|
clearSort: 'Rensa sortering',
|
|
10
11
|
clickToCopy: 'Klicka för att kopiera',
|
|
12
|
+
copy: 'Kopiera',
|
|
11
13
|
collapse: 'Stäng',
|
|
12
14
|
collapseAll: 'Stäng alla',
|
|
13
15
|
columnActions: 'Kolumnåtgärd',
|
package/locales/sv/index.js
CHANGED
|
@@ -10,8 +10,10 @@ const MRT_Localization_SV = {
|
|
|
10
10
|
changeSearchMode: 'Ändra sökläge',
|
|
11
11
|
clearFilter: 'Rensa filter',
|
|
12
12
|
clearSearch: 'Rensa sök',
|
|
13
|
+
clearSelection: 'Rensa val',
|
|
13
14
|
clearSort: 'Rensa sortering',
|
|
14
15
|
clickToCopy: 'Klicka för att kopiera',
|
|
16
|
+
copy: 'Kopiera',
|
|
15
17
|
collapse: 'Stäng',
|
|
16
18
|
collapseAll: 'Stäng alla',
|
|
17
19
|
columnActions: 'Kolumnåtgärd',
|
package/locales/tr/index.esm.js
CHANGED
|
@@ -6,8 +6,10 @@ const MRT_Localization_TR = {
|
|
|
6
6
|
changeSearchMode: 'Arama Modunu Değiştir',
|
|
7
7
|
clearFilter: 'Filtreyi Temizle',
|
|
8
8
|
clearSearch: 'Aramayı Temizle',
|
|
9
|
+
clearSelection: 'Seçimi Temizle',
|
|
9
10
|
clearSort: 'Sıralamayı Sıfırla',
|
|
10
11
|
clickToCopy: 'Kopyala',
|
|
12
|
+
copy: 'Kopyala',
|
|
11
13
|
columnActions: 'Sütun İşlemleri',
|
|
12
14
|
copiedToClipboard: 'Panoya Kopyalandı',
|
|
13
15
|
collapse: 'Daralt',
|
package/locales/tr/index.js
CHANGED
|
@@ -10,8 +10,10 @@ const MRT_Localization_TR = {
|
|
|
10
10
|
changeSearchMode: 'Arama Modunu Değiştir',
|
|
11
11
|
clearFilter: 'Filtreyi Temizle',
|
|
12
12
|
clearSearch: 'Aramayı Temizle',
|
|
13
|
+
clearSelection: 'Seçimi Temizle',
|
|
13
14
|
clearSort: 'Sıralamayı Sıfırla',
|
|
14
15
|
clickToCopy: 'Kopyala',
|
|
16
|
+
copy: 'Kopyala',
|
|
15
17
|
columnActions: 'Sütun İşlemleri',
|
|
16
18
|
copiedToClipboard: 'Panoya Kopyalandı',
|
|
17
19
|
collapse: 'Daralt',
|
package/locales/uk/index.esm.js
CHANGED
|
@@ -6,8 +6,10 @@ const MRT_Localization_UK = {
|
|
|
6
6
|
changeSearchMode: 'Змінити режим пошуку',
|
|
7
7
|
clearFilter: 'Очистити фільтр',
|
|
8
8
|
clearSearch: 'Очистити пошук',
|
|
9
|
+
clearSelection: 'Скасувати вибір',
|
|
9
10
|
clearSort: 'Очистити сортування',
|
|
10
11
|
clickToCopy: 'Натисніть, щоб скопіювати',
|
|
12
|
+
copy: 'Копіювати',
|
|
11
13
|
collapse: 'Згорнути',
|
|
12
14
|
collapseAll: 'Згорнути все',
|
|
13
15
|
columnActions: 'Дії стовпця',
|
package/locales/uk/index.js
CHANGED
|
@@ -10,8 +10,10 @@ const MRT_Localization_UK = {
|
|
|
10
10
|
changeSearchMode: 'Змінити режим пошуку',
|
|
11
11
|
clearFilter: 'Очистити фільтр',
|
|
12
12
|
clearSearch: 'Очистити пошук',
|
|
13
|
+
clearSelection: 'Скасувати вибір',
|
|
13
14
|
clearSort: 'Очистити сортування',
|
|
14
15
|
clickToCopy: 'Натисніть, щоб скопіювати',
|
|
16
|
+
copy: 'Копіювати',
|
|
15
17
|
collapse: 'Згорнути',
|
|
16
18
|
collapseAll: 'Згорнути все',
|
|
17
19
|
columnActions: 'Дії стовпця',
|
package/locales/vi/index.esm.js
CHANGED
|
@@ -6,8 +6,10 @@ const MRT_Localization_VI = {
|
|
|
6
6
|
changeSearchMode: 'Thay đổi chế độ tìm kiếm',
|
|
7
7
|
clearFilter: 'Xoá bộ lọc',
|
|
8
8
|
clearSearch: 'Xoá ô tìm kiếm',
|
|
9
|
+
clearSelection: 'Xoá lựa chọn',
|
|
9
10
|
clearSort: 'Huỷ sắp xếp',
|
|
10
11
|
clickToCopy: 'Nhấn vào để sao chép',
|
|
12
|
+
copy: 'Sao chép',
|
|
11
13
|
columnActions: 'Lựa chọn',
|
|
12
14
|
copiedToClipboard: 'Sao chép vào bảng tạm',
|
|
13
15
|
collapse: 'Thu gọn',
|
package/locales/vi/index.js
CHANGED
|
@@ -10,8 +10,10 @@ const MRT_Localization_VI = {
|
|
|
10
10
|
changeSearchMode: 'Thay đổi chế độ tìm kiếm',
|
|
11
11
|
clearFilter: 'Xoá bộ lọc',
|
|
12
12
|
clearSearch: 'Xoá ô tìm kiếm',
|
|
13
|
+
clearSelection: 'Xoá lựa chọn',
|
|
13
14
|
clearSort: 'Huỷ sắp xếp',
|
|
14
15
|
clickToCopy: 'Nhấn vào để sao chép',
|
|
16
|
+
copy: 'Sao chép',
|
|
15
17
|
columnActions: 'Lựa chọn',
|
|
16
18
|
copiedToClipboard: 'Sao chép vào bảng tạm',
|
|
17
19
|
collapse: 'Thu gọn',
|
|
@@ -6,8 +6,10 @@ const MRT_Localization_ZH_HANS = {
|
|
|
6
6
|
changeSearchMode: '更改搜索模式',
|
|
7
7
|
clearFilter: '清除过滤',
|
|
8
8
|
clearSearch: '清除搜索',
|
|
9
|
+
clearSelection: '清除选择',
|
|
9
10
|
clearSort: '清除排序',
|
|
10
11
|
clickToCopy: '点击以复制',
|
|
12
|
+
copy: '复制',
|
|
11
13
|
collapse: '折叠',
|
|
12
14
|
collapseAll: '全部折叠',
|
|
13
15
|
columnActions: '列操作',
|
package/locales/zh-Hans/index.js
CHANGED
|
@@ -10,8 +10,10 @@ const MRT_Localization_ZH_HANS = {
|
|
|
10
10
|
changeSearchMode: '更改搜索模式',
|
|
11
11
|
clearFilter: '清除过滤',
|
|
12
12
|
clearSearch: '清除搜索',
|
|
13
|
+
clearSelection: '清除选择',
|
|
13
14
|
clearSort: '清除排序',
|
|
14
15
|
clickToCopy: '点击以复制',
|
|
16
|
+
copy: '复制',
|
|
15
17
|
collapse: '折叠',
|
|
16
18
|
collapseAll: '全部折叠',
|
|
17
19
|
columnActions: '列操作',
|
|
@@ -6,8 +6,10 @@ const MRT_Localization_ZH_HANT = {
|
|
|
6
6
|
changeSearchMode: '更改搜尋模式',
|
|
7
7
|
clearFilter: '清除過濾',
|
|
8
8
|
clearSearch: '清除搜尋',
|
|
9
|
+
clearSelection: '清除選擇',
|
|
9
10
|
clearSort: '清除排序',
|
|
10
11
|
clickToCopy: '點擊以複製',
|
|
12
|
+
copy: '複製',
|
|
11
13
|
collapse: '折疊',
|
|
12
14
|
collapseAll: '全部折疊',
|
|
13
15
|
columnActions: '欄位動作',
|
package/locales/zh-Hant/index.js
CHANGED
|
@@ -10,8 +10,10 @@ const MRT_Localization_ZH_HANT = {
|
|
|
10
10
|
changeSearchMode: '更改搜尋模式',
|
|
11
11
|
clearFilter: '清除過濾',
|
|
12
12
|
clearSearch: '清除搜尋',
|
|
13
|
+
clearSelection: '清除選擇',
|
|
13
14
|
clearSort: '清除排序',
|
|
14
15
|
clickToCopy: '點擊以複製',
|
|
16
|
+
copy: '複製',
|
|
15
17
|
collapse: '折疊',
|
|
16
18
|
collapseAll: '全部折疊',
|
|
17
19
|
columnActions: '欄位動作',
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.11.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.",
|
|
@@ -66,25 +66,25 @@
|
|
|
66
66
|
"@emotion/react": "^11.11.3",
|
|
67
67
|
"@emotion/styled": "^11.11.0",
|
|
68
68
|
"@faker-js/faker": "^8.4.0",
|
|
69
|
-
"@mui/icons-material": "^5.15.
|
|
70
|
-
"@mui/material": "^5.15.
|
|
71
|
-
"@mui/x-date-pickers": "^6.19.
|
|
69
|
+
"@mui/icons-material": "^5.15.7",
|
|
70
|
+
"@mui/material": "^5.15.7",
|
|
71
|
+
"@mui/x-date-pickers": "^6.19.3",
|
|
72
72
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
73
73
|
"@size-limit/preset-small-lib": "^11.0.2",
|
|
74
|
-
"@storybook/addon-a11y": "^7.6.
|
|
75
|
-
"@storybook/addon-essentials": "^7.6.
|
|
76
|
-
"@storybook/addon-interactions": "^7.6.
|
|
77
|
-
"@storybook/addon-links": "^7.6.
|
|
78
|
-
"@storybook/addon-storysource": "^7.6.
|
|
79
|
-
"@storybook/blocks": "^7.6.
|
|
80
|
-
"@storybook/react": "^7.6.
|
|
81
|
-
"@storybook/react-vite": "^7.6.
|
|
74
|
+
"@storybook/addon-a11y": "^7.6.12",
|
|
75
|
+
"@storybook/addon-essentials": "^7.6.12",
|
|
76
|
+
"@storybook/addon-interactions": "^7.6.12",
|
|
77
|
+
"@storybook/addon-links": "^7.6.12",
|
|
78
|
+
"@storybook/addon-storysource": "^7.6.12",
|
|
79
|
+
"@storybook/blocks": "^7.6.12",
|
|
80
|
+
"@storybook/react": "^7.6.12",
|
|
81
|
+
"@storybook/react-vite": "^7.6.12",
|
|
82
82
|
"@storybook/testing-library": "^0.2.2",
|
|
83
|
-
"@types/node": "^20.11.
|
|
84
|
-
"@types/react": "^18.2.
|
|
83
|
+
"@types/node": "^20.11.16",
|
|
84
|
+
"@types/react": "^18.2.52",
|
|
85
85
|
"@types/react-dom": "^18.2.18",
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
87
|
-
"@typescript-eslint/parser": "^6.
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^6.20.0",
|
|
87
|
+
"@typescript-eslint/parser": "^6.20.0",
|
|
88
88
|
"@vitejs/plugin-react": "^4.2.1",
|
|
89
89
|
"eslint": "^8.56.0",
|
|
90
90
|
"eslint-plugin-mui-path-imports": "^0.0.15",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"rollup-plugin-dts": "^6.1.0",
|
|
100
100
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
101
101
|
"size-limit": "^11.0.2",
|
|
102
|
-
"storybook": "^7.6.
|
|
102
|
+
"storybook": "^7.6.12",
|
|
103
103
|
"storybook-dark-mode": "^3.0.3",
|
|
104
104
|
"tslib": "^2.6.2",
|
|
105
105
|
"typescript": "^5.3.3",
|
|
@@ -115,9 +115,9 @@
|
|
|
115
115
|
"react-dom": ">=18.0"
|
|
116
116
|
},
|
|
117
117
|
"dependencies": {
|
|
118
|
-
"@tanstack/match-sorter-utils": "8.11.
|
|
119
|
-
"@tanstack/react-table": "8.11.
|
|
120
|
-
"@tanstack/react-virtual": "3.0.
|
|
118
|
+
"@tanstack/match-sorter-utils": "8.11.8",
|
|
119
|
+
"@tanstack/react-table": "8.11.8",
|
|
120
|
+
"@tanstack/react-virtual": "3.0.4",
|
|
121
121
|
"highlight-words": "1.2.2"
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -11,18 +11,18 @@ type TableInstanceProp<TData extends MRT_RowData> = {
|
|
|
11
11
|
table: MRT_TableInstance<TData>;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
type
|
|
14
|
+
export type MaterialReactTableProps<TData extends MRT_RowData> = Xor<
|
|
15
15
|
TableInstanceProp<TData>,
|
|
16
16
|
MRT_TableOptions<TData>
|
|
17
17
|
>;
|
|
18
18
|
|
|
19
19
|
const isTableInstanceProp = <TData extends MRT_RowData>(
|
|
20
|
-
props:
|
|
20
|
+
props: MaterialReactTableProps<TData>,
|
|
21
21
|
): props is TableInstanceProp<TData> =>
|
|
22
22
|
(props as TableInstanceProp<TData>).table !== undefined;
|
|
23
23
|
|
|
24
24
|
export const MaterialReactTable = <TData extends MRT_RowData>(
|
|
25
|
-
props:
|
|
25
|
+
props: MaterialReactTableProps<TData>,
|
|
26
26
|
) => {
|
|
27
27
|
let table: MRT_TableInstance<TData>;
|
|
28
28
|
|
|
@@ -13,7 +13,8 @@ import {
|
|
|
13
13
|
} from '../../types';
|
|
14
14
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
15
15
|
|
|
16
|
-
interface
|
|
16
|
+
export interface MRT_TableBodyProps<TData extends MRT_RowData>
|
|
17
|
+
extends TableBodyProps {
|
|
17
18
|
columnVirtualizer?: MRT_ColumnVirtualizer;
|
|
18
19
|
table: MRT_TableInstance<TData>;
|
|
19
20
|
}
|
|
@@ -22,7 +23,7 @@ export const MRT_TableBody = <TData extends MRT_RowData>({
|
|
|
22
23
|
columnVirtualizer,
|
|
23
24
|
table,
|
|
24
25
|
...rest
|
|
25
|
-
}:
|
|
26
|
+
}: MRT_TableBodyProps<TData>) => {
|
|
26
27
|
const {
|
|
27
28
|
getBottomRows,
|
|
28
29
|
getIsSomeRowsPinned,
|
|
@@ -16,15 +16,16 @@ import {
|
|
|
16
16
|
type MRT_RowData,
|
|
17
17
|
type MRT_TableInstance,
|
|
18
18
|
} from '../../types';
|
|
19
|
+
import { isCellEditable, openEditingCell } from '../../utils/cell.utils';
|
|
19
20
|
import { getIsFirstColumn, getIsLastColumn } from '../../utils/column.utils';
|
|
20
21
|
import { getCommonMRTCellStyles, getMRTTheme } from '../../utils/style.utils';
|
|
21
22
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
22
23
|
import { MRT_CopyButton } from '../buttons/MRT_CopyButton';
|
|
23
24
|
import { MRT_EditCellTextField } from '../inputs/MRT_EditCellTextField';
|
|
24
25
|
|
|
25
|
-
interface
|
|
26
|
+
export interface MRT_TableBodyCellProps<TData extends MRT_RowData>
|
|
27
|
+
extends TableCellProps {
|
|
26
28
|
cell: MRT_Cell<TData>;
|
|
27
|
-
measureElement?: (element: HTMLTableCellElement) => void;
|
|
28
29
|
numRows?: number;
|
|
29
30
|
rowRef: RefObject<HTMLTableRowElement>;
|
|
30
31
|
staticColumnIndex?: number;
|
|
@@ -34,14 +35,13 @@ interface Props<TData extends MRT_RowData> extends TableCellProps {
|
|
|
34
35
|
|
|
35
36
|
export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
36
37
|
cell,
|
|
37
|
-
measureElement,
|
|
38
38
|
numRows,
|
|
39
39
|
rowRef,
|
|
40
40
|
staticColumnIndex,
|
|
41
41
|
staticRowIndex,
|
|
42
42
|
table,
|
|
43
43
|
...rest
|
|
44
|
-
}:
|
|
44
|
+
}: MRT_TableBodyCellProps<TData>) => {
|
|
45
45
|
const theme = useTheme();
|
|
46
46
|
const {
|
|
47
47
|
getState,
|
|
@@ -50,20 +50,19 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
|
50
50
|
columnResizeMode,
|
|
51
51
|
createDisplayMode,
|
|
52
52
|
editDisplayMode,
|
|
53
|
+
enableCellActions,
|
|
53
54
|
enableClickToCopy,
|
|
54
55
|
enableColumnOrdering,
|
|
55
56
|
enableColumnPinning,
|
|
56
|
-
enableEditing,
|
|
57
57
|
enableGrouping,
|
|
58
58
|
layoutMode,
|
|
59
59
|
muiSkeletonProps,
|
|
60
60
|
muiTableBodyCellProps,
|
|
61
61
|
},
|
|
62
|
-
refs: { editInputRefs },
|
|
63
|
-
setEditingCell,
|
|
64
62
|
setHoveredColumn,
|
|
65
63
|
} = table;
|
|
66
64
|
const {
|
|
65
|
+
actionCell,
|
|
67
66
|
columnSizingInfo,
|
|
68
67
|
creatingRow,
|
|
69
68
|
density,
|
|
@@ -168,10 +167,7 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
|
168
167
|
columnDef.columnDefType !== 'group' &&
|
|
169
168
|
column.getIsPinned();
|
|
170
169
|
|
|
171
|
-
const isEditable =
|
|
172
|
-
!cell.getIsPlaceholder() &&
|
|
173
|
-
parseFromValuesOrFunc(enableEditing, row) &&
|
|
174
|
-
parseFromValuesOrFunc(columnDef.enableEditing, row) !== false;
|
|
170
|
+
const isEditable = isCellEditable({ cell, table });
|
|
175
171
|
|
|
176
172
|
const isEditing =
|
|
177
173
|
isEditable &&
|
|
@@ -184,18 +180,24 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
|
184
180
|
const isCreating =
|
|
185
181
|
isEditable && createDisplayMode === 'row' && creatingRow?.id === row.id;
|
|
186
182
|
|
|
183
|
+
const showClickToCopyButton =
|
|
184
|
+
(parseFromValuesOrFunc(enableClickToCopy, cell) === true ||
|
|
185
|
+
parseFromValuesOrFunc(columnDef.enableClickToCopy, cell) === true) &&
|
|
186
|
+
!['context-menu', false].includes(
|
|
187
|
+
// @ts-ignore
|
|
188
|
+
parseFromValuesOrFunc(columnDef.enableClickToCopy, cell),
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
const isRightClickable = parseFromValuesOrFunc(enableCellActions, cell);
|
|
192
|
+
|
|
193
|
+
const cellValueProps = {
|
|
194
|
+
cell,
|
|
195
|
+
table,
|
|
196
|
+
};
|
|
197
|
+
|
|
187
198
|
const handleDoubleClick = (event: MouseEvent<HTMLTableCellElement>) => {
|
|
188
199
|
tableCellProps?.onDoubleClick?.(event);
|
|
189
|
-
|
|
190
|
-
setEditingCell(cell);
|
|
191
|
-
queueMicrotask(() => {
|
|
192
|
-
const textField = editInputRefs.current[column.id];
|
|
193
|
-
if (textField) {
|
|
194
|
-
textField.focus();
|
|
195
|
-
textField.select?.();
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
}
|
|
200
|
+
openEditingCell({ cell, table });
|
|
199
201
|
};
|
|
200
202
|
|
|
201
203
|
const handleDragEnter = (e: DragEvent<HTMLTableCellElement>) => {
|
|
@@ -210,9 +212,13 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
|
210
212
|
}
|
|
211
213
|
};
|
|
212
214
|
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
215
|
+
const handleContextMenu = (e: MouseEvent<HTMLTableCellElement>) => {
|
|
216
|
+
tableCellProps?.onContextMenu?.(e);
|
|
217
|
+
if (isRightClickable) {
|
|
218
|
+
e.preventDefault();
|
|
219
|
+
table.setActionCell(cell);
|
|
220
|
+
table.refs.actionCellRef.current = e.currentTarget;
|
|
221
|
+
}
|
|
216
222
|
};
|
|
217
223
|
|
|
218
224
|
return (
|
|
@@ -220,27 +226,31 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
|
220
226
|
align={theme.direction === 'rtl' ? 'right' : 'left'}
|
|
221
227
|
data-index={staticColumnIndex}
|
|
222
228
|
data-pinned={!!isColumnPinned || undefined}
|
|
223
|
-
ref={(node: HTMLTableCellElement) => {
|
|
224
|
-
if (node) {
|
|
225
|
-
measureElement?.(node);
|
|
226
|
-
}
|
|
227
|
-
}}
|
|
228
229
|
{...tableCellProps}
|
|
230
|
+
onContextMenu={handleContextMenu}
|
|
229
231
|
onDoubleClick={handleDoubleClick}
|
|
230
232
|
onDragEnter={handleDragEnter}
|
|
231
233
|
sx={(theme) => ({
|
|
232
234
|
'&:hover': {
|
|
233
235
|
outline:
|
|
236
|
+
actionCell?.id === cell.id ||
|
|
234
237
|
(editDisplayMode === 'cell' && isEditable) ||
|
|
235
238
|
(editDisplayMode === 'table' && (isCreating || isEditing))
|
|
236
239
|
? `1px solid ${theme.palette.grey[500]}`
|
|
237
240
|
: undefined,
|
|
238
|
-
outlineOffset: '-1px',
|
|
239
241
|
textOverflow: 'clip',
|
|
240
242
|
},
|
|
241
243
|
alignItems: layoutMode?.startsWith('grid') ? 'center' : undefined,
|
|
242
|
-
cursor:
|
|
243
|
-
|
|
244
|
+
cursor: isRightClickable
|
|
245
|
+
? 'context-menu'
|
|
246
|
+
: isEditable && editDisplayMode === 'cell'
|
|
247
|
+
? 'pointer'
|
|
248
|
+
: 'inherit',
|
|
249
|
+
outline:
|
|
250
|
+
actionCell?.id === cell.id
|
|
251
|
+
? `1px solid ${theme.palette.grey[500]}`
|
|
252
|
+
: undefined,
|
|
253
|
+
outlineOffset: '-1px',
|
|
244
254
|
overflow: 'hidden',
|
|
245
255
|
p:
|
|
246
256
|
density === 'compact'
|
|
@@ -254,6 +264,7 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
|
254
264
|
: columnDefType === 'display'
|
|
255
265
|
? '1rem 1.25rem'
|
|
256
266
|
: '1.5rem',
|
|
267
|
+
|
|
257
268
|
textOverflow: columnDefType !== 'display' ? 'ellipsis' : undefined,
|
|
258
269
|
whiteSpace:
|
|
259
270
|
row.getIsPinned() || density === 'compact' ? 'nowrap' : 'normal',
|
|
@@ -288,13 +299,13 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
|
288
299
|
renderedCellValue: cell.renderValue() as any,
|
|
289
300
|
row,
|
|
290
301
|
rowRef,
|
|
302
|
+
staticColumnIndex,
|
|
291
303
|
staticRowIndex,
|
|
292
304
|
table,
|
|
293
305
|
})
|
|
294
306
|
) : isCreating || isEditing ? (
|
|
295
307
|
<MRT_EditCellTextField cell={cell} table={table} />
|
|
296
|
-
) :
|
|
297
|
-
columnDef.enableClickToCopy !== false ? (
|
|
308
|
+
) : showClickToCopyButton && columnDef.enableClickToCopy !== false ? (
|
|
298
309
|
<MRT_CopyButton cell={cell} table={table}>
|
|
299
310
|
<MRT_TableBodyCellValue {...cellValueProps} />
|
|
300
311
|
</MRT_CopyButton>
|
|
@@ -10,9 +10,10 @@ import highlightWords from 'highlight-words';
|
|
|
10
10
|
|
|
11
11
|
const allowedTypes = ['string', 'number'];
|
|
12
12
|
|
|
13
|
-
interface
|
|
13
|
+
export interface MRT_TableBodyCellValueProps<TData extends MRT_RowData> {
|
|
14
14
|
cell: MRT_Cell<TData>;
|
|
15
15
|
rowRef?: RefObject<HTMLTableRowElement>;
|
|
16
|
+
staticColumnIndex?: number;
|
|
16
17
|
staticRowIndex?: number;
|
|
17
18
|
table: MRT_TableInstance<TData>;
|
|
18
19
|
}
|
|
@@ -20,9 +21,10 @@ interface Props<TData extends MRT_RowData> {
|
|
|
20
21
|
export const MRT_TableBodyCellValue = <TData extends MRT_RowData>({
|
|
21
22
|
cell,
|
|
22
23
|
rowRef,
|
|
24
|
+
staticColumnIndex,
|
|
23
25
|
staticRowIndex,
|
|
24
26
|
table,
|
|
25
|
-
}:
|
|
27
|
+
}: MRT_TableBodyCellValueProps<TData>) => {
|
|
26
28
|
const {
|
|
27
29
|
getState,
|
|
28
30
|
options: { enableFilterMatchHighlighting },
|
|
@@ -113,6 +115,7 @@ export const MRT_TableBodyCellValue = <TData extends MRT_RowData>({
|
|
|
113
115
|
renderedCellValue,
|
|
114
116
|
row,
|
|
115
117
|
rowRef,
|
|
118
|
+
staticColumnIndex,
|
|
116
119
|
staticRowIndex,
|
|
117
120
|
table,
|
|
118
121
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DragEvent, memo, useMemo, useRef } from 'react';
|
|
2
2
|
import { type VirtualItem } from '@tanstack/react-virtual';
|
|
3
|
-
import TableRow from '@mui/material/TableRow';
|
|
3
|
+
import TableRow, { type TableRowProps } from '@mui/material/TableRow';
|
|
4
4
|
import {
|
|
5
5
|
type Theme,
|
|
6
6
|
alpha,
|
|
@@ -27,7 +27,8 @@ import {
|
|
|
27
27
|
} from '../../utils/style.utils';
|
|
28
28
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
29
29
|
|
|
30
|
-
interface
|
|
30
|
+
export interface MRT_TableBodyRowProps<TData extends MRT_RowData>
|
|
31
|
+
extends TableRowProps {
|
|
31
32
|
columnVirtualizer?: MRT_ColumnVirtualizer;
|
|
32
33
|
numRows?: number;
|
|
33
34
|
pinnedRowIds?: string[];
|
|
@@ -47,7 +48,8 @@ export const MRT_TableBodyRow = <TData extends MRT_RowData>({
|
|
|
47
48
|
staticRowIndex,
|
|
48
49
|
table,
|
|
49
50
|
virtualRow,
|
|
50
|
-
|
|
51
|
+
...rest
|
|
52
|
+
}: MRT_TableBodyRowProps<TData>) => {
|
|
51
53
|
const theme = useTheme();
|
|
52
54
|
|
|
53
55
|
const {
|
|
@@ -87,11 +89,14 @@ export const MRT_TableBodyRow = <TData extends MRT_RowData>({
|
|
|
87
89
|
const isDraggingRow = draggingRow?.id === row.id;
|
|
88
90
|
const isHoveredRow = hoveredRow?.id === row.id;
|
|
89
91
|
|
|
90
|
-
const tableRowProps =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
const tableRowProps = {
|
|
93
|
+
...parseFromValuesOrFunc(muiTableBodyRowProps, {
|
|
94
|
+
row,
|
|
95
|
+
staticRowIndex,
|
|
96
|
+
table,
|
|
97
|
+
}),
|
|
98
|
+
...rest,
|
|
99
|
+
};
|
|
95
100
|
|
|
96
101
|
const [bottomPinnedIndex, topPinnedIndex] = useMemo(() => {
|
|
97
102
|
if (
|
|
@@ -234,10 +239,6 @@ export const MRT_TableBodyRow = <TData extends MRT_RowData>({
|
|
|
234
239
|
}
|
|
235
240
|
const props = {
|
|
236
241
|
cell,
|
|
237
|
-
measureElement:
|
|
238
|
-
!isDraggingRow && !isHoveredRow
|
|
239
|
-
? columnVirtualizer?.measureElement
|
|
240
|
-
: undefined,
|
|
241
242
|
numRows,
|
|
242
243
|
rowRef,
|
|
243
244
|
staticColumnIndex,
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
9
9
|
import { MRT_GrabHandleButton } from '../buttons/MRT_GrabHandleButton';
|
|
10
10
|
|
|
11
|
-
interface
|
|
11
|
+
export interface MRT_TableBodyRowGrabHandleProps<TData extends MRT_RowData>
|
|
12
|
+
extends IconButtonProps {
|
|
12
13
|
row: MRT_Row<TData>;
|
|
13
14
|
rowRef: RefObject<HTMLTableRowElement>;
|
|
14
15
|
table: MRT_TableInstance<TData>;
|
|
@@ -19,7 +20,7 @@ export const MRT_TableBodyRowGrabHandle = <TData extends MRT_RowData>({
|
|
|
19
20
|
rowRef,
|
|
20
21
|
table,
|
|
21
22
|
...rest
|
|
22
|
-
}:
|
|
23
|
+
}: MRT_TableBodyRowGrabHandleProps<TData>) => {
|
|
23
24
|
const {
|
|
24
25
|
options: { muiRowDragHandleProps },
|
|
25
26
|
} = table;
|
|
@@ -50,7 +51,7 @@ export const MRT_TableBodyRowGrabHandle = <TData extends MRT_RowData>({
|
|
|
50
51
|
|
|
51
52
|
return (
|
|
52
53
|
<MRT_GrabHandleButton
|
|
53
|
-
|
|
54
|
+
{...iconButtonProps}
|
|
54
55
|
location="row"
|
|
55
56
|
onDragEnd={handleDragEnd}
|
|
56
57
|
onDragStart={handleDragStart}
|