nmrium 0.24.1 → 0.27.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/Chart1D.js +3 -2
- package/lib/component/1d/FooterBanner.js +1 -1
- package/lib/component/1d/Integral.d.ts +2 -1
- package/lib/component/1d/Integral.js +5 -12
- package/lib/component/1d/IntegralResizable.d.ts +2 -1
- package/lib/component/1d/IntegralResizable.js +21 -16
- package/lib/component/1d/IntegralsSeries.js +3 -3
- package/lib/component/1d/Line.d.ts +2 -2
- package/lib/component/1d/PeakAnnotation.js +5 -4
- package/lib/component/1d/database/DatabaseElements.d.ts +3 -0
- package/lib/component/1d/database/DatabaseElements.js +18 -0
- package/lib/component/1d/database/DatabaseSpectrum.d.ts +3 -0
- package/lib/component/1d/database/DatabaseSpectrum.js +58 -0
- package/lib/component/1d/{ResurrectedDatabaseRanges.d.ts → database/ResurrectedDatabaseRanges.d.ts} +0 -0
- package/lib/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
- package/lib/component/1d/jCouplingGraph/JGraph.js +4 -10
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +36 -32
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +5 -5
- package/lib/component/1d/ranges/Range.d.ts +2 -1
- package/lib/component/1d/ranges/Range.js +38 -39
- package/lib/component/1d/ranges/Ranges.js +6 -3
- package/lib/component/1d/tool/XLabelPointer.js +1 -1
- package/lib/component/2d/Chart2D.js +2 -1
- package/lib/component/2d/Contours.js +4 -1
- package/lib/component/2d/FooterBanner.js +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +1 -1
- package/lib/component/2d/tools/slicing/HorizontalSliceChart.d.ts +2 -2
- package/lib/component/2d/tools/slicing/SliceScale.d.ts +1 -1
- package/lib/component/2d/tools/slicing/VerticalSliceChart.d.ts +2 -2
- package/lib/component/2d/zones/Signal.js +8 -8
- package/lib/component/2d/zones/Zone.js +3 -3
- package/lib/component/EventsTrackers/KeysListenerTracker.js +11 -5
- package/lib/component/NMRium.d.ts +5 -1
- package/lib/component/NMRium.js +28 -32
- package/lib/component/SplitPaneWrapper.d.ts +4 -0
- package/lib/component/SplitPaneWrapper.js +8 -0
- package/lib/component/assignment/AssignmentsContext.d.ts +35 -0
- package/lib/component/assignment/AssignmentsContext.js +83 -0
- package/lib/component/assignment/AssignmentsReducer.d.ts +32 -0
- package/lib/component/assignment/AssignmentsReducer.js +39 -0
- package/lib/component/assignment/actions/initAssignment.d.ts +5 -0
- package/lib/component/assignment/actions/initAssignment.js +62 -0
- package/lib/component/assignment/actions/removeAssignment.d.ts +16 -0
- package/lib/component/assignment/actions/removeAssignment.js +24 -0
- package/lib/component/assignment/actions/setActiveAssignment.d.ts +10 -0
- package/lib/component/assignment/actions/setActiveAssignment.js +8 -0
- package/lib/component/assignment/actions/toggleAssignment.d.ts +7 -0
- package/lib/component/assignment/actions/toggleAssignment.js +44 -0
- package/lib/component/assignment/index.d.ts +0 -18
- package/lib/component/assignment/index.js +12 -266
- package/lib/component/assignment/utilities/filterForIDsWithAssignment.d.ts +2 -0
- package/lib/component/assignment/utilities/filterForIDsWithAssignment.js +3 -0
- package/lib/component/context/GlobalContext.d.ts +15 -3
- package/lib/component/context/GlobalContext.js +1 -1
- package/lib/component/context/PreferencesContext.d.ts +15 -12
- package/lib/component/context/PreferencesContext.js +1 -1
- package/lib/component/elements/ActionButtons.d.ts +10 -0
- package/lib/component/elements/ActionButtons.js +14 -0
- package/lib/component/elements/Button.d.ts +30 -5
- package/lib/component/elements/Button.js +151 -4
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/ContextMenu.d.ts +8 -3
- package/lib/component/elements/ContextMenu.js +6 -6
- package/lib/component/elements/EditableColumn.d.ts +3 -2
- package/lib/component/elements/EditableColumn.js +27 -20
- package/lib/component/elements/Input.d.ts +9 -1
- package/lib/component/elements/Input.js +18 -5
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +5 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +38 -10
- package/lib/component/elements/ReactTable/ReactTable.d.ts +3 -1
- package/lib/component/elements/ReactTable/ReactTable.js +7 -2
- package/lib/component/elements/ReactTable/Style.d.ts +1 -3
- package/lib/component/elements/ReactTable/Style.js +1 -7
- package/lib/component/elements/Select.d.ts +1 -0
- package/lib/component/elements/Select.js +21 -15
- package/lib/component/elements/ToggleButton.d.ts +2 -1
- package/lib/component/elements/ToggleButton.js +2 -2
- package/lib/component/elements/ToolTip/ToolTip.js +3 -2
- package/lib/component/elements/draggble/SVGDraggable.d.ts +17 -0
- package/lib/component/elements/draggble/SVGDraggable.js +33 -0
- package/lib/component/elements/draggble/useDraggable.d.ts +22 -0
- package/lib/component/elements/draggble/useDraggable.js +70 -0
- package/lib/component/elements/formik/FormikColorPicker.d.ts +1 -0
- package/lib/component/elements/formik/FormikColorPicker.js +10 -7
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +5 -4
- package/lib/component/elements/formik/FormikColumnFormatField.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +1 -0
- package/lib/component/elements/formik/FormikInput.js +6 -3
- package/lib/component/elements/formik/FormikSlider.d.ts +1 -0
- package/lib/component/elements/formik/FormikSlider.js +6 -3
- package/lib/component/elements/popup/Alert/Provider.js +1 -1
- package/lib/component/elements/resizer/DivResizer.d.ts +2 -0
- package/lib/component/elements/resizer/DivResizer.js +62 -0
- package/lib/component/elements/resizer/Resizer.d.ts +20 -0
- package/lib/component/elements/resizer/Resizer.js +12 -0
- package/lib/component/elements/resizer/SVGResizer.d.ts +2 -0
- package/lib/component/elements/resizer/SVGResizer.js +42 -0
- package/lib/component/elements/resizer/useResizer.d.ts +11 -0
- package/lib/component/elements/resizer/useResizer.js +65 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.js +4 -15
- package/lib/component/header/BaseLineCorrectionPanel.js +2 -9
- package/lib/component/header/ManualPhaseCorrectionPanel.js +2 -9
- package/lib/component/header/RangesPickingOptionPanel.js +3 -16
- package/lib/component/header/ZeroFillingOptionsPanel.js +2 -9
- package/lib/component/header/Zones2DOptionPanel.js +3 -14
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +11 -9
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +3 -0
- package/lib/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +1 -10
- package/lib/component/hooks/usePanelPreferences.d.ts +7 -0
- package/lib/component/hooks/usePanelPreferences.js +54 -0
- package/lib/component/hooks/useXYReduce.d.ts +2 -2
- package/lib/component/loader/DefaultSpinnerComponent.d.ts +3 -1
- package/lib/component/loader/DefaultSpinnerComponent.js +2 -2
- package/lib/component/loader/DropZone.js +1 -0
- package/lib/component/loader/SpinnerContext.d.ts +3 -3
- package/lib/component/loader/SpinnerContext.js +2 -2
- package/lib/component/modal/AlignSpectraModal.js +2 -1
- package/lib/component/modal/ExportAsMatrixModal.js +2 -1
- package/lib/component/modal/ImportPublicationStringModal.js +2 -1
- package/lib/component/modal/LoadJCAMPModal.js +7 -6
- package/lib/component/modal/ModalStyle.js +4 -26
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -4
- package/lib/component/modal/MoleculeStructureEditorModal.js +24 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +2 -1
- package/lib/component/modal/PredictSpectraModal.js +2 -7
- package/lib/component/modal/SaveAsModal.d.ts +1 -1
- package/lib/component/modal/SaveAsModal.js +2 -1
- package/lib/component/modal/editRange/EditRangeModal.js +6 -5
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +2 -0
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +3 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +12 -9
- package/lib/component/modal/setting/DatabasesTabContent.d.ts +6 -0
- package/lib/component/modal/setting/DatabasesTabContent.js +75 -0
- package/lib/component/modal/setting/DisplayTabContent.js +11 -7
- package/lib/component/modal/setting/FormattingTabContent.js +20 -14
- package/lib/component/modal/setting/GeneralSettings.js +4 -1
- package/lib/component/modal/setting/settingsValidation.d.ts +56 -0
- package/lib/component/modal/setting/settingsValidation.js +46 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +6 -4
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +4 -3
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +13 -6
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.d.ts +10 -0
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +65 -0
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +0 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -5
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -11
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +26 -74
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +8 -0
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +38 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +12 -23
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +21 -7
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +31 -11
- package/lib/component/panels/MoleculesPanel/Utilities.js +61 -68
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +2 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +55 -60
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -1
- package/lib/component/panels/Panels.js +2 -3
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +3 -3
- package/lib/component/panels/PeaksPanel/PeaksPreferences.d.ts +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +29 -82
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +18 -25
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts +2 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +16 -10
- package/lib/component/panels/RangesPanel/RangesPanel.js +5 -11
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +55 -66
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +11 -6
- package/lib/component/panels/RangesPanel/RangesTable.js +3 -7
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +5 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.js +15 -14
- package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts +2 -1
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.d.ts +2 -1
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +16 -9
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +13 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +14 -0
- package/lib/component/panels/RangesPanel/TableColumns/format.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +5 -18
- package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.d.ts +18 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.js +18 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +7 -68
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +7 -68
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +6 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +51 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +5 -7
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +4 -8
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +5 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +5 -9
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +4 -4
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +4 -8
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPreferences.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +20 -84
- package/lib/component/panels/ZonesPanel/ZonesTable.js +4 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +7 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +22 -22
- package/lib/component/panels/databasePanel/DatabasePanel.js +73 -40
- package/lib/component/panels/databasePanel/DatabasePreferences.js +10 -42
- package/lib/component/panels/databasePanel/DatabaseTable.js +23 -11
- package/lib/component/panels/databasePanel/useDatabases.d.ts +5 -0
- package/lib/component/panels/databasePanel/useDatabases.js +10 -0
- package/lib/component/panels/extra/placeholder/NoTableData.d.ts +3 -1
- package/lib/component/panels/extra/placeholder/NoTableData.js +2 -2
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +3 -3
- package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts +13 -0
- package/lib/component/panels/extra/preferences/NucleusPreferences.js +22 -0
- package/lib/component/panels/extra/preferences/PreferencesContainer.d.ts +6 -0
- package/lib/component/panels/extra/preferences/PreferencesContainer.js +10 -0
- package/lib/component/panels/extra/preferences/PreferencesGroup.d.ts +7 -0
- package/lib/component/panels/extra/preferences/PreferencesGroup.js +21 -0
- package/lib/component/panels/header/SpectraAutomaticPickingButton.d.ts +2 -0
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +30 -0
- package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -18
- package/lib/component/reducer/Reducer.d.ts +360 -45
- package/lib/component/reducer/Reducer.js +9 -2
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +9 -0
- package/lib/component/reducer/actions/AssignmentsActions.js +18 -0
- package/lib/component/reducer/actions/LoadActions.d.ts +1 -1
- package/lib/component/reducer/actions/LoadActions.js +11 -6
- package/lib/component/reducer/actions/MoleculeActions.d.ts +4 -2
- package/lib/component/reducer/actions/MoleculeActions.js +15 -3
- package/lib/component/reducer/actions/PreferencesActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +1 -1
- package/lib/component/reducer/preferences/actions/addWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/addWorkspace.js +19 -0
- package/lib/component/reducer/preferences/actions/initPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/initPreferences.js +60 -0
- package/lib/component/reducer/preferences/actions/removeWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +20 -0
- package/lib/component/reducer/preferences/actions/resetPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/resetPreferences.js +14 -0
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +13 -0
- package/lib/component/reducer/preferences/actions/setPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setPreferences.js +34 -0
- package/lib/component/reducer/preferences/actions/setWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setWorkspace.js +8 -0
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +7 -0
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +55 -0
- package/lib/component/reducer/{preferencesReducer.d.ts → preferences/preferencesReducer.d.ts} +132 -15
- package/lib/component/reducer/preferences/preferencesReducer.js +80 -0
- package/lib/component/reducer/preferences/utilites/checkKeysExists.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/checkKeysExists.js +14 -0
- package/lib/component/reducer/preferences/utilites/filterObject.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/filterObject.js +7 -0
- package/lib/component/reducer/preferences/utilites/flatObject.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/flatObject.js +9 -0
- package/lib/component/reducer/preferences/utilites/getActiveWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/utilites/getActiveWorkspace.js +3 -0
- package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.d.ts +2 -0
- package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +4 -0
- package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.d.ts +5 -0
- package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.js +8 -0
- package/lib/component/reducer/types/Types.d.ts +3 -0
- package/lib/component/reducer/types/Types.js +3 -0
- package/lib/component/tool/FloatMoleculeStructures/ActionsButton.d.ts +4 -0
- package/lib/component/tool/FloatMoleculeStructures/ActionsButton.js +7 -0
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +14 -0
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +43 -0
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +15 -0
- package/lib/component/tool/FloatMoleculeStructures/index.js +28 -0
- package/lib/component/utility/Export.d.ts +3 -3
- package/lib/component/utility/Export.js +16 -9
- package/lib/component/utility/PathBuilder.js +2 -1
- package/lib/component/utility/formatNumber.d.ts +3 -0
- package/lib/component/utility/formatNumber.js +10 -0
- package/lib/component/utility/getUniqueNuclei.d.ts +1 -0
- package/lib/component/utility/getUniqueNuclei.js +10 -0
- package/lib/component/workspaces/Workspace.d.ts +74 -5
- package/lib/component/workspaces/basic.js +17 -10
- package/lib/component/workspaces/embedded.d.ts +2 -0
- package/lib/component/workspaces/embedded.js +32 -0
- package/lib/component/workspaces/exercise.js +2 -0
- package/lib/component/workspaces/index.d.ts +1 -0
- package/lib/component/workspaces/index.js +2 -1
- package/lib/component/workspaces/prediction.js +2 -0
- package/lib/component/workspaces/process1D.js +2 -0
- package/lib/data/SpectraManager.js +23 -15
- package/lib/data/data1d/Data1DManager.d.ts +1 -1
- package/lib/data/data1d/Data1DManager.js +6 -1
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.js +10 -0
- package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
- package/lib/data/data1d/Spectrum1D/toJSON.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/toJSON.js +1 -0
- package/lib/data/data1d/database.d.ts +9 -15
- package/lib/data/data1d/database.js +15 -20
- package/lib/data/data1d/filter1d/absolute.d.ts +3 -2
- package/lib/data/data1d/filter1d/autoPhaseCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/centerMean.d.ts +3 -2
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +3 -2
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +3 -2
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +1 -4
- package/lib/data/data1d/filter1d/exclusionZones.js +4 -4
- package/lib/data/data1d/filter1d/fft.d.ts +3 -2
- package/lib/data/data1d/filter1d/fft.js +2 -2
- package/lib/data/data1d/filter1d/fromTo.d.ts +3 -2
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +3 -2
- package/lib/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib/data/data1d/filter1d/pareto.d.ts +3 -2
- package/lib/data/data1d/filter1d/pareto.js +2 -2
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/shiftX.d.ts +2 -1
- package/lib/data/data1d/filter1d/standardDeviation.d.ts +3 -2
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +3 -2
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Data2DManager.d.ts +1 -1
- package/lib/data/data2d/Data2DManager.js +6 -1
- package/lib/data/data2d/Spectrum2D/toJSON.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/toJSON.js +1 -0
- package/lib/data/data2d/filter2d/shiftX.d.ts +4 -3
- package/lib/data/data2d/filter2d/shiftX.js +2 -2
- package/lib/data/data2d/filter2d/shiftY.d.ts +4 -3
- package/lib/data/data2d/filter2d/shiftY.js +2 -2
- package/lib/data/molecules/Molecule.d.ts +3 -3
- package/lib/data/molecules/Molecule.js +7 -1
- package/lib/data/molecules/MoleculeManager.d.ts +4 -1
- package/lib/data/molecules/MoleculeManager.js +33 -2
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/Data1D.d.ts +3 -3
- package/lib/data/types/data1d/Info1D.d.ts +1 -0
- package/lib/data/types/data2d/Signal2DAxisData.d.ts +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +3 -2
- package/lib-cjs/component/1d/FooterBanner.js +2 -2
- package/lib-cjs/component/1d/Integral.js +5 -12
- package/lib-cjs/component/1d/IntegralResizable.js +20 -15
- package/lib-cjs/component/1d/IntegralsSeries.js +3 -3
- package/lib-cjs/component/1d/PeakAnnotation.js +5 -4
- package/lib-cjs/component/1d/database/DatabaseElements.js +23 -0
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +60 -0
- package/lib-cjs/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
- package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +4 -10
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +35 -31
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +6 -6
- package/lib-cjs/component/1d/ranges/Range.js +40 -41
- package/lib-cjs/component/1d/ranges/Ranges.js +6 -3
- package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
- package/lib-cjs/component/2d/Chart2D.js +2 -1
- package/lib-cjs/component/2d/Contours.js +4 -1
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/zones/Signal.js +9 -9
- package/lib-cjs/component/2d/zones/Zone.js +4 -4
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +12 -6
- package/lib-cjs/component/NMRium.js +27 -31
- package/lib-cjs/component/SplitPaneWrapper.js +12 -0
- package/lib-cjs/component/assignment/AssignmentsContext.js +88 -0
- package/lib-cjs/component/assignment/AssignmentsReducer.js +45 -0
- package/lib-cjs/component/assignment/actions/initAssignment.js +65 -0
- package/lib-cjs/component/assignment/actions/removeAssignment.js +29 -0
- package/lib-cjs/component/assignment/actions/setActiveAssignment.js +11 -0
- package/lib-cjs/component/assignment/actions/toggleAssignment.js +47 -0
- package/lib-cjs/component/assignment/index.js +15 -269
- package/lib-cjs/component/assignment/utilities/filterForIDsWithAssignment.js +7 -0
- package/lib-cjs/component/context/GlobalContext.js +1 -1
- package/lib-cjs/component/context/PreferencesContext.js +1 -1
- package/lib-cjs/component/elements/ActionButtons.js +20 -0
- package/lib-cjs/component/elements/Button.js +150 -4
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/ContextMenu.js +6 -6
- package/lib-cjs/component/elements/EditableColumn.js +27 -20
- package/lib-cjs/component/elements/Input.js +18 -5
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +42 -14
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +7 -2
- package/lib-cjs/component/elements/ReactTable/Style.js +1 -9
- package/lib-cjs/component/elements/Select.js +20 -14
- package/lib-cjs/component/elements/ToggleButton.js +2 -2
- package/lib-cjs/component/elements/ToolTip/ToolTip.js +3 -2
- package/lib-cjs/component/elements/draggble/SVGDraggable.js +39 -0
- package/lib-cjs/component/elements/draggble/useDraggable.js +73 -0
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +10 -7
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +6 -3
- package/lib-cjs/component/elements/formik/FormikSlider.js +6 -3
- package/lib-cjs/component/elements/popup/Alert/Provider.js +1 -1
- package/lib-cjs/component/elements/resizer/DivResizer.js +68 -0
- package/lib-cjs/component/elements/resizer/Resizer.js +18 -0
- package/lib-cjs/component/elements/resizer/SVGResizer.js +48 -0
- package/lib-cjs/component/elements/resizer/useResizer.js +71 -0
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +3 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +2 -9
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +2 -9
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +2 -15
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -9
- package/lib-cjs/component/header/Zones2DOptionPanel.js +2 -13
- package/lib-cjs/component/hooks/useExport.js +11 -9
- package/lib-cjs/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +2 -12
- package/lib-cjs/component/hooks/usePanelPreferences.js +62 -0
- package/lib-cjs/component/loader/DefaultSpinnerComponent.js +2 -2
- package/lib-cjs/component/loader/DropZone.js +1 -0
- package/lib-cjs/component/loader/SpinnerContext.js +2 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +2 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -1
- package/lib-cjs/component/modal/ImportPublicationStringModal.js +2 -1
- package/lib-cjs/component/modal/LoadJCAMPModal.js +7 -6
- package/lib-cjs/component/modal/ModalStyle.js +4 -26
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +29 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +2 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +2 -7
- package/lib-cjs/component/modal/SaveAsModal.js +2 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +6 -5
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +12 -9
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +80 -0
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +11 -7
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +19 -13
- package/lib-cjs/component/modal/setting/GeneralSettings.js +4 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +72 -0
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +6 -4
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +13 -6
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +72 -0
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +2 -5
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -11
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +24 -72
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +44 -0
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -23
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +21 -7
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +61 -68
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +55 -60
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/Panels.js +2 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -4
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +27 -80
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +18 -48
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +17 -11
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +6 -12
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +53 -64
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +3 -7
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +18 -17
- package/lib-cjs/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +16 -0
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -16
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/PlotChart.js +21 -0
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +10 -68
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +10 -68
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +55 -0
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +4 -4
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +18 -82
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +4 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +23 -23
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +72 -39
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +10 -42
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +22 -10
- package/lib-cjs/component/panels/databasePanel/useDatabases.js +14 -0
- package/lib-cjs/component/panels/extra/placeholder/NoTableData.js +2 -2
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +3 -3
- package/lib-cjs/component/panels/extra/preferences/NucleusPreferences.js +29 -0
- package/lib-cjs/component/panels/extra/preferences/PreferencesContainer.js +14 -0
- package/lib-cjs/component/panels/extra/preferences/PreferencesGroup.js +25 -0
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +37 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -18
- package/lib-cjs/component/reducer/Reducer.js +9 -2
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +21 -0
- package/lib-cjs/component/reducer/actions/LoadActions.js +10 -5
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +17 -3
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +1 -1
- package/lib-cjs/component/reducer/actions/ToolsActions.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +26 -0
- package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +67 -0
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +24 -0
- package/lib-cjs/component/reducer/preferences/actions/resetPreferences.js +18 -0
- package/lib-cjs/component/reducer/preferences/actions/setPanelsPreferences.js +17 -0
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +38 -0
- package/lib-cjs/component/reducer/preferences/actions/setWorkspace.js +12 -0
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +62 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +87 -0
- package/lib-cjs/component/reducer/preferences/utilites/checkKeysExists.js +18 -0
- package/lib-cjs/component/reducer/preferences/utilites/filterObject.js +11 -0
- package/lib-cjs/component/reducer/preferences/utilites/flatObject.js +13 -0
- package/lib-cjs/component/reducer/preferences/utilites/getActiveWorkspace.js +7 -0
- package/lib-cjs/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +11 -0
- package/lib-cjs/component/reducer/preferences/utilites/mapNucleiFormatting.js +12 -0
- package/lib-cjs/component/reducer/types/Types.js +6 -3
- package/lib-cjs/component/tool/FloatMoleculeStructures/ActionsButton.js +13 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +50 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +36 -0
- package/lib-cjs/component/utility/Export.js +16 -9
- package/lib-cjs/component/utility/PathBuilder.js +2 -1
- package/lib-cjs/component/utility/formatNumber.js +17 -0
- package/lib-cjs/component/utility/getUniqueNuclei.js +14 -0
- package/lib-cjs/component/workspaces/basic.js +17 -10
- package/lib-cjs/component/workspaces/embedded.js +35 -0
- package/lib-cjs/component/workspaces/exercise.js +2 -0
- package/lib-cjs/component/workspaces/index.js +2 -1
- package/lib-cjs/component/workspaces/prediction.js +2 -0
- package/lib-cjs/component/workspaces/process1D.js +2 -0
- package/lib-cjs/data/SpectraManager.js +23 -15
- package/lib-cjs/data/data1d/Data1DManager.js +6 -1
- package/lib-cjs/data/data1d/Spectrum1D/convertDataToFloat64Array.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
- package/lib-cjs/data/data1d/Spectrum1D/toJSON.js +1 -0
- package/lib-cjs/data/data1d/database.js +15 -21
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +4 -4
- package/lib-cjs/data/data1d/filter1d/fft.js +2 -2
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib-cjs/data/data1d/filter1d/pareto.js +2 -2
- package/lib-cjs/data/data1d/filter1d/shiftX.js +2 -2
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Data2DManager.js +6 -1
- package/lib-cjs/data/data2d/Spectrum2D/toJSON.js +1 -0
- package/lib-cjs/data/data2d/filter2d/shiftX.js +4 -4
- package/lib-cjs/data/data2d/filter2d/shiftY.js +4 -4
- package/lib-cjs/data/molecules/Molecule.js +7 -1
- package/lib-cjs/data/molecules/MoleculeManager.js +37 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +49 -48
- package/lib/component/1d/Resizable.d.ts +0 -12
- package/lib/component/1d/Resizable.js +0 -105
- package/lib/component/panels/extra/preferences/defaultValues.d.ts +0 -54
- package/lib/component/panels/extra/preferences/defaultValues.js +0 -54
- package/lib/component/reducer/preferencesReducer.js +0 -272
- package/lib/component/utility/FormatNumber.d.ts +0 -6
- package/lib-cjs/component/1d/Resizable.js +0 -110
- package/lib-cjs/component/panels/extra/preferences/defaultValues.js +0 -61
- package/lib-cjs/component/reducer/preferencesReducer.js +0 -279
|
@@ -31,34 +31,12 @@ exports.ModalStyles = (0, react_1.css) `
|
|
|
31
31
|
overflow: auto;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
button:focus {
|
|
35
|
-
outline: none;
|
|
36
|
-
}
|
|
37
|
-
button:not([disabled]):hover {
|
|
38
|
-
color: black;
|
|
39
|
-
}
|
|
40
|
-
.btn:not([disabled]):hover {
|
|
41
|
-
background-color: #ffffff;
|
|
42
|
-
}
|
|
43
|
-
.btn:disabled {
|
|
44
|
-
opacity: 0.5;
|
|
45
|
-
}
|
|
46
|
-
.btn {
|
|
47
|
-
border: none;
|
|
48
|
-
padding: 0 15px;
|
|
49
|
-
background-color: #ffffff5e;
|
|
50
|
-
border-radius: 5px;
|
|
51
|
-
height: 25px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.primary {
|
|
55
|
-
background-color: #e2e2e2;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
34
|
.footer-container {
|
|
59
35
|
display: flex;
|
|
60
|
-
flex-direction: row
|
|
61
|
-
align-items:
|
|
36
|
+
flex-direction: row;
|
|
37
|
+
align-items: end;
|
|
38
|
+
justify-content: end;
|
|
39
|
+
|
|
62
40
|
background: rgb(242, 242, 242);
|
|
63
41
|
background: -moz-linear-gradient(
|
|
64
42
|
0deg,
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useMoleculeEditor = void 0;
|
|
3
7
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
4
8
|
/** @jsxImportSource @emotion/react */
|
|
5
9
|
const react_1 = require("react");
|
|
6
10
|
const full_1 = require("react-ocl/full");
|
|
7
11
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
12
|
+
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
13
|
+
const Modal_1 = require("../elements/popup/Modal");
|
|
14
|
+
const options_1 = require("../elements/popup/options");
|
|
8
15
|
const Types_1 = require("../reducer/types/Types");
|
|
9
16
|
const ModalStyle_1 = require("./ModalStyle");
|
|
10
17
|
function MoleculeStructureEditorModal(props) {
|
|
@@ -28,7 +35,16 @@ function MoleculeStructureEditorModal(props) {
|
|
|
28
35
|
}, [onClose]);
|
|
29
36
|
const handleSave = (0, react_1.useCallback)(() => {
|
|
30
37
|
if (selectedMolecule) {
|
|
31
|
-
|
|
38
|
+
const { key, isFloat, label } = selectedMolecule;
|
|
39
|
+
dispatch({
|
|
40
|
+
type: Types_1.SET_MOLECULE,
|
|
41
|
+
payload: {
|
|
42
|
+
molfile,
|
|
43
|
+
key,
|
|
44
|
+
isFloat,
|
|
45
|
+
label,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
32
48
|
onClose('replace');
|
|
33
49
|
}
|
|
34
50
|
else {
|
|
@@ -36,6 +52,17 @@ function MoleculeStructureEditorModal(props) {
|
|
|
36
52
|
onClose('new');
|
|
37
53
|
}
|
|
38
54
|
}, [dispatch, selectedMolecule, molfile, onClose]);
|
|
39
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsx)(full_1.StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }), (0, jsx_runtime_1.
|
|
55
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsx)(full_1.StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }), (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: handleClose }) })] }));
|
|
40
56
|
}
|
|
57
|
+
function useMoleculeEditor() {
|
|
58
|
+
const modal = (0, Modal_1.useModal)();
|
|
59
|
+
return (0, react_1.useCallback)((molecule) => {
|
|
60
|
+
modal.show((0, jsx_runtime_1.jsx)(MoleculeStructureEditorModal, { selectedMolecule: molecule }), {
|
|
61
|
+
position: options_1.positions.TOP_CENTER,
|
|
62
|
+
width: 700,
|
|
63
|
+
height: 500,
|
|
64
|
+
});
|
|
65
|
+
}, [modal]);
|
|
66
|
+
}
|
|
67
|
+
exports.useMoleculeEditor = useMoleculeEditor;
|
|
41
68
|
exports.default = MoleculeStructureEditorModal;
|
|
@@ -33,6 +33,7 @@ const react_2 = require("react");
|
|
|
33
33
|
const Filters = __importStar(require("../../../data/Filters"));
|
|
34
34
|
const References_1 = require("../../../data/constants/References");
|
|
35
35
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
36
|
+
const ActionButtons_1 = __importDefault(require("../../elements/ActionButtons"));
|
|
36
37
|
const CloseButton_1 = __importDefault(require("../../elements/CloseButton"));
|
|
37
38
|
const Select_1 = __importDefault(require("../../elements/Select"));
|
|
38
39
|
const FormikForm_1 = __importDefault(require("../../elements/formik/FormikForm"));
|
|
@@ -142,6 +143,6 @@ function MultipleSpectraFiltersModal({ onClose = () => null, nucleus = '', }) {
|
|
|
142
143
|
break;
|
|
143
144
|
}
|
|
144
145
|
}, [filter, submitHandler]);
|
|
145
|
-
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: "Apply filters" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "inner-content container", children: [(0, jsx_runtime_1.jsx)("p", { className: "infoText", children: "This filter will use the exclusions zones defined in the first spectrum." }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Filter :" }), (0, jsx_runtime_1.jsx)(Select_1.default, { data: List, style: { width: 275, height: 30, margin: 0 }, onChange: filterChangeHandler })] }), filterOptions] }), (0, jsx_runtime_1.
|
|
146
|
+
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: "Apply filters" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "inner-content container", children: [(0, jsx_runtime_1.jsx)("p", { className: "infoText", children: "This filter will use the exclusions zones defined in the first spectrum." }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Filter :" }), (0, jsx_runtime_1.jsx)(Select_1.default, { data: List, style: { width: 275, height: 30, margin: 0 }, onChange: filterChangeHandler })] }), filterOptions] }), (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, cancelLabel: "Close" }) })] }));
|
|
146
147
|
}
|
|
147
148
|
exports.default = MultipleSpectraFiltersModal;
|
|
@@ -35,6 +35,7 @@ const PredictionManager_1 = require("../../data/PredictionManager");
|
|
|
35
35
|
const generateNumbersPowerOfX_1 = __importDefault(require("../../data/utilities/generateNumbersPowerOfX"));
|
|
36
36
|
const ChartContext_1 = require("../context/ChartContext");
|
|
37
37
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
38
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
38
39
|
const CheckBox_1 = __importDefault(require("../elements/CheckBox"));
|
|
39
40
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
40
41
|
const IsotopesViewer_1 = __importDefault(require("../elements/IsotopesViewer"));
|
|
@@ -88,12 +89,6 @@ const styles = (0, react_1.css) `
|
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
|
|
91
|
-
button[disabled],
|
|
92
|
-
button[disabled]:hover {
|
|
93
|
-
opacity: 0.5;
|
|
94
|
-
color: black;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
92
|
.middle-x {
|
|
98
93
|
padding: 0 10px;
|
|
99
94
|
}
|
|
@@ -189,6 +184,6 @@ function PredictSpectraModal({ onClose = () => null, molfile, }) {
|
|
|
189
184
|
const approveCheckHandler = (0, react_2.useCallback)((e) => {
|
|
190
185
|
setApproved(e.target.checked);
|
|
191
186
|
}, []);
|
|
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.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: initValues, validationSchema: predictionFormValidation, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsx)(FormikErrorsSummary_1.default, {}), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Name :" }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "name", style: { input: { width: '200px', textAlign: 'left' } } })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Spectrometer Frequency :" }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: PredictionManager_1.FREQUENCIES, style: { width: 290, height: 30, margin: 0 }, name: "frequency" })] }), (0, jsx_runtime_1.jsx)("span", { className: "group-label", children: "1D Options " }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "1H", className: "custom-label" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.to", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "13C", className: "custom-label" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.to", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Line Width : " }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.lineWidth", type: "number", style: { input: { margin: 0 } } }), (0, jsx_runtime_1.jsx)("span", { style: { paddingLeft: '0.4rem' }, children: " Hz " })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Number of Points : " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: NUMBER_OF_POINTS_1D, name: "1d.nbPoints", style: { width: 290, height: 30, margin: 0 } })] }), (0, jsx_runtime_1.jsx)("span", { className: "group-label", children: "2D Options " }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Number of Points : " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.x", style: { margin: 0, height: 30 } }), (0, jsx_runtime_1.jsx)("span", { className: "middle-x", children: " X " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.y", style: { margin: 0, height: 30 } })] }), (0, jsx_runtime_1.jsx)("div", { className: "row margin-10", children: (0, jsx_runtime_1.jsx)("span", { className: "group-label", children: "Spectra " }) }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", style: { justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.proton" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "1H", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.carbon" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "13C", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.cosy" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "COSY", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.hsqc" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "HSQC", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.hmbc" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "HMBC", className: "nucleus-label" })] })] })] }), (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)(
|
|
187
|
+
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.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: initValues, validationSchema: predictionFormValidation, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsx)(FormikErrorsSummary_1.default, {}), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Name :" }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "name", style: { input: { width: '200px', textAlign: 'left' } } })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Spectrometer Frequency :" }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: PredictionManager_1.FREQUENCIES, style: { width: 290, height: 30, margin: 0 }, name: "frequency" })] }), (0, jsx_runtime_1.jsx)("span", { className: "group-label", children: "1D Options " }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "1H", className: "custom-label" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.to", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "13C", className: "custom-label" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.to", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Line Width : " }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.lineWidth", type: "number", style: { input: { margin: 0 } } }), (0, jsx_runtime_1.jsx)("span", { style: { paddingLeft: '0.4rem' }, children: " Hz " })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Number of Points : " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: NUMBER_OF_POINTS_1D, name: "1d.nbPoints", style: { width: 290, height: 30, margin: 0 } })] }), (0, jsx_runtime_1.jsx)("span", { className: "group-label", children: "2D Options " }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Number of Points : " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.x", style: { margin: 0, height: 30 } }), (0, jsx_runtime_1.jsx)("span", { className: "middle-x", children: " X " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.y", style: { margin: 0, height: 30 } })] }), (0, jsx_runtime_1.jsx)("div", { className: "row margin-10", children: (0, jsx_runtime_1.jsx)("span", { className: "group-label", children: "Spectra " }) }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", style: { justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.proton" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "1H", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.carbon" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "13C", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.cosy" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "COSY", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.hsqc" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "HSQC", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.hmbc" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "HMBC", className: "nucleus-label" })] })] })] }), (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" }) })] }));
|
|
193
188
|
}
|
|
194
189
|
exports.default = PredictSpectraModal;
|
|
@@ -9,6 +9,7 @@ const react_1 = require("@emotion/react");
|
|
|
9
9
|
const formik_1 = require("formik");
|
|
10
10
|
const react_2 = require("react");
|
|
11
11
|
const SpectraManager_1 = require("../../data/SpectraManager");
|
|
12
|
+
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
12
13
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
13
14
|
const FormikCheckBox_1 = __importDefault(require("../elements/formik/FormikCheckBox"));
|
|
14
15
|
const FormikForm_1 = __importDefault(require("../elements/formik/FormikForm"));
|
|
@@ -61,6 +62,6 @@ function SaveAsModal({ onClose, onSave, name }) {
|
|
|
61
62
|
}, [onClose, onSave]);
|
|
62
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.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: { ...INITIAL_VALUE, name }, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Name" }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "name", className: "name", style: {
|
|
63
64
|
inputWrapper: { width: '100%' },
|
|
64
|
-
} })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Compressed" }), (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "compressed" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Pretty Format" }), (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "pretty" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: " Include " }), (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: "dataExportOption", value: SpectraManager_1.DataExportOptions.ROW_DATA }), "Raw Data"] }), (0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)(formik_1.Field, { type: "radio", name: "dataExportOption", value: SpectraManager_1.DataExportOptions.DATA_SOURCE }), "Data Source"] })] })] })] }) }), (0, jsx_runtime_1.
|
|
65
|
+
} })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Compressed" }), (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "compressed" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Pretty Format" }), (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "pretty" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: " Include " }), (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: "dataExportOption", value: SpectraManager_1.DataExportOptions.ROW_DATA }), "Raw Data"] }), (0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)(formik_1.Field, { type: "radio", name: "dataExportOption", value: SpectraManager_1.DataExportOptions.DATA_SOURCE }), "Data Source"] })] })] })] }) }), (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?.() }) })] }));
|
|
65
66
|
}
|
|
66
67
|
exports.default = SaveAsModal;
|
|
@@ -16,9 +16,10 @@ const CloseButton_1 = __importDefault(require("../../elements/CloseButton"));
|
|
|
16
16
|
const SaveButton_1 = __importDefault(require("../../elements/SaveButton"));
|
|
17
17
|
const FormikForm_1 = __importDefault(require("../../elements/formik/FormikForm"));
|
|
18
18
|
const FormikOnChange_1 = __importDefault(require("../../elements/formik/FormikOnChange"));
|
|
19
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
19
20
|
const MultiplicityUtilities_1 = require("../../panels/extra/utilities/MultiplicityUtilities");
|
|
20
21
|
const Types_1 = require("../../reducer/types/Types");
|
|
21
|
-
const
|
|
22
|
+
const formatNumber_1 = require("../../utility/formatNumber");
|
|
22
23
|
const SignalsForm_1 = __importDefault(require("./forms/components/SignalsForm"));
|
|
23
24
|
const EditRangeValidation_1 = __importDefault(require("./forms/validation/EditRangeValidation"));
|
|
24
25
|
const styles = (0, react_1.css) `
|
|
@@ -76,7 +77,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
76
77
|
const formRef = (0, react_2.useRef)(null);
|
|
77
78
|
const { activeTab } = (0, ChartContext_1.useChartData)();
|
|
78
79
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
79
|
-
const
|
|
80
|
+
const rangesPreferences = (0, usePanelPreferences_1.usePanelPreferences)('ranges', activeTab);
|
|
80
81
|
const validation = (0, EditRangeValidation_1.default)();
|
|
81
82
|
const handleOnZoom = (0, react_2.useCallback)(() => {
|
|
82
83
|
onZoomEditRangeModal(range);
|
|
@@ -129,7 +130,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
129
130
|
};
|
|
130
131
|
if ((0, MultiplicityUtilities_1.hasCouplingConstant)(_multiplicity)) {
|
|
131
132
|
coupling = { ...signal.js[counterJ] };
|
|
132
|
-
coupling.coupling = Number(
|
|
133
|
+
coupling.coupling = Number((0, formatNumber_1.formatNumber)(coupling.coupling, rangesPreferences.coupling.format));
|
|
133
134
|
counterJ++;
|
|
134
135
|
}
|
|
135
136
|
coupling.multiplicity = (0, MultiplicityUtilities_1.translateMultiplet)(coupling.multiplicity);
|
|
@@ -138,7 +139,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
138
139
|
return { ...signal, js: couplings };
|
|
139
140
|
});
|
|
140
141
|
return { activeTab: '0', signals };
|
|
141
|
-
}, [
|
|
142
|
+
}, [range.signals, rangesPreferences.coupling.format]);
|
|
142
143
|
const changeHandler = (0, react_2.useCallback)((values) => {
|
|
143
144
|
const signals = getSignals(values.signals);
|
|
144
145
|
dispatch({
|
|
@@ -146,6 +147,6 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
146
147
|
payload: { tempRange: Object.assign({}, range, { signals }) },
|
|
147
148
|
});
|
|
148
149
|
}, [dispatch, getSignals, range]);
|
|
149
|
-
return ((0, jsx_runtime_1.jsx)("div", { css: styles, children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: formRef, initialValues: data, validationSchema: validation, onSubmit: handleOnSave, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)(Button_1.default, { onClick: handleOnZoom, className: "zoom-button", children: (0, jsx_runtime_1.jsx)(fa_1.FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), (0, jsx_runtime_1.jsx)("span", { children: ` Range and Signal edition: ${
|
|
150
|
+
return ((0, jsx_runtime_1.jsx)("div", { css: styles, children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: formRef, initialValues: data, validationSchema: validation, onSubmit: handleOnSave, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)(Button_1.default, { onClick: handleOnZoom, className: "zoom-button", children: (0, jsx_runtime_1.jsx)(fa_1.FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), (0, jsx_runtime_1.jsx)("span", { 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)(SignalsForm_1.default, { range: range, preferences: rangesPreferences }), (0, jsx_runtime_1.jsx)(FormikOnChange_1.default, { onChange: changeHandler })] }) }));
|
|
150
151
|
}
|
|
151
152
|
exports.default = EditRangeModal;
|
|
@@ -33,12 +33,11 @@ const formik_1 = require("formik");
|
|
|
33
33
|
const react_2 = require("react");
|
|
34
34
|
const fa_1 = require("react-icons/fa");
|
|
35
35
|
const Yup = __importStar(require("yup"));
|
|
36
|
-
const ChartContext_1 = require("../../../../context/ChartContext");
|
|
37
36
|
const Button_1 = __importDefault(require("../../../../elements/Button"));
|
|
38
37
|
const FormikForm_1 = __importDefault(require("../../../../elements/formik/FormikForm"));
|
|
39
38
|
const FormikInput_1 = __importDefault(require("../../../../elements/formik/FormikInput"));
|
|
40
39
|
const MultiplicityUtilities_1 = require("../../../../panels/extra/utilities/MultiplicityUtilities");
|
|
41
|
-
const
|
|
40
|
+
const formatNumber_1 = require("../../../../utility/formatNumber");
|
|
42
41
|
const styles = {
|
|
43
42
|
container: (0, react_1.css) `
|
|
44
43
|
text-align: center;
|
|
@@ -80,10 +79,8 @@ const styles = {
|
|
|
80
79
|
`,
|
|
81
80
|
};
|
|
82
81
|
// TODO: this seems to be a hacky use of ref.
|
|
83
|
-
function AddSignalFormTab({ onFocus, onBlur, range }, ref) {
|
|
82
|
+
function AddSignalFormTab({ onFocus, onBlur, range, preferences }, ref) {
|
|
84
83
|
const { values, setFieldValue } = (0, formik_1.useFormikContext)();
|
|
85
|
-
const { activeTab } = (0, ChartContext_1.useChartData)();
|
|
86
|
-
const format = (0, FormatNumber_1.useFormatNumberByNucleus)(activeTab);
|
|
87
84
|
const saveHandler = (0, react_2.useCallback)((val) => {
|
|
88
85
|
const newSignal = {
|
|
89
86
|
multiplicity: 'm',
|
|
@@ -119,6 +116,6 @@ function AddSignalFormTab({ onFocus, onBlur, range }, ref) {
|
|
|
119
116
|
width: '250px',
|
|
120
117
|
height: '30px',
|
|
121
118
|
},
|
|
122
|
-
}, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsxs)("p", { css: styles.inputInfo, children: ["[
|
|
119
|
+
}, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsxs)("p", { css: styles.inputInfo, children: ["[", `${(0, formatNumber_1.formatNumber)(range.from, preferences.from.format)} ppm - ${(0, formatNumber_1.formatNumber)(range.to, preferences.to.format)} ppm`, "]"] }), (0, jsx_runtime_1.jsx)(Button_1.default, { css: styles.addSignalBtn, onClick: triggerSubmitHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, { title: "Add new signal" }) })] })] }) }));
|
|
123
120
|
}
|
|
124
121
|
exports.default = (0, react_2.forwardRef)(AddSignalFormTab);
|
|
@@ -8,12 +8,11 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const formik_1 = require("formik");
|
|
10
10
|
const react_2 = require("react");
|
|
11
|
-
const ChartContext_1 = require("../../../../context/ChartContext");
|
|
12
11
|
const Tab_1 = __importDefault(require("../../../../elements/Tab/Tab"));
|
|
13
12
|
const Tabs_1 = __importDefault(require("../../../../elements/Tab/Tabs"));
|
|
14
13
|
const useSpectrum_1 = __importDefault(require("../../../../hooks/useSpectrum"));
|
|
15
14
|
const Events_1 = __importDefault(require("../../../../utility/Events"));
|
|
16
|
-
const
|
|
15
|
+
const formatNumber_1 = require("../../../../utility/formatNumber");
|
|
17
16
|
const AddSignalFormTab_1 = __importDefault(require("./AddSignalFormTab"));
|
|
18
17
|
const DeltaInput_1 = __importDefault(require("./DeltaInput"));
|
|
19
18
|
const SignalFormTab_1 = __importDefault(require("./SignalFormTab"));
|
|
@@ -43,13 +42,11 @@ const tabStyles = (0, react_1.css) `
|
|
|
43
42
|
list-style: none;
|
|
44
43
|
padding: 0.5rem 1.5rem;
|
|
45
44
|
`;
|
|
46
|
-
function SignalsForm({ range }) {
|
|
45
|
+
function SignalsForm({ range, preferences }) {
|
|
47
46
|
const newSignalFormRef = (0, react_2.useRef)();
|
|
48
47
|
const [activeField, setActiveField] = (0, react_2.useState)(null);
|
|
49
48
|
const { values, setFieldValue, errors, } = (0, formik_1.useFormikContext)();
|
|
50
|
-
const { activeTab } = (0, ChartContext_1.useChartData)();
|
|
51
49
|
const { info } = (0, useSpectrum_1.default)({ info: {} });
|
|
52
|
-
const format = (0, FormatNumber_1.useFormatNumberByNucleus)(activeTab);
|
|
53
50
|
(0, react_2.useEffect)(() => {
|
|
54
51
|
function handle(event) {
|
|
55
52
|
if (info?.originFrequency && activeField) {
|
|
@@ -62,7 +59,7 @@ function SignalsForm({ range }) {
|
|
|
62
59
|
setFieldValue(activeField, (event.range[1] - event.range[0]) / 2 + event.range[0]);
|
|
63
60
|
}
|
|
64
61
|
else {
|
|
65
|
-
const value = Number(
|
|
62
|
+
const value = Number((0, formatNumber_1.formatNumber)(Math.abs(event.range[0] - event.range[1]) * info.originFrequency, preferences.deltaHz.format));
|
|
66
63
|
setFieldValue(activeField, value);
|
|
67
64
|
}
|
|
68
65
|
}
|
|
@@ -72,7 +69,13 @@ function SignalsForm({ range }) {
|
|
|
72
69
|
return () => {
|
|
73
70
|
Events_1.default.off('brushEnd', handle);
|
|
74
71
|
};
|
|
75
|
-
}, [
|
|
72
|
+
}, [
|
|
73
|
+
activeField,
|
|
74
|
+
setFieldValue,
|
|
75
|
+
values.activeTab,
|
|
76
|
+
info,
|
|
77
|
+
preferences?.deltaHz?.format,
|
|
78
|
+
]);
|
|
76
79
|
(0, react_2.useEffect)(() => {
|
|
77
80
|
function handle(event) {
|
|
78
81
|
if (activeField) {
|
|
@@ -114,9 +117,9 @@ function SignalsForm({ range }) {
|
|
|
114
117
|
// eslint-disable-next-line react/no-array-index-key
|
|
115
118
|
, { tabid: `${i}`, tabstyles: tabContainsErrors(i) ? tabStylesAddition : tabStyles, canDelete: true, render: () => ((0, jsx_runtime_1.jsx)(DeltaInput_1.default, { signal: signal, index: i, onFocus: handleOnFocus })), children: (0, jsx_runtime_1.jsx)(SignalFormTab_1.default, { onFocus: handleOnFocus }) }, `signalForm${i}`)))
|
|
116
119
|
: [];
|
|
117
|
-
const addSignalTab = ((0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "+", tabid: "addSignalTab", canDelete: false, className: "add-signal-tab", children: (0, jsx_runtime_1.jsx)(AddSignalFormTab_1.default, { onFocus: handleOnFocus, range: range, ref: newSignalFormRef }) }, "addSignalTab"));
|
|
120
|
+
const addSignalTab = ((0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "+", tabid: "addSignalTab", canDelete: false, className: "add-signal-tab", children: (0, jsx_runtime_1.jsx)(AddSignalFormTab_1.default, { onFocus: handleOnFocus, range: range, ref: newSignalFormRef, preferences: preferences }) }, "addSignalTab"));
|
|
118
121
|
return signalTabs.concat(addSignalTab);
|
|
119
|
-
}, [handleOnFocus, range, tabContainsErrors, values.signals]);
|
|
122
|
+
}, [handleOnFocus, preferences, range, tabContainsErrors, values.signals]);
|
|
120
123
|
const editSignalInfoText = ((0, jsx_runtime_1.jsx)("p", { className: "infoText", children: "Focus on an input field and press Shift + Drag & Drop to draw a coupling constant in spectrum view." }));
|
|
121
124
|
const addSignalInfoText = ((0, jsx_runtime_1.jsx)("p", { className: "infoText", children: "Focus on the input field and press Shift + Left mouse click to select new signal delta value in spectrum view." }));
|
|
122
125
|
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { css: textStyles, children: errors.signals &&
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
|
+
/** @jsxImportSource @emotion/react */
|
|
8
|
+
const react_1 = require("@emotion/react");
|
|
9
|
+
const formik_1 = require("formik");
|
|
10
|
+
const get_1 = __importDefault(require("lodash/get"));
|
|
11
|
+
const react_2 = require("react");
|
|
12
|
+
const fa_1 = require("react-icons/fa");
|
|
13
|
+
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
14
|
+
const FormikCheckBox_1 = __importDefault(require("../../elements/formik/FormikCheckBox"));
|
|
15
|
+
const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
|
|
16
|
+
const workspaces_1 = __importDefault(require("../../workspaces"));
|
|
17
|
+
const style = {
|
|
18
|
+
addButton: (0, react_1.css) `
|
|
19
|
+
background-color: transparent;
|
|
20
|
+
border: 0;
|
|
21
|
+
outline: none;
|
|
22
|
+
margin-left: 5px;
|
|
23
|
+
svg {
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
fill: green;
|
|
26
|
+
}
|
|
27
|
+
`,
|
|
28
|
+
table: {
|
|
29
|
+
width: '100%',
|
|
30
|
+
},
|
|
31
|
+
th: {
|
|
32
|
+
fontSize: '12px',
|
|
33
|
+
},
|
|
34
|
+
input: {
|
|
35
|
+
input: { width: '100%' },
|
|
36
|
+
},
|
|
37
|
+
labelCol: {
|
|
38
|
+
width: '30%',
|
|
39
|
+
},
|
|
40
|
+
serialCol: {
|
|
41
|
+
width: '5%',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
function DatabasesTabContent({ currentWorkspace }) {
|
|
45
|
+
const { values, setFieldValue } = (0, formik_1.useFormikContext)();
|
|
46
|
+
const databases = (0, react_2.useMemo)(() => (0, get_1.default)(values, 'databases', []), [values]);
|
|
47
|
+
const deleteHandler = (0, react_2.useCallback)((index) => {
|
|
48
|
+
const _database = databases.slice();
|
|
49
|
+
_database.splice(index, 1);
|
|
50
|
+
setFieldValue('databases', _database);
|
|
51
|
+
}, [databases, setFieldValue]);
|
|
52
|
+
const addNewDatabaseHandler = (0, react_2.useCallback)(() => {
|
|
53
|
+
const newDatabase = {
|
|
54
|
+
label: '',
|
|
55
|
+
url: '',
|
|
56
|
+
enabled: true,
|
|
57
|
+
};
|
|
58
|
+
setFieldValue('databases', [...databases, newDatabase]);
|
|
59
|
+
}, [databases, setFieldValue]);
|
|
60
|
+
const resetDatabaseHandler = (0, react_2.useCallback)(() => {
|
|
61
|
+
const database = workspaces_1.default?.[currentWorkspace]?.databases || workspaces_1.default.default.databases;
|
|
62
|
+
setFieldValue('databases', database);
|
|
63
|
+
}, [currentWorkspace, setFieldValue]);
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "section-header", style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)("p", { style: { flex: 1 }, children: "Databases" }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Danger, { fill: "clear", size: "xSmall", onClick: resetDatabaseHandler, style: { margin: '0 5px' }, children: "Reset Databases" }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "outline", size: "xSmall", onClick: addNewDatabaseHandler, children: "Add Database" })] })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("table", { style: style.table, children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { style: style.th, children: "#" }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "Label " }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "URL" }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "Enabled" }), (0, jsx_runtime_1.jsx)("th", {})] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: databases?.map((item, index) => {
|
|
65
|
+
const num = index + 1;
|
|
66
|
+
return (
|
|
67
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
68
|
+
(0, jsx_runtime_1.jsxs)("tr", { style: { height: '33px' }, children: [(0, jsx_runtime_1.jsxs)("td", { style: style.serialCol, children: [(0, jsx_runtime_1.jsx)("span", { children: num }), ' '] }), (0, jsx_runtime_1.jsx)("td", { style: style.labelCol, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { style: style.input, name: `databases.${index}.label`, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { style: style.input, name: `databases.${index}.url`, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { style: {
|
|
69
|
+
container: {
|
|
70
|
+
display: 'block',
|
|
71
|
+
margin: '0 auto',
|
|
72
|
+
width: 'fit-content',
|
|
73
|
+
},
|
|
74
|
+
}, className: "checkbox-element", name: `databases.${index}.enabled` }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
75
|
+
display: 'flex',
|
|
76
|
+
height: '100%',
|
|
77
|
+
}, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: () => deleteHandler(index), children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }), databases.length === index + 1 && ((0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", style: { fontSize: '14px' }, onClick: addNewDatabaseHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }))] }) })] }, `${index}`));
|
|
78
|
+
}) })] }) })] }));
|
|
79
|
+
}
|
|
80
|
+
exports.default = DatabasesTabContent;
|
|
@@ -14,7 +14,7 @@ const LIST = [
|
|
|
14
14
|
name: 'panels.spectraPanel',
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
label: 'Spectra information
|
|
17
|
+
label: 'Spectra information panel',
|
|
18
18
|
name: 'panels.informationPanel',
|
|
19
19
|
},
|
|
20
20
|
{
|
|
@@ -34,7 +34,7 @@ const LIST = [
|
|
|
34
34
|
name: 'panels.structuresPanel',
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
label: 'Filters
|
|
37
|
+
label: 'Filters panel',
|
|
38
38
|
name: 'panels.filtersPanel',
|
|
39
39
|
},
|
|
40
40
|
{
|
|
@@ -42,23 +42,27 @@ const LIST = [
|
|
|
42
42
|
name: 'panels.zonesPanel',
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
label: 'Assignment summary
|
|
45
|
+
label: 'Assignment summary panel',
|
|
46
46
|
name: 'panels.summaryPanel',
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
label: 'Multiple
|
|
49
|
+
label: 'Multiple spectra analysis panel',
|
|
50
50
|
name: 'panels.multipleSpectraAnalysisPanel',
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
-
label: '
|
|
53
|
+
label: 'Databases panel',
|
|
54
54
|
name: 'panels.databasePanel',
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
|
-
label: 'Prediction
|
|
57
|
+
label: 'Prediction panel',
|
|
58
58
|
name: 'panels.predictionPanel',
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
label: '
|
|
61
|
+
label: 'Automatic assignment panel',
|
|
62
|
+
name: 'panels.automaticAssignmentPanel',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: 'Experimental features',
|
|
62
66
|
name: 'general.experimentalFeatures',
|
|
63
67
|
hideOpenOption: true,
|
|
64
68
|
},
|
|
@@ -11,7 +11,7 @@ const get_1 = __importDefault(require("lodash/get"));
|
|
|
11
11
|
const react_2 = require("react");
|
|
12
12
|
const fa_1 = require("react-icons/fa");
|
|
13
13
|
const generateID_1 = __importDefault(require("../../../data/utilities/generateID"));
|
|
14
|
-
const
|
|
14
|
+
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
15
15
|
const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
|
|
16
16
|
const styles = (0, react_1.css) `
|
|
17
17
|
.counter-col {
|
|
@@ -23,7 +23,7 @@ const styles = (0, react_1.css) `
|
|
|
23
23
|
width: 80px;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.
|
|
26
|
+
.input {
|
|
27
27
|
width: 100% !important;
|
|
28
28
|
margin: 0px !important;
|
|
29
29
|
}
|
|
@@ -52,24 +52,30 @@ const styles = (0, react_1.css) `
|
|
|
52
52
|
`;
|
|
53
53
|
function FormattingTabContent() {
|
|
54
54
|
const { values, setFieldValue } = (0, formik_1.useFormikContext)();
|
|
55
|
-
const
|
|
56
|
-
const deleteHandler = (0, react_2.useCallback)((
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
const nuclei = (0, react_2.useMemo)(() => (0, get_1.default)(values, 'formatting.nuclei', {}), [values]);
|
|
56
|
+
const deleteHandler = (0, react_2.useCallback)((key) => {
|
|
57
|
+
let _nuclei = {};
|
|
58
|
+
for (const nucleus in nuclei) {
|
|
59
|
+
if (nucleus !== key) {
|
|
60
|
+
_nuclei[nucleus] = nuclei[nucleus];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
setFieldValue('formatting.nuclei', _nuclei);
|
|
64
|
+
}, [nuclei, setFieldValue]);
|
|
60
65
|
const addNewNucleusFormatHandler = (0, react_2.useCallback)(() => {
|
|
61
66
|
const newFormat = {
|
|
62
|
-
key: (0, generateID_1.default)(),
|
|
63
67
|
name: '',
|
|
64
68
|
ppm: '0.00',
|
|
65
69
|
hz: '0.00',
|
|
66
70
|
};
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
const key = (0, generateID_1.default)();
|
|
72
|
+
const newNuclei = { ...nuclei, [key]: newFormat };
|
|
73
|
+
setFieldValue('formatting.nuclei', newNuclei);
|
|
74
|
+
}, [nuclei, setFieldValue]);
|
|
75
|
+
const nucleiList = Object.keys(nuclei);
|
|
76
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { className: "section-header", children: "Number formatting for crosshair and info line" }), (0, jsx_runtime_1.jsx)("div", { css: styles, children: (0, jsx_runtime_1.jsxs)("table", { children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { className: "counter-col", children: "#" }), (0, jsx_runtime_1.jsx)("th", { className: "nucleus-label-col", children: "Nucleus " }), (0, jsx_runtime_1.jsx)("th", { className: "nucleus-format-input-col", children: "\u03B4 (ppm)" }), (0, jsx_runtime_1.jsx)("th", { className: "nucleus-format-input-col", children: "Coupling (Hz)" }), (0, jsx_runtime_1.jsx)("th", { className: "nucleus-format-input-col" })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: nucleiList?.map((key, index) => {
|
|
71
77
|
const num = index + 1;
|
|
72
|
-
return ((0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsxs)("td", { className: "counter-col", children: [(0, jsx_runtime_1.jsxs)("span", { children: [num, " - "] }), ' '] }), (0, jsx_runtime_1.jsx)("td", { className: "nucleus-label-col", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `formatting.
|
|
78
|
+
return ((0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsxs)("td", { className: "counter-col", children: [(0, jsx_runtime_1.jsxs)("span", { children: [num, " - "] }), ' '] }), (0, jsx_runtime_1.jsx)("td", { className: "nucleus-label-col", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `formatting.nuclei.${key}.name`, className: "input", checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { className: "nucleus-format-input-col", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `formatting.nuclei.${key}.ppm`, className: "input" }) }), (0, jsx_runtime_1.jsx)("td", { className: "nucleus-format-input-col", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `formatting.nuclei.${key}.hz`, className: "input" }) }), (0, jsx_runtime_1.jsxs)("td", { className: "operation-container", children: [(0, jsx_runtime_1.jsx)(Button_1.default.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: () => deleteHandler(key), children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }), nucleiList.length === index + 1 && ((0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", style: { fontSize: '14px' }, onClick: addNewNucleusFormatHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }))] })] }, `${key}`));
|
|
73
79
|
}) })] }) })] }));
|
|
74
80
|
}
|
|
75
81
|
exports.default = FormattingTabContent;
|
|
@@ -31,6 +31,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
31
31
|
const react_1 = require("@emotion/react");
|
|
32
32
|
const react_2 = require("react");
|
|
33
33
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
34
|
+
const ActionButtons_1 = __importDefault(require("../../elements/ActionButtons"));
|
|
34
35
|
const CloseButton_1 = __importDefault(require("../../elements/CloseButton"));
|
|
35
36
|
const Tab_1 = __importDefault(require("../../elements/Tab/Tab"));
|
|
36
37
|
const Tabs_1 = __importStar(require("../../elements/Tab/Tabs"));
|
|
@@ -39,9 +40,11 @@ const FormikForm_1 = __importDefault(require("../../elements/formik/FormikForm")
|
|
|
39
40
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
40
41
|
const ModalStyle_1 = require("../ModalStyle");
|
|
41
42
|
const ControllersTabContent_1 = __importDefault(require("./ControllersTabContent"));
|
|
43
|
+
const DatabasesTabContent_1 = __importDefault(require("./DatabasesTabContent"));
|
|
42
44
|
const DisplayTabContent_1 = __importDefault(require("./DisplayTabContent"));
|
|
43
45
|
const FormattingTabContent_1 = __importDefault(require("./FormattingTabContent"));
|
|
44
46
|
const WorkspaceItem_1 = __importDefault(require("./WorkspaceItem"));
|
|
47
|
+
const settingsValidation_1 = require("./settingsValidation");
|
|
45
48
|
const styles = (0, react_1.css) `
|
|
46
49
|
.main-content {
|
|
47
50
|
width: 100%;
|
|
@@ -173,6 +176,6 @@ function GeneralSettings({ onClose }) {
|
|
|
173
176
|
const renderItem = (0, react_2.useCallback)((item) => {
|
|
174
177
|
return ((0, jsx_runtime_1.jsx)(WorkspaceItem_1.default, { item: item, onSave: addWorkSpaceHandler, onDelete: deleteWorkSpaceHandler }));
|
|
175
178
|
}, [addWorkSpaceHandler, deleteWorkSpaceHandler]);
|
|
176
|
-
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: "General Settings" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "workspace-container", children: [(0, jsx_runtime_1.jsx)("span", { className: "label", children: "Workspace : " }), (0, jsx_runtime_1.jsx)(DropDownButton_1.default, { data: workspacesList, renderItem: renderItem, selectedKey: preferences?.workspace.current, onSelect: ChangeWorkspaceHandler })] }), (0, jsx_runtime_1.jsx)("div", { className: "main-content", children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { ref: refForm, initialValues: preferences.current, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(Tabs_1.default, { position: Tabs_1.PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [(0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Controllers", tabid: "controllers", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(ControllersTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Formatting", tabid: "formatting", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(FormattingTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Display", tabid: "display", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(DisplayTabContent_1.default, { preferences: preferences.current.display }) }) })
|
|
179
|
+
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: "General Settings" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "workspace-container", children: [(0, jsx_runtime_1.jsx)("span", { className: "label", children: "Workspace : " }), (0, jsx_runtime_1.jsx)(DropDownButton_1.default, { data: workspacesList, renderItem: renderItem, selectedKey: preferences?.workspace.current, onSelect: ChangeWorkspaceHandler })] }), (0, jsx_runtime_1.jsx)("div", { className: "main-content", children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { ref: refForm, initialValues: preferences.current, validationSchema: settingsValidation_1.validation, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(Tabs_1.default, { position: Tabs_1.PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [(0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Controllers", tabid: "controllers", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(ControllersTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Formatting", tabid: "formatting", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(FormattingTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Display", tabid: "display", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(DisplayTabContent_1.default, { preferences: preferences.current.display }) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Databases", tabid: "databases", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(DatabasesTabContent_1.default, { currentWorkspace: preferences.workspace.current }) }) })] }) }, JSON.stringify(preferences.current)) }), (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: handleReset, cancelLabel: "Reset" }) })] }));
|
|
177
180
|
}
|
|
178
181
|
exports.default = GeneralSettings;
|