material-react-table 2.0.0-alpha.1 → 2.0.0-alpha.3

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 (143) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/index.js +2408 -2334
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/types/MaterialReactTable.d.ts +1 -1
  5. package/dist/cjs/types/buttons/MRT_GrabHandleButton.d.ts +1 -1
  6. package/dist/cjs/types/buttons/MRT_RowPinButton.d.ts +2 -2
  7. package/dist/cjs/types/column.utils.d.ts +6 -6
  8. package/dist/cjs/types/filterFns.d.ts +14 -14
  9. package/dist/cjs/types/head/MRT_TableHeadCellFilterLabel.d.ts +1 -1
  10. package/dist/cjs/types/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
  11. package/dist/cjs/types/hooks/useMRT_DisplayColumns.d.ts +3 -3
  12. package/dist/cjs/types/icons.d.ts +1 -1
  13. package/dist/cjs/types/inputs/MRT_FilterRangeSlider.d.ts +1 -1
  14. package/dist/cjs/types/locales/np.d.ts +2 -0
  15. package/dist/cjs/types/menus/MRT_ColumnActionMenu.d.ts +4 -4
  16. package/dist/cjs/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +1 -1
  17. package/dist/cjs/types/toolbar/MRT_TablePagination.d.ts +2 -2
  18. package/dist/cjs/types/toolbar/MRT_TopToolbar.d.ts +1 -1
  19. package/dist/cjs/types/types.d.ts +217 -197
  20. package/dist/esm/material-react-table.esm.js +2311 -2239
  21. package/dist/esm/material-react-table.esm.js.map +1 -1
  22. package/dist/esm/types/MaterialReactTable.d.ts +1 -1
  23. package/dist/esm/types/buttons/MRT_GrabHandleButton.d.ts +1 -1
  24. package/dist/esm/types/buttons/MRT_RowPinButton.d.ts +2 -2
  25. package/dist/esm/types/column.utils.d.ts +6 -6
  26. package/dist/esm/types/filterFns.d.ts +14 -14
  27. package/dist/esm/types/head/MRT_TableHeadCellFilterLabel.d.ts +1 -1
  28. package/dist/esm/types/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
  29. package/dist/esm/types/hooks/useMRT_DisplayColumns.d.ts +3 -3
  30. package/dist/esm/types/icons.d.ts +1 -1
  31. package/dist/esm/types/inputs/MRT_FilterRangeSlider.d.ts +1 -1
  32. package/dist/esm/types/locales/np.d.ts +2 -0
  33. package/dist/esm/types/menus/MRT_ColumnActionMenu.d.ts +4 -4
  34. package/dist/esm/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +1 -1
  35. package/dist/esm/types/toolbar/MRT_TablePagination.d.ts +2 -2
  36. package/dist/esm/types/toolbar/MRT_TopToolbar.d.ts +1 -1
  37. package/dist/esm/types/types.d.ts +217 -197
  38. package/dist/index.d.ts +258 -238
  39. package/locales/fr.esm.js +1 -1
  40. package/locales/fr.esm.js.map +1 -1
  41. package/locales/fr.js +1 -1
  42. package/locales/fr.js.map +1 -1
  43. package/locales/np.d.ts +2 -0
  44. package/locales/np.esm.d.ts +2 -0
  45. package/locales/np.esm.js +94 -0
  46. package/locales/np.esm.js.map +1 -0
  47. package/locales/np.js +98 -0
  48. package/locales/np.js.map +1 -0
  49. package/locales/tr.d.ts +2 -0
  50. package/locales/tr.esm.d.ts +2 -0
  51. package/locales/tr.esm.js +93 -0
  52. package/locales/tr.esm.js.map +1 -0
  53. package/locales/tr.js +97 -0
  54. package/locales/tr.js.map +1 -0
  55. package/locales/uk.d.ts +2 -0
  56. package/locales/uk.esm.d.ts +2 -0
  57. package/locales/uk.esm.js +93 -0
  58. package/locales/uk.esm.js.map +1 -0
  59. package/locales/uk.js +97 -0
  60. package/locales/uk.js.map +1 -0
  61. package/locales/vi.d.ts +2 -0
  62. package/locales/vi.esm.d.ts +2 -0
  63. package/locales/vi.esm.js +93 -0
  64. package/locales/vi.esm.js.map +1 -0
  65. package/locales/vi.js +97 -0
  66. package/locales/vi.js.map +1 -0
  67. package/locales/zh-Hans.d.ts +2 -0
  68. package/locales/zh-Hans.esm.d.ts +2 -0
  69. package/locales/zh-Hans.esm.js +93 -0
  70. package/locales/zh-Hans.esm.js.map +1 -0
  71. package/locales/zh-Hans.js +97 -0
  72. package/locales/zh-Hans.js.map +1 -0
  73. package/locales/zh-Hant.d.ts +2 -0
  74. package/locales/zh-Hant.esm.d.ts +2 -0
  75. package/locales/zh-Hant.esm.js +93 -0
  76. package/locales/zh-Hant.esm.js.map +1 -0
  77. package/locales/zh-Hant.js +97 -0
  78. package/locales/zh-Hant.js.map +1 -0
  79. package/package.json +27 -26
  80. package/src/MaterialReactTable.tsx +2 -2
  81. package/src/body/MRT_TableBody.tsx +9 -9
  82. package/src/body/MRT_TableBodyCell.tsx +22 -22
  83. package/src/body/MRT_TableBodyCellValue.tsx +5 -5
  84. package/src/body/MRT_TableBodyRow.tsx +32 -32
  85. package/src/body/MRT_TableBodyRowGrabHandle.tsx +2 -2
  86. package/src/body/MRT_TableBodyRowPinButton.tsx +3 -3
  87. package/src/body/MRT_TableDetailPanel.tsx +3 -3
  88. package/src/buttons/MRT_CopyButton.tsx +1 -1
  89. package/src/buttons/MRT_EditActionButtons.tsx +4 -4
  90. package/src/buttons/MRT_ExpandAllButton.tsx +3 -3
  91. package/src/buttons/MRT_ExpandButton.tsx +1 -1
  92. package/src/buttons/MRT_GrabHandleButton.tsx +10 -10
  93. package/src/buttons/MRT_RowPinButton.tsx +5 -5
  94. package/src/buttons/MRT_ShowHideColumnsButton.tsx +1 -1
  95. package/src/buttons/MRT_ToggleFullScreenButton.tsx +2 -2
  96. package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +8 -8
  97. package/src/column.utils.ts +24 -22
  98. package/src/filterFns.ts +29 -29
  99. package/src/footer/MRT_TableFooter.tsx +9 -9
  100. package/src/footer/MRT_TableFooterCell.tsx +1 -1
  101. package/src/footer/MRT_TableFooterRow.tsx +2 -2
  102. package/src/head/MRT_TableHead.tsx +9 -9
  103. package/src/head/MRT_TableHeadCell.tsx +10 -6
  104. package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +9 -6
  105. package/src/head/MRT_TableHeadCellFilterContainer.tsx +12 -5
  106. package/src/head/MRT_TableHeadCellFilterLabel.tsx +106 -61
  107. package/src/head/MRT_TableHeadCellGrabHandle.tsx +2 -2
  108. package/src/head/MRT_TableHeadCellResizeHandle.tsx +11 -11
  109. package/src/head/MRT_TableHeadCellSortLabel.tsx +8 -8
  110. package/src/head/MRT_TableHeadRow.tsx +2 -2
  111. package/src/hooks/useMRT_DisplayColumns.tsx +5 -5
  112. package/src/hooks/useMRT_Effects.ts +3 -3
  113. package/src/hooks/useMRT_TableInstance.ts +15 -14
  114. package/src/hooks/useMRT_TableOptions.ts +3 -3
  115. package/src/icons.ts +2 -2
  116. package/src/inputs/MRT_EditCellTextField.tsx +9 -9
  117. package/src/inputs/MRT_FilterCheckbox.tsx +7 -7
  118. package/src/inputs/MRT_FilterRangeFields.tsx +1 -1
  119. package/src/inputs/MRT_FilterRangeSlider.tsx +6 -6
  120. package/src/inputs/MRT_FilterTextField.tsx +309 -230
  121. package/src/inputs/MRT_GlobalFilterTextField.tsx +26 -26
  122. package/src/inputs/MRT_SelectCheckbox.tsx +7 -7
  123. package/src/locales/fr.ts +1 -1
  124. package/src/locales/np.ts +94 -0
  125. package/src/menus/MRT_ColumnActionMenu.tsx +48 -45
  126. package/src/menus/MRT_FilterOptionMenu.tsx +36 -36
  127. package/src/menus/MRT_RowActionMenu.tsx +7 -7
  128. package/src/menus/MRT_ShowHideColumnsMenu.tsx +6 -6
  129. package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +5 -5
  130. package/src/modals/MRT_EditRowModal.tsx +8 -8
  131. package/src/sortingFns.ts +1 -1
  132. package/src/table/MRT_Table.tsx +7 -7
  133. package/src/table/MRT_TableContainer.tsx +10 -10
  134. package/src/table/MRT_TablePaper.tsx +9 -9
  135. package/src/toolbar/MRT_BottomToolbar.tsx +5 -5
  136. package/src/toolbar/MRT_LinearProgressBar.tsx +4 -4
  137. package/src/toolbar/MRT_TablePagination.tsx +19 -19
  138. package/src/toolbar/MRT_ToolbarAlertBanner.tsx +4 -4
  139. package/src/toolbar/MRT_ToolbarDropZone.tsx +6 -6
  140. package/src/toolbar/MRT_ToolbarInternalButtons.tsx +8 -5
  141. package/src/toolbar/MRT_TopToolbar.tsx +7 -7
  142. package/src/types.ts +288 -257
  143. package/src/useMaterialReactTable.ts +1 -1
