nmrium 0.38.1 → 0.39.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 (474) hide show
  1. package/lib/component/1d/ApodizationLine.js +27 -4
  2. package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
  3. package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
  4. package/lib/component/1d/FooterBanner.js +5 -5
  5. package/lib/component/1d/SpectraLegends.js +2 -3
  6. package/lib/component/1d/Viewer1D.js +1 -1
  7. package/lib/component/1d/integral/Integral.d.ts +1 -1
  8. package/lib/component/1d/integral/IntegralResizable.d.ts +1 -1
  9. package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
  10. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
  11. package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
  12. package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -1
  13. package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
  14. package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +1 -1
  15. package/lib/component/1d/peaks/usePeakShapesPath.d.ts +2 -1
  16. package/lib/component/1d/ranges/Range.d.ts +1 -1
  17. package/lib/component/1d/tool/PeakPointer.js +6 -6
  18. package/lib/component/1d/tool/XLabelPointer.js +5 -5
  19. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -1
  20. package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
  21. package/lib/component/1d-2d/tools/BrushX.js +2 -3
  22. package/lib/component/1d-2d/tools/BrushXY.js +2 -3
  23. package/lib/component/1d-2d/tools/CrossLinePointer.js +4 -5
  24. package/lib/component/2d/Chart2D.js +4 -4
  25. package/lib/component/2d/FooterBanner.js +5 -5
  26. package/lib/component/2d/Viewer2D.js +1 -1
  27. package/lib/component/2d/tools/XYLabelPointer.js +5 -5
  28. package/lib/component/2d/zones/Signal.d.ts +1 -1
  29. package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
  30. package/lib/component/2d/zones/Zone.d.ts +1 -1
  31. package/lib/component/EventsTrackers/BrushTracker.d.ts +20 -12
  32. package/lib/component/EventsTrackers/BrushTracker.js +35 -22
  33. package/lib/component/EventsTrackers/KeysListenerTracker.js +90 -67
  34. package/lib/component/EventsTrackers/MouseTracker.d.ts +6 -2
  35. package/lib/component/EventsTrackers/MouseTracker.js +4 -1
  36. package/lib/component/NMRium.d.ts +5 -5
  37. package/lib/component/NMRium.js +15 -16
  38. package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
  39. package/lib/component/context/LoggerContext.js +5 -0
  40. package/lib/component/context/PreferencesContext.d.ts +10 -8
  41. package/lib/component/elements/Button.d.ts +13 -11
  42. package/lib/component/elements/Button.js +16 -25
  43. package/lib/component/elements/ColorInput.d.ts +0 -1
  44. package/lib/component/elements/ColorInput.js +2 -2
  45. package/lib/component/elements/EditableColumn.js +5 -2
  46. package/lib/component/elements/Input.js +2 -4
  47. package/lib/component/elements/Label.d.ts +1 -0
  48. package/lib/component/elements/Label.js +2 -2
  49. package/lib/component/elements/MolecularFormulaInput.d.ts +2 -2
  50. package/lib/component/elements/MolecularFormulaInput.js +15 -18
  51. package/lib/component/elements/NextPrev.d.ts +5 -3
  52. package/lib/component/elements/NextPrev.js +26 -8
  53. package/lib/component/elements/NumberInput.js +2 -2
  54. package/lib/component/elements/ReactTable/ReactTable.js +4 -4
  55. package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
  56. package/lib/component/elements/formik/FormikCheckBox.js +2 -2
  57. package/lib/component/elements/formik/FormikColumnFormatField.d.ts +4 -0
  58. package/lib/component/elements/formik/FormikColumnFormatField.js +19 -16
  59. package/lib/component/elements/formik/FormikError.d.ts +8 -0
  60. package/lib/component/elements/formik/FormikError.js +22 -0
  61. package/lib/component/elements/formik/FormikInput.js +10 -6
  62. package/lib/component/elements/formik/FormikSelect.js +1 -1
  63. package/lib/component/header/ApodizationOptionsPanel.js +4 -3
  64. package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -7
  65. package/lib/component/header/BaseLineCorrectionPanel.js +5 -2
  66. package/lib/component/header/PhaseCorrectionPanel.js +5 -2
  67. package/lib/component/header/RangesPickingOptionPanel.js +15 -7
  68. package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
  69. package/lib/component/highlight/index.d.ts +1 -1
  70. package/lib/component/hooks/useActiveSpectra.d.ts +1 -1
  71. package/lib/component/hooks/useActiveSpectrum.d.ts +1 -1
  72. package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts +1 -1
  73. package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +2 -0
  74. package/lib/component/hooks/useCheckPointsNumberInWindowArea.js +17 -0
  75. package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -2
  76. package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +3 -2
  77. package/lib/component/hooks/useExport.js +1 -1
  78. package/lib/component/hooks/useFilter.d.ts +2 -1
  79. package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
  80. package/lib/component/hooks/usePanelPreferences.js +4 -0
  81. package/lib/component/hooks/useSaveSettings.d.ts +1 -1
  82. package/lib/component/hooks/useSaveSettings.js +17 -15
  83. package/lib/component/hooks/useVerticalAlign.d.ts +1 -1
  84. package/lib/component/loader/DropZone.js +1 -2
  85. package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
  86. package/lib/component/modal/LoadJCAMPModal.d.ts +3 -3
  87. package/lib/component/modal/LoadJCAMPModal.js +56 -74
  88. package/lib/component/modal/ModalStyle.js +0 -10
  89. package/lib/component/modal/MoleculeStructureEditorModal.d.ts +2 -1
  90. package/lib/component/modal/MoleculeStructureEditorModal.js +12 -6
  91. package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
  92. package/lib/component/modal/PredictSpectraModal.d.ts +4 -2
  93. package/lib/component/modal/PredictSpectraModal.js +53 -105
  94. package/lib/component/modal/SaveAsModal.d.ts +2 -0
  95. package/lib/component/modal/SaveAsModal.js +21 -14
  96. package/lib/component/modal/changeSum/ChangeSumModal.js +25 -38
  97. package/lib/component/modal/editRange/EditRangeModal.d.ts +7 -6
  98. package/lib/component/modal/editRange/EditRangeModal.js +33 -13
  99. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +1 -1
  100. package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -0
  101. package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -2
  102. package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -5
  103. package/lib/component/modal/setting/GeneralSettings.js +2 -7
  104. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
  105. package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
  106. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
  107. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -15
  108. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
  109. package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +1 -11
  110. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +20 -25
  111. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +6 -11
  112. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +71 -81
  113. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
  114. package/lib/component/panels/MoleculesPanel/Utilities.js +3 -1
  115. package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
  116. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  117. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
  118. package/lib/component/panels/Panels.js +2 -2
  119. package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +1 -1
  120. package/lib/component/panels/RangesPanel/RangesHeader.js +39 -53
  121. package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
  122. package/lib/component/panels/RangesPanel/RangesPreferences.js +7 -22
  123. package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
  124. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
  125. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
  126. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
  127. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +9 -12
  128. package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
  129. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
  130. package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
  131. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -2
  132. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
  133. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
  134. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
  135. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +1 -1
  136. package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
  137. package/lib/component/panels/databasePanel/DatabasePanel.js +5 -24
  138. package/lib/component/panels/databasePanel/DatabasePreferences.js +2 -2
  139. package/lib/component/panels/header/DefaultPanelHeader.d.ts +2 -3
  140. package/lib/component/panels/header/DefaultPanelHeader.js +18 -26
  141. package/lib/component/panels/header/PanelHeader.d.ts +7 -0
  142. package/lib/component/panels/header/PanelHeader.js +12 -0
  143. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +9 -0
  144. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +94 -0
  145. package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -1
  146. package/lib/component/panels/predictionPanel/PredictionPanel.js +109 -37
  147. package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +3 -0
  148. package/lib/component/panels/predictionPanel/PredictionPreferences.js +24 -0
  149. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.d.ts +2 -0
  150. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +44 -0
  151. package/lib/component/reducer/Reducer.d.ts +5 -87
  152. package/lib/component/reducer/Reducer.js +1 -29
  153. package/lib/component/reducer/actions/DatabaseActions.js +6 -4
  154. package/lib/component/reducer/actions/DomainActions.js +3 -0
  155. package/lib/component/reducer/actions/FiltersActions.d.ts +1 -2
  156. package/lib/component/reducer/actions/FiltersActions.js +47 -52
  157. package/lib/component/reducer/actions/HistoryActions.d.ts +4 -0
  158. package/lib/component/reducer/actions/HistoryActions.js +40 -0
  159. package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
  160. package/lib/component/reducer/actions/IntegralsActions.js +3 -1
  161. package/lib/component/reducer/actions/LoadActions.d.ts +1 -2
  162. package/lib/component/reducer/actions/LoadActions.js +1 -1
  163. package/lib/component/reducer/actions/MoleculeActions.d.ts +7 -4
  164. package/lib/component/reducer/actions/MoleculeActions.js +57 -28
  165. package/lib/component/reducer/actions/PeaksActions.d.ts +1 -2
  166. package/lib/component/reducer/actions/PeaksActions.js +3 -3
  167. package/lib/component/reducer/actions/RangesActions.d.ts +4 -5
  168. package/lib/component/reducer/actions/RangesActions.js +5 -27
  169. package/lib/component/reducer/actions/SpectrumsActions.js +8 -8
  170. package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
  171. package/lib/component/reducer/actions/ToolsActions.js +3 -32
  172. package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
  173. package/lib/component/reducer/actions/ZonesActions.js +3 -6
  174. package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +8 -0
  175. package/lib/component/reducer/helper/ZoomHistoryManager.js +35 -0
  176. package/lib/component/reducer/helper/getActiveSpectra.d.ts +1 -1
  177. package/lib/component/reducer/helper/getActiveSpectrum.d.ts +1 -1
  178. package/lib/component/reducer/helper/getVerticalAlign.d.ts +1 -1
  179. package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
  180. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +1 -1
  181. package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -3
  182. package/lib/component/reducer/preferences/utilities/getActiveWorkspace.d.ts +1 -1
  183. package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +2 -3
  184. package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +1 -1
  185. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -1
  186. package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +1 -1
  187. package/lib/component/toolbar/BasicToolBar.js +6 -11
  188. package/lib/component/toolbar/ToolTypes.d.ts +2 -2
  189. package/lib/component/toolbar/ToolTypes.js +1 -1
  190. package/lib/component/workspaces/assignment.d.ts +1 -1
  191. package/lib/component/workspaces/basic.d.ts +1 -1
  192. package/lib/component/workspaces/embedded.d.ts +1 -1
  193. package/lib/component/workspaces/exercise.d.ts +1 -1
  194. package/lib/component/workspaces/index.d.ts +6 -6
  195. package/lib/component/workspaces/prediction.d.ts +1 -1
  196. package/lib/component/workspaces/prediction.js +193 -0
  197. package/lib/component/workspaces/process1D.d.ts +1 -1
  198. package/lib/component/workspaces/workspaceDefaultProperties.d.ts +1 -1
  199. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
  200. package/lib/data/PredictionManager.d.ts +3 -1
  201. package/lib/data/PredictionManager.js +43 -3
  202. package/lib/data/SpectraManager.d.ts +1 -2
  203. package/lib/data/constants/DefaultApodizationOptions.d.ts +2 -0
  204. package/lib/data/constants/DefaultApodizationOptions.js +5 -0
  205. package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -1
  206. package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -2
  207. package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
  208. package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.d.ts +1 -2
  209. package/lib/data/data1d/Spectrum1D/index.d.ts +1 -5
  210. package/lib/data/data1d/Spectrum1D/index.js +1 -5
  211. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
  212. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +3 -2
  213. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +1 -1
  214. package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +1 -1
  215. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -1
  216. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
  217. package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -2
  218. package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +1 -1
  219. package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +2 -2
  220. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +2 -1
  221. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
  222. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +7 -7
  223. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -24
  224. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -1
  225. package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -1
  226. package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
  227. package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
  228. package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
  229. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -2
  230. package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +13 -6
  231. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +1 -1
  232. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +23 -18
  233. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +37 -2
  234. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +1 -1
  235. package/lib/data/data1d/database.js +2 -4
  236. package/lib/data/data1d/multipleSpectraAnalysis.d.ts +3 -30
  237. package/lib/data/data1d/multipleSpectraAnalysis.js +4 -15
  238. package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +3 -2
  239. package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
  240. package/lib/data/data2d/Spectrum2D/getSlice.d.ts +1 -1
  241. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  242. package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
  243. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -1
  244. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +3 -2
  245. package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -1
  246. package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +3 -2
  247. package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
  248. package/lib/data/types/data1d/ComplexData1D.d.ts +2 -2
  249. package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
  250. package/lib/data/utilities/FindUtilities.d.ts +2 -1
  251. package/lib/data/utilities/RangeUtilities.d.ts +1 -1
  252. package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
  253. package/lib/data/utilities/calculateSanPlot.d.ts +2 -2
  254. package/lib/types/NMRiumDataReturn.d.ts +1 -3
  255. package/lib/versionInfo.js +1 -1
  256. package/lib-cjs/component/1d/ApodizationLine.js +28 -5
  257. package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +3 -26
  258. package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +5 -28
  259. package/lib-cjs/component/1d/FooterBanner.js +2 -2
  260. package/lib-cjs/component/1d/SpectraLegends.js +1 -2
  261. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
  262. package/lib-cjs/component/1d/tool/PeakPointer.js +3 -3
  263. package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
  264. package/lib-cjs/component/1d-2d/tools/BrushX.js +1 -2
  265. package/lib-cjs/component/1d-2d/tools/BrushXY.js +1 -2
  266. package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +2 -3
  267. package/lib-cjs/component/2d/Chart2D.js +4 -4
  268. package/lib-cjs/component/2d/FooterBanner.js +2 -2
  269. package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
  270. package/lib-cjs/component/EventsTrackers/BrushTracker.js +36 -22
  271. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +90 -67
  272. package/lib-cjs/component/EventsTrackers/MouseTracker.js +4 -1
  273. package/lib-cjs/component/NMRium.js +12 -13
  274. package/lib-cjs/component/context/LoggerContext.js +5 -0
  275. package/lib-cjs/component/elements/Button.js +16 -25
  276. package/lib-cjs/component/elements/ColorInput.js +2 -2
  277. package/lib-cjs/component/elements/EditableColumn.js +5 -2
  278. package/lib-cjs/component/elements/Input.js +2 -4
  279. package/lib-cjs/component/elements/Label.js +2 -2
  280. package/lib-cjs/component/elements/MolecularFormulaInput.js +14 -16
  281. package/lib-cjs/component/elements/NextPrev.js +26 -8
  282. package/lib-cjs/component/elements/NumberInput.js +2 -2
  283. package/lib-cjs/component/elements/ReactTable/ReactTable.js +4 -4
  284. package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
  285. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +20 -16
  286. package/lib-cjs/component/elements/formik/FormikError.js +27 -0
  287. package/lib-cjs/component/elements/formik/FormikInput.js +10 -6
  288. package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
  289. package/lib-cjs/component/header/ApodizationOptionsPanel.js +6 -5
  290. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +15 -6
  291. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
  292. package/lib-cjs/component/header/PhaseCorrectionPanel.js +6 -26
  293. package/lib-cjs/component/header/RangesPickingOptionPanel.js +15 -7
  294. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -25
  295. package/lib-cjs/component/hooks/useCheckPointsNumberInWindowArea.js +24 -0
  296. package/lib-cjs/component/hooks/useExport.js +1 -1
  297. package/lib-cjs/component/hooks/usePanelPreferences.js +4 -0
  298. package/lib-cjs/component/hooks/useSaveSettings.js +16 -14
  299. package/lib-cjs/component/loader/DropZone.js +1 -2
  300. package/lib-cjs/component/modal/LoadJCAMPModal.js +81 -75
  301. package/lib-cjs/component/modal/ModalStyle.js +0 -10
  302. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +12 -6
  303. package/lib-cjs/component/modal/PredictSpectraModal.js +53 -126
  304. package/lib-cjs/component/modal/SaveAsModal.js +22 -14
  305. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +24 -37
  306. package/lib-cjs/component/modal/editRange/EditRangeModal.js +32 -12
  307. package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -0
  308. package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
  309. package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -7
  310. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +6 -14
  311. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
  312. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +19 -24
  313. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +76 -86
  314. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +3 -1
  315. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
  316. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  317. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
  318. package/lib-cjs/component/panels/Panels.js +2 -2
  319. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +38 -52
  320. package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
  321. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +9 -12
  322. package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
  323. package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
  324. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
  325. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
  326. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -24
  327. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +25 -2
  328. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +18 -26
  329. package/lib-cjs/component/panels/header/PanelHeader.js +15 -0
  330. package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +122 -0
  331. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +109 -37
  332. package/lib-cjs/component/panels/predictionPanel/PredictionPreferences.js +29 -0
  333. package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +72 -0
  334. package/lib-cjs/component/reducer/Reducer.js +2 -31
  335. package/lib-cjs/component/reducer/actions/DatabaseActions.js +6 -4
  336. package/lib-cjs/component/reducer/actions/DomainActions.js +3 -0
  337. package/lib-cjs/component/reducer/actions/FiltersActions.js +66 -94
  338. package/lib-cjs/component/reducer/actions/HistoryActions.js +45 -0
  339. package/lib-cjs/component/reducer/actions/IntegralsActions.js +3 -1
  340. package/lib-cjs/component/reducer/actions/MoleculeActions.js +58 -32
  341. package/lib-cjs/component/reducer/actions/PeaksActions.js +3 -3
  342. package/lib-cjs/component/reducer/actions/RangesActions.js +7 -52
  343. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +10 -33
  344. package/lib-cjs/component/reducer/actions/ToolsActions.js +26 -32
  345. package/lib-cjs/component/reducer/actions/ZonesActions.js +6 -32
  346. package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +37 -0
  347. package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -2
  348. package/lib-cjs/component/toolbar/BasicToolBar.js +5 -10
  349. package/lib-cjs/component/toolbar/ToolTypes.js +9 -32
  350. package/lib-cjs/component/workspaces/prediction.js +193 -0
  351. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +21 -44
  352. package/lib-cjs/data/PredictionManager.js +43 -3
  353. package/lib-cjs/data/constants/DefaultApodizationOptions.js +8 -0
  354. package/lib-cjs/data/data1d/Spectrum1D/index.js +7 -11
  355. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -32
  356. package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
  357. package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
  358. package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
  359. package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
  360. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +7 -26
  361. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
  362. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
  363. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +3 -4
  364. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +13 -6
  365. package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +23 -18
  366. package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
  367. package/lib-cjs/data/data1d/database.js +2 -4
  368. package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +5 -16
  369. package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -26
  370. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +2 -25
  371. package/lib-cjs/versionInfo.js +1 -1
  372. package/package.json +29 -29
  373. package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +0 -7
  374. package/lib/component/panels/predictionPanel/PredictionOptions.js +0 -74
  375. package/lib/component/workspaces/Workspace.d.ts +0 -188
  376. package/lib/component/workspaces/Workspace.js +0 -1
  377. package/lib/data/Filters.d.ts +0 -12
  378. package/lib/data/Filters.js +0 -12
  379. package/lib/data/FiltersManager.d.ts +0 -30
  380. package/lib/data/FiltersManager.js +0 -175
  381. package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +0 -2
  382. package/lib/data/data1d/Spectrum1D/getShiftX.js +0 -6
  383. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +0 -2
  384. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -4
  385. package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +0 -7
  386. package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -9
  387. package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +0 -12
  388. package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -36
  389. package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +0 -2
  390. package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -6
  391. package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +0 -2
  392. package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -5
  393. package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +0 -2
  394. package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -26
  395. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +0 -3
  396. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -45
  397. package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +0 -2
  398. package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -7
  399. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +0 -4
  400. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -78
  401. package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +0 -2
  402. package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -9
  403. package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +0 -2
  404. package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -5
  405. package/lib/data/data1d/filter1d/apodization.d.ts +0 -27
  406. package/lib/data/data1d/filter1d/apodization.js +0 -81
  407. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +0 -33
  408. package/lib/data/data1d/filter1d/baselineCorrection.js +0 -51
  409. package/lib/data/data1d/filter1d/digitalFilter.d.ts +0 -20
  410. package/lib/data/data1d/filter1d/digitalFilter.js +0 -44
  411. package/lib/data/data1d/filter1d/equallySpaced.d.ts +0 -33
  412. package/lib/data/data1d/filter1d/equallySpaced.js +0 -52
  413. package/lib/data/data1d/filter1d/exclusionZones.d.ts +0 -15
  414. package/lib/data/data1d/filter1d/exclusionZones.js +0 -32
  415. package/lib/data/data1d/filter1d/fft.d.ts +0 -18
  416. package/lib/data/data1d/filter1d/fft.js +0 -90
  417. package/lib/data/data1d/filter1d/phaseCorrection.d.ts +0 -26
  418. package/lib/data/data1d/filter1d/phaseCorrection.js +0 -64
  419. package/lib/data/data1d/filter1d/shiftX.d.ts +0 -20
  420. package/lib/data/data1d/filter1d/shiftX.js +0 -26
  421. package/lib/data/data1d/filter1d/signalProcessing.d.ts +0 -26
  422. package/lib/data/data1d/filter1d/signalProcessing.js +0 -65
  423. package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +0 -2
  424. package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -35
  425. package/lib/data/data1d/filter1d/zeroFilling.d.ts +0 -22
  426. package/lib/data/data1d/filter1d/zeroFilling.js +0 -60
  427. package/lib/data/data2d/filter2d/shiftX.d.ts +0 -18
  428. package/lib/data/data2d/filter2d/shiftX.js +0 -27
  429. package/lib/data/data2d/filter2d/shiftY.d.ts +0 -18
  430. package/lib/data/data2d/filter2d/shiftY.js +0 -27
  431. package/lib/data/types/view-state/PeaksViewState.d.ts +0 -17
  432. package/lib/data/types/view-state/PeaksViewState.js +0 -1
  433. package/lib/types/NMRiumGeneralPreferences.d.ts +0 -7
  434. package/lib/types/NMRiumGeneralPreferences.js +0 -1
  435. package/lib/types/NMRiumPanelPreferences.d.ts +0 -17
  436. package/lib/types/NMRiumPanelPreferences.js +0 -1
  437. package/lib/types/NMRiumToolBarPreferences.d.ts +0 -22
  438. package/lib/types/NMRiumToolBarPreferences.js +0 -1
  439. package/lib/types/PanelPreferencesType.d.ts +0 -4
  440. package/lib/types/PanelPreferencesType.js +0 -1
  441. package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +0 -102
  442. package/lib-cjs/component/workspaces/Workspace.js +0 -2
  443. package/lib-cjs/data/Filters.js +0 -38
  444. package/lib-cjs/data/FiltersManager.js +0 -206
  445. package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +0 -33
  446. package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -8
  447. package/lib-cjs/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -13
  448. package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -40
  449. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -10
  450. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -9
  451. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -30
  452. package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -49
  453. package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -11
  454. package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -82
  455. package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -13
  456. package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -9
  457. package/lib-cjs/data/data1d/filter1d/apodization.js +0 -88
  458. package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +0 -60
  459. package/lib-cjs/data/data1d/filter1d/digitalFilter.js +0 -50
  460. package/lib-cjs/data/data1d/filter1d/equallySpaced.js +0 -61
  461. package/lib-cjs/data/data1d/filter1d/exclusionZones.js +0 -38
  462. package/lib-cjs/data/data1d/filter1d/fft.js +0 -96
  463. package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +0 -70
  464. package/lib-cjs/data/data1d/filter1d/shiftX.js +0 -32
  465. package/lib-cjs/data/data1d/filter1d/signalProcessing.js +0 -95
  466. package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -39
  467. package/lib-cjs/data/data1d/filter1d/zeroFilling.js +0 -66
  468. package/lib-cjs/data/data2d/filter2d/shiftX.js +0 -33
  469. package/lib-cjs/data/data2d/filter2d/shiftY.js +0 -33
  470. package/lib-cjs/data/types/view-state/PeaksViewState.js +0 -2
  471. package/lib-cjs/types/NMRiumGeneralPreferences.js +0 -2
  472. package/lib-cjs/types/NMRiumPanelPreferences.js +0 -2
  473. package/lib-cjs/types/NMRiumToolBarPreferences.js +0 -2
  474. package/lib-cjs/types/PanelPreferencesType.js +0 -2
