nmrium 0.42.0 → 0.43.1-pre.1692874523
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/ApodizationLine.js +1 -1
- package/lib/component/1d/Chart1D.js +3 -2
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib/component/1d/Line.js +1 -1
- package/lib/component/1d/Viewer1D.js +15 -3
- package/lib/component/1d/integral/IntegralResizable.js +4 -3
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +3 -1
- package/lib/component/1d/peaks/PeakAnnotations.js +20 -25
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts +2 -0
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +59 -0
- package/lib/component/1d/peaks/PeakEditionManager.d.ts +18 -0
- package/lib/component/1d/peaks/PeakEditionManager.js +98 -0
- package/lib/component/1d/peaks/Peaks.d.ts +1 -0
- package/lib/component/1d/peaks/Peaks.js +22 -0
- package/lib/component/1d/ranges/Range.js +3 -1
- package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.js +11 -31
- package/lib/component/1d/utilities/intersectionResolver.d.ts +25 -0
- package/lib/component/1d/utilities/intersectionResolver.js +71 -0
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +2 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +17 -16
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +2 -2
- package/lib/component/2d/SlicingView.js +1 -1
- package/lib/component/2d/Viewer2D.js +1 -3
- package/lib/component/2d/ft/Contours.js +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +5 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +48 -8
- package/lib/component/assignment/index.d.ts +6 -1
- package/lib/component/assignment/index.js +5 -1
- package/lib/component/context/DispatchContext.d.ts +3 -2
- package/lib/component/context/KeyModifierContext.d.ts +13 -0
- package/lib/component/context/KeyModifierContext.js +39 -0
- package/lib/component/context/PreferencesContext.d.ts +39 -39
- package/lib/component/elements/Button.js +2 -0
- package/lib/component/elements/CounterLabel.d.ts +7 -0
- package/lib/component/elements/CounterLabel.js +12 -0
- package/lib/component/elements/EditableColumn.js +12 -6
- package/lib/component/elements/Input.d.ts +3 -12
- package/lib/component/elements/Input.js +24 -76
- package/lib/component/elements/Message.js +0 -1
- package/lib/component/elements/NumberInput.d.ts +1 -0
- package/lib/component/elements/NumberInput.js +10 -3
- package/lib/component/elements/PreferencesButton.d.ts +4 -0
- package/lib/component/elements/PreferencesButton.js +6 -0
- package/lib/component/elements/formik/FormikInput.d.ts +2 -2
- package/lib/component/elements/formik/FormikInput.js +3 -6
- package/lib/component/elements/formik/FormikOnChange.js +1 -1
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib/component/header/ApodizationOptionsPanel.js +23 -14
- package/lib/component/header/BaseLineCorrectionPanel.js +31 -10
- package/lib/component/header/Header.d.ts +10 -3
- package/lib/component/header/Header.js +6 -6
- package/lib/component/header/ZeroFillingOptionsPanel.js +37 -31
- package/lib/component/highlight/index.d.ts +1 -0
- package/lib/component/highlight/index.js +1 -0
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
- package/lib/component/hooks/useCheckToolsVisibility.js +7 -3
- package/lib/component/hooks/useResizerStatus.d.ts +2 -0
- package/lib/component/hooks/useResizerStatus.js +7 -0
- package/lib/component/hooks/useSpectrum.js +1 -1
- package/lib/component/main/ErrorOverlay.js +20 -0
- package/lib/component/main/InnerNMRium.d.ts +7 -0
- package/lib/component/main/InnerNMRium.js +52 -0
- package/lib/component/main/InnerNMRiumContents.d.ts +14 -0
- package/lib/component/main/InnerNMRiumContents.js +88 -0
- package/lib/component/main/NMRium.d.ts +23 -0
- package/lib/component/main/NMRium.js +13 -0
- package/lib/component/main/NMRiumStateProvider.d.ts +9 -0
- package/lib/component/main/NMRiumStateProvider.js +74 -0
- package/lib/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
- package/lib/component/main/StateError.d.ts +4 -0
- package/lib/component/main/StateError.js +16 -0
- package/lib/component/main/index.d.ts +3 -0
- package/lib/component/main/index.js +3 -0
- package/lib/component/main/types.d.ts +18 -0
- package/lib/component/main/types.js +2 -0
- package/lib/component/modal/AlignSpectraModal.js +78 -29
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +5 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +12 -15
- package/lib/component/modal/MultipletAnalysisModal.js +1 -1
- package/lib/component/modal/PredictSpectraModal.js +1 -1
- package/lib/component/modal/{AboutUsModal.js → aboutUs/AboutUsModal.js} +4 -3
- package/lib/component/modal/aboutUs/AboutUsZakodium.d.ts +1 -0
- package/lib/component/modal/aboutUs/AboutUsZakodium.js +33 -0
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +5 -16
- package/lib/component/modal/changeSum/ChangeSumModal.js +6 -115
- package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts +18 -0
- package/lib/component/modal/changeSum/ChangeSumModalContents.js +94 -0
- package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +2 -2
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +1 -1
- package/lib/component/modal/setting/settingsValidation.js +5 -1
- package/lib/component/panels/InformationPanel.js +9 -100
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +6 -11
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +3 -9
- package/lib/component/panels/MoleculesPanel/Utilities.js +14 -10
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +13 -9
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +5 -5
- package/lib/component/panels/Panels.js +6 -7
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +11 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +6 -10
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -6
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +2 -3
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +8 -9
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +3 -2
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +18 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +3 -40
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.d.ts +18 -0
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +53 -0
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +3 -4
- package/lib/component/panels/header/DefaultPanelHeader.js +11 -13
- package/lib/component/panels/predictionPanel/PredictionPanel.js +3 -3
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
- package/lib/component/reducer/IgnoreActions.js +1 -1
- package/lib/component/reducer/Reducer.d.ts +3 -8
- package/lib/component/reducer/Reducer.js +34 -8
- package/lib/component/reducer/actions/DomainActions.js +2 -3
- package/lib/component/reducer/actions/FiltersActions.d.ts +32 -11
- package/lib/component/reducer/actions/FiltersActions.js +96 -28
- package/lib/component/reducer/actions/IntegralsActions.d.ts +6 -2
- package/lib/component/reducer/actions/IntegralsActions.js +44 -20
- package/lib/component/reducer/actions/MoleculeActions.js +4 -4
- package/lib/component/reducer/actions/PeaksActions.d.ts +6 -4
- package/lib/component/reducer/actions/PeaksActions.js +19 -1
- package/lib/component/reducer/actions/PreferencesActions.js +1 -2
- package/lib/component/reducer/actions/RangesActions.d.ts +6 -2
- package/lib/component/reducer/actions/RangesActions.js +31 -3
- package/lib/component/reducer/actions/ToolsActions.js +10 -10
- package/lib/component/reducer/core/Constants.d.ts +0 -4
- package/lib/component/reducer/core/Constants.js +0 -5
- package/lib/component/reducer/helper/ZoomHistoryManager.js +1 -2
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +1 -1
- package/lib/component/toolbar/FunctionToolBar.js +13 -3
- package/lib/component/toolbar/ToolTypes.d.ts +3 -2
- package/lib/component/toolbar/ToolTypes.js +57 -22
- package/lib/component/utility/export.js +7 -4
- package/lib/component/utility/filterType.d.ts +3 -0
- package/lib/component/utility/filterType.js +1 -0
- package/lib/component/workspaces/basic.js +2 -0
- package/lib/component/workspaces/embedded.js +2 -0
- package/lib/component/workspaces/exercise.js +2 -0
- package/lib/component/workspaces/prediction.js +9 -0
- package/lib/component/workspaces/process1D.js +2 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
- package/lib/data/PredictionManager.d.ts +3 -3
- package/lib/data/PredictionManager.js +10 -10
- package/lib/data/constants/References.d.ts +5 -3
- package/lib/data/data1d/Spectrum1D/getReferenceShift.d.ts +10 -1
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +2 -8
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -1
- package/lib/data/molecules/Molecule.js +2 -2
- package/lib/data/utilities/checkModifierKeyActivated.d.ts +1 -1
- package/lib/data/utilities/checkModifierKeyActivated.js +8 -13
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +3 -2
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib-cjs/component/1d/Line.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +15 -3
- package/lib-cjs/component/1d/integral/IntegralResizable.js +4 -3
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +3 -1
- package/lib-cjs/component/1d/peaks/PeakAnnotations.js +19 -24
- package/lib-cjs/component/1d/peaks/PeakAnnotationsSpreadMode.js +64 -0
- package/lib-cjs/component/1d/peaks/PeakEditionManager.js +129 -0
- package/lib-cjs/component/1d/peaks/Peaks.js +29 -0
- package/lib-cjs/component/1d/ranges/Range.js +3 -1
- package/lib-cjs/component/1d/tool/BaseLineZones.js +11 -34
- package/lib-cjs/component/1d/utilities/intersectionResolver.js +75 -0
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +17 -16
- package/lib-cjs/component/2d/SlicingView.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +1 -3
- package/lib-cjs/component/2d/ft/Contours.js +1 -1
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +47 -7
- package/lib-cjs/component/assignment/index.js +5 -1
- package/lib-cjs/component/context/KeyModifierContext.js +44 -0
- package/lib-cjs/component/elements/Button.js +2 -0
- package/lib-cjs/component/elements/CounterLabel.js +16 -0
- package/lib-cjs/component/elements/EditableColumn.js +12 -6
- package/lib-cjs/component/elements/Input.js +23 -75
- package/lib-cjs/component/elements/Message.js +0 -1
- package/lib-cjs/component/elements/NumberInput.js +12 -2
- package/lib-cjs/component/elements/PreferencesButton.js +13 -0
- package/lib-cjs/component/elements/formik/FormikInput.js +3 -6
- package/lib-cjs/component/elements/formik/FormikOnChange.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +23 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +30 -9
- package/lib-cjs/component/header/Header.js +6 -6
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +35 -29
- package/lib-cjs/component/highlight/index.js +1 -0
- package/lib-cjs/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +7 -3
- package/lib-cjs/component/hooks/useResizerStatus.js +11 -0
- package/lib-cjs/component/hooks/useSpectrum.js +1 -1
- package/lib-cjs/component/main/ErrorOverlay.js +26 -0
- package/lib-cjs/component/main/InnerNMRium.js +82 -0
- package/lib-cjs/component/main/InnerNMRiumContents.js +95 -0
- package/lib-cjs/component/main/NMRium.js +19 -0
- package/lib-cjs/component/main/NMRiumStateProvider.js +80 -0
- package/lib-cjs/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
- package/lib-cjs/component/main/StateError.js +20 -0
- package/lib-cjs/component/main/index.js +21 -0
- package/lib-cjs/component/main/types.js +3 -0
- package/lib-cjs/component/modal/AlignSpectraModal.js +100 -28
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +11 -17
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +1 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
- package/lib-cjs/component/modal/{AboutUsModal.js → aboutUs/AboutUsModal.js} +4 -3
- package/lib-cjs/component/modal/aboutUs/AboutUsZakodium.js +39 -0
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +6 -141
- package/lib-cjs/component/modal/changeSum/ChangeSumModalContents.js +124 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -2
- package/lib-cjs/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +4 -0
- package/lib-cjs/component/panels/InformationPanel.js +7 -98
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +29 -11
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +14 -10
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +4 -4
- package/lib-cjs/component/panels/Panels.js +6 -7
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +32 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +29 -10
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +29 -6
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +4 -5
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +7 -8
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +26 -2
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +3 -40
- package/lib-cjs/component/panels/databasePanel/DatabaseSearchOptions.js +60 -0
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +12 -12
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +3 -3
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
- package/lib-cjs/component/reducer/IgnoreActions.js +1 -1
- package/lib-cjs/component/reducer/Reducer.js +33 -7
- package/lib-cjs/component/reducer/actions/DomainActions.js +2 -3
- package/lib-cjs/component/reducer/actions/FiltersActions.js +98 -28
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +45 -20
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +3 -3
- package/lib-cjs/component/reducer/actions/PeaksActions.js +20 -1
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +1 -2
- package/lib-cjs/component/reducer/actions/RangesActions.js +31 -2
- package/lib-cjs/component/reducer/actions/ToolsActions.js +9 -9
- package/lib-cjs/component/reducer/core/Constants.js +1 -6
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +1 -2
- package/lib-cjs/component/toolbar/FunctionToolBar.js +13 -3
- package/lib-cjs/component/toolbar/ToolTypes.js +57 -22
- package/lib-cjs/component/utility/export.js +7 -4
- package/lib-cjs/component/utility/filterType.js +2 -0
- package/lib-cjs/component/workspaces/basic.js +2 -0
- package/lib-cjs/component/workspaces/embedded.js +2 -0
- package/lib-cjs/component/workspaces/exercise.js +2 -0
- package/lib-cjs/component/workspaces/prediction.js +9 -0
- package/lib-cjs/component/workspaces/process1D.js +2 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +2 -0
- package/lib-cjs/data/PredictionManager.js +9 -9
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +1 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -1
- package/lib-cjs/data/molecules/Molecule.js +2 -2
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +8 -13
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +26 -25
- package/lib/component/1d/peaks/PeakAnnotation.d.ts +0 -12
- package/lib/component/1d/peaks/PeakAnnotation.js +0 -116
- package/lib/component/ErrorOverlay.js +0 -27
- package/lib/component/NMRium.d.ts +0 -42
- package/lib/component/NMRium.js +0 -237
- package/lib/component/reducer/actions/GlobalActions.d.ts +0 -9
- package/lib/component/reducer/actions/GlobalActions.js +0 -4
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +0 -118
- package/lib-cjs/component/ErrorOverlay.js +0 -30
- package/lib-cjs/component/NMRium.js +0 -267
- package/lib-cjs/component/reducer/actions/GlobalActions.js +0 -7
- /package/lib/component/{ErrorOverlay.d.ts → main/ErrorOverlay.d.ts} +0 -0
- /package/lib/component/{SplitPaneWrapper.d.ts → main/SplitPaneWrapper.d.ts} +0 -0
- /package/lib/component/modal/{AboutUsModal.d.ts → aboutUs/AboutUsModal.d.ts} +0 -0
|
@@ -53,8 +53,12 @@ const infoBlockValidation = (0, yup_1.object)({
|
|
|
53
53
|
jpath: (0, yup_1.array)().of((0, yup_1.string)()).min(1),
|
|
54
54
|
})),
|
|
55
55
|
});
|
|
56
|
+
const generalValidation = (0, yup_1.object)({
|
|
57
|
+
dimmedSpectraOpacity: (0, yup_1.number)().required(),
|
|
58
|
+
});
|
|
56
59
|
exports.validation = (0, yup_1.lazy)((obj) => (0, yup_1.object)().shape({
|
|
57
60
|
formatting: formattingValidation(obj),
|
|
58
61
|
databases: databasesValidation,
|
|
59
62
|
infoBlock: infoBlockValidation,
|
|
63
|
+
general: generalValidation,
|
|
60
64
|
}));
|
|
@@ -5,107 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
const
|
|
9
|
-
const ReactTableFlexLayout_1 = __importDefault(require("../elements/ReactTable/ReactTableFlexLayout"));
|
|
8
|
+
const ui_1 = require("react-science/ui");
|
|
10
9
|
const useSpectrum_1 = __importDefault(require("../hooks/useSpectrum"));
|
|
11
|
-
const styles = {
|
|
12
|
-
container: {
|
|
13
|
-
height: '100%',
|
|
14
|
-
flexDirection: 'column',
|
|
15
|
-
display: 'flex',
|
|
16
|
-
width: '100%',
|
|
17
|
-
},
|
|
18
|
-
tableContainer: {
|
|
19
|
-
overflow: 'auto',
|
|
20
|
-
display: 'block',
|
|
21
|
-
},
|
|
22
|
-
tableHeader: {
|
|
23
|
-
padding: ' 5px 10px',
|
|
24
|
-
backgroundColor: ' #f8f8f8',
|
|
25
|
-
borderBottom: '1px solid gray',
|
|
26
|
-
fontSize: '1em',
|
|
27
|
-
cursor: 'pointer',
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
function Arrow(props) {
|
|
31
|
-
const { isOpen = true } = props;
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
33
|
-
fontSize: '1.3em',
|
|
34
|
-
transform: `rotate(${isOpen ? 90 : 0}deg)`,
|
|
35
|
-
transformOrigin: '50% 50%',
|
|
36
|
-
display: 'inline-block',
|
|
37
|
-
lineHeight: 1,
|
|
38
|
-
padding: isOpen ? '5px 0 0 0' : '0 5px 0 0',
|
|
39
|
-
verticalAlign: 'middle',
|
|
40
|
-
}, children: "\u2023" }));
|
|
41
|
-
}
|
|
42
|
-
function InformationTable(props) {
|
|
43
|
-
const { data, columns, title, onClick, isOpen = true } = props;
|
|
44
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.tableHeader, onClick: onClick, children: [(0, jsx_runtime_1.jsx)(Arrow, { isOpen: isOpen }), (0, jsx_runtime_1.jsx)("span", { style: { verticalAlign: 'middle', display: 'inline-block' }, children: title })] }), isOpen && ((0, jsx_runtime_1.jsx)(ReactTableFlexLayout_1.default, { data: data, columns: columns, style: { height: 'auto' } }))] }));
|
|
45
|
-
}
|
|
46
|
-
function filter(searchKey, data) {
|
|
47
|
-
const result = [];
|
|
48
|
-
for (const key in data) {
|
|
49
|
-
if (!searchKey || key.toLowerCase().includes(searchKey)) {
|
|
50
|
-
result.push({ key, value: data[key] });
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
const columns = [
|
|
56
|
-
{
|
|
57
|
-
Header: 'Parameter',
|
|
58
|
-
sortType: 'basic',
|
|
59
|
-
minWidth: 100,
|
|
60
|
-
width: 20,
|
|
61
|
-
maxWidth: 20,
|
|
62
|
-
accessor: 'key',
|
|
63
|
-
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)("p", { style: { padding: '5px', backgroundColor: 'white' }, children: row.original.key })),
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
Header: 'Value',
|
|
67
|
-
sortType: 'basic',
|
|
68
|
-
resizable: true,
|
|
69
|
-
accessor: 'value',
|
|
70
|
-
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)("p", { style: {
|
|
71
|
-
backgroundColor: '#efefef',
|
|
72
|
-
height: '100%',
|
|
73
|
-
padding: '5px',
|
|
74
|
-
fontFamily: 'monospace',
|
|
75
|
-
whiteSpace: 'pre',
|
|
76
|
-
overflow: 'hidden',
|
|
77
|
-
}, children: `${row.original.value}` })),
|
|
78
|
-
},
|
|
79
|
-
];
|
|
80
|
-
function InformationPanelInner({ info, meta, customInfo, }) {
|
|
81
|
-
const [searchKey, setSearchKey] = (0, react_1.useState)();
|
|
82
|
-
const [panelsStatus, openPanel] = (0, react_1.useState)({
|
|
83
|
-
info: true,
|
|
84
|
-
meta: true,
|
|
85
|
-
customInfo: true,
|
|
86
|
-
});
|
|
87
|
-
function handleSearch(e) {
|
|
88
|
-
const searchKey = e.target.value.toLowerCase();
|
|
89
|
-
setSearchKey(searchKey);
|
|
90
|
-
}
|
|
91
|
-
const matchesInfo = filter(searchKey, info);
|
|
92
|
-
const matchesMeta = filter(searchKey, meta);
|
|
93
|
-
const matchesMetaInfo = filter(searchKey, customInfo);
|
|
94
|
-
function handleOpen(key) {
|
|
95
|
-
openPanel((prevPanelsStatus) => ({
|
|
96
|
-
...prevPanelsStatus,
|
|
97
|
-
[key]: !prevPanelsStatus[key],
|
|
98
|
-
}));
|
|
99
|
-
}
|
|
100
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Input_1.default, { placeholder: "Search for parameter...", onChange: handleSearch, debounceTime: 250, style: {
|
|
101
|
-
inputWrapper: { width: '100%' },
|
|
102
|
-
input: { textAlign: 'left', padding: '5px' },
|
|
103
|
-
} }) }), (0, jsx_runtime_1.jsxs)("div", { style: styles.tableContainer, children: [(0, jsx_runtime_1.jsx)(InformationTable, { data: matchesMetaInfo, columns: columns, title: "Custom information", onClick: () => handleOpen('customInfo'), isOpen: panelsStatus.customInfo }), (0, jsx_runtime_1.jsx)(InformationTable, { data: matchesInfo, columns: columns, title: "Spectrum information", onClick: () => handleOpen('info'), isOpen: panelsStatus.info }), (0, jsx_runtime_1.jsx)(InformationTable, { data: matchesMeta, columns: columns, title: "Other spectrum parameters", onClick: () => handleOpen('meta'), isOpen: panelsStatus.meta })] })] }));
|
|
104
|
-
}
|
|
105
|
-
const MemoizedInformationPanel = (0, react_1.memo)(InformationPanelInner);
|
|
106
10
|
const emptyData = { info: {}, meta: {} };
|
|
107
11
|
function InformationPanel() {
|
|
108
12
|
const { info, meta, customInfo } = (0, useSpectrum_1.default)(emptyData);
|
|
109
|
-
|
|
13
|
+
const data = (0, react_1.useMemo)(() => [
|
|
14
|
+
{ description: 'Custom information', data: customInfo || {} },
|
|
15
|
+
{ description: 'Spectrum information', data: info || {} },
|
|
16
|
+
{ description: 'Other spectrum parameters', data: meta || {} },
|
|
17
|
+
], [customInfo, info, meta]);
|
|
18
|
+
return (0, jsx_runtime_1.jsx)(ui_1.InfoPanel, { data: data, title: "" });
|
|
110
19
|
}
|
|
111
20
|
exports.default = InformationPanel;
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
@@ -18,7 +41,7 @@ const Modal_1 = require("../../elements/popup/Modal");
|
|
|
18
41
|
const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
|
|
19
42
|
const ChangeSumModal_1 = __importDefault(require("../../modal/changeSum/ChangeSumModal"));
|
|
20
43
|
const BasicPanelStyle_1 = require("../extra/BasicPanelStyle");
|
|
21
|
-
const DefaultPanelHeader_1 =
|
|
44
|
+
const DefaultPanelHeader_1 = __importStar(require("../header/DefaultPanelHeader"));
|
|
22
45
|
const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader"));
|
|
23
46
|
const IntegralTable_1 = __importDefault(require("./IntegralTable"));
|
|
24
47
|
const IntegralsPreferences_1 = __importDefault(require("./IntegralsPreferences"));
|
|
@@ -48,16 +71,10 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
48
71
|
}, [modal, yesHandler]);
|
|
49
72
|
const changeIntegralSumHandler = (0, react_2.useCallback)((options) => {
|
|
50
73
|
dispatch({ type: 'CHANGE_INTEGRAL_SUM', payload: { options } });
|
|
51
|
-
|
|
52
|
-
}, [dispatch, modal]);
|
|
74
|
+
}, [dispatch]);
|
|
53
75
|
const currentSum = (0, react_2.useMemo)(() => {
|
|
54
76
|
return (0, get_1.default)(integrals, 'options.sum', null);
|
|
55
77
|
}, [integrals]);
|
|
56
|
-
const showChangeIntegralSumModal = (0, react_2.useCallback)(() => {
|
|
57
|
-
modal.show((0, jsx_runtime_1.jsx)(ChangeSumModal_1.default, { onClose: () => modal.close(), onSave: changeIntegralSumHandler, header: currentSum
|
|
58
|
-
? `Set new integrals Sum (Current: ${Number(currentSum).toFixed(2)})`
|
|
59
|
-
: 'Set new integrals Sum', sumOptions: integrals?.options }));
|
|
60
|
-
}, [changeIntegralSumHandler, currentSum, integrals?.options, modal]);
|
|
61
78
|
const settingsPanelHandler = (0, react_2.useCallback)(() => {
|
|
62
79
|
setFlipStatus(!isFlipped);
|
|
63
80
|
}, [isFlipped]);
|
|
@@ -92,6 +109,7 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
92
109
|
}
|
|
93
110
|
return [];
|
|
94
111
|
}, [filterIsActive, info.dimension, integrals, xDomain]);
|
|
112
|
+
const counter = integrals?.values?.length || 0;
|
|
95
113
|
return ((0, jsx_runtime_1.jsxs)("div", { css: [
|
|
96
114
|
BasicPanelStyle_1.tablePanelStyle,
|
|
97
115
|
style,
|
|
@@ -101,9 +119,9 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
101
119
|
position: relative;
|
|
102
120
|
}
|
|
103
121
|
`,
|
|
104
|
-
], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter:
|
|
105
|
-
? `Change
|
|
106
|
-
: 'Change
|
|
122
|
+
], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: counter, counterLabel: (0, DefaultPanelHeader_1.createFilterLabel)(counter, filterIsActive && filteredData?.length), onDelete: handleDeleteAll, deleteToolTip: "Delete All Integrals", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all integrals' : 'Hide integrals out of view', showSettingButton: true, onSettingClick: settingsPanelHandler, children: [(0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: currentSum
|
|
123
|
+
? `Change integration sum (${currentSum.toFixed(2)})`
|
|
124
|
+
: 'Change integration sum', popupPlacement: "right", children: (0, jsx_runtime_1.jsx)(ChangeSumModal_1.default, { onSave: changeIntegralSumHandler, sumType: "integrals", currentSum: currentSum, sumOptions: integrals?.options, renderButton: (onClick) => ((0, jsx_runtime_1.jsx)("button", { className: "sum-button", type: "button", onClick: onClick, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) })) }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { className: "icon", popupTitle: "Fixed integration values", popupPlacement: "right", onClick: toggleConstantSumHandler, value: integrals?.options?.isSumConstant || false, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(IntegralTable_1.default, { data: filteredData, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(IntegralsPreferences_1.default, { ref: settingRef })) })] }));
|
|
107
125
|
}
|
|
108
126
|
const MemoizedIntegralPanel = (0, react_2.memo)(IntegralPanelInner);
|
|
109
127
|
const emptyData = { integrals: {}, info: {} };
|
|
@@ -92,7 +92,7 @@ function IntegralTable({ activeTab, data }) {
|
|
|
92
92
|
const value = (0, formatNumber_1.formatNumber)(row.original.integral || 0, integralsPreferences.relative.format);
|
|
93
93
|
const flag = (0, Spectrum1D_1.checkIntegralKind)(row.original);
|
|
94
94
|
const integral = flag ? value : `[ ${value} ]`;
|
|
95
|
-
return ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: integral, onSave: (event) => saveRelativeHandler(event, row.original), type: "number" }));
|
|
95
|
+
return ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: integral, onSave: (event) => saveRelativeHandler(event, row.original), type: "number", validate: (val) => val !== '' }));
|
|
96
96
|
},
|
|
97
97
|
},
|
|
98
98
|
{
|
|
@@ -52,7 +52,7 @@ function MoleculePanelInner(props) {
|
|
|
52
52
|
const [currentIndex, setCurrentIndex] = (0, react_2.useState)(0);
|
|
53
53
|
const [molecules, setMolecules] = (0, react_2.useState)([]);
|
|
54
54
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
55
|
-
const openMoleculeEditor = (0, MoleculeStructureEditorModal_1.useMoleculeEditor)();
|
|
55
|
+
const { modal, openMoleculeEditor } = (0, MoleculeStructureEditorModal_1.useMoleculeEditor)();
|
|
56
56
|
const { currentDiaIDsToHighlight, handleOnAtomHover, handleOnClickAtom, assignedDiaIDsMerged, } = (0, useAtomAssignment_1.default)({ zones, ranges, activeTab, displayerMode });
|
|
57
57
|
(0, react_2.useEffect)(() => {
|
|
58
58
|
if (moleculesProp) {
|
|
@@ -84,7 +84,7 @@ function MoleculePanelInner(props) {
|
|
|
84
84
|
currentDiaIDsToHighlight.length > 0
|
|
85
85
|
? currentDiaIDsToHighlight
|
|
86
86
|
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover, showAtomNumber: moleculesView?.[mol.id]?.showAtomNumber || false }) })] }, mol.id)))) : ((0, jsx_runtime_1.jsx)("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditor(), children: (0, jsx_runtime_1.jsx)("span", { children: "Click to draw molecule" }) })) }));
|
|
87
|
-
} }) }) })] }));
|
|
87
|
+
} }) }) }), modal] }));
|
|
88
88
|
}
|
|
89
89
|
const MemoizedMoleculePanel = (0, react_2.memo)(MoleculePanelInner);
|
|
90
90
|
const emptyData = { ranges: {}, zones: {} };
|
|
@@ -27,7 +27,7 @@ const styles = {
|
|
|
27
27
|
margin: 0,
|
|
28
28
|
textAlign: 'right',
|
|
29
29
|
lineHeight: '22px',
|
|
30
|
-
padding: '0
|
|
30
|
+
padding: '0 5px',
|
|
31
31
|
whiteSpace: 'nowrap',
|
|
32
32
|
},
|
|
33
33
|
atomLabel: {
|
|
@@ -165,8 +165,6 @@ function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMolecul
|
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
const hasMolecules = molecules && molecules.length > 0;
|
|
168
|
-
return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { children: [renderSource === 'predictionPanel' && (0, jsx_runtime_1.jsx)(AboutPredictionModal_1.default, {}), renderSource === 'moleculePanel' && ((0, jsx_runtime_1.jsx)(ui_1.DropdownMenu, { trigger: "click", options: MOL_EXPORT_MENU, onSelect: exportHandler, children: (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { as: "div", disabled: !hasMolecules, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Export As", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }) })), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: handlePasteMolfileAction, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Paste molfile", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaPaste, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: onOpenMoleculeEditor, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Add molecule", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }), renderSource === 'moleculePanel' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: handleDelete, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Delete molecule", tooltipOrientation: "horizontal", disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }), hasMolecules && ((0, jsx_runtime_1.jsx)(PredictSpectraModal_1.default, { molecule: molecules[currentIndex] }))] })), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { value: moleculesView?.[moleculeKey]?.floating.visible || false, popupTitle: "Float molecule", popupPlacement: "left", onClick: floatMoleculeHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(io5_1.IoOpenOutline, {}) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px' }, value: moleculesView?.[moleculeKey]?.showAtomNumber || false, popupTitle: "Show atom number", popupPlacement: "left", onClick: showAtomNumbersHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)("p", { style: styles.atomLabel, children: "#" }) }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 }, children: children }), (0, jsx_runtime_1.
|
|
169
|
-
molecules.length > 0 &&
|
|
170
|
-
`${+(currentIndex + 1)} / ${molecules.length}`, ' '] }), onClickPreferences && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'black' }, onClick: onClickPreferences, toolTip: "Preferences", tooltipOrientation: "vertical", children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) })), (0, jsx_runtime_1.jsx)(clipboardComponents_1.ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePasteMolfile, text: text, label: "Molfile" })] }));
|
|
168
|
+
return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { children: [renderSource === 'predictionPanel' && (0, jsx_runtime_1.jsx)(AboutPredictionModal_1.default, {}), renderSource === 'moleculePanel' && ((0, jsx_runtime_1.jsx)(ui_1.DropdownMenu, { trigger: "click", options: MOL_EXPORT_MENU, onSelect: exportHandler, children: (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { as: "div", disabled: !hasMolecules, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Export As", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }) })), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: handlePasteMolfileAction, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Paste molfile", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaPaste, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: onOpenMoleculeEditor, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Add molecule", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }), renderSource === 'moleculePanel' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: handleDelete, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Delete molecule", tooltipOrientation: "horizontal", disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }), hasMolecules && ((0, jsx_runtime_1.jsx)(PredictSpectraModal_1.default, { molecule: molecules[currentIndex] }))] })), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { value: moleculesView?.[moleculeKey]?.floating.visible || false, popupTitle: "Float molecule", popupPlacement: "left", onClick: floatMoleculeHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(io5_1.IoOpenOutline, {}) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px' }, value: moleculesView?.[moleculeKey]?.showAtomNumber || false, popupTitle: "Show atom number", popupPlacement: "left", onClick: showAtomNumbersHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)("p", { style: styles.atomLabel, children: "#" }) }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 }, children: children }), molecules && molecules.length > 0 && ((0, jsx_runtime_1.jsx)("p", { style: styles.counter, children: `${+(currentIndex + 1)} / ${molecules.length}` })), onClickPreferences && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'black' }, onClick: onClickPreferences, toolTip: "Preferences", tooltipOrientation: "vertical", children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) })), (0, jsx_runtime_1.jsx)(clipboardComponents_1.ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePasteMolfile, text: text, label: "Molfile" })] }));
|
|
171
169
|
}
|
|
172
170
|
exports.default = MoleculePanelHeader;
|
|
@@ -13,31 +13,35 @@ function getElements(activeTab) {
|
|
|
13
13
|
* In case of an heavy atom with bonded hydrogens the OCL id(s)
|
|
14
14
|
* and number of these hydrogens are added as well.
|
|
15
15
|
*
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {DiaIDAndInfo} diaIDAndInfo - atom returned by OCLnmr component
|
|
17
17
|
* @param {string} activeTab - active tab
|
|
18
18
|
* @param {Axis} axis - current axis
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
|
-
function extractFromAtom(
|
|
21
|
+
function extractFromAtom(diaIDAndInfo, activeTab, axis) {
|
|
22
22
|
const elements = getElements(activeTab);
|
|
23
|
-
if (elements && elements.length > 0 &&
|
|
23
|
+
if (elements && elements.length > 0 && diaIDAndInfo) {
|
|
24
24
|
const dim = axis === 'x' ? 0 : axis === 'y' ? 1 : null;
|
|
25
25
|
switch (dim !== null && elements[dim]) {
|
|
26
|
-
case
|
|
26
|
+
case diaIDAndInfo.atomLabel: {
|
|
27
27
|
// take always oclID if atom type is same as element of activeTab)
|
|
28
|
-
return {
|
|
28
|
+
return {
|
|
29
|
+
oclIDs: [diaIDAndInfo.idCode],
|
|
30
|
+
nbAtoms: diaIDAndInfo.nbEquivalentAtoms,
|
|
31
|
+
};
|
|
29
32
|
}
|
|
30
33
|
case 'H': {
|
|
31
34
|
// if we are in proton spectrum and use then the IDs of attached hydrogens of an atom
|
|
32
35
|
return {
|
|
33
|
-
oclIDs:
|
|
34
|
-
nbAtoms:
|
|
36
|
+
oclIDs: diaIDAndInfo.attachedHydrogensIDCodes,
|
|
37
|
+
nbAtoms: diaIDAndInfo.nbEquivalentAtoms * diaIDAndInfo.nbAttachedHydrogens,
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
40
|
default:
|
|
38
41
|
return {
|
|
39
|
-
oclIDs: [
|
|
40
|
-
nbAtoms:
|
|
42
|
+
oclIDs: [diaIDAndInfo.idCode].concat(diaIDAndInfo.attachedHydrogensIDCodes),
|
|
43
|
+
nbAtoms: diaIDAndInfo.nbEquivalentAtoms +
|
|
44
|
+
diaIDAndInfo.nbEquivalentAtoms * diaIDAndInfo.nbAttachedHydrogens,
|
|
41
45
|
};
|
|
42
46
|
}
|
|
43
47
|
}
|
|
@@ -87,7 +91,7 @@ function getCurrentDiaIDsToHighlight(assignmentData) {
|
|
|
87
91
|
const { highlighted, assignments } = assignmentData.data;
|
|
88
92
|
const assignment = highlighted ? assignments[highlighted.id] : null;
|
|
89
93
|
const axisHover = highlighted ? highlighted.axis : null;
|
|
90
|
-
if (axisHover && assignment
|
|
94
|
+
if (axisHover && assignment?.[axisHover]) {
|
|
91
95
|
return assignment[axisHover];
|
|
92
96
|
}
|
|
93
97
|
else {
|
|
@@ -11,7 +11,6 @@ const filterForIDsWithAssignment_1 = require("../../assignment/utilities/filterF
|
|
|
11
11
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
12
12
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
13
13
|
const highlight_1 = require("../../highlight");
|
|
14
|
-
const Constants_1 = require("../../reducer/core/Constants");
|
|
15
14
|
const Utilities_1 = require("./Utilities");
|
|
16
15
|
function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }) {
|
|
17
16
|
const alert = (0, Alert_1.useAlert)();
|
|
@@ -46,10 +45,10 @@ function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }
|
|
|
46
45
|
}, [onAtomHoverAction, onAtomHoverHighlights, highlightData]);
|
|
47
46
|
const data = (0, react_1.useMemo)(() => {
|
|
48
47
|
if (zones || ranges) {
|
|
49
|
-
if (displayerMode ===
|
|
48
|
+
if (displayerMode === '1D' && ranges?.values) {
|
|
50
49
|
return ranges.values;
|
|
51
50
|
}
|
|
52
|
-
else if (displayerMode ===
|
|
51
|
+
else if (displayerMode === '2D' && zones?.values) {
|
|
53
52
|
return zones.values;
|
|
54
53
|
}
|
|
55
54
|
}
|
|
@@ -105,14 +104,14 @@ function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }
|
|
|
105
104
|
// see revision cc13abc18f77b6787b923e3c4edaef51750d9e90
|
|
106
105
|
return (0, Utilities_1.toggleDiaIDs)(diaID, atomInformation);
|
|
107
106
|
}, []);
|
|
108
|
-
const handleOnClickAtom = (0, react_1.useCallback)((
|
|
107
|
+
const handleOnClickAtom = (0, react_1.useCallback)((diaIDAndInfo, event) => {
|
|
109
108
|
if (!(0, checkModifierKeyActivated_1.default)(event) && activeAssignment.activated) {
|
|
110
109
|
const { axis, id } = activeAssignment.activated;
|
|
111
110
|
if (id && axis) {
|
|
112
|
-
const atomInformation = (0, Utilities_1.extractFromAtom)(
|
|
111
|
+
const atomInformation = (0, Utilities_1.extractFromAtom)(diaIDAndInfo, nucleus, axis);
|
|
113
112
|
if (atomInformation.nbAtoms > 0) {
|
|
114
113
|
// save assignment in assignment hook
|
|
115
|
-
const dimension = displayerMode ===
|
|
114
|
+
const dimension = displayerMode === '1D' ? '1D' : '2D';
|
|
116
115
|
activeAssignment.toggle(atomInformation.oclIDs, dimension);
|
|
117
116
|
// save assignment (diaIDs) in range/zone data
|
|
118
117
|
const { datum, signalIndex } = (0, Utilities_1.findDatumAndSignalIndex)(data, activeAssignment.id);
|
|
@@ -120,7 +119,7 @@ function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }
|
|
|
120
119
|
// determine the level of setting the diaIDs array (range vs. signal level) and save there
|
|
121
120
|
// let nbAtoms = 0;
|
|
122
121
|
// on range/zone level
|
|
123
|
-
if (displayerMode ===
|
|
122
|
+
if (displayerMode === '1D') {
|
|
124
123
|
const range = datum;
|
|
125
124
|
let _diaIDs = [];
|
|
126
125
|
if (signalIndex === undefined) {
|
|
@@ -178,8 +177,8 @@ function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }
|
|
|
178
177
|
nucleus,
|
|
179
178
|
toggleAssignment,
|
|
180
179
|
]);
|
|
181
|
-
const handleOnAtomHover = (0, react_1.useCallback)((
|
|
182
|
-
const { oclIDs } = (0, Utilities_1.extractFromAtom)(
|
|
180
|
+
const handleOnAtomHover = (0, react_1.useCallback)((diaIDAndInfo) => {
|
|
181
|
+
const { oclIDs } = (0, Utilities_1.extractFromAtom)(diaIDAndInfo, nucleus);
|
|
183
182
|
// on enter the atom
|
|
184
183
|
if (oclIDs.length > 0) {
|
|
185
184
|
// set all IDs to highlight when hovering over an atom from assignment data
|
package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js
CHANGED
|
@@ -27,7 +27,7 @@ const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHead
|
|
|
27
27
|
const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader"));
|
|
28
28
|
const MultipleSpectraAnalysisTable_1 = __importDefault(require("./MultipleSpectraAnalysisTable"));
|
|
29
29
|
const preferences_1 = __importDefault(require("./preferences"));
|
|
30
|
-
function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, }) {
|
|
30
|
+
function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, displayerMode, }) {
|
|
31
31
|
const [isFlipped, setFlipStatus] = (0, react_2.useState)(false);
|
|
32
32
|
const spectraPreferences = (0, usePanelPreferences_1.usePanelPreferences)('spectra', activeTab);
|
|
33
33
|
const preferences = (0, usePanelPreferences_1.usePanelPreferences)('multipleSpectraAnalysis', activeTab);
|
|
@@ -71,15 +71,15 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, })
|
|
|
71
71
|
position: relative;
|
|
72
72
|
}
|
|
73
73
|
`,
|
|
74
|
-
], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { deleteToolTip: "Delete All Peaks", showSettingButton: true, canDelete: false, onSettingClick: settingsPanelHandler, children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Copy To Clipboard", onClick: copyToClipboardHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Spectra calibration", onClick: openAlignSpectra, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrOverlay, { style: { fontSize: '18px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: "Y spectra tracker", popupPlacement: "right", onClick: showTrackerHandler, defaultValue: showLegend, children: (0, jsx_runtime_1.jsx)(io5_1.IoPulseOutline, {}) }, `${showLegend}`)] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(MultipleSpectraAnalysisTable_1.default, { data: spectraAnalysis, resortSpectra: preferences.analysisOptions.resortSpectra, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(preferences_1.default, { data: spectraAnalysis, activeTab: activeTab, onAfterSave: afterSaveHandler, ref: settingRef })) }), (0, jsx_runtime_1.jsx)(clipboardComponents_1.ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Spectra Analysis" })] }));
|
|
74
|
+
], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { deleteToolTip: "Delete All Peaks", showSettingButton: true, canDelete: false, onSettingClick: settingsPanelHandler, children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Copy To Clipboard", onClick: copyToClipboardHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }), displayerMode === '1D' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Spectra calibration", onClick: openAlignSpectra, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrOverlay, { style: { fontSize: '18px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: "Y spectra tracker", popupPlacement: "right", onClick: showTrackerHandler, defaultValue: showLegend, children: (0, jsx_runtime_1.jsx)(io5_1.IoPulseOutline, {}) }, `${showLegend}`)] }))] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(MultipleSpectraAnalysisTable_1.default, { data: spectraAnalysis, resortSpectra: preferences.analysisOptions.resortSpectra, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(preferences_1.default, { data: spectraAnalysis, activeTab: activeTab, onAfterSave: afterSaveHandler, ref: settingRef })) }), (0, jsx_runtime_1.jsx)(clipboardComponents_1.ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Spectra Analysis" })] }));
|
|
75
75
|
}
|
|
76
76
|
const MemoizedMultipleSpectraAnalysisPanel = (0, react_2.memo)(MultipleSpectraAnalysisPanelInner);
|
|
77
77
|
function MultipleSpectraAnalysisPanel() {
|
|
78
|
-
const { data, view: { spectra: { activeTab, showLegend }, }, displayerKey, } = (0, ChartContext_1.useChartData)();
|
|
78
|
+
const { data, view: { spectra: { activeTab, showLegend }, }, displayerKey, displayerMode, } = (0, ChartContext_1.useChartData)();
|
|
79
79
|
const spectra = (0, getSpectraByNucleus_1.getSpectraByNucleus)(activeTab, data);
|
|
80
80
|
if (!activeTab) {
|
|
81
81
|
return (0, jsx_runtime_1.jsx)("div", {});
|
|
82
82
|
}
|
|
83
|
-
return ((0, jsx_runtime_1.jsx)(MemoizedMultipleSpectraAnalysisPanel, { activeTab, displayerKey, spectra, showLegend }));
|
|
83
|
+
return ((0, jsx_runtime_1.jsx)(MemoizedMultipleSpectraAnalysisPanel, { activeTab, displayerMode, displayerKey, spectra, showLegend }));
|
|
84
84
|
}
|
|
85
85
|
exports.default = MultipleSpectraAnalysisPanel;
|
|
@@ -11,7 +11,6 @@ const ui_1 = require("react-science/ui");
|
|
|
11
11
|
const ChartContext_1 = require("../context/ChartContext");
|
|
12
12
|
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
13
13
|
const useCheckExperimentalFeature_1 = __importDefault(require("../hooks/useCheckExperimentalFeature"));
|
|
14
|
-
const Constants_1 = require("../reducer/core/Constants");
|
|
15
14
|
const AutomaticAssignment_1 = __importDefault(require("./AutomaticAssignment/AutomaticAssignment"));
|
|
16
15
|
const InformationPanel_1 = __importDefault(require("./InformationPanel"));
|
|
17
16
|
const IntegralPanel_1 = __importDefault(require("./IntegralsPanel/IntegralPanel"));
|
|
@@ -45,7 +44,7 @@ const accordionItems = [
|
|
|
45
44
|
title: 'Peaks',
|
|
46
45
|
component: (0, jsx_runtime_1.jsx)(PeaksPanel_1.default, {}),
|
|
47
46
|
hidePreferenceKey: 'peaksPanel',
|
|
48
|
-
mode:
|
|
47
|
+
mode: '1D',
|
|
49
48
|
},
|
|
50
49
|
{
|
|
51
50
|
title: 'Processings',
|
|
@@ -57,13 +56,13 @@ const accordionItems = [
|
|
|
57
56
|
title: 'Integrals',
|
|
58
57
|
component: (0, jsx_runtime_1.jsx)(IntegralPanel_1.default, {}),
|
|
59
58
|
hidePreferenceKey: 'integralsPanel',
|
|
60
|
-
mode:
|
|
59
|
+
mode: '1D',
|
|
61
60
|
},
|
|
62
61
|
{
|
|
63
62
|
title: 'Ranges',
|
|
64
63
|
component: (0, jsx_runtime_1.jsx)(RangesPanel_1.default, {}),
|
|
65
64
|
hidePreferenceKey: 'rangesPanel',
|
|
66
|
-
mode:
|
|
65
|
+
mode: '1D',
|
|
67
66
|
},
|
|
68
67
|
{
|
|
69
68
|
title: 'Multiple Spectra Analysis',
|
|
@@ -75,13 +74,13 @@ const accordionItems = [
|
|
|
75
74
|
title: 'Matrix Generation',
|
|
76
75
|
component: (0, jsx_runtime_1.jsx)(MatrixGenerationPanel_1.default, {}),
|
|
77
76
|
hidePreferenceKey: 'matrixGenerationPanel',
|
|
78
|
-
mode:
|
|
77
|
+
mode: '1D',
|
|
79
78
|
},
|
|
80
79
|
{
|
|
81
80
|
title: 'Zones',
|
|
82
81
|
component: (0, jsx_runtime_1.jsx)(ZonesPanel_1.default, {}),
|
|
83
82
|
hidePreferenceKey: 'zonesPanel',
|
|
84
|
-
mode:
|
|
83
|
+
mode: '2D',
|
|
85
84
|
},
|
|
86
85
|
{
|
|
87
86
|
title: 'Summary',
|
|
@@ -117,7 +116,7 @@ const accordionItems = [
|
|
|
117
116
|
title: 'Spectrum Simulation',
|
|
118
117
|
component: (0, jsx_runtime_1.jsx)(SpectrumSimulation_1.default, {}),
|
|
119
118
|
hidePreferenceKey: 'simulationPanel',
|
|
120
|
-
mode:
|
|
119
|
+
mode: '1D',
|
|
121
120
|
},
|
|
122
121
|
];
|
|
123
122
|
exports.TOOLS_PANELS_ACCORDION = {
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
@@ -23,7 +46,7 @@ const useCheckExperimentalFeature_1 = __importDefault(require("../../hooks/useCh
|
|
|
23
46
|
const useFormatNumberByNucleus_1 = require("../../hooks/useFormatNumberByNucleus");
|
|
24
47
|
const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
|
|
25
48
|
const BasicPanelStyle_1 = require("../extra/BasicPanelStyle");
|
|
26
|
-
const DefaultPanelHeader_1 =
|
|
49
|
+
const DefaultPanelHeader_1 = __importStar(require("../header/DefaultPanelHeader"));
|
|
27
50
|
const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader"));
|
|
28
51
|
const PeaksPreferences_1 = __importDefault(require("./PeaksPreferences"));
|
|
29
52
|
const PeaksTable_1 = __importDefault(require("./PeaksTable"));
|
|
@@ -91,6 +114,10 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
|
|
|
91
114
|
function toggleViewProperty(key) {
|
|
92
115
|
dispatch({ type: 'TOGGLE_PEAKS_VIEW_PROPERTY', payload: { key } });
|
|
93
116
|
}
|
|
117
|
+
function toggleDisplayingMode() {
|
|
118
|
+
dispatch({ type: 'TOGGLE_PEAKS_DISPLAYING_MODE' });
|
|
119
|
+
}
|
|
120
|
+
const counter = peaks?.values?.length || 0;
|
|
94
121
|
return ((0, jsx_runtime_1.jsxs)("div", { css: [
|
|
95
122
|
BasicPanelStyle_1.tablePanelStyle,
|
|
96
123
|
isFlipped &&
|
|
@@ -102,11 +129,13 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
|
|
|
102
129
|
}
|
|
103
130
|
}
|
|
104
131
|
`,
|
|
105
|
-
], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter:
|
|
132
|
+
], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: counter, counterLabel: (0, DefaultPanelHeader_1.createFilterLabel)(counter, filterIsActive && filteredPeaks?.length), onDelete: handleDeleteAll, deleteToolTip: "Delete All Peaks", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all peaks' : 'Hide peaks out of view', showSettingButton: true, onSettingClick: settingsPanelHandler, children: [isExperimental && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.showPeaksShapes
|
|
106
133
|
? 'Hide peaks shapes'
|
|
107
134
|
: 'Show peaks shapes', popupPlacement: "right", onClick: () => toggleViewProperty('showPeaksShapes'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.showPeaksShapes, children: (0, jsx_runtime_1.jsx)(Peaks_1.default, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.showPeaksSum
|
|
108
135
|
? 'Hide peaks sum'
|
|
109
|
-
: 'Show peaks sum', popupPlacement: "right", onClick: () => toggleViewProperty('showPeaksSum'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.showPeaksSum, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrFt, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: optimizePeaksHandler, toolTip: "Optimize peaks", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaThinkPeaks, {}) })] })), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.isPeaksVisible ? 'Hide peaks' : 'Show peaks', popupPlacement: "right", onClick: () => toggleViewProperty('isPeaksVisible'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.isPeaksVisible, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPeaks, { style: { pointerEvents: 'none', fontSize: '12px' } }) })
|
|
136
|
+
: 'Show peaks sum', popupPlacement: "right", onClick: () => toggleViewProperty('showPeaksSum'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.showPeaksSum, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrFt, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: optimizePeaksHandler, toolTip: "Optimize peaks", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaThinkPeaks, {}) })] })), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.isPeaksVisible ? 'Hide peaks' : 'Show peaks', popupPlacement: "right", onClick: () => toggleViewProperty('isPeaksVisible'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.isPeaksVisible, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPeaks, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.displayingMode === 'spread'
|
|
137
|
+
? 'Single Mode'
|
|
138
|
+
: 'Spread mode', popupPlacement: "right", onClick: toggleDisplayingMode, disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.displayingMode === 'spread', children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPeaksTopLabels, { style: { pointerEvents: 'none', fontSize: '12px' } }) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(PeaksTable_1.default, { data: filteredPeaks, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(PeaksPreferences_1.default, { ref: settingRef })) })] }));
|
|
110
139
|
}
|
|
111
140
|
const MemoizedPeaksPanel = (0, react_2.memo)(PeaksPanelInner);
|
|
112
141
|
const emptyData = { peaks: null, info: {} };
|
|
@@ -59,7 +59,7 @@ function PeaksTable({ activeTab, data }) {
|
|
|
59
59
|
index: 3,
|
|
60
60
|
Header: 'δ (ppm)',
|
|
61
61
|
accessor: 'x',
|
|
62
|
-
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: (0, formatNumber_1.formatNumber)(row.original.x, peaksPreferences.deltaPPM.format), onSave: (event) => saveDeltaPPMRefsHandler(event, row.original), type: "number" })),
|
|
62
|
+
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: (0, formatNumber_1.formatNumber)(row.original.x, peaksPreferences.deltaPPM.format), onSave: (event) => saveDeltaPPMRefsHandler(event, row.original), type: "number", validate: (val) => val !== '' })),
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
showWhen: 'deltaHz.show',
|