nmrium 2.7.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/lib/component/1d/BrushTracker1D.d.ts.map +1 -1
  2. package/lib/component/1d/BrushTracker1D.js +15 -14
  3. package/lib/component/1d/BrushTracker1D.js.map +1 -1
  4. package/lib/component/1d/Viewer1D.d.ts.map +1 -1
  5. package/lib/component/1d/Viewer1D.js +2 -1
  6. package/lib/component/1d/Viewer1D.js.map +1 -1
  7. package/lib/component/1d/plugin_chart_brush_tracker.d.ts +2 -0
  8. package/lib/component/1d/plugin_chart_brush_tracker.d.ts.map +1 -0
  9. package/lib/component/1d/plugin_chart_brush_tracker.js +41 -0
  10. package/lib/component/1d/plugin_chart_brush_tracker.js.map +1 -0
  11. package/lib/component/1d-2d/tools/BrushXY.d.ts +1 -1
  12. package/lib/component/1d-2d/tools/BrushXY.d.ts.map +1 -1
  13. package/lib/component/1d-2d/tools/BrushXY.js.map +1 -1
  14. package/lib/component/1d-2d/tools/CrossLinePointer.d.ts +1 -1
  15. package/lib/component/1d-2d/tools/CrossLinePointer.d.ts.map +1 -1
  16. package/lib/component/1d-2d/tools/CrossLinePointer.js.map +1 -1
  17. package/lib/component/2d/BrushTracker2D.js.map +1 -1
  18. package/lib/component/2d/utilities/DimensionLayout.d.ts +1 -1
  19. package/lib/component/2d/utilities/DimensionLayout.d.ts.map +1 -1
  20. package/lib/component/EventsTrackers/BrushTracker.d.ts +1 -84
  21. package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
  22. package/lib/component/EventsTrackers/BrushTracker.js +70 -3
  23. package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
  24. package/lib/component/EventsTrackers/brush_tracker.types.d.ts +93 -0
  25. package/lib/component/EventsTrackers/brush_tracker.types.d.ts.map +1 -0
  26. package/lib/component/EventsTrackers/brush_tracker.types.js +2 -0
  27. package/lib/component/EventsTrackers/brush_tracker.types.js.map +1 -0
  28. package/lib/component/EventsTrackers/brush_tracker_events_listeners.d.ts +7 -0
  29. package/lib/component/EventsTrackers/brush_tracker_events_listeners.d.ts.map +1 -0
  30. package/lib/component/EventsTrackers/brush_tracker_events_listeners.js +15 -0
  31. package/lib/component/EventsTrackers/brush_tracker_events_listeners.js.map +1 -0
  32. package/lib/component/elements/tanstack_table/create_action_column.d.ts +11 -0
  33. package/lib/component/elements/tanstack_table/create_action_column.d.ts.map +1 -0
  34. package/lib/component/elements/tanstack_table/create_action_column.js +24 -0
  35. package/lib/component/elements/tanstack_table/create_action_column.js.map +1 -0
  36. package/lib/component/elements/tanstack_table/create_column_helper.d.ts +5 -0
  37. package/lib/component/elements/tanstack_table/create_column_helper.d.ts.map +1 -0
  38. package/lib/component/elements/tanstack_table/create_column_helper.js +5 -0
  39. package/lib/component/elements/tanstack_table/create_column_helper.js.map +1 -0
  40. package/lib/component/elements/{ReactTable/BaseReactTable.d.ts → tanstack_table/elements/base_react_table.d.ts} +1 -1
  41. package/lib/component/elements/tanstack_table/elements/base_react_table.d.ts.map +1 -0
  42. package/lib/component/elements/{ReactTable/BaseReactTable.js → tanstack_table/elements/base_react_table.js} +1 -1
  43. package/lib/component/elements/tanstack_table/elements/base_react_table.js.map +1 -0
  44. package/lib/component/elements/{ReactTable/Elements/EmptyDataRow.d.ts → tanstack_table/elements/empty_data_row.d.ts} +1 -1
  45. package/lib/component/elements/tanstack_table/elements/empty_data_row.d.ts.map +1 -0
  46. package/lib/component/elements/{ReactTable/Elements/EmptyDataRow.js → tanstack_table/elements/empty_data_row.js} +1 -1
  47. package/lib/component/elements/tanstack_table/elements/empty_data_row.js.map +1 -0
  48. package/lib/component/elements/tanstack_table/elements/table_context.d.ts +4 -0
  49. package/lib/component/elements/tanstack_table/elements/table_context.d.ts.map +1 -0
  50. package/lib/component/elements/tanstack_table/elements/table_context.js +11 -0
  51. package/lib/component/elements/tanstack_table/elements/table_context.js.map +1 -0
  52. package/lib/component/elements/tanstack_table/elements/table_header.d.ts +12 -0
  53. package/lib/component/elements/tanstack_table/elements/table_header.d.ts.map +1 -0
  54. package/lib/component/elements/tanstack_table/elements/table_header.js +42 -0
  55. package/lib/component/elements/tanstack_table/elements/table_header.js.map +1 -0
  56. package/lib/component/elements/tanstack_table/elements/table_row.d.ts +12 -0
  57. package/lib/component/elements/tanstack_table/elements/table_row.d.ts.map +1 -0
  58. package/lib/component/elements/{ReactTable/Elements/ReactTableRow.js → tanstack_table/elements/table_row.js} +18 -17
  59. package/lib/component/elements/tanstack_table/elements/table_row.js.map +1 -0
  60. package/lib/component/elements/tanstack_table/features.d.ts +21 -0
  61. package/lib/component/elements/tanstack_table/features.d.ts.map +1 -0
  62. package/lib/component/elements/tanstack_table/features.js +14 -0
  63. package/lib/component/elements/tanstack_table/features.js.map +1 -0
  64. package/lib/component/elements/tanstack_table/index.d.ts +6 -0
  65. package/lib/component/elements/tanstack_table/index.d.ts.map +1 -0
  66. package/lib/component/elements/tanstack_table/index.js +6 -0
  67. package/lib/component/elements/tanstack_table/index.js.map +1 -0
  68. package/lib/component/elements/tanstack_table/table.d.ts +26 -0
  69. package/lib/component/elements/tanstack_table/table.d.ts.map +1 -0
  70. package/lib/component/elements/{ReactTable/ReactTable.js → tanstack_table/table.js} +29 -37
  71. package/lib/component/elements/tanstack_table/table.js.map +1 -0
  72. package/lib/component/elements/tanstack_table/types.d.ts +47 -0
  73. package/lib/component/elements/tanstack_table/types.d.ts.map +1 -0
  74. package/lib/component/elements/tanstack_table/types.js +2 -0
  75. package/lib/component/elements/tanstack_table/types.js.map +1 -0
  76. package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -1
  77. package/lib/component/header/AutoPeakPickingOptionPanel.js.map +1 -1
  78. package/lib/component/modal/ImportPublicationStringModal.d.ts.map +1 -1
  79. package/lib/component/modal/ImportPublicationStringModal.js +91 -73
  80. package/lib/component/modal/ImportPublicationStringModal.js.map +1 -1
  81. package/lib/component/modal/LogsHistoryModal.d.ts.map +1 -1
  82. package/lib/component/modal/LogsHistoryModal.js +44 -40
  83. package/lib/component/modal/LogsHistoryModal.js.map +1 -1
  84. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.d.ts.map +1 -1
  85. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +48 -44
  86. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js.map +1 -1
  87. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.d.ts.map +1 -1
  88. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +36 -32
  89. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js.map +1 -1
  90. package/lib/component/modal/metaImportation/MetaImportationModal.d.ts.map +1 -1
  91. package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -14
  92. package/lib/component/modal/metaImportation/MetaImportationModal.js.map +1 -1
  93. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +1 -1
  94. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts.map +1 -1
  95. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +29 -26
  96. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js.map +1 -1
  97. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
  98. package/lib/component/panels/IntegralsPanel/IntegralTable.js +70 -76
  99. package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
  100. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.d.ts.map +1 -1
  101. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +33 -29
  102. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js.map +1 -1
  103. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +8 -6
  104. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
  105. package/lib/component/panels/PeaksPanel/PeaksTable.js +116 -126
  106. package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
  107. package/lib/component/panels/PeaksPanel/peaksToTSV.d.ts +2 -2
  108. package/lib/component/panels/PeaksPanel/peaksToTSV.d.ts.map +1 -1
  109. package/lib/component/panels/PeaksPanel/peaksToTSV.js +9 -11
  110. package/lib/component/panels/PeaksPanel/peaksToTSV.js.map +1 -1
  111. package/lib/component/panels/RangesPanel/RangesTable.d.ts +3 -2
  112. package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
  113. package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
  114. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
  115. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts.map +1 -1
  116. package/lib/component/panels/SpectraPanel/SpectraTable.d.ts.map +1 -1
  117. package/lib/component/panels/SpectraPanel/SpectraTable.js +37 -26
  118. package/lib/component/panels/SpectraPanel/SpectraTable.js.map +1 -1
  119. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.d.ts +1 -1
  120. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.d.ts.map +1 -1
  121. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js +56 -52
  122. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js.map +1 -1
  123. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.d.ts.map +1 -1
  124. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +23 -20
  125. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js.map +1 -1
  126. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +2 -2
  127. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts.map +1 -1
  128. package/lib/component/panels/databasePanel/DatabaseTable.d.ts +1 -1
  129. package/lib/component/panels/databasePanel/DatabaseTable.d.ts.map +1 -1
  130. package/lib/component/panels/databasePanel/DatabaseTable.js +171 -153
  131. package/lib/component/panels/databasePanel/DatabaseTable.js.map +1 -1
  132. package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.d.ts.map +1 -1
  133. package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.js +27 -24
  134. package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.js.map +1 -1
  135. package/lib/component/panels/informationPanel/InformationEditionModal.d.ts.map +1 -1
  136. package/lib/component/panels/informationPanel/InformationEditionModal.js +69 -64
  137. package/lib/component/panels/informationPanel/InformationEditionModal.js.map +1 -1
  138. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.d.ts.map +1 -1
  139. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.js +17 -20
  140. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.js.map +1 -1
  141. package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.d.ts.map +1 -1
  142. package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.js +25 -20
  143. package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.js.map +1 -1
  144. package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.d.ts.map +1 -1
  145. package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.js +41 -36
  146. package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.js.map +1 -1
  147. package/lib/component/panels/spectrumSimulation/SpinSystemTable.d.ts.map +1 -1
  148. package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +14 -15
  149. package/lib/component/panels/spectrumSimulation/SpinSystemTable.js.map +1 -1
  150. package/lib/component/reducer/actions/DatabaseActions.d.ts.map +1 -1
  151. package/lib/component/reducer/actions/DatabaseActions.js +3 -2
  152. package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
  153. package/lib/component/reducer/actions/InsetActions.d.ts +1 -1
  154. package/lib/component/reducer/actions/InsetActions.d.ts.map +1 -1
  155. package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
  156. package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
  157. package/lib/component/reducer/helper/Zoom1DManager.d.ts +1 -1
  158. package/lib/component/reducer/helper/Zoom1DManager.d.ts.map +1 -1
  159. package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -1
  160. package/lib/component/reducer/helper/ZoomHistoryManager.d.ts.map +1 -1
  161. package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts +1 -1
  162. package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts.map +1 -1
  163. package/lib/component/utility/Events.d.ts +1 -1
  164. package/lib/component/utility/Events.d.ts.map +1 -1
  165. package/lib/component/utility/core_slots/core_operator_brush.commons.d.ts +9 -0
  166. package/lib/component/utility/core_slots/core_operator_brush.commons.d.ts.map +1 -0
  167. package/lib/component/utility/core_slots/core_operator_brush.commons.js +15 -0
  168. package/lib/component/utility/core_slots/core_operator_brush.commons.js.map +1 -0
  169. package/lib/component/utility/core_slots/core_operator_chart_brush.commons.d.ts +7 -0
  170. package/lib/component/utility/core_slots/core_operator_chart_brush.commons.d.ts.map +1 -0
  171. package/lib/component/utility/core_slots/core_operator_chart_brush.commons.js +82 -0
  172. package/lib/component/utility/core_slots/core_operator_chart_brush.commons.js.map +1 -0
  173. package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.d.ts +8 -0
  174. package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.d.ts.map +1 -0
  175. package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.js +11 -0
  176. package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.js.map +1 -0
  177. package/lib/component/utility/core_slots/core_operator_chart_svg.js +1 -13
  178. package/lib/component/utility/core_slots/core_operator_chart_svg.js.map +1 -1
  179. package/lib/versionInfo.js +1 -1
  180. package/package.json +5 -6
  181. package/src/component/1d/BrushTracker1D.tsx +19 -21
  182. package/src/component/1d/Viewer1D.tsx +2 -0
  183. package/src/component/1d/plugin_chart_brush_tracker.tsx +63 -0
  184. package/src/component/1d-2d/tools/BrushXY.tsx +1 -1
  185. package/src/component/1d-2d/tools/CrossLinePointer.tsx +1 -1
  186. package/src/component/2d/BrushTracker2D.tsx +5 -5
  187. package/src/component/2d/utilities/DimensionLayout.ts +1 -1
  188. package/src/component/EventsTrackers/BrushTracker.tsx +118 -115
  189. package/src/component/EventsTrackers/brush_tracker.types.ts +111 -0
  190. package/src/component/EventsTrackers/brush_tracker_events_listeners.ts +32 -0
  191. package/src/component/elements/tanstack_table/create_action_column.tsx +43 -0
  192. package/src/component/elements/tanstack_table/create_column_helper.ts +11 -0
  193. package/src/component/elements/tanstack_table/elements/table_context.ts +15 -0
  194. package/src/component/elements/tanstack_table/elements/table_header.tsx +111 -0
  195. package/src/component/elements/{ReactTable/Elements/ReactTableRow.tsx → tanstack_table/elements/table_row.tsx} +51 -50
  196. package/src/component/elements/tanstack_table/features.ts +33 -0
  197. package/src/component/elements/tanstack_table/index.ts +5 -0
  198. package/src/component/elements/{ReactTable/ReactTable.tsx → tanstack_table/table.tsx} +78 -157
  199. package/src/component/elements/tanstack_table/types.ts +86 -0
  200. package/src/component/header/AutoPeakPickingOptionPanel.tsx +1 -1
  201. package/src/component/modal/ImportPublicationStringModal.tsx +160 -136
  202. package/src/component/modal/LogsHistoryModal.tsx +32 -25
  203. package/src/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.tsx +28 -24
  204. package/src/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.tsx +27 -25
  205. package/src/component/modal/metaImportation/MetaImportationModal.tsx +19 -15
  206. package/src/component/panels/AutomaticAssignment/AutomaticAssignmentTable.tsx +27 -25
  207. package/src/component/panels/IntegralsPanel/IntegralTable.tsx +75 -89
  208. package/src/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.tsx +68 -60
  209. package/src/component/panels/PeaksPanel/PeaksTable.tsx +126 -124
  210. package/src/component/panels/PeaksPanel/peaksToTSV.ts +14 -15
  211. package/src/component/panels/RangesPanel/RangesTable.tsx +3 -2
  212. package/src/component/panels/RangesPanel/RangesTableRow.tsx +2 -2
  213. package/src/component/panels/SpectraPanel/SpectraTable.tsx +58 -36
  214. package/src/component/panels/SpectraPanel/base/SpectraColumnsManager.tsx +31 -35
  215. package/src/component/panels/SummaryPanel/SetShiftTolerancesModal.tsx +25 -20
  216. package/src/component/panels/ZonesPanel/ZonesTableRow.tsx +2 -2
  217. package/src/component/panels/databasePanel/DatabasePanel.tsx +1 -1
  218. package/src/component/panels/databasePanel/DatabaseTable.tsx +189 -183
  219. package/src/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.tsx +20 -20
  220. package/src/component/panels/informationPanel/InformationEditionModal.tsx +40 -37
  221. package/src/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.tsx +23 -24
  222. package/src/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.tsx +33 -24
  223. package/src/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.tsx +34 -31
  224. package/src/component/panels/spectrumSimulation/SpinSystemTable.tsx +19 -18
  225. package/src/component/reducer/actions/DatabaseActions.ts +4 -3
  226. package/src/component/reducer/actions/InsetActions.ts +1 -1
  227. package/src/component/reducer/actions/ToolsActions.ts +1 -1
  228. package/src/component/reducer/helper/Zoom1DManager.ts +1 -1
  229. package/src/component/reducer/helper/ZoomHistoryManager.ts +1 -1
  230. package/src/component/reducer/preferences/actions/matrixGeneration.ts +1 -1
  231. package/src/component/utility/Events.tsx +1 -1
  232. package/src/component/utility/core_slots/core_operator_brush.commons.ts +18 -0
  233. package/src/component/utility/core_slots/core_operator_chart_brush.commons.ts +138 -0
  234. package/src/component/utility/core_slots/core_operator_chart_brush_tracker.tsx +27 -0
  235. package/src/component/utility/core_slots/core_operator_chart_svg.tsx +2 -17
  236. package/src/versionInfo.ts +1 -1
  237. package/lib/component/elements/ReactTable/BaseReactTable.d.ts.map +0 -1
  238. package/lib/component/elements/ReactTable/BaseReactTable.js.map +0 -1
  239. package/lib/component/elements/ReactTable/Elements/EmptyDataRow.d.ts.map +0 -1
  240. package/lib/component/elements/ReactTable/Elements/EmptyDataRow.js.map +0 -1
  241. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.d.ts +0 -10
  242. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.d.ts.map +0 -1
  243. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.js +0 -27
  244. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.js.map +0 -1
  245. package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +0 -16
  246. package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts.map +0 -1
  247. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js.map +0 -1
  248. package/lib/component/elements/ReactTable/ReactTable.d.ts +0 -64
  249. package/lib/component/elements/ReactTable/ReactTable.d.ts.map +0 -1
  250. package/lib/component/elements/ReactTable/ReactTable.js.map +0 -1
  251. package/lib/component/elements/ReactTable/utility/ReactTableContext.d.ts +0 -4
  252. package/lib/component/elements/ReactTable/utility/ReactTableContext.d.ts.map +0 -1
  253. package/lib/component/elements/ReactTable/utility/ReactTableContext.js +0 -11
  254. package/lib/component/elements/ReactTable/utility/ReactTableContext.js.map +0 -1
  255. package/lib/component/elements/ReactTable/utility/addCustomColumn.d.ts +0 -19
  256. package/lib/component/elements/ReactTable/utility/addCustomColumn.d.ts.map +0 -1
  257. package/lib/component/elements/ReactTable/utility/addCustomColumn.js +0 -36
  258. package/lib/component/elements/ReactTable/utility/addCustomColumn.js.map +0 -1
  259. package/lib/component/elements/ReactTable/utility/useRowSpan.d.ts +0 -9
  260. package/lib/component/elements/ReactTable/utility/useRowSpan.d.ts.map +0 -1
  261. package/lib/component/elements/ReactTable/utility/useRowSpan.js +0 -40
  262. package/lib/component/elements/ReactTable/utility/useRowSpan.js.map +0 -1
  263. package/src/component/elements/ReactTable/Elements/ReactTableHeader.tsx +0 -81
  264. package/src/component/elements/ReactTable/utility/ReactTableContext.ts +0 -14
  265. package/src/component/elements/ReactTable/utility/addCustomColumn.tsx +0 -75
  266. package/src/component/elements/ReactTable/utility/useRowSpan.ts +0 -61
  267. /package/src/component/elements/{ReactTable/BaseReactTable.tsx → tanstack_table/elements/base_react_table.tsx} +0 -0
  268. /package/src/component/elements/{ReactTable/Elements/EmptyDataRow.tsx → tanstack_table/elements/empty_data_row.tsx} +0 -0
