nmrium 0.38.1 → 0.38.2

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 (439) 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/MouseTracker.d.ts +6 -2
  34. package/lib/component/EventsTrackers/MouseTracker.js +4 -1
  35. package/lib/component/NMRium.d.ts +4 -5
  36. package/lib/component/NMRium.js +11 -14
  37. package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
  38. package/lib/component/context/PreferencesContext.d.ts +6 -6
  39. package/lib/component/elements/Button.d.ts +13 -11
  40. package/lib/component/elements/Button.js +16 -25
  41. package/lib/component/elements/ColorInput.d.ts +0 -1
  42. package/lib/component/elements/ColorInput.js +2 -2
  43. package/lib/component/elements/EditableColumn.js +5 -2
  44. package/lib/component/elements/Input.js +2 -4
  45. package/lib/component/elements/Label.d.ts +1 -0
  46. package/lib/component/elements/Label.js +2 -2
  47. package/lib/component/elements/MolecularFormulaInput.d.ts +2 -2
  48. package/lib/component/elements/MolecularFormulaInput.js +15 -18
  49. package/lib/component/elements/NextPrev.d.ts +5 -3
  50. package/lib/component/elements/NextPrev.js +26 -8
  51. package/lib/component/elements/NumberInput.js +2 -2
  52. package/lib/component/elements/ReactTable/ReactTable.js +4 -4
  53. package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
  54. package/lib/component/elements/formik/FormikCheckBox.js +2 -2
  55. package/lib/component/elements/formik/FormikColumnFormatField.d.ts +4 -0
  56. package/lib/component/elements/formik/FormikColumnFormatField.js +19 -16
  57. package/lib/component/elements/formik/FormikInput.js +10 -6
  58. package/lib/component/elements/formik/FormikSelect.js +1 -1
  59. package/lib/component/header/ApodizationOptionsPanel.js +4 -3
  60. package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -7
  61. package/lib/component/header/BaseLineCorrectionPanel.js +5 -2
  62. package/lib/component/header/PhaseCorrectionPanel.js +5 -2
  63. package/lib/component/header/RangesPickingOptionPanel.js +15 -7
  64. package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
  65. package/lib/component/highlight/index.d.ts +1 -1
  66. package/lib/component/hooks/useActiveSpectra.d.ts +1 -1
  67. package/lib/component/hooks/useActiveSpectrum.d.ts +1 -1
  68. package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts +1 -1
  69. package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +2 -0
  70. package/lib/component/hooks/useCheckPointsNumberInWindowArea.js +17 -0
  71. package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -2
  72. package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +3 -2
  73. package/lib/component/hooks/useExport.js +1 -1
  74. package/lib/component/hooks/useFilter.d.ts +2 -1
  75. package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
  76. package/lib/component/hooks/usePanelPreferences.js +4 -0
  77. package/lib/component/hooks/useSaveSettings.d.ts +1 -1
  78. package/lib/component/hooks/useSaveSettings.js +1 -1
  79. package/lib/component/hooks/useVerticalAlign.d.ts +1 -1
  80. package/lib/component/loader/DropZone.js +1 -2
  81. package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
  82. package/lib/component/modal/LoadJCAMPModal.d.ts +3 -3
  83. package/lib/component/modal/LoadJCAMPModal.js +35 -66
  84. package/lib/component/modal/ModalStyle.js +0 -10
  85. package/lib/component/modal/MoleculeStructureEditorModal.d.ts +2 -1
  86. package/lib/component/modal/MoleculeStructureEditorModal.js +12 -6
  87. package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
  88. package/lib/component/modal/PredictSpectraModal.d.ts +4 -2
  89. package/lib/component/modal/PredictSpectraModal.js +43 -105
  90. package/lib/component/modal/SaveAsModal.d.ts +2 -0
  91. package/lib/component/modal/SaveAsModal.js +21 -14
  92. package/lib/component/modal/changeSum/ChangeSumModal.js +25 -38
  93. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +1 -1
  94. package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -0
  95. package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -2
  96. package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -5
  97. package/lib/component/modal/setting/GeneralSettings.js +1 -6
  98. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
  99. package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
  100. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
  101. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -15
  102. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
  103. package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +1 -11
  104. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +20 -25
  105. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +6 -11
  106. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +71 -81
  107. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
  108. package/lib/component/panels/MoleculesPanel/Utilities.js +3 -1
  109. package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
  110. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  111. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
  112. package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +1 -1
  113. package/lib/component/panels/RangesPanel/RangesHeader.js +39 -53
  114. package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
  115. package/lib/component/panels/RangesPanel/RangesPreferences.js +7 -22
  116. package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
  117. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
  118. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
  119. package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
  120. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
  121. package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
  122. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -2
  123. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
  124. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
  125. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
  126. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +1 -1
  127. package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
  128. package/lib/component/panels/databasePanel/DatabasePanel.js +5 -24
  129. package/lib/component/panels/databasePanel/DatabasePreferences.js +2 -2
  130. package/lib/component/panels/header/DefaultPanelHeader.d.ts +2 -3
  131. package/lib/component/panels/header/DefaultPanelHeader.js +18 -26
  132. package/lib/component/panels/header/PanelHeader.d.ts +7 -0
  133. package/lib/component/panels/header/PanelHeader.js +12 -0
  134. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +9 -0
  135. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +94 -0
  136. package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -1
  137. package/lib/component/panels/predictionPanel/PredictionPanel.js +107 -37
  138. package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +3 -0
  139. package/lib/component/panels/predictionPanel/PredictionPreferences.js +24 -0
  140. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.d.ts +2 -0
  141. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +44 -0
  142. package/lib/component/reducer/Reducer.d.ts +5 -87
  143. package/lib/component/reducer/Reducer.js +1 -29
  144. package/lib/component/reducer/actions/FiltersActions.d.ts +1 -2
  145. package/lib/component/reducer/actions/FiltersActions.js +47 -52
  146. package/lib/component/reducer/actions/HistoryActions.d.ts +4 -0
  147. package/lib/component/reducer/actions/HistoryActions.js +40 -0
  148. package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
  149. package/lib/component/reducer/actions/LoadActions.d.ts +1 -2
  150. package/lib/component/reducer/actions/LoadActions.js +1 -1
  151. package/lib/component/reducer/actions/MoleculeActions.d.ts +7 -4
  152. package/lib/component/reducer/actions/MoleculeActions.js +57 -28
  153. package/lib/component/reducer/actions/PeaksActions.d.ts +1 -2
  154. package/lib/component/reducer/actions/PeaksActions.js +3 -3
  155. package/lib/component/reducer/actions/RangesActions.d.ts +4 -5
  156. package/lib/component/reducer/actions/RangesActions.js +5 -27
  157. package/lib/component/reducer/actions/SpectrumsActions.js +2 -2
  158. package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
  159. package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
  160. package/lib/component/reducer/actions/ZonesActions.js +1 -2
  161. package/lib/component/reducer/helper/getActiveSpectra.d.ts +1 -1
  162. package/lib/component/reducer/helper/getActiveSpectrum.d.ts +1 -1
  163. package/lib/component/reducer/helper/getVerticalAlign.d.ts +1 -1
  164. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +1 -1
  165. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  166. package/lib/component/reducer/preferences/utilities/getActiveWorkspace.d.ts +1 -1
  167. package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +2 -3
  168. package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +1 -1
  169. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -1
  170. package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +1 -1
  171. package/lib/component/toolbar/BasicToolBar.js +6 -11
  172. package/lib/component/toolbar/ToolTypes.d.ts +2 -2
  173. package/lib/component/toolbar/ToolTypes.js +1 -1
  174. package/lib/component/workspaces/assignment.d.ts +1 -1
  175. package/lib/component/workspaces/basic.d.ts +1 -1
  176. package/lib/component/workspaces/embedded.d.ts +1 -1
  177. package/lib/component/workspaces/exercise.d.ts +1 -1
  178. package/lib/component/workspaces/index.d.ts +6 -6
  179. package/lib/component/workspaces/prediction.d.ts +1 -1
  180. package/lib/component/workspaces/prediction.js +193 -0
  181. package/lib/component/workspaces/process1D.d.ts +1 -1
  182. package/lib/component/workspaces/workspaceDefaultProperties.d.ts +1 -1
  183. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
  184. package/lib/data/PredictionManager.js +16 -2
  185. package/lib/data/SpectraManager.d.ts +1 -2
  186. package/lib/data/constants/DefaultApodizationOptions.d.ts +2 -0
  187. package/lib/data/constants/DefaultApodizationOptions.js +5 -0
  188. package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -1
  189. package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -2
  190. package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
  191. package/lib/data/data1d/Spectrum1D/index.d.ts +1 -5
  192. package/lib/data/data1d/Spectrum1D/index.js +1 -5
  193. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
  194. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +2 -1
  195. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +1 -1
  196. package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +1 -1
  197. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -1
  198. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
  199. package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -2
  200. package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +1 -1
  201. package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +2 -2
  202. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +2 -1
  203. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
  204. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +7 -7
  205. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -24
  206. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -1
  207. package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -1
  208. package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
  209. package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
  210. package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
  211. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -2
  212. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +37 -2
  213. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +1 -1
  214. package/lib/data/data1d/database.js +2 -4
  215. package/lib/data/data1d/multipleSpectraAnalysis.d.ts +3 -30
  216. package/lib/data/data1d/multipleSpectraAnalysis.js +4 -15
  217. package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +3 -2
  218. package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
  219. package/lib/data/data2d/Spectrum2D/getSlice.d.ts +1 -1
  220. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  221. package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
  222. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -1
  223. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +3 -2
  224. package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -1
  225. package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +3 -2
  226. package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
  227. package/lib/data/types/data1d/ComplexData1D.d.ts +2 -2
  228. package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
  229. package/lib/data/utilities/FindUtilities.d.ts +2 -1
  230. package/lib/data/utilities/RangeUtilities.d.ts +1 -1
  231. package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
  232. package/lib/data/utilities/calculateSanPlot.d.ts +2 -2
  233. package/lib/types/NMRiumDataReturn.d.ts +1 -3
  234. package/lib/versionInfo.js +1 -1
  235. package/lib-cjs/component/1d/ApodizationLine.js +28 -5
  236. package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +3 -26
  237. package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +5 -28
  238. package/lib-cjs/component/1d/FooterBanner.js +2 -2
  239. package/lib-cjs/component/1d/SpectraLegends.js +1 -2
  240. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
  241. package/lib-cjs/component/1d/tool/PeakPointer.js +3 -3
  242. package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
  243. package/lib-cjs/component/1d-2d/tools/BrushX.js +1 -2
  244. package/lib-cjs/component/1d-2d/tools/BrushXY.js +1 -2
  245. package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +2 -3
  246. package/lib-cjs/component/2d/Chart2D.js +4 -4
  247. package/lib-cjs/component/2d/FooterBanner.js +2 -2
  248. package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
  249. package/lib-cjs/component/EventsTrackers/BrushTracker.js +36 -22
  250. package/lib-cjs/component/EventsTrackers/MouseTracker.js +4 -1
  251. package/lib-cjs/component/NMRium.js +8 -11
  252. package/lib-cjs/component/elements/Button.js +16 -25
  253. package/lib-cjs/component/elements/ColorInput.js +2 -2
  254. package/lib-cjs/component/elements/EditableColumn.js +5 -2
  255. package/lib-cjs/component/elements/Input.js +2 -4
  256. package/lib-cjs/component/elements/Label.js +2 -2
  257. package/lib-cjs/component/elements/MolecularFormulaInput.js +14 -16
  258. package/lib-cjs/component/elements/NextPrev.js +26 -8
  259. package/lib-cjs/component/elements/NumberInput.js +2 -2
  260. package/lib-cjs/component/elements/ReactTable/ReactTable.js +4 -4
  261. package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
  262. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +20 -16
  263. package/lib-cjs/component/elements/formik/FormikInput.js +10 -6
  264. package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
  265. package/lib-cjs/component/header/ApodizationOptionsPanel.js +6 -5
  266. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +15 -6
  267. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
  268. package/lib-cjs/component/header/PhaseCorrectionPanel.js +6 -26
  269. package/lib-cjs/component/header/RangesPickingOptionPanel.js +15 -7
  270. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -25
  271. package/lib-cjs/component/hooks/useCheckPointsNumberInWindowArea.js +24 -0
  272. package/lib-cjs/component/hooks/useExport.js +1 -1
  273. package/lib-cjs/component/hooks/usePanelPreferences.js +4 -0
  274. package/lib-cjs/component/hooks/useSaveSettings.js +1 -1
  275. package/lib-cjs/component/loader/DropZone.js +1 -2
  276. package/lib-cjs/component/modal/LoadJCAMPModal.js +60 -67
  277. package/lib-cjs/component/modal/ModalStyle.js +0 -10
  278. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +12 -6
  279. package/lib-cjs/component/modal/PredictSpectraModal.js +43 -126
  280. package/lib-cjs/component/modal/SaveAsModal.js +22 -14
  281. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +24 -37
  282. package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -0
  283. package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
  284. package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -6
  285. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +6 -14
  286. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
  287. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +19 -24
  288. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +76 -86
  289. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +3 -1
  290. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
  291. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  292. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
  293. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +38 -52
  294. package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
  295. package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
  296. package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
  297. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
  298. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
  299. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -24
  300. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +25 -2
  301. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +18 -26
  302. package/lib-cjs/component/panels/header/PanelHeader.js +15 -0
  303. package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +122 -0
  304. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +107 -37
  305. package/lib-cjs/component/panels/predictionPanel/PredictionPreferences.js +29 -0
  306. package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +72 -0
  307. package/lib-cjs/component/reducer/Reducer.js +2 -31
  308. package/lib-cjs/component/reducer/actions/FiltersActions.js +66 -94
  309. package/lib-cjs/component/reducer/actions/HistoryActions.js +45 -0
  310. package/lib-cjs/component/reducer/actions/MoleculeActions.js +58 -32
  311. package/lib-cjs/component/reducer/actions/PeaksActions.js +3 -3
  312. package/lib-cjs/component/reducer/actions/RangesActions.js +7 -52
  313. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +4 -27
  314. package/lib-cjs/component/reducer/actions/ZonesActions.js +4 -28
  315. package/lib-cjs/component/toolbar/BasicToolBar.js +5 -10
  316. package/lib-cjs/component/toolbar/ToolTypes.js +9 -32
  317. package/lib-cjs/component/workspaces/prediction.js +193 -0
  318. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +21 -44
  319. package/lib-cjs/data/PredictionManager.js +16 -2
  320. package/lib-cjs/data/constants/DefaultApodizationOptions.js +8 -0
  321. package/lib-cjs/data/data1d/Spectrum1D/index.js +7 -11
  322. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -32
  323. package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
  324. package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
  325. package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
  326. package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
  327. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +7 -26
  328. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
  329. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
  330. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +3 -4
  331. package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
  332. package/lib-cjs/data/data1d/database.js +2 -4
  333. package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +5 -16
  334. package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -26
  335. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +2 -25
  336. package/lib-cjs/versionInfo.js +1 -1
  337. package/package.json +25 -25
  338. package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +0 -7
  339. package/lib/component/panels/predictionPanel/PredictionOptions.js +0 -74
  340. package/lib/component/workspaces/Workspace.d.ts +0 -188
  341. package/lib/component/workspaces/Workspace.js +0 -1
  342. package/lib/data/Filters.d.ts +0 -12
  343. package/lib/data/Filters.js +0 -12
  344. package/lib/data/FiltersManager.d.ts +0 -30
  345. package/lib/data/FiltersManager.js +0 -175
  346. package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +0 -2
  347. package/lib/data/data1d/Spectrum1D/getShiftX.js +0 -6
  348. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +0 -2
  349. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -4
  350. package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +0 -7
  351. package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -9
  352. package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +0 -12
  353. package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -36
  354. package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +0 -2
  355. package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -6
  356. package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +0 -2
  357. package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -5
  358. package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +0 -2
  359. package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -26
  360. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +0 -3
  361. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -45
  362. package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +0 -2
  363. package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -7
  364. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +0 -4
  365. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -78
  366. package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +0 -2
  367. package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -9
  368. package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +0 -2
  369. package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -5
  370. package/lib/data/data1d/filter1d/apodization.d.ts +0 -27
  371. package/lib/data/data1d/filter1d/apodization.js +0 -81
  372. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +0 -33
  373. package/lib/data/data1d/filter1d/baselineCorrection.js +0 -51
  374. package/lib/data/data1d/filter1d/digitalFilter.d.ts +0 -20
  375. package/lib/data/data1d/filter1d/digitalFilter.js +0 -44
  376. package/lib/data/data1d/filter1d/equallySpaced.d.ts +0 -33
  377. package/lib/data/data1d/filter1d/equallySpaced.js +0 -52
  378. package/lib/data/data1d/filter1d/exclusionZones.d.ts +0 -15
  379. package/lib/data/data1d/filter1d/exclusionZones.js +0 -32
  380. package/lib/data/data1d/filter1d/fft.d.ts +0 -18
  381. package/lib/data/data1d/filter1d/fft.js +0 -90
  382. package/lib/data/data1d/filter1d/phaseCorrection.d.ts +0 -26
  383. package/lib/data/data1d/filter1d/phaseCorrection.js +0 -64
  384. package/lib/data/data1d/filter1d/shiftX.d.ts +0 -20
  385. package/lib/data/data1d/filter1d/shiftX.js +0 -26
  386. package/lib/data/data1d/filter1d/signalProcessing.d.ts +0 -26
  387. package/lib/data/data1d/filter1d/signalProcessing.js +0 -65
  388. package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +0 -2
  389. package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -35
  390. package/lib/data/data1d/filter1d/zeroFilling.d.ts +0 -22
  391. package/lib/data/data1d/filter1d/zeroFilling.js +0 -60
  392. package/lib/data/data2d/filter2d/shiftX.d.ts +0 -18
  393. package/lib/data/data2d/filter2d/shiftX.js +0 -27
  394. package/lib/data/data2d/filter2d/shiftY.d.ts +0 -18
  395. package/lib/data/data2d/filter2d/shiftY.js +0 -27
  396. package/lib/data/types/view-state/PeaksViewState.d.ts +0 -17
  397. package/lib/data/types/view-state/PeaksViewState.js +0 -1
  398. package/lib/types/NMRiumGeneralPreferences.d.ts +0 -7
  399. package/lib/types/NMRiumGeneralPreferences.js +0 -1
  400. package/lib/types/NMRiumPanelPreferences.d.ts +0 -17
  401. package/lib/types/NMRiumPanelPreferences.js +0 -1
  402. package/lib/types/NMRiumToolBarPreferences.d.ts +0 -22
  403. package/lib/types/NMRiumToolBarPreferences.js +0 -1
  404. package/lib/types/PanelPreferencesType.d.ts +0 -4
  405. package/lib/types/PanelPreferencesType.js +0 -1
  406. package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +0 -102
  407. package/lib-cjs/component/workspaces/Workspace.js +0 -2
  408. package/lib-cjs/data/Filters.js +0 -38
  409. package/lib-cjs/data/FiltersManager.js +0 -206
  410. package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +0 -33
  411. package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -8
  412. package/lib-cjs/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -13
  413. package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -40
  414. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -10
  415. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -9
  416. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -30
  417. package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -49
  418. package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -11
  419. package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -82
  420. package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -13
  421. package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -9
  422. package/lib-cjs/data/data1d/filter1d/apodization.js +0 -88
  423. package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +0 -60
  424. package/lib-cjs/data/data1d/filter1d/digitalFilter.js +0 -50
  425. package/lib-cjs/data/data1d/filter1d/equallySpaced.js +0 -61
  426. package/lib-cjs/data/data1d/filter1d/exclusionZones.js +0 -38
  427. package/lib-cjs/data/data1d/filter1d/fft.js +0 -96
  428. package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +0 -70
  429. package/lib-cjs/data/data1d/filter1d/shiftX.js +0 -32
  430. package/lib-cjs/data/data1d/filter1d/signalProcessing.js +0 -95
  431. package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -39
  432. package/lib-cjs/data/data1d/filter1d/zeroFilling.js +0 -66
  433. package/lib-cjs/data/data2d/filter2d/shiftX.js +0 -33
  434. package/lib-cjs/data/data2d/filter2d/shiftY.js +0 -33
  435. package/lib-cjs/data/types/view-state/PeaksViewState.js +0 -2
  436. package/lib-cjs/types/NMRiumGeneralPreferences.js +0 -2
  437. package/lib-cjs/types/NMRiumPanelPreferences.js +0 -2
  438. package/lib-cjs/types/NMRiumToolBarPreferences.js +0 -2
  439. package/lib-cjs/types/PanelPreferencesType.js +0 -2
