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
@@ -7,14 +7,15 @@ import { useCallback, useMemo, useRef } from 'react';
7
7
  import { useFormContext, useWatch } from 'react-hook-form';
8
8
  import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
9
9
  import { Toolbar } from 'react-science/ui';
10
- import type { CellProps } from 'react-table';
11
10
 
12
11
  import { multiplets } from '../../../../../../data/constants/Multiplets.js';
13
12
  import { NumberInput2Controller } from '../../../../../elements/NumberInput2Controller.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.js';
17
14
  import { useTabsController } from '../../../../../elements/TabsProvider.js';
15
+ import {
16
+ TanStackTable,
17
+ createTanStackColumnHelper,
18
+ } from '../../../../../elements/tanstack_table/index.ts';
18
19
  import useSpectrum from '../../../../../hooks/useSpectrum.js';
19
20
  import { hasCouplingConstant } from '../../../../../panels/extra/utilities/MultiplicityUtilities.js';
20
21
  import { useEvent } from '../../../../../utility/Events.js';
@@ -57,6 +58,7 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
57
58
  setValue,
58
59
  control,
59
60
  setFocus,
61
+ getValues,
60
62
  formState: { errors },
61
63
  } = useFormContext();
62
64
  const signals = useWatch({ name: 'signals' });
@@ -125,7 +127,8 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
125
127
  );
126
128
 
127
129
  const deleteHandler = useCallback(
128
- (data: any, index: number) => {
130
+ (index: number) => {
131
+ const data = getValues(`signals.${signalIndex}.js`) || [];
129
132
  const jCouplings = data.filter(
130
133
  (_: any, columnIndex: number) => columnIndex !== index,
131
134
  );
@@ -135,24 +138,26 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
135
138
  lastSelectedCouplingIndexRef.current = null;
136
139
  }
137
140
  },
138
- [setValue, signalIndex],
141
+ [getValues, setValue, signalIndex],
139
142
  );
140
143
 
141
144
  function deleteAllHandler() {
142
145
  setValue(`signals[${signalIndex}].js`, []);
143
146
  lastSelectedCouplingIndexRef.current = null;
144
147
  }