@@ -8,22 +8,13 @@ const formik_1 = require("formik");
8
8
  const react_1 = require("react");
9
9
  const PreferencesContext_1 = require("../../context/PreferencesContext");
10
10
  const Label_1 = __importDefault(require("../../elements/Label"));
11
+ const FormikColumnFormatField_1 = require("../../elements/formik/FormikColumnFormatField");
11
12
  const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
12
13
  const useNucleus_1 = __importDefault(require("../../hooks/useNucleus"));
13
14
  const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
14
15
  const getUniqueNuclei_1 = require("../../utility/getUniqueNuclei");
15
16
  const NucleusPreferences_1 = require("../extra/preferences/NucleusPreferences");
16
17
  const PreferencesContainer_1 = require("../extra/preferences/PreferencesContainer");
17
- const styles = {
18
- inputLabel: {
19
- flex: 2,
20
- },
21
- inputWrapper: {
22
- width: '100px',
23
- flex: '4',
24
- borderRadius: '5px',
25
- },
26
- };
27
18
  const formatFields = [
28
19
  {
29
20
  id: 1,
@@ -80,23 +71,17 @@ function RangesPreferences(props, ref) {
80
71
  const nucleus = (0, useNucleus_1.default)();
81
72
  const nuclei = (0, react_1.useMemo)(() => (0, getUniqueNuclei_1.getUniqueNuclei)(nucleus), [nucleus]);
82
73
  const preferencesByNuclei = (0, usePanelPreferences_1.usePanelPreferencesByNuclei)('ranges', nuclei);
83
- (0, react_1.useEffect)(() => {
84
- formRef.current.setValues(preferencesByNuclei);
85
- }, [preferencesByNuclei]);
86
- const saveHandler = (0, react_1.useCallback)((values) => {
74
+ function saveHandler(values) {
87
75
  preferences.dispatch({
88
76
  type: 'SET_PANELS_PREFERENCES',
89
77
  payload: { key: 'ranges', value: values },
90
78
  });
91
- }, [preferences]);
79
+ }
92
80
  (0, react_1.useImperativeHandle)(ref, () => ({
93
81
  saveSetting: () => {
94
82
  formRef.current.submitForm();
95
83
  },
96
84
  }), []);
97
- return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: {}, onSubmit: saveHandler, innerRef: formRef, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: nuclei?.map((n) => ((0, jsx_runtime_1.jsx)(NucleusPreferences_1.NucleusPreferences, { nucleus: n, fields: formatFields, renderBottom: () => ((0, jsx_runtime_1.jsx)(Label_1.default, { title: "J Graph tolerance (Hz) :", style: {
98
- label: styles.inputLabel,
99
- wrapper: styles.inputWrapper,
100
- }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `nuclei.${n}.jGraphTolerance`, type: "number" }) })) }, n))) }) }) }));
85
+ return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: preferencesByNuclei, enableReinitialize: true, onSubmit: saveHandler, innerRef: formRef, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: nuclei?.map((n) => ((0, jsx_runtime_1.jsx)(NucleusPreferences_1.NucleusPreferences, { nucleus: n, fields: formatFields, renderBottom: () => ((0, jsx_runtime_1.jsx)(Label_1.default, { title: "J Graph tolerance (Hz) :", style: FormikColumnFormatField_1.formatFieldLabelStyle, children: (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)("div", { style: { width: '23px' } }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `nuclei.${n}.jGraphTolerance`, type: "number", style: FormikColumnFormatField_1.formatFieldInputStyle })] }) })) }, n))) }) }) }));
101
86
  }
