nmrium 2.6.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 (482) hide show
  1. package/lib/component/1d/ApodizationLine.js +2 -2
  2. package/lib/component/1d/ApodizationLine.js.map +1 -1
  3. package/lib/component/1d/BrushTracker1D.d.ts.map +1 -1
  4. package/lib/component/1d/BrushTracker1D.js +15 -14
  5. package/lib/component/1d/BrushTracker1D.js.map +1 -1
  6. package/lib/component/1d/Line.js +2 -2
  7. package/lib/component/1d/Line.js.map +1 -1
  8. package/lib/component/1d/SVGContent1D.d.ts.map +1 -1
  9. package/lib/component/1d/SVGContent1D.js +4 -1
  10. package/lib/component/1d/SVGContent1D.js.map +1 -1
  11. package/lib/component/1d/Viewer1D.d.ts.map +1 -1
  12. package/lib/component/1d/Viewer1D.js +2 -1
  13. package/lib/component/1d/Viewer1D.js.map +1 -1
  14. package/lib/component/1d/baseline/BaselinePreview.js +2 -2
  15. package/lib/component/1d/baseline/BaselinePreview.js.map +1 -1
  16. package/lib/component/1d/database/DatabaseSpectrum.js +2 -2
  17. package/lib/component/1d/database/DatabaseSpectrum.js.map +1 -1
  18. package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
  19. package/lib/component/1d/database/ResurrectedDatabaseRanges.js.map +1 -1
  20. package/lib/component/1d/matrix/Boxplot.js +5 -5
  21. package/lib/component/1d/matrix/Boxplot.js.map +1 -1
  22. package/lib/component/1d/matrix/Stocsy.js +2 -2
  23. package/lib/component/1d/matrix/Stocsy.js.map +1 -1
  24. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts.map +1 -1
  25. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +12 -3
  26. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js.map +1 -1
  27. package/lib/component/1d/peaks/usePeakShapesPath.js +2 -2
  28. package/lib/component/1d/peaks/usePeakShapesPath.js.map +1 -1
  29. package/lib/component/1d/plugin_chart_brush_tracker.d.ts +2 -0
  30. package/lib/component/1d/plugin_chart_brush_tracker.d.ts.map +1 -0
  31. package/lib/component/1d/plugin_chart_brush_tracker.js +41 -0
  32. package/lib/component/1d/plugin_chart_brush_tracker.js.map +1 -0
  33. package/lib/component/1d/plugin_svg_chart.d.ts +2 -0
  34. package/lib/component/1d/plugin_svg_chart.d.ts.map +1 -0
  35. package/lib/component/1d/plugin_svg_chart.js +43 -0
  36. package/lib/component/1d/plugin_svg_chart.js.map +1 -0
  37. package/lib/component/1d-2d/components/RangeIndicator.d.ts.map +1 -1
  38. package/lib/component/1d-2d/components/RangeIndicator.js +1 -7
  39. package/lib/component/1d-2d/components/RangeIndicator.js.map +1 -1
  40. package/lib/component/1d-2d/tools/BrushXY.d.ts +1 -1
  41. package/lib/component/1d-2d/tools/BrushXY.d.ts.map +1 -1
  42. package/lib/component/1d-2d/tools/BrushXY.js.map +1 -1
  43. package/lib/component/1d-2d/tools/CrossLinePointer.d.ts +1 -1
  44. package/lib/component/1d-2d/tools/CrossLinePointer.d.ts.map +1 -1
  45. package/lib/component/1d-2d/tools/CrossLinePointer.js.map +1 -1
  46. package/lib/component/2d/1d-tracer/HorizontalSliceChart.js +2 -2
  47. package/lib/component/2d/1d-tracer/HorizontalSliceChart.js.map +1 -1
  48. package/lib/component/2d/1d-tracer/Left1DChart.js +2 -2
  49. package/lib/component/2d/1d-tracer/Left1DChart.js.map +1 -1
  50. package/lib/component/2d/1d-tracer/Top1DChart.js +2 -2
  51. package/lib/component/2d/1d-tracer/Top1DChart.js.map +1 -1
  52. package/lib/component/2d/1d-tracer/VerticalSliceChart.js +2 -2
  53. package/lib/component/2d/1d-tracer/VerticalSliceChart.js.map +1 -1
  54. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js +3 -3
  55. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js.map +1 -1
  56. package/lib/component/2d/BrushTracker2D.js.map +1 -1
  57. package/lib/component/2d/ft/Contours.js +2 -2
  58. package/lib/component/2d/ft/Contours.js.map +1 -1
  59. package/lib/component/2d/utilities/DimensionLayout.d.ts +1 -1
  60. package/lib/component/2d/utilities/DimensionLayout.d.ts.map +1 -1
  61. package/lib/component/EventsTrackers/BrushTracker.d.ts +1 -84
  62. package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
  63. package/lib/component/EventsTrackers/BrushTracker.js +70 -3
  64. package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
  65. package/lib/component/EventsTrackers/brush_tracker.types.d.ts +93 -0
  66. package/lib/component/EventsTrackers/brush_tracker.types.d.ts.map +1 -0
  67. package/lib/component/EventsTrackers/brush_tracker.types.js +2 -0
  68. package/lib/component/EventsTrackers/brush_tracker.types.js.map +1 -0
  69. package/lib/component/EventsTrackers/brush_tracker_events_listeners.d.ts +7 -0
  70. package/lib/component/EventsTrackers/brush_tracker_events_listeners.d.ts.map +1 -0
  71. package/lib/component/EventsTrackers/brush_tracker_events_listeners.js +15 -0
  72. package/lib/component/EventsTrackers/brush_tracker_events_listeners.js.map +1 -0
  73. package/lib/component/context/ScaleContext.d.ts +1 -1
  74. package/lib/component/context/ScaleContext.d.ts.map +1 -1
  75. package/lib/component/elements/D3Axis.d.ts.map +1 -1
  76. package/lib/component/elements/D3Axis.js +15 -32
  77. package/lib/component/elements/D3Axis.js.map +1 -1
  78. package/lib/component/elements/export/ExportContent.d.ts.map +1 -1
  79. package/lib/component/elements/export/ExportContent.js +2 -2
  80. package/lib/component/elements/export/ExportContent.js.map +1 -1
  81. package/lib/component/elements/export/ExportOptionsModal.d.ts.map +1 -1
  82. package/lib/component/elements/export/ExportOptionsModal.js +9 -3
  83. package/lib/component/elements/export/ExportOptionsModal.js.map +1 -1
  84. package/lib/component/elements/export/useExportConfigurer.d.ts +1 -0
  85. package/lib/component/elements/export/useExportConfigurer.d.ts.map +1 -1
  86. package/lib/component/elements/export/useExportConfigurer.js +5 -0
  87. package/lib/component/elements/export/useExportConfigurer.js.map +1 -1
  88. package/lib/component/elements/print/PrintContent.d.ts.map +1 -1
  89. package/lib/component/elements/print/PrintContent.js +6 -25
  90. package/lib/component/elements/print/PrintContent.js.map +1 -1
  91. package/lib/component/elements/tanstack_table/create_action_column.d.ts +11 -0
  92. package/lib/component/elements/tanstack_table/create_action_column.d.ts.map +1 -0
  93. package/lib/component/elements/tanstack_table/create_action_column.js +24 -0
  94. package/lib/component/elements/tanstack_table/create_action_column.js.map +1 -0
  95. package/lib/component/elements/tanstack_table/create_column_helper.d.ts +5 -0
  96. package/lib/component/elements/tanstack_table/create_column_helper.d.ts.map +1 -0
  97. package/lib/component/elements/tanstack_table/create_column_helper.js +5 -0
  98. package/lib/component/elements/tanstack_table/create_column_helper.js.map +1 -0
  99. package/lib/component/elements/{ReactTable/BaseReactTable.d.ts → tanstack_table/elements/base_react_table.d.ts} +1 -1
  100. package/lib/component/elements/tanstack_table/elements/base_react_table.d.ts.map +1 -0
  101. package/lib/component/elements/{ReactTable/BaseReactTable.js → tanstack_table/elements/base_react_table.js} +1 -1
  102. package/lib/component/elements/tanstack_table/elements/base_react_table.js.map +1 -0
  103. package/lib/component/elements/{ReactTable/Elements/EmptyDataRow.d.ts → tanstack_table/elements/empty_data_row.d.ts} +1 -1
  104. package/lib/component/elements/tanstack_table/elements/empty_data_row.d.ts.map +1 -0
  105. package/lib/component/elements/{ReactTable/Elements/EmptyDataRow.js → tanstack_table/elements/empty_data_row.js} +1 -1
  106. package/lib/component/elements/tanstack_table/elements/empty_data_row.js.map +1 -0
  107. package/lib/component/elements/tanstack_table/elements/table_context.d.ts +4 -0
  108. package/lib/component/elements/tanstack_table/elements/table_context.d.ts.map +1 -0
  109. package/lib/component/elements/tanstack_table/elements/table_context.js +11 -0
  110. package/lib/component/elements/tanstack_table/elements/table_context.js.map +1 -0
  111. package/lib/component/elements/tanstack_table/elements/table_header.d.ts +12 -0
  112. package/lib/component/elements/tanstack_table/elements/table_header.d.ts.map +1 -0
  113. package/lib/component/elements/tanstack_table/elements/table_header.js +42 -0
  114. package/lib/component/elements/tanstack_table/elements/table_header.js.map +1 -0
  115. package/lib/component/elements/tanstack_table/elements/table_row.d.ts +12 -0
  116. package/lib/component/elements/tanstack_table/elements/table_row.d.ts.map +1 -0
  117. package/lib/component/elements/{ReactTable/Elements/ReactTableRow.js → tanstack_table/elements/table_row.js} +18 -17
  118. package/lib/component/elements/tanstack_table/elements/table_row.js.map +1 -0
  119. package/lib/component/elements/tanstack_table/features.d.ts +21 -0
  120. package/lib/component/elements/tanstack_table/features.d.ts.map +1 -0
  121. package/lib/component/elements/tanstack_table/features.js +14 -0
  122. package/lib/component/elements/tanstack_table/features.js.map +1 -0
  123. package/lib/component/elements/tanstack_table/index.d.ts +6 -0
  124. package/lib/component/elements/tanstack_table/index.d.ts.map +1 -0
  125. package/lib/component/elements/tanstack_table/index.js +6 -0
  126. package/lib/component/elements/tanstack_table/index.js.map +1 -0
  127. package/lib/component/elements/tanstack_table/table.d.ts +26 -0
  128. package/lib/component/elements/tanstack_table/table.d.ts.map +1 -0
  129. package/lib/component/elements/{ReactTable/ReactTable.js → tanstack_table/table.js} +29 -37
  130. package/lib/component/elements/tanstack_table/table.js.map +1 -0
  131. package/lib/component/elements/tanstack_table/types.d.ts +47 -0
  132. package/lib/component/elements/tanstack_table/types.d.ts.map +1 -0
  133. package/lib/component/elements/tanstack_table/types.js +2 -0
  134. package/lib/component/elements/tanstack_table/types.js.map +1 -0
  135. package/lib/component/elements/utilities/transferStyles.d.ts +2 -0
  136. package/lib/component/elements/utilities/transferStyles.d.ts.map +1 -0
  137. package/lib/component/elements/utilities/transferStyles.js +29 -0
  138. package/lib/component/elements/utilities/transferStyles.js.map +1 -0
  139. package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -1
  140. package/lib/component/header/AutoPeakPickingOptionPanel.js.map +1 -1
  141. package/lib/component/hooks/useIntegralPath.js +2 -2
  142. package/lib/component/hooks/useIntegralPath.js.map +1 -1
  143. package/lib/component/modal/ImportPublicationStringModal.d.ts.map +1 -1
  144. package/lib/component/modal/ImportPublicationStringModal.js +91 -73
  145. package/lib/component/modal/ImportPublicationStringModal.js.map +1 -1
  146. package/lib/component/modal/LogsHistoryModal.d.ts.map +1 -1
  147. package/lib/component/modal/LogsHistoryModal.js +44 -40
  148. package/lib/component/modal/LogsHistoryModal.js.map +1 -1
  149. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.d.ts.map +1 -1
  150. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +48 -44
  151. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js.map +1 -1
  152. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.d.ts.map +1 -1
  153. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +36 -32
  154. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js.map +1 -1
  155. package/lib/component/modal/metaImportation/MetaImportationModal.d.ts.map +1 -1
  156. package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -14
  157. package/lib/component/modal/metaImportation/MetaImportationModal.js.map +1 -1
  158. package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts +106 -105
  159. package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts.map +1 -1
  160. package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.d.ts +106 -105
  161. package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.d.ts.map +1 -1
  162. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +106 -105
  163. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts.map +1 -1
  164. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts +91 -90
  165. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts.map +1 -1
  166. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts +91 -90
  167. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts.map +1 -1
  168. package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts +15 -15
  169. package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts +91 -90
  170. package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts.map +1 -1
  171. package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.d.ts +91 -90
  172. package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.d.ts.map +1 -1
  173. package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts +91 -90
  174. package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts.map +1 -1
  175. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts +91 -90
  176. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts.map +1 -1
  177. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.d.ts +12 -10
  178. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.d.ts.map +1 -1
  179. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js +32 -40
  180. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js.map +1 -1
  181. package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts +91 -90
  182. package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts.map +1 -1
  183. package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts +91 -90
  184. package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts.map +1 -1
  185. package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts +91 -90
  186. package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts.map +1 -1
  187. package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts +91 -90
  188. package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts.map +1 -1
  189. package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts +91 -90
  190. package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts.map +1 -1
  191. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts +91 -90
  192. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts.map +1 -1
  193. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts +91 -90
  194. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts.map +1 -1
  195. package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts +91 -90
  196. package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts.map +1 -1
  197. package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts +91 -90
  198. package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts.map +1 -1
  199. package/lib/component/modal/setting/tanstack_general_settings/validation/export_tab_validation.d.ts +61 -17
  200. package/lib/component/modal/setting/tanstack_general_settings/validation/export_tab_validation.d.ts.map +1 -1
  201. package/lib/component/modal/setting/tanstack_general_settings/validation/export_tab_validation.js +79 -28
  202. package/lib/component/modal/setting/tanstack_general_settings/validation/export_tab_validation.js.map +1 -1
  203. package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts +15 -15
  204. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +1 -1
  205. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts.map +1 -1
  206. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +29 -26
  207. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js.map +1 -1
  208. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
  209. package/lib/component/panels/IntegralsPanel/IntegralTable.js +70 -76
  210. package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
  211. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.d.ts.map +1 -1
  212. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +33 -29
  213. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js.map +1 -1
  214. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +8 -6
  215. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
  216. package/lib/component/panels/PeaksPanel/PeaksTable.js +116 -126
  217. package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
  218. package/lib/component/panels/PeaksPanel/peaksToTSV.d.ts +2 -2
  219. package/lib/component/panels/PeaksPanel/peaksToTSV.d.ts.map +1 -1
  220. package/lib/component/panels/PeaksPanel/peaksToTSV.js +9 -11
  221. package/lib/component/panels/PeaksPanel/peaksToTSV.js.map +1 -1
  222. package/lib/component/panels/RangesPanel/RangesTable.d.ts +3 -2
  223. package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
  224. package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
  225. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
  226. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts.map +1 -1
  227. package/lib/component/panels/SpectraPanel/SpectraTable.d.ts.map +1 -1
  228. package/lib/component/panels/SpectraPanel/SpectraTable.js +37 -26
  229. package/lib/component/panels/SpectraPanel/SpectraTable.js.map +1 -1
  230. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.d.ts +1 -1
  231. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.d.ts.map +1 -1
  232. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js +56 -52
  233. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js.map +1 -1
  234. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.d.ts.map +1 -1
  235. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +23 -20
  236. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js.map +1 -1
  237. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +2 -2
  238. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts.map +1 -1
  239. package/lib/component/panels/databasePanel/DatabaseTable.d.ts +1 -1
  240. package/lib/component/panels/databasePanel/DatabaseTable.d.ts.map +1 -1
  241. package/lib/component/panels/databasePanel/DatabaseTable.js +171 -153
  242. package/lib/component/panels/databasePanel/DatabaseTable.js.map +1 -1
  243. package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.d.ts.map +1 -1
  244. package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.js +27 -24
  245. package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.js.map +1 -1
  246. package/lib/component/panels/filtersPanel/processings_sections_panel.js +1 -1
  247. package/lib/component/panels/filtersPanel/processings_sections_panel.js.map +1 -1
  248. package/lib/component/panels/informationPanel/InformationEditionModal.d.ts.map +1 -1
  249. package/lib/component/panels/informationPanel/InformationEditionModal.js +69 -64
  250. package/lib/component/panels/informationPanel/InformationEditionModal.js.map +1 -1
  251. package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.d.ts +3 -3
  252. package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.d.ts.map +1 -1
  253. package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +69 -56
  254. package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js.map +1 -1
  255. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
  256. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js.map +1 -1
  257. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.d.ts.map +1 -1
  258. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.js +17 -20
  259. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.js.map +1 -1
  260. package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.d.ts.map +1 -1
  261. package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.js +25 -20
  262. package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.js.map +1 -1
  263. package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.d.ts.map +1 -1
  264. package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.js +41 -36
  265. package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.js.map +1 -1
  266. package/lib/component/panels/spectrumSimulation/SpinSystemTable.d.ts.map +1 -1
  267. package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +14 -15
  268. package/lib/component/panels/spectrumSimulation/SpinSystemTable.js.map +1 -1
  269. package/lib/component/reducer/actions/DatabaseActions.d.ts.map +1 -1
  270. package/lib/component/reducer/actions/DatabaseActions.js +3 -2
  271. package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
  272. package/lib/component/reducer/actions/InsetActions.d.ts +1 -1
  273. package/lib/component/reducer/actions/InsetActions.d.ts.map +1 -1
  274. package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
  275. package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
  276. package/lib/component/reducer/helper/Zoom1DManager.d.ts +1 -1
  277. package/lib/component/reducer/helper/Zoom1DManager.d.ts.map +1 -1
  278. package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -1
  279. package/lib/component/reducer/helper/ZoomHistoryManager.d.ts.map +1 -1
  280. package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts +1 -1
  281. package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts.map +1 -1
  282. package/lib/component/toolbar/nmr_toolbar.js +1 -1
  283. package/lib/component/toolbar/nmr_toolbar.js.map +1 -1
  284. package/lib/component/utility/Events.d.ts +1 -1
  285. package/lib/component/utility/Events.d.ts.map +1 -1
  286. package/lib/component/utility/core_slots/core_operator_brush.commons.d.ts +9 -0
  287. package/lib/component/utility/core_slots/core_operator_brush.commons.d.ts.map +1 -0
  288. package/lib/component/utility/core_slots/core_operator_brush.commons.js +15 -0
  289. package/lib/component/utility/core_slots/core_operator_brush.commons.js.map +1 -0
  290. package/lib/component/utility/core_slots/core_operator_chart_brush.commons.d.ts +7 -0
  291. package/lib/component/utility/core_slots/core_operator_chart_brush.commons.d.ts.map +1 -0
  292. package/lib/component/utility/core_slots/core_operator_chart_brush.commons.js +82 -0
  293. package/lib/component/utility/core_slots/core_operator_chart_brush.commons.js.map +1 -0
  294. package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.d.ts +8 -0
  295. package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.d.ts.map +1 -0
  296. package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.js +11 -0
  297. package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.js.map +1 -0
  298. package/lib/component/utility/core_slots/core_operator_chart_svg.d.ts +8 -0
  299. package/lib/component/utility/core_slots/core_operator_chart_svg.d.ts.map +1 -0
  300. package/lib/component/utility/core_slots/core_operator_chart_svg.js +11 -0
  301. package/lib/component/utility/core_slots/core_operator_chart_svg.js.map +1 -0
  302. package/lib/component/utility/core_slots/core_operator_panel_tool.d.ts +2 -8
  303. package/lib/component/utility/core_slots/core_operator_panel_tool.d.ts.map +1 -1
  304. package/lib/component/utility/core_slots/core_operator_panel_tool.js +8 -6
  305. package/lib/component/utility/core_slots/core_operator_panel_tool.js.map +1 -1
  306. package/lib/component/utility/core_slots/core_operator_tool.commons.d.ts +11 -0
  307. package/lib/component/utility/core_slots/core_operator_tool.commons.d.ts.map +1 -0
  308. package/lib/component/utility/core_slots/core_operator_tool.commons.js +30 -0
  309. package/lib/component/utility/core_slots/core_operator_tool.commons.js.map +1 -0
  310. package/lib/component/utility/core_slots/core_operator_tool.d.ts +2 -8
  311. package/lib/component/utility/core_slots/core_operator_tool.d.ts.map +1 -1
  312. package/lib/component/utility/core_slots/core_operator_tool.js +8 -6
  313. package/lib/component/utility/core_slots/core_operator_tool.js.map +1 -1
  314. package/lib/component/utility/export.d.ts +5 -0
  315. package/lib/component/utility/export.d.ts.map +1 -1
  316. package/lib/component/utility/export.js +22 -0
  317. package/lib/component/utility/export.js.map +1 -1
  318. package/lib/data/data2d/Spectrum2D/contours.d.ts.map +1 -1
  319. package/lib/data/data2d/Spectrum2D/contours.js +23 -10
  320. package/lib/data/data2d/Spectrum2D/contours.js.map +1 -1
  321. package/lib/data/data2d/Spectrum2D/findBestMinContour/estimateNoiseLevel.d.ts +13 -0
  322. package/lib/data/data2d/Spectrum2D/findBestMinContour/estimateNoiseLevel.d.ts.map +1 -0
  323. package/lib/data/data2d/Spectrum2D/findBestMinContour/estimateNoiseLevel.js +40 -0
  324. package/lib/data/data2d/Spectrum2D/findBestMinContour/estimateNoiseLevel.js.map +1 -0
  325. package/lib/data/data2d/Spectrum2D/findBestMinContour/evaluation.d.ts +27 -0
  326. package/lib/data/data2d/Spectrum2D/findBestMinContour/evaluation.d.ts.map +1 -0
  327. package/lib/data/data2d/Spectrum2D/findBestMinContour/evaluation.js +230 -0
  328. package/lib/data/data2d/Spectrum2D/findBestMinContour/evaluation.js.map +1 -0
  329. package/lib/data/data2d/Spectrum2D/findBestMinContour/findAutomaticContourLevels.d.ts +227 -0
  330. package/lib/data/data2d/Spectrum2D/findBestMinContour/findAutomaticContourLevels.d.ts.map +1 -0
  331. package/lib/data/data2d/Spectrum2D/findBestMinContour/findAutomaticContourLevels.js +67 -0
  332. package/lib/data/data2d/Spectrum2D/findBestMinContour/findAutomaticContourLevels.js.map +1 -0
  333. package/lib/data/data2d/Spectrum2D/findBestMinContour/math.d.ts +4 -0
  334. package/lib/data/data2d/Spectrum2D/findBestMinContour/math.d.ts.map +1 -0
  335. package/lib/data/data2d/Spectrum2D/findBestMinContour/math.js +42 -0
  336. package/lib/data/data2d/Spectrum2D/findBestMinContour/math.js.map +1 -0
  337. package/lib/data/utilities/calculateSanPlot.d.ts +3 -1
  338. package/lib/data/utilities/calculateSanPlot.d.ts.map +1 -1
  339. package/lib/data/utilities/calculateSanPlot.js +2 -2
  340. package/lib/data/utilities/calculateSanPlot.js.map +1 -1
  341. package/lib/versionInfo.js +1 -1
  342. package/package.json +7 -8
  343. package/src/component/1d/ApodizationLine.tsx +2 -2
  344. package/src/component/1d/BrushTracker1D.tsx +19 -21
  345. package/src/component/1d/Line.tsx +2 -2
  346. package/src/component/1d/SVGContent1D.tsx +6 -0
  347. package/src/component/1d/Viewer1D.tsx +2 -0
  348. package/src/component/1d/baseline/BaselinePreview.tsx +2 -2
  349. package/src/component/1d/database/DatabaseSpectrum.tsx +2 -2
  350. package/src/component/1d/database/ResurrectedDatabaseRanges.tsx +2 -2
  351. package/src/component/1d/matrix/Boxplot.tsx +5 -5
  352. package/src/component/1d/matrix/Stocsy.tsx +2 -2
  353. package/src/component/1d/peaks/PeakAnnotationsSpreadMode.tsx +17 -3
  354. package/src/component/1d/peaks/usePeakShapesPath.ts +2 -2
  355. package/src/component/1d/plugin_chart_brush_tracker.tsx +63 -0
  356. package/src/component/1d/plugin_svg_chart.tsx +60 -0
  357. package/src/component/1d-2d/components/RangeIndicator.tsx +8 -9
  358. package/src/component/1d-2d/tools/BrushXY.tsx +1 -1
  359. package/src/component/1d-2d/tools/CrossLinePointer.tsx +1 -1
  360. package/src/component/2d/1d-tracer/HorizontalSliceChart.tsx +2 -2
  361. package/src/component/2d/1d-tracer/Left1DChart.tsx +2 -2
  362. package/src/component/2d/1d-tracer/Top1DChart.tsx +2 -2
  363. package/src/component/2d/1d-tracer/VerticalSliceChart.tsx +2 -2
  364. package/src/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.tsx +3 -3
  365. package/src/component/2d/BrushTracker2D.tsx +5 -5
  366. package/src/component/2d/ft/Contours.tsx +2 -2
  367. package/src/component/2d/utilities/DimensionLayout.ts +1 -1
  368. package/src/component/EventsTrackers/BrushTracker.tsx +118 -115
  369. package/src/component/EventsTrackers/brush_tracker.types.ts +111 -0
  370. package/src/component/EventsTrackers/brush_tracker_events_listeners.ts +32 -0
  371. package/src/component/context/ScaleContext.tsx +1 -1
  372. package/src/component/elements/D3Axis.tsx +49 -67
  373. package/src/component/elements/export/ExportContent.tsx +3 -2
  374. package/src/component/elements/export/ExportOptionsModal.tsx +32 -1
  375. package/src/component/elements/export/useExportConfigurer.tsx +6 -0
  376. package/src/component/elements/print/PrintContent.tsx +6 -27
  377. package/src/component/elements/tanstack_table/create_action_column.tsx +43 -0
  378. package/src/component/elements/tanstack_table/create_column_helper.ts +11 -0
  379. package/src/component/elements/tanstack_table/elements/table_context.ts +15 -0
  380. package/src/component/elements/tanstack_table/elements/table_header.tsx +111 -0
  381. package/src/component/elements/{ReactTable/Elements/ReactTableRow.tsx → tanstack_table/elements/table_row.tsx} +51 -50
  382. package/src/component/elements/tanstack_table/features.ts +33 -0
  383. package/src/component/elements/tanstack_table/index.ts +5 -0
  384. package/src/component/elements/{ReactTable/ReactTable.tsx → tanstack_table/table.tsx} +78 -157
  385. package/src/component/elements/tanstack_table/types.ts +86 -0
  386. package/src/component/elements/utilities/transferStyles.ts +32 -0
  387. package/src/component/header/AutoPeakPickingOptionPanel.tsx +1 -1
  388. package/src/component/hooks/useIntegralPath.ts +2 -2
  389. package/src/component/modal/ImportPublicationStringModal.tsx +160 -136
  390. package/src/component/modal/LogsHistoryModal.tsx +32 -25
  391. package/src/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.tsx +28 -24
  392. package/src/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.tsx +27 -25
  393. package/src/component/modal/metaImportation/MetaImportationModal.tsx +19 -15
  394. package/src/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.tsx +47 -57
  395. package/src/component/modal/setting/tanstack_general_settings/validation/export_tab_validation.ts +100 -28
  396. package/src/component/panels/AutomaticAssignment/AutomaticAssignmentTable.tsx +27 -25
  397. package/src/component/panels/IntegralsPanel/IntegralTable.tsx +75 -89
  398. package/src/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.tsx +68 -60
  399. package/src/component/panels/PeaksPanel/PeaksTable.tsx +126 -124
  400. package/src/component/panels/PeaksPanel/peaksToTSV.ts +14 -15
  401. package/src/component/panels/RangesPanel/RangesTable.tsx +3 -2
  402. package/src/component/panels/RangesPanel/RangesTableRow.tsx +2 -2
  403. package/src/component/panels/SpectraPanel/SpectraTable.tsx +58 -36
  404. package/src/component/panels/SpectraPanel/base/SpectraColumnsManager.tsx +31 -35
  405. package/src/component/panels/SummaryPanel/SetShiftTolerancesModal.tsx +25 -20
  406. package/src/component/panels/ZonesPanel/ZonesTableRow.tsx +2 -2
  407. package/src/component/panels/databasePanel/DatabasePanel.tsx +1 -1
  408. package/src/component/panels/databasePanel/DatabaseTable.tsx +189 -183
  409. package/src/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.tsx +20 -20
  410. package/src/component/panels/filtersPanel/processings_sections_panel.tsx +1 -1
  411. package/src/component/panels/informationPanel/InformationEditionModal.tsx +40 -37
  412. package/src/component/panels/multipleAnalysisPanel/AlignSpectra.tsx +128 -98
  413. package/src/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.tsx +1 -1
  414. package/src/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.tsx +23 -24
  415. package/src/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.tsx +33 -24
  416. package/src/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.tsx +34 -31
  417. package/src/component/panels/spectrumSimulation/SpinSystemTable.tsx +19 -18
  418. package/src/component/reducer/actions/DatabaseActions.ts +4 -3
  419. package/src/component/reducer/actions/InsetActions.ts +1 -1
  420. package/src/component/reducer/actions/ToolsActions.ts +1 -1
  421. package/src/component/reducer/helper/Zoom1DManager.ts +1 -1
  422. package/src/component/reducer/helper/ZoomHistoryManager.ts +1 -1
  423. package/src/component/reducer/preferences/actions/matrixGeneration.ts +1 -1
  424. package/src/component/toolbar/nmr_toolbar.tsx +1 -1
  425. package/src/component/utility/Events.tsx +1 -1
  426. package/src/component/utility/core_slots/core_operator_brush.commons.ts +18 -0
  427. package/src/component/utility/core_slots/core_operator_chart_brush.commons.ts +138 -0
  428. package/src/component/utility/core_slots/core_operator_chart_brush_tracker.tsx +27 -0
  429. package/src/component/utility/core_slots/core_operator_chart_svg.tsx +46 -0
  430. package/src/component/utility/core_slots/core_operator_panel_tool.tsx +9 -27
  431. package/src/component/utility/core_slots/core_operator_tool.commons.ts +63 -0
  432. package/src/component/utility/core_slots/core_operator_tool.tsx +9 -27
  433. package/src/component/utility/export.ts +34 -0
  434. package/src/data/data2d/Spectrum2D/contours.ts +40 -14
  435. package/src/data/data2d/Spectrum2D/findBestMinContour/estimateNoiseLevel.ts +67 -0
  436. package/src/data/data2d/Spectrum2D/findBestMinContour/evaluation.ts +432 -0
  437. package/src/data/data2d/Spectrum2D/findBestMinContour/findAutomaticContourLevels.ts +431 -0
  438. package/src/data/data2d/Spectrum2D/findBestMinContour/math.ts +59 -0
  439. package/src/data/utilities/calculateSanPlot.ts +2 -1
  440. package/src/versionInfo.ts +1 -1
  441. package/lib/component/elements/ReactTable/BaseReactTable.d.ts.map +0 -1
  442. package/lib/component/elements/ReactTable/BaseReactTable.js.map +0 -1
  443. package/lib/component/elements/ReactTable/Elements/EmptyDataRow.d.ts.map +0 -1
  444. package/lib/component/elements/ReactTable/Elements/EmptyDataRow.js.map +0 -1
  445. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.d.ts +0 -10
  446. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.d.ts.map +0 -1
  447. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.js +0 -27
  448. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.js.map +0 -1
  449. package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +0 -16
  450. package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts.map +0 -1
  451. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js.map +0 -1
  452. package/lib/component/elements/ReactTable/ReactTable.d.ts +0 -64
  453. package/lib/component/elements/ReactTable/ReactTable.d.ts.map +0 -1
  454. package/lib/component/elements/ReactTable/ReactTable.js.map +0 -1
  455. package/lib/component/elements/ReactTable/utility/ReactTableContext.d.ts +0 -4
  456. package/lib/component/elements/ReactTable/utility/ReactTableContext.d.ts.map +0 -1
  457. package/lib/component/elements/ReactTable/utility/ReactTableContext.js +0 -11
  458. package/lib/component/elements/ReactTable/utility/ReactTableContext.js.map +0 -1
  459. package/lib/component/elements/ReactTable/utility/addCustomColumn.d.ts +0 -19
  460. package/lib/component/elements/ReactTable/utility/addCustomColumn.d.ts.map +0 -1
  461. package/lib/component/elements/ReactTable/utility/addCustomColumn.js +0 -36
  462. package/lib/component/elements/ReactTable/utility/addCustomColumn.js.map +0 -1
  463. package/lib/component/elements/ReactTable/utility/useRowSpan.d.ts +0 -9
  464. package/lib/component/elements/ReactTable/utility/useRowSpan.d.ts.map +0 -1
  465. package/lib/component/elements/ReactTable/utility/useRowSpan.js +0 -40
  466. package/lib/component/elements/ReactTable/utility/useRowSpan.js.map +0 -1
  467. package/lib/component/elements/export/utilities/transferDocumentStyles.d.ts +0 -2
  468. package/lib/component/elements/export/utilities/transferDocumentStyles.d.ts.map +0 -1
  469. package/lib/component/elements/export/utilities/transferDocumentStyles.js +0 -21
  470. package/lib/component/elements/export/utilities/transferDocumentStyles.js.map +0 -1
  471. package/lib/component/utility/PathBuilder.d.ts +0 -10
  472. package/lib/component/utility/PathBuilder.d.ts.map +0 -1
  473. package/lib/component/utility/PathBuilder.js +0 -38
  474. package/lib/component/utility/PathBuilder.js.map +0 -1
  475. package/src/component/elements/ReactTable/Elements/ReactTableHeader.tsx +0 -81
  476. package/src/component/elements/ReactTable/utility/ReactTableContext.ts +0 -14
  477. package/src/component/elements/ReactTable/utility/addCustomColumn.tsx +0 -75
  478. package/src/component/elements/ReactTable/utility/useRowSpan.ts +0 -61
  479. package/src/component/elements/export/utilities/transferDocumentStyles.ts +0 -21
  480. package/src/component/utility/PathBuilder.ts +0 -41
  481. /package/src/component/elements/{ReactTable/BaseReactTable.tsx → tanstack_table/elements/base_react_table.tsx} +0 -0
  482. /package/src/component/elements/{ReactTable/Elements/EmptyDataRow.tsx → tanstack_table/elements/empty_data_row.tsx} +0 -0
