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,71 @@
|
|
|
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 react_1 = require("react");
|
|
7
|
+
const useDraggable_1 = __importDefault(require("../draggble/useDraggable"));
|
|
8
|
+
function useResizer(props) {
|
|
9
|
+
const { initialPosition = { x1: 10, x2: 40 }, onStart, onMove, onEnd, parentElement, } = props;
|
|
10
|
+
const currentPosition = (0, react_1.useRef)(initialPosition);
|
|
11
|
+
const prevPosition = (0, react_1.useRef)(initialPosition);
|
|
12
|
+
const activeRef = (0, react_1.useRef)(false);
|
|
13
|
+
const triggerEvent = (0, react_1.useRef)((position, status) => {
|
|
14
|
+
switch (status) {
|
|
15
|
+
case 'start':
|
|
16
|
+
onStart?.(position);
|
|
17
|
+
activeRef.current = true;
|
|
18
|
+
break;
|
|
19
|
+
case 'move':
|
|
20
|
+
onMove?.(position);
|
|
21
|
+
break;
|
|
22
|
+
case 'end':
|
|
23
|
+
prevPosition.current = position;
|
|
24
|
+
activeRef.current = false;
|
|
25
|
+
onEnd?.(position);
|
|
26
|
+
break;
|
|
27
|
+
default:
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const right = (0, useDraggable_1.default)({
|
|
32
|
+
position: { x: initialPosition.x2, y: 0 },
|
|
33
|
+
parentElement,
|
|
34
|
+
fromEdge: true,
|
|
35
|
+
});
|
|
36
|
+
const left = (0, useDraggable_1.default)({
|
|
37
|
+
position: { x: initialPosition.x1, y: 0 },
|
|
38
|
+
parentElement,
|
|
39
|
+
fromEdge: true,
|
|
40
|
+
});
|
|
41
|
+
(0, react_1.useEffect)(() => {
|
|
42
|
+
currentPosition.current = {
|
|
43
|
+
x1: left.position.value.x,
|
|
44
|
+
x2: right.position.value.x,
|
|
45
|
+
};
|
|
46
|
+
}, [left.position.value.x, right.position.value.x]);
|
|
47
|
+
(0, react_1.useEffect)(() => {
|
|
48
|
+
const { value: { x }, action, } = left.position;
|
|
49
|
+
const position = {
|
|
50
|
+
x1: x,
|
|
51
|
+
x2: currentPosition.current.x2,
|
|
52
|
+
};
|
|
53
|
+
triggerEvent.current(position, action);
|
|
54
|
+
}, [left.position]);
|
|
55
|
+
(0, react_1.useEffect)(() => {
|
|
56
|
+
const { value: { x }, action, } = right.position;
|
|
57
|
+
const position = {
|
|
58
|
+
x1: currentPosition.current.x1,
|
|
59
|
+
x2: x,
|
|
60
|
+
};
|
|
61
|
+
triggerEvent.current(position, action);
|
|
62
|
+
}, [right.position]);
|
|
63
|
+
return {
|
|
64
|
+
left,
|
|
65
|
+
right,
|
|
66
|
+
prevPosition: prevPosition.current,
|
|
67
|
+
currentPosition: currentPosition.current,
|
|
68
|
+
isActive: activeRef.current,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
exports.default = useResizer;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
9
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
9
10
|
const CheckBox_1 = __importDefault(require("../elements/CheckBox"));
|
|
10
11
|
const NumberInput_1 = __importDefault(require("../elements/NumberInput"));
|
|
11
12
|
const Types_1 = require("../reducer/types/Types");
|
|
@@ -14,6 +15,7 @@ const styles = {
|
|
|
14
15
|
height: '100%',
|
|
15
16
|
display: 'flex',
|
|
16
17
|
fontSize: '12px',
|
|
18
|
+
alignItems: 'center',
|
|
17
19
|
},
|
|
18
20
|
input: {
|
|
19
21
|
width: '50px',
|
|
@@ -24,14 +26,6 @@ const styles = {
|
|
|
24
26
|
label: {
|
|
25
27
|
flex: '5',
|
|
26
28
|
},
|
|
27
|
-
actionButton: {
|
|
28
|
-
height: '100%',
|
|
29
|
-
width: '60px',
|
|
30
|
-
borderRadius: '5px',
|
|
31
|
-
border: '0.55px solid #c7c7c7',
|
|
32
|
-
margin: '0px 5px',
|
|
33
|
-
userSelect: 'none',
|
|
34
|
-
},
|
|
35
29
|
};
|
|
36
30
|
function AutoPeakPickingOptionPanel() {
|
|
37
31
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
@@ -50,11 +44,6 @@ function AutoPeakPickingOptionPanel() {
|
|
|
50
44
|
},
|
|
51
45
|
});
|
|
52
46
|
}, [dispatch]);
|
|
53
|
-
const handleCancelFilter = (0, react_1.useCallback)(() => {
|
|
54
|
-
dispatch({
|
|
55
|
-
type: Types_1.RESET_SELECTED_TOOL,
|
|
56
|
-
});
|
|
57
|
-
}, [dispatch]);
|
|
58
47
|
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)(NumberInput_1.default, { ref: maxNumberOfPeaksRef, label: "Max Number Of Peaks:", name: "maxNumberOfPeaks", style: {
|
|
59
48
|
input: styles.input,
|
|
60
49
|
inputContainer: styles.inputContainer,
|
|
@@ -67,6 +56,6 @@ function AutoPeakPickingOptionPanel() {
|
|
|
67
56
|
input: styles.input,
|
|
68
57
|
inputContainer: styles.inputContainer,
|
|
69
58
|
label: styles.label,
|
|
70
|
-
}, defaultValue: 0.1, step: "0.01" }), (0, jsx_runtime_1.jsxs)("div", { style: { justifyItems: 'baseline', marginRight: '3px' }, children: [(0, jsx_runtime_1.jsx)("label", { style: { marginRight: '2px', lineHeight: 2, userSelect: 'none' }, htmlFor: "lookNegative", children: "Detect Negative:" }), (0, jsx_runtime_1.jsx)(CheckBox_1.default, { name: "lookNegative", ref: lookNegativeRef })] }), (0, jsx_runtime_1.jsx)(
|
|
59
|
+
}, defaultValue: 0.1, step: "0.01" }), (0, jsx_runtime_1.jsxs)("div", { style: { justifyItems: 'baseline', marginRight: '3px' }, children: [(0, jsx_runtime_1.jsx)("label", { style: { marginRight: '2px', lineHeight: 2, userSelect: 'none' }, htmlFor: "lookNegative", children: "Detect Negative:" }), (0, jsx_runtime_1.jsx)(CheckBox_1.default, { name: "lookNegative", ref: lookNegativeRef })] }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleApplyFilter, style: { margin: '0 10px' }, children: "Apply" })] }));
|
|
71
60
|
}
|
|
72
61
|
exports.default = AutoPeakPickingOptionPanel;
|
|
@@ -31,6 +31,7 @@ const react_1 = require("react");
|
|
|
31
31
|
const Yup = __importStar(require("yup"));
|
|
32
32
|
const baselineCorrection_1 = require("../../data/data1d/filter1d/baselineCorrection");
|
|
33
33
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
34
|
+
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
34
35
|
const Label_1 = __importDefault(require("../elements/Label"));
|
|
35
36
|
const Select_1 = __importDefault(require("../elements/Select"));
|
|
36
37
|
const FormikForm_1 = __importDefault(require("../elements/formik/FormikForm"));
|
|
@@ -47,14 +48,6 @@ const styles = {
|
|
|
47
48
|
lineHeight: 2,
|
|
48
49
|
userSelect: 'none',
|
|
49
50
|
},
|
|
50
|
-
actionButton: {
|
|
51
|
-
height: '100%',
|
|
52
|
-
width: '60px',
|
|
53
|
-
borderRadius: '5px',
|
|
54
|
-
border: '0.55px solid #c7c7c7',
|
|
55
|
-
margin: '0px 5px',
|
|
56
|
-
userSelect: 'none',
|
|
57
|
-
},
|
|
58
51
|
};
|
|
59
52
|
function BaseLineCorrectionPanel() {
|
|
60
53
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
@@ -120,6 +113,6 @@ function BaseLineCorrectionPanel() {
|
|
|
120
113
|
return { validation: {}, initialValue: {} };
|
|
121
114
|
}
|
|
122
115
|
}, [algorithm]);
|
|
123
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.label, children: "Algorithm: " }), (0, jsx_runtime_1.jsx)(Select_1.default, { ref: algorithmRef, data: getAlgorithmsList(), style: { marginLeft: 10, marginRight: 10 }, onChange: changeAlgorithmHandler, defaultValue: "polynomial" }), (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: formRef, onSubmit: handleApplyFilter, initialValues: formData.initialValue, validationSchema: formData.validation, children: [algorithm && algorithm === 'airpls' && ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "maxIterations:", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "maxIterations" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "tolerance:", style: { label: { padding: '0 5px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "tolerance" }) })] })), algorithm && ['autoPolynomial', 'polynomial'].includes(algorithm) && ((0, jsx_runtime_1.jsx)(Label_1.default, { title: "degree [ 1 - 6 ]:", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "degree", min: 1, max: 6, style: { inputWrapper: { height: '100%' } } }) }))] }, JSON.stringify(formData.initialValue)), (0, jsx_runtime_1.jsx)(
|
|
116
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.label, children: "Algorithm: " }), (0, jsx_runtime_1.jsx)(Select_1.default, { ref: algorithmRef, data: getAlgorithmsList(), style: { marginLeft: 10, marginRight: 10 }, onChange: changeAlgorithmHandler, defaultValue: "polynomial" }), (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: formRef, onSubmit: handleApplyFilter, initialValues: formData.initialValue, validationSchema: formData.validation, children: [algorithm && algorithm === 'airpls' && ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "maxIterations:", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "maxIterations" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "tolerance:", style: { label: { padding: '0 5px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "tolerance" }) })] })), algorithm && ['autoPolynomial', 'polynomial'].includes(algorithm) && ((0, jsx_runtime_1.jsx)(Label_1.default, { title: "degree [ 1 - 6 ]:", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "degree", min: 1, max: 6, style: { inputWrapper: { height: '100%' } } }) }))] }, JSON.stringify(formData.initialValue)), (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { onDone: () => formRef.current.submitForm(), onCancel: handleCancelFilter })] }));
|
|
124
117
|
}
|
|
125
118
|
exports.default = BaseLineCorrectionPanel;
|
|
@@ -31,6 +31,7 @@ const react_1 = require("react");
|
|
|
31
31
|
const Filters = __importStar(require("../../data/Filters"));
|
|
32
32
|
const ChartContext_1 = require("../context/ChartContext");
|
|
33
33
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
34
|
+
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
34
35
|
const Input_1 = __importDefault(require("../elements/Input"));
|
|
35
36
|
const InputRange_1 = __importDefault(require("../elements/InputRange"));
|
|
36
37
|
const Label_1 = __importDefault(require("../elements/Label"));
|
|
@@ -46,14 +47,6 @@ const styles = {
|
|
|
46
47
|
input: {
|
|
47
48
|
width: '100px',
|
|
48
49
|
},
|
|
49
|
-
actionButton: {
|
|
50
|
-
height: '100%',
|
|
51
|
-
width: '60px',
|
|
52
|
-
borderRadius: '5px',
|
|
53
|
-
border: '0.55px solid #c7c7c7',
|
|
54
|
-
margin: '0px 5px',
|
|
55
|
-
userSelect: 'none',
|
|
56
|
-
},
|
|
57
50
|
select: {
|
|
58
51
|
marginLeft: '5px',
|
|
59
52
|
marginRight: '10px',
|
|
@@ -163,7 +156,7 @@ function ManualPhaseCorrectionPanelInner({ data, pivot, filter, }) {
|
|
|
163
156
|
const onChangeHandler = (0, react_1.useCallback)((val) => {
|
|
164
157
|
setPhaseCorrectionType(val);
|
|
165
158
|
}, []);
|
|
166
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)(Select_1.default, { onChange: onChangeHandler, data: algorithms, defaultValue: phaseCorrectionTypes.manual, style: styles.select }), phaseCorrectionType === phaseCorrectionTypes.manual && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "PH0 :", style: { wrapper: { marginRight: '5px' } }, children: (0, jsx_runtime_1.jsx)(Input_1.default, { name: "ph0", style: { input: styles.input }, onChange: handleInput, value: value.ph0, type: "number", debounceTime: 250 }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "PH1 :", children: (0, jsx_runtime_1.jsx)(Input_1.default, { name: "ph1", style: { input: styles.input }, onChange: handleInput, value: value.ph1, type: "number", debounceTime: 250 }) }), (0, jsx_runtime_1.jsx)(InputRange_1.default, { ref: ph0Ref, name: "ph0", label: "Change Ph0 By mouse click and drag", style: { width: '20%' }, onChange: handleRangeChange }), (0, jsx_runtime_1.jsx)(InputRange_1.default, { ref: ph1Ref, name: "ph1", label: "Change Ph1 By mouse click and drag", style: { width: '20%' }, onChange: handleRangeChange })] })), (0, jsx_runtime_1.jsx)(
|
|
159
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)(Select_1.default, { onChange: onChangeHandler, data: algorithms, defaultValue: phaseCorrectionTypes.manual, style: styles.select }), phaseCorrectionType === phaseCorrectionTypes.manual && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "PH0 :", style: { wrapper: { marginRight: '5px' } }, children: (0, jsx_runtime_1.jsx)(Input_1.default, { name: "ph0", style: { input: styles.input }, onChange: handleInput, value: value.ph0, type: "number", debounceTime: 250 }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "PH1 :", children: (0, jsx_runtime_1.jsx)(Input_1.default, { name: "ph1", style: { input: styles.input }, onChange: handleInput, value: value.ph1, type: "number", debounceTime: 250 }) }), (0, jsx_runtime_1.jsx)(InputRange_1.default, { ref: ph0Ref, name: "ph0", label: "Change Ph0 By mouse click and drag", style: { width: '20%' }, onChange: handleRangeChange }), (0, jsx_runtime_1.jsx)(InputRange_1.default, { ref: ph1Ref, name: "ph1", label: "Change Ph1 By mouse click and drag", style: { width: '20%' }, onChange: handleRangeChange })] })), (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
|
|
167
160
|
}
|
|
168
161
|
const MemoizedManualPhaseCorrectionPanel = (0, react_1.memo)(ManualPhaseCorrectionPanelInner);
|
|
169
162
|
const emptyData = { datum: {}, filter: null };
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
9
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
9
10
|
const CheckBox_1 = __importDefault(require("../elements/CheckBox"));
|
|
10
11
|
const NumberInput_1 = __importDefault(require("../elements/NumberInput"));
|
|
11
12
|
const Types_1 = require("../reducer/types/Types");
|
|
@@ -31,15 +32,6 @@ const styles = {
|
|
|
31
32
|
label: {
|
|
32
33
|
flex: 5,
|
|
33
34
|
},
|
|
34
|
-
actionButton: {
|
|
35
|
-
height: '100%',
|
|
36
|
-
minWidth: '60px',
|
|
37
|
-
borderRadius: '5px',
|
|
38
|
-
border: '0.55px solid #c7c7c7',
|
|
39
|
-
margin: '0px 5px',
|
|
40
|
-
userSelect: 'none',
|
|
41
|
-
padding: '3px',
|
|
42
|
-
},
|
|
43
35
|
hint: {
|
|
44
36
|
lineHeight: 2,
|
|
45
37
|
userSelect: 'none',
|
|
@@ -61,15 +53,10 @@ function RangesPickingOptionPanel() {
|
|
|
61
53
|
},
|
|
62
54
|
});
|
|
63
55
|
}, [dispatch]);
|
|
64
|
-
const handleCancelFilter = (0, react_1.useCallback)(() => {
|
|
65
|
-
dispatch({
|
|
66
|
-
type: Types_1.RESET_SELECTED_TOOL,
|
|
67
|
-
});
|
|
68
|
-
}, [dispatch]);
|
|
69
56
|
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsxs)("div", { style: { justifyItems: 'baseline', margin: '0 10px' }, children: [(0, jsx_runtime_1.jsx)("label", { style: { marginRight: '2px', lineHeight: 2, userSelect: 'none' }, htmlFor: "lookNegative", children: "Detect negative:" }), (0, jsx_runtime_1.jsx)(CheckBox_1.default, { name: "lookNegative", ref: lookNegativeRef })] }), (0, jsx_runtime_1.jsx)(NumberInput_1.default, { ref: minMaxRatioRef, label: "Min Max Ratio:", name: "minMaxRatio", style: {
|
|
70
57
|
input: styles.input,
|
|
71
58
|
inputContainer: styles.inputContainer,
|
|
72
59
|
label: styles.label,
|
|
73
|
-
}, defaultValue: 0.05, step: "0.01" }), (0, jsx_runtime_1.jsx)(
|
|
60
|
+
}, defaultValue: 0.05, step: "0.01" }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleApplyFilter, style: { margin: '0 10px' }, children: "Auto ranges picking" }), (0, jsx_runtime_1.jsx)("span", { style: styles.hint, children: "Manual selection using SHIFT + select zone or click on Auto peak picking" })] }));
|
|
74
61
|
}
|
|
75
62
|
exports.default = RangesPickingOptionPanel;
|
|
@@ -8,6 +8,7 @@ const react_1 = require("react");
|
|
|
8
8
|
const generateNumbersPowerOfX_1 = __importDefault(require("../../data/utilities/generateNumbersPowerOfX"));
|
|
9
9
|
const ChartContext_1 = require("../context/ChartContext");
|
|
10
10
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
11
|
+
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
11
12
|
const Select_1 = __importDefault(require("../elements/Select"));
|
|
12
13
|
const Types_1 = require("../reducer/types/Types");
|
|
13
14
|
const styles = {
|
|
@@ -24,14 +25,6 @@ const styles = {
|
|
|
24
25
|
margin: '0px 5px 0px 5px',
|
|
25
26
|
textAlign: 'center',
|
|
26
27
|
},
|
|
27
|
-
actionButton: {
|
|
28
|
-
height: '100%',
|
|
29
|
-
width: '60px',
|
|
30
|
-
borderRadius: '5px',
|
|
31
|
-
border: '0.55px solid #c7c7c7',
|
|
32
|
-
margin: '0px 5px',
|
|
33
|
-
userSelect: 'none',
|
|
34
|
-
},
|
|
35
28
|
label: {
|
|
36
29
|
lineHeight: 2,
|
|
37
30
|
userSelect: 'none',
|
|
@@ -72,6 +65,6 @@ function ZeroFillingOptionsPanel() {
|
|
|
72
65
|
type: Types_1.RESET_SELECTED_TOOL,
|
|
73
66
|
});
|
|
74
67
|
}, [dispatch]);
|
|
75
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.label, children: "Size: " }), (0, jsx_runtime_1.jsx)(Select_1.default, { ref: sizeTextInputRef, data: Sizes, style: { marginLeft: 10, marginRight: 10 }, defaultValue: getDefaultValue() }), (0, jsx_runtime_1.jsx)("span", { style: styles.label, children: "Line Broadening: " }), (0, jsx_runtime_1.jsx)("input", { name: "line-broadening", style: styles.input, type: "number", defaultValue: lineBroadeningValue, onInput: handleInput, pattern: "^\\d*(\\.\\d{0,2})?$", step: "any" }), (0, jsx_runtime_1.jsx)(
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.label, children: "Size: " }), (0, jsx_runtime_1.jsx)(Select_1.default, { ref: sizeTextInputRef, data: Sizes, style: { marginLeft: 10, marginRight: 10 }, defaultValue: getDefaultValue() }), (0, jsx_runtime_1.jsx)("span", { style: styles.label, children: "Line Broadening: " }), (0, jsx_runtime_1.jsx)("input", { name: "line-broadening", style: styles.input, type: "number", defaultValue: lineBroadeningValue, onInput: handleInput, pattern: "^\\d*(\\.\\d{0,2})?$", step: "any" }), (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
|
|
76
69
|
}
|
|
77
70
|
exports.default = ZeroFillingOptionsPanel;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
9
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
9
10
|
const NumberInput_1 = __importDefault(require("../elements/NumberInput"));
|
|
10
11
|
const Types_1 = require("../reducer/types/Types");
|
|
11
12
|
const styles = {
|
|
@@ -24,13 +25,6 @@ const styles = {
|
|
|
24
25
|
label: {
|
|
25
26
|
flex: '5',
|
|
26
27
|
},
|
|
27
|
-
actionButton: {
|
|
28
|
-
height: '100%',
|
|
29
|
-
borderRadius: '5px',
|
|
30
|
-
border: '0.55px solid #c7c7c7',
|
|
31
|
-
margin: '0px 5px',
|
|
32
|
-
userSelect: 'none',
|
|
33
|
-
},
|
|
34
28
|
};
|
|
35
29
|
function Zones2DOptionPanel() {
|
|
36
30
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
@@ -43,11 +37,6 @@ function Zones2DOptionPanel() {
|
|
|
43
37
|
},
|
|
44
38
|
});
|
|
45
39
|
}, [dispatch]);
|
|
46
|
-
const handleCancelFilter = (0, react_1.useCallback)(() => {
|
|
47
|
-
dispatch({
|
|
48
|
-
type: Types_1.RESET_SELECTED_TOOL,
|
|
49
|
-
});
|
|
50
|
-
}, [dispatch]);
|
|
51
40
|
const handleInput = (0, react_1.useCallback)((e) => {
|
|
52
41
|
if (e.target) {
|
|
53
42
|
dispatch({ type: Types_1.CHANGE_ZONES_NOISE_FACTOR, payload: e.target.value });
|
|
@@ -57,6 +46,6 @@ function Zones2DOptionPanel() {
|
|
|
57
46
|
input: styles.input,
|
|
58
47
|
inputContainer: styles.inputContainer,
|
|
59
48
|
label: styles.label,
|
|
60
|
-
}, defaultValue: 1, onChange: handleInput }), (0, jsx_runtime_1.jsx)(
|
|
49
|
+
}, defaultValue: 1, onChange: handleInput }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleApplyFilter, style: { margin: '0 10px' }, children: "Auto Zones Picking" })] }));
|
|
61
50
|
}
|
|
62
51
|
exports.default = Zones2DOptionPanel;
|
|
@@ -7,25 +7,27 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const SpectraManager_1 = require("../../data/SpectraManager");
|
|
9
9
|
const ChartContext_1 = require("../context/ChartContext");
|
|
10
|
+
const GlobalContext_1 = require("../context/GlobalContext");
|
|
10
11
|
const Alert_1 = require("../elements/popup/Alert");
|
|
11
12
|
const Modal_1 = require("../elements/popup/Modal");
|
|
12
13
|
const SaveAsModal_1 = __importDefault(require("../modal/SaveAsModal"));
|
|
13
14
|
const Export_1 = require("../utility/Export");
|
|
14
15
|
const nmriumToNmredata_1 = require("../utility/nmriumToNmredata");
|
|
15
16
|
function useExport() {
|
|
17
|
+
const { rootRef } = (0, GlobalContext_1.useGlobal)();
|
|
16
18
|
const modal = (0, Modal_1.useModal)();
|
|
17
19
|
const alert = (0, Alert_1.useAlert)();
|
|
18
20
|
const state = (0, ChartContext_1.useChartData)();
|
|
19
21
|
const saveToClipboardHandler = (0, react_1.useCallback)(async () => {
|
|
20
|
-
if (state.data.length > 0) {
|
|
22
|
+
if (state.data.length > 0 && rootRef) {
|
|
21
23
|
const hideLoading = await alert.showLoading('Exporting as NMRium process in progress');
|
|
22
24
|
setTimeout(() => {
|
|
23
|
-
(0, Export_1.copyPNGToClipboard)('nmrSVG');
|
|
25
|
+
(0, Export_1.copyPNGToClipboard)(rootRef, 'nmrSVG');
|
|
24
26
|
hideLoading();
|
|
25
27
|
alert.success('Image copied to clipboard');
|
|
26
28
|
}, 0);
|
|
27
29
|
}
|
|
28
|
-
}, [alert, state]);
|
|
30
|
+
}, [rootRef, alert, state]);
|
|
29
31
|
const saveAsJSONHandler = (0, react_1.useCallback)(async (spaceIndent = 0, isCompressed = true) => {
|
|
30
32
|
if (state.data.length > 0) {
|
|
31
33
|
const hideLoading = await alert.showLoading('Exporting as NMRium process in progress');
|
|
@@ -56,25 +58,25 @@ function useExport() {
|
|
|
56
58
|
}
|
|
57
59
|
}, [alert, state]);
|
|
58
60
|
const saveAsSVGHandler = (0, react_1.useCallback)(async () => {
|
|
59
|
-
if (state.data.length > 0) {
|
|
61
|
+
if (state.data.length > 0 && rootRef) {
|
|
60
62
|
const hideLoading = await alert.showLoading('Exporting as SVG process in progress');
|
|
61
63
|
setTimeout(() => {
|
|
62
64
|
const fileName = state.data[0]?.display?.name;
|
|
63
|
-
(0, Export_1.exportAsSVG)('nmrSVG', fileName);
|
|
65
|
+
(0, Export_1.exportAsSVG)(rootRef, 'nmrSVG', fileName);
|
|
64
66
|
hideLoading();
|
|
65
67
|
}, 0);
|
|
66
68
|
}
|
|
67
|
-
}, [alert, state.data]);
|
|
69
|
+
}, [rootRef, alert, state.data]);
|
|
68
70
|
const saveAsPNGHandler = (0, react_1.useCallback)(async () => {
|
|
69
|
-
if (state.data.length > 0) {
|
|
71
|
+
if (state.data.length > 0 && rootRef) {
|
|
70
72
|
const hideLoading = await alert.showLoading('Exporting as PNG process in progress');
|
|
71
73
|
setTimeout(() => {
|
|
72
74
|
const fileName = state.data[0]?.display?.name;
|
|
73
|
-
(0, Export_1.exportAsPng)('nmrSVG', fileName);
|
|
75
|
+
(0, Export_1.exportAsPng)(rootRef, 'nmrSVG', fileName);
|
|
74
76
|
hideLoading();
|
|
75
77
|
}, 0);
|
|
76
78
|
}
|
|
77
|
-
}, [alert, state.data]);
|
|
79
|
+
}, [rootRef, alert, state.data]);
|
|
78
80
|
const saveHandler = (0, react_1.useCallback)((options) => {
|
|
79
81
|
async function handler() {
|
|
80
82
|
const { name, pretty, compressed, dataExportOption } = options;
|
|
@@ -3,17 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.useFormatNumberByNucleus = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const numeral_1 = __importDefault(require("numeral"));
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
11
|
-
function FormatNumber(value, format, prefix = '', suffix = '') {
|
|
12
|
-
return prefix + (0, numeral_1.default)(value).format(format) + suffix;
|
|
13
|
-
}
|
|
14
11
|
function useFormatNumberByNucleus(nucleus) {
|
|
15
12
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
16
|
-
const nucleusByKey = (0, get_1.default)(preferences.current, `formatting.
|
|
13
|
+
const nucleusByKey = (0, get_1.default)(preferences.current, `formatting.nuclei`, {
|
|
17
14
|
ppm: '0.0',
|
|
18
15
|
hz: '0.0',
|
|
19
16
|
});
|
|
@@ -40,10 +37,3 @@ function useFormatNumberByNucleus(nucleus) {
|
|
|
40
37
|
}, [nucleus, nucleusByKey]);
|
|
41
38
|
}
|
|
42
39
|
exports.useFormatNumberByNucleus = useFormatNumberByNucleus;
|
|
43
|
-
function getNumberOfDecimals(value) {
|
|
44
|
-
value = String(value).trim();
|
|
45
|
-
const lastIndex = value.lastIndexOf('.');
|
|
46
|
-
return lastIndex > 0 ? value.substr(lastIndex).split('').length - 1 : 0;
|
|
47
|
-
}
|
|
48
|
-
exports.getNumberOfDecimals = getNumberOfDecimals;
|
|
49
|
-
exports.default = FormatNumber;
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
exports.usePanelPreferencesByNuclei = exports.usePanelPreferences = void 0;
|
|
7
|
+
const merge_1 = __importDefault(require("lodash/merge"));
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
10
|
+
const panelsPreferencesDefaultValues_1 = require("../reducer/preferences/panelsPreferencesDefaultValues");
|
|
11
|
+
const LocalStorage_1 = require("../utility/LocalStorage");
|
|
12
|
+
const basePath = 'formatting.panels';
|
|
13
|
+
function getDefaultPreferences(panelKey, nucleus) {
|
|
14
|
+
switch (panelKey) {
|
|
15
|
+
case 'peaks':
|
|
16
|
+
return (0, panelsPreferencesDefaultValues_1.getPeaksDefaultValues)(nucleus);
|
|
17
|
+
case 'integrals':
|
|
18
|
+
return (0, panelsPreferencesDefaultValues_1.getIntegralDefaultValues)(nucleus);
|
|
19
|
+
case 'ranges':
|
|
20
|
+
return (0, panelsPreferencesDefaultValues_1.getRangeDefaultValues)(nucleus);
|
|
21
|
+
case 'zones':
|
|
22
|
+
return (0, panelsPreferencesDefaultValues_1.getZoneDefaultValues)(nucleus);
|
|
23
|
+
case 'database':
|
|
24
|
+
return panelsPreferencesDefaultValues_1.databaseDefaultValues;
|
|
25
|
+
default:
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function joinWithNucleusPreferences(data, nucleus, returnOnlyNucleusPreferences = false) {
|
|
30
|
+
const { nuclei = {}, ...rest } = data;
|
|
31
|
+
if (returnOnlyNucleusPreferences) {
|
|
32
|
+
return nuclei?.[nucleus];
|
|
33
|
+
}
|
|
34
|
+
return { ...nuclei[nucleus], ...rest };
|
|
35
|
+
}
|
|
36
|
+
function getPanelPreferences(preferences, panelKey, nucleus, returnOnlyNucleusPreferences = false) {
|
|
37
|
+
const panelPreferences = (0, merge_1.default)({}, getDefaultPreferences(panelKey, nucleus), (0, LocalStorage_1.getValue)(preferences, `${basePath}.${panelKey}`, {}));
|
|
38
|
+
if (panelKey !== 'database' && nucleus) {
|
|
39
|
+
return joinWithNucleusPreferences(panelPreferences, nucleus, returnOnlyNucleusPreferences);
|
|
40
|
+
}
|
|
41
|
+
return panelPreferences;
|
|
42
|
+
}
|
|
43
|
+
function usePanelPreferences(panelKey, nucleus) {
|
|
44
|
+
const { current } = (0, PreferencesContext_1.usePreferences)();
|
|
45
|
+
return (0, react_1.useMemo)(() => {
|
|
46
|
+
return getPanelPreferences(current, panelKey, nucleus);
|
|
47
|
+
}, [current, nucleus, panelKey]);
|
|
48
|
+
}
|
|
49
|
+
exports.usePanelPreferences = usePanelPreferences;
|
|
50
|
+
function usePanelPreferencesByNuclei(panelKey, nuclei) {
|
|
51
|
+
const { current } = (0, PreferencesContext_1.usePreferences)();
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
53
|
+
const { nuclei: omitNuclei = null, ...restPreferences } = getPanelPreferences(current, panelKey);
|
|
54
|
+
return (0, react_1.useMemo)(() => ({
|
|
55
|
+
nuclei: nuclei.reduce((acc, nucleusLabel) => {
|
|
56
|
+
acc[nucleusLabel] = getPanelPreferences(current, panelKey, nucleusLabel, true);
|
|
57
|
+
return acc;
|
|
58
|
+
}, {}),
|
|
59
|
+
...restPreferences,
|
|
60
|
+
}), [current, nuclei, panelKey, restPreferences]);
|
|
61
|
+
}
|
|
62
|
+
exports.usePanelPreferencesByNuclei = usePanelPreferencesByNuclei;
|
|
@@ -36,7 +36,7 @@ const styles = (0, react_1.css) `
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
`;
|
|
39
|
-
function DefaultSpinnerComponent() {
|
|
40
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 841.9 595.3", children: (0, jsx_runtime_1.jsxs)("g", { fill: "#61DAFB", children: [(0, jsx_runtime_1.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" }), (0, jsx_runtime_1.jsx)("path", { d: "M520.5 78.1z" })] }) }), (0, jsx_runtime_1.jsx)("p", { children:
|
|
39
|
+
function DefaultSpinnerComponent({ loadingText = 'Loading ...', }) {
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 841.9 595.3", children: (0, jsx_runtime_1.jsxs)("g", { fill: "#61DAFB", children: [(0, jsx_runtime_1.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" }), (0, jsx_runtime_1.jsx)("path", { d: "M520.5 78.1z" })] }) }), (0, jsx_runtime_1.jsx)("p", { children: loadingText })] }));
|
|
41
41
|
}
|
|
42
42
|
exports.default = DefaultSpinnerComponent;
|
|
@@ -200,6 +200,7 @@ function DropZone(props) {
|
|
|
200
200
|
const { getRootProps, getInputProps, isDragActive, open: openImportDialog, } = (0, react_dropzone_1.useDropzone)({
|
|
201
201
|
onDrop,
|
|
202
202
|
noClick: true,
|
|
203
|
+
noKeyboard: true,
|
|
203
204
|
});
|
|
204
205
|
const open = (0, react_2.useCallback)(() => {
|
|
205
206
|
openImportDialog();
|
|
@@ -7,8 +7,8 @@ exports.SpinnerProvider = exports.spinnerContext = exports.defaultGetSpinner = v
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const DefaultSpinnerComponent_1 = __importDefault(require("./DefaultSpinnerComponent"));
|
|
10
|
-
function defaultGetSpinner() {
|
|
11
|
-
return (0, jsx_runtime_1.jsx)(DefaultSpinnerComponent_1.default, {});
|
|
10
|
+
function defaultGetSpinner(loadingText = 'Loading ...') {
|
|
11
|
+
return (0, jsx_runtime_1.jsx)(DefaultSpinnerComponent_1.default, { loadingText: loadingText });
|
|
12
12
|
}
|
|
13
13
|
exports.defaultGetSpinner = defaultGetSpinner;
|
|
14
14
|
exports.spinnerContext = (0, react_1.createContext)(defaultGetSpinner);
|
|
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const References_1 = require("../../data/constants/References");
|
|
10
10
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
11
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
11
12
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
12
13
|
const Label_1 = __importDefault(require("../elements/Label"));
|
|
13
14
|
const Select_1 = __importDefault(require("../elements/Select"));
|
|
@@ -56,6 +57,6 @@ function AlignSpectraModal({ onClose = () => null, nucleus, }) {
|
|
|
56
57
|
...resValues,
|
|
57
58
|
});
|
|
58
59
|
}, [nucleus]);
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Spectra calibration" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", style: { flex: 1 }, children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: { from: -1, to: 1, nbPeaks: 1, targetX: 0 }, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Options :" }), (0, jsx_runtime_1.jsx)(Select_1.default, { data: List, style: { width: 270, height: 30, marginBottom: '20px' }, onChange: optionChangeHandler })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Range :" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "to", type: "number" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: " margin-10", children: (0, jsx_runtime_1.jsx)(Label_1.default, { className: "custom-label", title: "Number of Peaks : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "nbPeaks", type: "number" }) }) }), (0, jsx_runtime_1.jsx)("div", { className: " margin-10", children: (0, jsx_runtime_1.jsx)(Label_1.default, { className: "custom-label", title: "Target PPM :", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "targetX", type: "number" }) }) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(
|
|
60
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Spectra calibration" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", style: { flex: 1 }, children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: { from: -1, to: 1, nbPeaks: 1, targetX: 0 }, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Options :" }), (0, jsx_runtime_1.jsx)(Select_1.default, { data: List, style: { width: 270, height: 30, marginBottom: '20px' }, onChange: optionChangeHandler })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Range :" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "to", type: "number" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: " margin-10", children: (0, jsx_runtime_1.jsx)(Label_1.default, { className: "custom-label", title: "Number of Peaks : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "nbPeaks", type: "number" }) }) }), (0, jsx_runtime_1.jsx)("div", { className: " margin-10", children: (0, jsx_runtime_1.jsx)(Label_1.default, { className: "custom-label", title: "Target PPM :", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "targetX", type: "number" }) }) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleSave, children: "Done" }) })] }));
|
|
60
61
|
}
|
|
61
62
|
exports.default = AlignSpectraModal;
|
|
@@ -7,6 +7,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const ChartContext_1 = require("../context/ChartContext");
|
|
10
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
10
11
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
11
12
|
const Label_1 = __importDefault(require("../elements/Label"));
|
|
12
13
|
const FormikForm_1 = __importDefault(require("../elements/formik/FormikForm"));
|
|
@@ -35,6 +36,6 @@ function ExportAsMatrixModal({ onClose = () => null, }) {
|
|
|
35
36
|
Events_1.default.off('brushEnd', handler);
|
|
36
37
|
};
|
|
37
38
|
}, []);
|
|
38
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Export spectra as a Matrix" }), (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, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Range :" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "to", type: "number" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "row margin-10", children: (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Number of Points :", className: "custom-label", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "nbPoints", type: "number" }) }) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Export spectra as a Matrix" }), (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, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Range :" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "to", type: "number" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "row margin-10", children: (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Number of Points :", className: "custom-label", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "nbPoints", type: "number" }) }) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleSave, children: "Export Now" }) })] }));
|
|
39
40
|
}
|
|
40
41
|
exports.default = ExportAsMatrixModal;
|
|
@@ -32,6 +32,7 @@ const react_1 = require("@emotion/react");
|
|
|
32
32
|
const react_2 = require("react");
|
|
33
33
|
const yup = __importStar(require("yup"));
|
|
34
34
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
35
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
35
36
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
36
37
|
const FormikForm_1 = __importDefault(require("../elements/formik/FormikForm"));
|
|
37
38
|
const FormikTextarea_1 = __importDefault(require("../elements/formik/FormikTextarea"));
|
|
@@ -79,6 +80,6 @@ function ImportPublicationStringModal({ onClose, }) {
|
|
|
79
80
|
}, [alert, dispatch, onClose]);
|
|
80
81
|
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: "Import from publication string" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { ref: formRef, initialValues: {
|
|
81
82
|
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)',
|
|
82
|
-
}, validationSchema: validationSchema, onSubmit: publicationStringHandler, children: (0, jsx_runtime_1.jsx)(FormikTextarea_1.default, { name: "publicationText", className: "text-area", placeholder: "Enter publication string" }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(
|
|
83
|
+
}, validationSchema: validationSchema, onSubmit: publicationStringHandler, children: (0, jsx_runtime_1.jsx)(FormikTextarea_1.default, { name: "publicationText", className: "text-area", placeholder: "Enter publication string" }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: () => formRef.current.submitForm(), children: "Import" }) })] }));
|
|
83
84
|
}
|
|
84
85
|
exports.default = ImportPublicationStringModal;
|
|
@@ -7,6 +7,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const react_2 = require("react");
|
|
10
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
10
11
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
11
12
|
const FileUtility_1 = require("../utility/FileUtility");
|
|
12
13
|
const styles = (0, react_1.css) `
|
|
@@ -38,12 +39,13 @@ const styles = (0, react_1.css) `
|
|
|
38
39
|
.container {
|
|
39
40
|
display: flex;
|
|
40
41
|
margin: 30px 5px;
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
align-items: center;
|
|
43
|
+
height: 36px;
|
|
44
|
+
|
|
45
|
+
input {
|
|
43
46
|
padding: 5px;
|
|
44
47
|
border: 1px solid gray;
|
|
45
48
|
border-radius: 5px;
|
|
46
|
-
height: 36px;
|
|
47
49
|
margin: 2px;
|
|
48
50
|
}
|
|
49
51
|
input {
|
|
@@ -51,8 +53,7 @@ const styles = (0, react_1.css) `
|
|
|
51
53
|
}
|
|
52
54
|
button {
|
|
53
55
|
flex: 2;
|
|
54
|
-
|
|
55
|
-
background-color: gray;
|
|
56
|
+
height: 100%;
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
`;
|
|
@@ -78,6 +79,6 @@ function LoadJCAMPModal({ onLoadClick, onClose, startLoading, }) {
|
|
|
78
79
|
onLoadClick(null);
|
|
79
80
|
}
|
|
80
81
|
}, [onLoadClick, startLoading]);
|
|
81
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Load JCAMP Dialog" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose })] }), (0, jsx_runtime_1.jsxs)("div", { className: "container", children: [(0, jsx_runtime_1.jsx)("input", { ref: pathReft, type: "text", placeholder: "Enter URL to JCAMP-DX file" }), (0, jsx_runtime_1.jsx)(
|
|
82
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Load JCAMP Dialog" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose })] }), (0, jsx_runtime_1.jsxs)("div", { className: "container", children: [(0, jsx_runtime_1.jsx)("input", { ref: pathReft, type: "text", placeholder: "Enter URL to JCAMP-DX file" }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: loadJCAMPHandler, children: "Load" })] })] }));
|
|
82
83
|
}
|
|
83
84
|
exports.default = LoadJCAMPModal;
|