102
- exports.default = (0, react_1.memo)((0, react_1.forwardRef)(RangesPreferences));
87
+ exports.default = (0, react_1.forwardRef)(RangesPreferences);
@@ -62,31 +62,28 @@ function useEditRangeModal(range) {
62
62
  modal.close();
63
63
  }
64
64
  }, [assignmentData, dispatch, modal]);
65
- const closeEditRangeHandler = (0, react_1.useCallback)((range, originalRange) => {
66
- if (range.id === 'new') {
67
- deleteRange(range.id, true);
68
- }
69
- else {
70
- saveEditRangeHandler(originalRange, false);
71
- }
65
+ const resetHandler = (0, react_1.useCallback)((originalRange) => {
66
+ saveEditRangeHandler(originalRange, false);
72
67
  modal.close();
73
- }, [deleteRange, modal, saveEditRangeHandler]);
74
- const editRange = (0, react_1.useCallback)((isManual = false) => {
68
+ }, [modal, saveEditRangeHandler]);
69
+ const editRange = (0, react_1.useCallback)(() => {
70
+ if (!range?.id)
71
+ return;
75
72
  dispatch({
76
73
  type: 'SET_SELECTED_TOOL',
77
74
  payload: { selectedTool: 'editRange' },
78
75
  });
79
- modal.show((0, jsx_runtime_1.jsx)(EditRangeModal_1.default, { onCloseEditRangeModal: closeEditRangeHandler, onSaveEditRangeModal: saveEditRangeHandler, onZoomEditRangeModal: zoomRange, range: isManual ? {} : range, manualRange: isManual }), {
76
+ modal.show((0, jsx_runtime_1.jsx)(EditRangeModal_1.default, { onRest: resetHandler, onSave: saveEditRangeHandler, onZoom: zoomRange, rangeId: range?.id }), {
80
77
  position: options_1.positions.MIDDLE_RIGHT,
81
78
  transition: options_1.transitions.SCALE,
82
79
  isBackgroundBlur: false,
83
80
  });
84
81
  zoomRange();
85
82
  }, [
86
- closeEditRangeHandler,
87
83
  dispatch,
88
84
  modal,
89
- range,
85
+ range?.id,
86
+ resetHandler,
90
87
  saveEditRangeHandler,
91
88
  zoomRange,
92
89
  ]);
@@ -128,7 +128,11 @@ function SpectraTable(props) {
128
128
  maxWidth: '30px',
129
129
  },
130
130
  Cell: ({ row }) => {
131
- return ((0, jsx_runtime_1.jsx)(ColorIndicator_1.default, { display: row.original.display, dimension: row.original.info.dimension, onClick: (event) => onOpenSettingModal(event, row.original) }));
131
+ const { display, info: { dimension, isFid }, } = row.original;
132
+ if (dimension === 2 && isFid) {
133
+ return (0, jsx_runtime_1.jsx)("div", {});
134
+ }
135
+ return ((0, jsx_runtime_1.jsx)(ColorIndicator_1.default, { display: display, dimension: dimension, onClick: (event) => onOpenSettingModal(event, row.original) }));
132
136
  },
133
137
  },
134
138
  }), [onChangeVisibility, onOpenSettingModal]);