145
- const COLUMNS = useMemo<Array<Column<Jcoupling>>>(
146
- () => [
148
+
149
+ const COLUMNS = useMemo(() => {
150
+ const columnHelper = createTanStackColumnHelper<Jcoupling>();
151
+ return columnHelper.columns([
147
152
  {
148
- Header: '#',
149
- style: { width: '25px', ...styles.column },
150
- accessor: (_: any, index) => index + 1,
153
+ header: '#',
154
+ meta: { style: { width: '25px', ...styles.column } },
155
+ accessorFn: (_: any, index) => index + 1,
151
156
  },
152
157
  {
153
- Header: 'Multiplicity',
154
- style: { padding: 0, ...styles.column },
155
- Cell: ({ row }: CellProps<Jcoupling>) => {
158
+ header: 'Multiplicity',
159
+ meta: { style: { padding: 0, ...styles.column } },
160
+ cell: ({ row }) => {
156
161
  return (
157
162
  <Select2Controller
158
163
  control={control}
@@ -184,9 +189,9 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
184
189
  },
185
190
  },
186
191
  {
187
- Header: 'J (Hz)',
188
- style: { padding: 0, ...styles.column },
189
- Cell: ({ row }: CellProps<Jcoupling>) => {
192
+ header: 'J (Hz)',
193
+ meta: { style: { padding: 0, ...styles.column } },
194
+ cell: ({ row }) => {
190
195
  return (
191
196
  <NumberInput2Controller
192
197
  control={control}
@@ -203,10 +208,10 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
203
208
  },
204
209
  },
205
210
  {
206
- Header: '',
207
- style: { width: '70px', ...styles.column },
211
+ header: '',
212
+ meta: { style: { width: '70px', ...styles.column } },
208
213
  id: 'action-button',
209
- Cell: ({ data, row }: CellProps<Jcoupling>) => {
214
+ cell: ({ row }) => {
210
215
  const record: any = row.original;
211
216
  return (
212
217
  <div style={{ display: 'flex', justifyContent: 'space-around' }}>
@@ -215,7 +220,7 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
215
220
  size="small"
216
221
  variant="outlined"
217
222
  intent="danger"
218
- onClick={() => deleteHandler(data, row.index)}
223
+ onClick={() => deleteHandler(row.index)}
219
224
  >
220
225
  <FaRegTrashAlt className={Classes.ICON} />
221
226
  </Button>
@@ -224,9 +229,8 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
224
229
  );
225
230
  },
226
231
  },
227
- ],
228
- [control, deleteHandler, setFocus, setValue, signalIndex],
229
- );
232
+ ]);
233
+ }, [control, deleteHandler, setFocus, setValue, signalIndex]);
230
234
 
231
235
  function selectRowHandler(index: number) {
232
236
  setFocusSource('coupling');
@@ -263,7 +267,7 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
263
267
  overflow: 'auto',
264
268
  }}
265
269
  >
266
- <ReactTable
270
+ <TanStackTable
267
271
  data={signal?.js || []}
268
272
  columns={COLUMNS}
269
273
  onClick={(e, rowData: any) => selectRowHandler(rowData.index)}
@@ -8,12 +8,13 @@ import { useCallback, useMemo, useRef } from 'react';
8
8
  import { useFormContext, useWatch } from 'react-hook-form';
9
9
  import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
10
10
  import { Toolbar } from 'react-science/ui';
11
- import type { CellProps } from 'react-table';
12
11
 
13
12
  import { NumberInput2Controller } from '../../../../../elements/NumberInput2Controller.js';
14
- import type { Column } from '../../../../../elements/ReactTable/ReactTable.js';
15
- import ReactTable from '../../../../../elements/ReactTable/ReactTable.js';
16
13
  import { useTabsController } from '../../../../../elements/TabsProvider.js';
14
+ import {
15
+ TanStackTable,
16
+ createTanStackColumnHelper,
17
+ } from '../../../../../elements/tanstack_table/index.ts';
17
18
  import useSpectrum from '../../../../../hooks/useSpectrum.js';
18
19
  import { useEvent } from '../../../../../utility/Events.js';
19
20
  import { useEventFocusInput } from '../SignalsContent.js';
@@ -49,7 +50,7 @@ function getPeakKey(
49
50
  export function SignalPeaksTable(props: SignalPeaksTableProps) {
50
51
  const { focusSource, setFocusSource } = useEventFocusInput();
51
52
 
52
- const { setValue, control, setFocus } = useFormContext();
53
+ const { setValue, control, setFocus, getValues } = useFormContext();
53
54
  const { signals } = useWatch();
54
55
  const { selectedTabId: signalIndex = 0 } = useTabsController<number>();
55
56
 
@@ -123,7 +124,8 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
123
124
  );
124
125
 
125
126
  const deleteHandler = useCallback(
126
- (data: any, index: number) => {
127
+ (index: number) => {
128
+ const data = getValues(`signals.${signalIndex}.peaks`) || [];
127
129
  const peaks = data.filter(
128
130
  (_: any, columnIndex: number) => columnIndex !== index,
129
131
  );
@@ -133,7 +135,7 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
133
135
  lastSelectedPeakIndexRef.current = null;
134
136
  }
135
137
  },
136
- [setValue, signalIndex],
138
+ [getValues, setValue, signalIndex],
137
139
  );
138
140
 
139
141
  function deleteAllHandler() {
@@ -150,17 +152,18 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
150
152
  [re, setValue, signalIndex, xArray],
151
153
  );
152
154
 
153
- const COLUMNS = useMemo<Array<Column<NMRPeak1D>>>(
154
- () => [
155
+ const COLUMNS = useMemo(() => {
156
+ const columnHelper = createTanStackColumnHelper<NMRPeak1D>();
157
+ return columnHelper.columns([
155
158
  {
156
- Header: '#',
157
- style: { width: '25px', ...styles.column },
158
- accessor: (_: any, index) => index + 1,
159
+ header: '#',
160
+ meta: { style: { width: '25px', ...styles.column } },
161
+ accessorFn: (_: any, index) => index + 1,
159
162
  },
160
163
  {
161
- Header: 'delta',
162
- style: { padding: 0, ...styles.column },
163
- Cell: ({ row }: CellProps<NMRPeak1D>) => {
164
+ header: 'delta',
165
+ meta: { style: { padding: 0, ...styles.column } },
166
+ cell: ({ row }) => {
164
167
  return (
165
168
  <NumberInput2Controller
166
169
  control={control}
@@ -178,9 +181,9 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
178
181
  },
179
182
  },
180
183
  {
181
- Header: 'Intensity',
182
- style: { padding: 0, ...styles.column },
183
- Cell: ({ row }: CellProps<NMRPeak1D>) => {
184
+ header: 'Intensity',
185
+ meta: { style: { padding: 0, ...styles.column } },
186
+ cell: ({ row }) => {
184
187
  return (
185
188
  <NumberInput2Controller
186
189
  control={control}
@@ -195,10 +198,10 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
195
198
  },
196
199
  },
197
200
  {
198
- Header: '',
199
- style: { width: '70px', ...styles.column },
201
+ header: '',
202
+ meta: { style: { width: '70px', ...styles.column } },
200
203
  id: 'action-button',
201
- Cell: ({ data, row }: CellProps<NMRPeak1D>) => {
204
+ cell: ({ row }) => {
202
205
  const record: any = row.original;
203
206
  return (
204
207
  <div style={{ display: 'flex', justifyContent: 'space-around' }}>
@@ -207,7 +210,7 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
207
210
  size="small"
208
211
  variant="outlined"
209
212
  intent="danger"
210
- onClick={() => deleteHandler(data, row.index)}
213
+ onClick={() => deleteHandler(row.index)}
211
214
  >
212
215
  <FaRegTrashAlt className={Classes.ICON} />
213
216
  </Button>
@@ -216,9 +219,8 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
216
219
  );
217
220
  },
218
221
  },
219
- ],
220
- [changeDeltaHandler, control, deleteHandler, signalIndex],
221
- );
222
+ ]);
223
+ }, [changeDeltaHandler, control, deleteHandler, signalIndex]);
222
224
 
223
225
  function selectRowHandler(index: number) {
224
226
  setFocusSource('peak');
@@ -250,7 +252,7 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
250
252
  overflow: 'auto',
251
253
  }}
252
254
  >
253
- <ReactTable
255
+ <TanStackTable
254
256
  data={signal?.peaks || []}
255
257
  columns={COLUMNS}
256
258
  onClick={(e, rowData: any) => selectRowHandler(rowData.index)}
@@ -21,10 +21,13 @@ import { useToaster } from '../../context/ToasterContext.js';
21
21
  import Button from '../../elements/Button.js';
22
22
  import { Input2Controller } from '../../elements/Input2Controller.js';
23
23
  import Label from '../../elements/Label.js';
24
- import type { Column } from '../../elements/ReactTable/ReactTable.js';
25
- import ReactTable from '../../elements/ReactTable/ReactTable.js';
26
24
  import { Select2Controller } from '../../elements/Select2Controller.js';
27
25
  import { StandardDialog } from '../../elements/StandardDialog.tsx';
26
+ import type { TanStackTableRow } from '../../elements/tanstack_table/index.ts';
27
+ import {
28
+ TanStackTable,
29
+ createTanStackColumnHelper,
30
+ } from '../../elements/tanstack_table/index.ts';
28
31
  import { convertPathArrayToString } from '../../utility/convertPathArrayToString.js';
29
32
  import { getSpectraObjectPaths } from '../../utility/getSpectraObjectPaths.js';
30
33
 
@@ -164,9 +167,10 @@ function InnerMetaImportationModal({
164
167
 
165
168
  const columns = useMemo(() => {
166
169
  const fields = parseResult?.meta.fields || [];
167
- const columns: Array<Column<any>> = [
168
- { Header: '#', accessor: (_: any, index) => index + 1 },
169
- ];
170
+ const columnHelper = createTanStackColumnHelper<any>();
171
+ const columns = columnHelper.columns([
172
+ { header: '#', accessorFn: (_: any, index) => index + 1 },
173
+ ]);
170
174
 
171
175
  function getRowValue(val: any) {
172
176
  if (typeof val === 'string') return val;
@@ -177,9 +181,9 @@ function InnerMetaImportationModal({
177
181
  for (const fieldName of fields) {
178
182
  if (fieldName) {
179
183
  columns.push({
180
- Header: fieldName,
181
- accessor: (row: any) => getRowValue(row[fieldName]),
182
- style: styles.column,
184
+ header: fieldName,
185
+ accessorFn: (row: any) => getRowValue(row[fieldName]),
186
+ meta: { style: styles.column },
183
187
  });
184
188
  }
185
189
  }
@@ -217,24 +221,24 @@ function InnerMetaImportationModal({
217
221
  }
218
222
  }
219
223
 
220
- function handleActiveRow(data: any) {
221
- const record = compareResults[data.index] || null;
224
+ function handleActiveRow(row: TanStackTableRow<any>) {
225
+ const record = compareResults[row.index] || null;
222
226
  if (
223
227
  record?.isDuplicated ||
224
228
  record?.spectraIDs.length > 0 ||
225
- errors?.[data.index]
229
+ errors?.[row.index]
226
230
  ) {
227
231
  return true;
228
232
  }
229
233
  return false;
230
234
  }
231
235
 
232
- function handleRowStyle(data: any) {
233
- const record = compareResults[data.index] || null;
236
+ function handleRowStyle(row: TanStackTableRow<any>) {
237
+ const record = compareResults[row.index] || null;
234
238
  if (
235
239
  record?.isDuplicated ||
236
240
  record?.spectraIDs.length > 1 ||
237
- errors?.[data.index]
241
+ errors?.[row.index]
238
242
  ) {
239
243
  return rowColors.noMatch;
240
244
  } else if (record) {
@@ -303,7 +307,7 @@ function InnerMetaImportationModal({
303
307
  </Button.Done>
304
308
  </div>
305
309
  <div style={{ height: 'calc(100% - 160px)' }}>
306
- <ReactTable
310
+ <TanStackTable
307
311
  columns={columns}
308
312
  data={metadata}
309
313
  approxItemHeight={25}
@@ -1,11 +1,13 @@
1
1
  import { SvgNmrAssignment } from 'cheminfo-font';
2
2
  import type { MouseEvent } from 'react';
3
3
  import { memo, useCallback, useMemo } from 'react';
4
- import type { CellProps } from 'react-table';
5
4
 
6
5
  import { useDispatch } from '../../context/DispatchContext.js';
7
- import ReactTable from '../../elements/ReactTable/ReactTable.js';
8
- import type { CustomColumn } from '../../elements/ReactTable/utility/addCustomColumn.js';
6
+ import type { TanStackTableRow } from '../../elements/tanstack_table/index.ts';
7
+ import {
8
+ TanStackTable,
9
+ createTanStackColumnHelper,
10
+ } from '../../elements/tanstack_table/index.ts';
9
11
 
10
12
  import type { AutoAssignmentsData } from './useAutoAssignments.js';
11
13
 
@@ -13,11 +15,12 @@ interface AutomaticAssignmentTableProps {
13
15
  data: AutoAssignmentsData[];
14
16
  }
15
17
 
16
- function AutomaticAssignmentTable({ data }: AutomaticAssignmentTableProps) {
18
+ function AutomaticAssignmentTable(props: AutomaticAssignmentTableProps) {
19
+ const { data } = props;
17
20
  const dispatch = useDispatch();
18
21
 
19
22
  const assignHandler = useCallback(
20
- (event: MouseEvent, row: any) => {
23
+ (event: MouseEvent, row: TanStackTableRow<AutoAssignmentsData>) => {
21
24
  event.preventDefault();
22
25
  event.stopPropagation();
23
26
 
@@ -29,29 +32,29 @@ function AutomaticAssignmentTable({ data }: AutomaticAssignmentTableProps) {
29
32
  [dispatch],
30
33
  );
31
34
 
32
- const COLUMNS = useMemo<Array<CustomColumn<AutoAssignmentsData>>>(
33
- () => [
35
+ const COLUMNS = useMemo(() => {
36
+ const columnHelper = createTanStackColumnHelper<AutoAssignmentsData>();
37
+ return columnHelper.columns([
34
38
  {
35
- index: 1,
36
- Header: '#',
37
- accessor: (_, index) => index + 1,
38
- style: { width: '1%', maxWidth: '40px', minWidth: '40px' },
39
+ header: '#',
40
+ accessorFn: (_, index) => index + 1,
41
+ meta: { style: { width: '1%', maxWidth: '40px', minWidth: '40px' } },
39
42
  },
40
43
  {
41
- index: 2,
42
- Header: 'Score',
43
- accessor: 'score',
44
+ header: 'Score',
45
+ accessorKey: 'score',
44
46
  },
45
47
  {
46
- index: 3,
47
- Header: '',
48
- style: {
49
- width: '1%',
50
- maxWidth: '24px',
51
- minWidth: '24px',
48
+ header: '',
49
+ meta: {
50
+ style: {
51
+ width: '1%',
52
+ maxWidth: '24px',
53
+ minWidth: '24px',
54
+ },
52
55
  },
53
56
  id: 'assign-button',
54
- Cell: ({ row }: CellProps<AutoAssignmentsData>) => (
57
+ cell: ({ row }) => (
55
58
  <button
56
59
  type="button"
57
60
  className="assign-button"
@@ -61,12 +64,11 @@ function AutomaticAssignmentTable({ data }: AutomaticAssignmentTableProps) {
61
64
  </button>
62
65
  ),
63
66
  },
64
- ],
65
- [assignHandler],
66
- );
67
+ ]);
68
+ }, [assignHandler]);
67
69
 
68
70
  return (
69
- <ReactTable
71
+ <TanStackTable
70
72
  data={data}
71
73
  columns={COLUMNS}
72
74
  onClick={assignHandler}
@@ -3,18 +3,17 @@ import dlv from 'dlv';
3
3
  import { checkIntegralKind } from 'nmr-processing';
4
4
  import { memo, useCallback, useMemo } from 'react';
5
5
  import { FaRegTrashAlt } from 'react-icons/fa';
6
- import type { CellProps, Row } from 'react-table';
7
6
 
8
7
  import { SIGNAL_KINDS } from '../../../data/constants/signalsKinds.js';
9
8
  import { useDispatch } from '../../context/DispatchContext.js';
10
9
  import { EditableColumn } from '../../elements/EditableColumn.js';
11
10
  import { EmptyText } from '../../elements/EmptyText.js';
12
- import ReactTable from '../../elements/ReactTable/ReactTable.js';
13
- import type { CustomColumn } from '../../elements/ReactTable/utility/addCustomColumn.js';
14
- import addCustomColumn, {
15
- createActionColumn,
16
- } from '../../elements/ReactTable/utility/addCustomColumn.js';
17
11
  import Select from '../../elements/Select.js';
12
+ import {
13
+ TanStackTable,
14
+ createActionColumn,
15
+ createTanStackColumnHelper,
16
+ } from '../../elements/tanstack_table/index.ts';
18
17
  import { usePanelPreferences } from '../../hooks/usePanelPreferences.js';
19
18
  import { formatNumber } from '../../utility/formatNumber.js';
20
19
  import { NoDataForFid } from '../extra/placeholder/NoDataForFid.js';
@@ -36,8 +35,8 @@ function IntegralTable(props: IntegralTableProps) {
36
35
  const dispatch = useDispatch();
37
36
 
38
37
  const deleteIntegralHandler = useCallback(
39
- (row: Row<Integral>) => {
40
- const { id } = row.original;
38
+ (integral: Integral) => {
39
+ const { id } = integral;
41
40
  dispatch({
42
41
  type: 'DELETE_INTEGRAL',
43
42
  payload: {
@@ -69,55 +68,55 @@ function IntegralTable(props: IntegralTableProps) {
69
68
  );
70
69
  const integralsPreferences = usePanelPreferences('integrals', activeTab);
71
70
 
72
- const COLUMNS = useMemo<
73
- Array<
74
- CustomColumn<Integral> & {
75
- showWhen: string;
76
- }
77
- >
78
- >(
79
- () => [
80
- {
81
- showWhen: 'showSerialNumber',
82
- index: 1,
83
- Header: '#',
84
- accessor: (_, index) => index + 1,
85
- style: { width: '30px', maxWidth: '30px' },
86
- },
87
- {
88
- showWhen: 'from.show',
89
- index: 2,
90
- Header: 'From',
91
- sortType: 'basic',
92
- accessor: (row) =>
93
- formatNumber(row.from, integralsPreferences.from.format),
94
- },
95
- {
96
- showWhen: 'to.show',
97
- index: 3,
98
- Header: 'To',
99
- sortType: 'basic',
100
- accessor: (row) => formatNumber(row.to, integralsPreferences.to.format),
101
- },
102
- {
103
- showWhen: 'absolute.show',
104
- index: 4,
105
- Header: 'Absolute',
106
- accessor: (row) =>
107
- formatNumber(row.absolute, integralsPreferences.absolute.format),
108
- },
109
- {
110
- showWhen: 'relative.show',
111
- index: 5,
71
+ const COLUMNS = useMemo(() => {
72
+ const columnHelper = createTanStackColumnHelper<Integral>();
73
+ const columns = columnHelper.columns([]);
74
+ // TODO: Use column visibility feature instead.
75
+ if (dlv(integralsPreferences, 'showSerialNumber')) {
76
+ columns.push({
77
+ id: 'rowNumber',
78
+ header: '#',
79
+ accessorFn: (_, index) => index + 1,
80
+ meta: { style: { width: '30px', maxWidth: '30px' } },
81
+ });
82
+ }
83
+ if (dlv(integralsPreferences, 'from.show')) {
84
+ columns.push({
85
+ header: 'From',
86
+ sortFn: 'basic',
87
+ accessorKey: 'from',
88
+ cell: ({ getValue }) =>
89
+ formatNumber(getValue(), integralsPreferences.from.format),
90
+ });
91
+ }
92
+ if (dlv(integralsPreferences, 'to.show')) {
93
+ columns.push({
94
+ header: 'To',
95
+ sortFn: 'basic',
96
+ accessorKey: 'to',
97
+ cell: ({ getValue }) =>
98
+ formatNumber(getValue(), integralsPreferences.to.format),
99
+ });
100
+ }
101
+ if (dlv(integralsPreferences, 'absolute.show')) {
102
+ columns.push({
103
+ header: 'Absolute',
104
+ accessorKey: 'absolute',
105
+ cell: ({ getValue }) =>
106
+ formatNumber(getValue(), integralsPreferences.absolute.format),
107
+ });
108
+ }
109
+ if (dlv(integralsPreferences, 'relative.show')) {
110
+ columns.push({
112
111
  id: 'relative',
113
- Header: () => {
112
+ header: () => {
114
113
  const n = activeTab?.replaceAll(/\d/g, '');
115
114
  return <span>{`Relative ${n}`}</span>;
116
115
  },
117
- accessor: 'integral',
118
- Cell: ({ row }: CellProps<Integral>) => {
116
+ accessorKey: 'integral',
117
+ cell: ({ getValue, row }) => {
119
118
  const value = formatNumber(
120
- row.original.integral || 0,
119
+ getValue() || 0,
121
120
  integralsPreferences.relative.format,
122
121
  );
123
122
  const flag = checkIntegralKind(row.original);
@@ -133,55 +132,42 @@ function IntegralTable(props: IntegralTableProps) {
133
132
  />
134
133
  );
135
134
  },
136
- },
137
- {
138
- index: 6,
139
- Header: 'Kind',
140
- sortType: 'basic',
141
- resizable: true,
142
- accessor: 'kind',
143
- showWhen: 'showKind',
144
- Cell: ({ row }: CellProps<Integral>) => (
135
+ });
136
+ }
137
+ if (dlv(integralsPreferences, 'showKind')) {
138
+ columns.push({
139
+ header: 'Kind',
140
+ sortFn: 'basic',
141
+ accessorKey: 'kind',
142
+ cell: ({ getValue, row }) => (
145
143
  <Select
146
144
  onChange={(value) =>
147
145
  changeIntegralDataHandler(value as SignalKind, row.original)
148
146
  }
149
147
  items={SIGNAL_KINDS}
150
148
  style={selectStyle}
151
- defaultValue={row.original.kind}
149
+ defaultValue={getValue()}
152
150
  />
153
151
  ),
154
- },
155
- {
156
- showWhen: 'showDeleteAction',
157
- ...createActionColumn<Integral>({
158
- index: 20,
152
+ });
153
+ }
154
+ if (dlv(integralsPreferences, 'showDeleteAction')) {
155
+ columns.push(
156
+ createActionColumn<Integral>({
157
+ id: 'delete-action',
159
158
  icon: <FaRegTrashAlt />,
160
159
  onClick: deleteIntegralHandler,
161
160
  }),
162
- },
163
- ],
164
- [
165
- activeTab,
166
- changeIntegralDataHandler,
167
- integralsPreferences,
168
- saveRelativeHandler,
169
- deleteIntegralHandler,
170
- ],
171
- );
172
-
173
- const tableColumns = useMemo(() => {
174
- const columns: Array<CustomColumn<Integral>> = [];
175
- for (const col of COLUMNS) {
176
- const { showWhen, ...colParams } = col;
177
- if (dlv(integralsPreferences, showWhen)) {
178
- addCustomColumn(columns, colParams);
179
- }
161
+ );
180
162
  }
181
-
182
- columns.sort((object1, object2) => object1.index - object2.index);
183
163
  return columns;
184
- }, [COLUMNS, integralsPreferences]);
164
+ }, [
165
+ activeTab,
166
+ changeIntegralDataHandler,
167
+ integralsPreferences,
168
+ saveRelativeHandler,
169
+ deleteIntegralHandler,
170
+ ]);
185
171
 
186
172
  if (info.isFid) {
187
173
  return <NoDataForFid />;
@@ -191,7 +177,7 @@ function IntegralTable(props: IntegralTableProps) {
191
177
  return <EmptyText text="No data" />;
192
178
  }
193
179
 
194
- return <ReactTable data={data} columns={tableColumns} />;
180
+ return <TanStackTable data={data} columns={COLUMNS} />;
195
181
  }
196
182
 
197
183
  export default memo(IntegralTable);