nmrium 0.26.0 → 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 +10 -5
- 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 +10 -5
- package/lib/component/1d/ranges/Range.d.ts +2 -1
- package/lib/component/1d/ranges/Range.js +17 -9
- 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/EventsTrackers/KeysListenerTracker.js +10 -4
- package/lib/component/NMRium.d.ts +5 -1
- package/lib/component/NMRium.js +6 -3
- package/lib/component/SplitPaneWrapper.d.ts +4 -0
- package/lib/component/SplitPaneWrapper.js +8 -0
- package/lib/component/context/GlobalContext.d.ts +3 -0
- 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/Button.js +1 -1
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/ContextMenu.d.ts +8 -3
- 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/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/draggble/SVGDraggable.d.ts +17 -0
- package/lib/component/elements/draggble/SVGDraggable.js +33 -0
- package/lib/component/elements/{resizer → draggble}/useDraggable.d.ts +9 -6
- 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.js +17 -62
- package/lib/component/elements/resizer/Resizer.d.ts +3 -1
- package/lib/component/elements/resizer/SVGResizer.js +24 -53
- package/lib/component/elements/resizer/useResizer.d.ts +11 -0
- package/lib/component/elements/resizer/useResizer.js +65 -0
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +3 -0
- package/lib/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +0 -9
- 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/SpinnerContext.d.ts +3 -3
- package/lib/component/loader/SpinnerContext.js +2 -2
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -4
- package/lib/component/modal/MoleculeStructureEditorModal.js +22 -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 +5 -5
- package/lib/component/modal/setting/GeneralSettings.js +2 -1
- package/lib/component/modal/setting/settingsValidation.d.ts +48 -0
- package/lib/component/modal/setting/settingsValidation.js +33 -27
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +10 -5
- 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 +10 -2
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +12 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +11 -0
- 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 +15 -9
- package/lib/component/panels/RangesPanel/RangesPanel.js +4 -10
- 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 +3 -3
- 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/RangeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- 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/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/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +5 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
- 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 +5 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +2 -2
- 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/reducer/Reducer.d.ts +358 -45
- package/lib/component/reducer/Reducer.js +5 -1
- package/lib/component/reducer/actions/LoadActions.js +2 -2
- 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} +131 -7
- 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 +2 -0
- package/lib/component/reducer/types/Types.js +2 -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.js +6 -0
- 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 +72 -1
- package/lib/component/workspaces/basic.js +9 -1
- 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/data1d/Data1DManager.js +4 -0
- 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/database.d.ts +8 -13
- package/lib/data/data1d/database.js +14 -19
- 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.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.js +4 -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/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 +10 -5
- 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 +10 -5
- package/lib-cjs/component/1d/ranges/Range.js +17 -9
- 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/EventsTrackers/KeysListenerTracker.js +10 -4
- package/lib-cjs/component/NMRium.js +5 -2
- package/lib-cjs/component/SplitPaneWrapper.js +12 -0
- package/lib-cjs/component/context/GlobalContext.js +1 -1
- package/lib-cjs/component/context/PreferencesContext.js +1 -1
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +27 -20
- package/lib-cjs/component/elements/Input.js +18 -5
- package/lib-cjs/component/elements/Select.js +20 -14
- package/lib-cjs/component/elements/ToggleButton.js +2 -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 +17 -62
- package/lib-cjs/component/elements/resizer/SVGResizer.js +24 -53
- package/lib-cjs/component/elements/resizer/useResizer.js +71 -0
- package/lib-cjs/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +1 -11
- package/lib-cjs/component/hooks/usePanelPreferences.js +62 -0
- package/lib-cjs/component/loader/DefaultSpinnerComponent.js +2 -2
- package/lib-cjs/component/loader/SpinnerContext.js +2 -2
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -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 +4 -4
- package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +33 -27
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +10 -5
- 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 +9 -1
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +11 -0
- 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 +15 -9
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +4 -10
- 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 +3 -3
- 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/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/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/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -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 +2 -2
- 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/reducer/Reducer.js +5 -1
- package/lib-cjs/component/reducer/actions/LoadActions.js +2 -2
- 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 +5 -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 +6 -0
- 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 +9 -1
- 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/data1d/Data1DManager.js +4 -0
- 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/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 +4 -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 +42 -40
- package/lib/component/elements/resizer/useDraggable.js +0 -52
- 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 -269
- package/lib/component/utility/FormatNumber.d.ts +0 -6
- package/lib-cjs/component/elements/resizer/useDraggable.js +0 -55
- package/lib-cjs/component/panels/extra/preferences/defaultValues.js +0 -61
- package/lib-cjs/component/reducer/preferencesReducer.js +0 -276
|
@@ -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;
|
|
@@ -3,14 +3,11 @@ 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
13
|
const nucleusByKey = (0, get_1.default)(preferences.current, `formatting.nuclei`, {
|
|
@@ -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;
|
|
@@ -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);
|
|
@@ -3,12 +3,15 @@ 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.useMoleculeEditor = void 0;
|
|
6
7
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
8
|
/** @jsxImportSource @emotion/react */
|
|
8
9
|
const react_1 = require("react");
|
|
9
10
|
const full_1 = require("react-ocl/full");
|
|
10
11
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
11
12
|
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
13
|
+
const Modal_1 = require("../elements/popup/Modal");
|
|
14
|
+
const options_1 = require("../elements/popup/options");
|
|
12
15
|
const Types_1 = require("../reducer/types/Types");
|
|
13
16
|
const ModalStyle_1 = require("./ModalStyle");
|
|
14
17
|
function MoleculeStructureEditorModal(props) {
|
|
@@ -32,7 +35,16 @@ function MoleculeStructureEditorModal(props) {
|
|
|
32
35
|
}, [onClose]);
|
|
33
36
|
const handleSave = (0, react_1.useCallback)(() => {
|
|
34
37
|
if (selectedMolecule) {
|
|
35
|
-
|
|
38
|
+
const { key, isFloat, label } = selectedMolecule;
|
|
39
|
+
dispatch({
|
|
40
|
+
type: Types_1.SET_MOLECULE,
|
|
41
|
+
payload: {
|
|
42
|
+
molfile,
|
|
43
|
+
key,
|
|
44
|
+
isFloat,
|
|
45
|
+
label,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
36
48
|
onClose('replace');
|
|
37
49
|
}
|
|
38
50
|
else {
|
|
@@ -42,4 +54,15 @@ function MoleculeStructureEditorModal(props) {
|
|
|
42
54
|
}, [dispatch, selectedMolecule, molfile, onClose]);
|
|
43
55
|
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsx)(full_1.StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleClose }) })] }));
|
|
44
56
|
}
|
|
57
|
+
function useMoleculeEditor() {
|
|
58
|
+
const modal = (0, Modal_1.useModal)();
|
|
59
|
+
return (0, react_1.useCallback)((molecule) => {
|
|
60
|
+
modal.show((0, jsx_runtime_1.jsx)(MoleculeStructureEditorModal, { selectedMolecule: molecule }), {
|
|
61
|
+
position: options_1.positions.TOP_CENTER,
|
|
62
|
+
width: 700,
|
|
63
|
+
height: 500,
|
|
64
|
+
});
|
|
65
|
+
}, [modal]);
|
|
66
|
+
}
|
|
67
|
+
exports.useMoleculeEditor = useMoleculeEditor;
|
|
45
68
|
exports.default = MoleculeStructureEditorModal;
|
|
@@ -16,9 +16,10 @@ const CloseButton_1 = __importDefault(require("../../elements/CloseButton"));
|
|
|
16
16
|
const SaveButton_1 = __importDefault(require("../../elements/SaveButton"));
|
|
17
17
|
const FormikForm_1 = __importDefault(require("../../elements/formik/FormikForm"));
|
|
18
18
|
const FormikOnChange_1 = __importDefault(require("../../elements/formik/FormikOnChange"));
|
|
19
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
19
20
|
const MultiplicityUtilities_1 = require("../../panels/extra/utilities/MultiplicityUtilities");
|
|
20
21
|
const Types_1 = require("../../reducer/types/Types");
|
|
21
|
-
const
|
|
22
|
+
const formatNumber_1 = require("../../utility/formatNumber");
|
|
22
23
|
const SignalsForm_1 = __importDefault(require("./forms/components/SignalsForm"));
|
|
23
24
|
const EditRangeValidation_1 = __importDefault(require("./forms/validation/EditRangeValidation"));
|
|
24
25
|
const styles = (0, react_1.css) `
|
|
@@ -76,7 +77,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
76
77
|
const formRef = (0, react_2.useRef)(null);
|
|
77
78
|
const { activeTab } = (0, ChartContext_1.useChartData)();
|
|
78
79
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
79
|
-
const
|
|
80
|
+
const rangesPreferences = (0, usePanelPreferences_1.usePanelPreferences)('ranges', activeTab);
|
|
80
81
|
const validation = (0, EditRangeValidation_1.default)();
|
|
81
82
|
const handleOnZoom = (0, react_2.useCallback)(() => {
|
|
82
83
|
onZoomEditRangeModal(range);
|
|
@@ -129,7 +130,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
129
130
|
};
|
|
130
131
|
if ((0, MultiplicityUtilities_1.hasCouplingConstant)(_multiplicity)) {
|
|
131
132
|
coupling = { ...signal.js[counterJ] };
|
|
132
|
-
coupling.coupling = Number(
|
|
133
|
+
coupling.coupling = Number((0, formatNumber_1.formatNumber)(coupling.coupling, rangesPreferences.coupling.format));
|
|
133
134
|
counterJ++;
|
|
134
135
|
}
|
|
135
136
|
coupling.multiplicity = (0, MultiplicityUtilities_1.translateMultiplet)(coupling.multiplicity);
|
|
@@ -138,7 +139,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
138
139
|
return { ...signal, js: couplings };
|
|
139
140
|
});
|
|
140
141
|
return { activeTab: '0', signals };
|
|
141
|
-
}, [
|
|
142
|
+
}, [range.signals, rangesPreferences.coupling.format]);
|
|
142
143
|
const changeHandler = (0, react_2.useCallback)((values) => {
|
|
143
144
|
const signals = getSignals(values.signals);
|
|
144
145
|
dispatch({
|
|
@@ -146,6 +147,6 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
146
147
|
payload: { tempRange: Object.assign({}, range, { signals }) },
|
|
147
148
|
});
|
|
148
149
|
}, [dispatch, getSignals, range]);
|
|
149
|
-
return ((0, jsx_runtime_1.jsx)("div", { css: styles, children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: formRef, initialValues: data, validationSchema: validation, onSubmit: handleOnSave, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)(Button_1.default, { onClick: handleOnZoom, className: "zoom-button", children: (0, jsx_runtime_1.jsx)(fa_1.FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), (0, jsx_runtime_1.jsx)("span", { children: ` Range and Signal edition: ${
|
|
150
|
+
return ((0, jsx_runtime_1.jsx)("div", { css: styles, children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: formRef, initialValues: data, validationSchema: validation, onSubmit: handleOnSave, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)(Button_1.default, { onClick: handleOnZoom, className: "zoom-button", children: (0, jsx_runtime_1.jsx)(fa_1.FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), (0, jsx_runtime_1.jsx)("span", { children: ` Range and Signal edition: ${(0, formatNumber_1.formatNumber)(range.from, rangesPreferences.from.format)} ppm to ${(0, formatNumber_1.formatNumber)(range.to, rangesPreferences.to.format)} ppm` }), (0, jsx_runtime_1.jsx)(SaveButton_1.default, { onClick: () => formRef.current.submitForm(), popupTitle: "Save and exit" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: handleOnClose })] }), (0, jsx_runtime_1.jsx)(SignalsForm_1.default, { range: range, preferences: rangesPreferences }), (0, jsx_runtime_1.jsx)(FormikOnChange_1.default, { onChange: changeHandler })] }) }));
|
|
150
151
|
}
|
|
151
152
|
exports.default = EditRangeModal;
|
|
@@ -33,12 +33,11 @@ const formik_1 = require("formik");
|
|
|
33
33
|
const react_2 = require("react");
|
|
34
34
|
const fa_1 = require("react-icons/fa");
|
|
35
35
|
const Yup = __importStar(require("yup"));
|
|
36
|
-
const ChartContext_1 = require("../../../../context/ChartContext");
|
|
37
36
|
const Button_1 = __importDefault(require("../../../../elements/Button"));
|
|
38
37
|
const FormikForm_1 = __importDefault(require("../../../../elements/formik/FormikForm"));
|
|
39
38
|
const FormikInput_1 = __importDefault(require("../../../../elements/formik/FormikInput"));
|
|
40
39
|
const MultiplicityUtilities_1 = require("../../../../panels/extra/utilities/MultiplicityUtilities");
|
|
41
|
-
const
|
|
40
|
+
const formatNumber_1 = require("../../../../utility/formatNumber");
|
|
42
41
|
const styles = {
|
|
43
42
|
container: (0, react_1.css) `
|
|
44
43
|
text-align: center;
|
|
@@ -80,10 +79,8 @@ const styles = {
|
|
|
80
79
|
`,
|
|
81
80
|
};
|
|
82
81
|
// TODO: this seems to be a hacky use of ref.
|
|
83
|
-
function AddSignalFormTab({ onFocus, onBlur, range }, ref) {
|
|
82
|
+
function AddSignalFormTab({ onFocus, onBlur, range, preferences }, ref) {
|
|
84
83
|
const { values, setFieldValue } = (0, formik_1.useFormikContext)();
|
|
85
|
-
const { activeTab } = (0, ChartContext_1.useChartData)();
|
|
86
|
-
const format = (0, FormatNumber_1.useFormatNumberByNucleus)(activeTab);
|
|
87
84
|
const saveHandler = (0, react_2.useCallback)((val) => {
|
|
88
85
|
const newSignal = {
|
|
89
86
|
multiplicity: 'm',
|
|
@@ -119,6 +116,6 @@ function AddSignalFormTab({ onFocus, onBlur, range }, ref) {
|
|
|
119
116
|
width: '250px',
|
|
120
117
|
height: '30px',
|
|
121
118
|
},
|
|
122
|
-
}, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsxs)("p", { css: styles.inputInfo, children: ["[
|
|
119
|
+
}, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsxs)("p", { css: styles.inputInfo, children: ["[", `${(0, formatNumber_1.formatNumber)(range.from, preferences.from.format)} ppm - ${(0, formatNumber_1.formatNumber)(range.to, preferences.to.format)} ppm`, "]"] }), (0, jsx_runtime_1.jsx)(Button_1.default, { css: styles.addSignalBtn, onClick: triggerSubmitHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, { title: "Add new signal" }) })] })] }) }));
|
|
123
120
|
}
|
|
124
121
|
exports.default = (0, react_2.forwardRef)(AddSignalFormTab);
|
|
@@ -8,12 +8,11 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const formik_1 = require("formik");
|
|
10
10
|
const react_2 = require("react");
|
|
11
|
-
const ChartContext_1 = require("../../../../context/ChartContext");
|
|
12
11
|
const Tab_1 = __importDefault(require("../../../../elements/Tab/Tab"));
|
|
13
12
|
const Tabs_1 = __importDefault(require("../../../../elements/Tab/Tabs"));
|
|
14
13
|
const useSpectrum_1 = __importDefault(require("../../../../hooks/useSpectrum"));
|
|
15
14
|
const Events_1 = __importDefault(require("../../../../utility/Events"));
|
|
16
|
-
const
|
|
15
|
+
const formatNumber_1 = require("../../../../utility/formatNumber");
|
|
17
16
|
const AddSignalFormTab_1 = __importDefault(require("./AddSignalFormTab"));
|
|
18
17
|
const DeltaInput_1 = __importDefault(require("./DeltaInput"));
|
|
19
18
|
const SignalFormTab_1 = __importDefault(require("./SignalFormTab"));
|
|
@@ -43,13 +42,11 @@ const tabStyles = (0, react_1.css) `
|
|
|
43
42
|
list-style: none;
|
|
44
43
|
padding: 0.5rem 1.5rem;
|
|
45
44
|
`;
|
|
46
|
-
function SignalsForm({ range }) {
|
|
45
|
+
function SignalsForm({ range, preferences }) {
|
|
47
46
|
const newSignalFormRef = (0, react_2.useRef)();
|
|
48
47
|
const [activeField, setActiveField] = (0, react_2.useState)(null);
|
|
49
48
|
const { values, setFieldValue, errors, } = (0, formik_1.useFormikContext)();
|
|
50
|
-
const { activeTab } = (0, ChartContext_1.useChartData)();
|
|
51
49
|
const { info } = (0, useSpectrum_1.default)({ info: {} });
|
|
52
|
-
const format = (0, FormatNumber_1.useFormatNumberByNucleus)(activeTab);
|
|
53
50
|
(0, react_2.useEffect)(() => {
|
|
54
51
|
function handle(event) {
|
|
55
52
|
if (info?.originFrequency && activeField) {
|
|
@@ -62,7 +59,7 @@ function SignalsForm({ range }) {
|
|
|
62
59
|
setFieldValue(activeField, (event.range[1] - event.range[0]) / 2 + event.range[0]);
|
|
63
60
|
}
|
|
64
61
|
else {
|
|
65
|
-
const value = Number(
|
|
62
|
+
const value = Number((0, formatNumber_1.formatNumber)(Math.abs(event.range[0] - event.range[1]) * info.originFrequency, preferences.deltaHz.format));
|
|
66
63
|
setFieldValue(activeField, value);
|
|
67
64
|
}
|
|
68
65
|
}
|
|
@@ -72,7 +69,13 @@ function SignalsForm({ range }) {
|
|
|
72
69
|
return () => {
|
|
73
70
|
Events_1.default.off('brushEnd', handle);
|
|
74
71
|
};
|
|
75
|
-
}, [
|
|
72
|
+
}, [
|
|
73
|
+
activeField,
|
|
74
|
+
setFieldValue,
|
|
75
|
+
values.activeTab,
|
|
76
|
+
info,
|
|
77
|
+
preferences?.deltaHz?.format,
|
|
78
|
+
]);
|
|
76
79
|
(0, react_2.useEffect)(() => {
|
|
77
80
|
function handle(event) {
|
|
78
81
|
if (activeField) {
|
|
@@ -114,9 +117,9 @@ function SignalsForm({ range }) {
|
|
|
114
117
|
// eslint-disable-next-line react/no-array-index-key
|
|
115
118
|
, { tabid: `${i}`, tabstyles: tabContainsErrors(i) ? tabStylesAddition : tabStyles, canDelete: true, render: () => ((0, jsx_runtime_1.jsx)(DeltaInput_1.default, { signal: signal, index: i, onFocus: handleOnFocus })), children: (0, jsx_runtime_1.jsx)(SignalFormTab_1.default, { onFocus: handleOnFocus }) }, `signalForm${i}`)))
|
|
116
119
|
: [];
|
|
117
|
-
const addSignalTab = ((0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "+", tabid: "addSignalTab", canDelete: false, className: "add-signal-tab", children: (0, jsx_runtime_1.jsx)(AddSignalFormTab_1.default, { onFocus: handleOnFocus, range: range, ref: newSignalFormRef }) }, "addSignalTab"));
|
|
120
|
+
const addSignalTab = ((0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "+", tabid: "addSignalTab", canDelete: false, className: "add-signal-tab", children: (0, jsx_runtime_1.jsx)(AddSignalFormTab_1.default, { onFocus: handleOnFocus, range: range, ref: newSignalFormRef, preferences: preferences }) }, "addSignalTab"));
|
|
118
121
|
return signalTabs.concat(addSignalTab);
|
|
119
|
-
}, [handleOnFocus, range, tabContainsErrors, values.signals]);
|
|
122
|
+
}, [handleOnFocus, preferences, range, tabContainsErrors, values.signals]);
|
|
120
123
|
const editSignalInfoText = ((0, jsx_runtime_1.jsx)("p", { className: "infoText", children: "Focus on an input field and press Shift + Drag & Drop to draw a coupling constant in spectrum view." }));
|
|
121
124
|
const addSignalInfoText = ((0, jsx_runtime_1.jsx)("p", { className: "infoText", children: "Focus on the input field and press Shift + Left mouse click to select new signal delta value in spectrum view." }));
|
|
122
125
|
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { css: textStyles, children: errors.signals &&
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
|
+
/** @jsxImportSource @emotion/react */
|
|
8
|
+
const react_1 = require("@emotion/react");
|
|
9
|
+
const formik_1 = require("formik");
|
|
10
|
+
const get_1 = __importDefault(require("lodash/get"));
|
|
11
|
+
const react_2 = require("react");
|
|
12
|
+
const fa_1 = require("react-icons/fa");
|
|
13
|
+
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
14
|
+
const FormikCheckBox_1 = __importDefault(require("../../elements/formik/FormikCheckBox"));
|
|
15
|
+
const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
|
|
16
|
+
const workspaces_1 = __importDefault(require("../../workspaces"));
|
|
17
|
+
const style = {
|
|
18
|
+
addButton: (0, react_1.css) `
|
|
19
|
+
background-color: transparent;
|
|
20
|
+
border: 0;
|
|
21
|
+
outline: none;
|
|
22
|
+
margin-left: 5px;
|
|
23
|
+
svg {
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
fill: green;
|
|
26
|
+
}
|
|
27
|
+
`,
|
|
28
|
+
table: {
|
|
29
|
+
width: '100%',
|
|
30
|
+
},
|
|
31
|
+
th: {
|
|
32
|
+
fontSize: '12px',
|
|
33
|
+
},
|
|
34
|
+
input: {
|
|
35
|
+
input: { width: '100%' },
|
|
36
|
+
},
|
|
37
|
+
labelCol: {
|
|
38
|
+
width: '30%',
|
|
39
|
+
},
|
|
40
|
+
serialCol: {
|
|
41
|
+
width: '5%',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
function DatabasesTabContent({ currentWorkspace }) {
|
|
45
|
+
const { values, setFieldValue } = (0, formik_1.useFormikContext)();
|
|
46
|
+
const databases = (0, react_2.useMemo)(() => (0, get_1.default)(values, 'databases', []), [values]);
|
|
47
|
+
const deleteHandler = (0, react_2.useCallback)((index) => {
|
|
48
|
+
const _database = databases.slice();
|
|
49
|
+
_database.splice(index, 1);
|
|
50
|
+
setFieldValue('databases', _database);
|
|
51
|
+
}, [databases, setFieldValue]);
|
|
52
|
+
const addNewDatabaseHandler = (0, react_2.useCallback)(() => {
|
|
53
|
+
const newDatabase = {
|
|
54
|
+
label: '',
|
|
55
|
+
url: '',
|
|
56
|
+
enabled: true,
|
|
57
|
+
};
|
|
58
|
+
setFieldValue('databases', [...databases, newDatabase]);
|
|
59
|
+
}, [databases, setFieldValue]);
|
|
60
|
+
const resetDatabaseHandler = (0, react_2.useCallback)(() => {
|
|
61
|
+
const database = workspaces_1.default?.[currentWorkspace]?.databases || workspaces_1.default.default.databases;
|
|
62
|
+
setFieldValue('databases', database);
|
|
63
|
+
}, [currentWorkspace, setFieldValue]);
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "section-header", style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)("p", { style: { flex: 1 }, children: "Databases" }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Danger, { fill: "clear", size: "xSmall", onClick: resetDatabaseHandler, style: { margin: '0 5px' }, children: "Reset Databases" }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "outline", size: "xSmall", onClick: addNewDatabaseHandler, children: "Add Database" })] })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("table", { style: style.table, children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { style: style.th, children: "#" }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "Label " }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "URL" }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "Enabled" }), (0, jsx_runtime_1.jsx)("th", {})] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: databases?.map((item, index) => {
|
|
65
|
+
const num = index + 1;
|
|
66
|
+
return (
|
|
67
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
68
|
+
(0, jsx_runtime_1.jsxs)("tr", { style: { height: '33px' }, children: [(0, jsx_runtime_1.jsxs)("td", { style: style.serialCol, children: [(0, jsx_runtime_1.jsx)("span", { children: num }), ' '] }), (0, jsx_runtime_1.jsx)("td", { style: style.labelCol, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { style: style.input, name: `databases.${index}.label`, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { style: style.input, name: `databases.${index}.url`, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { style: {
|
|
69
|
+
container: {
|
|
70
|
+
display: 'block',
|
|
71
|
+
margin: '0 auto',
|
|
72
|
+
width: 'fit-content',
|
|
73
|
+
},
|
|
74
|
+
}, className: "checkbox-element", name: `databases.${index}.enabled` }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
75
|
+
display: 'flex',
|
|
76
|
+
height: '100%',
|
|
77
|
+
}, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: () => deleteHandler(index), children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }), databases.length === index + 1 && ((0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", style: { fontSize: '14px' }, onClick: addNewDatabaseHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }))] }) })] }, `${index}`));
|
|
78
|
+
}) })] }) })] }));
|
|
79
|
+
}
|
|
80
|
+
exports.default = DatabasesTabContent;
|
|
@@ -14,7 +14,7 @@ const LIST = [
|
|
|
14
14
|
name: 'panels.spectraPanel',
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
label: 'Spectra information
|
|
17
|
+
label: 'Spectra information panel',
|
|
18
18
|
name: 'panels.informationPanel',
|
|
19
19
|
},
|
|
20
20
|
{
|
|
@@ -34,7 +34,7 @@ const LIST = [
|
|
|
34
34
|
name: 'panels.structuresPanel',
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
label: 'Filters
|
|
37
|
+
label: 'Filters panel',
|
|
38
38
|
name: 'panels.filtersPanel',
|
|
39
39
|
},
|
|
40
40
|
{
|
|
@@ -42,23 +42,27 @@ const LIST = [
|
|
|
42
42
|
name: 'panels.zonesPanel',
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
label: 'Assignment summary
|
|
45
|
+
label: 'Assignment summary panel',
|
|
46
46
|
name: 'panels.summaryPanel',
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
label: 'Multiple
|
|
49
|
+
label: 'Multiple spectra analysis panel',
|
|
50
50
|
name: 'panels.multipleSpectraAnalysisPanel',
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
-
label: '
|
|
53
|
+
label: 'Databases panel',
|
|
54
54
|
name: 'panels.databasePanel',
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
|
-
label: 'Prediction
|
|
57
|
+
label: 'Prediction panel',
|
|
58
58
|
name: 'panels.predictionPanel',
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
label: '
|
|
61
|
+
label: 'Automatic assignment panel',
|
|
62
|
+
name: 'panels.automaticAssignmentPanel',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: 'Experimental features',
|
|
62
66
|
name: 'general.experimentalFeatures',
|
|
63
67
|
hideOpenOption: true,
|
|
64
68
|
},
|
|
@@ -11,7 +11,7 @@ const get_1 = __importDefault(require("lodash/get"));
|
|
|
11
11
|
const react_2 = require("react");
|
|
12
12
|
const fa_1 = require("react-icons/fa");
|
|
13
13
|
const generateID_1 = __importDefault(require("../../../data/utilities/generateID"));
|
|
14
|
-
const
|
|
14
|
+
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
15
15
|
const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
|
|
16
16
|
const styles = (0, react_1.css) `
|
|
17
17
|
.counter-col {
|
|
@@ -23,7 +23,7 @@ const styles = (0, react_1.css) `
|
|
|
23
23
|
width: 80px;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.
|
|
26
|
+
.input {
|
|
27
27
|
width: 100% !important;
|
|
28
28
|
margin: 0px !important;
|
|
29
29
|
}
|
|
@@ -73,9 +73,9 @@ function FormattingTabContent() {
|
|
|
73
73
|
setFieldValue('formatting.nuclei', newNuclei);
|
|
74
74
|
}, [nuclei, setFieldValue]);
|
|
75
75
|
const nucleiList = Object.keys(nuclei);
|
|
76
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { className: "section-header", children: "
|
|
76
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { className: "section-header", children: "Number formatting for crosshair and info line" }), (0, jsx_runtime_1.jsx)("div", { css: styles, children: (0, jsx_runtime_1.jsxs)("table", { children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { className: "counter-col", children: "#" }), (0, jsx_runtime_1.jsx)("th", { className: "nucleus-label-col", children: "Nucleus " }), (0, jsx_runtime_1.jsx)("th", { className: "nucleus-format-input-col", children: "\u03B4 (ppm)" }), (0, jsx_runtime_1.jsx)("th", { className: "nucleus-format-input-col", children: "Coupling (Hz)" }), (0, jsx_runtime_1.jsx)("th", { className: "nucleus-format-input-col" })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: nucleiList?.map((key, index) => {
|
|
77
77
|
const num = index + 1;
|
|
78
|
-
return ((0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsxs)("td", { className: "counter-col", children: [(0, jsx_runtime_1.jsxs)("span", { children: [num, " - "] }), ' '] }), (0, jsx_runtime_1.jsx)("td", { className: "nucleus-label-col", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `formatting.nuclei.${key}.name`, className: "
|
|
78
|
+
return ((0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsxs)("td", { className: "counter-col", children: [(0, jsx_runtime_1.jsxs)("span", { children: [num, " - "] }), ' '] }), (0, jsx_runtime_1.jsx)("td", { className: "nucleus-label-col", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `formatting.nuclei.${key}.name`, className: "input", checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { className: "nucleus-format-input-col", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `formatting.nuclei.${key}.ppm`, className: "input" }) }), (0, jsx_runtime_1.jsx)("td", { className: "nucleus-format-input-col", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `formatting.nuclei.${key}.hz`, className: "input" }) }), (0, jsx_runtime_1.jsxs)("td", { className: "operation-container", children: [(0, jsx_runtime_1.jsx)(Button_1.default.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: () => deleteHandler(key), children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }), nucleiList.length === index + 1 && ((0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", style: { fontSize: '14px' }, onClick: addNewNucleusFormatHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }))] })] }, `${key}`));
|
|
79
79
|
}) })] }) })] }));
|
|
80
80
|
}
|
|
81
81
|
exports.default = FormattingTabContent;
|
|
@@ -40,6 +40,7 @@ const FormikForm_1 = __importDefault(require("../../elements/formik/FormikForm")
|
|
|
40
40
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
41
41
|
const ModalStyle_1 = require("../ModalStyle");
|
|
42
42
|
const ControllersTabContent_1 = __importDefault(require("./ControllersTabContent"));
|
|
43
|
+
const DatabasesTabContent_1 = __importDefault(require("./DatabasesTabContent"));
|
|
43
44
|
const DisplayTabContent_1 = __importDefault(require("./DisplayTabContent"));
|
|
44
45
|
const FormattingTabContent_1 = __importDefault(require("./FormattingTabContent"));
|
|
45
46
|
const WorkspaceItem_1 = __importDefault(require("./WorkspaceItem"));
|
|
@@ -175,6 +176,6 @@ function GeneralSettings({ onClose }) {
|
|
|
175
176
|
const renderItem = (0, react_2.useCallback)((item) => {
|
|
176
177
|
return ((0, jsx_runtime_1.jsx)(WorkspaceItem_1.default, { item: item, onSave: addWorkSpaceHandler, onDelete: deleteWorkSpaceHandler }));
|
|
177
178
|
}, [addWorkSpaceHandler, deleteWorkSpaceHandler]);
|
|
178
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "General Settings" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "workspace-container", children: [(0, jsx_runtime_1.jsx)("span", { className: "label", children: "Workspace : " }), (0, jsx_runtime_1.jsx)(DropDownButton_1.default, { data: workspacesList, renderItem: renderItem, selectedKey: preferences?.workspace.current, onSelect: ChangeWorkspaceHandler })] }), (0, jsx_runtime_1.jsx)("div", { className: "main-content", children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { ref: refForm, initialValues: preferences.current, validationSchema: settingsValidation_1.validation, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(Tabs_1.default, { position: Tabs_1.PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [(0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Controllers", tabid: "controllers", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(ControllersTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Formatting", tabid: "formatting", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(FormattingTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Display", tabid: "display", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(DisplayTabContent_1.default, { preferences: preferences.current.display }) }) })] }) }, JSON.stringify(preferences.current)) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleReset, cancelLabel: "Reset" }) })] }));
|
|
179
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "General Settings" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "workspace-container", children: [(0, jsx_runtime_1.jsx)("span", { className: "label", children: "Workspace : " }), (0, jsx_runtime_1.jsx)(DropDownButton_1.default, { data: workspacesList, renderItem: renderItem, selectedKey: preferences?.workspace.current, onSelect: ChangeWorkspaceHandler })] }), (0, jsx_runtime_1.jsx)("div", { className: "main-content", children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { ref: refForm, initialValues: preferences.current, validationSchema: settingsValidation_1.validation, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(Tabs_1.default, { position: Tabs_1.PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [(0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Controllers", tabid: "controllers", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(ControllersTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Formatting", tabid: "formatting", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(FormattingTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Display", tabid: "display", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(DisplayTabContent_1.default, { preferences: preferences.current.display }) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Databases", tabid: "databases", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(DatabasesTabContent_1.default, { currentWorkspace: preferences.workspace.current }) }) })] }) }, JSON.stringify(preferences.current)) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleReset, cancelLabel: "Reset" }) })] }));
|
|
179
180
|
}
|
|
180
181
|
exports.default = GeneralSettings;
|