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.
- 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/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/KeysListenerTracker.js +90 -67
- package/lib/component/EventsTrackers/MouseTracker.d.ts +6 -2
- package/lib/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib/component/NMRium.d.ts +5 -5
- package/lib/component/NMRium.js +15 -16
- package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
- package/lib/component/context/LoggerContext.js +5 -0
- package/lib/component/context/PreferencesContext.d.ts +10 -8
- 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/FormikError.d.ts +8 -0
- package/lib/component/elements/formik/FormikError.js +22 -0
- 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 +17 -15
- 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 +56 -74
- 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 +53 -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/EditRangeModal.d.ts +7 -6
- package/lib/component/modal/editRange/EditRangeModal.js +33 -13
- 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 +2 -7
- 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/Panels.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/useEditRangeModal.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +9 -12
- 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 +5 -24
- 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 +109 -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 -29
- package/lib/component/reducer/actions/DatabaseActions.js +6 -4
- package/lib/component/reducer/actions/DomainActions.js +3 -0
- 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/IntegralsActions.js +3 -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 +8 -8
- package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
- package/lib/component/reducer/actions/ToolsActions.js +3 -32
- package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
- package/lib/component/reducer/actions/ZonesActions.js +3 -6
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +8 -0
- package/lib/component/reducer/helper/ZoomHistoryManager.js +35 -0
- 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/actions/addWorkspace.js +2 -2
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -3
- 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 +3 -1
- package/lib/data/PredictionManager.js +43 -3
- 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/generateSpectrumFromPublicationString.d.ts +1 -2
- 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 +3 -2
- 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/detectSignal.js +13 -6
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +23 -18
- 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/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/KeysListenerTracker.js +90 -67
- package/lib-cjs/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib-cjs/component/NMRium.js +12 -13
- package/lib-cjs/component/context/LoggerContext.js +5 -0
- 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/FormikError.js +27 -0
- 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 +16 -14
- package/lib-cjs/component/loader/DropZone.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +81 -75
- 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 +53 -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/EditRangeModal.js +32 -12
- 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 +2 -7
- 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/Panels.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/RangesPanel/hooks/useEditRangeModal.js +9 -12
- 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 +5 -24
- 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 +109 -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 -31
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +6 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +3 -0
- 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/IntegralsActions.js +3 -1
- 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 +10 -33
- package/lib-cjs/component/reducer/actions/ToolsActions.js +26 -32
- package/lib-cjs/component/reducer/actions/ZonesActions.js +6 -32
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +37 -0
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -2
- 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 +43 -3
- 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/detectSignal.js +13 -6
- package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +23 -18
- 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 +29 -29
- 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
|
@@ -1,78 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.usePredictSpectraModal = void 0;
|
|
29
7
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
30
8
|
/** @jsxImportSource @emotion/react */
|
|
31
9
|
const react_1 = require("@emotion/react");
|
|
32
|
-
const formik_1 = require("formik");
|
|
33
10
|
const react_2 = require("react");
|
|
34
|
-
const Yup = __importStar(require("yup"));
|
|
35
11
|
const PredictionManager_1 = require("../../data/PredictionManager");
|
|
36
|
-
const generateNumbersPowerOfX_1 = __importDefault(require("../../data/utilities/generateNumbersPowerOfX"));
|
|
37
12
|
const ChartContext_1 = require("../context/ChartContext");
|
|
38
13
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
14
|
+
const LoggerContext_1 = require("../context/LoggerContext");
|
|
39
15
|
const Button_1 = __importDefault(require("../elements/Button"));
|
|
40
16
|
const CheckBox_1 = __importDefault(require("../elements/CheckBox"));
|
|
41
17
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
42
|
-
const IsotopesViewer_1 = __importDefault(require("../elements/IsotopesViewer"));
|
|
43
|
-
const Label_1 = __importDefault(require("../elements/Label"));
|
|
44
|
-
const FormikCheckBox_1 = __importDefault(require("../elements/formik/FormikCheckBox"));
|
|
45
|
-
const FormikErrorsSummary_1 = __importDefault(require("../elements/formik/FormikErrorsSummary"));
|
|
46
|
-
const FormikInput_1 = __importDefault(require("../elements/formik/FormikInput"));
|
|
47
|
-
const FormikSelect_1 = __importDefault(require("../elements/formik/FormikSelect"));
|
|
48
18
|
const Alert_1 = require("../elements/popup/Alert");
|
|
19
|
+
const Modal_1 = require("../elements/popup/Modal");
|
|
20
|
+
const options_1 = require("../elements/popup/options");
|
|
21
|
+
const PredictionOptionsPanel_1 = __importDefault(require("../panels/predictionPanel/PredictionOptionsPanel"));
|
|
49
22
|
const LocalStorage_1 = require("../utility/LocalStorage");
|
|
50
23
|
const ModalStyle_1 = require("./ModalStyle");
|
|
51
24
|
const styles = (0, react_1.css) `
|
|
52
|
-
.row {
|
|
53
|
-
align-items: center;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
25
|
.inner-content {
|
|
57
26
|
flex: 1;
|
|
58
27
|
}
|
|
59
28
|
|
|
60
|
-
.custom-label {
|
|
61
|
-
width: 160px;
|
|
62
|
-
font-weight: 500;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.nucleus-label {
|
|
66
|
-
padding: 0 10px;
|
|
67
|
-
color: black;
|
|
68
|
-
font-weight: 700;
|
|
69
|
-
|
|
70
|
-
&.disabled {
|
|
71
|
-
opacity: 0.5;
|
|
72
|
-
color: black;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
29
|
.warning {
|
|
77
30
|
color: #c40000;
|
|
78
31
|
font-weight: bold;
|
|
@@ -89,59 +42,8 @@ const styles = (0, react_1.css) `
|
|
|
89
42
|
margin: 5px 5px 5px 0;
|
|
90
43
|
}
|
|
91
44
|
}
|
|
92
|
-
|
|
93
|
-
.middle-x {
|
|
94
|
-
padding: 0 10px;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.group-label {
|
|
98
|
-
width: 100%;
|
|
99
|
-
display: block;
|
|
100
|
-
border-bottom: 1px solid #efefef;
|
|
101
|
-
padding-bottom: 5px;
|
|
102
|
-
font-weight: 600;
|
|
103
|
-
color: #005d9e;
|
|
104
|
-
}
|
|
105
45
|
`;
|
|
106
|
-
|
|
107
|
-
const NUMBER_OF_POINTS_2D = (0, generateNumbersPowerOfX_1.default)(10, 10, {
|
|
108
|
-
format: (value) => value,
|
|
109
|
-
});
|
|
110
|
-
const predictionFormValidation = Yup.object().shape({
|
|
111
|
-
name: Yup.string().required().label('Name'),
|
|
112
|
-
frequency: Yup.number().integer().required().label('Frequency'),
|
|
113
|
-
'1d': Yup.object({
|
|
114
|
-
'1H': Yup.object({
|
|
115
|
-
from: Yup.number().required().label("1H ' From ' "),
|
|
116
|
-
to: Yup.number().required().label("1H ' To ' "),
|
|
117
|
-
}),
|
|
118
|
-
'13C': Yup.object().shape({
|
|
119
|
-
from: Yup.number().required().label("13C ' From ' "),
|
|
120
|
-
to: Yup.number().required().label("13C ' To ' "),
|
|
121
|
-
}),
|
|
122
|
-
lineWidth: Yup.number().integer().min(1).required().label('Line Width'),
|
|
123
|
-
nbPoints: Yup.number().integer().required().label('1D Number Of Points'),
|
|
124
|
-
}),
|
|
125
|
-
'2d': Yup.object({
|
|
126
|
-
nbPoints: Yup.object({
|
|
127
|
-
x: Yup.number().integer().required().label('2D Number Of Points'),
|
|
128
|
-
y: Yup.number().integer().required().label('2D Number Of Points'),
|
|
129
|
-
}),
|
|
130
|
-
}),
|
|
131
|
-
spectra: Yup.object({
|
|
132
|
-
proton: Yup.boolean(),
|
|
133
|
-
carbon: Yup.boolean(),
|
|
134
|
-
cosy: Yup.boolean(),
|
|
135
|
-
hsqc: Yup.boolean(),
|
|
136
|
-
hmbc: Yup.boolean(),
|
|
137
|
-
}).test('check-options', 'You must check one of the options to start prediction', (obj) => {
|
|
138
|
-
if (Object.values(obj).includes(true)) {
|
|
139
|
-
return true;
|
|
140
|
-
}
|
|
141
|
-
return false;
|
|
142
|
-
}),
|
|
143
|
-
});
|
|
144
|
-
function PredictSpectraModal({ onClose = () => null, molfile, }) {
|
|
46
|
+
function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
145
47
|
const refForm = (0, react_2.useRef)();
|
|
146
48
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
147
49
|
const alert = (0, Alert_1.useAlert)();
|
|
@@ -158,37 +60,62 @@ function PredictSpectraModal({ onClose = () => null, molfile, }) {
|
|
|
158
60
|
name: `Prediction ${predictionIndex + 1}`,
|
|
159
61
|
});
|
|
160
62
|
}, [predictionPreferences, predictionIndex]);
|
|
63
|
+
const { logger } = (0, LoggerContext_1.useLogger)();
|
|
161
64
|
const submitHandler = (0, react_2.useCallback)((values) => {
|
|
162
65
|
void (async () => {
|
|
163
|
-
if (
|
|
66
|
+
if (molecule) {
|
|
67
|
+
const { molfile } = molecule;
|
|
164
68
|
setPredictionPreferences({ ...values, isApproved });
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
payload: {
|
|
168
|
-
isLoading: true,
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
const predictedSpectra = Object.entries(values.spectra)
|
|
172
|
-
.map(([key, value]) => {
|
|
69
|
+
const predictedSpectra = [];
|
|
70
|
+
for (const [key, value] of Object.entries(values.spectra)) {
|
|
173
71
|
if (value) {
|
|
174
|
-
|
|
72
|
+
predictedSpectra.push(key);
|
|
175
73
|
}
|
|
176
|
-
|
|
177
|
-
})
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
74
|
+
}
|
|
75
|
+
const hideLoading = await alert.showLoading(`Predict ${predictedSpectra.join(',')} in progress`);
|
|
76
|
+
try {
|
|
77
|
+
const data = await (0, PredictionManager_1.predictSpectra)(molfile, logger);
|
|
78
|
+
dispatch({
|
|
79
|
+
type: 'PREDICT_SPECTRA',
|
|
80
|
+
payload: {
|
|
81
|
+
predictedSpectra: data.spectra,
|
|
82
|
+
options: values,
|
|
83
|
+
molecule,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
alert.error(error?.message);
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
hideLoading();
|
|
92
|
+
onClose();
|
|
93
|
+
}
|
|
186
94
|
}
|
|
187
95
|
})();
|
|
188
|
-
}, [
|
|
96
|
+
}, [
|
|
97
|
+
alert,
|
|
98
|
+
dispatch,
|
|
99
|
+
isApproved,
|
|
100
|
+
molecule,
|
|
101
|
+
onClose,
|
|
102
|
+
logger,
|
|
103
|
+
setPredictionPreferences,
|
|
104
|
+
]);
|
|
189
105
|
const approveCheckHandler = (0, react_2.useCallback)((e) => {
|
|
190
106
|
setApproved(e.target.checked);
|
|
191
107
|
}, []);
|
|
192
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Prediction of NMR spectrum" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "inner-content", children: [(0, jsx_runtime_1.jsx)(
|
|
108
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Prediction of NMR spectrum" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "inner-content", children: [(0, jsx_runtime_1.jsx)(PredictionOptionsPanel_1.default, { onSubmit: submitHandler, options: initValues, ref: refForm }), (0, jsx_runtime_1.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." }), (0, jsx_runtime_1.jsxs)("div", { className: "warning-container", children: [(0, jsx_runtime_1.jsx)(CheckBox_1.default, { onChange: approveCheckHandler, checked: isApproved }, String(isApproved)), (0, jsx_runtime_1.jsx)("p", { children: "I confirm that the chemical structure is not confidential." })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] }));
|
|
109
|
+
}
|
|
110
|
+
function usePredictSpectraModal() {
|
|
111
|
+
const modal = (0, Modal_1.useModal)();
|
|
112
|
+
return (molecule) => {
|
|
113
|
+
modal.show((0, jsx_runtime_1.jsx)(PredictSpectraModal, { molecule: molecule }), {
|
|
114
|
+
position: options_1.positions.TOP_CENTER,
|
|
115
|
+
enableResizing: true,
|
|
116
|
+
width: 600,
|
|
117
|
+
});
|
|
118
|
+
};
|
|
193
119
|
}
|
|
120
|
+
exports.usePredictSpectraModal = usePredictSpectraModal;
|
|
194
121
|
exports.default = PredictSpectraModal;
|
|
@@ -3,6 +3,7 @@ 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.labelStyle = void 0;
|
|
6
7
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
8
|
/** @jsxImportSource @emotion/react */
|
|
8
9
|
const react_1 = require("@emotion/react");
|
|
@@ -12,6 +13,7 @@ const SpectraManager_1 = require("../../data/SpectraManager");
|
|
|
12
13
|
const ChartContext_1 = require("../context/ChartContext");
|
|
13
14
|
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
14
15
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
16
|
+
const Label_1 = __importDefault(require("../elements/Label"));
|
|
15
17
|
const FormikCheckBox_1 = __importDefault(require("../elements/formik/FormikCheckBox"));
|
|
16
18
|
const FormikInput_1 = __importDefault(require("../elements/formik/FormikInput"));
|
|
17
19
|
const ModalStyle_1 = require("./ModalStyle");
|
|
@@ -20,15 +22,6 @@ const styles = (0, react_1.css) `
|
|
|
20
22
|
flex: 1;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
.custom-label {
|
|
24
|
-
width: 100px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.name {
|
|
28
|
-
width: 100% !important;
|
|
29
|
-
text-align: left !important;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
25
|
.data-export-group {
|
|
33
26
|
label {
|
|
34
27
|
margin-right: 10px;
|
|
@@ -50,6 +43,20 @@ const INITIAL_VALUE = {
|
|
|
50
43
|
settings: false,
|
|
51
44
|
},
|
|
52
45
|
};
|
|
46
|
+
exports.labelStyle = {
|
|
47
|
+
label: {
|
|
48
|
+
flex: 4,
|
|
49
|
+
fontSize: '12px',
|
|
50
|
+
fontWeight: 'bold',
|
|
51
|
+
color: '#232323',
|
|
52
|
+
},
|
|
53
|
+
wrapper: {
|
|
54
|
+
flex: 8,
|
|
55
|
+
display: 'flex',
|
|
56
|
+
justifyContent: 'flex-start',
|
|
57
|
+
},
|
|
58
|
+
container: { padding: '5px 0' },
|
|
59
|
+
};
|
|
53
60
|
function SaveAsModal({ onClose, onSave, name }) {
|
|
54
61
|
const refForm = (0, react_2.useRef)();
|
|
55
62
|
const { source } = (0, ChartContext_1.useChartData)();
|
|
@@ -60,10 +67,11 @@ function SaveAsModal({ onClose, onSave, name }) {
|
|
|
60
67
|
onSave(values);
|
|
61
68
|
onClose?.();
|
|
62
69
|
}, [onClose, onSave]);
|
|
63
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Save as ... " }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { innerRef: refForm, initialValues: { ...INITIAL_VALUE, name }, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Save as ... " }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { innerRef: refForm, initialValues: { ...INITIAL_VALUE, name }, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { style: exports.labelStyle, title: "Name", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "name", className: "name", style: {
|
|
71
|
+
inputWrapper: { width: '100%' },
|
|
72
|
+
input: { padding: '5px', textAlign: 'left' },
|
|
73
|
+
} }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { style: exports.labelStyle, title: "Compressed", children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "compressed" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { style: exports.labelStyle, title: "Pretty Format", children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "pretty" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { style: exports.labelStyle, title: "Include view", children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "include.view" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { style: exports.labelStyle, title: "Include settings", children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "include.settings" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { style: exports.labelStyle, title: "Include Data", children: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'column' }, children: (0, jsx_runtime_1.jsxs)("div", { className: "data-export-group", children: [(0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)(formik_1.Field, { type: "radio", name: "include.dataType", value: SpectraManager_1.DataExportOptions.ROW_DATA }), "Raw Data"] }), (0, jsx_runtime_1.jsxs)("label", { style: {
|
|
74
|
+
color: source ? 'black' : 'lightgray',
|
|
75
|
+
}, children: [(0, jsx_runtime_1.jsx)(formik_1.Field, { type: "radio", name: "include.dataType", value: SpectraManager_1.DataExportOptions.DATA_SOURCE, disabled: !source }), "Data Source"] }), (0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)(formik_1.Field, { type: "radio", name: "include.dataType", value: SpectraManager_1.DataExportOptions.NO_DATA }), "No Data"] })] }) }) })] }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: () => onClose?.() }) })] }));
|
|
68
76
|
}
|
|
69
77
|
exports.default = SaveAsModal;
|
|
@@ -33,6 +33,7 @@ const formik_1 = require("formik");
|
|
|
33
33
|
const react_2 = require("react");
|
|
34
34
|
const Yup = __importStar(require("yup"));
|
|
35
35
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
36
|
+
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
36
37
|
const CloseButton_1 = __importDefault(require("../../elements/CloseButton"));
|
|
37
38
|
const Tab_1 = __importDefault(require("../../elements/Tab/Tab"));
|
|
38
39
|
const Tabs_1 = __importDefault(require("../../elements/Tab/Tabs"));
|
|
@@ -71,38 +72,40 @@ const styles = (0, react_1.css) `
|
|
|
71
72
|
text-align: center;
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
-
.footer-container {
|
|
76
|
-
button {
|
|
77
|
-
width: 20%;
|
|
78
|
-
color: white;
|
|
79
|
-
background-color: gray !important;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
button:hover {
|
|
83
|
-
border: 1px solid gray;
|
|
84
|
-
color: gray;
|
|
85
|
-
background-color: white !important;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
75
|
`;
|
|
89
76
|
var SumSetOptions;
|
|
90
77
|
(function (SumSetOptions) {
|
|
91
78
|
SumSetOptions["Auto"] = "auto";
|
|
92
79
|
SumSetOptions["Manual"] = "manual";
|
|
93
80
|
})(SumSetOptions || (SumSetOptions = {}));
|
|
81
|
+
function getValidationSchema(option) {
|
|
82
|
+
switch (option) {
|
|
83
|
+
case SumSetOptions.Auto: {
|
|
84
|
+
return Yup.object({
|
|
85
|
+
molecule: Yup.object().required(),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
case SumSetOptions.Manual: {
|
|
89
|
+
return Yup.object({
|
|
90
|
+
sum: Yup.number().required(),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
default:
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
94
97
|
function ChangeSumModal({ onSave, onClose, header, sumOptions, }) {
|
|
95
98
|
const { current: { display: { panels }, }, } = (0, PreferencesContext_1.usePreferences)();
|
|
96
99
|
const [setOption, setActiveOption] = (0, react_2.useState)(SumSetOptions.Auto);
|
|
97
100
|
const formRef = (0, react_2.useRef)(null);
|
|
98
|
-
|
|
101
|
+
function handleKeyDown(event) {
|
|
99
102
|
if (event.key === 'Enter') {
|
|
100
103
|
formRef.current.submitForm();
|
|
101
104
|
}
|
|
102
|
-
}
|
|
103
|
-
|
|
105
|
+
}
|
|
106
|
+
function onTabChangeHandler(tab) {
|
|
104
107
|
setActiveOption(tab.tabid);
|
|
105
|
-
}
|
|
108
|
+
}
|
|
106
109
|
(0, react_2.useEffect)(() => {
|
|
107
110
|
if (sumOptions?.sumAuto && panels?.structuresPanel?.display) {
|
|
108
111
|
setActiveOption(SumSetOptions.Auto);
|
|
@@ -117,7 +120,7 @@ function ChangeSumModal({ onSave, onClose, header, sumOptions, }) {
|
|
|
117
120
|
formRef.current.setValues({ sum: sumOptions?.sum || '', molecule: null });
|
|
118
121
|
}
|
|
119
122
|
}, [panels?.structuresPanel, sumOptions]);
|
|
120
|
-
|
|
123
|
+
function saveHandler(values) {
|
|
121
124
|
switch (setOption) {
|
|
122
125
|
case SumSetOptions.Auto: {
|
|
123
126
|
const { molecule: { mf, id: moleculeId }, } = values;
|
|
@@ -133,26 +136,10 @@ function ChangeSumModal({ onSave, onClose, header, sumOptions, }) {
|
|
|
133
136
|
return;
|
|
134
137
|
}
|
|
135
138
|
onClose();
|
|
136
|
-
}
|
|
137
|
-
const validationSchema = (0, react_2.useMemo)(() => {
|
|
138
|
-
switch (setOption) {
|
|
139
|
-
case SumSetOptions.Auto: {
|
|
140
|
-
return Yup.object({
|
|
141
|
-
molecule: Yup.object().required(),
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
case SumSetOptions.Manual: {
|
|
145
|
-
return Yup.object({
|
|
146
|
-
sum: Yup.number().required(),
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
default:
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
}, [setOption]);
|
|
139
|
+
}
|
|
153
140
|
const isStructurePanelVisible = panels?.structuresPanel?.display || false;
|
|
154
141
|
return (
|
|
155
142
|
// <div css={modalContainer}>
|
|
156
|
-
(0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: header }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose })] }), (0, jsx_runtime_1.jsx)("div", { className: "tab-content", children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { innerRef: formRef, onSubmit: saveHandler, initialValues: { sum:
|
|
143
|
+
(0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: header }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose })] }), (0, jsx_runtime_1.jsx)("div", { className: "tab-content", children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { innerRef: formRef, onSubmit: saveHandler, initialValues: { sum: '', molecule: null }, validationSchema: getValidationSchema(setOption), children: (0, jsx_runtime_1.jsxs)(Tabs_1.default, { activeTab: setOption, onClick: onTabChangeHandler, children: [isStructurePanelVisible && ((0, jsx_runtime_1.jsx)(Tab_1.default, { title: "Auto", tabid: SumSetOptions.Auto, children: (0, jsx_runtime_1.jsx)(SelectMolecule_1.default, { name: "molecule" }) })), (0, jsx_runtime_1.jsx)(Tab_1.default, { title: "Manual", tabid: SumSetOptions.Manual, children: (0, jsx_runtime_1.jsx)("div", { className: "manual-container", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "sum", type: "number", nullable: true, placeholder: "Enter the new value", onKeyDown: handleKeyDown }) }) })] }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: () => formRef.current.submitForm(), style: { width: '80px' }, children: "Set" }) })] }));
|
|
157
144
|
}
|
|
158
145
|
exports.default = ChangeSumModal;
|
|
@@ -57,18 +57,36 @@ const styles = (0, react_1.css) `
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
`;
|
|
60
|
-
function EditRangeModal({
|
|
60
|
+
function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }) {
|
|
61
61
|
const formRef = (0, react_2.useRef)(null);
|
|
62
62
|
const { view: { spectra: { activeTab }, }, } = (0, ChartContext_1.useChartData)();
|
|
63
63
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
64
|
+
const range = useRange(rangeId);
|
|
65
|
+
const originalRangeRef = (0, react_2.useRef)(range);
|
|
64
66
|
const rangesPreferences = (0, usePanelPreferences_1.usePanelPreferences)('ranges', activeTab);
|
|
65
|
-
const range = useRange(originRange, manualRange);
|
|
66
67
|
const handleOnZoom = (0, react_2.useCallback)(() => {
|
|
67
|
-
|
|
68
|
-
}, [
|
|
68
|
+
onZoom(range);
|
|
69
|
+
}, [onZoom, range]);
|
|
70
|
+
(0, react_2.useEffect)(() => {
|
|
71
|
+
dispatch({
|
|
72
|
+
type: 'SET_SELECTED_TOOL',
|
|
73
|
+
payload: {
|
|
74
|
+
selectedTool: 'zoom',
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
if (!range) {
|
|
78
|
+
onClose?.();
|
|
79
|
+
}
|
|
80
|
+
}, [activeTab, dispatch, onClose, range]);
|
|
69
81
|
const handleOnClose = (0, react_2.useCallback)(() => {
|
|
70
|
-
|
|
71
|
-
|
|
82
|
+
dispatch({
|
|
83
|
+
type: 'SET_SELECTED_TOOL',
|
|
84
|
+
payload: {
|
|
85
|
+
selectedTool: 'zoom',
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
onRest(originalRangeRef.current);
|
|
89
|
+
}, [dispatch, onRest]);
|
|
72
90
|
const getCouplings = (0, react_2.useCallback)((couplings) => couplings
|
|
73
91
|
.filter((coupling) => coupling.coupling !== '')
|
|
74
92
|
.map((coupling) => {
|
|
@@ -93,9 +111,9 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
93
111
|
void (async () => {
|
|
94
112
|
const _range = { ...range };
|
|
95
113
|
_range.signals = getSignals(formValues.signals);
|
|
96
|
-
await
|
|
114
|
+
await onSave(_range);
|
|
97
115
|
})();
|
|
98
|
-
}, [getSignals,
|
|
116
|
+
}, [getSignals, onSave, range]);
|
|
99
117
|
const data = (0, react_2.useMemo)(() => {
|
|
100
118
|
const signals = range?.signals.map((signal) => {
|
|
101
119
|
// counter within j array to access to right j values
|
|
@@ -119,7 +137,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
119
137
|
return { ...signal, js: couplings };
|
|
120
138
|
});
|
|
121
139
|
return { activeTab: '0', signals };
|
|
122
|
-
}, [range?.signals, rangesPreferences
|
|
140
|
+
}, [range?.signals, rangesPreferences]);
|
|
123
141
|
const changeHandler = (0, react_2.useCallback)((values) => {
|
|
124
142
|
const signals = getSignals(values.signals);
|
|
125
143
|
if (JSON.stringify(range?.signals, (key, value) => {
|
|
@@ -136,14 +154,16 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
136
154
|
});
|
|
137
155
|
}
|
|
138
156
|
}, [dispatch, getSignals, range]);
|
|
157
|
+
if (!rangesPreferences || !range) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
139
160
|
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)(Button_1.default.Action, { onClick: handleOnZoom, fill: "outline", style: { fontSize: '14' }, color: { base: '#5f5f5f', hover: 'white' }, children: (0, jsx_runtime_1.jsx)(fa_1.FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), (0, jsx_runtime_1.jsx)("span", { className: "title", children: ` Range and Signal edition: ${(0, formatNumber_1.formatNumber)(range?.from, rangesPreferences.from.format)} ppm to ${(0, formatNumber_1.formatNumber)(range?.to, rangesPreferences.to.format)} ppm` }), (0, jsx_runtime_1.jsx)(SaveButton_1.default, { onClick: () => formRef.current.submitForm(), popupTitle: "Save and Exit" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: handleOnClose })] }), (0, jsx_runtime_1.jsx)(formik_1.Formik, { innerRef: formRef, initialValues: data, validationSchema: EditRangeValidation_1.default, onSubmit: handleOnSave, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SignalsForm_1.default, { range: range, preferences: rangesPreferences }), (0, jsx_runtime_1.jsx)(FormikOnChange_1.default, { onChange: changeHandler })] }) })] }));
|
|
140
161
|
}
|
|
141
|
-
function useRange(
|
|
162
|
+
function useRange(rangeId) {
|
|
142
163
|
const { ranges } = (0, useSpectrum_1.default)({
|
|
143
164
|
ranges: { values: [] },
|
|
144
165
|
});
|
|
145
|
-
const
|
|
146
|
-
const index = ranges.values.findIndex((rangeRecord) => rangeRecord.id === id);
|
|
166
|
+
const index = ranges.values.findIndex((rangeRecord) => rangeRecord.id === rangeId);
|
|
147
167
|
return ranges.values[index];
|
|
148
168
|
}
|
|
149
169
|
exports.default = EditRangeModal;
|
|
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
30
|
+
/** @jsxImportSource @emotion/react */
|
|
30
31
|
const formik_1 = require("formik");
|
|
31
32
|
const react_1 = require("react");
|
|
32
33
|
const ui_1 = require("react-science/ui");
|
|
@@ -88,7 +89,7 @@ const rowColors = {
|
|
|
88
89
|
};
|
|
89
90
|
const validationSchema = Yup.object({
|
|
90
91
|
source: Yup.string().required(),
|
|
91
|
-
target: Yup.array(Yup.string()).min(1),
|
|
92
|
+
target: Yup.array(Yup.string()).min(1).required(),
|
|
92
93
|
});
|
|
93
94
|
function MetaImportationModal({ onClose, file }) {
|
|
94
95
|
const alert = (0, Context_1.useAlert)();
|
|
@@ -114,7 +115,9 @@ function MetaImportationModal({ onClose, file }) {
|
|
|
114
115
|
};
|
|
115
116
|
}, [file]);
|
|
116
117
|
function handleDrop(files) {
|
|
117
|
-
|
|
118
|
+
if (files[0]) {
|
|
119
|
+
handleParseFile(files[0]);
|
|
120
|
+
}
|
|
118
121
|
}
|
|
119
122
|
const errors = (0, parseMeta_1.mapErrors)(parseResult?.errors || []);
|
|
120
123
|
const metaData = parseResult?.data || [];
|
|
@@ -195,14 +198,21 @@ function MetaImportationModal({ onClose, file }) {
|
|
|
195
198
|
}
|
|
196
199
|
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, style: { overflow: 'hidden' }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Import Meta Information" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsx)("div", { style: { flex: 1, width: '100%' }, children: !parseResult ? ((0, jsx_runtime_1.jsx)(ui_1.DropZone, { fileValidator: fileValidator, color: "gray", emptyText: "Drag and Drop CSV or tab-delimited file (.csv, .txt or .tsv)", onDrop: handleDrop })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: { height: '130px' }, children: [(0, jsx_runtime_1.jsx)(formik_1.Formik, { innerRef: formRef, initialValues: {
|
|
197
200
|
source: null,
|
|
198
|
-
target:
|
|
201
|
+
target: '',
|
|
199
202
|
}, onSubmit: handleLinkSpectra, validationSchema: validationSchema, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Source field", style: { label: { width: '100px' } }, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { name: "source", items: (0, mapColumnToSelectItems_1.mapColumnToSelectItems)(parseResult?.meta.fields || []), style: {
|
|
200
203
|
width: '300px',
|
|
201
|
-
padding: '
|
|
204
|
+
padding: '5px',
|
|
202
205
|
margin: 0,
|
|
203
206
|
} }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Target field path", style: {
|
|
204
207
|
label: { width: '100px', padding: '20px 0px' },
|
|
205
|
-
}, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "target", style: {
|
|
208
|
+
}, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "target", style: {
|
|
209
|
+
input: {
|
|
210
|
+
width: '300px',
|
|
211
|
+
textAlign: 'left',
|
|
212
|
+
padding: '5px',
|
|
213
|
+
fontSize: '14px',
|
|
214
|
+
},
|
|
215
|
+
}, placeholder: "Example: info.plus", datalist: datalist, nullable: true, mapOnChangeValue: (key) => paths?.[key] || null, mapValue: (paths) => (0, convertPathArrayToString_1.convertPathArrayToString)(paths) }) })] }) }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: () => formRef.current?.submitForm(), children: "Link Spectra" })] }), (0, jsx_runtime_1.jsx)("div", { style: { height: 'calc(100% - 160px)' }, children: (0, jsx_runtime_1.jsx)(ReactTable_1.default, { columns: columns, data: metaData, approxItemHeight: 25, approxColumnWidth: 100, enableVirtualScroll: true, enableColumnsVirtualScroll: true, activeRow: handleActiveRow, rowStyle: handleRowStyle }) })] })) }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleImport, disabled: Object.keys(matches).length === 0, children: "Import" }) })] }));
|
|
206
216
|
}
|
|
207
217
|
function fileValidator(file) {
|
|
208
218
|
if (!(0, parseMeta_1.isMetaFile)(file)) {
|
|
@@ -85,12 +85,7 @@ const styles = (0, react_1.css) `
|
|
|
85
85
|
|
|
86
86
|
.input {
|
|
87
87
|
font-size: 14px;
|
|
88
|
-
|
|
89
|
-
border: 1px solid #ccc;
|
|
90
|
-
padding: 5px;
|
|
91
|
-
width: 100px;
|
|
92
|
-
margin-right: 10px;
|
|
93
|
-
height: initial !important;
|
|
88
|
+
padding: 3px;
|
|
94
89
|
}
|
|
95
90
|
|
|
96
91
|
.close-bt {
|
|
@@ -166,7 +161,7 @@ function GeneralSettingsModal({ height }) {
|
|
|
166
161
|
dispatch({
|
|
167
162
|
type: 'ADD_WORKSPACE',
|
|
168
163
|
payload: {
|
|
169
|
-
|
|
164
|
+
workspaceKey: name,
|
|
170
165
|
data: refForm.current?.values,
|
|
171
166
|
},
|
|
172
167
|
});
|
|
@@ -9,6 +9,7 @@ const react_1 = require("react");
|
|
|
9
9
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
10
10
|
const Label_1 = __importDefault(require("../../elements/Label"));
|
|
11
11
|
const FormikColorInput_1 = __importDefault(require("../../elements/formik/FormikColorInput"));
|
|
12
|
+
const FormikColumnFormatField_1 = require("../../elements/formik/FormikColumnFormatField");
|
|
12
13
|
const FormikNumberInput_1 = __importDefault(require("../../elements/formik/FormikNumberInput"));
|
|
13
14
|
const useNucleus_1 = __importDefault(require("../../hooks/useNucleus"));
|
|
14
15
|
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
@@ -52,19 +53,10 @@ function IntegralsPreferences(props, ref) {
|
|
|
52
53
|
formRef.current.submitForm();
|
|
53
54
|
},
|
|
54
55
|
}));
|
|
55
|
-
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: nuclei?.map((n) => ((0, jsx_runtime_1.jsx)(NucleusPreferences_1.NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: `nuclei.${n}.color` }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "stroke width :", style: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
flex: 2,
|
|
61
|
-
},
|
|
62
|
-
wrapper: {
|
|
63
|
-
flex: 4,
|
|
64
|
-
},
|
|
65
|
-
}, children: (0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: `nuclei.${n}.strokeWidth`, style: {
|
|
66
|
-
width: '60%',
|
|
67
|
-
textAlign: 'center',
|
|
68
|
-
}, min: 1, max: 9, pattern: "[1-9]+" }) })] })) }, n))) }) }) }));
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: nuclei?.map((n) => ((0, jsx_runtime_1.jsx)(NucleusPreferences_1.NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Color", style: FormikColumnFormatField_1.formatFieldLabelStyle, children: (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', padding: '2px 0' }, children: [(0, jsx_runtime_1.jsx)("div", { style: { width: '23px' } }), (0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: `nuclei.${n}.color` })] }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "stroke width :", style: FormikColumnFormatField_1.formatFieldLabelStyle, children: (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', padding: '2px 0' }, children: [(0, jsx_runtime_1.jsx)("div", { style: { width: '23px' } }), (0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: `nuclei.${n}.strokeWidth`, style: {
|
|
57
|
+
width: '60%',
|
|
58
|
+
textAlign: 'center',
|
|
59
|
+
padding: '2px',
|
|
60
|
+
}, min: 1, max: 9, pattern: "[1-9]+" })] }) })] })) }, n))) }) }) }));
|
|
69
61
|
}
|
|
70
62
|
exports.default = (0, react_1.memo)((0, react_1.forwardRef)(IntegralsPreferences));
|