nmrium 0.38.1 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (474) hide show
  1. package/lib/component/1d/ApodizationLine.js +27 -4
  2. package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
  3. package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
  4. package/lib/component/1d/FooterBanner.js +5 -5
  5. package/lib/component/1d/SpectraLegends.js +2 -3
  6. package/lib/component/1d/Viewer1D.js +1 -1
  7. package/lib/component/1d/integral/Integral.d.ts +1 -1
  8. package/lib/component/1d/integral/IntegralResizable.d.ts +1 -1
  9. package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
  10. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
  11. package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
  12. package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -1
  13. package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
  14. package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +1 -1
  15. package/lib/component/1d/peaks/usePeakShapesPath.d.ts +2 -1
  16. package/lib/component/1d/ranges/Range.d.ts +1 -1
  17. package/lib/component/1d/tool/PeakPointer.js +6 -6
  18. package/lib/component/1d/tool/XLabelPointer.js +5 -5
  19. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -1
  20. package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
  21. package/lib/component/1d-2d/tools/BrushX.js +2 -3
  22. package/lib/component/1d-2d/tools/BrushXY.js +2 -3
  23. package/lib/component/1d-2d/tools/CrossLinePointer.js +4 -5
  24. package/lib/component/2d/Chart2D.js +4 -4
  25. package/lib/component/2d/FooterBanner.js +5 -5
  26. package/lib/component/2d/Viewer2D.js +1 -1
  27. package/lib/component/2d/tools/XYLabelPointer.js +5 -5
  28. package/lib/component/2d/zones/Signal.d.ts +1 -1
  29. package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
  30. package/lib/component/2d/zones/Zone.d.ts +1 -1
  31. package/lib/component/EventsTrackers/BrushTracker.d.ts +20 -12
  32. package/lib/component/EventsTrackers/BrushTracker.js +35 -22
  33. package/lib/component/EventsTrackers/KeysListenerTracker.js +90 -67
  34. package/lib/component/EventsTrackers/MouseTracker.d.ts +6 -2
  35. package/lib/component/EventsTrackers/MouseTracker.js +4 -1
  36. package/lib/component/NMRium.d.ts +5 -5
  37. package/lib/component/NMRium.js +15 -16
  38. package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
  39. package/lib/component/context/LoggerContext.js +5 -0
  40. package/lib/component/context/PreferencesContext.d.ts +10 -8
  41. package/lib/component/elements/Button.d.ts +13 -11
  42. package/lib/component/elements/Button.js +16 -25
  43. package/lib/component/elements/ColorInput.d.ts +0 -1
  44. package/lib/component/elements/ColorInput.js +2 -2
  45. package/lib/component/elements/EditableColumn.js +5 -2
  46. package/lib/component/elements/Input.js +2 -4
  47. package/lib/component/elements/Label.d.ts +1 -0
  48. package/lib/component/elements/Label.js +2 -2
  49. package/lib/component/elements/MolecularFormulaInput.d.ts +2 -2
  50. package/lib/component/elements/MolecularFormulaInput.js +15 -18
  51. package/lib/component/elements/NextPrev.d.ts +5 -3
  52. package/lib/component/elements/NextPrev.js +26 -8
  53. package/lib/component/elements/NumberInput.js +2 -2
  54. package/lib/component/elements/ReactTable/ReactTable.js +4 -4
  55. package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
  56. package/lib/component/elements/formik/FormikCheckBox.js +2 -2
  57. package/lib/component/elements/formik/FormikColumnFormatField.d.ts +4 -0
  58. package/lib/component/elements/formik/FormikColumnFormatField.js +19 -16
  59. package/lib/component/elements/formik/FormikError.d.ts +8 -0
  60. package/lib/component/elements/formik/FormikError.js +22 -0
  61. package/lib/component/elements/formik/FormikInput.js +10 -6
  62. package/lib/component/elements/formik/FormikSelect.js +1 -1
  63. package/lib/component/header/ApodizationOptionsPanel.js +4 -3
  64. package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -7
  65. package/lib/component/header/BaseLineCorrectionPanel.js +5 -2
  66. package/lib/component/header/PhaseCorrectionPanel.js +5 -2
  67. package/lib/component/header/RangesPickingOptionPanel.js +15 -7
  68. package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
  69. package/lib/component/highlight/index.d.ts +1 -1
  70. package/lib/component/hooks/useActiveSpectra.d.ts +1 -1
  71. package/lib/component/hooks/useActiveSpectrum.d.ts +1 -1
  72. package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts +1 -1
  73. package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +2 -0
  74. package/lib/component/hooks/useCheckPointsNumberInWindowArea.js +17 -0
  75. package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -2
  76. package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +3 -2
  77. package/lib/component/hooks/useExport.js +1 -1
  78. package/lib/component/hooks/useFilter.d.ts +2 -1
  79. package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
  80. package/lib/component/hooks/usePanelPreferences.js +4 -0
  81. package/lib/component/hooks/useSaveSettings.d.ts +1 -1
  82. package/lib/component/hooks/useSaveSettings.js +17 -15
  83. package/lib/component/hooks/useVerticalAlign.d.ts +1 -1
  84. package/lib/component/loader/DropZone.js +1 -2
  85. package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
  86. package/lib/component/modal/LoadJCAMPModal.d.ts +3 -3
  87. package/lib/component/modal/LoadJCAMPModal.js +56 -74
  88. package/lib/component/modal/ModalStyle.js +0 -10
  89. package/lib/component/modal/MoleculeStructureEditorModal.d.ts +2 -1
  90. package/lib/component/modal/MoleculeStructureEditorModal.js +12 -6
  91. package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
  92. package/lib/component/modal/PredictSpectraModal.d.ts +4 -2
  93. package/lib/component/modal/PredictSpectraModal.js +53 -105
  94. package/lib/component/modal/SaveAsModal.d.ts +2 -0
  95. package/lib/component/modal/SaveAsModal.js +21 -14
  96. package/lib/component/modal/changeSum/ChangeSumModal.js +25 -38
  97. package/lib/component/modal/editRange/EditRangeModal.d.ts +7 -6
  98. package/lib/component/modal/editRange/EditRangeModal.js +33 -13
  99. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +1 -1
  100. package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -0
  101. package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -2
  102. package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -5
  103. package/lib/component/modal/setting/GeneralSettings.js +2 -7
  104. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
  105. package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
  106. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
  107. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -15
  108. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
  109. package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +1 -11
  110. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +20 -25
  111. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +6 -11
  112. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +71 -81
  113. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
  114. package/lib/component/panels/MoleculesPanel/Utilities.js +3 -1
  115. package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
  116. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  117. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
  118. package/lib/component/panels/Panels.js +2 -2
  119. package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +1 -1
  120. package/lib/component/panels/RangesPanel/RangesHeader.js +39 -53
  121. package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
  122. package/lib/component/panels/RangesPanel/RangesPreferences.js +7 -22
  123. package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
  124. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
  125. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
  126. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
  127. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +9 -12
  128. package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
  129. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
  130. package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
  131. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -2
  132. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
  133. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
  134. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
  135. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +1 -1
  136. package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
  137. package/lib/component/panels/databasePanel/DatabasePanel.js +5 -24
  138. package/lib/component/panels/databasePanel/DatabasePreferences.js +2 -2
  139. package/lib/component/panels/header/DefaultPanelHeader.d.ts +2 -3
  140. package/lib/component/panels/header/DefaultPanelHeader.js +18 -26
  141. package/lib/component/panels/header/PanelHeader.d.ts +7 -0
  142. package/lib/component/panels/header/PanelHeader.js +12 -0
  143. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +9 -0
  144. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +94 -0
  145. package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -1
  146. package/lib/component/panels/predictionPanel/PredictionPanel.js +109 -37
  147. package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +3 -0
  148. package/lib/component/panels/predictionPanel/PredictionPreferences.js +24 -0
  149. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.d.ts +2 -0
  150. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +44 -0
  151. package/lib/component/reducer/Reducer.d.ts +5 -87
  152. package/lib/component/reducer/Reducer.js +1 -29
  153. package/lib/component/reducer/actions/DatabaseActions.js +6 -4
  154. package/lib/component/reducer/actions/DomainActions.js +3 -0
  155. package/lib/component/reducer/actions/FiltersActions.d.ts +1 -2
  156. package/lib/component/reducer/actions/FiltersActions.js +47 -52
  157. package/lib/component/reducer/actions/HistoryActions.d.ts +4 -0
  158. package/lib/component/reducer/actions/HistoryActions.js +40 -0
  159. package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
  160. package/lib/component/reducer/actions/IntegralsActions.js +3 -1
  161. package/lib/component/reducer/actions/LoadActions.d.ts +1 -2
  162. package/lib/component/reducer/actions/LoadActions.js +1 -1
  163. package/lib/component/reducer/actions/MoleculeActions.d.ts +7 -4
  164. package/lib/component/reducer/actions/MoleculeActions.js +57 -28
  165. package/lib/component/reducer/actions/PeaksActions.d.ts +1 -2
  166. package/lib/component/reducer/actions/PeaksActions.js +3 -3
  167. package/lib/component/reducer/actions/RangesActions.d.ts +4 -5
  168. package/lib/component/reducer/actions/RangesActions.js +5 -27
  169. package/lib/component/reducer/actions/SpectrumsActions.js +8 -8
  170. package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
  171. package/lib/component/reducer/actions/ToolsActions.js +3 -32
  172. package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
  173. package/lib/component/reducer/actions/ZonesActions.js +3 -6
  174. package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +8 -0
  175. package/lib/component/reducer/helper/ZoomHistoryManager.js +35 -0
  176. package/lib/component/reducer/helper/getActiveSpectra.d.ts +1 -1
  177. package/lib/component/reducer/helper/getActiveSpectrum.d.ts +1 -1
  178. package/lib/component/reducer/helper/getVerticalAlign.d.ts +1 -1
  179. package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
  180. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +1 -1
  181. package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -3
  182. package/lib/component/reducer/preferences/utilities/getActiveWorkspace.d.ts +1 -1
  183. package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +2 -3
  184. package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +1 -1
  185. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -1
  186. package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +1 -1
  187. package/lib/component/toolbar/BasicToolBar.js +6 -11
  188. package/lib/component/toolbar/ToolTypes.d.ts +2 -2
  189. package/lib/component/toolbar/ToolTypes.js +1 -1
  190. package/lib/component/workspaces/assignment.d.ts +1 -1
  191. package/lib/component/workspaces/basic.d.ts +1 -1
  192. package/lib/component/workspaces/embedded.d.ts +1 -1
  193. package/lib/component/workspaces/exercise.d.ts +1 -1
  194. package/lib/component/workspaces/index.d.ts +6 -6
  195. package/lib/component/workspaces/prediction.d.ts +1 -1
  196. package/lib/component/workspaces/prediction.js +193 -0
  197. package/lib/component/workspaces/process1D.d.ts +1 -1
  198. package/lib/component/workspaces/workspaceDefaultProperties.d.ts +1 -1
  199. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
  200. package/lib/data/PredictionManager.d.ts +3 -1
  201. package/lib/data/PredictionManager.js +43 -3
  202. package/lib/data/SpectraManager.d.ts +1 -2
  203. package/lib/data/constants/DefaultApodizationOptions.d.ts +2 -0
  204. package/lib/data/constants/DefaultApodizationOptions.js +5 -0
  205. package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -1
  206. package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -2
  207. package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
  208. package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.d.ts +1 -2
  209. package/lib/data/data1d/Spectrum1D/index.d.ts +1 -5
  210. package/lib/data/data1d/Spectrum1D/index.js +1 -5
  211. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
  212. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +3 -2
  213. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +1 -1
  214. package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +1 -1
  215. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -1
  216. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
  217. package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -2
  218. package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +1 -1
  219. package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +2 -2
  220. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +2 -1
  221. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
  222. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +7 -7
  223. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -24
  224. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -1
  225. package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -1
  226. package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
  227. package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
  228. package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
  229. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -2
  230. package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +13 -6
  231. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +1 -1
  232. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +23 -18
  233. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +37 -2
  234. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +1 -1
  235. package/lib/data/data1d/database.js +2 -4
  236. package/lib/data/data1d/multipleSpectraAnalysis.d.ts +3 -30
  237. package/lib/data/data1d/multipleSpectraAnalysis.js +4 -15
  238. package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +3 -2
  239. package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
  240. package/lib/data/data2d/Spectrum2D/getSlice.d.ts +1 -1
  241. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  242. package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
  243. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -1
  244. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +3 -2
  245. package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -1
  246. package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +3 -2
  247. package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
  248. package/lib/data/types/data1d/ComplexData1D.d.ts +2 -2
  249. package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
  250. package/lib/data/utilities/FindUtilities.d.ts +2 -1
  251. package/lib/data/utilities/RangeUtilities.d.ts +1 -1
  252. package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
  253. package/lib/data/utilities/calculateSanPlot.d.ts +2 -2
  254. package/lib/types/NMRiumDataReturn.d.ts +1 -3
  255. package/lib/versionInfo.js +1 -1
  256. package/lib-cjs/component/1d/ApodizationLine.js +28 -5
  257. package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +3 -26
  258. package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +5 -28
  259. package/lib-cjs/component/1d/FooterBanner.js +2 -2
  260. package/lib-cjs/component/1d/SpectraLegends.js +1 -2
  261. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
  262. package/lib-cjs/component/1d/tool/PeakPointer.js +3 -3
  263. package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
  264. package/lib-cjs/component/1d-2d/tools/BrushX.js +1 -2
  265. package/lib-cjs/component/1d-2d/tools/BrushXY.js +1 -2
  266. package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +2 -3
  267. package/lib-cjs/component/2d/Chart2D.js +4 -4
  268. package/lib-cjs/component/2d/FooterBanner.js +2 -2
  269. package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
  270. package/lib-cjs/component/EventsTrackers/BrushTracker.js +36 -22
  271. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +90 -67
  272. package/lib-cjs/component/EventsTrackers/MouseTracker.js +4 -1
  273. package/lib-cjs/component/NMRium.js +12 -13
  274. package/lib-cjs/component/context/LoggerContext.js +5 -0
  275. package/lib-cjs/component/elements/Button.js +16 -25
  276. package/lib-cjs/component/elements/ColorInput.js +2 -2
  277. package/lib-cjs/component/elements/EditableColumn.js +5 -2
  278. package/lib-cjs/component/elements/Input.js +2 -4
  279. package/lib-cjs/component/elements/Label.js +2 -2
  280. package/lib-cjs/component/elements/MolecularFormulaInput.js +14 -16
  281. package/lib-cjs/component/elements/NextPrev.js +26 -8
  282. package/lib-cjs/component/elements/NumberInput.js +2 -2
  283. package/lib-cjs/component/elements/ReactTable/ReactTable.js +4 -4
  284. package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
  285. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +20 -16
  286. package/lib-cjs/component/elements/formik/FormikError.js +27 -0
  287. package/lib-cjs/component/elements/formik/FormikInput.js +10 -6
  288. package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
  289. package/lib-cjs/component/header/ApodizationOptionsPanel.js +6 -5
  290. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +15 -6
  291. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
  292. package/lib-cjs/component/header/PhaseCorrectionPanel.js +6 -26
  293. package/lib-cjs/component/header/RangesPickingOptionPanel.js +15 -7
  294. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -25
  295. package/lib-cjs/component/hooks/useCheckPointsNumberInWindowArea.js +24 -0
  296. package/lib-cjs/component/hooks/useExport.js +1 -1
  297. package/lib-cjs/component/hooks/usePanelPreferences.js +4 -0
  298. package/lib-cjs/component/hooks/useSaveSettings.js +16 -14
  299. package/lib-cjs/component/loader/DropZone.js +1 -2
  300. package/lib-cjs/component/modal/LoadJCAMPModal.js +81 -75
  301. package/lib-cjs/component/modal/ModalStyle.js +0 -10
  302. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +12 -6
  303. package/lib-cjs/component/modal/PredictSpectraModal.js +53 -126
  304. package/lib-cjs/component/modal/SaveAsModal.js +22 -14
  305. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +24 -37
  306. package/lib-cjs/component/modal/editRange/EditRangeModal.js +32 -12
  307. package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -0
  308. package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
  309. package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -7
  310. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +6 -14
  311. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
  312. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +19 -24
  313. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +76 -86
  314. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +3 -1
  315. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
  316. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  317. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
  318. package/lib-cjs/component/panels/Panels.js +2 -2
  319. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +38 -52
  320. package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
  321. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +9 -12
  322. package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
  323. package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
  324. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
  325. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
  326. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -24
  327. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +25 -2
  328. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +18 -26
  329. package/lib-cjs/component/panels/header/PanelHeader.js +15 -0
  330. package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +122 -0
  331. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +109 -37
  332. package/lib-cjs/component/panels/predictionPanel/PredictionPreferences.js +29 -0
  333. package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +72 -0
  334. package/lib-cjs/component/reducer/Reducer.js +2 -31
  335. package/lib-cjs/component/reducer/actions/DatabaseActions.js +6 -4
  336. package/lib-cjs/component/reducer/actions/DomainActions.js +3 -0
  337. package/lib-cjs/component/reducer/actions/FiltersActions.js +66 -94
  338. package/lib-cjs/component/reducer/actions/HistoryActions.js +45 -0
  339. package/lib-cjs/component/reducer/actions/IntegralsActions.js +3 -1
  340. package/lib-cjs/component/reducer/actions/MoleculeActions.js +58 -32
  341. package/lib-cjs/component/reducer/actions/PeaksActions.js +3 -3
  342. package/lib-cjs/component/reducer/actions/RangesActions.js +7 -52
  343. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +10 -33
  344. package/lib-cjs/component/reducer/actions/ToolsActions.js +26 -32
  345. package/lib-cjs/component/reducer/actions/ZonesActions.js +6 -32
  346. package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +37 -0
  347. package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -2
  348. package/lib-cjs/component/toolbar/BasicToolBar.js +5 -10
  349. package/lib-cjs/component/toolbar/ToolTypes.js +9 -32
  350. package/lib-cjs/component/workspaces/prediction.js +193 -0
  351. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +21 -44
  352. package/lib-cjs/data/PredictionManager.js +43 -3
  353. package/lib-cjs/data/constants/DefaultApodizationOptions.js +8 -0
  354. package/lib-cjs/data/data1d/Spectrum1D/index.js +7 -11
  355. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -32
  356. package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
  357. package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
  358. package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
  359. package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
  360. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +7 -26
  361. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
  362. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
  363. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +3 -4
  364. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +13 -6
  365. package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +23 -18
  366. package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
  367. package/lib-cjs/data/data1d/database.js +2 -4
  368. package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +5 -16
  369. package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -26
  370. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +2 -25
  371. package/lib-cjs/versionInfo.js +1 -1
  372. package/package.json +29 -29
  373. package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +0 -7
  374. package/lib/component/panels/predictionPanel/PredictionOptions.js +0 -74
  375. package/lib/component/workspaces/Workspace.d.ts +0 -188
  376. package/lib/component/workspaces/Workspace.js +0 -1
  377. package/lib/data/Filters.d.ts +0 -12
  378. package/lib/data/Filters.js +0 -12
  379. package/lib/data/FiltersManager.d.ts +0 -30
  380. package/lib/data/FiltersManager.js +0 -175
  381. package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +0 -2
  382. package/lib/data/data1d/Spectrum1D/getShiftX.js +0 -6
  383. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +0 -2
  384. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -4
  385. package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +0 -7
  386. package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -9
  387. package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +0 -12
  388. package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -36
  389. package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +0 -2
  390. package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -6
  391. package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +0 -2
  392. package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -5
  393. package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +0 -2
  394. package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -26
  395. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +0 -3
  396. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -45
  397. package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +0 -2
  398. package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -7
  399. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +0 -4
  400. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -78
  401. package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +0 -2
  402. package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -9
  403. package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +0 -2
  404. package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -5
  405. package/lib/data/data1d/filter1d/apodization.d.ts +0 -27
  406. package/lib/data/data1d/filter1d/apodization.js +0 -81
  407. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +0 -33
  408. package/lib/data/data1d/filter1d/baselineCorrection.js +0 -51
  409. package/lib/data/data1d/filter1d/digitalFilter.d.ts +0 -20
  410. package/lib/data/data1d/filter1d/digitalFilter.js +0 -44
  411. package/lib/data/data1d/filter1d/equallySpaced.d.ts +0 -33
  412. package/lib/data/data1d/filter1d/equallySpaced.js +0 -52
  413. package/lib/data/data1d/filter1d/exclusionZones.d.ts +0 -15
  414. package/lib/data/data1d/filter1d/exclusionZones.js +0 -32
  415. package/lib/data/data1d/filter1d/fft.d.ts +0 -18
  416. package/lib/data/data1d/filter1d/fft.js +0 -90
  417. package/lib/data/data1d/filter1d/phaseCorrection.d.ts +0 -26
  418. package/lib/data/data1d/filter1d/phaseCorrection.js +0 -64
  419. package/lib/data/data1d/filter1d/shiftX.d.ts +0 -20
  420. package/lib/data/data1d/filter1d/shiftX.js +0 -26
  421. package/lib/data/data1d/filter1d/signalProcessing.d.ts +0 -26
  422. package/lib/data/data1d/filter1d/signalProcessing.js +0 -65
  423. package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +0 -2
  424. package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -35
  425. package/lib/data/data1d/filter1d/zeroFilling.d.ts +0 -22
  426. package/lib/data/data1d/filter1d/zeroFilling.js +0 -60
  427. package/lib/data/data2d/filter2d/shiftX.d.ts +0 -18
  428. package/lib/data/data2d/filter2d/shiftX.js +0 -27
  429. package/lib/data/data2d/filter2d/shiftY.d.ts +0 -18
  430. package/lib/data/data2d/filter2d/shiftY.js +0 -27
  431. package/lib/data/types/view-state/PeaksViewState.d.ts +0 -17
  432. package/lib/data/types/view-state/PeaksViewState.js +0 -1
  433. package/lib/types/NMRiumGeneralPreferences.d.ts +0 -7
  434. package/lib/types/NMRiumGeneralPreferences.js +0 -1
  435. package/lib/types/NMRiumPanelPreferences.d.ts +0 -17
  436. package/lib/types/NMRiumPanelPreferences.js +0 -1
  437. package/lib/types/NMRiumToolBarPreferences.d.ts +0 -22
  438. package/lib/types/NMRiumToolBarPreferences.js +0 -1
  439. package/lib/types/PanelPreferencesType.d.ts +0 -4
  440. package/lib/types/PanelPreferencesType.js +0 -1
  441. package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +0 -102
  442. package/lib-cjs/component/workspaces/Workspace.js +0 -2
  443. package/lib-cjs/data/Filters.js +0 -38
  444. package/lib-cjs/data/FiltersManager.js +0 -206
  445. package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +0 -33
  446. package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -8
  447. package/lib-cjs/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -13
  448. package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -40
  449. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -10
  450. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -9
  451. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -30
  452. package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -49
  453. package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -11
  454. package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -82
  455. package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -13
  456. package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -9
  457. package/lib-cjs/data/data1d/filter1d/apodization.js +0 -88
  458. package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +0 -60
  459. package/lib-cjs/data/data1d/filter1d/digitalFilter.js +0 -50
  460. package/lib-cjs/data/data1d/filter1d/equallySpaced.js +0 -61
  461. package/lib-cjs/data/data1d/filter1d/exclusionZones.js +0 -38
  462. package/lib-cjs/data/data1d/filter1d/fft.js +0 -96
  463. package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +0 -70
  464. package/lib-cjs/data/data1d/filter1d/shiftX.js +0 -32
  465. package/lib-cjs/data/data1d/filter1d/signalProcessing.js +0 -95
  466. package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -39
  467. package/lib-cjs/data/data1d/filter1d/zeroFilling.js +0 -66
  468. package/lib-cjs/data/data2d/filter2d/shiftX.js +0 -33
  469. package/lib-cjs/data/data2d/filter2d/shiftY.js +0 -33
  470. package/lib-cjs/data/types/view-state/PeaksViewState.js +0 -2
  471. package/lib-cjs/types/NMRiumGeneralPreferences.js +0 -2
  472. package/lib-cjs/types/NMRiumPanelPreferences.js +0 -2
  473. package/lib-cjs/types/NMRiumToolBarPreferences.js +0 -2
  474. package/lib-cjs/types/PanelPreferencesType.js +0 -2