@@ -1,19 +1,23 @@
1
1
  import type { Info1D, Peak1D } from '@zakodium/nmr-types';
2
2
  import dlv from 'dlv';
3
+ import type { Dispatch, SetStateAction } from 'react';
3
4
  import { memo, useCallback, useMemo, useState } from 'react';
4
5
  import { FaEdit, FaRegTrashAlt } from 'react-icons/fa';
5
- import type { CellProps, Row } from 'react-table';
6
6
 
7
7
  import { getPeakAbsoluteArea } from '../../../data/utilities/getPeakAbsoluteArea.ts';
8
8
  import { useDispatch } from '../../context/DispatchContext.js';
9
9
  import { EditableColumn } from '../../elements/EditableColumn.js';
10
10
  import { EmptyText } from '../../elements/EmptyText.js';
11
- import ReactTable from '../../elements/ReactTable/ReactTable.js';
12
- import type { ControlCustomColumn } from '../../elements/ReactTable/utility/addCustomColumn.js';
13
- import addCustomColumn, {
14
- createActionColumn,
15
- } from '../../elements/ReactTable/utility/addCustomColumn.js';
16
11
  import { TableHeaderLabel } from '../../elements/TableHeaderLabel.tsx';
12
+ import type {
13
+ TanStackTableColumn,
14
+ TanStackTableRow,
15
+ } from '../../elements/tanstack_table/index.ts';
16
+ import {
17
+ TanStackTable,
18
+ createActionColumn,
19
+ createTanStackColumnHelper,
20
+ } from '../../elements/tanstack_table/index.ts';
17
21
  import { usePanelPreferences } from '../../hooks/usePanelPreferences.js';
