nmrium 0.38.0 → 0.38.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/ApodizationLine.js +27 -4
- package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib/component/1d/FooterBanner.js +5 -5
- package/lib/component/1d/SpectraLegends.js +2 -3
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/integral/Integral.d.ts +1 -1
- package/lib/component/1d/integral/IntegralResizable.d.ts +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +2 -1
- package/lib/component/1d/ranges/Range.d.ts +1 -1
- package/lib/component/1d/tool/PeakPointer.js +6 -6
- package/lib/component/1d/tool/XLabelPointer.js +5 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
- package/lib/component/1d-2d/tools/BrushX.js +2 -3
- package/lib/component/1d-2d/tools/BrushXY.js +2 -3
- package/lib/component/1d-2d/tools/CrossLinePointer.js +4 -5
- package/lib/component/2d/Chart2D.js +4 -4
- package/lib/component/2d/FooterBanner.js +5 -5
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +5 -5
- package/lib/component/2d/zones/Signal.d.ts +1 -1
- package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts +20 -12
- package/lib/component/EventsTrackers/BrushTracker.js +35 -22
- package/lib/component/EventsTrackers/MouseTracker.d.ts +6 -2
- package/lib/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib/component/NMRium.d.ts +4 -5
- package/lib/component/NMRium.js +11 -14
- package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
- package/lib/component/context/PreferencesContext.d.ts +6 -6
- package/lib/component/elements/Button.d.ts +13 -11
- package/lib/component/elements/Button.js +16 -25
- package/lib/component/elements/ColorInput.d.ts +0 -1
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/EditableColumn.js +5 -2
- package/lib/component/elements/Input.js +2 -4
- package/lib/component/elements/Label.d.ts +1 -0
- package/lib/component/elements/Label.js +2 -2
- package/lib/component/elements/MolecularFormulaInput.d.ts +2 -2
- package/lib/component/elements/MolecularFormulaInput.js +15 -18
- package/lib/component/elements/NextPrev.d.ts +5 -3
- package/lib/component/elements/NextPrev.js +26 -8
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
- package/lib/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +4 -0
- package/lib/component/elements/formik/FormikColumnFormatField.js +19 -16
- package/lib/component/elements/formik/FormikInput.js +10 -6
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/header/ApodizationOptionsPanel.js +4 -3
- package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -7
- package/lib/component/header/BaseLineCorrectionPanel.js +5 -2
- package/lib/component/header/PhaseCorrectionPanel.js +5 -2
- package/lib/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectra.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrum.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts +1 -1
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +2 -0
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.js +17 -0
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -2
- package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +3 -2
- package/lib/component/hooks/useExport.js +1 -1
- package/lib/component/hooks/useFilter.d.ts +2 -1
- package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
- package/lib/component/hooks/usePanelPreferences.js +4 -0
- package/lib/component/hooks/useSaveSettings.d.ts +1 -1
- package/lib/component/hooks/useSaveSettings.js +1 -1
- package/lib/component/hooks/useVerticalAlign.d.ts +1 -1
- package/lib/component/loader/DropZone.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
- package/lib/component/modal/LoadJCAMPModal.d.ts +3 -3
- package/lib/component/modal/LoadJCAMPModal.js +35 -66
- package/lib/component/modal/ModalStyle.js +0 -10
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +2 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
- package/lib/component/modal/PredictSpectraModal.d.ts +4 -2
- package/lib/component/modal/PredictSpectraModal.js +43 -105
- package/lib/component/modal/SaveAsModal.d.ts +2 -0
- package/lib/component/modal/SaveAsModal.js +21 -14
- package/lib/component/modal/changeSum/ChangeSumModal.js +25 -38
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -2
- package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib/component/modal/setting/GeneralSettings.js +1 -6
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -15
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +1 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +20 -25
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +6 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +71 -81
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +39 -53
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +7 -22
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +11 -28
- package/lib/component/panels/databasePanel/DatabasePreferences.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +2 -3
- package/lib/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib/component/panels/header/PanelHeader.d.ts +7 -0
- package/lib/component/panels/header/PanelHeader.js +12 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +9 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +94 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +107 -37
- package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +3 -0
- package/lib/component/panels/predictionPanel/PredictionPreferences.js +24 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.d.ts +2 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +44 -0
- package/lib/component/reducer/Reducer.d.ts +5 -87
- package/lib/component/reducer/Reducer.js +1 -25
- package/lib/component/reducer/actions/FiltersActions.d.ts +1 -2
- package/lib/component/reducer/actions/FiltersActions.js +47 -52
- package/lib/component/reducer/actions/HistoryActions.d.ts +4 -0
- package/lib/component/reducer/actions/HistoryActions.js +40 -0
- package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
- package/lib/component/reducer/actions/LoadActions.d.ts +1 -2
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +7 -4
- package/lib/component/reducer/actions/MoleculeActions.js +57 -28
- package/lib/component/reducer/actions/PeaksActions.d.ts +1 -2
- package/lib/component/reducer/actions/PeaksActions.js +3 -3
- package/lib/component/reducer/actions/RangesActions.d.ts +4 -5
- package/lib/component/reducer/actions/RangesActions.js +5 -27
- package/lib/component/reducer/actions/SpectrumsActions.js +2 -2
- package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
- package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
- package/lib/component/reducer/actions/ZonesActions.js +1 -2
- package/lib/component/reducer/helper/getActiveSpectra.d.ts +1 -1
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +1 -1
- package/lib/component/reducer/helper/getVerticalAlign.d.ts +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getActiveWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +2 -3
- package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +1 -1
- package/lib/component/toolbar/BasicToolBar.js +6 -11
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/toolbar/ToolTypes.js +1 -1
- package/lib/component/workspaces/assignment.d.ts +1 -1
- package/lib/component/workspaces/basic.d.ts +1 -1
- package/lib/component/workspaces/embedded.d.ts +1 -1
- package/lib/component/workspaces/exercise.d.ts +1 -1
- package/lib/component/workspaces/index.d.ts +6 -6
- package/lib/component/workspaces/prediction.d.ts +1 -1
- package/lib/component/workspaces/prediction.js +193 -0
- package/lib/component/workspaces/process1D.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/PredictionManager.d.ts +2 -1
- package/lib/data/PredictionManager.js +16 -2
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/constants/DefaultApodizationOptions.d.ts +2 -0
- package/lib/data/constants/DefaultApodizationOptions.js +5 -0
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +1 -5
- package/lib/data/data1d/Spectrum1D/index.js +1 -5
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -24
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +37 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +1 -1
- package/lib/data/data1d/database.js +2 -4
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +3 -30
- package/lib/data/data1d/multipleSpectraAnalysis.js +4 -15
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib/data/data2d/Spectrum2D/getSlice.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -1
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +3 -2
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/types/data1d/ComplexData1D.d.ts +2 -2
- package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
- package/lib/data/utilities/FindUtilities.d.ts +2 -1
- package/lib/data/utilities/RangeUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/calculateSanPlot.d.ts +2 -2
- package/lib/types/NMRiumDataReturn.d.ts +1 -3
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +28 -5
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +3 -26
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +5 -28
- package/lib-cjs/component/1d/FooterBanner.js +2 -2
- package/lib-cjs/component/1d/SpectraLegends.js +1 -2
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -3
- package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
- package/lib-cjs/component/1d-2d/tools/BrushX.js +1 -2
- package/lib-cjs/component/1d-2d/tools/BrushXY.js +1 -2
- package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +2 -3
- package/lib-cjs/component/2d/Chart2D.js +4 -4
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +36 -22
- package/lib-cjs/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib-cjs/component/NMRium.js +8 -11
- package/lib-cjs/component/elements/Button.js +16 -25
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +5 -2
- package/lib-cjs/component/elements/Input.js +2 -4
- package/lib-cjs/component/elements/Label.js +2 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +14 -16
- package/lib-cjs/component/elements/NextPrev.js +26 -8
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +20 -16
- package/lib-cjs/component/elements/formik/FormikInput.js +10 -6
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +6 -5
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +15 -6
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
- package/lib-cjs/component/header/PhaseCorrectionPanel.js +6 -26
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -25
- package/lib-cjs/component/hooks/useCheckPointsNumberInWindowArea.js +24 -0
- package/lib-cjs/component/hooks/useExport.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +4 -0
- package/lib-cjs/component/hooks/useSaveSettings.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +60 -67
- package/lib-cjs/component/modal/ModalStyle.js +0 -10
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib-cjs/component/modal/PredictSpectraModal.js +43 -126
- package/lib-cjs/component/modal/SaveAsModal.js +22 -14
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +24 -37
- package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -6
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +6 -14
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +19 -24
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +76 -86
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +38 -52
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +11 -28
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +25 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib-cjs/component/panels/header/PanelHeader.js +15 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +122 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +107 -37
- package/lib-cjs/component/panels/predictionPanel/PredictionPreferences.js +29 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +72 -0
- package/lib-cjs/component/reducer/Reducer.js +2 -27
- package/lib-cjs/component/reducer/actions/FiltersActions.js +66 -94
- package/lib-cjs/component/reducer/actions/HistoryActions.js +45 -0
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +58 -32
- package/lib-cjs/component/reducer/actions/PeaksActions.js +3 -3
- package/lib-cjs/component/reducer/actions/RangesActions.js +7 -52
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +4 -27
- package/lib-cjs/component/reducer/actions/ZonesActions.js +4 -28
- package/lib-cjs/component/toolbar/BasicToolBar.js +5 -10
- package/lib-cjs/component/toolbar/ToolTypes.js +9 -32
- package/lib-cjs/component/workspaces/prediction.js +193 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +21 -44
- package/lib-cjs/data/PredictionManager.js +16 -2
- package/lib-cjs/data/constants/DefaultApodizationOptions.js +8 -0
- package/lib-cjs/data/data1d/Spectrum1D/index.js +7 -11
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -32
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +7 -26
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +3 -4
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib-cjs/data/data1d/database.js +2 -4
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +5 -16
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -26
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +2 -25
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +25 -25
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +0 -7
- package/lib/component/panels/predictionPanel/PredictionOptions.js +0 -74
- package/lib/component/workspaces/Workspace.d.ts +0 -188
- package/lib/component/workspaces/Workspace.js +0 -1
- package/lib/data/Filters.d.ts +0 -12
- package/lib/data/Filters.js +0 -12
- package/lib/data/FiltersManager.d.ts +0 -30
- package/lib/data/FiltersManager.js +0 -175
- package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.js +0 -6
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -4
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +0 -7
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -9
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +0 -12
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -36
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -6
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -26
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +0 -3
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -45
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -7
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +0 -4
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -78
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -9
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -5
- package/lib/data/data1d/filter1d/apodization.d.ts +0 -27
- package/lib/data/data1d/filter1d/apodization.js +0 -81
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +0 -33
- package/lib/data/data1d/filter1d/baselineCorrection.js +0 -51
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +0 -20
- package/lib/data/data1d/filter1d/digitalFilter.js +0 -44
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +0 -33
- package/lib/data/data1d/filter1d/equallySpaced.js +0 -52
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +0 -15
- package/lib/data/data1d/filter1d/exclusionZones.js +0 -32
- package/lib/data/data1d/filter1d/fft.d.ts +0 -18
- package/lib/data/data1d/filter1d/fft.js +0 -90
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +0 -26
- package/lib/data/data1d/filter1d/phaseCorrection.js +0 -64
- package/lib/data/data1d/filter1d/shiftX.d.ts +0 -20
- package/lib/data/data1d/filter1d/shiftX.js +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.d.ts +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.js +0 -65
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +0 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -35
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +0 -22
- package/lib/data/data1d/filter1d/zeroFilling.js +0 -60
- package/lib/data/data2d/filter2d/shiftX.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftX.js +0 -27
- package/lib/data/data2d/filter2d/shiftY.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftY.js +0 -27
- package/lib/data/types/view-state/PeaksViewState.d.ts +0 -17
- package/lib/data/types/view-state/PeaksViewState.js +0 -1
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -7
- package/lib/types/NMRiumGeneralPreferences.js +0 -1
- package/lib/types/NMRiumPanelPreferences.d.ts +0 -17
- package/lib/types/NMRiumPanelPreferences.js +0 -1
- package/lib/types/NMRiumToolBarPreferences.d.ts +0 -22
- package/lib/types/NMRiumToolBarPreferences.js +0 -1
- package/lib/types/PanelPreferencesType.d.ts +0 -4
- package/lib/types/PanelPreferencesType.js +0 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +0 -102
- package/lib-cjs/component/workspaces/Workspace.js +0 -2
- package/lib-cjs/data/Filters.js +0 -38
- package/lib-cjs/data/FiltersManager.js +0 -206
- package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +0 -33
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -8
- package/lib-cjs/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -40
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -10
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -30
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -49
- package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -11
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -82
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/filter1d/apodization.js +0 -88
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +0 -60
- package/lib-cjs/data/data1d/filter1d/digitalFilter.js +0 -50
- package/lib-cjs/data/data1d/filter1d/equallySpaced.js +0 -61
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +0 -38
- package/lib-cjs/data/data1d/filter1d/fft.js +0 -96
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +0 -70
- package/lib-cjs/data/data1d/filter1d/shiftX.js +0 -32
- package/lib-cjs/data/data1d/filter1d/signalProcessing.js +0 -95
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -39
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +0 -66
- package/lib-cjs/data/data2d/filter2d/shiftX.js +0 -33
- package/lib-cjs/data/data2d/filter2d/shiftY.js +0 -33
- package/lib-cjs/data/types/view-state/PeaksViewState.js +0 -2
- package/lib-cjs/types/NMRiumGeneralPreferences.js +0 -2
- package/lib-cjs/types/NMRiumPanelPreferences.js +0 -2
- package/lib-cjs/types/NMRiumToolBarPreferences.js +0 -2
- package/lib-cjs/types/PanelPreferencesType.js +0 -2
|
@@ -8,7 +8,7 @@ import { useModal } from '../elements/popup/Modal';
|
|
|
8
8
|
import { positions } from '../elements/popup/options';
|
|
9
9
|
import { ModalStyles } from './ModalStyle';
|
|
10
10
|
function MoleculeStructureEditorModal(props) {
|
|
11
|
-
const { onClose = () => null, selectedMolecule } = props;
|
|
11
|
+
const { onClose = () => null, selectedMolecule, floatMoleculeOnSave = false, } = props;
|
|
12
12
|
const [molfile, setMolfile] = useState(null);
|
|
13
13
|
const dispatch = useDispatch();
|
|
14
14
|
useEffect(() => {
|
|
@@ -45,21 +45,27 @@ function MoleculeStructureEditorModal(props) {
|
|
|
45
45
|
onClose('replace');
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
|
-
dispatch({
|
|
48
|
+
dispatch({
|
|
49
|
+
type: 'ADD_MOLECULE',
|
|
50
|
+
payload: {
|
|
51
|
+
molfile,
|
|
52
|
+
floatMoleculeOnSave,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
49
55
|
onClose('new');
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
|
-
}, [
|
|
58
|
+
}, [molfile, selectedMolecule, dispatch, floatMoleculeOnSave, onClose]);
|
|
53
59
|
return (_jsxs("div", { css: ModalStyles, children: [_jsx(StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleClose }) })] }));
|
|
54
60
|
}
|
|
55
|
-
export function useMoleculeEditor() {
|
|
61
|
+
export function useMoleculeEditor(floatMoleculeOnSave = false) {
|
|
56
62
|
const modal = useModal();
|
|
57
63
|
return useCallback((molecule) => {
|
|
58
|
-
modal.show(_jsx(MoleculeStructureEditorModal, { selectedMolecule: molecule }), {
|
|
64
|
+
modal.show(_jsx(MoleculeStructureEditorModal, { selectedMolecule: molecule, floatMoleculeOnSave: floatMoleculeOnSave }), {
|
|
59
65
|
position: positions.TOP_CENTER,
|
|
60
66
|
width: 700,
|
|
61
67
|
height: 500,
|
|
62
68
|
});
|
|
63
|
-
}, [modal]);
|
|
69
|
+
}, [floatMoleculeOnSave, modal]);
|
|
64
70
|
}
|
|
65
71
|
export default MoleculeStructureEditorModal;
|
|
@@ -2,11 +2,11 @@ import { Spectrum } from 'nmr-load-save';
|
|
|
2
2
|
import { ActiveSpectrum } from '../reducer/Reducer';
|
|
3
3
|
interface MultipletAnalysisModalProps {
|
|
4
4
|
data: Spectrum[];
|
|
5
|
-
activeSpectrum: ActiveSpectrum;
|
|
5
|
+
activeSpectrum: ActiveSpectrum | null;
|
|
6
6
|
scaleX: any;
|
|
7
7
|
startX: any;
|
|
8
8
|
endX: any;
|
|
9
|
-
onClose
|
|
9
|
+
onClose?: (element?: string) => void;
|
|
10
10
|
}
|
|
11
11
|
export default function MultipletAnalysisModal({ data, activeSpectrum, scaleX, startX, endX, onClose, }: MultipletAnalysisModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { StateMoleculeExtended } from '../../data/molecules/Molecule';
|
|
1
2
|
interface PredictSpectraModalProps {
|
|
2
3
|
onClose?: (element?: string) => void;
|
|
3
|
-
|
|
4
|
+
molecule: StateMoleculeExtended;
|
|
4
5
|
}
|
|
5
|
-
declare function PredictSpectraModal({ onClose,
|
|
6
|
+
declare function PredictSpectraModal({ onClose, molecule, }: PredictSpectraModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function usePredictSpectraModal(): (molecule: StateMoleculeExtended) => void;
|
|
6
8
|
export default PredictSpectraModal;
|
|
@@ -1,50 +1,24 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { Formik } from 'formik';
|
|
5
4
|
import { useCallback, useRef, useState, useMemo } from 'react';
|
|
6
|
-
import
|
|
7
|
-
import { defaultPredictionOptions, FREQUENCIES, } from '../../data/PredictionManager';
|
|
8
|
-
import generateNumbersPowerOfX from '../../data/utilities/generateNumbersPowerOfX';
|
|
5
|
+
import { defaultPredictionOptions, predictSpectra, } from '../../data/PredictionManager';
|
|
9
6
|
import { useChartData } from '../context/ChartContext';
|
|
10
7
|
import { useDispatch } from '../context/DispatchContext';
|
|
11
8
|
import Button from '../elements/Button';
|
|
12
9
|
import CheckBox from '../elements/CheckBox';
|
|
13
10
|
import CloseButton from '../elements/CloseButton';
|
|
14
|
-
import IsotopesViewer from '../elements/IsotopesViewer';
|
|
15
|
-
import Label from '../elements/Label';
|
|
16
|
-
import FormikCheckBox from '../elements/formik/FormikCheckBox';
|
|
17
|
-
import FormikErrorsSummary from '../elements/formik/FormikErrorsSummary';
|
|
18
|
-
import FormikInput from '../elements/formik/FormikInput';
|
|
19
|
-
import FormikSelect from '../elements/formik/FormikSelect';
|
|
20
11
|
import { useAlert } from '../elements/popup/Alert';
|
|
12
|
+
import { useModal } from '../elements/popup/Modal';
|
|
13
|
+
import { positions } from '../elements/popup/options';
|
|
14
|
+
import PredictionPreferences from '../panels/predictionPanel/PredictionOptionsPanel';
|
|
21
15
|
import { useStateWithLocalStorage } from '../utility/LocalStorage';
|
|
22
16
|
import { ModalStyles } from './ModalStyle';
|
|
23
17
|
const styles = css `
|
|
24
|
-
.row {
|
|
25
|
-
align-items: center;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
18
|
.inner-content {
|
|
29
19
|
flex: 1;
|
|
30
20
|
}
|
|
31
21
|
|
|
32
|
-
.custom-label {
|
|
33
|
-
width: 160px;
|
|
34
|
-
font-weight: 500;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.nucleus-label {
|
|
38
|
-
padding: 0 10px;
|
|
39
|
-
color: black;
|
|
40
|
-
font-weight: 700;
|
|
41
|
-
|
|
42
|
-
&.disabled {
|
|
43
|
-
opacity: 0.5;
|
|
44
|
-
color: black;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
22
|
.warning {
|
|
49
23
|
color: #c40000;
|
|
50
24
|
font-weight: bold;
|
|
@@ -61,59 +35,8 @@ const styles = css `
|
|
|
61
35
|
margin: 5px 5px 5px 0;
|
|
62
36
|
}
|
|
63
37
|
}
|
|
64
|
-
|
|
65
|
-
.middle-x {
|
|
66
|
-
padding: 0 10px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.group-label {
|
|
70
|
-
width: 100%;
|
|
71
|
-
display: block;
|
|
72
|
-
border-bottom: 1px solid #efefef;
|
|
73
|
-
padding-bottom: 5px;
|
|
74
|
-
font-weight: 600;
|
|
75
|
-
color: #005d9e;
|
|
76
|
-
}
|
|
77
38
|
`;
|
|
78
|
-
|
|
79
|
-
const NUMBER_OF_POINTS_2D = generateNumbersPowerOfX(10, 10, {
|
|
80
|
-
format: (value) => value,
|
|
81
|
-
});
|
|
82
|
-
const predictionFormValidation = Yup.object().shape({
|
|
83
|
-
name: Yup.string().required().label('Name'),
|
|
84
|
-
frequency: Yup.number().integer().required().label('Frequency'),
|
|
85
|
-
'1d': Yup.object({
|
|
86
|
-
'1H': Yup.object({
|
|
87
|
-
from: Yup.number().required().label("1H ' From ' "),
|
|
88
|
-
to: Yup.number().required().label("1H ' To ' "),
|
|
89
|
-
}),
|
|
90
|
-
'13C': Yup.object().shape({
|
|
91
|
-
from: Yup.number().required().label("13C ' From ' "),
|
|
92
|
-
to: Yup.number().required().label("13C ' To ' "),
|
|
93
|
-
}),
|
|
94
|
-
lineWidth: Yup.number().integer().min(1).required().label('Line Width'),
|
|
95
|
-
nbPoints: Yup.number().integer().required().label('1D Number Of Points'),
|
|
96
|
-
}),
|
|
97
|
-
'2d': Yup.object({
|
|
98
|
-
nbPoints: Yup.object({
|
|
99
|
-
x: Yup.number().integer().required().label('2D Number Of Points'),
|
|
100
|
-
y: Yup.number().integer().required().label('2D Number Of Points'),
|
|
101
|
-
}),
|
|
102
|
-
}),
|
|
103
|
-
spectra: Yup.object({
|
|
104
|
-
proton: Yup.boolean(),
|
|
105
|
-
carbon: Yup.boolean(),
|
|
106
|
-
cosy: Yup.boolean(),
|
|
107
|
-
hsqc: Yup.boolean(),
|
|
108
|
-
hmbc: Yup.boolean(),
|
|
109
|
-
}).test('check-options', 'You must check one of the options to start prediction', (obj) => {
|
|
110
|
-
if (Object.values(obj).includes(true)) {
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
return false;
|
|
114
|
-
}),
|
|
115
|
-
});
|
|
116
|
-
function PredictSpectraModal({ onClose = () => null, molfile, }) {
|
|
39
|
+
function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
117
40
|
const refForm = useRef();
|
|
118
41
|
const dispatch = useDispatch();
|
|
119
42
|
const alert = useAlert();
|
|
@@ -132,35 +55,50 @@ function PredictSpectraModal({ onClose = () => null, molfile, }) {
|
|
|
132
55
|
}, [predictionPreferences, predictionIndex]);
|
|
133
56
|
const submitHandler = useCallback((values) => {
|
|
134
57
|
void (async () => {
|
|
135
|
-
if (
|
|
58
|
+
if (molecule) {
|
|
59
|
+
const { molfile } = molecule;
|
|
136
60
|
setPredictionPreferences({ ...values, isApproved });
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
payload: {
|
|
140
|
-
isLoading: true,
|
|
141
|
-
},
|
|
142
|
-
});
|
|
143
|
-
const predictedSpectra = Object.entries(values.spectra)
|
|
144
|
-
.map(([key, value]) => {
|
|
61
|
+
const predictedSpectra = [];
|
|
62
|
+
for (const [key, value] of Object.entries(values.spectra)) {
|
|
145
63
|
if (value) {
|
|
146
|
-
|
|
64
|
+
predictedSpectra.push(key);
|
|
147
65
|
}
|
|
148
|
-
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
66
|
+
}
|
|
67
|
+
const hideLoading = await alert.showLoading(`Predict ${predictedSpectra.join(',')} in progress`);
|
|
68
|
+
try {
|
|
69
|
+
const data = await predictSpectra(molfile);
|
|
70
|
+
dispatch({
|
|
71
|
+
type: 'PREDICT_SPECTRA',
|
|
72
|
+
payload: {
|
|
73
|
+
predictedSpectra: data.spectra,
|
|
74
|
+
options: values,
|
|
75
|
+
molecule,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
alert.error(error?.message);
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
hideLoading();
|
|
84
|
+
onClose();
|
|
85
|
+
}
|
|
158
86
|
}
|
|
159
87
|
})();
|
|
160
|
-
}, [alert, dispatch, isApproved,
|
|
88
|
+
}, [alert, dispatch, isApproved, molecule, onClose, setPredictionPreferences]);
|
|
161
89
|
const approveCheckHandler = useCallback((e) => {
|
|
162
90
|
setApproved(e.target.checked);
|
|
163
91
|
}, []);
|
|
164
|
-
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Prediction of NMR spectrum" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsxs("div", { className: "inner-content", children: [_jsx(
|
|
92
|
+
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Prediction of NMR spectrum" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsxs("div", { className: "inner-content", children: [_jsx(PredictionPreferences, { onSubmit: submitHandler, options: initValues, ref: refForm }), _jsx("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), _jsxs("div", { className: "warning-container", children: [_jsx(CheckBox, { onChange: approveCheckHandler, checked: isApproved }, String(isApproved)), _jsx("p", { children: "I confirm that the chemical structure is not confidential." })] })] }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] }));
|
|
93
|
+
}
|
|
94
|
+
export function usePredictSpectraModal() {
|
|
95
|
+
const modal = useModal();
|
|
96
|
+
return (molecule) => {
|
|
97
|
+
modal.show(_jsx(PredictSpectraModal, { molecule: molecule }), {
|
|
98
|
+
position: positions.TOP_CENTER,
|
|
99
|
+
enableResizing: true,
|
|
100
|
+
width: 600,
|
|
101
|
+
});
|
|
102
|
+
};
|
|
165
103
|
}
|
|
166
104
|
export default PredictSpectraModal;
|
|
@@ -7,6 +7,7 @@ import { DataExportOptions } from '../../data/SpectraManager';
|
|
|
7
7
|
import { useChartData } from '../context/ChartContext';
|
|
8
8
|
import ActionButtons from '../elements/ActionButtons';
|
|
9
9
|
import CloseButton from '../elements/CloseButton';
|
|
10
|
+
import Label from '../elements/Label';
|
|
10
11
|
import FormikCheckBox from '../elements/formik/FormikCheckBox';
|
|
11
12
|
import FormikInput from '../elements/formik/FormikInput';
|
|
12
13
|
import { ModalStyles } from './ModalStyle';
|
|
@@ -15,15 +16,6 @@ const styles = css `
|
|
|
15
16
|
flex: 1;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
.custom-label {
|
|
19
|
-
width: 100px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.name {
|
|
23
|
-
width: 100% !important;
|
|
24
|
-
text-align: left !important;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
19
|
.data-export-group {
|
|
28
20
|
label {
|
|
29
21
|
margin-right: 10px;
|
|
@@ -45,6 +37,20 @@ const INITIAL_VALUE = {
|
|
|
45
37
|
settings: false,
|
|
46
38
|
},
|
|
47
39
|
};
|
|
40
|
+
export const labelStyle = {
|
|
41
|
+
label: {
|
|
42
|
+
flex: 4,
|
|
43
|
+
fontSize: '12px',
|
|
44
|
+
fontWeight: 'bold',
|
|
45
|
+
color: '#232323',
|
|
46
|
+
},
|
|
47
|
+
wrapper: {
|
|
48
|
+
flex: 8,
|
|
49
|
+
display: 'flex',
|
|
50
|
+
justifyContent: 'flex-start',
|
|
51
|
+
},
|
|
52
|
+
container: { padding: '5px 0' },
|
|
53
|
+
};
|
|
48
54
|
function SaveAsModal({ onClose, onSave, name }) {
|
|
49
55
|
const refForm = useRef();
|
|
50
56
|
const { source } = useChartData();
|
|
@@ -55,10 +61,11 @@ function SaveAsModal({ onClose, onSave, name }) {
|
|
|
55
61
|
onSave(values);
|
|
56
62
|
onClose?.();
|
|
57
63
|
}, [onClose, onSave]);
|
|
58
|
-
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Save as ... " }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { innerRef: refForm, initialValues: { ...INITIAL_VALUE, name }, onSubmit: submitHandler, children: _jsxs(_Fragment, { children: [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Save as ... " }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { innerRef: refForm, initialValues: { ...INITIAL_VALUE, name }, onSubmit: submitHandler, children: _jsxs(_Fragment, { children: [_jsx(Label, { style: labelStyle, title: "Name", children: _jsx(FormikInput, { name: "name", className: "name", style: {
|
|
65
|
+
inputWrapper: { width: '100%' },
|
|
66
|
+
input: { padding: '5px', textAlign: 'left' },
|
|
67
|
+
} }) }), _jsx(Label, { style: labelStyle, title: "Compressed", children: _jsx(FormikCheckBox, { name: "compressed" }) }), _jsx(Label, { style: labelStyle, title: "Pretty Format", children: _jsx(FormikCheckBox, { name: "pretty" }) }), _jsx(Label, { style: labelStyle, title: "Include view", children: _jsx(FormikCheckBox, { name: "include.view" }) }), _jsx(Label, { style: labelStyle, title: "Include settings", children: _jsx(FormikCheckBox, { name: "include.settings" }) }), _jsx(Label, { style: labelStyle, title: "Include Data", children: _jsx("div", { style: { display: 'flex', flexDirection: 'column' }, children: _jsxs("div", { className: "data-export-group", children: [_jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.ROW_DATA }), "Raw Data"] }), _jsxs("label", { style: {
|
|
68
|
+
color: source ? 'black' : 'lightgray',
|
|
69
|
+
}, children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.DATA_SOURCE, disabled: !source }), "Data Source"] }), _jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.NO_DATA }), "No Data"] })] }) }) })] }) }) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: () => onClose?.() }) })] }));
|
|
63
70
|
}
|
|
64
71
|
export default SaveAsModal;
|
|
@@ -2,9 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { Formik } from 'formik';
|
|
5
|
-
import {
|
|
5
|
+
import { useEffect, useRef, useState } from 'react';
|
|
6
6
|
import * as Yup from 'yup';
|
|
7
7
|
import { usePreferences } from '../../context/PreferencesContext';
|
|
8
|
+
import Button from '../../elements/Button';
|
|
8
9
|
import CloseButton from '../../elements/CloseButton';
|
|
9
10
|
import Tab from '../../elements/Tab/Tab';
|
|
10
11
|
import Tabs from '../../elements/Tab/Tabs';
|
|
@@ -43,38 +44,40 @@ const styles = css `
|
|
|
43
44
|
text-align: center;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
.footer-container {
|
|
48
|
-
button {
|
|
49
|
-
width: 20%;
|
|
50
|
-
color: white;
|
|
51
|
-
background-color: gray !important;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
button:hover {
|
|
55
|
-
border: 1px solid gray;
|
|
56
|
-
color: gray;
|
|
57
|
-
background-color: white !important;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
47
|
`;
|
|
61
48
|
var SumSetOptions;
|
|
62
49
|
(function (SumSetOptions) {
|
|
63
50
|
SumSetOptions["Auto"] = "auto";
|
|
64
51
|
SumSetOptions["Manual"] = "manual";
|
|
65
52
|
})(SumSetOptions || (SumSetOptions = {}));
|
|
53
|
+
function getValidationSchema(option) {
|
|
54
|
+
switch (option) {
|
|
55
|
+
case SumSetOptions.Auto: {
|
|
56
|
+
return Yup.object({
|
|
57
|
+
molecule: Yup.object().required(),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
case SumSetOptions.Manual: {
|
|
61
|
+
return Yup.object({
|
|
62
|
+
sum: Yup.number().required(),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
default:
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
66
69
|
export default function ChangeSumModal({ onSave, onClose, header, sumOptions, }) {
|
|
67
70
|
const { current: { display: { panels }, }, } = usePreferences();
|
|
68
71
|
const [setOption, setActiveOption] = useState(SumSetOptions.Auto);
|
|
69
72
|
const formRef = useRef(null);
|
|
70
|
-
|
|
73
|
+
function handleKeyDown(event) {
|
|
71
74
|
if (event.key === 'Enter') {
|
|
72
75
|
formRef.current.submitForm();
|
|
73
76
|
}
|
|
74
|
-
}
|
|
75
|
-
|
|
77
|
+
}
|
|
78
|
+
function onTabChangeHandler(tab) {
|
|
76
79
|
setActiveOption(tab.tabid);
|
|
77
|
-
}
|
|
80
|
+
}
|
|
78
81
|
useEffect(() => {
|
|
79
82
|
if (sumOptions?.sumAuto && panels?.structuresPanel?.display) {
|
|
80
83
|
setActiveOption(SumSetOptions.Auto);
|
|
@@ -89,7 +92,7 @@ export default function ChangeSumModal({ onSave, onClose, header, sumOptions, })
|
|
|
89
92
|
formRef.current.setValues({ sum: sumOptions?.sum || '', molecule: null });
|
|
90
93
|
}
|
|
91
94
|
}, [panels?.structuresPanel, sumOptions]);
|
|
92
|
-
|
|
95
|
+
function saveHandler(values) {
|
|
93
96
|
switch (setOption) {
|
|
94
97
|
case SumSetOptions.Auto: {
|
|
95
98
|
const { molecule: { mf, id: moleculeId }, } = values;
|
|
@@ -105,25 +108,9 @@ export default function ChangeSumModal({ onSave, onClose, header, sumOptions, })
|
|
|
105
108
|
return;
|
|
106
109
|
}
|
|
107
110
|
onClose();
|
|
108
|
-
}
|
|
109
|
-
const validationSchema = useMemo(() => {
|
|
110
|
-
switch (setOption) {
|
|
111
|
-
case SumSetOptions.Auto: {
|
|
112
|
-
return Yup.object({
|
|
113
|
-
molecule: Yup.object().required(),
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
case SumSetOptions.Manual: {
|
|
117
|
-
return Yup.object({
|
|
118
|
-
sum: Yup.number().required(),
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
default:
|
|
122
|
-
return null;
|
|
123
|
-
}
|
|
124
|
-
}, [setOption]);
|
|
111
|
+
}
|
|
125
112
|
const isStructurePanelVisible = panels?.structuresPanel?.display || false;
|
|
126
113
|
return (
|
|
127
114
|
// <div css={modalContainer}>
|
|
128
|
-
_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: header }), _jsx(CloseButton, { onClick: onClose })] }), _jsx("div", { className: "tab-content", children: _jsx(Formik, { innerRef: formRef, onSubmit: saveHandler, initialValues: { sum:
|
|
115
|
+
_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: header }), _jsx(CloseButton, { onClick: onClose })] }), _jsx("div", { className: "tab-content", children: _jsx(Formik, { innerRef: formRef, onSubmit: saveHandler, initialValues: { sum: '', molecule: null }, validationSchema: getValidationSchema(setOption), children: _jsxs(Tabs, { activeTab: setOption, onClick: onTabChangeHandler, children: [isStructurePanelVisible && (_jsx(Tab, { title: "Auto", tabid: SumSetOptions.Auto, children: _jsx(SelectMolecule, { name: "molecule" }) })), _jsx(Tab, { title: "Manual", tabid: SumSetOptions.Manual, children: _jsx("div", { className: "manual-container", children: _jsx(FormikInput, { name: "sum", type: "number", nullable: true, placeholder: "Enter the new value", onKeyDown: handleKeyDown }) }) })] }) }) }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: () => formRef.current.submitForm(), style: { width: '80px' }, children: "Set" }) })] }));
|
|
129
116
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { WorkSpacePanelPreferences } from 'nmr-load-save';
|
|
3
|
+
import { Range } from 'nmr-processing';
|
|
4
4
|
interface SignalsFormProps {
|
|
5
5
|
range: Range;
|
|
6
6
|
preferences: WorkSpacePanelPreferences['ranges'];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
2
3
|
import { Formik } from 'formik';
|
|
3
4
|
import { useState, useMemo, useRef, useEffect } from 'react';
|
|
4
5
|
import { DropZone } from 'react-science/ui';
|
|
@@ -60,7 +61,7 @@ const rowColors = {
|
|
|
60
61
|
};
|
|
61
62
|
const validationSchema = Yup.object({
|
|
62
63
|
source: Yup.string().required(),
|
|
63
|
-
target: Yup.array(Yup.string()).min(1),
|
|
64
|
+
target: Yup.array(Yup.string()).min(1).required(),
|
|
64
65
|
});
|
|
65
66
|
function MetaImportationModal({ onClose, file }) {
|
|
66
67
|
const alert = useAlert();
|
|
@@ -86,7 +87,9 @@ function MetaImportationModal({ onClose, file }) {
|
|
|
86
87
|
};
|
|
87
88
|
}, [file]);
|
|
88
89
|
function handleDrop(files) {
|
|
89
|
-
|
|
90
|
+
if (files[0]) {
|
|
91
|
+
handleParseFile(files[0]);
|
|
92
|
+
}
|
|
90
93
|
}
|
|
91
94
|
const errors = mapErrors(parseResult?.errors || []);
|
|
92
95
|
const metaData = parseResult?.data || [];
|
|
@@ -167,14 +170,21 @@ function MetaImportationModal({ onClose, file }) {
|
|
|
167
170
|
}
|
|
168
171
|
return (_jsxs("div", { css: ModalStyles, style: { overflow: 'hidden' }, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Import Meta Information" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { style: styles.container, children: _jsx("div", { style: { flex: 1, width: '100%' }, children: !parseResult ? (_jsx(DropZone, { fileValidator: fileValidator, color: "gray", emptyText: "Drag and Drop CSV or tab-delimited file (.csv, .txt or .tsv)", onDrop: handleDrop })) : (_jsxs(_Fragment, { children: [_jsxs("div", { style: { height: '130px' }, children: [_jsx(Formik, { innerRef: formRef, initialValues: {
|
|
169
172
|
source: null,
|
|
170
|
-
target:
|
|
173
|
+
target: '',
|
|
171
174
|
}, onSubmit: handleLinkSpectra, validationSchema: validationSchema, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "Source field", style: { label: { width: '100px' } }, children: _jsx(FormikSelect, { name: "source", items: mapColumnToSelectItems(parseResult?.meta.fields || []), style: {
|
|
172
175
|
width: '300px',
|
|
173
|
-
padding: '
|
|
176
|
+
padding: '5px',
|
|
174
177
|
margin: 0,
|
|
175
178
|
} }) }), _jsx(Label, { title: "Target field path", style: {
|
|
176
179
|
label: { width: '100px', padding: '20px 0px' },
|
|
177
|
-
}, children: _jsx(FormikInput, { name: "target", style: {
|
|
180
|
+
}, children: _jsx(FormikInput, { name: "target", style: {
|
|
181
|
+
input: {
|
|
182
|
+
width: '300px',
|
|
183
|
+
textAlign: 'left',
|
|
184
|
+
padding: '5px',
|
|
185
|
+
fontSize: '14px',
|
|
186
|
+
},
|
|
187
|
+
}, placeholder: "Example: info.plus", datalist: datalist, nullable: true, mapOnChangeValue: (key) => paths?.[key] || null, mapValue: (paths) => convertPathArrayToString(paths) }) })] }) }), _jsx(Button.Done, { onClick: () => formRef.current?.submitForm(), children: "Link Spectra" })] }), _jsx("div", { style: { height: 'calc(100% - 160px)' }, children: _jsx(ReactTable, { columns: columns, data: metaData, approxItemHeight: 25, approxColumnWidth: 100, enableVirtualScroll: true, enableColumnsVirtualScroll: true, activeRow: handleActiveRow, rowStyle: handleRowStyle }) })] })) }) }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleImport, disabled: Object.keys(matches).length === 0, children: "Import" }) })] }));
|
|
178
188
|
}
|
|
179
189
|
function fileValidator(file) {
|
|
180
190
|
if (!isMetaFile(file)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { CustomWorkspaces } from 'nmr-load-save';
|
|
1
2
|
import { NMRiumWorkspace } from '../../../NMRium';
|
|
2
|
-
import { CustomWorkspaces } from '../../../workspaces/Workspace';
|
|
3
3
|
interface DatabasesTabContentProps {
|
|
4
4
|
currentWorkspace: NMRiumWorkspace;
|
|
5
5
|
originalWorkspaces: CustomWorkspaces;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Integral } from 'nmr-
|
|
2
|
+
import { Integral } from 'nmr-processing';
|
|
3
3
|
import { IntegralPanelInnerProps } from './IntegralPanel';
|
|
4
4
|
interface IntegralTableProps extends Pick<IntegralPanelInnerProps, 'activeTab'> {
|
|
5
5
|
data: Array<Integral>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Formik } from 'formik';
|
|
3
3
|
import { useCallback, useImperativeHandle, useRef, memo, forwardRef, useMemo, } from 'react';
|
|
4
4
|
import { usePreferences } from '../../context/PreferencesContext';
|
|
5
5
|
import Label from '../../elements/Label';
|
|
6
6
|
import FormikColorInput from '../../elements/formik/FormikColorInput';
|
|
7
|
+
import { formatFieldLabelStyle } from '../../elements/formik/FormikColumnFormatField';
|
|
7
8
|
import FormikNumberInput from '../../elements/formik/FormikNumberInput';
|
|
8
9
|
import useNucleus from '../../hooks/useNucleus';
|
|
9
10
|
import { usePanelPreferencesByNuclei } from '../../hooks/usePanelPreferences';
|
|
@@ -47,19 +48,10 @@ function IntegralsPreferences(props, ref) {
|
|
|
47
48
|
formRef.current.submitForm();
|
|
48
49
|
},
|
|
49
50
|
}));
|
|
50
|
-
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => (_jsxs(_Fragment, { children: [_jsx(FormikColorInput, { name: `nuclei.${n}.color` }), _jsx(Label, { title: "stroke width :", style: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
flex: 2,
|
|
56
|
-
},
|
|
57
|
-
wrapper: {
|
|
58
|
-
flex: 4,
|
|
59
|
-
},
|
|
60
|
-
}, children: _jsx(FormikNumberInput, { name: `nuclei.${n}.strokeWidth`, style: {
|
|
61
|
-
width: '60%',
|
|
62
|
-
textAlign: 'center',
|
|
63
|
-
}, min: 1, max: 9, pattern: "[1-9]+" }) })] })) }, n))) }) }) }));
|
|
51
|
+
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Color", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex', padding: '2px 0' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikColorInput, { name: `nuclei.${n}.color` })] }) }), _jsx(Label, { title: "stroke width :", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex', padding: '2px 0' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikNumberInput, { name: `nuclei.${n}.strokeWidth`, style: {
|
|
52
|
+
width: '60%',
|
|
53
|
+
textAlign: 'center',
|
|
54
|
+
padding: '2px',
|
|
55
|
+
}, min: 1, max: 9, pattern: "[1-9]+" })] }) })] })) }, n))) }) }) }));
|
|
64
56
|
}
|
|
65
57
|
export default memo(forwardRef(IntegralsPreferences));
|
|
@@ -4,13 +4,13 @@ import { MF } from 'react-mf';
|
|
|
4
4
|
import { extractLabelsNumbers, extractNumber, } from '../../../data/molecules/MoleculeManager';
|
|
5
5
|
import { useDispatch } from '../../context/DispatchContext';
|
|
6
6
|
import EditableColumn from '../../elements/EditableColumn';
|
|
7
|
+
import Label from '../../elements/Label';
|
|
7
8
|
const styles = {
|
|
8
9
|
toolbar: {
|
|
9
10
|
display: 'flex',
|
|
10
11
|
borderBottom: '0.55px solid rgb(240, 240, 240)',
|
|
11
12
|
padding: '5px 10px',
|
|
12
13
|
justifyContent: 'space-between',
|
|
13
|
-
height: '35px',
|
|
14
14
|
},
|
|
15
15
|
labelInput: {
|
|
16
16
|
width: '150px',
|
|
@@ -33,5 +33,5 @@ export default function MoleculeHeader(props) {
|
|
|
33
33
|
const label = event.target.value;
|
|
34
34
|
dispatch({ type: 'CHANGE_MOLECULE_LABEL', payload: { label, id } });
|
|
35
35
|
}, [dispatch]);
|
|
36
|
-
return (_jsxs("div", { style: styles.toolbar, children: [
|
|
36
|
+
return (_jsxs("div", { style: styles.toolbar, children: [_jsx(Label, { title: "Label", children: _jsx(EditableColumn, { value: currentMolecule.label, style: styles.labelInput, validate: validateLabel, onSave: (event) => saveLabelHandler(currentMolecule.id, event), textOverFlowEllipses: true }) }), _jsxs("span", { children: [_jsx(MF, { mf: currentMolecule.mf }), " - ", currentMolecule.mw?.toFixed(2)] })] }));
|
|
37
37
|
}
|