@@ -109,14 +109,17 @@ const defaultData = {
109
109
  spectra: [],
110
110
  };
111
111
  const NMRium = (0, react_2.forwardRef)(function NMRium(props, ref) {
112
- const { onError, ...otherProps } = props;
113
- return ((0, jsx_runtime_1.jsx)(ui_1.RootLayout, { style: { width: '100%' }, children: (0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ErrorOverlay_1.default, onError: onError, children: (0, jsx_runtime_1.jsx)(InnerNMRium, { ...otherProps, innerRef: ref }) }) }));
112
+ const { noErrorBoundary = false, onError, ...otherProps } = props;
113
+ const innerNmrium = (0, jsx_runtime_1.jsx)(InnerNMRium, { ...otherProps, innerRef: ref });
114
+ const children = noErrorBoundary ? (innerNmrium) : ((0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ErrorOverlay_1.default, onError: onError, children: innerNmrium }));
115
+ return (0, jsx_runtime_1.jsx)(ui_1.RootLayout, { style: { width: '100%' }, children: children });
114
116
  });
115
117
  function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces, preferences, getSpinner = SpinnerContext_1.defaultGetSpinner, onChange, emptyText, innerRef, }) {
116
118
  const rootRef = (0, react_2.useRef)(null);
117
119
  const elementsWrapperRef = (0, react_2.useRef)(null);
118
120
  const viewerRef = (0, react_2.useRef)(null);
119
121
  const [show, , setOff, toggle] = (0, ui_1.useOnOff)(false);
122
+ const mainDivRef = (0, react_2.useRef)(null);
120
123
  const handleChange = (0, react_2.useRef)(onChange);
121
124
  (0, react_2.useEffect)(() => {
122
125
  handleChange.current = onChange;
@@ -154,9 +157,6 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
154
157
  // trigger onChange callback if settings changed
155
158
  handleChange.current?.(stateRef.current, 'settings');
156
159
  }, [preferencesState]);
157
- const dispatchMiddleWare = (0, react_2.useMemo)(() => {
158
- return (0, Reducer_1.dispatchMiddleware)(dispatch);
159
- }, []);
160
160
  (0, react_2.useEffect)(() => {
161
161
  rootRef.current?.focus();
162
162
  }, [isFullscreen]);
@@ -177,14 +177,14 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
177
177
  },