@@ -32,7 +32,10 @@ function SpectraColumnsManager({ nucleus, onAdd, onDelete, datalist, mapOnChange
32
32
  {
33
33
  Header: 'Label',
34
34
  Cell: ({ row }) => {
35
- return ((0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `nuclei.${nucleus}.columns.${row.index}.label`, style: { input: { ...style, ...inputStyle } } }));
35
+ return ((0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `nuclei.${nucleus}.columns.${row.index}.label`, style: {
36
+ input: { ...style, ...inputStyle },
37
+ inputWrapper: { border: 'none' },
38
+ } }));
36
39
  },
37
40
  },
38
41
  {
@@ -42,7 +45,10 @@ function SpectraColumnsManager({ nucleus, onAdd, onDelete, datalist, mapOnChange
42
45
  if (column?.name) {
43
46
  return ((0, jsx_runtime_1.jsx)("span", { style: style, children: column?.jpath?.join('.') || column.description }));
44
47
  }
45
- return ((0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `nuclei.${nucleus}.columns.${row.index}.jpath`, style: { input: { ...style, ...inputStyle } }, datalist: datalist, mapOnChangeValue: mapOnChangeValue, mapValue: mapValue }));
48
+ return ((0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `nuclei.${nucleus}.columns.${row.index}.jpath`, style: {
49
+ input: { ...style, ...inputStyle },
50
+ inputWrapper: { border: 'none' },
51
+ }, datalist: datalist, mapOnChangeValue: mapOnChangeValue, mapValue: mapValue }));
46
52
  },