@@ -0,0 +1,97 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const MRT_Localization_ZH_HANT = {
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
+ pinToLeft: '固定至左邊',
65
+ pinToRight: '固定至右邊',
66
+ resetColumnSize: '重置欄位大小',
67
+ resetOrder: '重置排序',
68
+ rowActions: '橫列動作',
69
+ rowNumber: '#',
70
+ rowNumbers: '橫列編號',
71
+ rowsPerPage: '每頁數量',
72
+ save: '儲存',
73
+ search: '搜尋',
74
+ selectedCountOfRowCountRowsSelected: '已選擇橫列:{selectedCount}/{rowCount}',
75
+ select: '選擇',
76
+ showAll: '顯示全部',
77
+ showAllColumns: '顯示全部欄位',
78
+ showHideColumns: '顯示/隱藏 欄位',
79
+ showHideFilters: '顯示/隱藏 過濾條件',
80
+ showHideSearch: '顯示/隱藏 搜尋條件',
81
+ sortByColumnAsc: '按 {column} 順序排序',
82
+ sortByColumnDesc: '按 {column} 倒序排序',
83
+ sortedByColumnAsc: '已按 {column} 順序排序',
84
+ sortedByColumnDesc: '已按 {column} 倒序排序',
85
+ thenBy: ',然後以',
86
+ toggleDensity: '切換密度',
87
+ toggleFullScreen: '切換全螢幕',
88
+ toggleSelectAll: '切換選擇全部',
89
+ toggleSelectRow: '切換選擇橫列',
90
+ toggleVisibility: '切換可見度',
91
+ ungroupByColumn: '取消按 {column} 分組',
92
+ unpin: '取消固定',
93
+ unpinAll: '全部取消固定',
94
+ };
95
+
96
+ exports.MRT_Localization_ZH_HANT = MRT_Localization_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AAC7B,IAAA,cAAc,EAAE,YAAY;AAC5B,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,gBAAgB,EAAE,iBAAiB;AACnC,IAAA,iBAAiB,EAAE,kBAAkB;AACrC,IAAA,kBAAkB,EAAE,kBAAkB;AACtC,IAAA,MAAM,EAAE,MAAM;AACd,IAAA,aAAa,EAAE,MAAM;AACrB,IAAA,gBAAgB,EAAE,OAAO;AACzB,IAAA,eAAe,EAAE,QAAQ;AACzB,IAAA,eAAe,EAAE,QAAQ;AACzB,IAAA,gBAAgB,EAAE,OAAO;AACzB,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,QAAQ,EAAE,QAAQ;;;;;"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.0-alpha.1",
2
+ "version": "2.0.0-alpha.3",
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.",
@@ -65,30 +65,31 @@
65
65
  "@emotion/react": "^11.11.1",
