nmrium 0.29.0 → 0.30.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 (409) hide show
  1. package/README.md +12 -2
  2. package/lib/component/1d/ApodizationLine.d.ts +3 -0
  3. package/lib/component/1d/ApodizationLine.js +47 -0
  4. package/lib/component/1d/Chart1D.js +4 -2
  5. package/lib/component/1d/ExclusionZoneAnnotation.d.ts +1 -1
  6. package/lib/component/1d/ExclusionZoneAnnotation.js +14 -7
  7. package/lib/component/1d/IntegralResizable.js +5 -4
  8. package/lib/component/1d/LinesSeries.js +6 -6
  9. package/lib/component/1d/Viewer1D.js +7 -12
  10. package/lib/component/1d/database/DatabaseElements.js +2 -2
  11. package/lib/component/1d/database/DatabaseSpectrum.js +3 -3
  12. package/lib/component/1d/database/ResurrectedDatabaseRanges.js +3 -3
  13. package/lib/component/1d/multiAnalysis/AnalysisRange.js +16 -14
  14. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +3 -4
  15. package/lib/component/1d/{PeakAnnotation.d.ts → peaks/PeakAnnotation.d.ts} +1 -2
  16. package/lib/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
  17. package/lib/component/1d/{PeakAnnotations.d.ts → peaks/PeakAnnotations.d.ts} +0 -0
  18. package/lib/component/1d/peaks/PeakAnnotations.js +26 -0
  19. package/lib/component/1d/peaks/PeaksShapes.d.ts +3 -0
  20. package/lib/component/1d/peaks/PeaksShapes.js +35 -0
  21. package/lib/component/1d/peaks/usePeakShapesPath.d.ts +13 -0
  22. package/lib/component/1d/peaks/usePeakShapesPath.js +45 -0
  23. package/lib/component/1d/ranges/Range.js +4 -4
  24. package/lib/component/2d/FooterBanner.js +2 -2
  25. package/lib/component/2d/Viewer2D.js +2 -2
  26. package/lib/component/2d/zones/Signal.d.ts +3 -2
  27. package/lib/component/2d/zones/Signal.js +3 -3
  28. package/lib/component/2d/zones/Zone.d.ts +1 -1
  29. package/lib/component/2d/zones/Zone.js +4 -4
  30. package/lib/component/EventsTrackers/KeysListenerTracker.js +91 -52
  31. package/lib/component/assignment/AssignmentsContext.d.ts +1 -1
  32. package/lib/component/context/GlobalContext.d.ts +1 -1
  33. package/lib/component/context/GlobalContext.js +3 -3
  34. package/lib/component/elements/ActiveButton.d.ts +17 -0
  35. package/lib/component/elements/ActiveButton.js +28 -0
  36. package/lib/component/elements/Button.d.ts +6 -6
  37. package/lib/component/elements/Button.js +5 -5
  38. package/lib/component/elements/ButtonToolTip.js +1 -1
  39. package/lib/component/elements/CheckBox.d.ts +2 -6
  40. package/lib/component/elements/CheckBox.js +4 -6
  41. package/lib/component/elements/Input.d.ts +5 -4
  42. package/lib/component/elements/Input.js +1 -1
  43. package/lib/component/elements/Label.d.ts +8 -6
  44. package/lib/component/elements/Label.js +3 -3
  45. package/lib/component/elements/MoleculeSelection.d.ts +2 -2
  46. package/lib/component/elements/MoleculeSelection.js +1 -1
  47. package/lib/component/elements/NextPrev.js +1 -1
  48. package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -2
  49. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +2 -2
  50. package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
  51. package/lib/component/elements/Select.d.ts +7 -11
  52. package/lib/component/elements/Select.js +6 -8
  53. package/lib/component/elements/Tab/Tab.js +1 -1
  54. package/lib/component/elements/Table/Table.d.ts +1 -2
  55. package/lib/component/elements/Table/Table.js +2 -2
  56. package/lib/component/elements/ToggleButton.d.ts +1 -2
  57. package/lib/component/elements/ToggleButton.js +3 -2
  58. package/lib/component/elements/accordion/AccordionItem.js +2 -2
  59. package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
  60. package/lib/component/elements/formik/FormikOnChange.d.ts +3 -2
  61. package/lib/component/elements/formik/FormikOnChange.js +11 -5
  62. package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  63. package/lib/component/elements/resizer/DivResizer.js +3 -3
  64. package/lib/component/elements/resizer/Resizer.d.ts +1 -0
  65. package/lib/component/elements/resizer/SVGResizer.js +3 -3
  66. package/lib/component/header/ApodizationOptionsPanel.d.ts +2 -0
  67. package/lib/component/header/ApodizationOptionsPanel.js +81 -0
  68. package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +2 -1
  69. package/lib/component/header/AutoPeakPickingOptionPanel.js +40 -36
  70. package/lib/component/header/BaseLineCorrectionPanel.d.ts +1 -2
  71. package/lib/component/header/BaseLineCorrectionPanel.js +84 -52
  72. package/lib/component/header/Header.js +5 -2
  73. package/lib/component/header/HeaderContainer.d.ts +7 -0
  74. package/lib/component/header/HeaderContainer.js +10 -0
  75. package/lib/component/header/ManualPhaseCorrectionPanel.js +27 -29
  76. package/lib/component/header/RangesPickingOptionPanel.js +19 -21
  77. package/lib/component/header/ZeroFillingOptionsPanel.js +49 -46
  78. package/lib/component/header/Zones2DOptionPanel.js +11 -13
  79. package/lib/component/highlight/index.d.ts +27 -10
  80. package/lib/component/highlight/index.js +19 -17
  81. package/lib/component/hooks/useCheckToolsVisibility.d.ts +10 -1
  82. package/lib/component/hooks/useCheckToolsVisibility.js +31 -1
  83. package/lib/component/hooks/useFilter.d.ts +1 -0
  84. package/lib/component/hooks/useFilter.js +7 -0
  85. package/lib/component/hooks/useToolsFunctions.js +1 -1
  86. package/lib/component/loader/DropZone.js +1 -1
  87. package/lib/component/modal/AlignSpectraModal.js +1 -2
  88. package/lib/component/modal/EditPeakShapeModal.d.ts +9 -0
  89. package/lib/component/modal/EditPeakShapeModal.js +85 -0
  90. package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -3
  91. package/lib/component/modal/MoleculeStructureEditorModal.js +2 -3
  92. package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
  93. package/lib/component/modal/PredictSpectraModal.js +1 -1
  94. package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
  95. package/lib/component/modal/changeSum/ChangeSumModal.js +9 -11
  96. package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
  97. package/lib/component/modal/editRange/EditRangeModal.js +2 -2
  98. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +4 -9
  99. package/lib/component/modal/setting/DatabasesTabContent.js +2 -2
  100. package/lib/component/modal/setting/DisplayTabContent.js +1 -1
  101. package/lib/component/modal/setting/FormattingTabContent.js +2 -2
  102. package/lib/component/modal/setting/GeneralSettings.js +1 -1
  103. package/lib/component/modal/setting/ToolsTabContent.js +13 -13
  104. package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -2
  105. package/lib/component/modal/setting/WorkspaceItem.js +2 -2
  106. package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
  107. package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +3 -3
  108. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
  109. package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +5 -4
  110. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +13 -10
  111. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +4 -2
  112. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
  113. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -2
  114. package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +5 -3
  115. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +12 -4
  116. package/lib/component/panels/Panels.js +3 -3
  117. package/lib/component/panels/PeaksPanel/PeaksPanel.js +47 -22
  118. package/lib/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
  119. package/lib/component/panels/PeaksPanel/PeaksTable.js +44 -13
  120. package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
  121. package/lib/component/panels/RangesPanel/RangesTableRow.js +4 -4
  122. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
  123. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +3 -2
  124. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +3 -3
  125. package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +3 -3
  126. package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
  127. package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
  128. package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.d.ts +1 -1
  129. package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
  130. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
  131. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
  132. package/lib/component/panels/SummaryPanel/SummaryPanel.js +1 -2
  133. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
  134. package/lib/component/panels/databasePanel/DatabasePanel.js +4 -12
  135. package/lib/component/panels/databasePanel/DatabaseTable.js +3 -3
  136. package/lib/component/panels/filtersPanel/FilterPanel.js +1 -1
  137. package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
  138. package/lib/component/panels/header/DefaultPanelHeader.js +3 -12
  139. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
  140. package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +2 -1
  141. package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -2
  142. package/lib/component/panels/predictionPanel/PredictionPanel.js +15 -3
  143. package/lib/component/reducer/IgnoreActions.js +4 -0
  144. package/lib/component/reducer/Reducer.d.ts +37 -6
  145. package/lib/component/reducer/Reducer.js +25 -5
  146. package/lib/component/reducer/actions/FiltersActions.d.ts +13 -7
  147. package/lib/component/reducer/actions/FiltersActions.js +165 -29
  148. package/lib/component/reducer/actions/IntegralsActions.js +2 -2
  149. package/lib/component/reducer/actions/MoleculeActions.js +27 -14
  150. package/lib/component/reducer/actions/PeaksActions.d.ts +4 -1
  151. package/lib/component/reducer/actions/PeaksActions.js +38 -5
  152. package/lib/component/reducer/actions/RangesActions.js +2 -2
  153. package/lib/component/reducer/actions/SpectrumsActions.js +1 -1
  154. package/lib/component/reducer/actions/ToolsActions.js +9 -72
  155. package/lib/component/reducer/helper/getStrongestPeak.d.ts +7 -0
  156. package/lib/component/reducer/helper/getStrongestPeak.js +14 -0
  157. package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
  158. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
  159. package/lib/component/reducer/preferences/preferencesReducer.d.ts +23 -15
  160. package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
  161. package/lib/component/reducer/types/Types.d.ts +7 -0
  162. package/lib/component/reducer/types/Types.js +7 -0
  163. package/lib/component/tool/BrushX.js +1 -1
  164. package/lib/component/tool/BrushXY.js +4 -3
  165. package/lib/component/tool/CrossLinePointer.js +5 -4
  166. package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +2 -2
  167. package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +14 -6
  168. package/lib/component/tool/FloatMoleculeStructures/index.d.ts +3 -2
  169. package/lib/component/tool/FloatMoleculeStructures/index.js +13 -6
  170. package/lib/component/toolbar/BasicToolBar.js +3 -8
  171. package/lib/component/toolbar/FunctionToolBar.js +11 -23
  172. package/lib/component/toolbar/ToolTypes.d.ts +7 -1
  173. package/lib/component/toolbar/ToolTypes.js +119 -9
  174. package/lib/component/utility/util/nmredata/addZones.js +3 -3
  175. package/lib/component/workspaces/Workspace.d.ts +4 -1
  176. package/lib/component/workspaces/basic.js +12 -11
  177. package/lib/component/workspaces/embedded.js +14 -13
  178. package/lib/component/workspaces/exercise.js +4 -6
  179. package/lib/component/workspaces/prediction.js +14 -13
  180. package/lib/component/workspaces/process1D.js +20 -19
  181. package/lib/component/workspaces/workspaceDefaultProperties.js +14 -15
  182. package/lib/constants.js +1 -1
  183. package/lib/data/Filters.d.ts +2 -2
  184. package/lib/data/Filters.js +2 -2
  185. package/lib/data/FiltersManager.js +3 -3
  186. package/lib/data/PredictionManager.d.ts +0 -1
  187. package/lib/data/PredictionManager.js +15 -15
  188. package/lib/data/SpectraManager.d.ts +2 -1
  189. package/lib/data/SpectraManager.js +2 -8
  190. package/lib/data/constants/SignalsKinds.d.ts +0 -1
  191. package/lib/data/constants/SignalsKinds.js +0 -8
  192. package/lib/data/data1d/Data1DManager.js +5 -5
  193. package/lib/data/data1d/Spectrum1D/SumManager.d.ts +5 -5
  194. package/lib/data/data1d/Spectrum1D/SumManager.js +18 -12
  195. package/lib/data/data1d/Spectrum1D/generateJGraphData.js +2 -2
  196. package/lib/data/data1d/Spectrum1D/index.d.ts +2 -1
  197. package/lib/data/data1d/Spectrum1D/index.js +2 -1
  198. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
  199. package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
  200. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +4 -2
  201. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +1 -1
  202. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -16
  203. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +8 -0
  204. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +24 -0
  205. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
  206. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +1 -0
  207. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
  208. package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
  209. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -3
  210. package/lib/data/data1d/database.js +4 -6
  211. package/lib/data/data1d/filter1d/apodization.d.ts +25 -0
  212. package/lib/data/data1d/filter1d/apodization.js +63 -0
  213. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +24 -7
  214. package/lib/data/data1d/filter1d/baselineCorrection.js +10 -17
  215. package/lib/data/data1d/filter1d/zeroFillingAndApodization.d.ts +9 -0
  216. package/lib/data/data1d/filter1d/zeroFillingAndApodization.js +24 -0
  217. package/lib/data/data2d/Processing2D.d.ts +3 -3
  218. package/lib/data/data2d/Processing2D.js +3 -2
  219. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -3
  220. package/lib/data/data2d/Spectrum2D/zones/detectZones.js +3 -3
  221. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -3
  222. package/lib/data/migration/MigrationManager.d.ts +1 -1
  223. package/lib/data/migration/MigrationManager.js +3 -1
  224. package/lib/data/migration/migrateToVersion3.d.ts +1 -0
  225. package/lib/data/migration/migrateToVersion3.js +55 -0
  226. package/lib/data/molecules/Molecule.d.ts +15 -6
  227. package/lib/data/molecules/Molecule.js +5 -8
  228. package/lib/data/molecules/MoleculeManager.d.ts +4 -4
  229. package/lib/data/molecules/MoleculeManager.js +5 -5
  230. package/lib/data/types/data1d/SumOptions.d.ts +1 -1
  231. package/lib/data/utilities/generateNumbersPowerOfX.d.ts +0 -1
  232. package/lib/data/utilities/generateNumbersPowerOfX.js +0 -1
  233. package/lib/data/utilities/isInRange.d.ts +7 -0
  234. package/lib/data/utilities/isInRange.js +4 -0
  235. package/lib/types/NMRiumDataReturn.d.ts +2 -2
  236. package/lib/types/NMRiumGeneralPreferences.d.ts +0 -2
  237. package/lib/types/NMRiumToolBarPreferences.d.ts +14 -13
  238. package/lib/versionInfo.js +1 -1
  239. package/lib-cjs/component/1d/ApodizationLine.js +75 -0
  240. package/lib-cjs/component/1d/Chart1D.js +4 -2
  241. package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +15 -8
  242. package/lib-cjs/component/1d/IntegralResizable.js +4 -3
  243. package/lib-cjs/component/1d/LinesSeries.js +5 -5
  244. package/lib-cjs/component/1d/Viewer1D.js +7 -12
  245. package/lib-cjs/component/1d/database/DatabaseElements.js +1 -1
  246. package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -2
  247. package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
  248. package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +15 -13
  249. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +1 -2
  250. package/lib-cjs/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
  251. package/lib-cjs/component/1d/peaks/PeakAnnotations.js +31 -0
  252. package/lib-cjs/component/1d/peaks/PeaksShapes.js +40 -0
  253. package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +49 -0
  254. package/lib-cjs/component/1d/ranges/Range.js +3 -3
  255. package/lib-cjs/component/2d/FooterBanner.js +2 -2
  256. package/lib-cjs/component/2d/Viewer2D.js +2 -2
  257. package/lib-cjs/component/2d/zones/Signal.js +3 -3
  258. package/lib-cjs/component/2d/zones/Zone.js +3 -3
  259. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +89 -50
  260. package/lib-cjs/component/context/GlobalContext.js +4 -4
  261. package/lib-cjs/component/elements/ActiveButton.js +33 -0
  262. package/lib-cjs/component/elements/Button.js +5 -5
  263. package/lib-cjs/component/elements/ButtonToolTip.js +1 -1
  264. package/lib-cjs/component/elements/CheckBox.js +3 -5
  265. package/lib-cjs/component/elements/Input.js +1 -1
  266. package/lib-cjs/component/elements/Label.js +3 -3
  267. package/lib-cjs/component/elements/MoleculeSelection.js +1 -1
  268. package/lib-cjs/component/elements/NextPrev.js +1 -1
  269. package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
  270. package/lib-cjs/component/elements/Select.js +6 -8
  271. package/lib-cjs/component/elements/Tab/Tab.js +1 -1
  272. package/lib-cjs/component/elements/Table/Table.js +2 -2
  273. package/lib-cjs/component/elements/ToggleButton.js +3 -2
  274. package/lib-cjs/component/elements/accordion/AccordionItem.js +2 -2
  275. package/lib-cjs/component/elements/formik/FormikOnChange.js +10 -4
  276. package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  277. package/lib-cjs/component/elements/resizer/DivResizer.js +3 -3
  278. package/lib-cjs/component/elements/resizer/SVGResizer.js +2 -2
  279. package/lib-cjs/component/header/ApodizationOptionsPanel.js +110 -0
  280. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +39 -35
  281. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +82 -49
  282. package/lib-cjs/component/header/Header.js +5 -2
  283. package/lib-cjs/component/header/HeaderContainer.js +14 -0
  284. package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +26 -28
  285. package/lib-cjs/component/header/RangesPickingOptionPanel.js +19 -21
  286. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +70 -44
  287. package/lib-cjs/component/header/Zones2DOptionPanel.js +11 -13
  288. package/lib-cjs/component/highlight/index.js +20 -18
  289. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +31 -1
  290. package/lib-cjs/component/hooks/useFilter.js +14 -0
  291. package/lib-cjs/component/hooks/useToolsFunctions.js +1 -1
  292. package/lib-cjs/component/loader/DropZone.js +1 -1
  293. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
  294. package/lib-cjs/component/modal/EditPeakShapeModal.js +113 -0
  295. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +2 -3
  296. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
  297. package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
  298. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +9 -11
  299. package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
  300. package/lib-cjs/component/modal/editRange/EditRangeModal.js +2 -2
  301. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +3 -8
  302. package/lib-cjs/component/modal/setting/DatabasesTabContent.js +2 -2
  303. package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
  304. package/lib-cjs/component/modal/setting/FormattingTabContent.js +2 -2
  305. package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -1
  306. package/lib-cjs/component/modal/setting/ToolsTabContent.js +13 -13
  307. package/lib-cjs/component/modal/setting/WorkspaceItem.js +2 -2
  308. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
  309. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
  310. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -9
  311. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
  312. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +11 -3
  313. package/lib-cjs/component/panels/Panels.js +3 -3
  314. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +45 -20
  315. package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
  316. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +42 -11
  317. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +1 -1
  318. package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +3 -3
  319. package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
  320. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -1
  321. package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +3 -6
  322. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
  323. package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
  324. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
  325. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
  326. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
  327. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +1 -2
  328. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
  329. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +4 -12
  330. package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +2 -2
  331. package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -1
  332. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
  333. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +3 -12
  334. package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
  335. package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -2
  336. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +15 -3
  337. package/lib-cjs/component/reducer/IgnoreActions.js +4 -0
  338. package/lib-cjs/component/reducer/Reducer.js +25 -8
  339. package/lib-cjs/component/reducer/actions/FiltersActions.js +170 -29
  340. package/lib-cjs/component/reducer/actions/IntegralsActions.js +2 -2
  341. package/lib-cjs/component/reducer/actions/MoleculeActions.js +27 -14
  342. package/lib-cjs/component/reducer/actions/PeaksActions.js +40 -4
  343. package/lib-cjs/component/reducer/actions/RangesActions.js +2 -2
  344. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +1 -1
  345. package/lib-cjs/component/reducer/actions/ToolsActions.js +8 -71
  346. package/lib-cjs/component/reducer/helper/getStrongestPeak.js +18 -0
  347. package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -5
  348. package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
  349. package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -1
  350. package/lib-cjs/component/reducer/types/Types.js +10 -3
  351. package/lib-cjs/component/tool/BrushX.js +1 -1
  352. package/lib-cjs/component/tool/BrushXY.js +4 -3
  353. package/lib-cjs/component/tool/CrossLinePointer.js +5 -4
  354. package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +12 -4
  355. package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +13 -6
  356. package/lib-cjs/component/toolbar/BasicToolBar.js +3 -8
  357. package/lib-cjs/component/toolbar/FunctionToolBar.js +10 -22
  358. package/lib-cjs/component/toolbar/ToolTypes.js +119 -9
  359. package/lib-cjs/component/utility/util/nmredata/addZones.js +3 -6
  360. package/lib-cjs/component/workspaces/basic.js +12 -11
  361. package/lib-cjs/component/workspaces/embedded.js +14 -13
  362. package/lib-cjs/component/workspaces/exercise.js +4 -6
  363. package/lib-cjs/component/workspaces/prediction.js +14 -13
  364. package/lib-cjs/component/workspaces/process1D.js +20 -19
  365. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +14 -15
  366. package/lib-cjs/constants.js +1 -1
  367. package/lib-cjs/data/Filters.js +3 -3
  368. package/lib-cjs/data/FiltersManager.js +3 -6
  369. package/lib-cjs/data/PredictionManager.js +15 -15
  370. package/lib-cjs/data/SpectraManager.js +2 -8
  371. package/lib-cjs/data/constants/SignalsKinds.js +0 -8
  372. package/lib-cjs/data/data1d/Data1DManager.js +5 -5
  373. package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +18 -12
  374. package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +2 -5
  375. package/lib-cjs/data/data1d/Spectrum1D/index.js +3 -1
  376. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
  377. package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
  378. package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +4 -2
  379. package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -19
  380. package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +28 -0
  381. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
  382. package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +1 -0
  383. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
  384. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -5
  385. package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -6
  386. package/lib-cjs/data/data1d/database.js +4 -6
  387. package/lib-cjs/data/data1d/filter1d/apodization.js +70 -0
  388. package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +11 -18
  389. package/lib-cjs/data/data1d/filter1d/zeroFillingAndApodization.js +30 -0
  390. package/lib-cjs/data/data2d/Processing2D.js +3 -2
  391. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -6
  392. package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +3 -6
  393. package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -6
  394. package/lib-cjs/data/migration/MigrationManager.js +3 -1
  395. package/lib-cjs/data/migration/migrateToVersion3.js +58 -0
  396. package/lib-cjs/data/molecules/Molecule.js +5 -8
  397. package/lib-cjs/data/molecules/MoleculeManager.js +5 -5
  398. package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +0 -1
  399. package/lib-cjs/data/utilities/isInRange.js +7 -0
  400. package/lib-cjs/versionInfo.js +1 -1
  401. package/package.json +32 -31
  402. package/lib/component/1d/PeakAnnotations.js +0 -41
  403. package/lib/data/data1d/filter1d/lineBroadening.d.ts +0 -14
  404. package/lib/data/data1d/filter1d/lineBroadening.js +0 -57
  405. package/lib/data/utilities/generateID.d.ts +0 -1
  406. package/lib/data/utilities/generateID.js +0 -9
  407. package/lib-cjs/component/1d/PeakAnnotations.js +0 -46
  408. package/lib-cjs/data/data1d/filter1d/lineBroadening.js +0 -63
  409. package/lib-cjs/data/utilities/generateID.js +0 -12
