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
|
@@ -34,6 +34,6 @@ const styles = css `
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
`;
|
|
37
|
-
export default function DefaultSpinnerComponent() {
|
|
38
|
-
return (_jsxs("div", { css: styles, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 841.9 595.3", children: _jsxs("g", { fill: "#61DAFB", children: [_jsx("path", { d: "M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z" }), _jsx("path", { d: "M520.5 78.1z" })] }) }), _jsx("p", { children:
|
|
37
|
+
export default function DefaultSpinnerComponent({ loadingText = 'Loading ...', }) {
|
|
38
|
+
return (_jsxs("div", { css: styles, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 841.9 595.3", children: _jsxs("g", { fill: "#61DAFB", children: [_jsx("path", { d: "M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z" }), _jsx("path", { d: "M520.5 78.1z" })] }) }), _jsx("p", { children: loadingText })] }));
|
|
39
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
export declare function defaultGetSpinner(): JSX.Element;
|
|
3
|
-
export declare const spinnerContext: import("react").Context<() => ReactElement>;
|
|
4
|
-
export declare const SpinnerProvider: import("react").Provider<() => ReactElement>;
|
|
2
|
+
export declare function defaultGetSpinner(loadingText?: string): JSX.Element;
|
|
3
|
+
export declare const spinnerContext: import("react").Context<(loadingText?: string) => ReactElement>;
|
|
4
|
+
export declare const SpinnerProvider: import("react").Provider<(loadingText?: string) => ReactElement>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext } from 'react';
|
|
3
3
|
import DefaultSpinnerComponent from './DefaultSpinnerComponent';
|
|
4
|
-
export function defaultGetSpinner() {
|
|
5
|
-
return _jsx(DefaultSpinnerComponent, {});
|
|
4
|
+
export function defaultGetSpinner(loadingText = 'Loading ...') {
|
|
5
|
+
return _jsx(DefaultSpinnerComponent, { loadingText: loadingText });
|
|
6
6
|
}
|
|
7
7
|
export const spinnerContext = createContext(defaultGetSpinner);
|
|
8
8
|
export const SpinnerProvider = spinnerContext.Provider;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { Molecule } from '../../data/molecules/Molecule';
|
|
1
2
|
interface MoleculeStructureEditorModalProps {
|
|
2
3
|
onClose?: (element?: string) => void;
|
|
3
|
-
selectedMolecule
|
|
4
|
-
key: any;
|
|
5
|
-
molfile: string;
|
|
6
|
-
};
|
|
4
|
+
selectedMolecule?: Molecule;
|
|
7
5
|
}
|
|
8
6
|
declare function MoleculeStructureEditorModal(props: MoleculeStructureEditorModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function useMoleculeEditor(): (molecule?: Molecule) => void;
|
|
9
8
|
export default MoleculeStructureEditorModal;
|
|
@@ -4,6 +4,8 @@ import { useState, useEffect, useCallback } from 'react';
|
|
|
4
4
|
import { StructureEditor } from 'react-ocl/full';
|
|
5
5
|
import { useDispatch } from '../context/DispatchContext';
|
|
6
6
|
import ActionButtons from '../elements/ActionButtons';
|
|
7
|
+
import { useModal } from '../elements/popup/Modal';
|
|
8
|
+
import { positions } from '../elements/popup/options';
|
|
7
9
|
import { SET_MOLECULE, ADD_MOLECULE } from '../reducer/types/Types';
|
|
8
10
|
import { ModalStyles } from './ModalStyle';
|
|
9
11
|
function MoleculeStructureEditorModal(props) {
|
|
@@ -27,7 +29,16 @@ function MoleculeStructureEditorModal(props) {
|
|
|
27
29
|
}, [onClose]);
|
|
28
30
|
const handleSave = useCallback(() => {
|
|
29
31
|
if (selectedMolecule) {
|
|
30
|
-
|
|
32
|
+
const { key, isFloat, label } = selectedMolecule;
|
|
33
|
+
dispatch({
|
|
34
|
+
type: SET_MOLECULE,
|
|
35
|
+
payload: {
|
|
36
|
+
molfile,
|
|
37
|
+
key,
|
|
38
|
+
isFloat,
|
|
39
|
+
label,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
31
42
|
onClose('replace');
|
|
32
43
|
}
|
|
33
44
|
else {
|
|
@@ -37,4 +48,14 @@ function MoleculeStructureEditorModal(props) {
|
|
|
37
48
|
}, [dispatch, selectedMolecule, molfile, onClose]);
|
|
38
49
|
return (_jsxs("div", { css: ModalStyles, children: [_jsx(StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleClose }) })] }));
|
|
39
50
|
}
|
|
51
|
+
export function useMoleculeEditor() {
|
|
52
|
+
const modal = useModal();
|
|
53
|
+
return useCallback((molecule) => {
|
|
54
|
+
modal.show(_jsx(MoleculeStructureEditorModal, { selectedMolecule: molecule }), {
|
|
55
|
+
position: positions.TOP_CENTER,
|
|
56
|
+
width: 700,
|
|
57
|
+
height: 500,
|
|
58
|
+
});
|
|
59
|
+
}, [modal]);
|
|
60
|
+
}
|
|
40
61
|
export default MoleculeStructureEditorModal;
|
|
@@ -11,9 +11,10 @@ import CloseButton from '../../elements/CloseButton';
|
|
|
11
11
|
import SaveButton from '../../elements/SaveButton';
|
|
12
12
|
import FormikForm from '../../elements/formik/FormikForm';
|
|
13
13
|
import FormikOnChange from '../../elements/formik/FormikOnChange';
|
|
14
|
+
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
14
15
|
import { hasCouplingConstant, translateMultiplet, } from '../../panels/extra/utilities/MultiplicityUtilities';
|
|
15
16
|
import { CHANGE_TEMP_RANGE } from '../../reducer/types/Types';
|
|
16
|
-
import {
|
|
17
|
+
import { formatNumber } from '../../utility/formatNumber';
|
|
17
18
|
import SignalsForm from './forms/components/SignalsForm';
|
|
18
19
|
import useRangeFormValidation from './forms/validation/EditRangeValidation';
|
|
19
20
|
const styles = css `
|
|
@@ -71,7 +72,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
71
72
|
const formRef = useRef(null);
|
|
72
73
|
const { activeTab } = useChartData();
|
|
73
74
|
const dispatch = useDispatch();
|
|
74
|
-
const
|
|
75
|
+
const rangesPreferences = usePanelPreferences('ranges', activeTab);
|
|
75
76
|
const validation = useRangeFormValidation();
|
|
76
77
|
const handleOnZoom = useCallback(() => {
|
|
77
78
|
onZoomEditRangeModal(range);
|
|
@@ -124,7 +125,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
124
125
|
};
|
|
125
126
|
if (hasCouplingConstant(_multiplicity)) {
|
|
126
127
|
coupling = { ...signal.js[counterJ] };
|
|
127
|
-
coupling.coupling = Number(
|
|
128
|
+
coupling.coupling = Number(formatNumber(coupling.coupling, rangesPreferences.coupling.format));
|
|
128
129
|
counterJ++;
|
|
129
130
|
}
|
|
130
131
|
coupling.multiplicity = translateMultiplet(coupling.multiplicity);
|
|
@@ -133,7 +134,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
133
134
|
return { ...signal, js: couplings };
|
|
134
135
|
});
|
|
135
136
|
return { activeTab: '0', signals };
|
|
136
|
-
}, [
|
|
137
|
+
}, [range.signals, rangesPreferences.coupling.format]);
|
|
137
138
|
const changeHandler = useCallback((values) => {
|
|
138
139
|
const signals = getSignals(values.signals);
|
|
139
140
|
dispatch({
|
|
@@ -141,6 +142,6 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
141
142
|
payload: { tempRange: Object.assign({}, range, { signals }) },
|
|
142
143
|
});
|
|
143
144
|
}, [dispatch, getSignals, range]);
|
|
144
|
-
return (_jsx("div", { css: styles, children: _jsxs(FormikForm, { ref: formRef, initialValues: data, validationSchema: validation, onSubmit: handleOnSave, children: [_jsxs("div", { className: "header handle", children: [_jsx(Button, { onClick: handleOnZoom, className: "zoom-button", children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { children: ` Range and Signal edition: ${
|
|
145
|
+
return (_jsx("div", { css: styles, children: _jsxs(FormikForm, { ref: formRef, initialValues: data, validationSchema: validation, onSubmit: handleOnSave, children: [_jsxs("div", { className: "header handle", children: [_jsx(Button, { onClick: handleOnZoom, className: "zoom-button", children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { children: ` Range and Signal edition: ${formatNumber(range.from, rangesPreferences.from.format)} ppm to ${formatNumber(range.to, rangesPreferences.to.format)} ppm` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), popupTitle: "Save and exit" }), _jsx(CloseButton, { onClick: handleOnClose })] }), _jsx(SignalsForm, { range: range, preferences: rangesPreferences }), _jsx(FormikOnChange, { onChange: changeHandler })] }) }));
|
|
145
146
|
}
|
|
146
147
|
export default EditRangeModal;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { WorkSpacePanelPreferences } from '../../../../workspaces/Workspace';
|
|
2
3
|
interface AddSignalFormTabProps {
|
|
3
4
|
onFocus: (element: any) => void;
|
|
4
5
|
onBlur?: () => void;
|
|
5
6
|
range: any;
|
|
7
|
+
preferences: WorkSpacePanelPreferences['ranges'];
|
|
6
8
|
}
|
|
7
9
|
declare const _default: import("react").ForwardRefExoticComponent<AddSignalFormTabProps & import("react").RefAttributes<unknown>>;
|
|
8
10
|
export default _default;
|
|
@@ -5,12 +5,11 @@ import { useFormikContext } from 'formik';
|
|
|
5
5
|
import { forwardRef, useCallback, useMemo } from 'react';
|
|
6
6
|
import { FaPlus } from 'react-icons/fa';
|
|
7
7
|
import * as Yup from 'yup';
|
|
8
|
-
import { useChartData } from '../../../../context/ChartContext';
|
|
9
8
|
import Button from '../../../../elements/Button';
|
|
10
9
|
import FormikForm from '../../../../elements/formik/FormikForm';
|
|
11
10
|
import FormikInput from '../../../../elements/formik/FormikInput';
|
|
12
11
|
import { translateMultiplet } from '../../../../panels/extra/utilities/MultiplicityUtilities';
|
|
13
|
-
import {
|
|
12
|
+
import { formatNumber } from '../../../../utility/formatNumber';
|
|
14
13
|
const styles = {
|
|
15
14
|
container: css `
|
|
16
15
|
text-align: center;
|
|
@@ -52,10 +51,8 @@ const styles = {
|
|
|
52
51
|
`,
|
|
53
52
|
};
|
|
54
53
|
// TODO: this seems to be a hacky use of ref.
|
|
55
|
-
function AddSignalFormTab({ onFocus, onBlur, range }, ref) {
|
|
54
|
+
function AddSignalFormTab({ onFocus, onBlur, range, preferences }, ref) {
|
|
56
55
|
const { values, setFieldValue } = useFormikContext();
|
|
57
|
-
const { activeTab } = useChartData();
|
|
58
|
-
const format = useFormatNumberByNucleus(activeTab);
|
|
59
56
|
const saveHandler = useCallback((val) => {
|
|
60
57
|
const newSignal = {
|
|
61
58
|
multiplicity: 'm',
|
|
@@ -91,6 +88,6 @@ function AddSignalFormTab({ onFocus, onBlur, range }, ref) {
|
|
|
91
88
|
width: '250px',
|
|
92
89
|
height: '30px',
|
|
93
90
|
},
|
|
94
|
-
}, checkErrorAfterInputTouched: false }) }), _jsxs("p", { css: styles.inputInfo, children: ["[
|
|
91
|
+
}, checkErrorAfterInputTouched: false }) }), _jsxs("p", { css: styles.inputInfo, children: ["[", `${formatNumber(range.from, preferences.from.format)} ppm - ${formatNumber(range.to, preferences.to.format)} ppm`, "]"] }), _jsx(Button, { css: styles.addSignalBtn, onClick: triggerSubmitHandler, children: _jsx(FaPlus, { title: "Add new signal" }) })] })] }) }));
|
|
95
92
|
}
|
|
96
93
|
export default forwardRef(AddSignalFormTab);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { WorkSpacePanelPreferences } from '../../../../workspaces/Workspace';
|
|
2
3
|
interface SignalsFormProps {
|
|
3
4
|
range: number;
|
|
5
|
+
preferences: WorkSpacePanelPreferences['ranges'];
|
|
4
6
|
}
|
|
5
|
-
declare function SignalsForm({ range }: SignalsFormProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function SignalsForm({ range, preferences }: SignalsFormProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
8
|
declare const _default: import("react").MemoExoticComponent<typeof SignalsForm>;
|
|
7
9
|
export default _default;
|
|
@@ -3,12 +3,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { useFormikContext } from 'formik';
|
|
5
5
|
import { useCallback, useMemo, memo, useEffect, useState, useRef } from 'react';
|
|
6
|
-
import { useChartData } from '../../../../context/ChartContext';
|
|
7
6
|
import Tab from '../../../../elements/Tab/Tab';
|
|
8
7
|
import Tabs from '../../../../elements/Tab/Tabs';
|
|
9
8
|
import useSpectrum from '../../../../hooks/useSpectrum';
|
|
10
9
|
import Events from '../../../../utility/Events';
|
|
11
|
-
import {
|
|
10
|
+
import { formatNumber } from '../../../../utility/formatNumber';
|
|
12
11
|
import AddSignalFormTab from './AddSignalFormTab';
|
|
13
12
|
import DeltaInput from './DeltaInput';
|
|
14
13
|
import SignalFormTab from './SignalFormTab';
|
|
@@ -38,13 +37,11 @@ const tabStyles = css `
|
|
|
38
37
|
list-style: none;
|
|
39
38
|
padding: 0.5rem 1.5rem;
|
|
40
39
|
`;
|
|
41
|
-
function SignalsForm({ range }) {
|
|
40
|
+
function SignalsForm({ range, preferences }) {
|
|
42
41
|
const newSignalFormRef = useRef();
|
|
43
42
|
const [activeField, setActiveField] = useState(null);
|
|
44
43
|
const { values, setFieldValue, errors, } = useFormikContext();
|
|
45
|
-
const { activeTab } = useChartData();
|
|
46
44
|
const { info } = useSpectrum({ info: {} });
|
|
47
|
-
const format = useFormatNumberByNucleus(activeTab);
|
|
48
45
|
useEffect(() => {
|
|
49
46
|
function handle(event) {
|
|
50
47
|
if (info?.originFrequency && activeField) {
|
|
@@ -57,7 +54,7 @@ function SignalsForm({ range }) {
|
|
|
57
54
|
setFieldValue(activeField, (event.range[1] - event.range[0]) / 2 + event.range[0]);
|
|
58
55
|
}
|
|
59
56
|
else {
|
|
60
|
-
const value = Number(
|
|
57
|
+
const value = Number(formatNumber(Math.abs(event.range[0] - event.range[1]) * info.originFrequency, preferences.deltaHz.format));
|
|
61
58
|
setFieldValue(activeField, value);
|
|
62
59
|
}
|
|
63
60
|
}
|
|
@@ -67,7 +64,13 @@ function SignalsForm({ range }) {
|
|
|
67
64
|
return () => {
|
|
68
65
|
Events.off('brushEnd', handle);
|
|
69
66
|
};
|
|
70
|
-
}, [
|
|
67
|
+
}, [
|
|
68
|
+
activeField,
|
|
69
|
+
setFieldValue,
|
|
70
|
+
values.activeTab,
|
|
71
|
+
info,
|
|
72
|
+
preferences?.deltaHz?.format,
|
|
73
|
+
]);
|
|
71
74
|
useEffect(() => {
|
|
72
75
|
function handle(event) {
|
|
73
76
|
if (activeField) {
|
|
@@ -109,9 +112,9 @@ function SignalsForm({ range }) {
|
|
|
109
112
|
// eslint-disable-next-line react/no-array-index-key
|
|
110
113
|
, { tabid: `${i}`, tabstyles: tabContainsErrors(i) ? tabStylesAddition : tabStyles, canDelete: true, render: () => (_jsx(DeltaInput, { signal: signal, index: i, onFocus: handleOnFocus })), children: _jsx(SignalFormTab, { onFocus: handleOnFocus }) }, `signalForm${i}`)))
|
|
111
114
|
: [];
|
|
112
|
-
const addSignalTab = (_jsx(Tab, { tablabel: "+", tabid: "addSignalTab", canDelete: false, className: "add-signal-tab", children: _jsx(AddSignalFormTab, { onFocus: handleOnFocus, range: range, ref: newSignalFormRef }) }, "addSignalTab"));
|
|
115
|
+
const addSignalTab = (_jsx(Tab, { tablabel: "+", tabid: "addSignalTab", canDelete: false, className: "add-signal-tab", children: _jsx(AddSignalFormTab, { onFocus: handleOnFocus, range: range, ref: newSignalFormRef, preferences: preferences }) }, "addSignalTab"));
|
|
113
116
|
return signalTabs.concat(addSignalTab);
|
|
114
|
-
}, [handleOnFocus, range, tabContainsErrors, values.signals]);
|
|
117
|
+
}, [handleOnFocus, preferences, range, tabContainsErrors, values.signals]);
|
|
115
118
|
const editSignalInfoText = (_jsx("p", { className: "infoText", children: "Focus on an input field and press Shift + Drag & Drop to draw a coupling constant in spectrum view." }));
|
|
116
119
|
const addSignalInfoText = (_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." }));
|
|
117
120
|
return (_jsxs("div", { children: [_jsx("div", { css: textStyles, children: errors.signals &&
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NMRiumWorkspace } from '../../NMRium';
|
|
2
|
+
interface DatabasesTabContentProps {
|
|
3
|
+
currentWorkspace: NMRiumWorkspace;
|
|
4
|
+
}
|
|
5
|
+
declare function DatabasesTabContent({ currentWorkspace }: DatabasesTabContentProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default DatabasesTabContent;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { useFormikContext } from 'formik';
|
|
5
|
+
import lodashGet from 'lodash/get';
|
|
6
|
+
import { useCallback, useMemo } from 'react';
|
|
7
|
+
import { FaPlus, FaTimes } from 'react-icons/fa';
|
|
8
|
+
import Button from '../../elements/Button';
|
|
9
|
+
import FormikCheckBox from '../../elements/formik/FormikCheckBox';
|
|
10
|
+
import FormikInput from '../../elements/formik/FormikInput';
|
|
11
|
+
import Workspaces from '../../workspaces';
|
|
12
|
+
const style = {
|
|
13
|
+
addButton: css `
|
|
14
|
+
background-color: transparent;
|
|
15
|
+
border: 0;
|
|
16
|
+
outline: none;
|
|
17
|
+
margin-left: 5px;
|
|
18
|
+
svg {
|
|
19
|
+
font-size: 14px;
|
|
20
|
+
fill: green;
|
|
21
|
+
}
|
|
22
|
+
`,
|
|
23
|
+
table: {
|
|
24
|
+
width: '100%',
|
|
25
|
+
},
|
|
26
|
+
th: {
|
|
27
|
+
fontSize: '12px',
|
|
28
|
+
},
|
|
29
|
+
input: {
|
|
30
|
+
input: { width: '100%' },
|
|
31
|
+
},
|
|
32
|
+
labelCol: {
|
|
33
|
+
width: '30%',
|
|
34
|
+
},
|
|
35
|
+
serialCol: {
|
|
36
|
+
width: '5%',
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
function DatabasesTabContent({ currentWorkspace }) {
|
|
40
|
+
const { values, setFieldValue } = useFormikContext();
|
|
41
|
+
const databases = useMemo(() => lodashGet(values, 'databases', []), [values]);
|
|
42
|
+
const deleteHandler = useCallback((index) => {
|
|
43
|
+
const _database = databases.slice();
|
|
44
|
+
_database.splice(index, 1);
|
|
45
|
+
setFieldValue('databases', _database);
|
|
46
|
+
}, [databases, setFieldValue]);
|
|
47
|
+
const addNewDatabaseHandler = useCallback(() => {
|
|
48
|
+
const newDatabase = {
|
|
49
|
+
label: '',
|
|
50
|
+
url: '',
|
|
51
|
+
enabled: true,
|
|
52
|
+
};
|
|
53
|
+
setFieldValue('databases', [...databases, newDatabase]);
|
|
54
|
+
}, [databases, setFieldValue]);
|
|
55
|
+
const resetDatabaseHandler = useCallback(() => {
|
|
56
|
+
const database = Workspaces?.[currentWorkspace]?.databases || Workspaces.default.databases;
|
|
57
|
+
setFieldValue('databases', database);
|
|
58
|
+
}, [currentWorkspace, setFieldValue]);
|
|
59
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "section-header", style: { display: 'flex' }, children: [_jsx("p", { style: { flex: 1 }, children: "Databases" }), _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [_jsx(Button.Danger, { fill: "clear", size: "xSmall", onClick: resetDatabaseHandler, style: { margin: '0 5px' }, children: "Reset Databases" }), _jsx(Button.Done, { fill: "outline", size: "xSmall", onClick: addNewDatabaseHandler, children: "Add Database" })] })] }), _jsx("div", { children: _jsxs("table", { style: style.table, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { style: style.th, children: "#" }), _jsx("th", { style: style.th, children: "Label " }), _jsx("th", { style: style.th, children: "URL" }), _jsx("th", { style: style.th, children: "Enabled" }), _jsx("th", {})] }) }), _jsx("tbody", { children: databases?.map((item, index) => {
|
|
60
|
+
const num = index + 1;
|
|
61
|
+
return (
|
|
62
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
63
|
+
_jsxs("tr", { style: { height: '33px' }, children: [_jsxs("td", { style: style.serialCol, children: [_jsx("span", { children: num }), ' '] }), _jsx("td", { style: style.labelCol, children: _jsx(FormikInput, { style: style.input, name: `databases.${index}.label`, checkErrorAfterInputTouched: false }) }), _jsx("td", { children: _jsx(FormikInput, { style: style.input, name: `databases.${index}.url`, checkErrorAfterInputTouched: false }) }), _jsx("td", { children: _jsx(FormikCheckBox, { style: {
|
|
64
|
+
container: {
|
|
65
|
+
display: 'block',
|
|
66
|
+
margin: '0 auto',
|
|
67
|
+
width: 'fit-content',
|
|
68
|
+
},
|
|
69
|
+
}, className: "checkbox-element", name: `databases.${index}.enabled` }) }), _jsx("td", { children: _jsxs("div", { style: {
|
|
70
|
+
display: 'flex',
|
|
71
|
+
height: '100%',
|
|
72
|
+
}, children: [_jsx(Button.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: () => deleteHandler(index), children: _jsx(FaTimes, {}) }), databases.length === index + 1 && (_jsx(Button.Done, { fill: "clear", style: { fontSize: '14px' }, onClick: addNewDatabaseHandler, children: _jsx(FaPlus, {}) }))] }) })] }, `${index}`));
|
|
73
|
+
}) })] }) })] }));
|
|
74
|
+
}
|
|
75
|
+
export default DatabasesTabContent;
|
|
@@ -9,7 +9,7 @@ const LIST = [
|
|
|
9
9
|
name: 'panels.spectraPanel',
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
label: 'Spectra information
|
|
12
|
+
label: 'Spectra information panel',
|
|
13
13
|
name: 'panels.informationPanel',
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -29,7 +29,7 @@ const LIST = [
|
|
|
29
29
|
name: 'panels.structuresPanel',
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
label: 'Filters
|
|
32
|
+
label: 'Filters panel',
|
|
33
33
|
name: 'panels.filtersPanel',
|
|
34
34
|
},
|
|
35
35
|
{
|
|
@@ -37,23 +37,27 @@ const LIST = [
|
|
|
37
37
|
name: 'panels.zonesPanel',
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
label: 'Assignment summary
|
|
40
|
+
label: 'Assignment summary panel',
|
|
41
41
|
name: 'panels.summaryPanel',
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
|
-
label: 'Multiple
|
|
44
|
+
label: 'Multiple spectra analysis panel',
|
|
45
45
|
name: 'panels.multipleSpectraAnalysisPanel',
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
|
-
label: '
|
|
48
|
+
label: 'Databases panel',
|
|
49
49
|
name: 'panels.databasePanel',
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
|
-
label: 'Prediction
|
|
52
|
+
label: 'Prediction panel',
|
|
53
53
|
name: 'panels.predictionPanel',
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
label: '
|
|
56
|
+
label: 'Automatic assignment panel',
|
|
57
|
+
name: 'panels.automaticAssignmentPanel',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: 'Experimental features',
|
|
57
61
|
name: 'general.experimentalFeatures',
|
|
58
62
|
hideOpenOption: true,
|
|
59
63
|
},
|
|
@@ -4,9 +4,9 @@ import { css } from '@emotion/react';
|
|
|
4
4
|
import { useFormikContext } from 'formik';
|
|
5
5
|
import lodashGet from 'lodash/get';
|
|
6
6
|
import { Fragment, useCallback, useMemo } from 'react';
|
|
7
|
-
import { FaPlus } from 'react-icons/fa';
|
|
7
|
+
import { FaPlus, FaTimes } from 'react-icons/fa';
|
|
8
8
|
import generateID from '../../../data/utilities/generateID';
|
|
9
|
-
import
|
|
9
|
+
import Button from '../../elements/Button';
|
|
10
10
|
import FormikInput from '../../elements/formik/FormikInput';
|
|
11
11
|
const styles = css `
|
|
12
12
|
.counter-col {
|
|
@@ -18,7 +18,7 @@ const styles = css `
|
|
|
18
18
|
width: 80px;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.
|
|
21
|
+
.input {
|
|
22
22
|
width: 100% !important;
|
|
23
23
|
margin: 0px !important;
|
|
24
24
|
}
|
|
@@ -68,9 +68,9 @@ function FormattingTabContent() {
|
|
|
68
68
|
setFieldValue('formatting.nuclei', newNuclei);
|
|
69
69
|
}, [nuclei, setFieldValue]);
|
|
70
70
|
const nucleiList = Object.keys(nuclei);
|
|
71
|
-
return (_jsxs(Fragment, { children: [_jsx("p", { className: "section-header", children: "
|
|
71
|
+
return (_jsxs(Fragment, { children: [_jsx("p", { className: "section-header", children: "Number formatting for crosshair and info line" }), _jsx("div", { css: styles, children: _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: "counter-col", children: "#" }), _jsx("th", { className: "nucleus-label-col", children: "Nucleus " }), _jsx("th", { className: "nucleus-format-input-col", children: "\u03B4 (ppm)" }), _jsx("th", { className: "nucleus-format-input-col", children: "Coupling (Hz)" }), _jsx("th", { className: "nucleus-format-input-col" })] }) }), _jsx("tbody", { children: nucleiList?.map((key, index) => {
|
|
72
72
|
const num = index + 1;
|
|
73
|
-
return (_jsxs("tr", { children: [_jsxs("td", { className: "counter-col", children: [_jsxs("span", { children: [num, " - "] }), ' '] }), _jsx("td", { className: "nucleus-label-col", children: _jsx(FormikInput, { name: `formatting.nuclei.${key}.name`, className: "
|
|
73
|
+
return (_jsxs("tr", { children: [_jsxs("td", { className: "counter-col", children: [_jsxs("span", { children: [num, " - "] }), ' '] }), _jsx("td", { className: "nucleus-label-col", children: _jsx(FormikInput, { name: `formatting.nuclei.${key}.name`, className: "input", checkErrorAfterInputTouched: false }) }), _jsx("td", { className: "nucleus-format-input-col", children: _jsx(FormikInput, { name: `formatting.nuclei.${key}.ppm`, className: "input" }) }), _jsx("td", { className: "nucleus-format-input-col", children: _jsx(FormikInput, { name: `formatting.nuclei.${key}.hz`, className: "input" }) }), _jsxs("td", { className: "operation-container", children: [_jsx(Button.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: () => deleteHandler(key), children: _jsx(FaTimes, {}) }), nucleiList.length === index + 1 && (_jsx(Button.Done, { fill: "clear", style: { fontSize: '14px' }, onClick: addNewNucleusFormatHandler, children: _jsx(FaPlus, {}) }))] })] }, `${key}`));
|
|
74
74
|
}) })] }) })] }));
|
|
75
75
|
}
|
|
76
76
|
export default FormattingTabContent;
|
|
@@ -12,6 +12,7 @@ import FormikForm from '../../elements/formik/FormikForm';
|
|
|
12
12
|
import { useAlert } from '../../elements/popup/Alert';
|
|
13
13
|
import { ModalStyles } from '../ModalStyle';
|
|
14
14
|
import ControllersTabContent from './ControllersTabContent';
|
|
15
|
+
import DatabasesTabContent from './DatabasesTabContent';
|
|
15
16
|
import DisplayTabContent from './DisplayTabContent';
|
|
16
17
|
import FormattingTabContent from './FormattingTabContent';
|
|
17
18
|
import WorkspaceItem from './WorkspaceItem';
|
|
@@ -147,6 +148,6 @@ function GeneralSettings({ onClose }) {
|
|
|
147
148
|
const renderItem = useCallback((item) => {
|
|
148
149
|
return (_jsx(WorkspaceItem, { item: item, onSave: addWorkSpaceHandler, onDelete: deleteWorkSpaceHandler }));
|
|
149
150
|
}, [addWorkSpaceHandler, deleteWorkSpaceHandler]);
|
|
150
|
-
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "General Settings" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsxs("div", { className: "workspace-container", children: [_jsx("span", { className: "label", children: "Workspace : " }), _jsx(DropDownButton, { data: workspacesList, renderItem: renderItem, selectedKey: preferences?.workspace.current, onSelect: ChangeWorkspaceHandler })] }), _jsx("div", { className: "main-content", children: _jsx(FormikForm, { ref: refForm, initialValues: preferences.current, validationSchema: validation, onSubmit: submitHandler, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { tablabel: "Controllers", tabid: "controllers", children: _jsx("div", { className: "inner-content", children: _jsx(ControllersTabContent, {}) }) }), _jsx(Tab, { tablabel: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { tablabel: "Display", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, { preferences: preferences.current.display }) }) })] }) }, JSON.stringify(preferences.current)) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleReset, cancelLabel: "Reset" }) })] }));
|
|
151
|
+
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "General Settings" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsxs("div", { className: "workspace-container", children: [_jsx("span", { className: "label", children: "Workspace : " }), _jsx(DropDownButton, { data: workspacesList, renderItem: renderItem, selectedKey: preferences?.workspace.current, onSelect: ChangeWorkspaceHandler })] }), _jsx("div", { className: "main-content", children: _jsx(FormikForm, { ref: refForm, initialValues: preferences.current, validationSchema: validation, onSubmit: submitHandler, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { tablabel: "Controllers", tabid: "controllers", children: _jsx("div", { className: "inner-content", children: _jsx(ControllersTabContent, {}) }) }), _jsx(Tab, { tablabel: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { tablabel: "Display", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, { preferences: preferences.current.display }) }) }), _jsx(Tab, { tablabel: "Databases", tabid: "databases", children: _jsx("div", { className: "inner-content", children: _jsx(DatabasesTabContent, { currentWorkspace: preferences.workspace.current }) }) })] }) }, JSON.stringify(preferences.current)) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleReset, cancelLabel: "Reset" }) })] }));
|
|
151
152
|
}
|
|
152
153
|
export default GeneralSettings;
|
|
@@ -1,8 +1,56 @@
|
|
|
1
1
|
import * as Yup from 'yup';
|
|
2
2
|
export declare const validation: import("yup/lib/Lazy").default<Yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
3
|
formatting: Yup.ObjectSchema<any, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<any>, import("yup/lib/object").AssertsShape<any>>;
|
|
4
|
+
databases: Yup.ArraySchema<Yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
5
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
7
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
8
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
9
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
11
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
12
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
13
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
14
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
15
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
16
|
+
}>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
17
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
18
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
19
|
+
}>>[] | undefined>;
|
|
4
20
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
5
21
|
formatting: Yup.ObjectSchema<any, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<any>, import("yup/lib/object").AssertsShape<any>>;
|
|
22
|
+
databases: Yup.ArraySchema<Yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
23
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
24
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
25
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
26
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
27
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
28
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
29
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
30
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
31
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
32
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
33
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
34
|
+
}>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
35
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
36
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
37
|
+
}>>[] | undefined>;
|
|
6
38
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
39
|
formatting: Yup.ObjectSchema<any, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<any>, import("yup/lib/object").AssertsShape<any>>;
|
|
40
|
+
databases: Yup.ArraySchema<Yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
41
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
42
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
43
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
44
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
45
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
46
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
47
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
48
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
49
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
50
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
51
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
52
|
+
}>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
53
|
+
label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
54
|
+
url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
55
|
+
}>>[] | undefined>;
|
|
8
56
|
}>>>, import("yup/lib/object").AnyObject>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Yup from 'yup';
|
|
2
|
-
const
|
|
2
|
+
const formattingElementValidation = (obj) => Object.keys(obj.formatting.nuclei).reduce((validate, key) => {
|
|
3
3
|
validate[key] = Yup.object().shape({
|
|
4
4
|
name: Yup.string().trim().required('Nucleus is a required field'),
|
|
5
5
|
ppm: Yup.string().trim().required('PPM format is a required field'),
|
|
@@ -7,34 +7,40 @@ const formattingValidation = (obj) => Object.keys(obj.formatting.nuclei).reduce(
|
|
|
7
7
|
});
|
|
8
8
|
return validate;
|
|
9
9
|
}, {});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (_key) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
nucleusFrequencies[_key] = { value: 1, fields: [key] };
|
|
25
|
-
}
|
|
10
|
+
const formattingValidation = (obj) => Yup.object().shape({
|
|
11
|
+
nuclei: Yup.object()
|
|
12
|
+
.shape(formattingElementValidation(obj))
|
|
13
|
+
.test('Unique', 'Nuclei need te be unique', function check(nuclei) {
|
|
14
|
+
let nucleusFrequencies = {};
|
|
15
|
+
for (const key of Object.keys(nuclei)) {
|
|
16
|
+
const _key = nuclei[key].name?.toLowerCase() || '';
|
|
17
|
+
if (_key) {
|
|
18
|
+
if (nucleusFrequencies[_key]) {
|
|
19
|
+
++nucleusFrequencies[_key].value;
|
|
20
|
+
nucleusFrequencies[_key].fields.push(key);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
nucleusFrequencies[_key] = { value: 1, fields: [key] };
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
26
|
+
}
|
|
27
|
+
const errors = Object.keys(nucleusFrequencies).reduce((errorList, key) => {
|
|
28
|
+
const { value, fields } = nucleusFrequencies[key];
|
|
29
|
+
if (value > 1) {
|
|
30
|
+
for (let field of fields) {
|
|
31
|
+
errorList.push(new Yup.ValidationError(`${key} nucleus must te be unique`, nuclei[key].name, `${this.path}.${field}.name`));
|
|
34
32
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
}
|
|
34
|
+
return errorList;
|
|
35
|
+
}, []);
|
|
36
|
+
return new Yup.ValidationError(errors);
|
|
39
37
|
}),
|
|
38
|
+
});
|
|
39
|
+
const databasesValidation = Yup.array().of(Yup.object().shape({
|
|
40
|
+
label: Yup.string().trim().required('Label is a required field'),
|
|
41
|
+
url: Yup.string().trim().url().required('URL is a required field'),
|
|
42
|
+
}));
|
|
43
|
+
export const validation = Yup.lazy((obj) => Yup.object().shape({
|
|
44
|
+
formatting: formattingValidation(obj),
|
|
45
|
+
databases: databasesValidation,
|
|
40
46
|
}));
|