66
66
  "@emotion/styled": "^11.11.0",
67
67
  "@faker-js/faker": "^8.1.0",
68
- "@mui/icons-material": "^5.14.11",
69
- "@mui/material": "^5.14.11",
70
- "@mui/x-date-pickers": "^6.15.0",
71
- "@rollup/plugin-babel": "^6.0.3",
72
- "@rollup/plugin-node-resolve": "^15.2.1",
73
- "@rollup/plugin-typescript": "^11.1.4",
68
+ "@mui/icons-material": "^5.14.12",
69
+ "@mui/material": "^5.14.12",
70
+ "@mui/x-date-pickers": "^6.16.1",
71
+ "@rollup/plugin-babel": "^6.0.4",
72
+ "@rollup/plugin-node-resolve": "^15.2.2",
73
+ "@rollup/plugin-typescript": "^11.1.5",
74
74
  "@size-limit/preset-small-lib": "^9.0.0",
75
- "@storybook/addon-a11y": "^7.4.5",
76
- "@storybook/addon-essentials": "^7.4.5",
77
- "@storybook/addon-interactions": "^7.4.5",
78
- "@storybook/addon-links": "^7.4.5",
79
- "@storybook/addon-storysource": "^7.4.5",
80
- "@storybook/blocks": "^7.4.5",
81
- "@storybook/react": "^7.4.5",
82
- "@storybook/react-vite": "^7.4.5",
83
- "@storybook/testing-library": "^0.2.1",
84
- "@types/node": "^20.7.1",
85
- "@types/react": "^18.2.23",
86
- "@types/react-dom": "^18.2.8",
87
- "@typescript-eslint/eslint-plugin": "^6.7.3",
88
- "@typescript-eslint/parser": "^6.7.3",
75
+ "@storybook/addon-a11y": "^7.4.6",
76
+ "@storybook/addon-essentials": "^7.4.6",
77
+ "@storybook/addon-interactions": "^7.4.6",
78
+ "@storybook/addon-links": "^7.4.6",
79
+ "@storybook/addon-storysource": "^7.4.6",
80
+ "@storybook/blocks": "^7.4.6",
81
+ "@storybook/react": "^7.4.6",
82
+ "@storybook/react-vite": "^7.4.6",
83
+ "@storybook/testing-library": "^0.2.2",
84
+ "@types/node": "^20.8.2",
85
+ "@types/react": "^18.2.25",
86
+ "@types/react-dom": "^18.2.10",
87
+ "@typescript-eslint/eslint-plugin": "^6.7.4",
88
+ "@typescript-eslint/parser": "^6.7.4",
89
89
  "@vitejs/plugin-react": "^4.1.0",