178
178
  }), []);
179
179
  (0, react_2.useEffect)(() => {
180
- dispatchMiddleWare({
180
+ dispatch({
181
181
  type: 'SET_LOADING_FLAG',
182
182
  payload: { isLoading: true },
183
183
  });
184
184
  if (dataProp) {
185
185
  void (0, nmr_load_save_1.readNMRiumObject)(dataProp)
186
186
  .then((nmriumState) => {
187
- dispatchMiddleWare({ type: 'INITIATE', payload: { nmriumState } });
187
+ dispatch({ type: 'INITIATE', payload: { nmriumState } });
188
188
  })
189
189
  .catch((error) => {
190
190
  dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
@@ -193,26 +193,25 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
193
193
  reportError(error);
194
194
  });
195
195
  }
196
- }, [dataProp, dispatchMiddleWare]);
196
+ }, [dataProp]);
197
197
  const preventContextMenuHandler = (0, react_2.useCallback)((e) => {
198
198
  if (!(0, checkModifierKeyActivated_1.default)(e)) {
199
199
  e.preventDefault();
200
200
  }
201
201
  }, []);
202
- const mainDivRef = (0, react_2.useRef)(null);
203
202
  (0, react_2.useEffect)(() => {
204
203
  const div = mainDivRef.current;
205
204
  if (!div) {
206
205
  return;
207
206
  }
208
207
  function mouseEnterHandler() {
209
- dispatchMiddleWare({
208
+ dispatch({
210
209
  type: 'SET_MOUSE_OVER_DISPLAYER',
211
210
  payload: { isMouseOverDisplayer: true },
212
211
  });
213
212
  }
214
213
  function mouseLeaveHandler() {
215
- dispatchMiddleWare({
214
+ dispatch({
216
215
  type: 'SET_MOUSE_OVER_DISPLAYER',
217
216
  payload: { isMouseOverDisplayer: false },
218
217
  });
@@ -223,12 +222,12 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
223
222
  div.removeEventListener('mouseenter', mouseEnterHandler);
224
223
  div.removeEventListener('mouseleave', mouseLeaveHandler);
225
224
  };
226
- }, [dispatchMiddleWare]);
225
+ }, []);
227
226
  return ((0, jsx_runtime_1.jsx)(GlobalContext_1.GlobalProvider, { value: {
228
227
  rootRef: rootRef.current,
229
228
  elementsWrapperRef: elementsWrapperRef.current,
230
229
  viewerRef: viewerRef.current,
231
- }, children: (0, jsx_runtime_1.jsx)(PreferencesContext_1.PreferencesProvider, { value: preferencesState, children: (0, jsx_runtime_1.jsx)("div", { ref: mainDivRef, style: { height: '100%', position: 'relative' }, children: (0, jsx_runtime_1.jsx)(LoggerContext_1.LoggerProvider, { children: (0, jsx_runtime_1.jsx)(Alert_1.AlertProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(DispatchContext_1.DispatchProvider, { value: dispatchMiddleWare, children: (0, jsx_runtime_1.jsx)(ChartContext_1.ChartDataProvider, { value: state, children: (0, jsx_runtime_1.jsx)(Modal_1.ModalProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(highlight_1.HighlightProvider, { children: (0, jsx_runtime_1.jsx)(assignment_1.AssignmentProvider, { spectraData: spectraData, children: (0, jsx_runtime_1.jsx)(SpinnerContext_1.SpinnerProvider, { value: getSpinner, children: (0, jsx_runtime_1.jsx)("div", { className: "nmrium-container", ref: rootRef, css: containerStyles, onContextMenu: preventContextMenuHandler, style: { height: '100%', width: '100%' }, children: (0, jsx_runtime_1.jsx)(DropZone_1.default, { children: (0, jsx_runtime_1.jsxs)("div", { style: {
230
+ }, children: (0, jsx_runtime_1.jsx)(PreferencesContext_1.PreferencesProvider, { value: preferencesState, children: (0, jsx_runtime_1.jsx)("div", { ref: mainDivRef, style: { height: '100%', position: 'relative' }, children: (0, jsx_runtime_1.jsx)(LoggerContext_1.LoggerProvider, { children: (0, jsx_runtime_1.jsx)(Alert_1.AlertProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(DispatchContext_1.DispatchProvider, { value: dispatch, children: (0, jsx_runtime_1.jsx)(ChartContext_1.ChartDataProvider, { value: state, children: (0, jsx_runtime_1.jsx)(Modal_1.ModalProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(highlight_1.HighlightProvider, { children: (0, jsx_runtime_1.jsx)(assignment_1.AssignmentProvider, { spectraData: spectraData, children: (0, jsx_runtime_1.jsx)(SpinnerContext_1.SpinnerProvider, { value: getSpinner, children: (0, jsx_runtime_1.jsx)("div", { className: "nmrium-container", ref: rootRef, css: containerStyles, onContextMenu: preventContextMenuHandler, style: { height: '100%', width: '100%' }, children: (0, jsx_runtime_1.jsx)(DropZone_1.default, { children: (0, jsx_runtime_1.jsxs)("div", { style: {
232
231
  display: 'flex',
233
232
  flexDirection: 'column',
234
233
  backgroundColor: 'white',
@@ -20,6 +20,11 @@ function LoggerProvider({ children }) {
20
20
  const [logsHistory, setLogsHistory] = (0, react_1.useState)([]);
21
21
  const loggerRef = (0, react_1.useRef)(new fifo_logger_1.FifoLogger({
22
22
  onChange: (log, logs) => {
23
+ if (log?.error &&
24
+ (log?.levelLabel === 'error' || log?.levelLabel === 'fatal')) {
25
+ // eslint-disable-next-line no-console
26
+ console.error(log.error);
27
+ }
23
28
  setLogsHistory(logs.slice());
24
29
  },
25
30
  }));
@@ -93,7 +93,7 @@ function getFillStyle(props) {
93
93
  }
94
94
  const styles = {
95
95
  button: (props) => {
96
- const { size, backgroundColor: { hover, active }, color, borderRadius, } = props;
96
+ const { size, backgroundColor: { hover, active }, color, borderRadius, element, } = props;
97
97
  const basic = (0, react_1.css) `
98
98
  display: flex;
99
99
  flex-direction: row;
@@ -105,17 +105,18 @@ const styles = {
105
105
  }
106
106
  `;
107
107
  const fillStyle = getFillStyle(props);
108
- const colorStyle = (0, react_1.css) `
109
- &:disabled {
108
+ const basicDisabledStyle = (0, react_1.css) `
109
+ &:disabled,
110
+ &.disabled {
110
111
  opacity: 0.25;
111
112
  }
112
-
113
- &:not([disabled]):hover {
113
+ `;
114
+ const colorStyle = (0, react_1.css) `
115
+ &:not(${element === 'button' ? '[disabled]' : '.disabled'}):hover {
114
116
  background-color: ${hover};
115
117
  color: ${color.hover};
116
118
  }
117
-
118
- &:not([disabled]):active {
119
+ &:not(${element === 'button' ? '[disabled]' : '.disabled'}):active {
119
120
  background-color: ${active || hover};
120
121
  color: ${color?.active || color.hover};
121
122
  }
@@ -124,6 +125,7 @@ const styles = {
124
125
  basic,
125
126
  sizeConfig[size],
126
127
  fillStyle,
128
+ basicDisabledStyle,
127
129
  colorStyle,
128
130
  { borderRadius },
129
131
  ]);
@@ -163,8 +165,11 @@ function Button(props) {
163
165
  base,
164
166
  hover: shade,
165
167
  active: tint,
166
- }, borderColor = 'transparent', fill = 'solid', borderRadius, style = {}, wrapperStyle = {}, toolTip, tooltipOrientation = 'vertical', wrapperClassName, ...restProps } = buttonProps;
167
- return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', ...wrapperStyle }, ...(wrapperClassName && { className: wrapperClassName }), children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClick, css: [
168
+ }, borderColor = 'transparent', fill = 'solid', borderRadius, style = {}, wrapperStyle = {}, toolTip, tooltipOrientation = 'vertical', wrapperClassName = '', as: Wrapper = 'button', disabled = false, className = '', ...restProps } = buttonProps;
169
+ const isDivDisabled = Wrapper === 'div' && disabled;
170
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', ...wrapperStyle }, className: wrapperClassName, children: [(0, jsx_runtime_1.jsx)(Wrapper, { ...(Wrapper === 'button' && { type: 'button', disabled }), onClick: Wrapper === 'button' || (Wrapper === 'div' && !disabled)
171
+ ? onClick
172
+ : (e) => e.stopPropagation(), css: [
168
173
  styles.button({
169
174
  size,
170
175
  backgroundColor,
@@ -172,29 +177,15 @@ function Button(props) {
172
177
  borderColor,
173
178
  fill,
174
179
  borderRadius,
180
+ element: Wrapper,
175
181
  }),
176
182
  style,
177
- ], ...restProps, children: (0, jsx_runtime_1.jsx)("span", { style: { flex: 1, pointerEvents: 'none' }, children: props.children }) }), toolTip && ((0, jsx_runtime_1.jsx)("div", { className: "content", css: toolTipStyle(tooltipOrientation), children: (0, jsx_runtime_1.jsx)("span", { style: {
183
+ ], className: `${className} ${isDivDisabled ? 'disabled' : ''}`, ...restProps, children: (0, jsx_runtime_1.jsx)("span", { style: { flex: 1, pointerEvents: 'none' }, children: props.children }) }), toolTip && ((0, jsx_runtime_1.jsx)("div", { className: "content", css: toolTipStyle(tooltipOrientation), children: (0, jsx_runtime_1.jsx)("span", { style: {
178
184
  display: 'flex',
179
185
  margin: 'auto',
180
186
  justifyContent: 'center',
181
187
  }, children: toolTip }) }))] }));
182
188
  }
183
- // function ThemeButton(props: { colorTheme: ColorTheme } & ButtonProps) {
184
- // const { colorTheme, ...buttonProps } = props;
185
- // const { base, shade, tint } = colorPalettes[colorTheme];
186
- // const {
187
- // color = { base: shade, hover: 'white' },
188
- // backgroundColor = {
189
- // base,
190
- // hover: shade,
191
- // active: tint,
192
- // },
193
- // fill = 'solid',
194
- // ...restProps
195
- // } = buttonProps;
196
- // return <Button {...{ fill, ...restProps, backgroundColor, color }} />;
197
- // }
198
189
  Button.Done = function ButtonDone(props) {
199
190
  return (0, jsx_runtime_1.jsx)(Button, { ...props, theme: "success" });
200
191
  };
@@ -66,7 +66,7 @@ const style = (0, react_1.css) `
66
66
  }
67
67
  `;
68
68
  function ColorInput(props) {
69
- const { label = 'Color: ', onColorChange = () => null, name, value = '#000000', } = props;
69
+ const { onColorChange = () => null, name, value = '#000000' } = props;
70
70
  const [displayColorPicker, showColorPicker] = (0, react_2.useState)(false);
71
71
  const [selectedColor, setColor] = (0, react_2.useState)(value);
72
72
  (0, react_2.useEffect)(() => {
@@ -83,6 +83,6 @@ function ColorInput(props) {
83
83
  setColor(hex);
84
84
  onColorChange({ ...colorEvent, hex, name });
85
85
  }, [name, onColorChange]);
86
- return ((0, jsx_runtime_1.jsxs)("div", { css: style, children: [(0, jsx_runtime_1.jsx)("span", { className: "input-label", children: label }), (0, jsx_runtime_1.jsxs)("div", { style: { flex: 4 }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "swatch", onClick: handleClick, children: [(0, jsx_runtime_1.jsx)("div", { className: "color", style: { backgroundColor: selectedColor } }), (0, jsx_runtime_1.jsx)("input", { type: "hidden", value: selectedColor, name: name })] }), displayColorPicker ? ((0, jsx_runtime_1.jsxs)("div", { className: "color-popover", children: [(0, jsx_runtime_1.jsx)("div", { className: "cover", onClick: handleClose }), (0, jsx_runtime_1.jsx)(ui_1.ColorPicker, { color: { hex: selectedColor }, onChangeComplete: handleOnColorChanged })] })) : null] })] }));
86
+ return ((0, jsx_runtime_1.jsxs)("div", { css: style, children: [(0, jsx_runtime_1.jsxs)("div", { className: "swatch", onClick: handleClick, children: [(0, jsx_runtime_1.jsx)("div", { className: "color", style: { backgroundColor: selectedColor } }), (0, jsx_runtime_1.jsx)("input", { type: "hidden", value: selectedColor, name: name })] }), displayColorPicker ? ((0, jsx_runtime_1.jsxs)("div", { className: "color-popover", children: [(0, jsx_runtime_1.jsx)("div", { className: "cover", onClick: handleClose }), (0, jsx_runtime_1.jsx)(ui_1.ColorPicker, { color: { hex: selectedColor }, onChangeComplete: handleOnColorChanged })] })) : null] }));
87
87
  }
88
88
  exports.default = (0, react_2.memo)(ColorInput);
@@ -57,14 +57,17 @@ const EditableColumn = (0, react_1.forwardRef)(function EditableColumn(props, re
57
57
  }, className: "editable-column-input", onDoubleClick: startEditHandler, children: [!enabled && ((0, jsx_runtime_1.jsx)("span", { style: {
58
58
  display: 'table-cell',
59
59
  verticalAlign: 'middle',
60
- width: 'inherit',
60
+ width: '100%',
61
61
  ...(textOverFlowEllipses
62
62
  ? { textOverflow: 'ellipsis', overflow: 'hidden' }
63
63
  : {}),
64
64
  }, children: value })), enabled && ((0, jsx_runtime_1.jsx)("div", { style: { display: 'table-cell', verticalAlign: 'middle' }, children: (0, jsx_runtime_1.jsx)(Input_1.default, { style: {
65
65
  inputWrapper: {
66
- width: '100%',
67
66
  ...(!isValid && { borderColor: 'red' }),
67
+ width: '100%',
68
+ },
69
+ input: {
70
+ width: '100%',
68
71
  },
69
72
  }, enableAutoSelect: true, className: "editable-column", value: value, type: type, onKeyUp: editHandler, ...InputProps }) }))] }));
70
73
  });
@@ -13,8 +13,6 @@ const styles = {
13
13
  userSelect: 'none',
14
14
  },
15
15
  inputWrapper: {
16
- height: '100%',
17
- width: '100px',
18
16
  borderRadius: '5px',
19
17
  borderWidth: '0.55px',
20
18
  borderColor: '#c7c7c7',
@@ -62,7 +60,7 @@ const Input = (0, react_1.forwardRef)((props, ref) => {
62
60
  input: {},
63
61
  inputWrapper: {},
64
62
  }, onChange = () => null, debounceTime = 0, onKeyDown = () => null, onKeyUp = () => null, checkValue = () => true, type = 'text', enableAutoSelect = false, className, format = () => identity, onBlur = () => null, onFocus = () => null, renderIcon = null, canClear = false, nullable = false, onClear, datalist = [], ...otherProps } = props;
65
- const [val, setVal] = (0, react_1.useState)(value);
63
+ const [val, setVal] = (0, react_1.useState)(value ?? '');
66
64
  const valueRef = (0, react_1.useRef)(value);
67
65
  const localRef = (0, react_1.useRef)();
68
66
  const combinedRef = (0, useCombinedRefs_1.default)([ref, localRef]);
@@ -70,7 +68,7 @@ const Input = (0, react_1.forwardRef)((props, ref) => {
70
68
  onChange?.(val);
71
69
  }, debounceTime), [debounceTime, onChange]);
72
70
  (0, react_1.useEffect)(() => {
73
- setVal(value);
71
+ setVal((prevVal) => (prevVal !== value ? value ?? '' : prevVal));
74
72
  }, [value]);
75
73
  (0, react_1.useEffect)(() => {
76
74
  if (enableAutoSelect) {
@@ -8,13 +8,13 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
8
8
  const react_1 = require("@emotion/react");
9
9
  const Button_1 = __importDefault(require("./Button"));
10
10
  function Label(props) {
11
- const { title, shortTitle, className = '', children, style, description, ...otherProps } = props;
11
+ const { title, shortTitle, className = '', children, style, description, renderTitle, ...otherProps } = props;
12
12
  return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center', ...style?.container }, children: [(0, jsx_runtime_1.jsxs)("label", { className: className, style: {
13
13
  fontSize: '12px',
14
14
  color: '#232323',
15
15
  paddingRight: '10px',
16
16
  width: 'max-content',
17
17
  ...style?.label,
18
- }, ...otherProps, children: [(0, jsx_runtime_1.jsx)("span", { className: shortTitle ? 'large-label' : '', children: title }), shortTitle && ((0, jsx_runtime_1.jsx)("span", { className: "small-label", css: (0, react_1.css)({ display: 'none' }), children: shortTitle })), description && ((0, jsx_runtime_1.jsx)(Button_1.default.Info, { toolTip: description, tooltipOrientation: "horizontal", style: { display: 'inline-block' }, backgroundColor: { hover: 'white', base: 'white' }, color: { base: 'gray', hover: 'black' } }))] }), (0, jsx_runtime_1.jsx)("div", { style: style?.wrapper, children: children })] }));
18
+ }, ...otherProps, children: [renderTitle ? (renderTitle(title)) : ((0, jsx_runtime_1.jsx)("span", { className: shortTitle ? 'large-label' : '', children: title })), shortTitle && ((0, jsx_runtime_1.jsx)("span", { className: "small-label", css: (0, react_1.css)({ display: 'none' }), children: shortTitle })), description && ((0, jsx_runtime_1.jsx)(Button_1.default.Info, { toolTip: description, tooltipOrientation: "horizontal", style: { display: 'inline-block' }, backgroundColor: { hover: 'white', base: 'white' }, color: { base: 'gray', hover: 'black' } }))] }), (0, jsx_runtime_1.jsx)("div", { style: style?.wrapper, children: children })] }));
19
19
  }
20
20
  exports.default = Label;
@@ -34,27 +34,25 @@ const inputStyle = (0, react_1.css) `
34
34
  background-color: gray;
35
35
  }
36
36
  `;
37
+ function isValidMf(mf) {
38
+ if (mf.trim().length === 0) {
39
+ return false;
40
+ }
41
+ try {
42
+ (0, getAtomsFromMF_1.default)(mf);
43
+ return true;
44
+ }
45
+ catch {
46
+ return false;
47
+ }
48
+ }
37
49
  function MolecularFormulaInput({ onSave = () => null, previousMF, }) {
38
50
  const [mf, setMF] = (0, react_2.useState)('');
39
51
  const [isValidMF, setIsValidMF] = (0, react_2.useState)(true);
40
52
  const [hasChanged, setHasChanged] = (0, react_2.useState)(false);
41
- const checkMF = (0, react_2.useCallback)((mf) => {
42
- if (mf.trim().length === 0) {
43
- return false;
44
- }
45
- try {
46
- (0, getAtomsFromMF_1.default)(mf);
47
- return true;
48
- }
49
- catch (error) {
50
- // TODO: handle error.
51
- reportError(error);
52
- return false;
53
- }
54
- }, []);
55
53
  const onChangeHandler = (0, react_2.useCallback)((e) => {
56
54
  setHasChanged(true);
57
- if (checkMF(e.target.value)) {
55
+ if (isValidMf(e.target.value)) {
58
56
  setIsValidMF(true);
59
57
  setMF(e.target.value);
60
58
  }
@@ -62,7 +60,7 @@ function MolecularFormulaInput({ onSave = () => null, previousMF, }) {
62
60
  setIsValidMF(false);
63
61
  setMF('');
64
62
  }
65
- }, [checkMF]);
63
+ }, []);
66
64
  const onSaveHandler = (0, react_2.useCallback)(() => {
67
65
  onSave(hasChanged ? mf.trim() : previousMF);
68
66
  }, [hasChanged, mf, onSave, previousMF]);
@@ -6,12 +6,9 @@ const react_1 = require("@emotion/react");
6
6
  const react_2 = require("react");
7
7
  const fa_1 = require("react-icons/fa");
8
8
  const react_use_1 = require("react-use");
9
- function Arrow({ direction, onClick }) {
9
+ function Arrow({ direction, onClick, style = {} }) {
10
10
  return ((0, jsx_runtime_1.jsx)("div", { onClick: onClick, css: (0, react_1.css) `
11
- display: flex;
12
- position: absolute;
13
- top: 50%;
14
- ${direction === 'right' ? `right: 25px` : `left: 25px`};
11
+ display: inline-flex;
15
12
  height: 40px;
16
13
  width: 40px;
17
14
  justify-content: center;
@@ -22,6 +19,7 @@ function Arrow({ direction, onClick }) {
22
19
  border: none;
23
20
  transition: transform ease-in 0.1s;
24
21
  background-color: #f7f7f7;
22
+ pointer-events: auto;
25
23
 
26
24
  &:hover {
27
25
  transform: scale(1.1);
@@ -36,10 +34,11 @@ function Arrow({ direction, onClick }) {
36
34
  outline: 0;
37
35
  }
38
36
  }
39
- `, children: (0, jsx_runtime_1.jsx)(fa_1.FaAngleLeft, { style: { transform: `scaleX(${direction === 'right' ? '-1' : '1'})` } }) }));
37
+ `, style: style, children: (0, jsx_runtime_1.jsx)(fa_1.FaAngleLeft, { style: { transform: `scaleX(${direction === 'right' ? '-1' : '1'})` } }) }));
40
38
  }
41
39
  const transition = 0.45;
42
- function NextPrev({ children, loop = false, defaultIndex = 0, onChange = () => null, }) {
40
+ function NextPrev(props) {
41
+ const { children, loop = false, defaultIndex = 0, onChange = () => null, style = {}, } = props;
43
42
  const [ref, { width }] = (0, react_use_1.useMeasure)();
44
43
  const [activeIndex, setActiveIndex] = (0, react_2.useState)(0);
45
44
  (0, react_2.useEffect)(() => {
@@ -100,6 +99,25 @@ function NextPrev({ children, loop = false, defaultIndex = 0, onChange = () => n
100
99
  height: 100%;
101
100
  width: ${slidersWidth}px;
102
101
  display: flex;
103
- `, children: Sliders }), activeIndex !== 0 && (0, jsx_runtime_1.jsx)(Arrow, { direction: "left", onClick: prevHandler }), Sliders && activeIndex !== Sliders.length - 1 && ((0, jsx_runtime_1.jsx)(Arrow, { direction: "right", onClick: nextHandler }))] }));
102
+ `, children: Sliders }), (0, jsx_runtime_1.jsxs)("div", { style: {
103
+ position: 'absolute',
104
+ top: '50%',
105
+ padding: '0 10px',
106
+ justifyContent: 'space-between',
107
+ width: '100%',
108
+ display: 'flex',
109
+ pointerEvents: 'none',
110
+ ...style?.arrowContainer,
111
+ }, children: [(0, jsx_runtime_1.jsx)(Arrow, { direction: "left", onClick: prevHandler, style: {
112
+ ...(activeIndex === 0 && {
113
+ visibility: 'hidden',
114
+ pointerEvents: 'none',
115
+ }),
116
+ } }), (0, jsx_runtime_1.jsx)(Arrow, { direction: "right", onClick: nextHandler, style: {
117
+ ...((!Sliders || activeIndex === Sliders.length - 1) && {
118
+ visibility: 'hidden',
119
+ pointerEvents: 'none',
120
+ }),
121
+ } })] })] }));
104
122
  }
105
123
  exports.default = (0, react_2.memo)(NextPrev);
@@ -9,7 +9,7 @@ const inputStyle = {
9
9
  border: '0.55px solid #c7c7c7',
10
10
  textAlign: 'center',
11
11
  };
12
- const NumberInput = (0, react_1.forwardRef)(({ name, value: valueProp, style = {}, onChange, pattern = '^\\d*.\\d*$', step = 'any', min = 'any', max = 'any', }, ref) => {
13
- return ((0, jsx_runtime_1.jsx)("input", { ref: ref, name: name, style: { ...inputStyle, ...style }, type: "number", pattern: pattern, value: valueProp, step: step, onChange: onChange, min: min, max: max }));
12
+ const NumberInput = (0, react_1.forwardRef)(({ name, value: valueProp, style = {}, onChange, pattern = '^\\d*.\\d*$', step = 'any', min = 'any', max = 'any', ...otherProps }, ref) => {
13
+ return ((0, jsx_runtime_1.jsx)("input", { ref: ref, name: name, style: { ...inputStyle, ...style }, type: "number", pattern: pattern, value: valueProp, step: step, onChange: onChange, min: min, max: max, ...otherProps }));
14
14
  });
15
15
  exports.default = NumberInput;
@@ -130,8 +130,8 @@ const ReactTableInner = (0, react_1.forwardRef)(function ReactTableInner(props,
130
130
  ? approxColumnWidth * (columns.length + 1)
131
131
  : '100%',
132
132
  pointerEvents: 'none',
133
- } }), (0, jsx_runtime_1.jsxs)("table", { ...getTableProps(), css: Style_1.ReactTableStyle, style: styles.table(enableVirtualScroll, enableColumnsVirtualScroll), children: [(0, jsx_runtime_1.jsx)(ReactTableHeader_1.default, { headerGroups: headerGroups, onClick: headerClickHandler }), (0, jsx_runtime_1.jsxs)("tbody", { ...getTableBodyProps(), children: [!rowsData ||
134
- (rowsData?.length === 0 && ((0, jsx_runtime_1.jsx)(EmptyDataRow_1.EmptyDataRow, { columns: columns, text: emptyDataRowText }))), rowsData.map((row, index) => {
133
+ } }), (0, jsx_runtime_1.jsxs)("table", { ...getTableProps(), css: Style_1.ReactTableStyle, style: styles.table(enableVirtualScroll, enableColumnsVirtualScroll), children: [(0, jsx_runtime_1.jsx)(ReactTableHeader_1.default, { headerGroups: headerGroups, onClick: headerClickHandler }), (0, jsx_runtime_1.jsxs)("tbody", { ...getTableBodyProps(), children: [!data ||
134
+ (data?.length === 0 && ((0, jsx_runtime_1.jsx)(EmptyDataRow_1.EmptyDataRow, { columns: columns, text: emptyDataRowText }))), rowsData.map((row, index) => {
135
135
  prepareRow(row);
136
136
  (0, useRowSpan_1.prepareRowSpan)(rows, enableVirtualScroll
137
137
  ? index + virtualBoundary.rows.start
@@ -150,7 +150,7 @@ const ReactTableInner = (0, react_1.forwardRef)(function ReactTableInner(props,
150
150
  opacity: !isCounterVisible ? '0' : '1',
151
151
  transition: 'all 0.5s',
152
152
  visibility: !isCounterVisible ? 'hidden' : 'visible',
153
- }, children: [enableColumnsVirtualScroll && typeof startColumn === 'string' && ((0, jsx_runtime_1.jsxs)("span", { style: { left: 0 }, children: [`Column ${startColumn}`, " "] })), index + 1, " / ", total] }))] }));
153
+ }, children: [enableColumnsVirtualScroll && typeof startColumn === 'string' && ((0, jsx_runtime_1.jsxs)("span", { style: { left: 0 }, children: [`Column ${startColumn}`, " "] })), typeof index === 'number' ? index + 1 : total, " / ", total] }))] }));
154
154
  });
155
155
  function ReactTable(props) {
156
156
  const { data, approxItemHeight = 40, approxColumnWidth = 40, groupKey, onSortEnd, columns, style = {}, } = props;
@@ -187,7 +187,7 @@ function ReactTable(props) {
187
187
  }, [approxColumnWidth, approxItemHeight, height, width]);
188
188
  function lookForGroupIndex(currentIndex, side) {
189
189
  const currentItem = data[currentIndex];
190
- if (currentItem.index && groupKey) {
190
+ if (currentItem?.index && groupKey) {
191
191
  switch (side) {
192
192
  case -1: {
193
193
  let index = currentIndex - 1;
@@ -9,7 +9,7 @@ const get_1 = __importDefault(require("lodash/get"));
9
9
  const react_1 = require("react");
10
10
  const CheckBox_1 = __importDefault(require("../CheckBox"));
11
11
  function FormikCheckBox(props) {
12
- const { label, name, onChange = () => null, className = 'checkbox', reverse = false, style = { container: {}, label: {}, checkbox: {} }, defaultValue, ...resProps } = props;
12
+ const { label, name, onChange = () => null, className = 'checkbox', reverse = false, style = { container: {}, label: {}, checkbox: {} }, defaultValue, renderLabel, ...resProps } = props;
13
13
  const { values, setFieldValue } = (0, formik_1.useFormikContext)();
14
14
  const value = reverse
15
15
  ? !(0, get_1.default)(values, name, defaultValue)
@@ -19,6 +19,6 @@ function FormikCheckBox(props) {
19
19
  onChange(e);
20
20
  void setFieldValue(name, reverse ? value : !value);
21
21
  }, [name, onChange, reverse, setFieldValue, value]);
22
- return ((0, jsx_runtime_1.jsxs)("div", { className: `${className} check-${value}`, style: style.container || {}, children: [label && ((0, jsx_runtime_1.jsx)("label", { htmlFor: name, className: "checkbox-label", style: style.label || {}, children: label })), (0, jsx_runtime_1.jsx)(CheckBox_1.default, { ...resProps, name: name, checked: value, onChange: changeHandler, style: style.checkbox || {} })] }));
22
+ return ((0, jsx_runtime_1.jsxs)("div", { className: `${className} check-${value}`, style: { display: 'flex', justifyContent: 'center', ...style.container }, children: [renderLabel?.(label), label && !renderLabel && ((0, jsx_runtime_1.jsx)("label", { htmlFor: name, className: "checkbox-label", style: style.label || {}, children: label })), (0, jsx_runtime_1.jsx)(CheckBox_1.default, { ...resProps, name: name, id: name, checked: value, onChange: changeHandler, style: style.checkbox || {} })] }));
23
23
  }
24
24
  exports.default = FormikCheckBox;
@@ -3,26 +3,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.formatFieldLabelStyle = exports.formatFieldInputStyle = void 0;
6
7
  const jsx_runtime_1 = require("react/jsx-runtime");
7
8
  const formik_1 = require("formik");
8
9
  const get_1 = __importDefault(require("lodash/get"));
9
10
  const react_1 = require("react");
10
11
  const Input_1 = __importDefault(require("../Input"));
11
- const styles = {
12
- row: {
13
- display: 'flex',
14
- margin: '5px 0px',
15
- alignItems: 'center',
12
+ const Label_1 = __importDefault(require("../Label"));
13
+ exports.formatFieldInputStyle = {
14
+ inputWrapper: {
15
+ width: '60%',
16
+ margin: '2px 0',
17
+ },
18
+ input: {
19
+ padding: '2px',
20
+ textAlign: 'center',
16
21
  },
17
- inputLabel: {
18
- flex: 2,
22
+ };
23
+ exports.formatFieldLabelStyle = {
24
+ label: {
25
+ flex: 4,
19
26
  fontSize: '11px',
20
27
  fontWeight: 'bold',
21
28
  color: '#232323',
22
29
  },
23
- input: {
24
- width: '60%',
25
- textAlign: 'center',
30
+ wrapper: {
31
+ flex: 8,
26
32
  },
27
33
  };
28
34
  function FormikColumnFormatField(props) {
@@ -34,11 +40,9 @@ function FormikColumnFormatField(props) {
34
40
  const checkChangeHandler = (0, react_1.useCallback)((e) => {
35
41
  void setFieldValue(e.target.name, e.target.checked);
36
42
  }, [setFieldValue]);
37
- return ((0, jsx_runtime_1.jsxs)("div", { style: styles.row, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.inputLabel, children: label }), (0, jsx_runtime_1.jsxs)("div", { style: {
38
- flex: 4,
39
- display: 'flex',
40
- flexDirection: 'row',
41
- alignItems: 'center',
42
- }, children: [!hideCheckField && checkControllerName && ((0, jsx_runtime_1.jsx)("input", { type: "checkbox", style: { margin: '0px 5px' }, name: checkControllerName, onChange: checkChangeHandler, checked: (0, get_1.default)(values, checkControllerName, false) })), !hideFormatField && formatControllerName && ((0, jsx_runtime_1.jsx)(Input_1.default, { style: { inputWrapper: styles.input }, name: formatControllerName, value: (0, get_1.default)(values, formatControllerName, ''), onChange: changeHandler, type: "text", disabled: disableFormat }))] })] }));
43
+ return ((0, jsx_runtime_1.jsx)(Label_1.default, { title: label, style: exports.formatFieldLabelStyle, children: (0, jsx_runtime_1.jsxs)("div", { style: {
44
+ display: 'flex',
45
+ alignItems: 'center',
46
+ }, children: [!hideCheckField && checkControllerName ? ((0, jsx_runtime_1.jsx)("input", { type: "checkbox", style: { margin: '0px 5px' }, name: checkControllerName, onChange: checkChangeHandler, checked: (0, get_1.default)(values, checkControllerName, false) })) : ((0, jsx_runtime_1.jsx)("div", { style: { width: '23px' } })), !hideFormatField && formatControllerName && ((0, jsx_runtime_1.jsx)(Input_1.default, { style: exports.formatFieldInputStyle, name: formatControllerName, value: (0, get_1.default)(values, formatControllerName, ''), onChange: changeHandler, type: "text", disabled: disableFormat }))] }) }));
43
47
  }
44
48
  exports.default = (0, react_1.memo)(FormikColumnFormatField);
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const formik_1 = require("formik");
8
+ const get_1 = __importDefault(require("lodash/get"));
9
+ const styles = {
10
+ container: {
11
+ padding: '0.4rem',
12
+ display: 'flex',
13
+ flexDirection: 'column',
14
+ },
15
+ text: {
16
+ color: '#fd000c',
17
+ margin: '0.5px',
18
+ fontSize: '0.9em',
19
+ },
20
+ };
21
+ function FormikError({ style, name, children }) {
22
+ const { errors, isValid, dirty, touched } = (0, formik_1.useFormikContext)();
23
+ const errorText = (0, get_1.default)(errors, name);
24
+ const isTouched = (0, get_1.default)(touched, name);
25
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { ...styles.container, ...style?.container }, children: [children, !isValid && dirty && isTouched && ((0, jsx_runtime_1.jsx)("span", { style: { ...styles.text, ...style?.text }, children: errorText }))] }));
26
+ }
27
+ exports.default = FormikError;
@@ -11,7 +11,7 @@ function identity(value) {
11
11
  return value;
12
12
  }
13
13
  function FormikInput(props) {
14
- const { name, style = { label: {}, input: {} }, onChange = () => null, checkValue = () => true, type = 'text', className = '', value = null, format = () => identity, checkErrorAfterInputTouched = true, mapOnChangeValue, mapValue, ...resProps } = props;
14
+ const { name, style = { label: {}, input: {}, inputWrapper: {} }, onChange = () => null, checkValue = () => true, type = 'text', className = '', value = null, format = () => identity, checkErrorAfterInputTouched = true, mapOnChangeValue, mapValue, ...resProps } = props;
15
15
  const { values, handleChange, errors, touched, setFieldValue } = (0, formik_1.useFormikContext)();
16
16
  function changeHandler(e) {
17
17
  onChange(e);
@@ -31,11 +31,15 @@ function FormikInput(props) {
31
31
  return ((0, jsx_runtime_1.jsx)(Input_1.default, { name: name, value: val, onChange: changeHandler, type: type, style: {
32
32
  ...style,
33
33
  inputWrapper: {
34
- ...style.input,
35
- ...(isInvalid && {
36
- border: '1px solid red',
37
- outline: 'none',
38
- }),
34
+ ...style.inputWrapper,
35
+ ...(isInvalid
36
+ ? {
37
+ borderColor: 'red',
38
+ borderWidth: '1px',
39
+ borderStyle: 'solid',
40
+ outline: 'none',
41
+ }
42
+ : {}),
39
43
  },
40
44
  }, checkValue: checkValue, className: className, format: format, ...resProps }));
41
45
  }
@@ -24,6 +24,6 @@ const FormikSelect = function FormikSelect(props) {
24
24
  if (checkErrorAfterInputTouched) {
25
25
  isInvalid = (0, get_1.default)(errors, name) && (0, get_1.default)(touched, name);
26
26
  }
27
- return ((0, jsx_runtime_1.jsx)(Select_1.default, { name: name, defaultValue: value || (0, get_1.default)(values, name), onChange: changeHandler, style: { ...style, ...(isInvalid && { border: '1px solid red' }) }, ...resProps }));
27
+ return ((0, jsx_runtime_1.jsx)(Select_1.default, { name: name, defaultValue: value || (0, get_1.default)(values, name), onChange: changeHandler, style: { ...style, ...(isInvalid && { border: '1px solid red' }) }, ...resProps }, String(value || (0, get_1.default)(values, name))));
28
28
  };
29
29
  exports.default = FormikSelect;
@@ -28,10 +28,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  const jsx_runtime_1 = require("react/jsx-runtime");
30
30
  const formik_1 = require("formik");
31
+ const nmr_processing_1 = require("nmr-processing");
31
32
  const react_1 = require("react");
32
33
  const Yup = __importStar(require("yup"));
33
- const Filters = __importStar(require("../../data/Filters"));
34
- const apodization_1 = require("../../data/data1d/filter1d/apodization");
34
+ const DefaultApodizationOptions_1 = require("../../data/constants/DefaultApodizationOptions");
35
35
  const DispatchContext_1 = require("../context/DispatchContext");
36
36
  const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
37
37
  const Label_1 = __importDefault(require("../elements/Label"));
@@ -42,7 +42,8 @@ const useFilter_1 = require("../hooks/useFilter");
42
42
  const Header_1 = require("./Header");
43
43
  const HeaderContainer_1 = require("./HeaderContainer");
44
44
  const inputStyle = {
45
- input: { height: '100%', width: '60px' },
45
+ input: { width: '60px' },
46
+ inputWrapper: { height: '100%' },
46
47
  };
47
48
  const validationSchema = Yup.object().shape({
48
49
  lineBroadening: Yup.number().required(),
@@ -50,7 +51,7 @@ const validationSchema = Yup.object().shape({
50
51
  lineBroadeningCenter: Yup.number().required().min(0).max(1),
51
52
  });
52
53
  const initialValues = {
53
- ...apodization_1.defaultApodizationOptions,
54
+ ...DefaultApodizationOptions_1.defaultApodizationOptions,
54
55
  livePreview: true,
55
56
  };
56
57
  function ApodizationOptionsInnerPanel(props) {
@@ -84,7 +85,7 @@ function ApodizationOptionsInnerPanel(props) {
84
85
  }
85
86
  const MemoizedApodizationPanel = (0, react_1.memo)(ApodizationOptionsInnerPanel);
86
87
  function ApodizationOptionsPanel() {
87
- const filter = (0, useFilter_1.useFilter)(Filters.apodization.id);
88
+ const filter = (0, useFilter_1.useFilter)(nmr_processing_1.Filters.apodization.id);
88
89
  return (0, jsx_runtime_1.jsx)(MemoizedApodizationPanel, { filter: filter });
89
90
  }
90
91
  exports.default = ApodizationOptionsPanel;