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
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import useDraggable from '../draggble/useDraggable';
|
|
3
|
+
export default function useResizer(props) {
|
|
4
|
+
const { initialPosition = { x1: 10, x2: 40 }, onStart, onMove, onEnd, parentElement, } = props;
|
|
5
|
+
const currentPosition = useRef(initialPosition);
|
|
6
|
+
const prevPosition = useRef(initialPosition);
|
|
7
|
+
const activeRef = useRef(false);
|
|
8
|
+
const triggerEvent = useRef((position, status) => {
|
|
9
|
+
switch (status) {
|
|
10
|
+
case 'start':
|
|
11
|
+
onStart?.(position);
|
|
12
|
+
activeRef.current = true;
|
|
13
|
+
break;
|
|
14
|
+
case 'move':
|
|
15
|
+
onMove?.(position);
|
|
16
|
+
break;
|
|
17
|
+
case 'end':
|
|
18
|
+
prevPosition.current = position;
|
|
19
|
+
activeRef.current = false;
|
|
20
|
+
onEnd?.(position);
|
|
21
|
+
break;
|
|
22
|
+
default:
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const right = useDraggable({
|
|
27
|
+
position: { x: initialPosition.x2, y: 0 },
|
|
28
|
+
parentElement,
|
|
29
|
+
fromEdge: true,
|
|
30
|
+
});
|
|
31
|
+
const left = useDraggable({
|
|
32
|
+
position: { x: initialPosition.x1, y: 0 },
|
|
33
|
+
parentElement,
|
|
34
|
+
fromEdge: true,
|
|
35
|
+
});
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
currentPosition.current = {
|
|
38
|
+
x1: left.position.value.x,
|
|
39
|
+
x2: right.position.value.x,
|
|
40
|
+
};
|
|
41
|
+
}, [left.position.value.x, right.position.value.x]);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const { value: { x }, action, } = left.position;
|
|
44
|
+
const position = {
|
|
45
|
+
x1: x,
|
|
46
|
+
x2: currentPosition.current.x2,
|
|
47
|
+
};
|
|
48
|
+
triggerEvent.current(position, action);
|
|
49
|
+
}, [left.position]);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const { value: { x }, action, } = right.position;
|
|
52
|
+
const position = {
|
|
53
|
+
x1: currentPosition.current.x1,
|
|
54
|
+
x2: x,
|
|
55
|
+
};
|
|
56
|
+
triggerEvent.current(position, action);
|
|
57
|
+
}, [right.position]);
|
|
58
|
+
return {
|
|
59
|
+
left,
|
|
60
|
+
right,
|
|
61
|
+
prevPosition: prevPosition.current,
|
|
62
|
+
currentPosition: currentPosition.current,
|
|
63
|
+
isActive: activeRef.current,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useRef } from 'react';
|
|
3
3
|
import { useDispatch } from '../context/DispatchContext';
|
|
4
|
+
import Button from '../elements/Button';
|
|
4
5
|
import CheckBox from '../elements/CheckBox';
|
|
5
6
|
import NumberInput from '../elements/NumberInput';
|
|
6
|
-
import { AUTO_PEAK_PICKING
|
|
7
|
+
import { AUTO_PEAK_PICKING } from '../reducer/types/Types';
|
|
7
8
|
const styles = {
|
|
8
9
|
container: {
|
|
9
10
|
height: '100%',
|
|
10
11
|
display: 'flex',
|
|
11
12
|
fontSize: '12px',
|
|
13
|
+
alignItems: 'center',
|
|
12
14
|
},
|
|
13
15
|
input: {
|
|
14
16
|
width: '50px',
|
|
@@ -19,14 +21,6 @@ const styles = {
|
|
|
19
21
|
label: {
|
|
20
22
|
flex: '5',
|
|
21
23
|
},
|
|
22
|
-
actionButton: {
|
|
23
|
-
height: '100%',
|
|
24
|
-
width: '60px',
|
|
25
|
-
borderRadius: '5px',
|
|
26
|
-
border: '0.55px solid #c7c7c7',
|
|
27
|
-
margin: '0px 5px',
|
|
28
|
-
userSelect: 'none',
|
|
29
|
-
},
|
|
30
24
|
};
|
|
31
25
|
function AutoPeakPickingOptionPanel() {
|
|
32
26
|
const dispatch = useDispatch();
|
|
@@ -45,11 +39,6 @@ function AutoPeakPickingOptionPanel() {
|
|
|
45
39
|
},
|
|
46
40
|
});
|
|
47
41
|
}, [dispatch]);
|
|
48
|
-
const handleCancelFilter = useCallback(() => {
|
|
49
|
-
dispatch({
|
|
50
|
-
type: RESET_SELECTED_TOOL,
|
|
51
|
-
});
|
|
52
|
-
}, [dispatch]);
|
|
53
42
|
return (_jsxs("div", { style: styles.container, children: [_jsx(NumberInput, { ref: maxNumberOfPeaksRef, label: "Max Number Of Peaks:", name: "maxNumberOfPeaks", style: {
|
|
54
43
|
input: styles.input,
|
|
55
44
|
inputContainer: styles.inputContainer,
|
|
@@ -62,6 +51,6 @@ function AutoPeakPickingOptionPanel() {
|
|
|
62
51
|
input: styles.input,
|
|
63
52
|
inputContainer: styles.inputContainer,
|
|
64
53
|
label: styles.label,
|
|
65
|
-
}, defaultValue: 0.1, step: "0.01" }), _jsxs("div", { style: { justifyItems: 'baseline', marginRight: '3px' }, children: [_jsx("label", { style: { marginRight: '2px', lineHeight: 2, userSelect: 'none' }, htmlFor: "lookNegative", children: "Detect Negative:" }), _jsx(CheckBox, { name: "lookNegative", ref: lookNegativeRef })] }), _jsx(
|
|
54
|
+
}, defaultValue: 0.1, step: "0.01" }), _jsxs("div", { style: { justifyItems: 'baseline', marginRight: '3px' }, children: [_jsx("label", { style: { marginRight: '2px', lineHeight: 2, userSelect: 'none' }, htmlFor: "lookNegative", children: "Detect Negative:" }), _jsx(CheckBox, { name: "lookNegative", ref: lookNegativeRef })] }), _jsx(Button.Done, { onClick: handleApplyFilter, style: { margin: '0 10px' }, children: "Apply" })] }));
|
|
66
55
|
}
|
|
67
56
|
export default AutoPeakPickingOptionPanel;
|
|
@@ -3,6 +3,7 @@ import { useCallback, useRef, useState, useMemo } from 'react';
|
|
|
3
3
|
import * as Yup from 'yup';
|
|
4
4
|
import { baselineAlgorithms } from '../../data/data1d/filter1d/baselineCorrection';
|
|
5
5
|
import { useDispatch } from '../context/DispatchContext';
|
|
6
|
+
import ActionButtons from '../elements/ActionButtons';
|
|
6
7
|
import Label from '../elements/Label';
|
|
7
8
|
import Select from '../elements/Select';
|
|
8
9
|
import FormikForm from '../elements/formik/FormikForm';
|
|
@@ -19,14 +20,6 @@ const styles = {
|
|
|
19
20
|
lineHeight: 2,
|
|
20
21
|
userSelect: 'none',
|
|
21
22
|
},
|
|
22
|
-
actionButton: {
|
|
23
|
-
height: '100%',
|
|
24
|
-
width: '60px',
|
|
25
|
-
borderRadius: '5px',
|
|
26
|
-
border: '0.55px solid #c7c7c7',
|
|
27
|
-
margin: '0px 5px',
|
|
28
|
-
userSelect: 'none',
|
|
29
|
-
},
|
|
30
23
|
};
|
|
31
24
|
function BaseLineCorrectionPanel() {
|
|
32
25
|
const dispatch = useDispatch();
|
|
@@ -92,6 +85,6 @@ function BaseLineCorrectionPanel() {
|
|
|
92
85
|
return { validation: {}, initialValue: {} };
|
|
93
86
|
}
|
|
94
87
|
}, [algorithm]);
|
|
95
|
-
return (_jsxs("div", { style: styles.container, children: [_jsx("span", { style: styles.label, children: "Algorithm: " }), _jsx(Select, { ref: algorithmRef, data: getAlgorithmsList(), style: { marginLeft: 10, marginRight: 10 }, onChange: changeAlgorithmHandler, defaultValue: "polynomial" }), _jsxs(FormikForm, { ref: formRef, onSubmit: handleApplyFilter, initialValues: formData.initialValue, validationSchema: formData.validation, children: [algorithm && algorithm === 'airpls' && (_jsxs("div", { style: { display: 'flex' }, children: [_jsx(Label, { title: "maxIterations:", children: _jsx(FormikInput, { type: "number", name: "maxIterations" }) }), _jsx(Label, { title: "tolerance:", style: { label: { padding: '0 5px' } }, children: _jsx(FormikInput, { type: "number", name: "tolerance" }) })] })), algorithm && ['autoPolynomial', 'polynomial'].includes(algorithm) && (_jsx(Label, { title: "degree [ 1 - 6 ]:", children: _jsx(FormikInput, { type: "number", name: "degree", min: 1, max: 6, style: { inputWrapper: { height: '100%' } } }) }))] }, JSON.stringify(formData.initialValue)), _jsx(
|
|
88
|
+
return (_jsxs("div", { style: styles.container, children: [_jsx("span", { style: styles.label, children: "Algorithm: " }), _jsx(Select, { ref: algorithmRef, data: getAlgorithmsList(), style: { marginLeft: 10, marginRight: 10 }, onChange: changeAlgorithmHandler, defaultValue: "polynomial" }), _jsxs(FormikForm, { ref: formRef, onSubmit: handleApplyFilter, initialValues: formData.initialValue, validationSchema: formData.validation, children: [algorithm && algorithm === 'airpls' && (_jsxs("div", { style: { display: 'flex' }, children: [_jsx(Label, { title: "maxIterations:", children: _jsx(FormikInput, { type: "number", name: "maxIterations" }) }), _jsx(Label, { title: "tolerance:", style: { label: { padding: '0 5px' } }, children: _jsx(FormikInput, { type: "number", name: "tolerance" }) })] })), algorithm && ['autoPolynomial', 'polynomial'].includes(algorithm) && (_jsx(Label, { title: "degree [ 1 - 6 ]:", children: _jsx(FormikInput, { type: "number", name: "degree", min: 1, max: 6, style: { inputWrapper: { height: '100%' } } }) }))] }, JSON.stringify(formData.initialValue)), _jsx(ActionButtons, { onDone: () => formRef.current.submitForm(), onCancel: handleCancelFilter })] }));
|
|
96
89
|
}
|
|
97
90
|
export default BaseLineCorrectionPanel;
|
|
@@ -3,6 +3,7 @@ import { useMemo, memo, useCallback, useEffect, useRef, useState, } from 'react'
|
|
|
3
3
|
import * as Filters from '../../data/Filters';
|
|
4
4
|
import { useChartData } from '../context/ChartContext';
|
|
5
5
|
import { useDispatch } from '../context/DispatchContext';
|
|
6
|
+
import ActionButtons from '../elements/ActionButtons';
|
|
6
7
|
import Input from '../elements/Input';
|
|
7
8
|
import InputRange from '../elements/InputRange';
|
|
8
9
|
import Label from '../elements/Label';
|
|
@@ -18,14 +19,6 @@ const styles = {
|
|
|
18
19
|
input: {
|
|
19
20
|
width: '100px',
|
|
20
21
|
},
|
|
21
|
-
actionButton: {
|
|
22
|
-
height: '100%',
|
|
23
|
-
width: '60px',
|
|
24
|
-
borderRadius: '5px',
|
|
25
|
-
border: '0.55px solid #c7c7c7',
|
|
26
|
-
margin: '0px 5px',
|
|
27
|
-
userSelect: 'none',
|
|
28
|
-
},
|
|
29
22
|
select: {
|
|
30
23
|
marginLeft: '5px',
|
|
31
24
|
marginRight: '10px',
|
|
@@ -135,7 +128,7 @@ function ManualPhaseCorrectionPanelInner({ data, pivot, filter, }) {
|
|
|
135
128
|
const onChangeHandler = useCallback((val) => {
|
|
136
129
|
setPhaseCorrectionType(val);
|
|
137
130
|
}, []);
|
|
138
|
-
return (_jsxs("div", { style: styles.container, children: [_jsx(Select, { onChange: onChangeHandler, data: algorithms, defaultValue: phaseCorrectionTypes.manual, style: styles.select }), phaseCorrectionType === phaseCorrectionTypes.manual && (_jsxs(_Fragment, { children: [_jsx(Label, { title: "PH0 :", style: { wrapper: { marginRight: '5px' } }, children: _jsx(Input, { name: "ph0", style: { input: styles.input }, onChange: handleInput, value: value.ph0, type: "number", debounceTime: 250 }) }), _jsx(Label, { title: "PH1 :", children: _jsx(Input, { name: "ph1", style: { input: styles.input }, onChange: handleInput, value: value.ph1, type: "number", debounceTime: 250 }) }), _jsx(InputRange, { ref: ph0Ref, name: "ph0", label: "Change Ph0 By mouse click and drag", style: { width: '20%' }, onChange: handleRangeChange }), _jsx(InputRange, { ref: ph1Ref, name: "ph1", label: "Change Ph1 By mouse click and drag", style: { width: '20%' }, onChange: handleRangeChange })] })), _jsx(
|
|
131
|
+
return (_jsxs("div", { style: styles.container, children: [_jsx(Select, { onChange: onChangeHandler, data: algorithms, defaultValue: phaseCorrectionTypes.manual, style: styles.select }), phaseCorrectionType === phaseCorrectionTypes.manual && (_jsxs(_Fragment, { children: [_jsx(Label, { title: "PH0 :", style: { wrapper: { marginRight: '5px' } }, children: _jsx(Input, { name: "ph0", style: { input: styles.input }, onChange: handleInput, value: value.ph0, type: "number", debounceTime: 250 }) }), _jsx(Label, { title: "PH1 :", children: _jsx(Input, { name: "ph1", style: { input: styles.input }, onChange: handleInput, value: value.ph1, type: "number", debounceTime: 250 }) }), _jsx(InputRange, { ref: ph0Ref, name: "ph0", label: "Change Ph0 By mouse click and drag", style: { width: '20%' }, onChange: handleRangeChange }), _jsx(InputRange, { ref: ph1Ref, name: "ph1", label: "Change Ph1 By mouse click and drag", style: { width: '20%' }, onChange: handleRangeChange })] })), _jsx(ActionButtons, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
|
|
139
132
|
}
|
|
140
133
|
const MemoizedManualPhaseCorrectionPanel = memo(ManualPhaseCorrectionPanelInner);
|
|
141
134
|
const emptyData = { datum: {}, filter: null };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useRef } from 'react';
|
|
3
3
|
import { useDispatch } from '../context/DispatchContext';
|
|
4
|
+
import Button from '../elements/Button';
|
|
4
5
|
import CheckBox from '../elements/CheckBox';
|
|
5
6
|
import NumberInput from '../elements/NumberInput';
|
|
6
|
-
import { AUTO_RANGES_DETECTION
|
|
7
|
+
import { AUTO_RANGES_DETECTION } from '../reducer/types/Types';
|
|
7
8
|
const styles = {
|
|
8
9
|
container: {
|
|
9
10
|
padding: '5px',
|
|
@@ -26,15 +27,6 @@ const styles = {
|
|
|
26
27
|
label: {
|
|
27
28
|
flex: 5,
|
|
28
29
|
},
|
|
29
|
-
actionButton: {
|
|
30
|
-
height: '100%',
|
|
31
|
-
minWidth: '60px',
|
|
32
|
-
borderRadius: '5px',
|
|
33
|
-
border: '0.55px solid #c7c7c7',
|
|
34
|
-
margin: '0px 5px',
|
|
35
|
-
userSelect: 'none',
|
|
36
|
-
padding: '3px',
|
|
37
|
-
},
|
|
38
30
|
hint: {
|
|
39
31
|
lineHeight: 2,
|
|
40
32
|
userSelect: 'none',
|
|
@@ -56,15 +48,10 @@ function RangesPickingOptionPanel() {
|
|
|
56
48
|
},
|
|
57
49
|
});
|
|
58
50
|
}, [dispatch]);
|
|
59
|
-
const handleCancelFilter = useCallback(() => {
|
|
60
|
-
dispatch({
|
|
61
|
-
type: RESET_SELECTED_TOOL,
|
|
62
|
-
});
|
|
63
|
-
}, [dispatch]);
|
|
64
51
|
return (_jsxs("div", { style: styles.container, children: [_jsxs("div", { style: { justifyItems: 'baseline', margin: '0 10px' }, children: [_jsx("label", { style: { marginRight: '2px', lineHeight: 2, userSelect: 'none' }, htmlFor: "lookNegative", children: "Detect negative:" }), _jsx(CheckBox, { name: "lookNegative", ref: lookNegativeRef })] }), _jsx(NumberInput, { ref: minMaxRatioRef, label: "Min Max Ratio:", name: "minMaxRatio", style: {
|
|
65
52
|
input: styles.input,
|
|
66
53
|
inputContainer: styles.inputContainer,
|
|
67
54
|
label: styles.label,
|
|
68
|
-
}, defaultValue: 0.05, step: "0.01" }), _jsx(
|
|
55
|
+
}, defaultValue: 0.05, step: "0.01" }), _jsx(Button.Done, { onClick: handleApplyFilter, style: { margin: '0 10px' }, children: "Auto ranges picking" }), _jsx("span", { style: styles.hint, children: "Manual selection using SHIFT + select zone or click on Auto peak picking" })] }));
|
|
69
56
|
}
|
|
70
57
|
export default RangesPickingOptionPanel;
|
|
@@ -3,6 +3,7 @@ import { useCallback, useRef, useState } from 'react';
|
|
|
3
3
|
import generateNumbersPowerOfX from '../../data/utilities/generateNumbersPowerOfX';
|
|
4
4
|
import { useChartData } from '../context/ChartContext';
|
|
5
5
|
import { useDispatch } from '../context/DispatchContext';
|
|
6
|
+
import ActionButtons from '../elements/ActionButtons';
|
|
6
7
|
import Select from '../elements/Select';
|
|
7
8
|
import { APPLY_ZERO_FILLING_FILTER, RESET_SELECTED_TOOL, } from '../reducer/types/Types';
|
|
8
9
|
const styles = {
|
|
@@ -19,14 +20,6 @@ const styles = {
|
|
|
19
20
|
margin: '0px 5px 0px 5px',
|
|
20
21
|
textAlign: 'center',
|
|
21
22
|
},
|
|
22
|
-
actionButton: {
|
|
23
|
-
height: '100%',
|
|
24
|
-
width: '60px',
|
|
25
|
-
borderRadius: '5px',
|
|
26
|
-
border: '0.55px solid #c7c7c7',
|
|
27
|
-
margin: '0px 5px',
|
|
28
|
-
userSelect: 'none',
|
|
29
|
-
},
|
|
30
23
|
label: {
|
|
31
24
|
lineHeight: 2,
|
|
32
25
|
userSelect: 'none',
|
|
@@ -67,6 +60,6 @@ function ZeroFillingOptionsPanel() {
|
|
|
67
60
|
type: RESET_SELECTED_TOOL,
|
|
68
61
|
});
|
|
69
62
|
}, [dispatch]);
|
|
70
|
-
return (_jsxs("div", { style: styles.container, children: [_jsx("span", { style: styles.label, children: "Size: " }), _jsx(Select, { ref: sizeTextInputRef, data: Sizes, style: { marginLeft: 10, marginRight: 10 }, defaultValue: getDefaultValue() }), _jsx("span", { style: styles.label, children: "Line Broadening: " }), _jsx("input", { name: "line-broadening", style: styles.input, type: "number", defaultValue: lineBroadeningValue, onInput: handleInput, pattern: "^\\d*(\\.\\d{0,2})?$", step: "any" }), _jsx(
|
|
63
|
+
return (_jsxs("div", { style: styles.container, children: [_jsx("span", { style: styles.label, children: "Size: " }), _jsx(Select, { ref: sizeTextInputRef, data: Sizes, style: { marginLeft: 10, marginRight: 10 }, defaultValue: getDefaultValue() }), _jsx("span", { style: styles.label, children: "Line Broadening: " }), _jsx("input", { name: "line-broadening", style: styles.input, type: "number", defaultValue: lineBroadeningValue, onInput: handleInput, pattern: "^\\d*(\\.\\d{0,2})?$", step: "any" }), _jsx(ActionButtons, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
|
|
71
64
|
}
|
|
72
65
|
export default ZeroFillingOptionsPanel;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useRef } from 'react';
|
|
3
3
|
import { useDispatch } from '../context/DispatchContext';
|
|
4
|
+
import Button from '../elements/Button';
|
|
4
5
|
import NumberInput from '../elements/NumberInput';
|
|
5
|
-
import {
|
|
6
|
+
import { AUTO_ZONES_DETECTION, CHANGE_ZONES_NOISE_FACTOR, } from '../reducer/types/Types';
|
|
6
7
|
const styles = {
|
|
7
8
|
container: {
|
|
8
9
|
padding: '5px',
|
|
@@ -19,13 +20,6 @@ const styles = {
|
|
|
19
20
|
label: {
|
|
20
21
|
flex: '5',
|
|
21
22
|
},
|
|
22
|
-
actionButton: {
|
|
23
|
-
height: '100%',
|
|
24
|
-
borderRadius: '5px',
|
|
25
|
-
border: '0.55px solid #c7c7c7',
|
|
26
|
-
margin: '0px 5px',
|
|
27
|
-
userSelect: 'none',
|
|
28
|
-
},
|
|
29
23
|
};
|
|
30
24
|
function Zones2DOptionPanel() {
|
|
31
25
|
const dispatch = useDispatch();
|
|
@@ -38,11 +32,6 @@ function Zones2DOptionPanel() {
|
|
|
38
32
|
},
|
|
39
33
|
});
|
|
40
34
|
}, [dispatch]);
|
|
41
|
-
const handleCancelFilter = useCallback(() => {
|
|
42
|
-
dispatch({
|
|
43
|
-
type: RESET_SELECTED_TOOL,
|
|
44
|
-
});
|
|
45
|
-
}, [dispatch]);
|
|
46
35
|
const handleInput = useCallback((e) => {
|
|
47
36
|
if (e.target) {
|
|
48
37
|
dispatch({ type: CHANGE_ZONES_NOISE_FACTOR, payload: e.target.value });
|
|
@@ -52,6 +41,6 @@ function Zones2DOptionPanel() {
|
|
|
52
41
|
input: styles.input,
|
|
53
42
|
inputContainer: styles.inputContainer,
|
|
54
43
|
label: styles.label,
|
|
55
|
-
}, defaultValue: 1, onChange: handleInput }), _jsx(
|
|
44
|
+
}, defaultValue: 1, onChange: handleInput }), _jsx(Button.Done, { onClick: handleApplyFilter, style: { margin: '0 10px' }, children: "Auto Zones Picking" })] }));
|
|
56
45
|
}
|
|
57
46
|
export default Zones2DOptionPanel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default function useExport(): {
|
|
2
2
|
saveToClipboardHandler: () => Promise<void>;
|
|
3
|
-
saveAsJSONHandler: (spaceIndent?:
|
|
3
|
+
saveAsJSONHandler: (spaceIndent?: number, isCompressed?: boolean) => Promise<void>;
|
|
4
4
|
saveAsNMREHandler: () => Promise<void>;
|
|
5
5
|
saveAsSVGHandler: () => Promise<void>;
|
|
6
6
|
saveAsPNGHandler: () => Promise<void>;
|
|
@@ -2,25 +2,27 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import { toJSON } from '../../data/SpectraManager';
|
|
4
4
|
import { useChartData } from '../context/ChartContext';
|
|
5
|
+
import { useGlobal } from '../context/GlobalContext';
|
|
5
6
|
import { useAlert } from '../elements/popup/Alert';
|
|
6
7
|
import { positions, useModal } from '../elements/popup/Modal';
|
|
7
8
|
import SaveAsModal from '../modal/SaveAsModal';
|
|
8
9
|
import { copyPNGToClipboard, exportAsJSON, exportAsNMRE, exportAsPng, exportAsSVG, } from '../utility/Export';
|
|
9
10
|
import { nmriumToNmredata } from '../utility/nmriumToNmredata';
|
|
10
11
|
export default function useExport() {
|
|
12
|
+
const { rootRef } = useGlobal();
|
|
11
13
|
const modal = useModal();
|
|
12
14
|
const alert = useAlert();
|
|
13
15
|
const state = useChartData();
|
|
14
16
|
const saveToClipboardHandler = useCallback(async () => {
|
|
15
|
-
if (state.data.length > 0) {
|
|
17
|
+
if (state.data.length > 0 && rootRef) {
|
|
16
18
|
const hideLoading = await alert.showLoading('Exporting as NMRium process in progress');
|
|
17
19
|
setTimeout(() => {
|
|
18
|
-
copyPNGToClipboard('nmrSVG');
|
|
20
|
+
copyPNGToClipboard(rootRef, 'nmrSVG');
|
|
19
21
|
hideLoading();
|
|
20
22
|
alert.success('Image copied to clipboard');
|
|
21
23
|
}, 0);
|
|
22
24
|
}
|
|
23
|
-
}, [alert, state]);
|
|
25
|
+
}, [rootRef, alert, state]);
|
|
24
26
|
const saveAsJSONHandler = useCallback(async (spaceIndent = 0, isCompressed = true) => {
|
|
25
27
|
if (state.data.length > 0) {
|
|
26
28
|
const hideLoading = await alert.showLoading('Exporting as NMRium process in progress');
|
|
@@ -51,25 +53,25 @@ export default function useExport() {
|
|
|
51
53
|
}
|
|
52
54
|
}, [alert, state]);
|
|
53
55
|
const saveAsSVGHandler = useCallback(async () => {
|
|
54
|
-
if (state.data.length > 0) {
|
|
56
|
+
if (state.data.length > 0 && rootRef) {
|
|
55
57
|
const hideLoading = await alert.showLoading('Exporting as SVG process in progress');
|
|
56
58
|
setTimeout(() => {
|
|
57
59
|
const fileName = state.data[0]?.display?.name;
|
|
58
|
-
exportAsSVG('nmrSVG', fileName);
|
|
60
|
+
exportAsSVG(rootRef, 'nmrSVG', fileName);
|
|
59
61
|
hideLoading();
|
|
60
62
|
}, 0);
|
|
61
63
|
}
|
|
62
|
-
}, [alert, state.data]);
|
|
64
|
+
}, [rootRef, alert, state.data]);
|
|
63
65
|
const saveAsPNGHandler = useCallback(async () => {
|
|
64
|
-
if (state.data.length > 0) {
|
|
66
|
+
if (state.data.length > 0 && rootRef) {
|
|
65
67
|
const hideLoading = await alert.showLoading('Exporting as PNG process in progress');
|
|
66
68
|
setTimeout(() => {
|
|
67
69
|
const fileName = state.data[0]?.display?.name;
|
|
68
|
-
exportAsPng('nmrSVG', fileName);
|
|
70
|
+
exportAsPng(rootRef, 'nmrSVG', fileName);
|
|
69
71
|
hideLoading();
|
|
70
72
|
}, 0);
|
|
71
73
|
}
|
|
72
|
-
}, [alert, state.data]);
|
|
74
|
+
}, [rootRef, alert, state.data]);
|
|
73
75
|
const saveHandler = useCallback((options) => {
|
|
74
76
|
async function handler() {
|
|
75
77
|
const { name, pretty, compressed, dataExportOption } = options;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare type ReturnFunction = (value?: number | string, formatKey?: string, prefix?: string, suffix?: string) => string;
|
|
2
|
+
export declare function useFormatNumberByNucleus(nucleus?: Array<string>): Array<ReturnFunction>;
|
|
3
|
+
export declare function useFormatNumberByNucleus(nucleus?: string): ReturnFunction;
|
|
@@ -2,12 +2,9 @@ import lodashGet from 'lodash/get';
|
|
|
2
2
|
import Numeral from 'numeral';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import { usePreferences } from '../context/PreferencesContext';
|
|
5
|
-
function FormatNumber(value, format, prefix = '', suffix = '') {
|
|
6
|
-
return prefix + Numeral(value).format(format) + suffix;
|
|
7
|
-
}
|
|
8
5
|
export function useFormatNumberByNucleus(nucleus) {
|
|
9
6
|
const preferences = usePreferences();
|
|
10
|
-
const nucleusByKey = lodashGet(preferences.current, `formatting.
|
|
7
|
+
const nucleusByKey = lodashGet(preferences.current, `formatting.nuclei`, {
|
|
11
8
|
ppm: '0.0',
|
|
12
9
|
hz: '0.0',
|
|
13
10
|
});
|
|
@@ -33,9 +30,3 @@ export function useFormatNumberByNucleus(nucleus) {
|
|
|
33
30
|
}
|
|
34
31
|
}, [nucleus, nucleusByKey]);
|
|
35
32
|
}
|
|
36
|
-
export function getNumberOfDecimals(value) {
|
|
37
|
-
value = String(value).trim();
|
|
38
|
-
const lastIndex = value.lastIndexOf('.');
|
|
39
|
-
return lastIndex > 0 ? value.substr(lastIndex).split('').length - 1 : 0;
|
|
40
|
-
}
|
|
41
|
-
export default FormatNumber;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PanelsPreferences, WorkSpacePanelPreferences } from '../workspaces/Workspace';
|
|
2
|
+
declare type Panel = 'peaks' | 'integrals' | 'zones' | 'ranges' | 'database';
|
|
3
|
+
export declare function usePanelPreferences<T extends Panel>(panelKey: T, nucleus: string): WorkSpacePanelPreferences[T];
|
|
4
|
+
export declare function usePanelPreferences<T extends 'database'>(panelKey: T): WorkSpacePanelPreferences['database'];
|
|
5
|
+
export declare type UsePanelPreferencesByNucleiResult<T extends Panel> = T extends 'peaks' ? PanelsPreferences['peaks'] : T extends 'integrals' ? PanelsPreferences['integrals'] : T extends 'zones' ? PanelsPreferences['zones'] : T extends 'ranges' ? PanelsPreferences['ranges'] : void;
|
|
6
|
+
export declare function usePanelPreferencesByNuclei<T extends Panel>(panelKey: T, nuclei: string[]): UsePanelPreferencesByNucleiResult<T>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import lodashMerge from 'lodash/merge';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { usePreferences } from '../context/PreferencesContext';
|
|
4
|
+
import { getIntegralDefaultValues, getPeaksDefaultValues, getZoneDefaultValues, getRangeDefaultValues, databaseDefaultValues, } from '../reducer/preferences/panelsPreferencesDefaultValues';
|
|
5
|
+
import { getValue } from '../utility/LocalStorage';
|
|
6
|
+
const basePath = 'formatting.panels';
|
|
7
|
+
function getDefaultPreferences(panelKey, nucleus) {
|
|
8
|
+
switch (panelKey) {
|
|
9
|
+
case 'peaks':
|
|
10
|
+
return getPeaksDefaultValues(nucleus);
|
|
11
|
+
case 'integrals':
|
|
12
|
+
return getIntegralDefaultValues(nucleus);
|
|
13
|
+
case 'ranges':
|
|
14
|
+
return getRangeDefaultValues(nucleus);
|
|
15
|
+
case 'zones':
|
|
16
|
+
return getZoneDefaultValues(nucleus);
|
|
17
|
+
case 'database':
|
|
18
|
+
return databaseDefaultValues;
|
|
19
|
+
default:
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function joinWithNucleusPreferences(data, nucleus, returnOnlyNucleusPreferences = false) {
|
|
24
|
+
const { nuclei = {}, ...rest } = data;
|
|
25
|
+
if (returnOnlyNucleusPreferences) {
|
|
26
|
+
return nuclei?.[nucleus];
|
|
27
|
+
}
|
|
28
|
+
return { ...nuclei[nucleus], ...rest };
|
|
29
|
+
}
|
|
30
|
+
function getPanelPreferences(preferences, panelKey, nucleus, returnOnlyNucleusPreferences = false) {
|
|
31
|
+
const panelPreferences = lodashMerge({}, getDefaultPreferences(panelKey, nucleus), getValue(preferences, `${basePath}.${panelKey}`, {}));
|
|
32
|
+
if (panelKey !== 'database' && nucleus) {
|
|
33
|
+
return joinWithNucleusPreferences(panelPreferences, nucleus, returnOnlyNucleusPreferences);
|
|
34
|
+
}
|
|
35
|
+
return panelPreferences;
|
|
36
|
+
}
|
|
37
|
+
export function usePanelPreferences(panelKey, nucleus) {
|
|
38
|
+
const { current } = usePreferences();
|
|
39
|
+
return useMemo(() => {
|
|
40
|
+
return getPanelPreferences(current, panelKey, nucleus);
|
|
41
|
+
}, [current, nucleus, panelKey]);
|
|
42
|
+
}
|
|
43
|
+
export function usePanelPreferencesByNuclei(panelKey, nuclei) {
|
|
44
|
+
const { current } = usePreferences();
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
46
|
+
const { nuclei: omitNuclei = null, ...restPreferences } = getPanelPreferences(current, panelKey);
|
|
47
|
+
return useMemo(() => ({
|
|
48
|
+
nuclei: nuclei.reduce((acc, nucleusLabel) => {
|
|
49
|
+
acc[nucleusLabel] = getPanelPreferences(current, panelKey, nucleusLabel, true);
|
|
50
|
+
return acc;
|
|
51
|
+
}, {}),
|
|
52
|
+
...restPreferences,
|
|
53
|
+
}), [current, nuclei, panelKey, restPreferences]);
|
|
54
|
+
}
|
|
@@ -5,7 +5,7 @@ export declare enum XYReducerDomainAxis {
|
|
|
5
5
|
}
|
|
6
6
|
declare type XYReducerDomainAxisType = keyof typeof XYReducerDomainAxis;
|
|
7
7
|
export default function useXYReduce(domainAxis: XYReducerDomainAxisType): (data: {
|
|
8
|
-
x:
|
|
9
|
-
y:
|
|
8
|
+
x: Float64Array;
|
|
9
|
+
y: Float64Array;
|
|
10
10
|
}) => DataXY<DoubleArray>;
|
|
11
11
|
export {};
|
|
@@ -34,6 +34,6 @@ const styles = css `
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
`;
|
|
37
|
-
export default function DefaultSpinnerComponent() {
|
|
38
|
-
return (_jsxs("div", { css: styles, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 841.9 595.3", children: _jsxs("g", { fill: "#61DAFB", children: [_jsx("path", { d: "M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z" }), _jsx("path", { d: "M520.5 78.1z" })] }) }), _jsx("p", { children:
|
|
37
|
+
export default function DefaultSpinnerComponent({ loadingText = 'Loading ...', }) {
|
|
38
|
+
return (_jsxs("div", { css: styles, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 841.9 595.3", children: _jsxs("g", { fill: "#61DAFB", children: [_jsx("path", { d: "M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z" }), _jsx("path", { d: "M520.5 78.1z" })] }) }), _jsx("p", { children: loadingText })] }));
|
|
39
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
export declare function defaultGetSpinner(): JSX.Element;
|
|
3
|
-
export declare const spinnerContext: import("react").Context<() => ReactElement>;
|
|
4
|
-
export declare const SpinnerProvider: import("react").Provider<() => ReactElement>;
|
|
2
|
+
export declare function defaultGetSpinner(loadingText?: string): JSX.Element;
|
|
3
|
+
export declare const spinnerContext: import("react").Context<(loadingText?: string) => ReactElement>;
|
|
4
|
+
export declare const SpinnerProvider: import("react").Provider<(loadingText?: string) => ReactElement>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext } from 'react';
|
|
3
3
|
import DefaultSpinnerComponent from './DefaultSpinnerComponent';
|
|
4
|
-
export function defaultGetSpinner() {
|
|
5
|
-
return _jsx(DefaultSpinnerComponent, {});
|
|
4
|
+
export function defaultGetSpinner(loadingText = 'Loading ...') {
|
|
5
|
+
return _jsx(DefaultSpinnerComponent, { loadingText: loadingText });
|
|
6
6
|
}
|
|
7
7
|
export const spinnerContext = createContext(defaultGetSpinner);
|
|
8
8
|
export const SpinnerProvider = spinnerContext.Provider;
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
4
4
|
import { REFERENCES } from '../../data/constants/References';
|
|
5
5
|
import { useDispatch } from '../context/DispatchContext';
|
|
6
|
+
import Button from '../elements/Button';
|
|
6
7
|
import CloseButton from '../elements/CloseButton';
|
|
7
8
|
import Label from '../elements/Label';
|
|
8
9
|
import Select from '../elements/Select';
|
|
@@ -51,6 +52,6 @@ function AlignSpectraModal({ onClose = () => null, nucleus, }) {
|
|
|
51
52
|
...resValues,
|
|
52
53
|
});
|
|
53
54
|
}, [nucleus]);
|
|
54
|
-
return (_jsxs("div", { css: ModalStyles, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Spectra calibration" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", style: { flex: 1 }, children: _jsxs(FormikForm, { ref: refForm, initialValues: { from: -1, to: 1, nbPeaks: 1, targetX: 0 }, onSubmit: submitHandler, children: [_jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Options :" }), _jsx(Select, { data: List, style: { width: 270, height: 30, marginBottom: '20px' }, onChange: optionChangeHandler })] }), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Range :" }), _jsx(Label, { title: "From : ", children: _jsx(FormikInput, { name: "from", type: "number" }) }), _jsx(Label, { title: "To : ", children: _jsx(FormikInput, { name: "to", type: "number" }) })] }), _jsx("div", { className: " margin-10", children: _jsx(Label, { className: "custom-label", title: "Number of Peaks : ", children: _jsx(FormikInput, { name: "nbPeaks", type: "number" }) }) }), _jsx("div", { className: " margin-10", children: _jsx(Label, { className: "custom-label", title: "Target PPM :", children: _jsx(FormikInput, { name: "targetX", type: "number" }) }) })] }) }), _jsx("div", { className: "footer-container", children: _jsx(
|
|
55
|
+
return (_jsxs("div", { css: ModalStyles, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Spectra calibration" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", style: { flex: 1 }, children: _jsxs(FormikForm, { ref: refForm, initialValues: { from: -1, to: 1, nbPeaks: 1, targetX: 0 }, onSubmit: submitHandler, children: [_jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Options :" }), _jsx(Select, { data: List, style: { width: 270, height: 30, marginBottom: '20px' }, onChange: optionChangeHandler })] }), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Range :" }), _jsx(Label, { title: "From : ", children: _jsx(FormikInput, { name: "from", type: "number" }) }), _jsx(Label, { title: "To : ", children: _jsx(FormikInput, { name: "to", type: "number" }) })] }), _jsx("div", { className: " margin-10", children: _jsx(Label, { className: "custom-label", title: "Number of Peaks : ", children: _jsx(FormikInput, { name: "nbPeaks", type: "number" }) }) }), _jsx("div", { className: " margin-10", children: _jsx(Label, { className: "custom-label", title: "Target PPM :", children: _jsx(FormikInput, { name: "targetX", type: "number" }) }) })] }) }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, children: "Done" }) })] }));
|
|
55
56
|
}
|
|
56
57
|
export default AlignSpectraModal;
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { useCallback, useEffect, useRef } from 'react';
|
|
4
4
|
import { useChartData } from '../context/ChartContext';
|
|
5
|
+
import Button from '../elements/Button';
|
|
5
6
|
import CloseButton from '../elements/CloseButton';
|
|
6
7
|
import Label from '../elements/Label';
|
|
7
8
|
import FormikForm from '../elements/formik/FormikForm';
|
|
@@ -30,6 +31,6 @@ function ExportAsMatrixModal({ onClose = () => null, }) {
|
|
|
30
31
|
Events.off('brushEnd', handler);
|
|
31
32
|
};
|
|
32
33
|
}, []);
|
|
33
|
-
return (_jsxs("div", { css: ModalStyles, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Export spectra as a Matrix" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsxs(FormikForm, { ref: refForm, initialValues: INITIAL_VALUE, onSubmit: submitHandler, children: [_jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Range :" }), _jsx(Label, { title: "From : ", children: _jsx(FormikInput, { name: "from", type: "number" }) }), _jsx(Label, { title: "To : ", children: _jsx(FormikInput, { name: "to", type: "number" }) })] }), _jsx("div", { className: "row margin-10", children: _jsx(Label, { title: "Number of Points :", className: "custom-label", children: _jsx(FormikInput, { name: "nbPoints", type: "number" }) }) })] }) }), _jsx("div", { className: "footer-container", children: _jsx(
|
|
34
|
+
return (_jsxs("div", { css: ModalStyles, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Export spectra as a Matrix" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsxs(FormikForm, { ref: refForm, initialValues: INITIAL_VALUE, onSubmit: submitHandler, children: [_jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Range :" }), _jsx(Label, { title: "From : ", children: _jsx(FormikInput, { name: "from", type: "number" }) }), _jsx(Label, { title: "To : ", children: _jsx(FormikInput, { name: "to", type: "number" }) })] }), _jsx("div", { className: "row margin-10", children: _jsx(Label, { title: "Number of Points :", className: "custom-label", children: _jsx(FormikInput, { name: "nbPoints", type: "number" }) }) })] }) }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, children: "Export Now" }) })] }));
|
|
34
35
|
}
|
|
35
36
|
export default ExportAsMatrixModal;
|
|
@@ -4,6 +4,7 @@ import { css } from '@emotion/react';
|
|
|
4
4
|
import { useCallback, useRef } from 'react';
|
|
5
5
|
import * as yup from 'yup';
|
|
6
6
|
import { useDispatch } from '../context/DispatchContext';
|
|
7
|
+
import Button from '../elements/Button';
|
|
7
8
|
import CloseButton from '../elements/CloseButton';
|
|
8
9
|
import FormikForm from '../elements/formik/FormikForm';
|
|
9
10
|
import FormikTextarea from '../elements/formik/FormikTextarea';
|
|
@@ -51,6 +52,6 @@ function ImportPublicationStringModal({ onClose, }) {
|
|
|
51
52
|
}, [alert, dispatch, onClose]);
|
|
52
53
|
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Import from publication string" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(FormikForm, { ref: formRef, initialValues: {
|
|
53
54
|
publicationText: '1H NMR (CDCl3, 400MHz) δ 10.58 (b, 1H), 7.40 (d, 1H, J = 8.0 Hz), 6.19 (d, 1H, J = 7.6 Hz), 4.88 (s, 1H), 2.17 (s, 3H), 1.02 (s, 9H), 1.01 (s, 9H), 0.89 (s, 9H)',
|
|
54
|
-
}, validationSchema: validationSchema, onSubmit: publicationStringHandler, children: _jsx(FormikTextarea, { name: "publicationText", className: "text-area", placeholder: "Enter publication string" }) }) }), _jsx("div", { className: "footer-container", children: _jsx(
|
|
55
|
+
}, validationSchema: validationSchema, onSubmit: publicationStringHandler, children: _jsx(FormikTextarea, { name: "publicationText", className: "text-area", placeholder: "Enter publication string" }) }) }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: () => formRef.current.submitForm(), children: "Import" }) })] }));
|
|
55
56
|
}
|
|
56
57
|
export default ImportPublicationStringModal;
|