@@ -1,6 +1,6 @@
1
- import { Molecule } from '../../data/molecules/Molecule';
1
+ import { StateMoleculeExtended } from '../../data/molecules/Molecule';
2
2
  interface MoleculeSelectionProps {
3
- molecules: Array<Molecule>;
3
+ molecules: Array<StateMoleculeExtended>;
4
4
  onChange: (element: number) => void;
5
5
  index?: number;
6
6
  }
@@ -73,5 +73,5 @@ export default function MoleculeSelection(props) {
73
73
  }, [onChange]);
74
74
  return (_jsxs("div", { children: [_jsx("div", { css: toolbarStyle, children: _jsxs("p", { children: [molecules &&
75
75
  molecules.length > 0 &&
76
- `${+(currentIndex + 1)} / ${molecules.length}`, ' '] }) }), _jsx("div", { css: moleculeContainerStyle, children: _jsx(NextPrev, { defaultIndex: currentIndex, onChange: onChangeHandler, children: molecules?.map((mol, index) => (_jsxs("div", { className: "slider", children: [_jsx("div", { children: mol.molfile && (_jsx(MolfileSvgRenderer, { id: `molSVG${index}`, width: 120, molfile: mol.molfile })) }), _jsxs("p", { children: [_jsx(MF, { mf: mol.mf }), " - ", mol.mw?.toFixed(2)] })] }, mol.key))) }) })] }));
76
+ `${+(currentIndex + 1)} / ${molecules.length}`, ' '] }) }), _jsx("div", { css: moleculeContainerStyle, children: _jsx(NextPrev, { defaultIndex: currentIndex, onChange: onChangeHandler, children: molecules?.map((mol, index) => (_jsxs("div", { className: "slider", children: [_jsx("div", { children: mol.molfile && (_jsx(MolfileSvgRenderer, { id: `molSVG${index}`, width: 120, molfile: mol.molfile })) }), _jsxs("p", { children: [_jsx(MF, { mf: mol.mf }), " - ", mol.mw?.toFixed(2)] })] }, mol.id))) }) })] }));
77
77
  }