47
53
  },
48
54
  {
@@ -52,11 +58,11 @@ function SpectraColumnsManager({ nucleus, onAdd, onDelete, datalist, mapOnChange
52
58
  },
53
59
  {
54
60
  Header: '',
55
- style: { width: '30px' },
61
+ style: { width: '80px' },
56
62
  id: 'add-button',
57
63
  Cell: ({ row }) => {
58
64
  const record = row.original;
59
- return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "outline", onClick: () => onAdd(nucleus, row.index + 1), children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }), !record?.name && ((0, jsx_runtime_1.jsx)(Button_1.default.Danger, { fill: "outline", onClick: () => onDelete(nucleus, row.index), children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }))] }));
65
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "outline", onClick: () => onAdd(nucleus, row.index + 1), children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }), !record?.name && ((0, jsx_runtime_1.jsx)(Button_1.default.Danger, { fill: "outline", onClick: () => onDelete(nucleus, row.index), children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }))] }));
60
66
  },
61
67
  },
62
68
  ], [datalist, mapOnChangeValue, mapValue, nucleus, onAdd, onDelete]);
@@ -82,7 +82,7 @@ function AdditionalColumnField({ rowCorrelation, columnCorrelation, commonLinks,
82
82
  const contextMenu = (0, react_1.useMemo)(() => {
83
83
  // allow the edition of correlations
84
84
  const commonLinksMenu = commonLinks.flatMap((commonLink) => {
85
- const commonLinkContextMenuLabel = `${(0, Utilities_1.getAbbreviation)(commonLink)} (${commonLink.signal.x ? commonLink.signal.x.delta.toFixed(2) : '?'}, ${commonLink.signal.y ? commonLink.signal.y.delta.toFixed(2) : '?'})${commonLink.edited?.moved === true ? '[MOVED]' : ''}`;
85
+ const commonLinkContextMenuLabel = `${(0, Utilities_1.getAbbreviation)(commonLink)} (${commonLink.signal.x?.delta ? commonLink.signal.x.delta.toFixed(2) : '?'}, ${commonLink.signal.y?.delta ? commonLink.signal.y.delta.toFixed(2) : '?'})${commonLink.edited?.moved === true ? '[MOVED]' : ''}`;
86
86
  return commonLink.pseudo === false
87
87
  ? [
88
88
  {
@@ -183,7 +183,7 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
183
183
  }
184
184
  }, children: [(0, nmr_correlation_1.getLabel)(correlations, correlation), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { ref: contextRef, context: contextMenu })] }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: (0, nmr_correlation_1.getCorrelationDelta)(correlation)
185
185
  ? (0, nmr_correlation_1.getCorrelationDelta)(correlation)?.toFixed(2)
186
- : '' }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler })) : ((0, jsx_runtime_1.jsx)("text", { style: equivalenceCellStyle, children: correlation.equivalence })) }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount') })) : ('') }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps,
186
+ : '' }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler })) : ((0, jsx_runtime_1.jsx)("span", { style: equivalenceCellStyle, children: correlation.equivalence })) }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount') })) : ('') }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps,
187
187
  style: { ...tableDataProps.style, borderRight: '1px solid' }, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.hybridization