@@ -8,7 +8,7 @@ import { useModal } from '../elements/popup/Modal';
8
8
  import { positions } from '../elements/popup/options';
9
9
  import { ModalStyles } from './ModalStyle';
10
10
  function MoleculeStructureEditorModal(props) {
11
- const { onClose = () => null, selectedMolecule } = props;
11
+ const { onClose = () => null, selectedMolecule, floatMoleculeOnSave = false, } = props;
12
12
  const [molfile, setMolfile] = useState(null);
13
13
  const dispatch = useDispatch();
14
14
  useEffect(() => {
@@ -45,21 +45,27 @@ function MoleculeStructureEditorModal(props) {
45
45
  onClose('replace');
46
46
  }
47
47
  else {
48
- dispatch({ type: 'ADD_MOLECULE', payload: { molfile } });
48
+ dispatch({
49
+ type: 'ADD_MOLECULE',
50
+ payload: {
51
+ molfile,
52
+ floatMoleculeOnSave,
53
+ },
54
+ });
49
55
  onClose('new');
50
56
  }
51
57
  }
52
- }, [dispatch, selectedMolecule, molfile, onClose]);
58
+ }, [molfile, selectedMolecule, dispatch, floatMoleculeOnSave, onClose]);
53
59
  return (_jsxs("div", { css: ModalStyles, children: [_jsx(StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleClose }) })] }));