@@ -8,7 +8,7 @@ function Arrow({ direction, onClick }) {
8
8
  return (_jsx("div", { onClick: onClick, css: css `
9
9
  display: flex;
10
10
  position: absolute;
11
- top: calc(50% - 20px);
11
+ top: 50%;
12
12
  ${direction === 'right' ? `right: 25px` : `left: 25px`};
13
13
  height: 40px;
14
14
  width: 40px;
@@ -1,12 +1,12 @@
1
1
  /** @jsxImportSource @emotion/react */
2
2
  /// <reference types="react" />
3
- import { HighlightedSource } from '../../../highlight/index';
3
+ import { HighlightEventSource } from '../../../highlight/index';
4
4
  export interface ClickEvent {
5
5
  onClick?: (event: Event, data: unknown) => void;
6
6
  }
7
7
  interface ReactTableRowProps extends ClickEvent {
8
8
  row: any;
9
- highlightedSource?: HighlightedSource;
9
+ highlightedSource?: HighlightEventSource;
10
10
  onContextMenu: () => void;
11
11
  isVisible: boolean;
12
12
  isRowActive: boolean;
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
4
  import { useMemo, forwardRef, useEffect, useCallback } from 'react';
5
- import { HighlightedSource, useHighlight } from '../../../highlight/index';
5
+ import { HighlightEventSource, useHighlight } from '../../../highlight/index';
6
6
  function highlightStyle(isActive, row) {
7
7
  if (isActive) {
8
8
  return { backgroundColor: '#ff6f0057' };
@@ -34,7 +34,7 @@ function getIDs(row) {
34
34
  return [''];
35
35
  }
36
36
  function ReactTableRow(props, ref) {
37
- const { row, highlightedSource = HighlightedSource.UNKNOWN, onContextMenu, onClick, isRowActive = false, } = props;
37
+ const { row, highlightedSource = HighlightEventSource.UNKNOWN, onContextMenu, onClick, isRowActive = false, } = props;
38
38
  const data = useMemo(() => ({
39
39
  type: highlightedSource,
40
40
  extra: row.original,
@@ -1,10 +1,10 @@
1
1
  /// <reference types="react" />
2
- import { HighlightedSource } from '../../highlight';
2
+ import { HighlightEventSource } from '../../highlight';
3
3
  import { ClickEvent } from './Elements/ReactTableRow';
4
4
  interface ReactTableProps extends ClickEvent {
5
5
  data: any;
6
6
  columns: any;
7
- highlightedSource?: HighlightedSource;
7
+ highlightedSource?: HighlightEventSource;
8
8
  context?: Array<{
9
9
  label: string;
10
10
  onClick: () => void;
@@ -1,17 +1,13 @@
1
1
  import { CSSProperties } from 'react';
2
- export interface SelectEntry {
3
- key: string | number;
4
- value: string | number;
5
- label: string | number;
6
- }
7
- export interface SelectProps {
8
- onChange?: (element: string) => void;
9
- data: Array<SelectEntry>;
2
+ export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'style' | 'onChange'> {
3
+ onChange?: (element: any) => void;
4
+ items: any[];
5
+ defaultValue?: string | number | undefined;
10
6
  style?: CSSProperties;
11
- defaultValue?: string | number;
12
- name?: string;
13
- className?: string;
14
7
  placeholder?: string;
8
+ itemValueField?: string;
9
+ itemTextField?: string;
10
+ returnValue?: boolean;
15
11
  }
16
12
  declare const Select: import("react").ForwardRefExoticComponent<SelectProps & import("react").RefAttributes<HTMLSelectElement>>;
17
13
  export default Select;
@@ -29,14 +29,12 @@ const styles = {
29
29
  `,
30
30
  };
31
31
  const Select = forwardRef(function Select(props, ref) {
32
- const { data, style = { width: 100 }, onChange = () => null, defaultValue = '', name = '', className = '', placeholder = '', } = props;
32
+ const { items, style = { width: 100 }, onChange = () => null, defaultValue, value, name = '', className = '', placeholder = '', itemValueField = 'value', itemTextField = 'label', returnValue = true, } = props;
33
33
  const handleOnChanged = useCallback((e) => {
34
- let value = e.target.value;
35
- if (!isNaN(value)) {
36
- value = Number(value);
37
- }
38
- onChange(value);
39
- }, [onChange]);
40
- return (_jsxs("select", { ref: ref, css: styles.select(style?.width), name: name, onChange: handleOnChanged, defaultValue: defaultValue, className: className, style: style, required: true, children: [placeholder && (_jsx("option", { value: "", disabled: true, children: placeholder })), data.map((d) => (_jsx("option", { value: d.value, children: d.label }, `${d.key}`)))] }));
34
+ const [option] = e.target.selectedOptions;
35
+ const selectedData = JSON.parse(option.dataset.value);
36
+ onChange(returnValue ? selectedData[itemValueField] : selectedData);
37
+ }, [itemValueField, onChange, returnValue]);
38
+ return (_jsxs("select", { ref: ref, css: styles.select(style?.width), name: name, onChange: handleOnChanged, defaultValue: defaultValue, value: value, className: className, style: style, required: true, children: [placeholder && (_jsx("option", { value: "", disabled: true, children: placeholder })), items.map((option) => (_jsx("option", { value: option[itemValueField], "data-value": JSON.stringify(option), children: option[itemTextField] }, JSON.stringify(option))))] }));
41
39
  });
42
40
  export default Select;
@@ -30,7 +30,7 @@ export function InternalTab({ tabid, tablabel, isActive, onClick = () => null, c
30
30
  e.stopPropagation();
31
31
  onDelete({ ...e, tablabel, tabid });
32
32
  }, [onDelete, tablabel, tabid]);
33
- return (_jsxs("li", { className: className, onClick: clickHandler, css: styles(tabstyles), "data-test-id": `tab-${tabid}`, children: [canDelete && _jsx(DeleteButton, { onDelete: deleteHandler }), render
33
+ return (_jsxs("li", { className: className, onClick: clickHandler, css: styles(tabstyles), children: [canDelete && _jsx(DeleteButton, { onDelete: deleteHandler }), render
34
34
  ? render({ isActive, title: tablabel || '', id: tabid })
35
35
  : tablabel] }));
36
36
  }
@@ -3,8 +3,7 @@ interface TableProps {
3
3
  children: ReactNode;
4
4
  className?: string;
5
5
  style?: CSSProperties;
6
- testID?: string;
7
6
  }
8
- declare function Table({ children, className, style, testID }: TableProps): JSX.Element;
7
+ declare function Table({ children, className, style }: TableProps): JSX.Element;
9
8
  declare const _default: import("react").MemoExoticComponent<typeof Table>;
10
9
  export default _default;
@@ -7,7 +7,7 @@ const styles = {
7
7
  display: 'flex',
8
8
  flexDirection: 'column',
9
9
  };
10
- function Table({ children, className, style, testID }) {
11
- return (_jsx("div", { className: className, style: { ...styles, ...style }, "data-test-id": testID, children: children }));
10
+ function Table({ children, className, style }) {
11
+ return (_jsx("div", { className: className, style: { ...styles, ...style }, children: children }));
12
12
  }
13
13
  export default memo(Table);
@@ -8,8 +8,7 @@ interface ToggleButtonProps {
8
8
  disabled?: boolean;
9
9
  children: ReactNode;
10
10
  className?: string;
11
- testID?: string;
12
11
  }
13
- declare function ToggleButton({ children, style, onClick, popupTitle, popupPlacement, defaultValue, disabled, className, testID, }: ToggleButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
12
+ declare function ToggleButton({ children, style, onClick, popupTitle, popupPlacement, defaultValue, disabled, className, }: ToggleButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
14
13
  declare const _default: import("react").MemoExoticComponent<typeof ToggleButton>;
15
14
  export default _default;
@@ -7,6 +7,7 @@ const styles = css `
7
7
  background-color: #f5f5f5;
8
8
  border: none;
9
9
  border-radius: 5px;
10
+ padding: 5px;
10
11
 
11
12
  &:hover {
12
13
  background-color: lightgray !important;
@@ -18,12 +19,12 @@ const styles = css `
18
19
  color: white;
19
20
  }
20
21
  `;
21
- function ToggleButton({ children, style = {}, onClick = () => null, popupTitle = '', popupPlacement = 'right', defaultValue = false, disabled = false, className = '', testID, }) {
22
+ function ToggleButton({ children, style = {}, onClick = () => null, popupTitle = '', popupPlacement = 'right', defaultValue = false, disabled = false, className = '', }) {
22
23
  const [flag, toggle] = useState(defaultValue);
23
24
  const toggleHandler = useCallback(() => {
24
25
  onClick(!flag);
25
26
  toggle(!flag);
26
27
  }, [onClick, flag]);
27
- return (_jsx(ToolTip, { title: popupTitle, popupPlacement: popupPlacement, children: _jsx("button", { "data-test-id": testID, disabled: disabled, css: styles, style: style, className: (flag ? 'toggle toggle-active ' : 'toggle ') + className, type: "button", onClick: toggleHandler, children: children }) }));
28
+ return (_jsx(ToolTip, { title: popupTitle, popupPlacement: popupPlacement, children: _jsx("button", { disabled: disabled, css: styles, style: style, className: (flag ? 'toggle toggle-active ' : 'toggle ') + className, type: "button", onClick: toggleHandler, children: children }) }));
28
29
  }
29
30
  export default memo(ToggleButton);
@@ -70,10 +70,10 @@ function AccordionItem({ title, children, index, isOpen, onOpen = () => null, st
70
70
  ...styles.container,
71
71
  flex: active == null ? 0 : '1 1 1px',
72
72
  transition: isOpen ? 'flex 0.2s ease' : '',
73
- }, className: "custom-accordion", children: [_jsx("button", { type: "button", style: styles.button, onClick: toggleAccordion, onDoubleClick: dbClickHandler, "data-test-id": `panel-title-${title}`, children: _jsx("p", { style: styles.buttonTitle, children: title }) }), _jsx("div", { ref: refContent, style: {
73
+ }, className: "custom-accordion", children: [_jsx("button", { type: "button", style: styles.button, onClick: toggleAccordion, onDoubleClick: dbClickHandler, children: _jsx("p", { style: styles.buttonTitle, children: title }) }), _jsx("div", { ref: refContent, style: {
74
74
  ...styles.content,
75
75
  maxHeight: active == null ? 0 : '100%',
76
76
  ...style,
77
- }, "data-test-id": `panel-content-${title}`, children: children })] }));
77
+ }, children: children })] }));
78
78
  }
79
79
  export default AccordionItem;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { NumberInputProps } from '../NumberInput';
3
3
  interface FormikNumberInputProps extends NumberInputProps {
4
- label: string;
4
+ label?: string;
5
5
  name: string;
6
6
  }
7
7
  declare function FormikNumberInput(props: FormikNumberInputProps): JSX.Element;
@@ -1,6 +1,7 @@
1
+ /// <reference types="react" />
1
2
  interface FormikOnChangeProps {
2
3
  onChange?: (any: any) => void;
3
4
  enableValidation?: boolean;
4
5
  }
5
- declare const FormikOnChange: (props: FormikOnChangeProps) => null;
6
- export default FormikOnChange;
6
+ declare const _default: import("react").MemoExoticComponent<(props: FormikOnChangeProps) => null>;
7
+ export default _default;
@@ -1,18 +1,24 @@
1
1
  import { useFormikContext } from 'formik';
2
- import { useEffect } from 'react';
2
+ import { useEffect, memo, useRef } from 'react';
3
3
  const FormikOnChange = (props) => {
4
4
  const { onChange = () => null, enableValidation = true } = props;
5
- const { values, errors } = useFormikContext();
5
+ const oldValuesRef = useRef({});
6
+ const { values, errors, submitForm, setTouched } = useFormikContext();
6
7
  useEffect(() => {
7
8
  if (enableValidation) {
8
- if (Object.keys(errors).length === 0) {
9
+ if (Object.keys(errors).length === 0 &&
10
+ JSON.stringify(oldValuesRef.current) !== JSON.stringify(values)) {
9
11
  onChange(values);
10
12
  }
13
+ else {
14
+ setTouched(errors);
15
+ }
11
16
  }
12
17
  else {
13
18
  onChange(values);
14
19
  }
15
- }, [values, enableValidation, errors, onChange]);
20
+ oldValuesRef.current = values;
21
+ }, [values, enableValidation, errors, onChange, submitForm, setTouched]);
16
22
  return null;
17
23
  };
18
- export default FormikOnChange;
24
+ export default memo(FormikOnChange);
@@ -6,7 +6,7 @@ const styles = css `
6
6
  display: block;
7
7
  border-radius: 5px;
8
8
  overflow: hidden;
9
- width: 300px;
9
+ width: 350px;
10
10
  border-top: 10px solid #ed0000;
11
11
 
12
12
  .message {
@@ -54,9 +54,9 @@ const styles = {
54
54
  },
55
55
  };
56
56
  export default function DivResizer(props) {
57
- const { children } = props;
57
+ const { children, disabled } = props;
58
58
  const { left, right, prevPosition, currentPosition, isActive } = useResizer(props);
59
- return (_jsxs(_Fragment, { children: [_jsx("div", { "data-no-export": "true", onMouseDown: right.onMouseDown, css: styles.container(right.position.value.x), children: _jsx("div", { style: anchorStyle }) }), _jsx("div", { css: styles.content(left, right, prevPosition), children: typeof children === 'function'
59
+ return (_jsxs(_Fragment, { children: [!disabled && (_jsx("div", { "data-no-export": "true", onMouseDown: right.onMouseDown, css: styles.container(right.position.value.x), children: _jsx("div", { style: anchorStyle }) })), _jsx("div", { css: styles.content(left, right, prevPosition), children: typeof children === 'function'
60
60
  ? children?.(currentPosition, isActive)
61
- : children }), _jsx("div", { "data-no-export": "true", onMouseDown: left.onMouseDown, css: styles.container(left.position.value.x), children: _jsx("div", { style: anchorStyle }) })] }));
61
+ : children }), !disabled && (_jsx("div", { "data-no-export": "true", onMouseDown: left.onMouseDown, css: styles.container(left.position.value.x), children: _jsx("div", { style: anchorStyle }) }))] }));
62
62
  }
@@ -14,6 +14,7 @@ export interface ResizerProps {
14
14
  tag?: 'div' | 'svg';
15
15
  parentElement?: HTMLElement | null;
16
16
  dragHandleClassName?: string;
17
+ disabled?: boolean;
17
18
  }
18
19
  declare type PositionChangeHandler = (data: Position) => void;
19
20
  export default function Resizer(props: ResizerProps): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
4
  import useResizer from './useResizer';
@@ -29,13 +29,13 @@ const styles = {
29
29
  `,
30
30
  };
31
31
  export default function SVGResizer(props) {
32
- const { children } = props;
32
+ const { children, disabled } = props;
33
33
  const { left, right, currentPosition, isActive } = useResizer(props);
34
34
  return (_jsxs("g", { style: {
35
35
  transform: `translateX(${currentPosition.x1}px)`,
36
36
  }, children: [typeof children === 'function'
37
37
  ? children(currentPosition, isActive)
38
- : children, _jsx(SVGResizerHandle, { onMouseDown: left.onMouseDown, position: 0 }), _jsx(SVGResizerHandle, { onMouseDown: right.onMouseDown, position: Math.ceil(currentPosition.x2 - currentPosition.x1) })] }));
38
+ : children, !disabled && (_jsxs(_Fragment, { children: [' ', _jsx(SVGResizerHandle, { onMouseDown: left.onMouseDown, position: 0 }), _jsx(SVGResizerHandle, { onMouseDown: right.onMouseDown, position: Math.ceil(currentPosition.x2 - currentPosition.x1) })] }))] }));
39
39
  }
40
40
  function SVGResizerHandle(props) {
41
41
  return (_jsxs("g", { onMouseDown: props.onMouseDown, css: styles.container, style: { transform: `translateX(${props.position}px)` }, "data-no-export": "true", children: [_jsx("rect", { x: "-5px", style: style.innerContainer }), _jsx("rect", { x: "-2.5px", style: style.anchor })] }));
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function ApodizationOptionsPanel(): JSX.Element;
@@ -0,0 +1,81 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef, memo } from 'react';
3
+ import * as Yup from 'yup';
4
+ import * as Filters from '../../data/Filters';
5
+ import { defaultApodizationOptions } from '../../data/data1d/filter1d/apodization';
6
+ import { useDispatch } from '../context/DispatchContext';
7
+ import ActionButtons from '../elements/ActionButtons';
8
+ import Label from '../elements/Label';
9
+ import FormikCheckBox from '../elements/formik/FormikCheckBox';
10
+ import FormikForm from '../elements/formik/FormikForm';
11
+ import FormikInput from '../elements/formik/FormikInput';
12
+ import FormikOnChange from '../elements/formik/FormikOnChange';
13
+ import { useFilter } from '../hooks/useFilter';
14
+ import { APPLY_APODIZATION_FILTER, CALCULATE_APODIZATION_FILTER, DISABLE_FILTER_LIVE_PREVIEW, RESET_SELECTED_TOOL, } from '../reducer/types/Types';
15
+ import { options } from '../toolbar/ToolTypes';
16
+ import { HeaderContainer } from './HeaderContainer';
17
+ const labelStyle = {
18
+ label: {
19
+ fontWeight: 'normal',
20
+ fontSize: '12px',
21
+ },
22
+ wrapper: {
23
+ paddingRight: '5px',
24
+ },
25
+ };
26
+ const inputStyle = {
27
+ input: { height: '24px', width: '60px' },
28
+ };
29
+ const validationSchema = Yup.object().shape({
30
+ lineBroadening: Yup.number().required(),
31
+ gaussBroadening: Yup.number().required(),
32
+ lineBroadeningCenter: Yup.number().required().min(0).max(1),
33
+ });
34
+ const initialValues = {
35
+ ...defaultApodizationOptions,
36
+ livePreview: true,
37
+ };
38
+ function ApodizationOptionsInnerPanel(props) {
39
+ const dispatch = useDispatch();
40
+ const formRef = useRef();
41
+ const handleApplyFilter = (values, triggerSource = 'apply') => {
42
+ const { livePreview, ...filterOptions } = values;
43
+ if (livePreview && triggerSource === 'onChange') {
44
+ dispatch({
45
+ type: CALCULATE_APODIZATION_FILTER,
46
+ payload: filterOptions,
47
+ });
48
+ }
49
+ else if (triggerSource === 'apply') {
50
+ dispatch({
51
+ type: APPLY_APODIZATION_FILTER,
52
+ payload: filterOptions,
53
+ });
54
+ }
55
+ };
56
+ const handleCancelFilter = () => {
57
+ dispatch({
58
+ type: RESET_SELECTED_TOOL,
59
+ });
60
+ };
61
+ useEffect(() => {
62
+ if (props.filter) {
63
+ formRef.current.setValues({ ...props.filter.value, livePreview: true });
64
+ }
65
+ }, [props?.filter]);
66
+ const disableLivePreviewHandler = (event) => {
67
+ //disable filter Live preview
68
+ if (!event.target.checked) {
69
+ dispatch({
70
+ type: DISABLE_FILTER_LIVE_PREVIEW,
71
+ payload: { selectedTool: options.apodization.id },
72
+ });
73
+ }
74
+ };
75
+ return (_jsxs(HeaderContainer, { children: [_jsxs(FormikForm, { ref: formRef, onSubmit: (values) => handleApplyFilter(values), initialValues: initialValues, validationSchema: validationSchema, children: [_jsx(Label, { title: "Line broadening : ", style: labelStyle, children: _jsx(FormikInput, { type: "number", name: "lineBroadening", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "Gauss broadening :", style: labelStyle, children: _jsx(FormikInput, { type: "number", name: "gaussBroadening", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "lineBroadeningCenter [0 - 1] : ", style: labelStyle, children: _jsx(FormikInput, { type: "number", name: "lineBroadeningCenter", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "live preview ", htmlFor: "livePreview", style: { label: { padding: '0 5px' } }, children: _jsx(FormikCheckBox, { name: "livePreview", onChange: disableLivePreviewHandler }) }), _jsx(FormikOnChange, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableValidation: true })] }), _jsx(ActionButtons, { onDone: () => formRef.current.submitForm(), onCancel: handleCancelFilter })] }));
76
+ }
77
+ const MemoziedApodizationPanel = memo(ApodizationOptionsInnerPanel);
78
+ export default function ApodizationOptionsPanel() {
79
+ const filter = useFilter(Filters.apodization.id);
80
+ return _jsx(MemoziedApodizationPanel, { filter: filter });
81
+ }
@@ -1,3 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  declare function AutoPeakPickingOptionPanel(): JSX.Element;
3
- export default AutoPeakPickingOptionPanel;
3
+ declare const _default: import("react").MemoExoticComponent<typeof AutoPeakPickingOptionPanel>;
4
+ export default _default;
@@ -1,56 +1,60 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback, useRef } from 'react';
2
+ import { memo, useCallback, useRef } from 'react';
3
3
  import { useDispatch } from '../context/DispatchContext';
4
4
  import Button from '../elements/Button';
5
- import CheckBox from '../elements/CheckBox';
6
- import NumberInput from '../elements/NumberInput';
5
+ import Label from '../elements/Label';
6
+ import FormikForm from '../elements/formik/FormikForm';
7
+ import FormikNumberInput from '../elements/formik/FormikNumberInput';
8
+ import FormikSelect from '../elements/formik/FormikSelect';
7
9
  import { AUTO_PEAK_PICKING } from '../reducer/types/Types';
8
- const styles = {
9
- container: {
10
- height: '100%',
11
- display: 'flex',
12
- fontSize: '12px',
13
- alignItems: 'center',
14
- },
10
+ import { HeaderContainer } from './HeaderContainer';
11
+ const inputStyle = {
15
12
  input: {
16
13
  width: '50px',
14
+ margin: '0px',
17
15
  },
18
16
  inputContainer: {
19
17
  flex: '2',
20
18
  },
19
+ };
20
+ const labelStyle = {
21
21
  label: {
22
- flex: '5',
22
+ fontWeight: 'normal',
23
+ fontSize: '12px',
24
+ },
25
+ wrapper: {
26
+ paddingRight: '5px',
27
+ },
28
+ };
29
+ const LookFor = [
30
+ {
31
+ label: 'Positive',
32
+ value: 'positive',
33
+ },
34
+ {
35
+ label: 'Negative',
36
+ value: 'negative',
37
+ },
38
+ {
39
+ label: 'Both',
40
+ value: 'both',
23
41
  },
42
+ ];
43
+ const INIT_VALUES = {
44
+ maxNumberOfPeaks: 50,
45
+ minMaxRatio: 0.1,
46
+ noiseFactor: 3,
47
+ direction: 'positive',
24
48
  };
25
49
  function AutoPeakPickingOptionPanel() {
26
50
  const dispatch = useDispatch();
27
- const minMaxRatioRef = useRef();
28
- const maxNumberOfPeaksRef = useRef();
29
- const noiseFactor = useRef();
30
- const lookNegativeRef = useRef();
31
- const handleApplyFilter = useCallback(() => {
51
+ const formRef = useRef();
52
+ const handleApplyFilter = useCallback((values) => {
32
53
  dispatch({
33
54
  type: AUTO_PEAK_PICKING,
34
- options: {
35
- maxNumberOfPeaks: maxNumberOfPeaksRef.current.value,
36
- minMaxRatio: minMaxRatioRef.current.value,
37
- noiseFactor: noiseFactor.current.value,
38
- lookNegative: lookNegativeRef.current.checked,
39
- },
55
+ options: values,
40
56
  });
41
57
  }, [dispatch]);
42
- return (_jsxs("div", { style: styles.container, children: [_jsx(NumberInput, { ref: maxNumberOfPeaksRef, label: "Max Number Of Peaks:", name: "maxNumberOfPeaks", style: {
43
- input: styles.input,
44
- inputContainer: styles.inputContainer,
45
- label: styles.label,
46
- }, defaultValue: 50 }), _jsx(NumberInput, { ref: noiseFactor, label: "Noise factor", name: "noiseFactor", style: {
47
- input: styles.input,
48
- inputContainer: styles.inputContainer,
49
- label: styles.label,
50
- }, defaultValue: 3 }), _jsx(NumberInput, { ref: minMaxRatioRef, label: "Min Max Ratio:", name: "minMaxRatio", style: {
51
- input: styles.input,
52
- inputContainer: styles.inputContainer,
53
- label: styles.label,
54
- }, defaultValue: 0.1, step: "0.01" }), _jsxs("div", { style: { justifyItems: 'baseline', marginRight: '3px' }, children: [_jsx("label", { style: { marginRight: '2px', lineHeight: 2, userSelect: 'none' }, htmlFor: "lookNegative", children: "Detect Negative:" }), _jsx(CheckBox, { name: "lookNegative", ref: lookNegativeRef })] }), _jsx(Button.Done, { onClick: handleApplyFilter, style: { margin: '0 10px' }, children: "Apply" })] }));
58
+ return (_jsxs(HeaderContainer, { children: [_jsxs(FormikForm, { ref: formRef, initialValues: INIT_VALUES, onSubmit: handleApplyFilter, children: [_jsx(Label, { title: "Direction : ", style: labelStyle, children: _jsx(FormikSelect, { name: "direction", items: LookFor, style: { marginLeft: 10, marginRight: 10 }, defaultValue: "positive" }) }), _jsx(Label, { title: "Max Number Of Peaks :", style: labelStyle, children: _jsx(FormikNumberInput, { name: "maxNumberOfPeaks", style: inputStyle }) }), _jsx(Label, { title: "Noise factor :", style: labelStyle, children: _jsx(FormikNumberInput, { name: "noiseFactor", style: inputStyle }) }), _jsx(Label, { title: "Min Max Ratio :", style: labelStyle, children: _jsx(FormikNumberInput, { name: "minMaxRatio", style: inputStyle, step: "0.01" }) })] }), _jsx(Button.Done, { onClick: () => formRef.current.handleSubmit(), style: { margin: '0 10px' }, children: "Apply" })] }));
55
59
  }
56
- export default AutoPeakPickingOptionPanel;
60
+ export default memo(AutoPeakPickingOptionPanel);
@@ -1,3 +1,2 @@
1
1
  /// <reference types="react" />
2
- declare function BaseLineCorrectionPanel(): JSX.Element;
3
- export default BaseLineCorrectionPanel;
2
+ export default function BaseLineCorrectionPanel(): JSX.Element;