188
188
  .map((hybrid) => `sp${hybrid}`)
189
189
  .join(','), style: correlation.edited.hybridization ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'hybridization') })) : ('') }), additionalColumnFields] }));
@@ -7,6 +7,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
7
7
  /** @jsxImportSource @emotion/react */
8
8
  const react_1 = require("@emotion/react");
9
9
  const nmr_load_save_1 = require("nmr-load-save");
10
+ const nmr_processing_1 = require("nmr-processing");
10
11
  const full_1 = __importDefault(require("openchemlib/full"));
11
12
  const react_2 = require("react");
12
13
  const bs_1 = require("react-icons/bs");
@@ -40,24 +41,6 @@ const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader
40
41
  const DatabasePreferences_1 = __importDefault(require("./DatabasePreferences"));
41
42
  const DatabaseStructureSearchModal_1 = require("./DatabaseStructureSearchModal");
42
43
  const DatabaseTable_1 = __importDefault(require("./DatabaseTable"));
43
- const style = (0, react_1.css) `
44
- .header {
45
- height: 30px;
46
- padding: 2px 0 2px 5px;
47
- }
48
-
49
- .input-container {
50
- width: 100%;
51
- }
52
-
53
- .search-input {
54
- width: 100% !important;
55
- border-radius: 5px;
56
- border: 0.55px solid gray;
57
- padding: 0 5px;
58
- outline: none;
59
- }
60
- `;
61
44
  const emptyKeywords = {
62
45
  solvent: '-1',
63
46
  searchKeywords: '',
@@ -156,8 +139,7 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
156
139
  baseURL: url,
157
140
  })));
158
141
  }
159
- catch (error) {
160
- reportError(error);
142
+ catch {
161
143
  alert.error(`Failed to load ${url}`);
162
144
  }
163
145
  finally {
@@ -271,7 +253,6 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
271
253
  };
272
254
  return ((0, jsx_runtime_1.jsxs)("div", { css: [
273
255
  BasicPanelStyle_1.tablePanelStyle,
274
- style,
275
256
  isFlipped &&
276
257
  (0, react_1.css) `
277
258
  .table-container {
@@ -281,11 +262,11 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
281
262
  }
282
263
  }
283
264
  `,
284
- ], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { showSettingButton: true, onSettingClick: settingsPanelHandler, canDelete: false, className: "header", children: [(0, jsx_runtime_1.jsx)(ToggleButton_1.default, { defaultValue: selectedTool === ToolTypes_1.options.databaseRangesSelection.id, popupTitle: "Filter by select ranges", popupPlacement: "right", onClick: enableFilterHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaICursor, { style: {
265
+ ], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { showSettingButton: true, onSettingClick: settingsPanelHandler, canDelete: false, children: [(0, jsx_runtime_1.jsx)(ToggleButton_1.default, { defaultValue: selectedTool === ToolTypes_1.options.databaseRangesSelection.id, popupTitle: "Filter by select ranges", popupPlacement: "right", onClick: enableFilterHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaICursor, { style: {
285
266
  pointerEvents: 'none',
286
267
  fontSize: '12px',
287
268
  transform: 'rotate(90deg)',
288
- } }) }, `${selectedTool}`), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 2 }, items: databases, itemTextField: "label", itemValueField: "key", onChange: handleChangeDatabase, placeholder: "Select database", defaultValue: defaultDatabase }), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 1 }, items: result.solvents, placeholder: "Solvent", onChange: handleSearch, value: keywords.solvent }), (0, jsx_runtime_1.jsx)(Input_1.default, { value: keywords.searchKeywords, renderIcon: () => (0, jsx_runtime_1.jsx)(io5_1.IoSearchOutline, {}), style: { inputWrapper: { flex: 3 } }, className: "search-input", type: "text", debounceTime: 250, placeholder: "Search for parameter...", onChange: handleSearch, onClear: clearHandler, canClear: true }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", onClick: openSearchByStructure, style: { marginLeft: '5px' }, children: !idCode ? ((0, jsx_runtime_1.jsx)(bs_1.BsHexagon, { style: {
269
+ } }) }, `${selectedTool}`), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 2, marginLeft: '5px' }, items: databases, itemTextField: "label", itemValueField: "key", onChange: handleChangeDatabase, placeholder: "Select database", defaultValue: defaultDatabase }), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 1, margin: '0px 5px' }, items: result.solvents, placeholder: "Solvent", onChange: handleSearch, value: keywords.solvent }), (0, jsx_runtime_1.jsx)(Input_1.default, { value: keywords.searchKeywords, renderIcon: () => (0, jsx_runtime_1.jsx)(io5_1.IoSearchOutline, {}), style: { inputWrapper: { flex: 3 } }, className: "search-input", type: "text", debounceTime: 250, placeholder: "Search for parameter...", onChange: handleSearch, onClear: clearHandler, canClear: true }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", onClick: openSearchByStructure, style: { marginLeft: '5px' }, children: !idCode ? ((0, jsx_runtime_1.jsx)(bs_1.BsHexagon, { style: {
289
270
  fontSize: '14px',
290
271
  } })) : ((0, jsx_runtime_1.jsx)(bs_1.BsHexagonFill, { style: {
291
272
  fontSize: '14px',
@@ -343,7 +324,7 @@ async function saveJcampAsJson(rowData, filteredData) {
343
324
  ...spectrum,
344
325
  ranges: {
345
326
  options: { sum: sum || 100 },
346
- values: (0, Spectrum1D_1.mapRanges)(ranges, spectrum),
327
+ values: (0, nmr_processing_1.mapRanges)(ranges, spectrum),
347
328
  },
348
329
  });
349
330
  }
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
@@ -9,7 +32,7 @@ const react_1 = require("react");
9
32
  const PreferencesContext_1 = require("../../context/PreferencesContext");
10
33
  const Label_1 = __importDefault(require("../../elements/Label"));
11
34
  const FormikColorInput_1 = __importDefault(require("../../elements/formik/FormikColorInput"));
12
- const FormikColumnFormatField_1 = __importDefault(require("../../elements/formik/FormikColumnFormatField"));
35
+ const FormikColumnFormatField_1 = __importStar(require("../../elements/formik/FormikColumnFormatField"));
13
36
  const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
14
37
  const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
15
38
  const PreferencesContainer_1 = require("../extra/preferences/PreferencesContainer");
@@ -32,6 +55,6 @@ function DatabasePreferences(props, ref) {
32
55
  formRef.current.submitForm();
33
56
  },
34
57
  }));