54
60
  }
55
- export function useMoleculeEditor() {
61
+ export function useMoleculeEditor(floatMoleculeOnSave = false) {
56
62
  const modal = useModal();
57
63
  return useCallback((molecule) => {
58
- modal.show(_jsx(MoleculeStructureEditorModal, { selectedMolecule: molecule }), {
64
+ modal.show(_jsx(MoleculeStructureEditorModal, { selectedMolecule: molecule, floatMoleculeOnSave: floatMoleculeOnSave }), {
59
65
  position: positions.TOP_CENTER,
60
66
  width: 700,
61
67
  height: 500,
62
68
  });
63
- }, [modal]);
69
+ }, [floatMoleculeOnSave, modal]);
64
70
  }
65
71
  export default MoleculeStructureEditorModal;
@@ -2,11 +2,11 @@ import { Spectrum } from 'nmr-load-save';
2
2
  import { ActiveSpectrum } from '../reducer/Reducer';
3
3
  interface MultipletAnalysisModalProps {
4
4
  data: Spectrum[];
5
- activeSpectrum: ActiveSpectrum;
5
+ activeSpectrum: ActiveSpectrum | null;
6
6
  scaleX: any;
7
7
  startX: any;
8
8
  endX: any;
9
- onClose: (element?: string) => void;
9
+ onClose?: (element?: string) => void;
10
10
  }
11
11
  export default function MultipletAnalysisModal({ data, activeSpectrum, scaleX, startX, endX, onClose, }: MultipletAnalysisModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
12
12
  export {};
@@ -1,6 +1,8 @@
1
+ import { StateMoleculeExtended } from '../../data/molecules/Molecule';
1
2
  interface PredictSpectraModalProps {
2
3
  onClose?: (element?: string) => void;
3
- molfile: string;
4
+ molecule: StateMoleculeExtended;
4
5
  }
5
- declare function PredictSpectraModal({ onClose, molfile, }: PredictSpectraModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
6
+ declare function PredictSpectraModal({ onClose, molecule, }: PredictSpectraModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
7
+ export declare function usePredictSpectraModal(): (molecule: StateMoleculeExtended) => void;
6
8
  export default PredictSpectraModal;
@@ -1,50 +1,24 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
- import { Formik } from 'formik';
5
4
  import { useCallback, useRef, useState, useMemo } from 'react';
6
- import * as Yup from 'yup';
7
- import { defaultPredictionOptions, FREQUENCIES, } from '../../data/PredictionManager';
8
- import generateNumbersPowerOfX from '../../data/utilities/generateNumbersPowerOfX';
5
+ import { defaultPredictionOptions, predictSpectra, } from '../../data/PredictionManager';
9
6
  import { useChartData } from '../context/ChartContext';
10
7
  import { useDispatch } from '../context/DispatchContext';
11
8
  import Button from '../elements/Button';
12
9
  import CheckBox from '../elements/CheckBox';
13
10
  import CloseButton from '../elements/CloseButton';
14
- import IsotopesViewer from '../elements/IsotopesViewer';
15
- import Label from '../elements/Label';
16
- import FormikCheckBox from '../elements/formik/FormikCheckBox';
17
- import FormikErrorsSummary from '../elements/formik/FormikErrorsSummary';
18
- import FormikInput from '../elements/formik/FormikInput';
19
- import FormikSelect from '../elements/formik/FormikSelect';
20
11
  import { useAlert } from '../elements/popup/Alert';
12
+ import { useModal } from '../elements/popup/Modal';
13
+ import { positions } from '../elements/popup/options';
14
+ import PredictionPreferences from '../panels/predictionPanel/PredictionOptionsPanel';
21
15
  import { useStateWithLocalStorage } from '../utility/LocalStorage';
22
16
  import { ModalStyles } from './ModalStyle';
23
17
  const styles = css `
24
- .row {
25
- align-items: center;
26
- }
27
-
28
18
  .inner-content {
29
19
  flex: 1;
30
20
  }
31
21
 
32
- .custom-label {
33
- width: 160px;
34
- font-weight: 500;
35
- }
36
-
37
- .nucleus-label {
38
- padding: 0 10px;
39
- color: black;
40
- font-weight: 700;
41
-
42
- &.disabled {
43
- opacity: 0.5;
44
- color: black;
45
- }
46
- }
47
-
48
22
  .warning {
49
23
  color: #c40000;
50
24
  font-weight: bold;
@@ -61,59 +35,8 @@ const styles = css `
61
35
  margin: 5px 5px 5px 0;
62
36
  }
63
37
  }
64
-
65
- .middle-x {
66
- padding: 0 10px;
67
- }
68
-
69
- .group-label {
70
- width: 100%;
71
- display: block;
72
- border-bottom: 1px solid #efefef;
73
- padding-bottom: 5px;
74
- font-weight: 600;
75
- color: #005d9e;
76
- }
77
38
  `;
78
- const NUMBER_OF_POINTS_1D = generateNumbersPowerOfX(12, 19);
79
- const NUMBER_OF_POINTS_2D = generateNumbersPowerOfX(10, 10, {
80
- format: (value) => value,
81
- });
82
- const predictionFormValidation = Yup.object().shape({
83
- name: Yup.string().required().label('Name'),
84
- frequency: Yup.number().integer().required().label('Frequency'),
85
- '1d': Yup.object({
86
- '1H': Yup.object({
87
- from: Yup.number().required().label("1H ' From ' "),
88
- to: Yup.number().required().label("1H ' To ' "),
89
- }),
90
- '13C': Yup.object().shape({
91
- from: Yup.number().required().label("13C ' From ' "),
92
- to: Yup.number().required().label("13C ' To ' "),
93
- }),
94
- lineWidth: Yup.number().integer().min(1).required().label('Line Width'),
95
- nbPoints: Yup.number().integer().required().label('1D Number Of Points'),
96
- }),
97
- '2d': Yup.object({
98
- nbPoints: Yup.object({
99
- x: Yup.number().integer().required().label('2D Number Of Points'),
100
- y: Yup.number().integer().required().label('2D Number Of Points'),
101
- }),
102
- }),
103
- spectra: Yup.object({
104
- proton: Yup.boolean(),
105
- carbon: Yup.boolean(),
106
- cosy: Yup.boolean(),
107
- hsqc: Yup.boolean(),
108
- hmbc: Yup.boolean(),
109
- }).test('check-options', 'You must check one of the options to start prediction', (obj) => {
110
- if (Object.values(obj).includes(true)) {
111
- return true;
112
- }
113
- return false;
114
- }),
115
- });
116
- function PredictSpectraModal({ onClose = () => null, molfile, }) {
39
+ function PredictSpectraModal({ onClose = () => null, molecule, }) {
117
40
  const refForm = useRef();
118
41
  const dispatch = useDispatch();
119
42
  const alert = useAlert();
@@ -132,35 +55,50 @@ function PredictSpectraModal({ onClose = () => null, molfile, }) {
132
55
  }, [predictionPreferences, predictionIndex]);
133
56
  const submitHandler = useCallback((values) => {
134
57
  void (async () => {
135
- if (molfile) {
58
+ if (molecule) {
59
+ const { molfile } = molecule;
136
60
  setPredictionPreferences({ ...values, isApproved });
137
- dispatch({
138
- type: 'SET_LOADING_FLAG',
139
- payload: {
140
- isLoading: true,
141
- },
142
- });
143
- const predictedSpectra = Object.entries(values.spectra)
144
- .map(([key, value]) => {
61
+ const predictedSpectra = [];
62
+ for (const [key, value] of Object.entries(values.spectra)) {
145
63
  if (value) {
146
- return key;
64
+ predictedSpectra.push(key);
147
65
  }
148
- return undefined;
149
- })
150
- .join(',');
151
- const hideLoading = await alert.showLoading(`Predict ${predictedSpectra} in progress`);
152
- dispatch({
153
- type: 'PREDICT_SPECTRA',
154
- payload: { molfile, options: values },
155
- });
156
- hideLoading();
157
- onClose();
66
+ }
67
+ const hideLoading = await alert.showLoading(`Predict ${predictedSpectra.join(',')} in progress`);
68
+ try {
69
+ const data = await predictSpectra(molfile);
70
+ dispatch({
71
+ type: 'PREDICT_SPECTRA',
72
+ payload: {
73
+ predictedSpectra: data.spectra,
74
+ options: values,
75
+ molecule,
76
+ },
77
+ });
78
+ }
79
+ catch (error) {
80
+ alert.error(error?.message);
81
+ }
82
+ finally {
83
+ hideLoading();
84
+ onClose();
85
+ }
158
86
  }
159
87
  })();
160
- }, [alert, dispatch, isApproved, molfile, onClose, setPredictionPreferences]);
88
+ }, [alert, dispatch, isApproved, molecule, onClose, setPredictionPreferences]);
161
89
  const approveCheckHandler = useCallback((e) => {
162
90
  setApproved(e.target.checked);
163
91
  }, []);
164
- return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Prediction of NMR spectrum" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsxs("div", { className: "inner-content", children: [_jsx(Formik, { innerRef: refForm, initialValues: initValues, validationSchema: predictionFormValidation, onSubmit: submitHandler, children: _jsxs(_Fragment, { children: [_jsx(FormikErrorsSummary, {}), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Name :" }), _jsx(FormikInput, { name: "name", style: { input: { width: '200px', textAlign: 'left' } } })] }), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Spectrometer Frequency :" }), _jsx(FormikSelect, { items: FREQUENCIES, style: { width: 290, height: 30, margin: 0 }, name: "frequency" })] }), _jsx("span", { className: "group-label", children: "1D Options " }), _jsxs("div", { className: "row margin-10 padding-h-10", children: [_jsx(IsotopesViewer, { value: "1H", className: "custom-label" }), _jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "1d.1H.from", type: "number" }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "1d.1H.to", type: "number" }) })] }), _jsxs("div", { className: "row margin-10 padding-h-10", children: [_jsx(IsotopesViewer, { value: "13C", className: "custom-label" }), _jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "1d.13C.from", type: "number" }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "1d.13C.to", type: "number" }) })] }), _jsxs("div", { className: "row margin-10 padding-h-10", children: [_jsx("span", { className: "custom-label", children: "Line Width : " }), _jsx(FormikInput, { name: "1d.lineWidth", type: "number", style: { input: { margin: 0 } } }), _jsx("span", { style: { paddingLeft: '0.4rem' }, children: " Hz " })] }), _jsxs("div", { className: "row margin-10 padding-h-10", children: [_jsx("span", { className: "custom-label", children: "Number of Points : " }), _jsx(FormikSelect, { items: NUMBER_OF_POINTS_1D, name: "1d.nbPoints", style: { width: 290, height: 30, margin: 0 } })] }), _jsx("span", { className: "group-label", children: "2D Options " }), _jsxs("div", { className: "row margin-10 padding-h-10", children: [_jsx("span", { className: "custom-label", children: "Number of Points : " }), _jsx(FormikSelect, { items: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.x", style: { margin: 0, height: 30 } }), _jsx("span", { className: "middle-x", children: " X " }), _jsx(FormikSelect, { items: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.y", style: { margin: 0, height: 30 } })] }), _jsx("div", { className: "row margin-10", children: _jsx("span", { className: "group-label", children: "Spectra " }) }), _jsxs("div", { className: "row margin-10 padding-h-10", style: { justifyContent: 'space-between' }, children: [_jsxs("div", { className: "row", children: [_jsx(FormikCheckBox, { name: "spectra.proton" }), _jsx(IsotopesViewer, { value: "1H", className: "nucleus-label" })] }), _jsxs("div", { className: "row", children: [_jsx(FormikCheckBox, { name: "spectra.carbon" }), _jsx(IsotopesViewer, { value: "13C", className: "nucleus-label" })] }), _jsxs("div", { className: "row", children: [_jsx(FormikCheckBox, { name: "spectra.cosy" }), _jsx(IsotopesViewer, { value: "COSY", className: "nucleus-label" })] }), _jsxs("div", { className: "row", children: [_jsx(FormikCheckBox, { name: "spectra.hsqc" }), _jsx(IsotopesViewer, { value: "HSQC", className: "nucleus-label" })] }), _jsxs("div", { className: "row", children: [_jsx(FormikCheckBox, { name: "spectra.hmbc" }), _jsx(IsotopesViewer, { value: "HMBC", className: "nucleus-label" })] })] })] }) }), _jsx("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), _jsxs("div", { className: "warning-container", children: [_jsx(CheckBox, { onChange: approveCheckHandler, checked: isApproved }, String(isApproved)), _jsx("p", { children: "I confirm that the chemical structure is not confidential." })] })] }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] }));
92
+ return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Prediction of NMR spectrum" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsxs("div", { className: "inner-content", children: [_jsx(PredictionPreferences, { onSubmit: submitHandler, options: initValues, ref: refForm }), _jsx("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), _jsxs("div", { className: "warning-container", children: [_jsx(CheckBox, { onChange: approveCheckHandler, checked: isApproved }, String(isApproved)), _jsx("p", { children: "I confirm that the chemical structure is not confidential." })] })] }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] }));
93
+ }
94
+ export function usePredictSpectraModal() {
95
+ const modal = useModal();
96
+ return (molecule) => {
97
+ modal.show(_jsx(PredictSpectraModal, { molecule: molecule }), {
98
+ position: positions.TOP_CENTER,
99
+ enableResizing: true,
100
+ width: 600,
101
+ });
102
+ };
165
103
  }
166
104
  export default PredictSpectraModal;
@@ -1,3 +1,5 @@
1
+ import { LabelStyle } from '../elements/Label';
2
+ export declare const labelStyle: LabelStyle;
1
3
  interface SaveAsModalProps {
2
4
  onClose?: (event?: MouseEvent) => void;
3
5
  onSave: (element: any) => void;
@@ -7,6 +7,7 @@ import { DataExportOptions } from '../../data/SpectraManager';
7
7
  import { useChartData } from '../context/ChartContext';
8
8
  import ActionButtons from '../elements/ActionButtons';
9
9
  import CloseButton from '../elements/CloseButton';
10
+ import Label from '../elements/Label';
10
11
  import FormikCheckBox from '../elements/formik/FormikCheckBox';
11
12
  import FormikInput from '../elements/formik/FormikInput';
12
13
  import { ModalStyles } from './ModalStyle';
@@ -15,15 +16,6 @@ const styles = css `
15
16
  flex: 1;
16
17
  }
17
18
 
18
- .custom-label {
19
- width: 100px;
20
- }
21
-
22
- .name {
23
- width: 100% !important;
24
- text-align: left !important;
25
- }
26
-
27
19
  .data-export-group {
28
20
  label {
29
21
  margin-right: 10px;
@@ -45,6 +37,20 @@ const INITIAL_VALUE = {
45
37
  settings: false,
46
38
  },
47
39
  };
40
+ export const labelStyle = {
41
+ label: {
42
+ flex: 4,
43
+ fontSize: '12px',
44
+ fontWeight: 'bold',
45
+ color: '#232323',
46
+ },
47
+ wrapper: {
48
+ flex: 8,
49
+ display: 'flex',
50
+ justifyContent: 'flex-start',
51
+ },
52
+ container: { padding: '5px 0' },
53
+ };
48
54
  function SaveAsModal({ onClose, onSave, name }) {
49
55
  const refForm = useRef();
50
56
  const { source } = useChartData();
@@ -55,10 +61,11 @@ function SaveAsModal({ onClose, onSave, name }) {
55
61
  onSave(values);
56
62
  onClose?.();
57
63
  }, [onClose, onSave]);
58
- return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Save as ... " }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { innerRef: refForm, initialValues: { ...INITIAL_VALUE, name }, onSubmit: submitHandler, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Name" }), _jsx(FormikInput, { name: "name", className: "name", style: {
59
- inputWrapper: { width: '100%' },
60
- } })] }), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Compressed" }), _jsx(FormikCheckBox, { name: "compressed" })] }), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Pretty Format" }), _jsx(FormikCheckBox, { name: "pretty" })] }), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: " Include view " }), _jsx(FormikCheckBox, { name: "include.view" })] }), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: " Include settings " }), _jsx(FormikCheckBox, { name: "include.settings" })] }), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: " Include Data " }), _jsx("div", { style: { display: 'flex', flexDirection: 'column' }, children: _jsxs("div", { className: "data-export-group", children: [_jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.ROW_DATA }), "Raw Data"] }), _jsxs("label", { style: {
61
- color: source ? 'black' : 'lightgray',
62
- }, children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.DATA_SOURCE, disabled: !source }), "Data Source"] }), _jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.NO_DATA }), "No Data"] })] }) })] })] }) }) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: () => onClose?.() }) })] }));
64
+ return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Save as ... " }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { innerRef: refForm, initialValues: { ...INITIAL_VALUE, name }, onSubmit: submitHandler, children: _jsxs(_Fragment, { children: [_jsx(Label, { style: labelStyle, title: "Name", children: _jsx(FormikInput, { name: "name", className: "name", style: {
65
+ inputWrapper: { width: '100%' },
66
+ input: { padding: '5px', textAlign: 'left' },
67
+ } }) }), _jsx(Label, { style: labelStyle, title: "Compressed", children: _jsx(FormikCheckBox, { name: "compressed" }) }), _jsx(Label, { style: labelStyle, title: "Pretty Format", children: _jsx(FormikCheckBox, { name: "pretty" }) }), _jsx(Label, { style: labelStyle, title: "Include view", children: _jsx(FormikCheckBox, { name: "include.view" }) }), _jsx(Label, { style: labelStyle, title: "Include settings", children: _jsx(FormikCheckBox, { name: "include.settings" }) }), _jsx(Label, { style: labelStyle, title: "Include Data", children: _jsx("div", { style: { display: 'flex', flexDirection: 'column' }, children: _jsxs("div", { className: "data-export-group", children: [_jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.ROW_DATA }), "Raw Data"] }), _jsxs("label", { style: {
68
+ color: source ? 'black' : 'lightgray',
69
+ }, children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.DATA_SOURCE, disabled: !source }), "Data Source"] }), _jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.NO_DATA }), "No Data"] })] }) }) })] }) }) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: () => onClose?.() }) })] }));
63
70
  }