18
22
  import { formatNumber } from '../../utility/formatNumber.js';
19
23
  import { NoDataForFid } from '../extra/placeholder/NoDataForFid.js';
@@ -27,14 +31,21 @@ function getFormattedNumber(
27
31
  return typeof value === 'number' ? formatNumber(value, format) : '';
28
32
  }
29
33
 
30
- export function usePeaksTableColumns(activeTab: string) {
34
+ interface UsePeaksTableColumnsReturn {
35
+ tableColumns: Array<TanStackTableColumn<PeakRecord>>;
36
+ peak: Peak1D | undefined;
37
+ setEditedPeak: Dispatch<SetStateAction<Peak1D | undefined>>;
38
+ }
39
+
40
+ export function usePeaksTableColumns(
41
+ activeTab: string,
42
+ ): UsePeaksTableColumnsReturn {
31
43
  const dispatch = useDispatch();
32
44
  const { tablePreferences } = usePanelPreferences('peaks', activeTab);
33
45
  const [peak, setEditedPeak] = useState<Peak1D | undefined>();
34
46
 
35
47
  const deletePeakHandler = useCallback(
36
- (row: Row<PeakRecord>) => {
37
- const params = row.original;
48
+ (params: PeakRecord) => {
38
49
  dispatch({
39
50
  type: 'DELETE_PEAK',
40
51
  payload: { id: params.id },
@@ -43,8 +54,8 @@ export function usePeaksTableColumns(activeTab: string) {
43
54
  [dispatch],
44
55
  );
45
56
 
46
- const editPeakHandler = useCallback((row: Row<PeakRecord>) => {
47
- setEditedPeak(row.original);
57
+ const editPeakHandler = useCallback((row: PeakRecord) => {
58
+ setEditedPeak(row);
48
59
  }, []);
49
60
 
50
61
  const saveDeltaPPMRefsHandler = useCallback(
@@ -65,19 +76,21 @@ export function usePeaksTableColumns(activeTab: string) {
65
76
  [dispatch],
66
77
  );
67
78
 
68
- const COLUMNS = useMemo<Array<ControlCustomColumn<PeakRecord>>>(
69
- () => [
70
- {
71
- showWhen: 'showSerialNumber',
72
- index: 1,
73
- Header: '#',
74
- accessor: (_, index) => index + 1,
75
- style: { width: '1%', maxWidth: '40px', minWidth: '40px' },
76
- },
77
- {
78
- showWhen: 'deltaPPM.show',
79
- index: 3,
80
- Header: () => {
79
+ const COLUMNS = useMemo(() => {
80
+ const columnHelper = createTanStackColumnHelper<PeakRecord>();
81
+ const columns = columnHelper.columns([]);
82
+ // TODO: Use column visibility feature instead.
83
+ if (dlv(tablePreferences, 'showSerialNumber')) {
84
+ columns.push({
85
+ id: 'rowNumber',
86
+ header: '#',
87
+ accessorFn: (_, index) => index + 1,
88
+ meta: { style: { width: '1%', maxWidth: '40px', minWidth: '40px' } },
89
+ });
90
+ }
91
+ if (dlv(tablePreferences, 'deltaPPM.show')) {
92
+ columns.push({
93
+ header: () => {
81
94
  return (
82
95
  <TableHeaderLabel
83
96
  text="δ (ppm)"
@@ -87,8 +100,8 @@ export function usePeaksTableColumns(activeTab: string) {
87
100
  />
88
101
  );
89
102
  },
90
- accessor: 'x',
91
- Cell: ({ row }: CellProps<PeakRecord>) => (
103
+ accessorKey: 'x',
104
+ cell: ({ row }) => (
92
105
  <EditableColumn
93
106
  value={formatNumber(
94
107
  row.original.x,
@@ -99,91 +112,91 @@ export function usePeaksTableColumns(activeTab: string) {
99
112
  validate={(val) => val !== ''}
100
113
  />
101
114
  ),
102
- },
103
- {
104
- showWhen: 'deltaHz.show',
105
- index: 4,
106
- Header: 'δ (Hz)',
107
- accessor: 'xHz',
108
- Cell: ({ row }: CellProps<PeakRecord>) =>
115
+ });
116
+ }
117
+ if (dlv(tablePreferences, 'deltaHz.show')) {
118
+ columns.push({
119
+ header: 'δ (Hz)',
120
+ accessorKey: 'xHz',
121
+ cell: ({ row }) =>
109
122
  formatNumber(row.original.xHz, tablePreferences.deltaHz.format),
110
- },
111
- {
112
- showWhen: 'intensity.show',
113
- index: 5,
114
- Header: 'Intensity',
115
- style: { maxWidth: '80px' },
116
- accessor: 'y',
117
- Cell: ({ row }: CellProps<PeakRecord>) =>
123
+ });
124
+ }
125
+ if (dlv(tablePreferences, 'intensity.show')) {
126
+ columns.push({
127
+ header: 'Intensity',
128
+ meta: { style: { maxWidth: '80px' } },
129
+ accessorKey: 'y',
130
+ cell: ({ row }) =>
118
131
  formatNumber(row.original.y, tablePreferences.intensity.format),
119
- },
120
- {
121
- showWhen: 'peakWidth.show',
122
- index: 6,
123
- Header: 'Width (Hz)',
124
- accessor: 'width',
125
- Cell: ({ row }: CellProps<PeakRecord>) =>
132
+ });
133
+ }
134
+ if (dlv(tablePreferences, 'peakWidth.show')) {
135
+ columns.push({
136
+ header: 'Width (Hz)',
137
+ accessorKey: 'width',
138
+ cell: ({ row }) =>
126
139
  formatNumber(row.original.width, tablePreferences.peakWidth.format),
127
- },
128
- {
129
- showWhen: 'showKind',
130
- index: 7,
131
- Header: 'Kind',
132
- accessor: (row) => row.shape?.kind || '',
133
- },
134
- {
135
- showWhen: 'fwhm.show',
136
- index: 8,
137
- Header: 'fwhm',
138
- accessor: (row) => row?.shape?.fwhm ?? '',
139
- Cell: ({ row }: CellProps<PeakRecord>) =>
140
+ });
141
+ }
142
+ if (dlv(tablePreferences, 'showKind')) {
143
+ columns.push({
144
+ header: 'Kind',
145
+ accessorFn: (row) => row.shape?.kind || '',
146
+ });
147
+ }
148
+ if (dlv(tablePreferences, 'fwhm.show')) {
149
+ columns.push({
150
+ header: 'fwhm',
151
+ accessorFn: (row) => row?.shape?.fwhm ?? '',
152
+ cell: ({ row }) =>
140
153
  getFormattedNumber(
141
154
  row.original?.shape?.fwhm,
142
155
  tablePreferences.fwhm.format,
143
156
  ),
144
- },
145
- {
146
- showWhen: 'mu.show',
147
- index: 9,
148
- Header: 'mu',
149
- accessor: (row) =>
157
+ });
158
+ }
159
+ if (dlv(tablePreferences, 'mu.show')) {
160
+ columns.push({
161
+ header: 'mu',
162
+ accessorFn: (row) =>
150
163
  row?.shape?.kind === 'pseudoVoigt' ? (row.shape.mu ?? '') : '',
151
- Cell: ({ row }: CellProps<PeakRecord>) => {
164
+ cell: ({ row }) => {
152
165
  const shape = row.original?.shape;
153
166
  const mu = shape?.kind === 'pseudoVoigt' ? shape.mu : undefined;
154
167
  return getFormattedNumber(mu, tablePreferences.mu.format);
155
168
  },
156
- },
157
- {
158
- showWhen: 'gamma.show',
159
- index: 10,
160
- Header: 'gamma',
161
- accessor: (row) =>
169
+ });
170
+ }
171
+ if (dlv(tablePreferences, 'gamma.show')) {
172
+ columns.push({
173
+ header: 'gamma',
174
+ accessorFn: (row) =>
162
175
  row?.shape?.kind === 'generalizedLorentzian'
163
176
  ? (row.shape.gamma ?? '')
164
177
  : '',
165
- Cell: ({ row }: CellProps<PeakRecord>) => {
178
+ cell: ({ row }) => {
166
179
  const shape = row.original?.shape;
167
180
  const gamma =
168
181
  shape?.kind === 'generalizedLorentzian' ? shape.gamma : undefined;
169
182
  return getFormattedNumber(gamma, tablePreferences.gamma.format);
170
183
  },
171
- },
172
- {
173
- showWhen: 'absoluteArea.show',
174
- index: 11,
175
- Header: 'Absolute area',
176
- accessor: (row) => getPeakAbsoluteArea(row) ?? '',
177
- Cell: ({ row }: CellProps<PeakRecord>) =>
184
+ });
185
+ }
186
+ if (dlv(tablePreferences, 'absoluteArea.show')) {
187
+ columns.push({
188
+ header: 'Absolute area',
189
+ accessorFn: (row) => getPeakAbsoluteArea(row) ?? '',
190
+ cell: ({ row }) =>
178
191
  getFormattedNumber(
179
192
  getPeakAbsoluteArea(row.original),
180
193
  tablePreferences.absoluteArea.format,
181
194
  ),
182
- },
183
- {
184
- showWhen: 'relativeArea.show',
185
- index: 12,
186
- Header: () => {
195
+ });
196
+ }
197
+ if (dlv(tablePreferences, 'relativeArea.show')) {
198
+ columns.push({
199
+ header: () => {
187
200
  return (
188
201
  <TableHeaderLabel
189
202
  text="Relative area"
@@ -193,8 +206,8 @@ export function usePeaksTableColumns(activeTab: string) {
193
206
  />
194
207
  );
195
208
  },
196
- accessor: 'relativeArea',
197
- Cell: ({ row }: CellProps<PeakRecord>) => {
209
+ accessorKey: 'relativeArea',
210
+ cell: ({ row }) => {
198
211
  const value = formatNumber(
199
212
  row.original.relativeArea || 0,
200
213
  tablePreferences.relativeArea.format,
@@ -212,59 +225,48 @@ export function usePeaksTableColumns(activeTab: string) {
212
225
  />
213
226
  );
214
227
  },
215
- },
216
- {
217
- showWhen: 'showEditPeakShapeAction',
218
- ...createActionColumn<PeakRecord>({
219
- index: 20,
228
+ });
229
+ }
230
+ if (dlv(tablePreferences, 'showEditPeakShapeAction')) {
231
+ columns.push(
232
+ createActionColumn<PeakRecord>({
233
+ id: 'edit-peak',
220
234
  icon: <FaEdit />,
221
235
  onClick: editPeakHandler,
222
236
  style: {
223
237
  borderRight: '0px',
224
238
  },
225
239
  }),
226
- },
227
- {
228
- showWhen: 'showDeleteAction',
229
- ...createActionColumn<PeakRecord>({
230
- index: 21,
240
+ );
241
+ }
242
+ if (dlv(tablePreferences, 'showDeleteAction')) {
243
+ columns.push(
244
+ createActionColumn<PeakRecord>({
245
+ id: 'delete-peak',
231
246
  icon: <FaRegTrashAlt />,
232
247
  onClick: deletePeakHandler,
233
248
  }),
234
- },
235
- ],
236
- [
237
- editPeakHandler,
238
- deletePeakHandler,
239
- tablePreferences,
240
- saveDeltaPPMRefsHandler,
241
- saveRelativeAreaHandler,
242
- ],
243
- );
244
-
245
- const tableColumns = useMemo(() => {
246
- const columns: Array<ControlCustomColumn<PeakRecord>> = [];
247
- for (const col of COLUMNS) {
248
- const { showWhen, ...colParams } = col;
249
- if (dlv(tablePreferences, showWhen)) {
250
- addCustomColumn(columns, colParams);
251
- }
249
+ );
252
250
  }
253
-
254
- columns.sort((object1, object2) => object1.index - object2.index);
255
251
  return columns;
256
- }, [COLUMNS, tablePreferences]);
252
+ }, [
253
+ editPeakHandler,
254
+ deletePeakHandler,
255
+ tablePreferences,
256
+ saveDeltaPPMRefsHandler,
257
+ saveRelativeAreaHandler,
258
+ ]);
257
259
 
258
- return { tableColumns, peak, setEditedPeak };
260
+ return { tableColumns: COLUMNS, peak, setEditedPeak };
259
261
  }
260
262
 
261
263
  interface PeaksTableProps {
262
- tableColumns: Array<ControlCustomColumn<PeakRecord>>;
264
+ tableColumns: Array<TanStackTableColumn<PeakRecord>>;
263
265
  data: PeakRecord[];
264
266
  info: Info1D;
265
267
  }
266
268
 
267
- function handleActiveRow(row: Row<PeakRecord>) {
269
+ function handleActiveRow(row: TanStackTableRow<PeakRecord>) {
268
270
  return row.original.isConstantlyHighlighted;
269
271
  }
270
272
 
@@ -280,7 +282,7 @@ function PeaksTable(props: PeaksTableProps) {
280
282
  }
281
283
 
282
284
  return (
283
- <ReactTable
285
+ <TanStackTable
284
286
  activeRow={handleActiveRow}
285
287
  rowStyle={{ activated: { backgroundColor: '#f5f5dc' } }}
286
288
  data={data}
@@ -1,20 +1,26 @@
1
1
  import dlv from 'dlv';
2
2
 
3
- import type { ControlCustomColumn } from '../../elements/ReactTable/utility/addCustomColumn.tsx';
3
+ import type { TanStackTableColumn } from '../../elements/tanstack_table/index.ts';
4
4
 
5
5
  import type { PeakRecord } from './PeaksPanel.tsx';
6
6
 
7
+ type ExportCellValue = boolean | null | number | string | undefined;
8
+
9
+ function formatCellValue(value: ExportCellValue) {
10
+ return value === null || value === undefined ? '' : String(value);
11
+ }
12
+
7
13
  export function exportPeaksToTSV(
8
14
  data: PeakRecord[],
9
- tableColumns: Array<ControlCustomColumn<PeakRecord>>,
15
+ tableColumns: Array<TanStackTableColumn<PeakRecord>>,
10
16
  ) {
11
17
  const exportColumns = tableColumns.filter(
12
- (col) => col.Header && typeof col.Header === 'string',
18
+ (col) => col.header && typeof col.header === 'string',
13
19
  );
14
20
 
15
21
  const headers: string[] = [];
16
22
  for (const col of exportColumns) {
17
- headers.push(col.Header as string);
23
+ headers.push(col.header as string);
18
24
  }
19
25
 
20
26
  const rows: string[] = [];
@@ -22,18 +28,11 @@ export function exportPeaksToTSV(
22
28
  const record = data[i];
23
29
  const cells: string[] = [];
24
30
  for (const col of exportColumns) {
25
- const accessor = col.accessor;
26
- if (typeof accessor === 'string') {
27
- cells.push(String(dlv(record, accessor) ?? ''));
28
- } else if (typeof accessor === 'function') {
31
+ if ('accessorKey' in col) {
32
+ cells.push(formatCellValue(dlv(record, col.accessorKey)));
33
+ } else if ('accessorFn' in col) {
29
34
  cells.push(
30
- String(
31
- accessor(record, i, {
32
- subRows: [],
33
- depth: 0,
34
- data: [],
35
- }) ?? '',
36
- ),
35
+ formatCellValue(col.accessorFn(record, i) as ExportCellValue),
37
36
  );
38
37
  } else {
39
38
  cells.push('');
@@ -5,7 +5,7 @@ import { FaLink } from 'react-icons/fa';
5
5
 
6
6
  import { withDialog } from '../../elements/DialogManager.js';
7
7
  import { EmptyText } from '../../elements/EmptyText.js';
8
- import type { TableContextMenuProps } from '../../elements/ReactTable/ReactTable.js';
8
+ import type { TanStackTableContextMenuProps } from '../../elements/tanstack_table/index.ts';
9
9
  import useTableSortBy from '../../hooks/useTableSortBy.js';
10
10
  import { EditRangeModal } from '../../modal/editRange/EditRangeModal.js';
11
11
  import { extractChemicalElement } from '../../utility/extractChemicalElement.js';
@@ -13,6 +13,7 @@ import { NoDataForFid } from '../extra/placeholder/NoDataForFid.js';
13
13
 
14
14
  import type { RangesTableDataRow } from './RangesPanel.js';
15
15
  import RangesTableRow from './RangesTableRow.js';
16
+ import type { RangeData } from './hooks/useMapRanges.js';
16
17
  import useMapRanges from './hooks/useMapRanges.js';
17
18
 
18
19
  const Table = styled.table`
@@ -60,7 +61,7 @@ const Table = styled.table`
60
61
  }
61
62
  `;
62
63
 
63
- interface RangesTableProps extends TableContextMenuProps {
64
+ interface RangesTableProps extends TanStackTableContextMenuProps<RangeData> {
64
65
  preferences: WorkspacePanelPreferences['ranges'];
65
66
  tableData: RangesTableDataRow[];
66
67
  activeTab: string;
@@ -11,7 +11,7 @@ import {
11
11
  import { filterAssignedIDs } from '../../assignment/utilities/filterAssignedIDs.js';
12
12
  import { useDispatch } from '../../context/DispatchContext.js';
13
13
  import { ContextMenu } from '../../elements/ContextMenuBluePrint.js';
14
- import type { TableContextMenuProps } from '../../elements/ReactTable/ReactTable.js';
14
+ import type { TanStackTableContextMenuProps } from '../../elements/tanstack_table/index.ts';
15
15
  import { useHighlight } from '../../highlight/index.js';
16
16
 
17
17
  import AbsoluteColumn from './TableColumns/AbsoluteColumn.js';
@@ -33,7 +33,7 @@ const ConstantlyHighlightedRowStyle = {
33
33
  backgroundColor: '#f5f5dc',
34
34
  };
35
35
 
36
- interface RangesTableRowProps extends TableContextMenuProps {
36
+ interface RangesTableRowProps extends TanStackTableContextMenuProps<RangeData> {
37
37
  rowData: RangeData;
38
38
  preferences: WorkspacePanelPreferences['ranges'];
39
39
  info: Info1D;
@@ -13,7 +13,6 @@ import type { CSSProperties, MouseEvent } from 'react';
13
13
  import { useCallback, useMemo, useState } from 'react';
14
14
  import { FaCopy, FaFileExport, FaRegTrashAlt } from 'react-icons/fa';
15
15
  import { IoColorPaletteOutline } from 'react-icons/io5';
16
- import type { CellProps } from 'react-table';
17
16
 
18
17
  import { exportForCT } from '../../../data/SpectraManager.js';
19
18
  import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardComponents.js';
@@ -24,8 +23,14 @@ import { useSortSpectra } from '../../context/SortSpectraContext.js';
24
23
  import { useToaster } from '../../context/ToasterContext.js';
25
24
  import type { ContextMenuItem } from '../../elements/ContextMenuBluePrint.js';
26
25
  import { ContextMenu } from '../../elements/ContextMenuBluePrint.js';
27
- import type { Column } from '../../elements/ReactTable/ReactTable.js';
28
- import ReactTable from '../../elements/ReactTable/ReactTable.js';
26
+ import type {
27
+ TanStackTableColumn,
28
+ TanStackTableRow,
29
+ } from '../../elements/tanstack_table/index.ts';
30
+ import {
31
+ TanStackTable,
32
+ createTanStackColumnHelper,
33
+ } from '../../elements/tanstack_table/index.ts';
29
34
  import { usePanelPreferences } from '../../hooks/usePanelPreferences.js';
30
35
  import ExportAsJcampModal from '../../modal/ExportAsJcampModal.js';
31
36
  import { getValueByPath } from '../../utility/getValueByPath.ts';
@@ -146,6 +151,8 @@ function isValidExportForCT(spectrum: Spectrum, molecules: StateMolecule[]) {
146
151
  return true;
147
152
  }
148
153
 
154
+ const columnHelper = createTanStackColumnHelper<Spectrum>();
155
+
149
156
  export function SpectraTable(props: SpectraTableProps) {
150
157
  const {
151
158
  data,
@@ -165,18 +172,23 @@ export function SpectraTable(props: SpectraTableProps) {
165
172
  const { sort, reset } = useSortSpectra();
166
173
 
167
174
  const COLUMNS: Partial<
168
- Record<(string & {}) | PredefinedSpectraColumn, Column<Spectrum>>
175
+ Record<
176
+ (string & {}) | PredefinedSpectraColumn,
177
+ TanStackTableColumn<Spectrum>
178
+ >
169
179
  > = useMemo(
170
180
  () => ({
171
181
  visible: {
172
182
  id: 'hide-show-spectrum',
173
- Header: '',
174
- style: {
175
- width: '35px',
176
- maxWidth: '55px',
177
- height: '24px',
183
+ header: '',
184
+ meta: {
185
+ style: {
186
+ width: '35px',
187
+ maxWidth: '55px',
188
+ height: '24px',
189
+ },
178
190
  },
179
- Cell: ({ row }: CellProps<Spectrum>) => {
191
+ cell: ({ row }) => {
180
192
  return (
181
193
  <ShowHideSpectrumButton
182
194
  data={row.original}
@@ -187,12 +199,14 @@ export function SpectraTable(props: SpectraTableProps) {
187
199
  },
188
200
  color: {
189
201
  id: 'spectrum-actions',
190
- style: {
191
- width: '30px',
192
- maxWidth: '30px',
193
- height: '24px',
202
+ meta: {
203
+ style: {
204
+ width: '30px',
205
+ maxWidth: '30px',
206
+ height: '24px',
207
+ },
194
208
  },
195
- Cell: ({ row }: CellProps<Spectrum>) => {
209
+ cell: ({ row }) => {
196
210
  const {
197
211
  display,
198
212
  info: { dimension, isFid },
@@ -215,7 +229,7 @@ export function SpectraTable(props: SpectraTableProps) {
215
229
  );
216
230
 
217
231
  const selectContextMenuHandler = useCallback(
218
- async (option: any, spectrum: any) => {
232
+ async (option: any, spectrum: Spectrum) => {
219
233
  const { id } = option;
220
234
  switch (id) {
221
235
  case SpectraContextMenuOptionsKeys.CopyToClipboard: {
@@ -288,13 +302,14 @@ export function SpectraTable(props: SpectraTableProps) {
288
302
  [dispatch, molecules, rawWriteWithType, toaster],
289
303
  );
290
304
 
291
- function handleActiveRow(row: any) {
292
- return activeSpectraSet.has(row?.original.id) || false;
305
+ function handleActiveRow(row: TanStackTableRow<Spectrum>) {
306
+ return activeSpectraSet.has(row.original.id);
293
307
  }
294
308
 
295
309
  const tableColumns = useMemo(() => {
296
- const columns: Array<Column<Spectrum>> = [];
297
- let index = 0;
310
+ const columns = columnHelper.columns([]);
311
+ const columnIdCounts = new Map<string, number>();
312
+ // TODO: use column visibility feature
298
313
  const visibleColumns = spectraPreferences.columns.filter(
299
314
  (col) => col.visible,
300
315
  );
@@ -305,32 +320,37 @@ export function SpectraTable(props: SpectraTableProps) {
305
320
  if (name && COLUMNS[name]) {
306
321
  columns.push({
307
322
  ...COLUMNS[name],
308
- Header: () => <ColumnHeader label={col.label} col={col} />,
323
+ header: () => <ColumnHeader label={col.label} col={col} />,
309
324
  id: name,
310
325
  });
311
326
  } else {
312
327
  const pathString = pathToString(jpath);
313
328
  let style: CSSProperties = columnStyle;
314
- let cellRender: Column<Spectrum>['Cell'] | null = null;
329
+ let cellRender: TanStackTableColumn<Spectrum>['cell'] | null = null;
315
330
  if (pathString === 'info.name') {
316
331
  if (visibleColumns.length > 3) {
317
332
  style = { ...columnStyle, width: '50%' };
318
333
  }
319
- cellRender = ({ row }: CellProps<Spectrum>) => {
334
+ cellRender = ({ row }) => {
320
335
  return <SpectrumName data={row.original} />;
321
336
  };
322
337
  }
323
338
 
324
339
  if (pathString === 'info.solvent') {
325
- cellRender = ({ row }: CellProps<Spectrum>) => {
340
+ cellRender = ({ row }) => {
326
341
  return <RenderAsHTML data={row.original} jpath={pathString} />;
327
342
  };
328
343
  }
329
344
 
330
- const cell: Column<Spectrum> = {
331
- Header: () => <ColumnHeader label={col.label} col={col} />,
332
- Cell: ({ row }: CellProps<Spectrum>) => {
333
- const val = getValueByPath(row.original, jpath, format);
345
+ const baseColumnId = `jpath:${pathString}`;
346
+ const duplicateIndex = columnIdCounts.get(baseColumnId) ?? 0;
347
+ columnIdCounts.set(baseColumnId, duplicateIndex + 1);
348
+
349
+ const cell: TanStackTableColumn<Spectrum> = {
350
+ header: () => <ColumnHeader label={col.label} col={col} />,
351
+ accessorFn: (value) => getValueByPath(value, jpath, format),
352
+ cell: ({ getValue }) => {
353
+ const val = getValue() as any;
334
354
  return (
335
355
  <Tooltip
336
356
  content={val}
@@ -340,19 +360,21 @@ export function SpectraTable(props: SpectraTableProps) {
340
360
  />
341
361
  );
342
362
  },
343
- ...(cellRender && { Cell: cellRender }),
344
- id: `${index}`,
345
- style,
363
+ ...(cellRender && { cell: cellRender }),
364
+ id:
365
+ duplicateIndex === 0
366
+ ? baseColumnId
367
+ : `${baseColumnId}:${duplicateIndex}`,
368
+ meta: { style },
346
369
  };
347
370
 
348
371
  columns.push(cell);
349
372
  }
350
- index++;
351
373
  }
352
374
  return columns;
353
375
  }, [COLUMNS, spectraPreferences.columns]);
354
376
 
355
- function handleSortEnd(data: any, isTabledSorted: any) {
377
+ function handleSortEnd(data: any, isTabledSorted?: boolean) {
356
378
  if (isTabledSorted) {
357
379
  sort({ sortType: 'sortByReferenceIndexes', sortByReferences: data });
358
380
  } else {
@@ -360,9 +382,9 @@ export function SpectraTable(props: SpectraTableProps) {
360
382
  }
361
383
  }
362
384
 
363
- function handleRowStyle(data: any) {
385
+ function handleRowStyle(row: TanStackTableRow<Spectrum>) {
364
386
  return {
365
- base: activeSpectraSet.has(data?.original.id) ? { opacity: 0.2 } : {},
387
+ base: activeSpectraSet.has(row.original.id) ? { opacity: 0.2 } : {},
366
388
  activated: { opacity: 1 },
367
389
  };
368
390
  }
@@ -375,7 +397,7 @@ export function SpectraTable(props: SpectraTableProps) {
375
397
  : Spectra2DContextMenuOptions;
376
398
  return (
377
399
  <>
378
- <ReactTable
400
+ <TanStackTable
379
401
  rowStyle={handleRowStyle}
380
402
  activeRow={handleActiveRow}
381
403
  data={data}