35
- return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: {}, onSubmit: saveHandler, innerRef: formRef, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(PreferencesGroup_1.PreferencesGroup, { children: [(0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Preview jcamp", checkControllerName: "previewJcamp", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: "color" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Margin bottom (px) :", style: { label: { padding: 0, flex: 4 }, wrapper: { flex: 8 } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "marginBottom", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)(PreferencesGroup_1.PreferencesGroup, { header: "Table Preferences", children: [(0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Structure", checkControllerName: "showSmiles", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Solvent", checkControllerName: "showSolvent", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Names", checkControllerName: "showNames", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Range", checkControllerName: "range.show", formatControllerName: "range.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "\u03B4 (ppm)", checkControllerName: "delta.show", formatControllerName: "delta.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Assignment", checkControllerName: "showAssignment", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "J (Hz)", checkControllerName: "coupling.show", formatControllerName: "coupling.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Multiplicity", checkControllerName: "showMultiplicity", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Save as nmrium", checkControllerName: "allowSaveAsNMRium", hideFormatField: true })] })] }) }) }));
58
+ return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: {}, onSubmit: saveHandler, innerRef: formRef, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(PreferencesGroup_1.PreferencesGroup, { children: [(0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Preview jcamp", checkControllerName: "previewJcamp", hideFormatField: true }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Color", style: FormikColumnFormatField_1.formatFieldLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: "color" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Margin bottom (px) :", style: FormikColumnFormatField_1.formatFieldLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "marginBottom", type: "number", style: FormikColumnFormatField_1.formatFieldInputStyle }) })] }), (0, jsx_runtime_1.jsxs)(PreferencesGroup_1.PreferencesGroup, { header: "Table Preferences", children: [(0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Structure", checkControllerName: "showSmiles", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Solvent", checkControllerName: "showSolvent", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Names", checkControllerName: "showNames", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Range", checkControllerName: "range.show", formatControllerName: "range.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "\u03B4 (ppm)", checkControllerName: "delta.show", formatControllerName: "delta.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Assignment", checkControllerName: "showAssignment", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "J (Hz)", checkControllerName: "coupling.show", formatControllerName: "coupling.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Multiplicity", checkControllerName: "showMultiplicity", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Save as nmrium", checkControllerName: "allowSaveAsNMRium", hideFormatField: true })] })] }) }) }));
36
59
  }
37
60
  exports.default = (0, react_1.forwardRef)(DatabasePreferences);
@@ -3,37 +3,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
7
- /** @jsxImportSource @emotion/react */
8
- const react_1 = require("@emotion/react");
9
- const react_2 = require("react");
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
10
7
  const fa_1 = require("react-icons/fa");
11
8
  const Button_1 = __importDefault(require("../../elements/Button"));
12
9
  const ToggleButton_1 = __importDefault(require("../../elements/ToggleButton"));
13
10
  const ToolTip_1 = __importDefault(require("../../elements/ToolTip/ToolTip"));
14
- const styles = (0, react_1.css) `
15
- display: flex;
16
- flex-direction: row;
17
- border-bottom: 0.55px solid rgb(240 240 240);
18
- padding: 2px 5px;
19
-
20
- .left-container {
21
- display: flex;
22
- flex-direction: row;
23
- flex: 1;
24
- }
25
-
26
- .counter-label {
27
- margin: 0;
28
- text-align: right;
29
- line-height: 22px;
30
- padding: 0 10px;
31
- white-space: nowrap;
32
- }
33
- `;
11
+ const PanelHeader_1 = __importDefault(require("./PanelHeader"));
12
+ const styles = {
13
+ leftContainer: {
14
+ display: 'flex',
15
+ flexDirection: 'row',
16
+ flex: 1,
17
+ },
18
+ counterLabel: {
19
+ margin: 0,
20
+ textAlign: 'right',
21
+ lineHeight: '22px',
22
+ padding: '0 10px',
23
+ whiteSpace: 'nowrap',
24
+ },
25
+ };
34
26
  function DefaultPanelHeader({ counter, onDelete = () => null, deleteToolTip = 'Delete', onFilter = () => null, filterToolTip = '', filterIsActive = false, counterFiltered = 0, children, onSettingClick = () => null, showSettingButton = false, canDelete = true, disableDelete = false, style = {}, className = '', renderRightButtons, }) {
35
- return ((0, jsx_runtime_1.jsxs)("div", { css: styles, style, className, children: [(0, jsx_runtime_1.jsxs)("div", { className: "left-container", children: [canDelete && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'red' }, onClick: onDelete, disabled: counter === 0 || disableDelete, toolTip: deleteToolTip, tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) })), filterToolTip ? ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: filterToolTip, popupPlacement: "right", onClick: onFilter, defaultValue: filterIsActive, children: (0, jsx_runtime_1.jsx)(fa_1.FaFilter, { style: { pointerEvents: 'none', fontSize: '12px' } }) })) : null, children] }), renderRightButtons?.(), counter !== undefined && ((0, jsx_runtime_1.jsxs)("p", { className: "counter-label", children: ["[", ' ', filterIsActive && counterFiltered !== undefined
27
+ return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { style, className, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.leftContainer, children: [canDelete && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'red' }, onClick: onDelete, disabled: counter === 0 || disableDelete, toolTip: deleteToolTip, tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) })), filterToolTip ? ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: filterToolTip, popupPlacement: "right", onClick: onFilter, defaultValue: filterIsActive, children: (0, jsx_runtime_1.jsx)(fa_1.FaFilter, { style: { pointerEvents: 'none', fontSize: '12px' } }) })) : null, children] }), renderRightButtons?.(), counter !== undefined && ((0, jsx_runtime_1.jsxs)("p", { style: styles.counterLabel, children: ["[", ' ', filterIsActive && counterFiltered !== undefined
36
28
  ? `${counterFiltered}/${counter}`
37
29
  : counter, ' ', "]"] })), showSettingButton && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Preferences", popupPlacement: "left", children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onSettingClick, children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) }) }))] }));
38
30
  }