90
90
  "eslint": "^8.50.0",
91
91
  "eslint-plugin-mui-path-imports": "^0.0.15",
92
+ "eslint-plugin-perfectionist": "^2.1.0",
92
93
  "prop-types": "^15.8.1",
93
94
  "react": "^18.2.0",
94
95
  "react-dom": "^18.2.0",
@@ -98,25 +99,25 @@
98
99
  "rollup-plugin-dts": "^6.0.2",
99
100
  "rollup-plugin-peer-deps-external": "^2.2.4",
100
101
  "size-limit": "^9.0.0",
101
- "storybook": "^7.4.5",
102
+ "storybook": "^7.4.6",
102
103
  "storybook-dark-mode": "^3.0.1",
103
104
  "tslib": "^2.6.2",
104
105
  "typescript": "^5.2.2",
105
- "vite": "^4.4.9"
106
+ "vite": "^4.4.11"
106
107
  },
107
108
  "peerDependencies": {
108
109
  "@emotion/react": ">=11.11",
109
110
  "@emotion/styled": ">=11.11",
110
111
  "@mui/icons-material": ">=5.11",
111
112
  "@mui/material": ">=5.13",
112
- "@mui/x-date-pickers": ">=6.8.0",
113
+ "@mui/x-date-pickers": ">=6.15.0",
113
114
  "react": ">=18.0",
114
115
  "react-dom": ">=18.0"
115
116
  },
116
117
  "dependencies": {
117
118
  "@tanstack/match-sorter-utils": "8.8.4",
118
- "@tanstack/react-table": "8.10.3",
119
- "@tanstack/react-virtual": "3.0.0-beta.61",
119
+ "@tanstack/react-table": "8.10.4",
120
+ "@tanstack/react-virtual": "3.0.0-beta.63",
120
121
  "highlight-words": "1.2.2"
121
122
  }
122
123
  }
@@ -1,10 +1,10 @@
1
- import { useMaterialReactTable } from './useMaterialReactTable';
2
1
  import { MRT_TablePaper } from './table/MRT_TablePaper';
3
2
  import {
4
- type MRT_TableOptions,
5
3
  type MRT_TableInstance,
4
+ type MRT_TableOptions,
6
5
  type Xor,
7
6
  } from './types';
7
+ import { useMaterialReactTable } from './useMaterialReactTable';
8
8
 