@@ -0,0 +1,111 @@
1
+ import type { CSSProperties, MouseEvent } from 'react';
2
+ import { FaSortAmountDown, FaSortAmountUp } from 'react-icons/fa';
3
+
4
+ import type {
5
+ TanStackReactTable,
6
+ TanStackRowData,
7
+ TanStackTableHeader,
8
+ TanStackTableHeaderGroup,
9
+ } from '../types.ts';
10
+
11
+ interface TableCellEvent {
12
+ onClick: (e: MouseEvent<HTMLTableCellElement>) => void;
13
+ }
14
+
15
+ interface TableHeaderProps<
16
+ TData extends TanStackRowData,
17
+ > extends TableCellEvent {
18
+ headerGroups: Array<TanStackTableHeaderGroup<TData>>;
19
+ table: TanStackReactTable<TData>;
20
+ }
21
+
22
+ const sortIconStyle: CSSProperties = {
23
+ position: 'absolute',
24
+ top: '50%',
25
+ transform: 'translateY(-50%)',
26
+ left: '2px',
27
+ };
28
+
29
+ export default function TableHeader<TData extends TanStackRowData>(
30
+ props: TableHeaderProps<TData>,
31
+ ) {
32
+ const { headerGroups, table, onClick } = props;
33
+ return (
34
+ <thead>
35
+ {headerGroups.map((headerGroup) => {
36
+ return (
37
+ <tr key={headerGroup.id}>
38
+ {headerGroup.headers.map((header) => (
39
+ <HeaderCell
40
+ key={header.id}
41
+ header={header}
42
+ table={table}
43
+ onClick={onClick}
44
+ />
45
+ ))}
46
+ </tr>
47
+ );
48
+ })}
49
+ </thead>
50
+ );
51
+ }
52
+
53
+ interface HeaderCellProps<
54
+ TData extends TanStackRowData,
55
+ > extends TableCellEvent {
56
+ header: TanStackTableHeader<TData>;
57
+ table: TanStackReactTable<TData>;
58
+ }
59
+
60
+ function HeaderCell<TData extends TanStackRowData>(
61
+ props: HeaderCellProps<TData>,
62
+ ) {
63
+ const { header, table, onClick } = props;
64
+
65
+ const meta = header.column.columnDef.meta;
66
+ const canSort = header.column.getCanSort();
67
+ const toggleSortingHandler = canSort
68
+ ? header.column.getToggleSortingHandler()
69
+ : undefined;
70
+ const isSorted = header.column.getIsSorted();
71
+
72
+ function clickHandler(event: MouseEvent<HTMLTableCellElement>) {
73
+ if (toggleSortingHandler) {
74
+ toggleSortingHandler(event);
75
+ onClick(event);
76
+ }
77
+ }
78
+
79
+ return (
80
+ <th
81
+ colSpan={header.colSpan}
82
+ style={{
83
+ height: '1px',
84
+ cursor: canSort ? 'pointer' : undefined,
85
+ ...meta?.style,
86
+ ...meta?.thStyle,
87
+ }}
88
+ title={
89
+ canSort
90
+ ? header.column.getNextSortingOrder() === 'asc'
91
+ ? 'Sort ascending'
92
+ : header.column.getNextSortingOrder() === 'desc'
93
+ ? 'Sort descending'
94
+ : 'Clear sort'
95
+ : undefined
96
+ }
97
+ onClick={clickHandler}
98
+ >
99
+ <span style={sortIconStyle}>
100
+ {isSorted ? (
101
+ isSorted === 'desc' ? (
102
+ <FaSortAmountDown />
103
+ ) : (
104
+ <FaSortAmountUp />
105
+ )
106
+ ) : null}
107
+ </span>
108
+ <table.FlexRender header={header} />
109
+ </th>
110
+ );
111
+ }
@@ -1,5 +1,4 @@
1
1
  /** @jsxImportSource @emotion/react */