64
71
  export default SaveAsModal;
@@ -2,9 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
4
  import { Formik } from 'formik';
5
- import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
5
+ import { useEffect, useRef, useState } from 'react';
6
6
  import * as Yup from 'yup';
7
7
  import { usePreferences } from '../../context/PreferencesContext';
8
+ import Button from '../../elements/Button';
8
9
  import CloseButton from '../../elements/CloseButton';
9
10
  import Tab from '../../elements/Tab/Tab';
10
11
  import Tabs from '../../elements/Tab/Tabs';
@@ -43,38 +44,40 @@ const styles = css `
43
44
  text-align: center;
44
45
  }
45
46
  }
46
-
47
- .footer-container {
48
- button {
49
- width: 20%;
50
- color: white;
51
- background-color: gray !important;
52
- }
53
-
54
- button:hover {
55
- border: 1px solid gray;
56
- color: gray;
57
- background-color: white !important;
58
- }
59
- }
60
47
  `;
61
48
  var SumSetOptions;
62
49
  (function (SumSetOptions) {
63
50
  SumSetOptions["Auto"] = "auto";
64
51
  SumSetOptions["Manual"] = "manual";
65
52
  })(SumSetOptions || (SumSetOptions = {}));
53
+ function getValidationSchema(option) {
54
+ switch (option) {
55
+ case SumSetOptions.Auto: {
56
+ return Yup.object({
57
+ molecule: Yup.object().required(),
58
+ });
59
+ }
60
+ case SumSetOptions.Manual: {
61
+ return Yup.object({
62
+ sum: Yup.number().required(),
63
+ });
64
+ }
65
+ default:
66
+ return null;
67
+ }
68
+ }
66
69
  export default function ChangeSumModal({ onSave, onClose, header, sumOptions, }) {
67
70
  const { current: { display: { panels }, }, } = usePreferences();
68
71
  const [setOption, setActiveOption] = useState(SumSetOptions.Auto);
69
72
  const formRef = useRef(null);
70
- const handleKeyDown = useCallback((event) => {
73
+ function handleKeyDown(event) {
71
74
  if (event.key === 'Enter') {
72
75
  formRef.current.submitForm();
73
76
  }
74
- }, []);
75
- const onTabChangeHandler = useCallback((tab) => {
77
+ }
78
+ function onTabChangeHandler(tab) {
76
79
  setActiveOption(tab.tabid);
77
- }, []);
80
+ }
78
81
  useEffect(() => {
79
82
  if (sumOptions?.sumAuto && panels?.structuresPanel?.display) {
80
83
  setActiveOption(SumSetOptions.Auto);
@@ -89,7 +92,7 @@ export default function ChangeSumModal({ onSave, onClose, header, sumOptions, })
89
92
  formRef.current.setValues({ sum: sumOptions?.sum || '', molecule: null });
90
93
  }
91
94
  }, [panels?.structuresPanel, sumOptions]);
92
- const saveHandler = useCallback((values) => {
95
+ function saveHandler(values) {
93
96
  switch (setOption) {
94
97
  case SumSetOptions.Auto: {
95
98
  const { molecule: { mf, id: moleculeId }, } = values;
@@ -105,25 +108,9 @@ export default function ChangeSumModal({ onSave, onClose, header, sumOptions, })
105
108
  return;
106
109
  }
107
110
  onClose();
108
- }, [onClose, onSave, setOption]);
109
- const validationSchema = useMemo(() => {
110
- switch (setOption) {
111
- case SumSetOptions.Auto: {
112
- return Yup.object({
113
- molecule: Yup.object().required(),
114
- });
115
- }
116
- case SumSetOptions.Manual: {
117
- return Yup.object({
118
- sum: Yup.number().required(),
119
- });
120
- }
121
- default:
122
- return null;
123
- }
124
- }, [setOption]);
111
+ }
125
112
  const isStructurePanelVisible = panels?.structuresPanel?.display || false;
126
113
  return (
127
114
  // <div css={modalContainer}>
128
- _jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: header }), _jsx(CloseButton, { onClick: onClose })] }), _jsx("div", { className: "tab-content", children: _jsx(Formik, { innerRef: formRef, onSubmit: saveHandler, initialValues: { sum: null, molecule: null }, validationSchema: validationSchema, children: _jsxs(Tabs, { activeTab: setOption, onClick: onTabChangeHandler, children: [isStructurePanelVisible && (_jsx(Tab, { title: "Auto", tabid: SumSetOptions.Auto, children: _jsx(SelectMolecule, { name: "molecule" }) })), _jsx(Tab, { title: "Manual", tabid: SumSetOptions.Manual, children: _jsx("div", { className: "manual-container", children: _jsx(FormikInput, { name: "sum", type: "number", placeholder: "Enter the new value", onKeyDown: handleKeyDown }) }) })] }) }) }), _jsx("div", { className: "footer-container", children: _jsx("button", { type: "button", onClick: () => formRef.current.submitForm(), className: "btn", children: "Set" }) })] }));
115
+ _jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: header }), _jsx(CloseButton, { onClick: onClose })] }), _jsx("div", { className: "tab-content", children: _jsx(Formik, { innerRef: formRef, onSubmit: saveHandler, initialValues: { sum: '', molecule: null }, validationSchema: getValidationSchema(setOption), children: _jsxs(Tabs, { activeTab: setOption, onClick: onTabChangeHandler, children: [isStructurePanelVisible && (_jsx(Tab, { title: "Auto", tabid: SumSetOptions.Auto, children: _jsx(SelectMolecule, { name: "molecule" }) })), _jsx(Tab, { title: "Manual", tabid: SumSetOptions.Manual, children: _jsx("div", { className: "manual-container", children: _jsx(FormikInput, { name: "sum", type: "number", nullable: true, placeholder: "Enter the new value", onKeyDown: handleKeyDown }) }) })] }) }) }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: () => formRef.current.submitForm(), style: { width: '80px' }, children: "Set" }) })] }));
129
116
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { WorkSpacePanelPreferences } from '../../../../workspaces/Workspace';
2
+ import { WorkSpacePanelPreferences } from 'nmr-load-save';
3
3
  interface AddSignalFormTabProps {
4
4
  onFocus: (element: any) => void;
5
5
  onBlur?: () => void;
@@ -5,6 +5,8 @@ const style = {
5
5
  input: {
6
6
  width: '50px',
7
7
  height: '26px',
8
+ },
9
+ inputWrapper: {
8
10
  borderWidth: 0,
9
11
  margin: '0 5px',
10
12
  },
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { Range } from 'nmr-load-save';
3
- import { WorkSpacePanelPreferences } from '../../../../workspaces/Workspace';
2
+ import { WorkSpacePanelPreferences } from 'nmr-load-save';
3
+ import { Range } from 'nmr-processing';
4
4
  interface SignalsFormProps {
5
5
  range: Range;
6
6
  preferences: WorkSpacePanelPreferences['ranges'];
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
2
3
  import { Formik } from 'formik';
3
4
  import { useState, useMemo, useRef, useEffect } from 'react';
4
5
  import { DropZone } from 'react-science/ui';
@@ -60,7 +61,7 @@ const rowColors = {
60
61
  };
61
62
  const validationSchema = Yup.object({
62
63
  source: Yup.string().required(),
63
- target: Yup.array(Yup.string()).min(1),
64
+ target: Yup.array(Yup.string()).min(1).required(),
64
65
  });
65
66
  function MetaImportationModal({ onClose, file }) {
66
67
  const alert = useAlert();
@@ -86,7 +87,9 @@ function MetaImportationModal({ onClose, file }) {
86
87
  };
87
88
  }, [file]);
88
89
  function handleDrop(files) {
89
- handleParseFile(files[0]);
90
+ if (files[0]) {
91
+ handleParseFile(files[0]);
92
+ }
90
93
  }
91
94
  const errors = mapErrors(parseResult?.errors || []);
92
95
  const metaData = parseResult?.data || [];
@@ -167,14 +170,21 @@ function MetaImportationModal({ onClose, file }) {
167
170
  }
168
171
  return (_jsxs("div", { css: ModalStyles, style: { overflow: 'hidden' }, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Import Meta Information" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { style: styles.container, children: _jsx("div", { style: { flex: 1, width: '100%' }, children: !parseResult ? (_jsx(DropZone, { fileValidator: fileValidator, color: "gray", emptyText: "Drag and Drop CSV or tab-delimited file (.csv, .txt or .tsv)", onDrop: handleDrop })) : (_jsxs(_Fragment, { children: [_jsxs("div", { style: { height: '130px' }, children: [_jsx(Formik, { innerRef: formRef, initialValues: {
169
172
  source: null,
170
- target: null,
173
+ target: '',
171
174
  }, onSubmit: handleLinkSpectra, validationSchema: validationSchema, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "Source field", style: { label: { width: '100px' } }, children: _jsx(FormikSelect, { name: "source", items: mapColumnToSelectItems(parseResult?.meta.fields || []), style: {
172
175
  width: '300px',
173
- padding: '3px',
176
+ padding: '5px',
174
177
  margin: 0,
175
178
  } }) }), _jsx(Label, { title: "Target field path", style: {
176
179
  label: { width: '100px', padding: '20px 0px' },
177
- }, children: _jsx(FormikInput, { name: "target", style: { input: { width: '300px', textAlign: 'left' } }, placeholder: "Example: info.plus", datalist: datalist, mapOnChangeValue: (key) => paths?.[key] || null, mapValue: (paths) => convertPathArrayToString(paths) }) })] }) }), _jsx(Button.Done, { onClick: () => formRef.current?.submitForm(), children: "Link Spectra" })] }), _jsx("div", { style: { height: 'calc(100% - 160px)' }, children: _jsx(ReactTable, { columns: columns, data: metaData, approxItemHeight: 25, approxColumnWidth: 100, enableVirtualScroll: true, enableColumnsVirtualScroll: true, activeRow: handleActiveRow, rowStyle: handleRowStyle }) })] })) }) }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleImport, disabled: Object.keys(matches).length === 0, children: "Import" }) })] }));
180
+ }, children: _jsx(FormikInput, { name: "target", style: {
181
+ input: {
182
+ width: '300px',
183
+ textAlign: 'left',
184
+ padding: '5px',
185
+ fontSize: '14px',
186
+ },
187
+ }, placeholder: "Example: info.plus", datalist: datalist, nullable: true, mapOnChangeValue: (key) => paths?.[key] || null, mapValue: (paths) => convertPathArrayToString(paths) }) })] }) }), _jsx(Button.Done, { onClick: () => formRef.current?.submitForm(), children: "Link Spectra" })] }), _jsx("div", { style: { height: 'calc(100% - 160px)' }, children: _jsx(ReactTable, { columns: columns, data: metaData, approxItemHeight: 25, approxColumnWidth: 100, enableVirtualScroll: true, enableColumnsVirtualScroll: true, activeRow: handleActiveRow, rowStyle: handleRowStyle }) })] })) }) }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleImport, disabled: Object.keys(matches).length === 0, children: "Import" }) })] }));
178
188
  }
