nmrium 0.38.1 → 0.38.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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 +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 +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 -29
- 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.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/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 +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 +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 -31
- 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
|
@@ -3,99 +3,96 @@ 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
|
-
const jsx_runtime_1 = require("
|
|
7
|
-
/** @jsxImportSource @emotion/react */
|
|
8
|
-
const react_1 = require("@emotion/react");
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
7
|
const cheminfo_font_1 = require("cheminfo-font");
|
|
10
8
|
const full_1 = require("openchemlib/full");
|
|
11
|
-
const
|
|
9
|
+
const react_1 = require("react");
|
|
12
10
|
const fa_1 = require("react-icons/fa");
|
|
13
11
|
const io5_1 = require("react-icons/io5");
|
|
12
|
+
const ui_1 = require("react-science/ui");
|
|
14
13
|
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
15
14
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
16
15
|
const GlobalContext_1 = require("../../context/GlobalContext");
|
|
17
16
|
const ActiveButton_1 = __importDefault(require("../../elements/ActiveButton"));
|
|
18
|
-
const
|
|
19
|
-
const MenuButton_1 = __importDefault(require("../../elements/MenuButton"));
|
|
20
|
-
const ToolTip_1 = __importDefault(require("../../elements/ToolTip/ToolTip"));
|
|
17
|
+
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
21
18
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
22
|
-
const Modal_1 = require("../../elements/popup/Modal");
|
|
23
19
|
const AboutPredictionModal_1 = __importDefault(require("../../modal/AboutPredictionModal"));
|
|
24
|
-
const PredictSpectraModal_1 =
|
|
20
|
+
const PredictSpectraModal_1 = require("../../modal/PredictSpectraModal");
|
|
25
21
|
const export_1 = require("../../utility/export");
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
line-height: 22px;
|
|
47
|
-
padding: 0 10px;
|
|
48
|
-
}
|
|
49
|
-
`;
|
|
50
|
-
const atomLabelStyle = {
|
|
51
|
-
width: '14px',
|
|
52
|
-
height: '14px',
|
|
53
|
-
padding: 0,
|
|
54
|
-
margin: 0,
|
|
55
|
-
textAlign: 'center',
|
|
56
|
-
lineHeight: 1,
|
|
22
|
+
const PanelHeader_1 = __importDefault(require("../header/PanelHeader"));
|
|
23
|
+
const styles = {
|
|
24
|
+
counter: {
|
|
25
|
+
margin: 0,
|
|
26
|
+
textAlign: 'right',
|
|
27
|
+
lineHeight: '22px',
|
|
28
|
+
padding: '0 10px',
|
|
29
|
+
whiteSpace: 'nowrap',
|
|
30
|
+
},
|
|
31
|
+
atomLabel: {
|
|
32
|
+
width: '14px',
|
|
33
|
+
height: '14px',
|
|
34
|
+
padding: 0,
|
|
35
|
+
margin: 0,
|
|
36
|
+
textAlign: 'center',
|
|
37
|
+
lineHeight: 1,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
const LabelWrapper = ({ children }) => {
|
|
41
|
+
return (0, jsx_runtime_1.jsx)("p", { style: { padding: '0.4em' }, children: children });
|
|
57
42
|
};
|
|
58
43
|
const MOL_EXPORT_MENU = [
|
|
59
44
|
{
|
|
60
|
-
|
|
45
|
+
type: 'option',
|
|
61
46
|
icon: (0, jsx_runtime_1.jsx)(fa_1.FaCopy, {}),
|
|
62
|
-
label:
|
|
47
|
+
label: (0, jsx_runtime_1.jsx)(LabelWrapper, { children: "Copy as molfile V3" }),
|
|
48
|
+
data: {
|
|
49
|
+
id: 'molfileV3',
|
|
50
|
+
},
|
|
63
51
|
},
|
|
64
52
|
{
|
|
65
|
-
|
|
53
|
+
type: 'option',
|
|
66
54
|
icon: (0, jsx_runtime_1.jsx)(fa_1.FaCopy, {}),
|
|
67
|
-
label:
|
|
55
|
+
label: (0, jsx_runtime_1.jsx)(LabelWrapper, { children: "Copy as molfile V2" }),
|
|
56
|
+
data: {
|
|
57
|
+
id: 'molfileV2',
|
|
58
|
+
},
|
|
68
59
|
},
|
|
69
60
|
{
|
|
70
|
-
|
|
61
|
+
type: 'option',
|
|
71
62
|
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFileImage, {}),
|
|
72
|
-
label:
|
|
63
|
+
label: (0, jsx_runtime_1.jsx)(LabelWrapper, { children: "Copy as PNG" }),
|
|
64
|
+
data: {
|
|
65
|
+
id: 'png',
|
|
66
|
+
},
|
|
73
67
|
},
|
|
74
68
|
{
|
|
75
|
-
|
|
69
|
+
type: 'option',
|
|
76
70
|
icon: (0, jsx_runtime_1.jsx)(fa_1.FaDownload, {}),
|
|
77
|
-
label:
|
|
71
|
+
label: (0, jsx_runtime_1.jsx)(LabelWrapper, { children: "Export as SVG" }),
|
|
72
|
+
data: {
|
|
73
|
+
id: 'svg',
|
|
74
|
+
},
|
|
78
75
|
},
|
|
79
76
|
];
|
|
80
|
-
function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMoleculeIndexChange
|
|
77
|
+
function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMoleculeIndexChange, onOpenMoleculeEditor, renderSource = 'moleculePanel', onClickPreferences, children, }) {
|
|
81
78
|
const { rootRef } = (0, GlobalContext_1.useGlobal)();
|
|
82
79
|
const alert = (0, Alert_1.useAlert)();
|
|
83
80
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
84
|
-
const modal = (0, Modal_1.useModal)();
|
|
85
81
|
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
86
82
|
const moleculeKey = molecules?.[currentIndex]?.id;
|
|
87
|
-
const
|
|
83
|
+
const openPredictSpectraModal = (0, PredictSpectraModal_1.usePredictSpectraModal)();
|
|
84
|
+
const saveAsSVGHandler = (0, react_1.useCallback)(() => {
|
|
88
85
|
if (!rootRef)
|
|
89
86
|
return;
|
|
90
|
-
(0, export_1.exportAsSVG)(rootRef, `molSVG${currentIndex}`, 'molFile');
|
|
87
|
+
(0, export_1.exportAsSVG)(rootRef, `molSVG${currentIndex} `, 'molFile');
|
|
91
88
|
}, [rootRef, currentIndex]);
|
|
92
|
-
const saveAsPNGHandler = (0,
|
|
89
|
+
const saveAsPNGHandler = (0, react_1.useCallback)(() => {
|
|
93
90
|
if (!rootRef)
|
|
94
91
|
return;
|
|
95
|
-
(0, export_1.copyPNGToClipboard)(rootRef, `molSVG${currentIndex}`);
|
|
92
|
+
(0, export_1.copyPNGToClipboard)(rootRef, `molSVG${currentIndex} `);
|
|
96
93
|
alert.success('MOL copied as PNG to clipboard');
|
|
97
94
|
}, [rootRef, alert, currentIndex]);
|
|
98
|
-
const saveAsMolHandler = (0,
|
|
95
|
+
const saveAsMolHandler = (0, react_1.useCallback)((molfile) => {
|
|
99
96
|
void (0, export_1.copyTextToClipboard)(molfile).then((flag) => {
|
|
100
97
|
if (flag) {
|
|
101
98
|
alert.success('MOLFile copied to clipboard');
|
|
@@ -105,26 +102,26 @@ function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMolecul
|
|
|
105
102
|
}
|
|
106
103
|
});
|
|
107
104
|
}, [alert]);
|
|
108
|
-
const exportHandler = (0,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
const exportHandler = (0, react_1.useCallback)((selected) => {
|
|
106
|
+
const molecule = molecules?.[currentIndex];
|
|
107
|
+
if (molecule) {
|
|
108
|
+
switch (selected?.data.id) {
|
|
109
|
+
case 'molfileV3':
|
|
110
|
+
saveAsMolHandler(molecule.molfile);
|
|
111
|
+
break;
|
|
112
|
+
case 'molfileV2': {
|
|
113
|
+
saveAsMolHandler(full_1.Molecule.fromMolfile(molecule.molfile).toMolfile());
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
case 'png':
|
|
117
|
+
saveAsPNGHandler();
|
|
118
|
+
break;
|
|
119
|
+
case 'svg':
|
|
120
|
+
saveAsSVGHandler();
|
|
121
|
+
break;
|
|
122
|
+
default:
|
|
123
|
+
break;
|
|
114
124
|
}
|
|
115
|
-
case 'molfileV2': {
|
|
116
|
-
const molfile = molecules?.[currentIndex].molfile || '';
|
|
117
|
-
saveAsMolHandler(full_1.Molecule.fromMolfile(molfile).toMolfile());
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
case 'png':
|
|
121
|
-
saveAsPNGHandler();
|
|
122
|
-
break;
|
|
123
|
-
case 'svg':
|
|
124
|
-
saveAsSVGHandler();
|
|
125
|
-
break;
|
|
126
|
-
default:
|
|
127
|
-
break;
|
|
128
125
|
}
|
|
129
126
|
}, [
|
|
130
127
|
currentIndex,
|
|
@@ -133,14 +130,14 @@ function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMolecul
|
|
|
133
130
|
saveAsPNGHandler,
|
|
134
131
|
saveAsSVGHandler,
|
|
135
132
|
]);
|
|
136
|
-
const handlePaste = (0,
|
|
133
|
+
const handlePaste = (0, react_1.useCallback)(() => {
|
|
137
134
|
void navigator.clipboard.readText().then((molfile) => {
|
|
138
135
|
dispatch({ type: 'ADD_MOLECULE', payload: { molfile } });
|
|
139
136
|
});
|
|
140
137
|
}, [dispatch]);
|
|
141
|
-
const handleDelete = (0,
|
|
138
|
+
const handleDelete = (0, react_1.useCallback)(() => {
|
|
142
139
|
if (molecules[currentIndex]?.id) {
|
|
143
|
-
onMoleculeIndexChange(0);
|
|
140
|
+
onMoleculeIndexChange?.(0);
|
|
144
141
|
dispatch({
|
|
145
142
|
type: 'DELETE_MOLECULE',
|
|
146
143
|
payload: { id: molecules[currentIndex].id, assignmentData },
|
|
@@ -153,13 +150,6 @@ function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMolecul
|
|
|
153
150
|
dispatch,
|
|
154
151
|
assignmentData,
|
|
155
152
|
]);
|
|
156
|
-
const openPredictSpectraModal = (0, react_2.useCallback)(() => {
|
|
157
|
-
modal.show((0, jsx_runtime_1.jsx)(PredictSpectraModal_1.default, { molfile: molecules[currentIndex].molfile }), {
|
|
158
|
-
position: Modal_1.positions.TOP_CENTER,
|
|
159
|
-
enableResizing: true,
|
|
160
|
-
width: 600,
|
|
161
|
-
});
|
|
162
|
-
}, [modal, molecules, currentIndex]);
|
|
163
153
|
function floatMoleculeHandler() {
|
|
164
154
|
dispatch({
|
|
165
155
|
type: 'FLOAT_MOLECULE_OVER_SPECTRUM',
|
|
@@ -173,8 +163,8 @@ function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMolecul
|
|
|
173
163
|
});
|
|
174
164
|
}
|
|
175
165
|
const hasMolecules = molecules && molecules.length > 0;
|
|
176
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
166
|
+
return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { children: [renderSource === 'predictionPanel' && (0, jsx_runtime_1.jsx)(AboutPredictionModal_1.default, {}), renderSource === 'moleculePanel' && ((0, jsx_runtime_1.jsx)(ui_1.DropdownMenu, { trigger: "click", options: MOL_EXPORT_MENU, onSelect: exportHandler, children: (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { as: "div", disabled: !hasMolecules, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Export As", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }) })), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: handlePaste, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Paste molfile", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaPaste, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: onOpenMoleculeEditor, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Add molecule", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }), renderSource === 'moleculePanel' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: handleDelete, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Delete molecule", tooltipOrientation: "horizontal", disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }), hasMolecules && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: '#4e4e4e', hover: '#4e4e4e' }, onClick: () => openPredictSpectraModal(molecules[currentIndex]), toolTip: "Predict spectra", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrFt, {}) }))] })), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { value: moleculesView?.[moleculeKey]?.floating.visible || false, popupTitle: "Float molecule", popupPlacement: "left", onClick: floatMoleculeHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(io5_1.IoOpenOutline, {}) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px' }, value: moleculesView?.[moleculeKey]?.showAtomNumber || false, popupTitle: "Show atom number", popupPlacement: "left", onClick: showAtomNumbersHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)("p", { style: styles.atomLabel, children: "#" }) }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 }, children: children }), (0, jsx_runtime_1.jsxs)("p", { style: styles.counter, children: [molecules &&
|
|
177
167
|
molecules.length > 0 &&
|
|
178
|
-
`${+(currentIndex + 1)} / ${molecules.length}`, ' '] })] }));
|
|
168
|
+
`${+(currentIndex + 1)} / ${molecules.length}`, ' '] }), onClickPreferences && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'black' }, onClick: onClickPreferences, toolTip: "Preferences", tooltipOrientation: "vertical", children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) }))] }));
|
|
179
169
|
}
|
|
180
170
|
exports.default = MoleculePanelHeader;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toggleDiaIDs = exports.getCurrentDiaIDsToHighlight = exports.getHighlightsOnHover = exports.findDatumAndSignalIndex = exports.extractFromAtom = void 0;
|
|
4
4
|
function getElements(activeTab) {
|
|
5
|
+
if (!activeTab)
|
|
6
|
+
return;
|
|
5
7
|
const nuclei = activeTab.split(',');
|
|
6
8
|
return nuclei.map((nucleus) => nucleus.replaceAll(/\d/g, ''));
|
|
7
9
|
}
|
|
@@ -18,7 +20,7 @@ function getElements(activeTab) {
|
|
|
18
20
|
*/
|
|
19
21
|
function extractFromAtom(atom, activeTab, axis) {
|
|
20
22
|
const elements = getElements(activeTab);
|
|
21
|
-
if (elements.length > 0 && Object.keys(atom).length > 0) {
|
|
23
|
+
if (elements && elements.length > 0 && Object.keys(atom).length > 0) {
|
|
22
24
|
const dim = axis === 'x' ? 0 : axis === 'y' ? 1 : null;
|
|
23
25
|
switch (dim !== null && elements[dim]) {
|
|
24
26
|
case atom.atomLabel: {
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const
|
|
7
|
+
const nmr_load_save_1 = require("nmr-load-save");
|
|
8
8
|
const DeleteButton_1 = __importDefault(require("../../../elements/Tab/DeleteButton"));
|
|
9
9
|
const DropDownButton_1 = __importDefault(require("../../../elements/dropDownButton/DropDownButton"));
|
|
10
10
|
const index_1 = require("../../../highlight/index");
|
|
@@ -42,10 +42,10 @@ const styles = {
|
|
|
42
42
|
},
|
|
43
43
|
};
|
|
44
44
|
const columnsFilters = [
|
|
45
|
-
{ key:
|
|
46
|
-
{ key:
|
|
47
|
-
{ key:
|
|
48
|
-
{ key:
|
|
45
|
+
{ key: nmr_load_save_1.AnalisisColumnsValuesKeys.RELATIVE, label: 'Relative' },
|
|
46
|
+
{ key: nmr_load_save_1.AnalisisColumnsValuesKeys.ABSOLUTE, label: 'Absolute' },
|
|
47
|
+
{ key: nmr_load_save_1.AnalisisColumnsValuesKeys.MIN, label: 'Min Intensity' },
|
|
48
|
+
{ key: nmr_load_save_1.AnalisisColumnsValuesKeys.MAX, label: 'Max Intensity' },
|
|
49
49
|
];
|
|
50
50
|
function AnalysisColumnHeader({ columnKey, rangeLabel, data, onColumnFilter, onDelete, }) {
|
|
51
51
|
const highlight = (0, index_1.useHighlight)([columnKey]);
|
|
@@ -53,6 +53,6 @@ function AnalysisColumnHeader({ columnKey, rangeLabel, data, onColumnFilter, onD
|
|
|
53
53
|
e.stopPropagation();
|
|
54
54
|
onDelete();
|
|
55
55
|
}
|
|
56
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { ...styles.container, ...highlight.defaultActiveStyle }, ...highlight.onHover, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.innerContainer, children: [data.type ===
|
|
56
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { ...styles.container, ...highlight.defaultActiveStyle }, ...highlight.onHover, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.innerContainer, children: [data.type === nmr_load_save_1.AnalysisColumnsTypes.NORMAL && ((0, jsx_runtime_1.jsx)("div", { style: styles.dropdownContainer, children: (0, jsx_runtime_1.jsx)(DropDownButton_1.default, { data: columnsFilters, formatSelectedValue: (item) => item.label.slice(0, 3), selectedKey: data.valueKey, onSelect: onColumnFilter }) })), (0, jsx_runtime_1.jsxs)("div", { style: styles.labelContainer, children: [(0, jsx_runtime_1.jsxs)("span", { style: styles.label, children: [" ", columnKey] }), (0, jsx_runtime_1.jsx)("span", { style: styles.label, children: rangeLabel })] })] }), (0, jsx_runtime_1.jsx)(DeleteButton_1.default, { onDelete: deleteHandler, style: styles.deleteButton })] }));
|
|
57
57
|
}
|
|
58
58
|
exports.default = AnalysisColumnHeader;
|
|
@@ -8,10 +8,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const formik_1 = require("formik");
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const fa_1 = require("react-icons/fa");
|
|
11
|
-
const multipleSpectraAnalysis_1 = require("../../../../data/data1d/multipleSpectraAnalysis");
|
|
12
11
|
const Button_1 = __importDefault(require("../../../elements/Button"));
|
|
13
12
|
const ReactTable_1 = __importDefault(require("../../../elements/ReactTable/ReactTable"));
|
|
14
13
|
const FormikInput_1 = __importDefault(require("../../../elements/formik/FormikInput"));
|
|
14
|
+
const nmr_load_save_1 = require("nmr-load-save");
|
|
15
15
|
const inputStyle = { input: { width: '100%', fontSize: '1.15em' } };
|
|
16
16
|
function AnalysisTablePreferences() {
|
|
17
17
|
const { values: { analysisOptions: { columns }, }, setFieldValue, } = (0, formik_1.useFormikContext)();
|
|
@@ -43,7 +43,7 @@ function AnalysisTablePreferences() {
|
|
|
43
43
|
{
|
|
44
44
|
Header: 'Value',
|
|
45
45
|
Cell: ({ row }) => {
|
|
46
|
-
const isFormulaColumn = row.original.type ===
|
|
46
|
+
const isFormulaColumn = row.original.type === nmr_load_save_1.AnalysisColumnsTypes.FORMULA;
|
|
47
47
|
return ((0, jsx_runtime_1.jsx)(FormikInput_1.default, { disabled: !isFormulaColumn, name: `analysisOptions.columns.${row.index}.formula`, style: inputStyle }));
|
|
48
48
|
},
|
|
49
49
|
},
|
|
@@ -28,9 +28,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
30
|
const formik_1 = require("formik");
|
|
31
|
+
const nmr_load_save_1 = require("nmr-load-save");
|
|
31
32
|
const react_1 = require("react");
|
|
32
33
|
const Yup = __importStar(require("yup"));
|
|
33
|
-
const multipleSpectraAnalysis_1 = require("../../../../data/data1d/multipleSpectraAnalysis");
|
|
34
34
|
const PreferencesContext_1 = require("../../../context/PreferencesContext");
|
|
35
35
|
const GroupPane_1 = require("../../../elements/GroupPane");
|
|
36
36
|
const Label_1 = __importDefault(require("../../../elements/Label"));
|
|
@@ -121,7 +121,7 @@ function columnSchema(columns) {
|
|
|
121
121
|
formula: Yup.string().test('required', 'Pease enter formula field', function checkRequired() {
|
|
122
122
|
const errors = [];
|
|
123
123
|
for (const column of columns) {
|
|
124
|
-
if (column?.type ===
|
|
124
|
+
if (column?.type === nmr_load_save_1.AnalysisColumnsTypes.FORMULA &&
|
|
125
125
|
(!column.formula || column.formula === '')) {
|
|
126
126
|
errors.push(new Yup.ValidationError(`${column.tempKey} formula value is required`, column.formula, this.path));
|
|
127
127
|
}
|
|
@@ -9,7 +9,6 @@ const react_1 = require("@emotion/react");
|
|
|
9
9
|
const cheminfo_font_1 = require("cheminfo-font");
|
|
10
10
|
const get_1 = __importDefault(require("lodash/get"));
|
|
11
11
|
const nmr_processing_1 = require("nmr-processing");
|
|
12
|
-
const react_2 = require("react");
|
|
13
12
|
const fa_1 = require("react-icons/fa");
|
|
14
13
|
const im_1 = require("react-icons/im");
|
|
15
14
|
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
@@ -24,7 +23,6 @@ const ChangeSumModal_1 = __importDefault(require("../../modal/changeSum/ChangeSu
|
|
|
24
23
|
const export_1 = require("../../utility/export");
|
|
25
24
|
const formatNumber_1 = require("../../utility/formatNumber");
|
|
26
25
|
const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
|
|
27
|
-
const useEditRangeModal_1 = __importDefault(require("./hooks/useEditRangeModal"));
|
|
28
26
|
const style = (0, react_1.css) `
|
|
29
27
|
.btn {
|
|
30
28
|
background-color: transparent;
|
|
@@ -50,25 +48,25 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
|
|
|
50
48
|
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
51
49
|
const currentSum = (0, get_1.default)(ranges, 'options.sum', null);
|
|
52
50
|
const rangesPreferences = (0, usePanelPreferences_1.usePanelPreferences)('ranges', activeTab);
|
|
53
|
-
|
|
51
|
+
function changeRangesSumHandler(options) {
|
|
54
52
|
dispatch({ type: 'CHANGE_RANGE_SUM', payload: { options } });
|
|
55
53
|
modal.close();
|
|
56
|
-
}
|
|
57
|
-
|
|
54
|
+
}
|
|
55
|
+
function showChangeRangesSumModal() {
|
|
58
56
|
modal.show((0, jsx_runtime_1.jsx)(ChangeSumModal_1.default, { onClose: () => modal.close(), onSave: changeRangesSumHandler, header: currentSum
|
|
59
57
|
? `Set new Ranges Sum (Current: ${Number(currentSum).toFixed(2)})`
|
|
60
58
|
: 'Set new Ranges Sum', sumOptions: ranges?.options }));
|
|
61
|
-
}
|
|
62
|
-
|
|
59
|
+
}
|
|
60
|
+
function removeAssignments() {
|
|
63
61
|
onUnlink();
|
|
64
|
-
}
|
|
65
|
-
|
|
62
|
+
}
|
|
63
|
+
function handleOnRemoveAssignments() {
|
|
66
64
|
modal.showConfirmDialog({
|
|
67
65
|
message: 'All assignments will be removed. Are you sure?',
|
|
68
66
|
buttons: [{ text: 'Yes', handler: removeAssignments }, { text: 'No' }],
|
|
69
67
|
});
|
|
70
|
-
}
|
|
71
|
-
|
|
68
|
+
}
|
|
69
|
+
function handleDeleteAll() {
|
|
72
70
|
modal.showConfirmDialog({
|
|
73
71
|
message: 'All ranges will be deleted. Are You sure?',
|
|
74
72
|
buttons: [
|
|
@@ -84,17 +82,17 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
|
|
|
84
82
|
{ text: 'No' },
|
|
85
83
|
],
|
|
86
84
|
});
|
|
87
|
-
}
|
|
88
|
-
|
|
85
|
+
}
|
|
86
|
+
function handleSetShowMultiplicityTrees() {
|
|
89
87
|
dispatch({ type: 'SHOW_MULTIPLICITY_TREES', payload: { id } });
|
|
90
|
-
}
|
|
91
|
-
|
|
88
|
+
}
|
|
89
|
+
function handleShowIntegrals() {
|
|
92
90
|
dispatch({ type: 'SHOW_RANGES_INTEGRALS', payload: { id } });
|
|
93
|
-
}
|
|
94
|
-
|
|
91
|
+
}
|
|
92
|
+
function handleShowJGraph() {
|
|
95
93
|
dispatch({ type: 'SHOW_J_GRAPH', payload: { id } });
|
|
96
|
-
}
|
|
97
|
-
|
|
94
|
+
}
|
|
95
|
+
function saveToClipboardHandler(value) {
|
|
98
96
|
void (async () => {
|
|
99
97
|
const success = await (0, export_1.copyHTMLToClipboard)(value);
|
|
100
98
|
if (success) {
|
|
@@ -104,43 +102,31 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
|
|
|
104
102
|
alert.error('copy to clipboard failed');
|
|
105
103
|
}
|
|
106
104
|
})();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
rangesPreferences?.deltaHz?.format,
|
|
124
|
-
rangesPreferences?.deltaPPM?.format,
|
|
125
|
-
saveToClipboardHandler,
|
|
126
|
-
]);
|
|
127
|
-
const changeSumConstantFlagHandler = (0, react_2.useCallback)(() => {
|
|
105
|
+
}
|
|
106
|
+
function saveAsHTMLHandler() {
|
|
107
|
+
if (Array.isArray(ranges?.values) && ranges.values.length > 0) {
|
|
108
|
+
const { originFrequency: observedFrequency, nucleus } = info;
|
|
109
|
+
const nbDecimalDelta = (0, formatNumber_1.getNumberOfDecimals)(rangesPreferences.deltaPPM.format);
|
|
110
|
+
const nbDecimalJ = (0, formatNumber_1.getNumberOfDecimals)(rangesPreferences.deltaHz.format);
|
|
111
|
+
const result = (0, nmr_processing_1.rangesToACS)(ranges.values, {
|
|
112
|
+
nucleus,
|
|
113
|
+
nbDecimalDelta,
|
|
114
|
+
nbDecimalJ,
|
|
115
|
+
observedFrequency, //400
|
|
116
|
+
});
|
|
117
|
+
modal.show((0, jsx_runtime_1.jsx)(CopyClipboardModal_1.default, { text: result, onCopyClick: saveToClipboardHandler, onClose: () => modal.close() }), {});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function changeSumConstantFlagHandler() {
|
|
128
121
|
dispatch({
|
|
129
122
|
type: 'CHANGE_RANGES_SUM_FLAG',
|
|
130
123
|
});
|
|
131
|
-
}
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
dispatch({
|
|
135
|
-
type: 'ADD_RANGE',
|
|
136
|
-
payload: {},
|
|
137
|
-
});
|
|
138
|
-
editRange(true);
|
|
139
|
-
}, [dispatch, editRange]);
|
|
140
|
-
return ((0, jsx_runtime_1.jsx)("div", { css: style, children: (0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: ranges?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Ranges", onFilter: onFilterActivated, filterToolTip: isFilterActive ? 'Show all ranges' : 'Hide ranges out of view', filterIsActive: isFilterActive, counterFiltered: filterCounter, showSettingButton: true, onSettingClick: onSettingClick, children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Preview publication string", popupPlacement: "right", onClick: saveAsHTMLHandler, className: "btn preview-publication-icon", children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: currentSum
|
|
124
|
+
}
|
|
125
|
+
const hasRanges = Array.isArray(ranges?.values) && ranges.values.length > 0;
|
|
126
|
+
return ((0, jsx_runtime_1.jsx)("div", { css: style, children: (0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: ranges?.values?.length || 0, onDelete: handleDeleteAll, deleteToolTip: "Delete All Ranges", onFilter: onFilterActivated, filterToolTip: isFilterActive ? 'Show all ranges' : 'Hide ranges out of view', filterIsActive: isFilterActive, counterFiltered: filterCounter, showSettingButton: true, onSettingClick: onSettingClick, children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Preview publication string", popupPlacement: "right", onClick: saveAsHTMLHandler, className: "btn preview-publication-icon", disabled: !hasRanges, children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: currentSum
|
|
141
127
|
? `Change ranges sum (${Number(currentSum).toFixed(2)})`
|
|
142
|
-
: 'Change ranges sum', popupPlacement: "right", onClick: showChangeRangesSumModal, className: "btn icon", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Remove all assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !
|
|
128
|
+
: 'Change ranges sum', popupPlacement: "right", onClick: showChangeRangesSumModal, className: "btn icon", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Remove all assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !hasRanges, className: "btn icon", children: (0, jsx_runtime_1.jsx)(fa_1.FaUnlink, {}) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showMultiplicityTrees
|
|
143
129
|
? 'Hide multiplicity trees in spectrum'
|
|
144
|
-
: 'Show multiplicity trees in spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, value: showMultiplicityTrees, disabled: !
|
|
130
|
+
: 'Show multiplicity trees in spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, value: showMultiplicityTrees, disabled: !hasRanges, children: (0, jsx_runtime_1.jsx)(fa_1.FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, value: showJGraph, disabled: !hasRanges, children: (0, jsx_runtime_1.jsx)(fa_1.FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, value: showRangesIntegrals, disabled: !hasRanges, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { className: "icon", popupTitle: "Fix integral values", popupPlacement: "right", onClick: changeSumConstantFlagHandler, value: ranges?.options?.isSumConstant, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) })] }) }));
|
|
145
131
|
}
|
|
146
132
|
exports.default = RangesHeader;
|
|
@@ -8,22 +8,13 @@ const formik_1 = require("formik");
|
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
10
10
|
const Label_1 = __importDefault(require("../../elements/Label"));
|
|
11
|
+
const FormikColumnFormatField_1 = require("../../elements/formik/FormikColumnFormatField");
|
|
11
12
|
const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
|
|
12
13
|
const useNucleus_1 = __importDefault(require("../../hooks/useNucleus"));
|
|
13
14
|
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
14
15
|
const getUniqueNuclei_1 = require("../../utility/getUniqueNuclei");
|
|
15
16
|
const NucleusPreferences_1 = require("../extra/preferences/NucleusPreferences");
|
|
16
17
|
const PreferencesContainer_1 = require("../extra/preferences/PreferencesContainer");
|
|
17
|
-
const styles = {
|
|
18
|
-
inputLabel: {
|
|
19
|
-
flex: 2,
|
|
20
|
-
},
|
|
21
|
-
inputWrapper: {
|
|
22
|
-
width: '100px',
|
|
23
|
-
flex: '4',
|
|
24
|
-
borderRadius: '5px',
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
18
|
const formatFields = [
|
|
28
19
|
{
|
|
29
20
|
id: 1,
|
|
@@ -80,23 +71,17 @@ function RangesPreferences(props, ref) {
|
|
|
80
71
|
const nucleus = (0, useNucleus_1.default)();
|
|
81
72
|
const nuclei = (0, react_1.useMemo)(() => (0, getUniqueNuclei_1.getUniqueNuclei)(nucleus), [nucleus]);
|
|
82
73
|
const preferencesByNuclei = (0, usePanelPreferences_1.usePanelPreferencesByNuclei)('ranges', nuclei);
|
|
83
|
-
|
|
84
|
-
formRef.current.setValues(preferencesByNuclei);
|
|
85
|
-
}, [preferencesByNuclei]);
|
|
86
|
-
const saveHandler = (0, react_1.useCallback)((values) => {
|
|
74
|
+
function saveHandler(values) {
|
|
87
75
|
preferences.dispatch({
|
|
88
76
|
type: 'SET_PANELS_PREFERENCES',
|
|
89
77
|
payload: { key: 'ranges', value: values },
|
|
90
78
|
});
|
|
91
|
-
}
|
|
79
|
+
}
|
|
92
80
|
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
93
81
|
saveSetting: () => {
|
|
94
82
|
formRef.current.submitForm();
|
|
95
83
|
},
|
|
96
84
|
}), []);
|
|
97
|
-
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues:
|
|
98
|
-
label: styles.inputLabel,
|
|
99
|
-
wrapper: styles.inputWrapper,
|
|
100
|
-
}, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `nuclei.${n}.jGraphTolerance`, type: "number" }) })) }, n))) }) }) }));
|
|
85
|
+
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: preferencesByNuclei, enableReinitialize: true, 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, renderBottom: () => ((0, jsx_runtime_1.jsx)(Label_1.default, { title: "J Graph tolerance (Hz) :", style: FormikColumnFormatField_1.formatFieldLabelStyle, children: (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)("div", { style: { width: '23px' } }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `nuclei.${n}.jGraphTolerance`, type: "number", style: FormikColumnFormatField_1.formatFieldInputStyle })] }) })) }, n))) }) }) }));
|
|
101
86
|
}
|
|
102
|
-
exports.default = (0, react_1.
|
|
87
|
+
exports.default = (0, react_1.forwardRef)(RangesPreferences);
|
|
@@ -128,7 +128,11 @@ function SpectraTable(props) {
|
|
|
128
128
|
maxWidth: '30px',
|
|
129
129
|
},
|
|
130
130
|
Cell: ({ row }) => {
|
|
131
|
-
|
|
131
|
+
const { display, info: { dimension, isFid }, } = row.original;
|
|
132
|
+
if (dimension === 2 && isFid) {
|
|
133
|
+
return (0, jsx_runtime_1.jsx)("div", {});
|
|
134
|
+
}
|
|
135
|
+
return ((0, jsx_runtime_1.jsx)(ColorIndicator_1.default, { display: display, dimension: dimension, onClick: (event) => onOpenSettingModal(event, row.original) }));
|
|
132
136
|
},
|
|
133
137
|
},
|
|
134
138
|
}), [onChangeVisibility, onOpenSettingModal]);
|
|
@@ -32,7 +32,10 @@ function SpectraColumnsManager({ nucleus, onAdd, onDelete, datalist, mapOnChange
|
|
|
32
32
|
{
|
|
33
33
|
Header: 'Label',
|
|
34
34
|
Cell: ({ row }) => {
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `nuclei.${nucleus}.columns.${row.index}.label`, style: {
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `nuclei.${nucleus}.columns.${row.index}.label`, style: {
|
|
36
|
+
input: { ...style, ...inputStyle },
|
|
37
|
+
inputWrapper: { border: 'none' },
|
|
38
|
+
} }));
|
|
36
39
|
},
|
|
37
40
|
},
|
|
38
41
|
{
|
|
@@ -42,7 +45,10 @@ function SpectraColumnsManager({ nucleus, onAdd, onDelete, datalist, mapOnChange
|
|
|
42
45
|
if (column?.name) {
|
|
43
46
|
return ((0, jsx_runtime_1.jsx)("span", { style: style, children: column?.jpath?.join('.') || column.description }));
|
|
44
47
|
}
|
|
45
|
-
return ((0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `nuclei.${nucleus}.columns.${row.index}.jpath`, style: {
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `nuclei.${nucleus}.columns.${row.index}.jpath`, style: {
|
|
49
|
+
input: { ...style, ...inputStyle },
|
|
50
|
+
inputWrapper: { border: 'none' },
|
|
51
|
+
}, datalist: datalist, mapOnChangeValue: mapOnChangeValue, mapValue: mapValue }));
|
|
46
52
|
},
|
|
47
53
|
},
|
|
48
54
|
{
|
|
@@ -52,11 +58,11 @@ function SpectraColumnsManager({ nucleus, onAdd, onDelete, datalist, mapOnChange
|
|
|
52
58
|
},
|
|
53
59
|
{
|
|
54
60
|
Header: '',
|
|
55
|
-
style: { width: '
|
|
61
|
+
style: { width: '80px' },
|
|
56
62
|
id: 'add-button',
|
|
57
63
|
Cell: ({ row }) => {
|
|
58
64
|
const record = row.original;
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "outline", onClick: () => onAdd(nucleus, row.index + 1), children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }), !record?.name && ((0, jsx_runtime_1.jsx)(Button_1.default.Danger, { fill: "outline", onClick: () => onDelete(nucleus, row.index), children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }))] }));
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "outline", onClick: () => onAdd(nucleus, row.index + 1), children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }), !record?.name && ((0, jsx_runtime_1.jsx)(Button_1.default.Danger, { fill: "outline", onClick: () => onDelete(nucleus, row.index), children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }))] }));
|
|
60
66
|
},
|
|
61
67
|
},
|
|
62
68
|
], [datalist, mapOnChangeValue, mapValue, nucleus, onAdd, onDelete]);
|
|
@@ -82,7 +82,7 @@ function AdditionalColumnField({ rowCorrelation, columnCorrelation, commonLinks,
|
|
|
82
82
|
const contextMenu = (0, react_1.useMemo)(() => {
|
|
83
83
|
// allow the edition of correlations
|
|
84
84
|
const commonLinksMenu = commonLinks.flatMap((commonLink) => {
|
|
85
|
-
const commonLinkContextMenuLabel = `${(0, Utilities_1.getAbbreviation)(commonLink)} (${commonLink.signal.x ? commonLink.signal.x.delta.toFixed(2) : '?'}, ${commonLink.signal.y ? commonLink.signal.y.delta.toFixed(2) : '?'})${commonLink.edited?.moved === true ? '[MOVED]' : ''}`;
|
|
85
|
+
const commonLinkContextMenuLabel = `${(0, Utilities_1.getAbbreviation)(commonLink)} (${commonLink.signal.x?.delta ? commonLink.signal.x.delta.toFixed(2) : '?'}, ${commonLink.signal.y?.delta ? commonLink.signal.y.delta.toFixed(2) : '?'})${commonLink.edited?.moved === true ? '[MOVED]' : ''}`;
|
|
86
86
|
return commonLink.pseudo === false
|
|
87
87
|
? [
|
|
88
88
|
{
|