2
-
3
2
  import type { CSSObject, SerializedStyles } from '@emotion/react';
4
3
  import { css } from '@emotion/react';
5
4
  import type { MouseEvent } from 'react';
@@ -7,16 +6,21 @@ import { useCallback, useEffect, useMemo } from 'react';
7
6
 
8
7
  import type { HighlightEventSource } from '../../../highlight/index.js';
9
8
  import { useHighlight } from '../../../highlight/index.js';
9
+ import type { BaseContextMenuProps } from '../../ContextMenuBluePrint.js';
10
10
  import { ContextMenu } from '../../ContextMenuBluePrint.js';
11
11
  import type {
12
- BaseRowStyle,
13
- HighlightSourceProps,
14
- TableContextMenuProps,
15
- } from '../ReactTable.js';
12
+ TanStackReactTable,
13
+ TanStackRowData,
14
+ TanStackTableClickEvent,
15
+ TanStackTableContextMenuProps,
16
+ TanStackTableHighlightSourceProps,
17
+ TanStackTableRow,
18
+ TanStackTableRowStyle,
19
+ } from '../types.ts';
16
20
 
17
21
  function getRowStyle(
18
22
  isActive: boolean,
19
- rowStyle: BaseRowStyle = {},
23
+ rowStyle: TanStackTableRowStyle = {},
20
24
  disableDefaultRowStyle?: boolean,
21
25
  ): SerializedStyles {
22
26
  const { hover = {}, active = {}, base = {}, activated = {} } = rowStyle;
@@ -40,19 +44,17 @@ function getRowStyle(
40
44
  ]);