179
189
  function fileValidator(file) {
180
190
  if (!isMetaFile(file)) {
@@ -57,12 +57,7 @@ const styles = css `
57
57
 
58
58
  .input {
59
59
  font-size: 14px;
60
- border-radius: 5px;
61
- border: 1px solid #ccc;
62
- padding: 5px;
63
- width: 100px;
64
- margin-right: 10px;
65
- height: initial !important;
60
+ padding: 3px;
66
61
  }
67
62
 
68
63
  .close-bt {
@@ -1,5 +1,5 @@
1
+ import { CustomWorkspaces } from 'nmr-load-save';
1
2
  import { NMRiumWorkspace } from '../../../NMRium';
2
- import { CustomWorkspaces } from '../../../workspaces/Workspace';
3
3
  interface DatabasesTabContentProps {
4
4
  currentWorkspace: NMRiumWorkspace;
5
5
  originalWorkspaces: CustomWorkspaces;
@@ -1,4 +1,4 @@
1
- import { Info1D, Integrals } from 'nmr-load-save';
1
+ import { Info1D, Integrals } from 'nmr-processing';
2
2
  export interface IntegralPanelInnerProps {
3
3
  integrals: Integrals;
4
4
  info: Info1D;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Integral } from 'nmr-load-save';
2
+ import { Integral } from 'nmr-processing';
3
3
  import { IntegralPanelInnerProps } from './IntegralPanel';
4
4
  interface IntegralTableProps extends Pick<IntegralPanelInnerProps, 'activeTab'> {
5
5
  data: Array<Integral>;
@@ -1,9 +1,10 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Formik } from 'formik';
3
3
  import { useCallback, useImperativeHandle, useRef, memo, forwardRef, useMemo, } from 'react';
4
4
  import { usePreferences } from '../../context/PreferencesContext';
5
5
  import Label from '../../elements/Label';
6
6
  import FormikColorInput from '../../elements/formik/FormikColorInput';
7
+ import { formatFieldLabelStyle } from '../../elements/formik/FormikColumnFormatField';
7
8
  import FormikNumberInput from '../../elements/formik/FormikNumberInput';
8
9
  import useNucleus from '../../hooks/useNucleus';
9
10
  import { usePanelPreferencesByNuclei } from '../../hooks/usePanelPreferences';
@@ -47,19 +48,10 @@ function IntegralsPreferences(props, ref) {
47
48
  formRef.current.submitForm();
48
49
  },
49
50
  }));
50
- return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => (_jsxs(_Fragment, { children: [_jsx(FormikColorInput, { name: `nuclei.${n}.color` }), _jsx(Label, { title: "stroke width :", style: {
51
- label: {
52
- fontSize: '11px',
53
- fontWeight: 'bold',
54
- color: '#232323',
55
- flex: 2,
56
- },
57
- wrapper: {
58
- flex: 4,
59
- },
60
- }, children: _jsx(FormikNumberInput, { name: `nuclei.${n}.strokeWidth`, style: {
61
- width: '60%',
62
- textAlign: 'center',
63
- }, min: 1, max: 9, pattern: "[1-9]+" }) })] })) }, n))) }) }) }));
51
+ return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Color", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex', padding: '2px 0' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikColorInput, { name: `nuclei.${n}.color` })] }) }), _jsx(Label, { title: "stroke width :", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex', padding: '2px 0' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikNumberInput, { name: `nuclei.${n}.strokeWidth`, style: {
52
+ width: '60%',
53
+ textAlign: 'center',
54
+ padding: '2px',
55
+ }, min: 1, max: 9, pattern: "[1-9]+" })] }) })] })) }, n))) }) }) }));
64
56
  }
65
57
  export default memo(forwardRef(IntegralsPreferences));
@@ -4,13 +4,13 @@ import { MF } from 'react-mf';
4
4
  import { extractLabelsNumbers, extractNumber, } from '../../../data/molecules/MoleculeManager';
5
5
  import { useDispatch } from '../../context/DispatchContext';
6
6
  import EditableColumn from '../../elements/EditableColumn';
7
+ import Label from '../../elements/Label';
7
8
  const styles = {
8
9
  toolbar: {
9
10
  display: 'flex',
10
11
  borderBottom: '0.55px solid rgb(240, 240, 240)',
11
12
  padding: '5px 10px',
12
13
  justifyContent: 'space-between',
13
- height: '35px',
14
14
  },
15
15
  labelInput: {
16
16
  width: '150px',
@@ -33,5 +33,5 @@ export default function MoleculeHeader(props) {
33
33
  const label = event.target.value;
34
34
  dispatch({ type: 'CHANGE_MOLECULE_LABEL', payload: { label, id } });
35
35
  }, [dispatch]);
36
- return (_jsxs("div", { style: styles.toolbar, children: [_jsxs("div", { style: { display: 'flex' }, children: [_jsx("span", { children: "Label" }), _jsx(EditableColumn, { value: currentMolecule.label, style: styles.labelInput, validate: validateLabel, onSave: (event) => saveLabelHandler(currentMolecule.id, event), textOverFlowEllipses: true })] }), _jsxs("span", { children: [_jsx(MF, { mf: currentMolecule.mf }), " - ", currentMolecule.mw?.toFixed(2)] })] }));
36
+ return (_jsxs("div", { style: styles.toolbar, children: [_jsx(Label, { title: "Label", children: _jsx(EditableColumn, { value: currentMolecule.label, style: styles.labelInput, validate: validateLabel, onSave: (event) => saveLabelHandler(currentMolecule.id, event), textOverFlowEllipses: true }) }), _jsxs("span", { children: [_jsx(MF, { mf: currentMolecule.mf }), " - ", currentMolecule.mw?.toFixed(2)] })] }));
37
37
  }