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
@@ -6,16 +6,17 @@ import { useCallback, useMemo } from 'react';
6
6
  import { Controller, useForm, useWatch } from 'react-hook-form';
7
7
  import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
8
8
  import { Button } from 'react-science/ui';
9
- import type { CellProps } from 'react-table';
10
9
  import { array, mixed, object, string } from 'yup';
11
10
 
12
11
  import { useDispatch } from '../../context/DispatchContext.js';
13
12
  import { Input2Controller } from '../../elements/Input2Controller.js';
14
- import type { Column } from '../../elements/ReactTable/ReactTable.js';
15
- import ReactTable from '../../elements/ReactTable/ReactTable.js';
16
13
  import { Select2Controller } from '../../elements/Select2Controller.tsx';
17
14
  import { StandardDialog } from '../../elements/StandardDialog.tsx';
18
15
  import { StyledDialogBody } from '../../elements/StyledDialogBody.js';
16
+ import {
17
+ TanStackTable,
18
+ createTanStackColumnHelper,
19
+ } from '../../elements/tanstack_table/index.ts';
19
20
  import { useSelectedSpectra } from '../../hooks/useSelectedSpectra.ts';
20
21
  import { checkUniqueByKey } from '../../utility/checkUniqueByKey.js';
21
22
 
@@ -289,7 +290,7 @@ function InnerInformationPanel(props: InnerInformationPanelProps) {
289
290
  const dispatch = useDispatch();
290
291
  const spectra = useSelectedSpectra();
291
292
  const disabled = (spectra?.length ?? 0) < 2;
292
- const { handleSubmit, reset, control } = useForm<{
293
+ const { handleSubmit, reset, control, getValues } = useForm<{
293
294
  metaInfo: MetaInfoItem[];
294
295
  }>({
295
296
  defaultValues: { metaInfo },
@@ -297,28 +298,30 @@ function InnerInformationPanel(props: InnerInformationPanelProps) {
297
298
  });
298
299
 
299
300
  const addHandler = useCallback(
300
- (data: any, index = 0) => {
301
- const meta = {
301
+ (index = 0) => {
302
+ const meta: MetaInfoItem = {
302
303
  key: '',
303
304
  value: '',
304
305
  scope: 'all',
305
- spectra: spectra?.map(({ id }) => id),
306
+ spectra: spectra?.map(({ id }) => id) || [],
306
307
  };
308
+ const data = getValues('metaInfo') || [];
307
309
  reset({
308
310
  metaInfo: [...data.slice(0, index), meta, ...data.slice(index)],
309
311
  });
310
312
  },
311
- [reset, spectra],
313
+ [getValues, reset, spectra],
312
314
  );
313
315
 
314
316
  const deleteHandler = useCallback(
315
- (data: any, index: number) => {
317
+ (index: number) => {
318
+ const data = getValues('metaInfo') || [];
316
319
  const meta = data.filter(
317
320
  (_: any, columnIndex: any) => columnIndex !== index,
318
321
  );
319
322
  reset({ metaInfo: meta });
320
323
  },
321
- [reset],
324
+ [getValues, reset],
322
325
  );
323
326
 
324
327
  function saveHandler(values: any) {
@@ -328,17 +331,18 @@ function InnerInformationPanel(props: InnerInformationPanelProps) {
328
331
  onCloseDialog();
329
332
  }
330
333
 
331
- const COLUMNS = useMemo<Array<Column<MetaInfoItem>>>(
332
- () => [
334
+ const COLUMNS = useMemo(() => {
335
+ const columnHelper = createTanStackColumnHelper<MetaInfoItem>();
336
+ return columnHelper.columns([
333
337
  {
334
- Header: '#',
335
- style: { width: '25px', textAlign: 'center' },
336
- accessor: (_, index) => index + 1,
338
+ header: '#',
339
+ meta: { style: { width: '25px', textAlign: 'center' } },
340
+ accessorFn: (_, index) => index + 1,
337
341
  },
338
342
  {
339
- Header: 'Key',
340
- style: { padding: 0 },
341
- Cell: ({ row }: CellProps<MetaInfoItem>) => {
343
+ header: 'Key',
344
+ meta: { style: { padding: 0 } },
345
+ cell: ({ row }) => {
342
346
  return (
343
347
  <Input2Controller
344
348
  control={control}
@@ -350,9 +354,9 @@ function InnerInformationPanel(props: InnerInformationPanelProps) {
350
354
  },
351
355
  },
352
356
  {
353
- Header: 'Value',
354
- style: { padding: 0 },
355
- Cell: ({ row }: CellProps<MetaInfoItem>) => {
357
+ header: 'Value',
358
+ meta: { style: { padding: 0 } },
359
+ cell: ({ row }) => {
356
360
  const values = Object.values(row.original.values || {});
357
361
  const uniqueValues = new Set(values);
358
362
  const isMixed = uniqueValues.size > 1;
@@ -378,9 +382,9 @@ function InnerInformationPanel(props: InnerInformationPanelProps) {
378
382
  },
379
383
  },
380
384
  {
381
- Header: 'Scope',
382
- style: { padding: 0 },
383
- Cell: ({ row }: CellProps<MetaInfoItem>) => {
385
+ header: 'Scope',
386
+ meta: { style: { padding: 0 } },
387
+ cell: ({ row }) => {
384
388
  return (
385
389
  <Select2Controller
386
390
  disabled={disabled}
@@ -400,9 +404,9 @@ function InnerInformationPanel(props: InnerInformationPanelProps) {
400
404
  },
401
405
  },
402
406
  {
403
- Header: 'Spectra',
404
- style: { padding: 0 },
405
- Cell: ({ row }: CellProps<MetaInfoItem>) => {
407
+ header: 'Spectra',
408
+ meta: { style: { padding: 0 } },
409
+ cell: ({ row }) => {
406
410
  return (
407
411
  <Controller
408
412
  name={`metaInfo.${row.index}.spectra`}
@@ -422,10 +426,10 @@ function InnerInformationPanel(props: InnerInformationPanelProps) {
422
426
  },
423
427
  },
424
428
  {
425
- Header: '',
426
- style: { width: '60px' },
429
+ header: '',
430
+ meta: { style: { width: '60px' } },
427
431
  id: 'action-button',
428
- Cell: ({ data, row }: CellProps<MetaInfoItem>) => {
432
+ cell: ({ row }) => {
429
433
  return (
430
434
  <div style={{ display: 'flex', justifyContent: 'space-evenly' }}>
431
435
  <Button
@@ -435,7 +439,7 @@ function InnerInformationPanel(props: InnerInformationPanelProps) {
435
439
  tooltipProps={{ content: '', disabled: true }}
436
440
  onClick={(e) => {
437
441
  e.stopPropagation();
438
- addHandler(data, row.index + 1);
442
+ addHandler(row.index + 1);
439
443
  }}
440
444
  >
441
445
  <FaPlus className={Classes.ICON} />
@@ -447,7 +451,7 @@ function InnerInformationPanel(props: InnerInformationPanelProps) {
447
451
  tooltipProps={{ content: '', disabled: true }}
448
452
  onClick={(e) => {
449
453
  e.stopPropagation();
450
- deleteHandler(data, row.index);
454
+ deleteHandler(row.index);
451
455
  }}
452
456
  >
453
457
  <FaRegTrashAlt className={Classes.ICON} />
@@ -456,9 +460,8 @@ function InnerInformationPanel(props: InnerInformationPanelProps) {
456
460
  );
457
461
  },
458
462
  },
459
- ],
460
- [addHandler, control, deleteHandler, disabled],
461
- );
463
+ ]);
464
+ }, [addHandler, control, deleteHandler, disabled]);
462
465
 
463
466
  const values = useWatch({ name: 'metaInfo', control });
464
467
 
@@ -472,7 +475,7 @@ function InnerInformationPanel(props: InnerInformationPanelProps) {
472
475
  size="medium"
473
476
  variant="outlined"
474
477
  icon="plus"
475
- onClick={() => addHandler(values)}
478
+ onClick={() => addHandler()}
476
479
  tooltipProps={{ content: '', disabled: true }}
477
480
  >
478
481
  Add a new meta
@@ -480,7 +483,7 @@ function InnerInformationPanel(props: InnerInformationPanelProps) {
480
483
  <RowCount>{spectra?.length} spectra selected</RowCount>
481
484
  </Toolbar>
482
485
 
483
- <ReactTable<MetaInfoItem>
486
+ <TanStackTable
484
487
  data={values}
485
488
  columns={COLUMNS}
486
489
  emptyDataRowText="No meta"
@@ -1,15 +1,15 @@
1
1
  import styled from '@emotion/styled';
2
2
  import { Fragment, useMemo } from 'react';
3
- import type { CellProps, Row } from 'react-table';
4
3
 
5
4
  import type { SpectraAnalysisData } from '../../../data/data1d/multipleSpectraAnalysis.js';
6
5
  import { usePreferences } from '../../context/PreferencesContext.js';
7
6
  import { useSortSpectra } from '../../context/SortSpectraContext.js';
8
7
  import { ColorDot } from '../../elements/ColorDot.tsx';
9
8
  import { EmptyText } from '../../elements/EmptyText.js';
10
- import ReactTable from '../../elements/ReactTable/ReactTable.js';
11
- import type { CustomColumn } from '../../elements/ReactTable/utility/addCustomColumn.js';
12
- import addCustomColumn from '../../elements/ReactTable/utility/addCustomColumn.js';
9
+ import {
10
+ TanStackTable,
11
+ createTanStackColumnHelper,
12
+ } from '../../elements/tanstack_table/index.ts';
13
13
  import { useFormatNumberByNucleus } from '../../hooks/useFormatNumberByNucleus.js';
14
14
  import { usePanelPreferences } from '../../hooks/usePanelPreferences.js';
15
15
  import evaluate from '../../utility/Evaluate.js';
@@ -44,6 +44,8 @@ interface MultipleSpectraAnalysisTableProps {
44
44
 
45
45
  type ValueType = SpectraAnalysisData['values'][number];
46
46
 
47
+ const columnHelper = createTanStackColumnHelper<ValueType>();
48
+
47
49
  function MultipleSpectraAnalysisTable(
48
50
  props: MultipleSpectraAnalysisTableProps,
49
51
  ) {
@@ -81,20 +83,19 @@ function MultipleSpectraAnalysisTable(
81
83
  });
82
84
  }
83
85
 
84
- const columns: Array<CustomColumn<ValueType>> = [
86
+ const columns = columnHelper.columns([
85
87
  {
86
- Header: '#',
87
- index: 0,
88
- accessor: (_, index) => index !== undefined && index + 1,
89
- disableSortBy: true,
90
- Cell: ({ row, data }: CellProps<any>) => {
88
+ header: '#',
89
+ accessorFn: (_, index) => index !== undefined && index + 1,
90
+ enableSorting: false,
91
+ cell: ({ row }) => {
91
92
  const spectrumId = row.original[Object.keys(row.original)[0]].SID;
92
93
  const color = spectraColors?.[spectrumId] || '#000000';
93
94
  return (
94
95
  <SerialWrapper>
95
96
  <Serial>
96
97
  {String(row.index + 1).padStart(
97
- String(data.length).length,
98
+ String(data.values.length).length,
98
99
  '0',
99
100
  )}
100
101
  </Serial>
@@ -103,10 +104,10 @@ function MultipleSpectraAnalysisTable(
103
104
  );
104
105
  },
105
106
  },
106
- ];
107
+ ]);
107
108
 
108
- function cellHandler(row: Row<ValueType>, columnKey: string) {
109
- const value = row.original[columnKey].value;
109
+ function cellHandler(row: ValueType, columnKey: string) {
110
+ const value = row[columnKey].value;
110
111
  return (
111
112
  <AnalysisCell
112
113
  value={value}
@@ -140,25 +141,23 @@ function MultipleSpectraAnalysisTable(
140
141
  if (panelPreferences?.analysisOptions?.columns) {
141
142
  const analysisColumns = panelPreferences?.analysisOptions?.columns;
142
143
  for (const columnKey in analysisColumns) {
143
- const { index: columnIndex } = analysisColumns[columnKey];
144
- addCustomColumn<ValueType>(columns, {
145
- index: columnIndex + 1,
146
- Header: () => headerHandler(analysisColumns[columnKey], columnKey),
144
+ columns.push({
145
+ header: () => headerHandler(analysisColumns[columnKey], columnKey),
147
146
  id: columnKey,
148
- accessor: (row) => {
147
+ accessorFn: (row) => {
149
148
  return row[columnKey].value;
150
149
  },
151
- Cell: (cell: CellProps<ValueType>) =>
152
- cellHandler(cell.row, columnKey),
153
- style: { padding: 0 },
150
+ cell: ({ row }) => cellHandler(row.original, columnKey),
151
+ meta: { style: { padding: 0 } },
154
152
  });
155
153
  }
156
154
  }
157
- columns.sort((object1, object2) => object1.index - object2.index);
155
+
158
156
  return columns;
159
157
  }, [
160
158
  activeTab,
161
159
  dispatchPreferences,
160
+ data.values.length,
162
161
  format,
163
162
  panelPreferences?.analysisOptions?.columns,
164
163
  spectraColors,
@@ -187,7 +186,7 @@ function MultipleSpectraAnalysisTable(
187
186
  }
188
187
  return data?.values.length > 0 ? (
189
188
  <Fragment>
190
- <ReactTable
189
+ <TanStackTable
191
190
  data={data.values}
192
191
  columns={tableColumns}
193
192
  onSortEnd={handleSortEnd}
@@ -4,18 +4,24 @@ import { useCallback, useMemo } from 'react';
4
4
  import { useFormContext, useWatch } from 'react-hook-form';
5
5
  import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
6
6
  import { Button } from 'react-science/ui';
7
- import type { CellProps } from 'react-table';
8
7
 
9
8
  import { Input2Controller } from '../../../elements/Input2Controller.js';
10
- import type { Column } from '../../../elements/ReactTable/ReactTable.js';
11
- import ReactTable from '../../../elements/ReactTable/ReactTable.js';
9
+ import {
10
+ TanStackTable,
11
+ createTanStackColumnHelper,
12
+ } from '../../../elements/tanstack_table/index.ts';
12
13
 
13
14
  export function AnalysisTablePreferences() {
14
- const { setValue, control } = useFormContext();
15
- const columns = useWatch({ name: 'analysisOptions.columns' });
15
+ const { setValue, control, getValues } = useFormContext();
16
+ const watchedAnalysisColumns = useWatch({ name: 'analysisOptions.columns' });
17
+ const analysisColumns = useMemo(
18
+ () => watchedAnalysisColumns ?? [],
19
+ [watchedAnalysisColumns],
20
+ );
16
21
 
17
22
  const addNewColumn = useCallback(
18
- (index: any, columns: any) => {
23
+ (index: any) => {
24
+ const columns = getValues('analysisOptions.columns') ?? [];
19
25
  setValue('analysisOptions.columns', [
20
26
  ...columns,
21
27
  {
@@ -27,28 +33,31 @@ export function AnalysisTablePreferences() {
27
33
  },
28
34
  ]);
29
35
  },
30
- [setValue],
36
+ [getValues, setValue],
31
37
  );
32
38
 
33
39
  const handleDelete = useCallback(
34
- (index: any, columns: any) => {
40
+ (index: any) => {
41
+ const columns = getValues('analysisOptions.columns') ?? [];
35
42
  setValue(
36
43
  'analysisOptions.columns',
37
44
  columns.filter((_: any, colIndex: any) => colIndex !== index),
38
45
  );
39
46
  },
40
- [setValue],
47
+ [getValues, setValue],
41
48
  );
42
49
 
43
- const COLUMNS = useMemo<Array<Column<any>>>(() => {
44
- return [
50
+ const COLUMNS = useMemo(() => {
51
+ const columnHelper = createTanStackColumnHelper<any>();
52
+ return columnHelper.columns([
45
53
  {
46
- Header: '#',
47
- accessor: (_: any, index) => index + 1,
54
+ id: 'rowNumber',
55
+ header: '#',
56
+ accessorFn: (_: any, index) => index + 1,
48
57
  },
49
58
  {
50
- Header: 'Label',
51
- Cell: ({ row }: CellProps<any>) => (
59
+ header: 'Label',
60
+ cell: ({ row }) => (
52
61
  <Input2Controller
53
62
  control={control}
54
63
  name={`analysisOptions.columns.${row.index}.tempKey`}
@@ -58,8 +67,8 @@ export function AnalysisTablePreferences() {
58
67
  ),
59
68
  },
60
69
  {
61
- Header: 'Value',
62
- Cell: ({ row }: CellProps<any>) => {
70
+ header: 'Value',
71
+ cell: ({ row }) => {
63
72
  const isFormulaColumn =
64
73
  row.original.type === ANALYSIS_COLUMN_TYPES.FORMULA;
65
74
  return (
@@ -74,17 +83,17 @@ export function AnalysisTablePreferences() {
74
83
  },
75
84
  },
76
85
  {
77
- Header: '',
78
- style: { width: '70px' },
86
+ header: '',
87
+ meta: { style: { width: '70px' } },
79
88
  id: 'actions-button',
80
- Cell: ({ data, row }: CellProps<any>) => {
89
+ cell: ({ row }) => {
81
90
  return (
82
91
  <div style={{ display: 'flex', justifyContent: 'space-evenly' }}>
83
92
  <Button
84
93
  size="small"
85
94
  intent="success"
86
95
  variant="outlined"
87
- onClick={() => addNewColumn(row.index + 1, data)}
96
+ onClick={() => addNewColumn(row.index + 1)}
88
97
  >
89
98
  <FaPlus className={Classes.ICON} />
90
99
  </Button>
@@ -92,7 +101,7 @@ export function AnalysisTablePreferences() {
92
101
  size="small"
93
102
  variant="outlined"
94
103
  intent="danger"
95
- onClick={() => handleDelete(row.index, data)}
104
+ onClick={() => handleDelete(row.index)}
96
105
  >
97
106
  <FaRegTrashAlt className={Classes.ICON} />
98
107
  </Button>
@@ -100,8 +109,8 @@ export function AnalysisTablePreferences() {
100
109
  );
101
110
  },
102
111
  },
103
- ];
112
+ ]);
104
113
  }, [addNewColumn, control, handleDelete]);
105
114
 
106
- return <ReactTable columns={COLUMNS} data={columns} />;
115
+ return <TanStackTable columns={COLUMNS} data={analysisColumns} />;
107
116
  }
@@ -3,18 +3,19 @@ import type { LegendField, PredefinedLegendField } from '@zakodium/nmrium-core';
3
3
  import { useCallback, useMemo } from 'react';
4
4
  import { useFormContext, useWatch } from 'react-hook-form';
5
5
  import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
6
- import type { CellProps } from 'react-table';
7
6
 
8
7
  import { useChartData } from '../../../context/ChartContext.js';
9
8
  import { CheckController } from '../../../elements/CheckController.js';
10
9
  import { Input2Controller } from '../../../elements/Input2Controller.js';
11
- import type { Column } from '../../../elements/ReactTable/ReactTable.js';
12
- import ReactTable from '../../../elements/ReactTable/ReactTable.js';
10
+ import {
11
+ TanStackTable,
12
+ createTanStackColumnHelper,
13
+ } from '../../../elements/tanstack_table/index.ts';
13
14
  import { convertPathArrayToString } from '../../../utility/convertPathArrayToString.js';
14
15
  import { getSpectraObjectPaths } from '../../../utility/getSpectraObjectPaths.js';
15
16
 
16
17
  function LegendsPreferences() {
17
- const { setValue, control } = useFormContext();
18
+ const { setValue, control, getValues } = useFormContext();
18
19
  const { data } = useChartData();
19
20
  const { datalist, paths } = useMemo(
20
21
  () => getSpectraObjectPaths(data),
@@ -24,12 +25,13 @@ function LegendsPreferences() {
24
25
  const fields = useWatch({ name: 'legendsFields' });
25
26
 
26
27
  const addHandler = useCallback(
27
- (data: readonly any[], index: number) => {
28
- let columns: any[] = [];
28
+ (index: number) => {
29
+ let columns = [];
29
30
  const emptyField = {
30
31
  jpath: null,
31
32
  visible: true,
32
33
  };
34
+ const data = getValues('legendsFields');
33
35
  if (data && Array.isArray(data)) {
34
36
  columns = [...data.slice(0, index), emptyField, ...data.slice(index)];
35
37
  } else {
@@ -37,29 +39,31 @@ function LegendsPreferences() {
37
39
  }
38
40
  setValue('legendsFields', columns);
39
41
  },
40
- [setValue],
42
+ [getValues, setValue],
41
43
  );
42
44
 
43
45
  const deleteHandler = useCallback(
44
- (data: any, index: number) => {
46
+ (index: number) => {
47
+ const data = getValues('legendsFields');
45
48
  const _fields = data.filter(
46
49
  (_: any, columnIndex: any) => columnIndex !== index,
47
50
  );
48
51
  setValue('legendsFields', _fields);
49
52
  },
50
- [setValue],
53
+ [getValues, setValue],
51
54
  );
52
55
 
53
- const COLUMNS = useMemo<Array<Column<LegendField>>>(
54
- () => [
56
+ const COLUMNS = useMemo(() => {
57
+ const columnHelper = createTanStackColumnHelper<LegendField>();
58
+ return columnHelper.columns([
55
59
  {
56
- Header: '#',
57
- style: { width: '25px' },
58
- accessor: (_, index) => index + 1,
60
+ header: '#',
61
+ meta: { style: { width: '25px' } },
62
+ accessorFn: (_, index) => index + 1,
59
63
  },
60
64
  {
61
- Header: 'Field',
62
- Cell: ({ row }: CellProps<LegendField>) => {
65
+ header: 'Field',
66
+ cell: ({ row }) => {
63
67
  const predefinedColumn = row.original as PredefinedLegendField;
64
68
  if (predefinedColumn?.name) {
65
69
  return (
@@ -74,7 +78,7 @@ function LegendsPreferences() {
74
78
  control={control}
75
79
  name={`legendsFields.${row.index}.jpath`}
76
80
  filterItems={datalist}
77
- mapOnChangeValue={(key) => (paths as any)[key] || null}
81
+ mapOnChangeValue={(key) => paths[key] || null}
78
82
  mapValue={convertPathArrayToString}
79
83
  style={{ backgroundColor: 'transparent' }}
80
84
  noShadowBox
@@ -83,9 +87,9 @@ function LegendsPreferences() {
83
87
  },
84
88
  },
85
89
  {
86
- Header: 'Visible',
87
- style: { width: '30px', textAlign: 'center' },
88
- Cell: ({ row }: CellProps<LegendField>) => (
90
+ header: 'Visible',
91
+ meta: { style: { width: '30px', textAlign: 'center' } },
92
+ cell: ({ row }) => (
89
93
  <CheckController
90
94
  control={control}
91
95
  style={{ margin: 0 }}
@@ -94,18 +98,18 @@ function LegendsPreferences() {
94
98
  ),
95
99
  },
96
100
  {
97
- Header: '',
98
- style: { width: '70px' },
101
+ header: '',
102
+ meta: { style: { width: '70px' } },
99
103
  id: 'operation-button',
100
- Cell: ({ data, row }: CellProps<LegendField>) => {
101
- const record: any = row.original;
104
+ cell: ({ row }) => {
105
+ const record = row.original;
102
106
  return (
103
107
  <div style={{ display: 'flex', justifyContent: 'space-evenly' }}>
104
108
  <Button
105
109
  size="small"
106
110
  intent="success"
107
111
  variant="outlined"
108
- onClick={() => addHandler(data, row.index + 1)}
112
+ onClick={() => addHandler(row.index + 1)}
109
113
  >
110
114
  <FaPlus className={Classes.ICON} />
111
115
  </Button>
@@ -113,8 +117,8 @@ function LegendsPreferences() {
113
117
  size="small"
114
118
  variant="outlined"
115
119
  intent="danger"
116
- onClick={() => deleteHandler(data, row.index)}
117
- disabled={record?.name}
120
+ onClick={() => deleteHandler(row.index)}
121
+ disabled={'name' in record}
118
122
  >
119
123
  <FaRegTrashAlt className={Classes.ICON} />
120
124
  </Button>
@@ -122,12 +126,11 @@ function LegendsPreferences() {
122
126
  );
123
127
  },
124
128
  },
125
- ],
126
- [addHandler, control, datalist, deleteHandler, paths],
127
- );
129
+ ]);
130
+ }, [addHandler, control, datalist, deleteHandler, paths]);
128
131
 
129
132
  return (
130
- <ReactTable
133
+ <TanStackTable
131
134
  data={fields}
132
135
  columns={COLUMNS}
133
136
  style={{ table: { height: '100%' } }}
@@ -1,12 +1,12 @@
1
1
  import type { CSSProperties } from 'react';
2
2
  import { useMemo } from 'react';
3
3
  import { useFormContext, useWatch } from 'react-hook-form';
4
- import type { CellProps } from 'react-table';
5
4
 
6
5
  import { NumberInput2Controller } from '../../elements/NumberInput2Controller.js';
7
- import type { Column } from '../../elements/ReactTable/ReactTable.js';
8
- import ReactTable from '../../elements/ReactTable/ReactTable.js';
9
- import addCustomColumn from '../../elements/ReactTable/utility/addCustomColumn.js';
6
+ import {
7
+ TanStackTable,
8
+ createTanStackColumnHelper,
9
+ } from '../../elements/tanstack_table/index.ts';
10
10
 
11
11
  const cellStyle: CSSProperties = {
12
12
  padding: '1px',
@@ -26,16 +26,17 @@ export function SpinSystemTable(props: SpinSystemTableProps) {
26
26
  const data = useWatch({ name: 'data' });
27
27
 
28
28
  const tableColumns = useMemo(() => {
29
- const columns: Array<Column<SpinSystemElement>> = [
29
+ const columnHelper = createTanStackColumnHelper<SpinSystemElement>();
30
+ const columns = columnHelper.columns([
30
31
  {
31
32
  id: 'rowLabel',
32
- Header: '',
33
- accessor: (_, index) => spinSystem.at(index),
33
+ header: '',
34
+ accessorFn: (_, index) => spinSystem.at(index),
34
35
  },
35
36
  {
36
- Header: 'Delta',
37
- style: cellStyle,
38
- Cell: ({ row }: CellProps<SpinSystemElement>) => (
37
+ header: 'Delta',
38
+ meta: { style: cellStyle },
39
+ cell: ({ row }) => (
39
40
  <NumberInput2Controller
40
41
  control={control}
41
42
  name={`data.${row.index}.0`}
@@ -44,16 +45,15 @@ export function SpinSystemTable(props: SpinSystemTableProps) {
44
45
  />
45
46
  ),
46
47
  },
47
- ];
48
- let i = 0;
48
+ ]);
49
49
 
50
+ let i = 0;
50
51
  for (const label of spinSystem.slice(0, -1)) {
51
52
  const columnIndex = i + 1;
52
- addCustomColumn(columns, {
53
+ columns.push({
53
54
  id: label,
54
- index: i,
55
- style: cellStyle,
56
- Cell: function cellRender({ row }: CellProps<SpinSystemElement>) {
55
+ meta: { style: cellStyle },
56
+ cell: function cellRender({ row }) {
57
57
  const val = row.original?.[columnIndex] ?? null;
58
58
  if (val !== null) {
59
59
  return (
@@ -67,12 +67,13 @@ export function SpinSystemTable(props: SpinSystemTableProps) {
67
67
  }
68
68
  return <div />;
69
69
  },
70
- Header: () => (
70
+ header: () => (
71
71
  <span>
72
72
  J<sub>{label}-X</sub>(Hz)
73
73
  </span>
74
74
  ),
75
75
  });
76
+
76
77
  i++;
77
78
  }
78
79
  return columns;
@@ -82,5 +83,5 @@ export function SpinSystemTable(props: SpinSystemTableProps) {
82
83
  return null;
83
84
  }
84
85
 
85
- return <ReactTable columns={tableColumns} data={data} />;
86
+ return <TanStackTable columns={tableColumns} data={data} />;
86
87
  }