39
- exports.default = (0, react_2.memo)(DefaultPanelHeader);
31
+ exports.default = DefaultPanelHeader;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const containerStyle = {
5
+ display: 'flex',
6
+ flexDirection: 'row',
7
+ borderBottom: '0.55px solid rgb(240 240 240)',
8
+ padding: '2px 5px',
9
+ alignItems: 'center',
10
+ };
11
+ function PanelHeader(props) {
12
+ const { style = {}, children } = props;
13
+ return (0, jsx_runtime_1.jsxs)("div", { style: { ...containerStyle, ...style }, children: [children, " "] });
14
+ }
15
+ exports.default = PanelHeader;
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const jsx_runtime_1 = require("react/jsx-runtime");
30
+ const formik_1 = require("formik");
31
+ const react_1 = require("react");
32
+ const Yup = __importStar(require("yup"));
33
+ const PredictionManager_1 = require("../../../data/PredictionManager");
34
+ const generateNumbersPowerOfX_1 = __importDefault(require("../../../data/utilities/generateNumbersPowerOfX"));
35
+ const GroupPane_1 = require("../../elements/GroupPane");
36
+ const IsotopesViewer_1 = __importDefault(require("../../elements/IsotopesViewer"));
37
+ const Label_1 = __importDefault(require("../../elements/Label"));
38
+ const FormikCheckBox_1 = __importDefault(require("../../elements/formik/FormikCheckBox"));
39
+ const FormikErrorsSummary_1 = __importDefault(require("../../elements/formik/FormikErrorsSummary"));
40
+ const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
41
+ const FormikSelect_1 = __importDefault(require("../../elements/formik/FormikSelect"));
42
+ const NUMBER_OF_POINTS_1D = (0, generateNumbersPowerOfX_1.default)(12, 19);
43
+ const NUMBER_OF_POINTS_2D = (0, generateNumbersPowerOfX_1.default)(10, 10, {
44
+ format: (value) => value,
45
+ });
46
+ const predictionFormValidation = Yup.object().shape({
47
+ name: Yup.string().label('Name'),
48
+ frequency: Yup.number().integer().required().label('Frequency'),
49
+ '1d': Yup.object({
50
+ '1H': Yup.object({
51
+ from: Yup.number().required().label("1H ' From ' "),
52
+ to: Yup.number().required().label("1H ' To ' "),
53
+ }),
54
+ '13C': Yup.object().shape({
55
+ from: Yup.number().required().label("13C ' From ' "),
56
+ to: Yup.number().required().label("13C ' To ' "),
57
+ }),
58
+ lineWidth: Yup.number().integer().min(1).required().label('Line Width'),
59
+ nbPoints: Yup.number().integer().required().label('1D Number Of Points'),
60
+ }),
61
+ '2d': Yup.object({
62
+ nbPoints: Yup.object({
63
+ x: Yup.number().integer().required().label('2D Number Of Points'),
64
+ y: Yup.number().integer().required().label('2D Number Of Points'),
65
+ }),
66
+ }),
67
+ spectra: Yup.object({
68
+ proton: Yup.boolean(),
69
+ carbon: Yup.boolean(),
70
+ cosy: Yup.boolean(),
71
+ hsqc: Yup.boolean(),
72
+ hmbc: Yup.boolean(),
73
+ }).test('check-options', 'You must check one of the options to start prediction', (obj) => {
74
+ if (Object.values(obj).includes(true)) {
75
+ return true;
76
+ }
77
+ return false;
78
+ }),
79
+ });
80
+ const labelStyle = {
81
+ label: { flex: 4, fontWeight: '500' },
82
+ wrapper: { flex: 8, display: 'flex', alignItems: 'center' },
83
+ container: { padding: '5px 0' },
84
+ };
85
+ const inputStyle = {
86
+ input: {
87
+ padding: '5px',
88
+ },
89
+ };
90
+ const styles = {
91
+ select: {
92
+ width: '100%',
93
+ minWidth: '100px',
94
+ maxWidth: '280px',
95
+ height: 30,
96
+ margin: 0,
97
+ },
98
+ groupHeader: {
99
+ borderBottom: '1px solid #efefef',
100
+ paddingBottom: '5px',
101
+ fontWeight: '600',
102
+ color: '#005d9e',
103
+ },
104
+ };
105
+ function PredictionOptionsPanel(props, ref) {
106
+ const { options, onSubmit, hideName = false } = props;
107
+ return ((0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: options, validationSchema: predictionFormValidation, enableReinitialize: true, onSubmit: onSubmit, innerRef: ref, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(FormikErrorsSummary_1.default, {}), !hideName && ((0, jsx_runtime_1.jsx)(Label_1.default, { title: "Name", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "name", style: inputStyle }) })), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Frequency", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: PredictionManager_1.FREQUENCIES, style: styles.select, name: "frequency" }) }), (0, jsx_runtime_1.jsxs)(GroupPane_1.GroupPane, { text: "1D Options", style: {
108
+ header: styles.groupHeader,
109
+ }, children: [(0, jsx_runtime_1.jsxs)(Label_1.default, { title: "1H", renderTitle: (title) => ((0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: title, className: "custom-label" })), style: labelStyle, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.from", type: "number", style: inputStyle }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.to", type: "number", style: inputStyle }) })] }), (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "13C", renderTitle: (title) => ((0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: title, className: "custom-label" })), style: labelStyle, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.from", type: "number", style: inputStyle }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.to", type: "number", style: inputStyle }) })] }), (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "Line Width", style: labelStyle, children: [(0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.lineWidth", type: "number", style: inputStyle }), (0, jsx_runtime_1.jsx)("span", { style: { paddingLeft: '0.4rem' }, children: " Hz " })] }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Number of Points", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: NUMBER_OF_POINTS_1D, name: "1d.nbPoints", style: styles.select }) })] }), (0, jsx_runtime_1.jsx)(GroupPane_1.GroupPane, { text: "2D Options", style: {
110
+ header: styles.groupHeader,
111
+ }, children: (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "Number of Points", style: labelStyle, children: [(0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.x", style: { margin: 0, height: 30 } }), (0, jsx_runtime_1.jsx)("span", { style: { padding: '0 10px' }, children: " X " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.y", style: { margin: 0, height: 30 } })] }) }), (0, jsx_runtime_1.jsx)(GroupPane_1.GroupPane, { text: "Spectra", style: {
112
+ header: styles.groupHeader,
113
+ }, children: (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-around' }, children: [(0, jsx_runtime_1.jsx)(IsotopesOption, { title: "1H", name: "spectra.proton" }), (0, jsx_runtime_1.jsx)(IsotopesOption, { title: "13C", name: "spectra.carbon" }), (0, jsx_runtime_1.jsx)(IsotopesOption, { title: "COSY", name: "spectra.cosy" }), (0, jsx_runtime_1.jsx)(IsotopesOption, { title: "HSQC", name: "spectra.hsqc" }), (0, jsx_runtime_1.jsx)(IsotopesOption, { title: "HMBC", name: "spectra.hmbc" })] }) })] }) }));
114
+ }
115
+ function IsotopesOption(props) {
116
+ const { name, title } = props;
117
+ return ((0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: name, style: {
118
+ checkbox: { display: 'flex' },
119
+ container: { flexDirection: 'row-reverse', padding: '0 5px' },
120
+ }, renderLabel: () => ((0, jsx_runtime_1.jsx)("label", { htmlFor: name, children: (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: title, style: { padding: '0 5px' } }) })) }));
121
+ }
122
+ exports.default = (0, react_1.forwardRef)(PredictionOptionsPanel);