9
9
  type TableInstanceProp<TData extends Record<string, any> = {}> = {
10
10
  table: MRT_TableInstance<TData>;
@@ -1,15 +1,15 @@
1
1
  import { memo, useMemo } from 'react';
2
2
  import {
3
- useVirtualizer,
4
3
  type VirtualItem,
5
4
  type Virtualizer,
5
+ useVirtualizer,
6
6
  } from '@tanstack/react-virtual';
7
7
  import TableBody from '@mui/material/TableBody';
8
8
  import Typography from '@mui/material/Typography';
9
- import { Memo_MRT_TableBodyRow, MRT_TableBodyRow } from './MRT_TableBodyRow';
9
+ import { MRT_TableBodyRow, Memo_MRT_TableBodyRow } from './MRT_TableBodyRow';
10
+ import { parseFromValuesOrFunc } from '../column.utils';
10
11
  import { rankGlobalFuzzy } from '../sortingFns';
11
12
  import { type MRT_Row, type MRT_TableInstance } from '../types';
12
- import { parseFromValuesOrFunc } from '../column.utils';
13
13
 
14
14
  interface Props<TData extends Record<string, any>> {
15
15
  columnVirtualizer?: Virtualizer<HTMLDivElement, HTMLTableCellElement>;
@@ -29,18 +29,18 @@ export const MRT_TableBody = <TData extends Record<string, any>>({
29
29
  const {
30
30
  getBottomRows,
31
31
  getCenterRows,
32
+ getIsSomeRowsPinned,
32
33
  getPrePaginationRowModel,
33
34
  getRowModel,
34
35
  getState,
35
- getIsSomeRowsPinned,
36
36
  getTopRows,
37
37
  options: {
38
38
  enableGlobalFilterRankedResults,
39
39
  enablePagination,
40
40
  enableRowPinning,
41
41
  enableRowVirtualization,
42
- enableStickyHeader,
43
42
  enableStickyFooter,
43
+ enableStickyHeader,
44
44
  layoutMode,
45
45
  localization,
46
46
  manualExpanding,
@@ -55,7 +55,7 @@ export const MRT_TableBody = <TData extends Record<string, any>>({
55
55
  rowVirtualizerInstanceRef,
56
56
  rowVirtualizerOptions,
57
57
  },
58
- refs: { tableContainerRef, tablePaperRef, tableFooterRef, tableHeadRef },
58
+ refs: { tableContainerRef, tableFooterRef, tableHeadRef, tablePaperRef },
59
59
  } = table;
60
60
  const {
61
61
  columnFilters,
@@ -63,10 +63,10 @@ export const MRT_TableBody = <TData extends Record<string, any>>({
63
63
  expanded,
64
64
  globalFilter,
65
65
  globalFilterFn,
66
+ isFullScreen,
66
67
  pagination,
67
- sorting,
68
68
  rowPinning,
69
- isFullScreen,
69
+ sorting,
70
70
  } = getState();
71
71
 
72
72
  const tableBodyProps = parseFromValuesOrFunc(muiTableBodyProps, { table });
@@ -284,9 +284,9 @@ export const MRT_TableBody = <TData extends Record<string, any>>({
284
284
  <TableBody
285
285
  {...tableBodyProps}
286
286
  sx={(theme) => ({
287
+ bottom: tableFooterHeight - 1,
287
288
  display: layoutMode === 'grid' ? 'grid' : 'table-row-group',
288
289
  position: 'sticky',
289
- bottom: tableFooterHeight - 1,
290
290
  zIndex: 1,
291
291
  ...(parseFromValuesOrFunc(tableBodyProps?.sx, theme) as any),
292
292
  })}
@@ -1,26 +1,26 @@
1
1
  import {
2
- memo,
3
2
  type DragEvent,
4
3
  type MouseEvent,
5
4
  type RefObject,
5
+ memo,
6
6
  useEffect,
7
7
  useMemo,
8
8
  useState,
9
9
  } from 'react';
10
+ import { type VirtualItem } from '@tanstack/react-virtual';
10
11
  import Skeleton from '@mui/material/Skeleton';
11
12
  import TableCell from '@mui/material/TableCell';
12
13
  import { useTheme } from '@mui/material/styles';
13
- import { MRT_EditCellTextField } from '../inputs/MRT_EditCellTextField';
14
- import { MRT_CopyButton } from '../buttons/MRT_CopyButton';
15
- import { MRT_TableBodyRowGrabHandle } from './MRT_TableBodyRowGrabHandle';
16
14
  import { MRT_TableBodyCellValue } from './MRT_TableBodyCellValue';
15
+ import { MRT_TableBodyRowGrabHandle } from './MRT_TableBodyRowGrabHandle';
16
+ import { MRT_CopyButton } from '../buttons/MRT_CopyButton';
17
17
  import {
18
18
  getCommonCellStyles,
19
19
  getIsFirstColumn,
20
20
  getIsLastColumn,
21
21
  parseFromValuesOrFunc,
22
22
  } from '../column.utils';
23
- import { type VirtualItem } from '@tanstack/react-virtual';
23
+ import { MRT_EditCellTextField } from '../inputs/MRT_EditCellTextField';
24
24
  import { type MRT_Cell, type MRT_TableInstance } from '../types';
25
25
 
26
26
  interface Props<TData extends Record<string, any>> {
@@ -54,8 +54,8 @@ export const MRT_TableBodyCell = <TData extends Record<string, any>>({
54
54
  enableGrouping,
55
55
  enableRowNumbers,
56
56
  layoutMode,
57
- muiTableBodyCellProps,
58
57
  muiSkeletonProps,
58
+ muiTableBodyCellProps,
59
59
  rowNumberMode,
60
60
  },
61
61
  refs: { editInputRefs },
@@ -64,13 +64,13 @@ export const MRT_TableBodyCell = <TData extends Record<string, any>>({
64
64
  } = table;
65
65
  const {
66
66
  creatingRow,
67
+ density,
67
68
  draggingColumn,
68
69
  draggingRow,
69
70
  editingCell,
70
71
  editingRow,
71
72
  hoveredColumn,
72
73
  hoveredRow,
73
- density,
74
74
  isLoading,
75
75
  showSkeletons,
76
76
  } = getState();
@@ -129,6 +129,10 @@ export const MRT_TableBodyCell = <TData extends Record<string, any>>({
129
129
 
130
130
  return borderStyle
131
131
  ? {
132
+ borderBottom:
133
+ isDraggingRow || isHoveredRow || isLastRow
134
+ ? borderStyle
135
+ : undefined,
132
136
  borderLeft:
133
137
  isDraggingColumn ||
134
138
  isHoveredColumn ||
@@ -141,10 +145,6 @@ export const MRT_TableBodyCell = <TData extends Record<string, any>>({
141
145
  ((isDraggingRow || isHoveredRow) && isLastColumn)
142
146
  ? borderStyle
143
147
  : undefined,
144
- borderBottom:
145
- isDraggingRow || isHoveredRow || isLastRow
146
- ? borderStyle
147
- : undefined,
148
148
  borderTop: isDraggingRow || isHoveredRow ? borderStyle : undefined,
149
149
  }
150
150
  : undefined;
@@ -156,7 +156,7 @@ export const MRT_TableBodyCell = <TData extends Record<string, any>>({
156
156
 
157
157
  const isEditing =
158
158
  isEditable &&
159
- !['modal', 'custom'].includes(editDisplayMode as string) &&
159
+ !['custom', 'modal'].includes(editDisplayMode as string) &&
160
160
  (editDisplayMode === 'table' ||
161
161
  editingRow?.id === row.id ||
162
162
  editingCell?.id === cell.id) &&
@@ -200,9 +200,16 @@ export const MRT_TableBodyCell = <TData extends Record<string, any>>({
200
200
  }
201
201
  }}
202
202
  {...tableCellProps}
203
- onDragEnter={handleDragEnter}
204
203
  onDoubleClick={handleDoubleClick}
204
+ onDragEnter={handleDragEnter}
205
205
  sx={(theme) => ({
206
+ '&:hover': {
207
+ outline: ['cell', 'table'].includes(editDisplayMode ?? '')
208
+ ? `1px solid ${theme.palette.text.secondary}`
209
+ : undefined,
210
+ outlineOffset: '-1px',
211
+ textOverflow: 'clip',
212
+ },
206
213
  alignItems: layoutMode === 'grid' ? 'center' : undefined,
207
214
  cursor:
208
215
  isEditable && editDisplayMode === 'cell' ? 'pointer' : 'inherit',
@@ -237,18 +244,11 @@ export const MRT_TableBodyCell = <TData extends Record<string, any>>({
237
244
  row.getIsPinned() || density === 'compact' ? 'nowrap' : 'normal',
238
245
  zIndex:
239
246
  draggingColumn?.id === column.id ? 2 : column.getIsPinned() ? 1 : 0,
240
- '&:hover': {
241
- outline: ['table', 'cell'].includes(editDisplayMode ?? '')
242
- ? `1px solid ${theme.palette.text.secondary}`
243
- : undefined,
244
- outlineOffset: '-1px',
245
- textOverflow: 'clip',
246
- },
247
247
  ...getCommonCellStyles({
248
248
  column,
249
249
  table,
250
- theme,
251
250
  tableCellProps,
251
+ theme,
252
252
  }),
253
253
  ...draggingBorders,
254
254
  })}
@@ -275,8 +275,8 @@ export const MRT_TableBodyCell = <TData extends Record<string, any>>({
275
275
  !row.getIsGrouped()) ? (
276
276
  columnDef.Cell?.({
277
277
  cell,
278
- renderedCellValue: cell.renderValue() as any,
279
278
  column,
279
+ renderedCellValue: cell.renderValue() as any,
280
280
  row,
281
281
  table,
282
282
  })
@@ -1,8 +1,8 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import Box from '@mui/material/Box';
3
3
  import { darken, lighten } from '@mui/material/styles';
4
- import highlightWords from 'highlight-words';
5
4
  import { type MRT_Cell, type MRT_TableInstance } from '../types';
5
+ import highlightWords from 'highlight-words';
6
6
 
7
7
  const allowedTypes = ['string', 'number'];
8
8
 
@@ -46,7 +46,7 @@ export const MRT_TableBodyCellValue = <TData extends Record<string, any>>({
46
46
  const isGroupedValue = renderedCellValue !== undefined;
47
47
 
48
48
  if (!isGroupedValue) {
49
- renderedCellValue = cell.renderValue() as number | string | ReactNode;
49
+ renderedCellValue = cell.renderValue() as ReactNode | number | string;
50
50
  }
51
51
 
52
52
  if (
@@ -62,10 +62,10 @@ export const MRT_TableBodyCellValue = <TData extends Record<string, any>>({
62
62
  column.getCanGlobalFilter()))
63
63
  ) {
64
64
  const chunks = highlightWords?.({
65
- text: renderedCellValue?.toString() as string,
66
- query: (filterValue ?? globalFilter ?? '').toString(),
67
65
  matchExactly:
68
66
  (filterValue ? columnDef._filterFn : globalFilterFn) !== 'fuzzy',
67
+ query: (filterValue ?? globalFilter ?? '').toString(),
68
+ text: renderedCellValue?.toString() as string,
69
69
  });
70
70
  if (chunks?.length > 1 || chunks?.[0]?.match) {
71
71
  renderedCellValue = (
@@ -101,8 +101,8 @@ export const MRT_TableBodyCellValue = <TData extends Record<string, any>>({
101
101
  if (columnDef.Cell && !isGroupedValue) {
102
102
  renderedCellValue = columnDef.Cell({
103
103
  cell,
104
- renderedCellValue,
105
104
  column,
105
+ renderedCellValue,
106
106
  row,
107
107
  table,
108
108
  });
@@ -1,4 +1,5 @@
1
- import { type DragEvent, memo, useRef, useMemo } from 'react';
1
+ import { type DragEvent, memo, useMemo, useRef } from 'react';
2
+ import { type VirtualItem, type Virtualizer } from '@tanstack/react-virtual';
2
3
  import TableRow from '@mui/material/TableRow';
3
4
  import {
4
5
  type Theme,
@@ -7,9 +8,8 @@ import {
7
8
  lighten,
8
9
  useTheme,
9
10
  } from '@mui/material/styles';
10
- import { Memo_MRT_TableBodyCell, MRT_TableBodyCell } from './MRT_TableBodyCell';
11
+ import { MRT_TableBodyCell, Memo_MRT_TableBodyCell } from './MRT_TableBodyCell';
11
12
  import { MRT_TableDetailPanel } from './MRT_TableDetailPanel';
12
- import { type VirtualItem, type Virtualizer } from '@tanstack/react-virtual';
13
13
  import { parseFromValuesOrFunc } from '../column.utils';
14
14
  import { type MRT_Cell, type MRT_Row, type MRT_TableInstance } from '../types';
15
15
 
@@ -50,12 +50,12 @@ export const MRT_TableBodyRow = <TData extends Record<string, any>>({
50
50
  enableStickyFooter,
51
51
  enableStickyHeader,
52
52
  layoutMode,
53
- rowPinningDisplayMode,
54
53
  memoMode,
55
54
  muiTableBodyRowProps,
56
55
  renderDetailPanel,
56
+ rowPinningDisplayMode,
57
57
  },
58
- refs: { tableHeadRef, tableFooterRef },
58
+ refs: { tableFooterRef, tableHeadRef },
59
59
  setHoveredRow,
60
60
  } = table;
61
61
  const {
@@ -118,27 +118,43 @@ export const MRT_TableBodyRow = <TData extends Record<string, any>>({
118
118
  <TableRow
119
119
  data-index={virtualRow?.index}
120
120
  onDragEnter={handleDragEnter}
121
- selected={row.getIsSelected()}
122
121
  ref={(node: HTMLTableRowElement) => {
123
122
  if (node) {
124
123
  rowRef.current = node;
125
124
  measureElement?.(node);
126
125
  }
127
126
  }}
127
+ selected={row.getIsSelected()}
128
128
  {...tableRowProps}
129
+ style={{
130
+ transform: virtualRow
131
+ ? `translateY(${virtualRow?.start}px)`
132
+ : undefined,
133
+ ...tableRowProps?.style,
134
+ }}
129
135
  sx={(theme: Theme) => ({
136
+ '&:hover td': {
137
+ backgroundColor:
138
+ tableRowProps?.hover !== false
139
+ ? row.getIsSelected()
140
+ ? `${alpha(theme.palette.primary.main, 0.2)}`
141
+ : theme.palette.mode === 'dark'
142
+ ? `${lighten(theme.palette.background.default, 0.12)}`
143
+ : `${darken(theme.palette.background.default, 0.05)}`
144
+ : undefined,
145
+ },
130
146
  backgroundColor: `${lighten(
131
147
  theme.palette.background.default,
132
148
  0.06,
133
149
  )} !important`,
134
- boxSizing: 'border-box',
135
150
  bottom:
136
- bottomPinnedIndex !== undefined && isPinned
151
+ !virtualRow && bottomPinnedIndex !== undefined && isPinned
137
152
  ? `${
138
153
  bottomPinnedIndex * rowHeight +
139
154
  (enableStickyFooter ? tableFooterHeight - 1 : 0)
140
155
  }px`
141
156
  : undefined,
157
+ boxSizing: 'border-box',
142
158
  display: layoutMode === 'grid' ? 'flex' : 'table-row',
143
159
  opacity: isPinned
144
160
  ? 0.98
@@ -150,7 +166,13 @@ export const MRT_TableBodyRow = <TData extends Record<string, any>>({
150
166
  : rowPinningDisplayMode?.includes('sticky') && isPinned
151
167
  ? 'sticky'
152
168
  : undefined,
153
- transition: virtualRow ? 'none' : 'all 150ms ease-in-out',
169
+ td: {
170
+ backgroundColor: row.getIsSelected()
171
+ ? alpha(theme.palette.primary.main, 0.2)
172
+ : isPinned
173
+ ? alpha(theme.palette.primary.main, 0.1)
174
+ : undefined,
175
+ },
154
176
  top: virtualRow
155
177
  ? 0
156
178
  : topPinnedIndex !== undefined && isPinned
@@ -159,36 +181,14 @@ export const MRT_TableBodyRow = <TData extends Record<string, any>>({
159
181
  (enableStickyHeader || isFullScreen ? tableHeadHeight - 1 : 0)
160
182
  }px`
161
183
  : undefined,
184
+ transition: virtualRow ? 'none' : 'all 150ms ease-in-out',
162
185
  width: '100%',
163
186
  zIndex:
164
187
  rowPinningDisplayMode?.includes('sticky') && isPinned
165
188
  ? 1
166
189
  : undefined,
167
- td: {
168
- backgroundColor: row.getIsSelected()
169
- ? alpha(theme.palette.primary.main, 0.2)
170
- : isPinned
171
- ? alpha(theme.palette.primary.main, 0.1)
172
- : undefined,
173
- },
174
- '&:hover td': {
175
- backgroundColor:
176
- tableRowProps?.hover !== false
177
- ? row.getIsSelected()
178
- ? `${alpha(theme.palette.primary.main, 0.2)}`
179
- : theme.palette.mode === 'dark'
180
- ? `${lighten(theme.palette.background.default, 0.12)}`
181
- : `${darken(theme.palette.background.default, 0.05)}`
182
- : undefined,
183
- },
184
190
  ...(sx as any),
185
191
  })}
186
- style={{
187
- transform: virtualRow
188
- ? `translateY(${virtualRow?.start}px)`
189
- : undefined,
190
- ...tableRowProps?.style,
191
- }}
192
192
  >
193
193
  {virtualPaddingLeft ? (
194
194
  <td style={{ display: 'flex', width: virtualPaddingLeft }} />
@@ -1,7 +1,7 @@
1
1
  import { type DragEvent, type RefObject } from 'react';
2
2
  import { MRT_GrabHandleButton } from '../buttons/MRT_GrabHandleButton';
3
- import { type MRT_Row, type MRT_TableInstance } from '../types';
4
3
  import { parseFromValuesOrFunc } from '../column.utils';
4
+ import { type MRT_Row, type MRT_TableInstance } from '../types';
5
5
 
6
6
  interface Props<TData extends Record<string, any>> {
7
7
  row: MRT_Row<TData>;
@@ -38,8 +38,8 @@ export const MRT_TableBodyRowGrabHandle = <TData extends Record<string, any>>({
38
38
  return (
39
39
  <MRT_GrabHandleButton
40
40
  iconButtonProps={iconButtonProps}
41
- onDragStart={handleDragStart}
42
41
  onDragEnd={handleDragEnd}
42
+ onDragStart={handleDragStart}
43
43
  table={table}
44
44
  />
45
45
  );
@@ -30,17 +30,17 @@ export const MRT_TableBodyRowPinButton = <TData extends Record<string, any>>({
30
30
  flexDirection: density === 'compact' ? 'row' : 'column',
31
31
  }}
32
32
  >
33
- <MRT_RowPinButton row={row} table={table} pinningPosition="top" />
34
- <MRT_RowPinButton row={row} table={table} pinningPosition="bottom" />
33
+ <MRT_RowPinButton pinningPosition="top" row={row} table={table} />
34
+ <MRT_RowPinButton pinningPosition="bottom" row={row} table={table} />
35
35
  </Box>
36
36
  );
37
37
  }
38
38
 
39
39
  return (
40
40
  <MRT_RowPinButton
41
+ pinningPosition={rowPinningDisplayMode === 'bottom' ? 'bottom' : 'top'}
41
42
  row={row}
42
43
  table={table}
43
- pinningPosition={rowPinningDisplayMode === 'bottom' ? 'bottom' : 'top'}
44
44
  />
45
45
  );
46
46
  };
@@ -1,9 +1,9 @@
1
1
  import { type RefObject } from 'react';
2
+ import { type VirtualItem } from '@tanstack/react-virtual';
2
3
  import Collapse from '@mui/material/Collapse';
3
4
  import TableCell from '@mui/material/TableCell';
4
5
  import TableRow from '@mui/material/TableRow';
5
6
  import { lighten } from '@mui/material/styles';
6
- import { type VirtualItem } from '@tanstack/react-virtual';
7
7
  import { parseFromValuesOrFunc } from '../column.utils';
8
8
  import { type MRT_Row, type MRT_TableInstance } from '../types';
9
9
 
@@ -23,12 +23,12 @@ export const MRT_TableDetailPanel = <TData extends Record<string, any>>({
23
23
  virtualRow,
24
24
  }: Props<TData>) => {
25
25
  const {
26
- getVisibleLeafColumns,
27
26
  getState,
27
+ getVisibleLeafColumns,
28
28
  options: {
29
29
  layoutMode,
30
- muiTableBodyRowProps,
31
30
  muiDetailPanelProps,
31
+ muiTableBodyRowProps,
32
32
  renderDetailPanel,
33
33
  },
34
34
  } = table;
@@ -1,8 +1,8 @@
1
1
  import { type MouseEvent, type ReactNode, useState } from 'react';
2
2
  import Button from '@mui/material/Button';
3
3
  import Tooltip from '@mui/material/Tooltip';
4
- import { type MRT_Cell, type MRT_TableInstance } from '../types';
5
4
  import { parseFromValuesOrFunc } from '../column.utils';
5
+ import { type MRT_Cell, type MRT_TableInstance } from '../types';
6
6
 
7
7
  interface Props<TData extends Record<string, any>> {
8
8
  cell: MRT_Cell<TData>;