41
45
  }
42
46
 
43
- export interface ClickEvent {
44
- onClick?: (event: MouseEvent, data: unknown) => void;
45
- }
46
-
47
- interface ReactTableRowProps extends ClickEvent, TableContextMenuProps {
48
- row: any;
47
+ interface TableRowProps<TData extends TanStackRowData>
48
+ extends TanStackTableClickEvent<TData>, TanStackTableContextMenuProps<TData> {
49
+ row: TanStackTableRow<TData>;
50
+ table: TanStackReactTable<TData>;
49
51
  isRowActive: boolean;
50
- rowStyle: BaseRowStyle | undefined;
52
+ rowStyle: TanStackTableRowStyle | undefined;
51
53
  disableDefaultRowStyle?: boolean;
52
54
  }
53
55
 
54
- type ReactTableRowPropsWithHighlight = ReactTableRowProps &
55
- HighlightSourceProps;
56
+ type TableRowPropsWithHighlight<TData extends TanStackRowData> =
57
+ TableRowProps<TData> & TanStackTableHighlightSourceProps<TData>;
56
58
 
57
59
  function getIDs(row: any): string[] {
58
60
  const id = row.original.id;
@@ -66,9 +68,12 @@ function getIDs(row: any): string[] {
66
68
  return [''];
67
69
  }
68
70
 
69
- function ReactTableRow(props: ReactTableRowPropsWithHighlight) {
71
+ export default function TableRow<TData extends TanStackRowData>(
72
+ props: TableRowPropsWithHighlight<TData>,
73
+ ) {
70
74
  const {
71
75
  row,
76
+ table,
72
77
  highlightedSource = 'UNKNOWN',
73
78
  getHighlightExtra,
74
79
  onContextMenuSelect,
@@ -103,54 +108,50 @@ function ReactTableRow(props: ReactTableRowPropsWithHighlight) {
103
108
  [onClick, row],
104
109
  );
105
110
 
106
- const { key: rowKey, ...otherKeyProps } = row.getRowProps();
107
111
  return (
108
112
  <ContextMenu
109
113
  data={row.original}
110
114
  options={contextMenu}
111
- onSelect={(selected) => onContextMenuSelect?.(selected, row.original)}
115
+ onSelect={(selected: Parameters<BaseContextMenuProps['onSelect']>[0]) =>
116
+ onContextMenuSelect?.(selected, row.original)
117
+ }
112
118
  as="tr"
113
119
  style={{ position: 'static' }}
114
- key={rowKey}
115
120
  css={getRowStyle(
116
121
  highlight.isActive || isRowActive,
117
122
  rowStyle,
118
123
  disableDefaultRowStyle,
119
124
  )}
120
- {...otherKeyProps}
121
125
  {...highlight.onHover}
122
126
  >
123
- {row.cells.map((cell: any) => {
124
- const {
125
- column: { style },
126
- isRowSpanned,
127
- rowSpan,
128
- } = cell;
129
- if (isRowSpanned) {
130
- return null;
131
- } else {
132
- const { key: columnKey, ...otherColumnProps } = cell.getCellProps();
133
-
134
- return (
135
- <td
136
- rowSpan={rowSpan}
137
- key={columnKey}
138
- {...otherColumnProps}
139
- onContextMenu={(e) => {
140
- e.preventDefault();
141
-
142
- return false;
143
- }}
144
- style={style}
145
- onClick={clickHandler}
146
- >
147
- {cell.render('Cell')}
148
- </td>
149
- );
150
- }
127
+ {row.getAllCells().map((cell) => {
128
+ const rowSpan = cell.getRowSpan();
129
+ const colSpan = cell.getColSpan();
130
+ // When span is 0, it means that the cell is covered by another one,
131
+ // so it should not be rendered.
132
+ if (rowSpan === 0 || colSpan === 0) return null;
133
+
134
+ const meta = cell.column.columnDef.meta;
135
+ return (
136
+ <td
137
+ key={cell.id}
138
+ rowSpan={rowSpan}
139
+ colSpan={colSpan}
140
+ onContextMenu={(e) => {
141
+ e.preventDefault();
142
+
143
+ return false;
144
+ }}
145
+ style={{
146
+ ...meta?.style,
147
+ ...meta?.tdStyle,
148
+ }}
149
+ onClick={clickHandler}
150
+ >
151
+ <table.FlexRender cell={cell} />
152
+ </td>
153
+ );
151
154
  })}
152
155
  </ContextMenu>
153
156
  );
154
157
  }
155
-
156
- export default ReactTableRow;
@@ -0,0 +1,33 @@
1
+ import {
2
+ cellSpanningFeature,
3
+ createSortedRowModel,
4
+ metaHelper,
5
+ rowSortingFeature,
6
+ sortFn_alphanumeric as sortFnAlphanumeric,
7
+ sortFn_basic as sortFnBasic,
8
+ sortFn_datetime as sortFnDatetime,
9
+ sortFn_text as sortFnText,
10
+ tableFeatures,
11
+ } from '@tanstack/react-table';
12
+ import type { CSSProperties } from 'react';
13
+
14
+ interface TanStackTableColumnMeta {
15
+ style?: CSSProperties;
16
+ thStyle?: CSSProperties;
17
+ tdStyle?: CSSProperties;
18
+ }
19
+
20
+ export const tanStackTableFeatures = tableFeatures({
21
+ cellSpanningFeature,
22
+ rowSortingFeature,
23
+ sortedRowModel: createSortedRowModel(),
24
+ sortFns: {
25
+ alphanumeric: sortFnAlphanumeric,
26
+ basic: sortFnBasic,
27
+ datetime: sortFnDatetime,
28
+ text: sortFnText,
29
+ },
30
+ columnMeta: metaHelper<TanStackTableColumnMeta>(),
31
+ });
32
+
33
+ export type TanStackTableFeatures = typeof tanStackTableFeatures;
@@ -0,0 +1,5 @@
1
+ export * from './create_action_column.tsx';
2
+ export * from './create_column_helper.ts';
3
+ export * from './features.ts';
4
+ export { default as TanStackTable } from './table.tsx';
5
+ export * from './types.ts';
@@ -1,7 +1,7 @@
1
- /* eslint-disable unicorn/prefer-logical-operator-over-ternary */
2
1
  /** @jsxImportSource @emotion/react */
3
2
  import type { CSSObject, SerializedStyles } from '@emotion/react';
4
3
  import { css } from '@emotion/react';
4
+ import { useTable } from '@tanstack/react-table';
5
5
  import type {
6
6
  CSSProperties,
7
7
  MouseEvent,
@@ -10,7 +10,6 @@ import type {
10
10
  UIEvent,
11
11
  } from 'react';
12
12
  import {
13
- forwardRef,
14
13
  memo,
15
14
  useEffect,
16
15
  useLayoutEffect,
@@ -19,105 +18,62 @@ import {
19
18
  useState,
20
19
  } from 'react';
21
20
  import { useResizeObserver } from 'react-d3-utils';
22
- import type {
23
- CellProps,
24
- Column as ReactColumn,
25
- Row,
26
- TableInstance,
27
- UseSortByColumnOptions,
28
- UseSortByInstanceProps,
29
- UseSortByOptions,
30
- UseTableOptions,
31
- } from 'react-table';
32
- import { useSortBy, useTable } from 'react-table';
33
21
 
34
- import type {
35
- HighlightEventSourceExtra,
36
- HighlightEventSourceType,
37
- } from '../../highlight/index.js';
38
- import type { BaseContextMenuProps } from '../ContextMenuBluePrint.js';
39
-
40
- import { BaseReactTable } from './BaseReactTable.js';
41
- import { EmptyDataRow } from './Elements/EmptyDataRow.js';
42
- import ReactTableHeader from './Elements/ReactTableHeader.js';
43
- import type { ClickEvent } from './Elements/ReactTableRow.js';
44
- import ReactTableRow from './Elements/ReactTableRow.js';
22
+ import { BaseReactTable } from './elements/base_react_table.tsx';
23
+ import { EmptyDataRow } from './elements/empty_data_row.tsx';
45
24
  import {
46
- ReactTableProvider,
47
- useReactTableContext,
48
- } from './utility/ReactTableContext.js';
49
- import type { RowSpanHeaders } from './utility/useRowSpan.js';
50
- import useRowSpan, { prepareRowSpan } from './utility/useRowSpan.js';
51
-
52
- export type HighlightSourceProps = {
53
- [K in HighlightEventSourceType]: HighlightEventSourceExtra<K> extends never
54
- ? { highlightedSource?: K; getHighlightExtra?: never }
55
- : {
56
- highlightedSource: K;
57
- getHighlightExtra: (row: any) => HighlightEventSourceExtra<K>;
58
- };
59
- }[HighlightEventSourceType];
60
-
61
- interface ExtraColumn<T extends object> {
62
- enableRowSpan?: boolean;
63
- style?: CSSProperties;
64
- Cell?: (cell: CellProps<T>) => ReactElement | string;
65
- }
66
-
67
- export type Column<T extends object = object> = ReactColumn<T> &
68
- ExtraColumn<T> &
69
- UseSortByColumnOptions<T>;
70
-
71
- type TableInstanceWithHooks<T extends object> = TableInstance<T> & {
72
- rowSpanHeaders: RowSpanHeaders;
73
- } & UseSortByInstanceProps<T>;
74
-
75
- type TableOptions<T extends object> = UseTableOptions<T> & UseSortByOptions<T>;
76
-
77
- interface SortEvent {
78
- onSortEnd?: (data: any, isTableSorted?: boolean) => void;
79
- }
80
-
81
- export interface BaseRowStyle {
82
- active?: CSSProperties;
83
- activated?: CSSProperties;
84
- hover?: CSSProperties;
85
- base?: CSSProperties;
86
- }
87
-
88
- export interface TableContextMenuProps {
89
- onContextMenuSelect?: (
90
- selected: Parameters<BaseContextMenuProps['onSelect']>[0],
91
- data: any,
92
- ) => void;
93
- contextMenu?: BaseContextMenuProps['options'];
94
- }
95
- interface ReactTableProps<T extends object>
96
- extends TableContextMenuProps, ClickEvent, SortEvent {
97
- data: T[];
98
- columns: Array<Column<T>>;
25
+ TanStackTableProvider,
26
+ useTanStackTableContext,
27
+ } from './elements/table_context.ts';
28
+ import TableHeader from './elements/table_header.tsx';
29
+ import TableRow from './elements/table_row.tsx';
30
+ import { tanStackTableFeatures } from './features.ts';
31
+ import type {
32
+ TanStackRowData,
33
+ TanStackTableClickEvent,
34
+ TanStackTableColumn,
35
+ TanStackTableContextMenuProps,
36
+ TanStackTableHighlightSourceProps,
37
+ TanStackTableRow,
38
+ TanStackTableRowStyle,
39
+ TanStackTableSortEvent,
40
+ TanStackTableVirtualBoundary,
41
+ } from './types.ts';
42
+
43
+ interface TanStackTableProps<TData extends TanStackRowData>
44
+ extends
45
+ TanStackTableContextMenuProps<TData>,
46
+ TanStackTableClickEvent<TData>,
47
+ TanStackTableSortEvent<TData> {
48
+ data: readonly TData[];
49
+ columns: ReadonlyArray<TanStackTableColumn<TData, any>>;
99
50
  approxItemHeight?: number;
100
51
  approxColumnWidth?: number;
101
- groupKey?: keyof T;
52
+ groupKey?: keyof TData;
102
53
  indexKey?: string;
103
54
  enableVirtualScroll?: boolean;
104
55
  enableColumnsVirtualScroll?: boolean;
105
- activeRow?: (data: Row<T>) => boolean;
56
+ activeRow?: (data: TanStackTableRow<TData>) => boolean;
106
57
  enableDefaultActiveRow?: boolean;
107
58
  totalCount?: number;
108
59
  emptyDataRowText?: string;
109
- rowStyle?: BaseRowStyle | ((data: T) => BaseRowStyle | undefined);
60
+ rowStyle?:
61
+ | TanStackTableRowStyle
62
+ | ((row: TanStackTableRow<TData>) => TanStackTableRowStyle | undefined);
110
63
  style?: CSSObject | SerializedStyles;
111
64
  disableDefaultRowStyle?: boolean;
65
+ enableCellSpanning?: boolean;
112
66
  }
113
67
 
114
- type ReactTableInnerProps<T extends object> = ReactTableProps<T> &
115
- HighlightSourceProps & {
116
- onScroll?: (event: UIEvent<HTMLDivElement>) => void;
117
- };
68
+ type ReactTableInnerProps<TData extends TanStackRowData> =
69
+ TanStackTableProps<TData> &
70
+ TanStackTableHighlightSourceProps<TData> & {
71
+ containerRef: Ref<HTMLDivElement>;
72
+ onScroll?: (event: UIEvent<HTMLDivElement>) => void;
73
+ };
118
74
 
119
- type ReactTableOuterProps<T extends object> = ReactTableProps<T> &
120
- HighlightSourceProps;
75
+ type ReactTableOuterProps<TData extends TanStackRowData> =
76
+ TanStackTableProps<TData> & TanStackTableHighlightSourceProps<TData>;
121
77
 
122
78
  const styles = {
123
79
  table: (
@@ -150,13 +106,8 @@ const counterStyle: CSSProperties = {
150
106
  fontSize: '1.4em',
151
107
  };
152
108
 
153
- const ReactTableInner = forwardRef(TableInner) as <T extends object = any>(
154
- props: ReactTableInnerProps<T> & { ref?: Ref<HTMLDivElement> },
155
- ) => ReactElement;
156
-
157
- function TableInner<T extends object>(
158
- props: ReactTableInnerProps<T>,
159
- ref: Ref<HTMLDivElement>,
109
+ function TanStackTableInner<TData extends TanStackRowData>(
110
+ props: ReactTableInnerProps<TData>,
160
111
  ) {
161
112
  const {
162
113
  data,
@@ -170,7 +121,6 @@ function TableInner<T extends object>(
170
121
  enableVirtualScroll = false,
171
122
  enableColumnsVirtualScroll = false,
172
123
  approxColumnWidth = 40,
173
- groupKey,
174
124
  onClick,
175
125
  activeRow,
176
126
  totalCount,
@@ -180,10 +130,12 @@ function TableInner<T extends object>(
180
130
  disableDefaultRowStyle = false,
181
131
  enableDefaultActiveRow = false,
182
132
  emptyDataRowText = 'No Data',
133
+ containerRef,
134
+ enableCellSpanning,
183
135
  } = props;
184
136
 
185
137
  const isSortedEventTriggered = useRef<boolean>(false);
186
- const virtualBoundary = useReactTableContext();
138
+ const virtualBoundary = useTanStackTableContext();
187
139
  const [rowIndex, setRowIndex] = useState<number>();
188
140
  const timeoutIdRef = useRef<NodeJS.Timeout>();
189
141
  const [isCounterVisible, setCounterVisibility] = useState(false);
@@ -199,25 +151,15 @@ function TableInner<T extends object>(
199
151
  : columns;
200
152
  }, [enableColumnsVirtualScroll, virtualBoundary.columns, columns]);
201
153
 
202
- const {
203
- getTableProps,
204
- getTableBodyProps,
205
- headerGroups,
206
- rows,
207
- prepareRow,
208
- rowSpanHeaders,
209
- state, // Access the sort state here
210
- } = useTable(
211
- {
212
- columns: memoColumns,
213
- data,
214
- autoResetSortBy: false,
215
- } as TableOptions<T>,
216
- useSortBy,
217
- useRowSpan,
218
- ) as TableInstanceWithHooks<T>;
219
-
220
- const { sortBy } = state as any;
154
+ const table = useTable({
155
+ features: tanStackTableFeatures,
156
+ data,
157
+ columns: memoColumns,
158
+ enableCellSpanning,
159
+ });
160
+
161
+ const sortBy = table.state.sorting;
162
+ const rows = table.getRowModel().rows;
221
163
 
222
164
  function clickHandler(event: MouseEvent, row: any) {
223
165
  setRowIndex(row.index);
@@ -263,14 +205,14 @@ function TableInner<T extends object>(
263
205
 
264
206
  const lastRow = rowsData.at(-1);
265
207
  const index = (lastRow?.original as any)?.[indexKey] || lastRow?.index;
266
- const total = totalCount ? totalCount : data.length;
208
+ const total = totalCount || data.length;
267
209
 
268
- const startColumn = columns[virtualBoundary.columns.start]?.Header;
210
+ const startColumn = columns[virtualBoundary.columns.start]?.header;
269
211
 
270
212
  return (
271
213
  <>
272
214
  <div
273
- ref={ref}
215
+ ref={containerRef}
274
216
  className="table-container"
275
217
  style={{
276
218
  overflowY: 'auto',
@@ -293,14 +235,14 @@ function TableInner<T extends object>(
293
235
  }}
294
236
  />
295
237
  <BaseReactTable
296
- {...getTableProps()}
297
238
  style={styles.table(enableVirtualScroll, enableColumnsVirtualScroll)}
298
239
  >
299
- <ReactTableHeader
300
- headerGroups={headerGroups}
240
+ <TableHeader
241
+ headerGroups={table.getHeaderGroups()}
242
+ table={table}
301
243
  onClick={headerClickHandler}
302
244
  />
303
- <tbody {...getTableBodyProps()}>
245
+ <tbody>
304
246
  {!data ||
305
247
  (data?.length === 0 && (
306
248
  <EmptyDataRow
@@ -309,27 +251,16 @@ function TableInner<T extends object>(
309
251
  />
310
252
  ))}
311
253
  {rowsData.map((row, index) => {
312
- prepareRow(row);
313
-
314
- prepareRowSpan(
315
- rows,
316
- enableVirtualScroll
317
- ? index + virtualBoundary.rows.start
318
- : index,
319
- rowSpanHeaders,
320
- groupKey,
321
- );
322
- const { key, ...restRowProps } = row.getRowProps();
323
254
  const highlightSourceProps = {
324
255
  highlightedSource,
325
256
  getHighlightExtra,
326
- } as HighlightSourceProps;
257
+ } as TanStackTableHighlightSourceProps<TData>;
327
258
 
328
259
  return (
329
- <ReactTableRow
330
- key={key}
331
- {...restRowProps}
260
+ <TableRow
261
+ key={row.id}
332
262
  row={row}
263
+ table={table}
333
264
  contextMenu={contextMenu}
334
265
  onContextMenuSelect={onContextMenuSelect}
335
266
  onClick={
@@ -345,9 +276,7 @@ function TableInner<T extends object>(
345
276
  : activeRow(row)
346
277
  }
347
278
  rowStyle={
348
- typeof rowStyle === 'function'
349
- ? rowStyle(row as T)
350
- : rowStyle
279
+ typeof rowStyle === 'function' ? rowStyle(row) : rowStyle
351
280
  }
352
281
  disableDefaultRowStyle={disableDefaultRowStyle}
353
282
  {...highlightSourceProps}
@@ -377,16 +306,9 @@ function TableInner<T extends object>(
377
306
  );
378
307
  }
379
308
 
380
- interface VirtualBoundary {
381
- start: number;
382
- end: number;
383
- }
384
- export interface TableVirtualBoundary {
385
- rows: VirtualBoundary;
386
- columns: VirtualBoundary;
387
- }
388
-
389
- function ReactTable<T extends object>(props: ReactTableOuterProps<T>) {
309
+ function TanStackTable<TData extends TanStackRowData>(
310
+ props: ReactTableOuterProps<TData>,
311
+ ) {
390
312
  const {
391
313
  data,
392
314
  approxItemHeight = 40,
@@ -403,7 +325,7 @@ function ReactTable<T extends object>(props: ReactTableOuterProps<T>) {
403
325
  useResizeObserver();
404
326
 
405
327
  const [tableVirtualBoundary, setTableVirtualBoundary] =
406
- useState<TableVirtualBoundary>({
328
+ useState<TanStackTableVirtualBoundary>({
407
329
  rows: {
408
330
  start: 1,
409
331
  end: 0,
@@ -489,7 +411,6 @@ function ReactTable<T extends object>(props: ReactTableOuterProps<T>) {
489
411
  function findEndIndex(index: number, numberOfVisibleRows: number) {
490
412
  const newIndex = index + numberOfVisibleRows;
491
413
  const currentIndx = newIndex >= data.length ? data.length - 1 : newIndex;
492
- // return currentIndx;
493
414
  // Look for the last index of the group
494
415
  return lookForGroupIndex(currentIndx, 1);
495
416
  }
@@ -521,7 +442,7 @@ function ReactTable<T extends object>(props: ReactTableOuterProps<T>) {
521
442
  }
522
443
 
523
444
  return (
524
- <ReactTableProvider value={tableVirtualBoundary}>
445
+ <TanStackTableProvider value={tableVirtualBoundary}>
525
446
  <div
526
447
  ref={mRef}
527
448
  css={css(
@@ -532,17 +453,17 @@ function ReactTable<T extends object>(props: ReactTableOuterProps<T>) {
532
453
  style,
533
454
  )}
534
455
  >
535
- <ReactTableInner<T>
456
+ <TanStackTableInner<TData>
536
457
  onScroll={scrollHandler}
537
458
  onSortEnd={onSortEnd}
538
- ref={containerRef}
459
+ containerRef={containerRef}
539
460
  {...props}
540
461
  />
541
462
  </div>
542
- </ReactTableProvider>
463
+ </TanStackTableProvider>
543
464
  );
544
465
  }
545
466
 
546
- export default memo(ReactTable) as <T extends object = any>(
547
- props: ReactTableOuterProps<T>,
467
+ export default memo(TanStackTable) as <TData extends TanStackRowData>(
468
+ props: ReactTableOuterProps<TData>,
548
469
  ) => ReactElement;