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
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import debounce from 'lodash/debounce';
|
|
3
|
-
import {
|
|
3
|
+
import { useEffect, useRef, forwardRef, useMemo, useState, } from 'react';
|
|
4
4
|
import useCombinedRefs from '../hooks/useCombinedRefs';
|
|
5
5
|
const styles = {
|
|
6
|
-
label: {
|
|
7
|
-
lineHeight: 2,
|
|
8
|
-
userSelect: 'none',
|
|
9
|
-
},
|
|
10
6
|
inputWrapper: {
|
|
11
7
|
borderRadius: '5px',
|
|
12
8
|
borderWidth: '0.55px',
|
|
@@ -21,7 +17,6 @@ const styles = {
|
|
|
21
17
|
outline: 'none',
|
|
22
18
|
flex: 1,
|
|
23
19
|
height: '100%',
|
|
24
|
-
textAlign: 'center',
|
|
25
20
|
width: '100%',
|
|
26
21
|
},
|
|
27
22
|
clearButton: {
|
|
@@ -34,103 +29,56 @@ const styles = {
|
|
|
34
29
|
padding: 0,
|
|
35
30
|
},
|
|
36
31
|
};
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
const pattern = /^(?:-?\d*|\d+)(?:\.\d{0,20})?$/;
|
|
40
|
-
if (value.trim() === '' || pattern.test(value)) {
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
function identity(value) {
|
|
48
|
-
return value;
|
|
49
|
-
}
|
|
50
|
-
function preventPropagate(event) {
|
|
51
|
-
event.stopPropagation();
|
|
32
|
+
function mapValue(value) {
|
|
33
|
+
return typeof value === 'number' && value === 0 ? value : value || '';
|
|
52
34
|
}
|
|
53
35
|
const Input = forwardRef((props, ref) => {
|
|
54
|
-
const { value =
|
|
36
|
+
const { value: externalValue = undefined, name, style = {
|
|
55
37
|
input: {},
|
|
56
38
|
inputWrapper: {},
|
|
57
|
-
}, onChange
|
|
58
|
-
const [
|
|
59
|
-
const
|
|
39
|
+
}, onChange, checkValue = () => true, type = 'text', autoSelect = false, className, renderIcon, canClear = false, onClear, datalist = [], debounceTime = 0, ...otherProps } = props;
|
|
40
|
+
const [internalValue, setInternalValue] = useState();
|
|
41
|
+
const value = debounceTime ? internalValue : externalValue;
|
|
60
42
|
const localRef = useRef();
|
|
61
43
|
const combinedRef = useCombinedRefs([ref, localRef]);
|
|
62
|
-
const debounceOnChange = useMemo(() => debounce((
|
|
63
|
-
onChange?.(
|
|
44
|
+
const debounceOnChange = useMemo(() => debounce((e) => {
|
|
45
|
+
onChange?.(e);
|
|
64
46
|
}, debounceTime), [debounceTime, onChange]);
|
|
65
47
|
useEffect(() => {
|
|
66
|
-
|
|
67
|
-
}, [value]);
|
|
68
|
-
useEffect(() => {
|
|
69
|
-
if (enableAutoSelect) {
|
|
48
|
+
if (autoSelect) {
|
|
70
49
|
combinedRef?.current?.select();
|
|
71
50
|
}
|
|
72
|
-
}, [
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
? null
|
|
79
|
-
: Number(value)
|
|
80
|
-
: nullable && !value
|
|
81
|
-
? null
|
|
82
|
-
: value;
|
|
83
|
-
return format()(val);
|
|
84
|
-
}
|
|
51
|
+
}, [autoSelect, combinedRef]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (debounceTime) {
|
|
54
|
+
setInternalValue(externalValue);
|
|
55
|
+
}
|
|
56
|
+
}, [debounceTime, externalValue]);
|
|
85
57
|
function onChangeHandler(e) {
|
|
86
58
|
e.stopPropagation();
|
|
87
59
|
e.preventDefault();
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
const formatValue = format();
|
|
91
|
-
setVal(formatValue(_value));
|
|
92
|
-
valueRef.current = _value;
|
|
93
|
-
const val = {
|
|
94
|
-
...e,
|
|
95
|
-
target: { name: e.target.name, value: getValue(_value) },
|
|
96
|
-
};
|
|
60
|
+
const val = e.target.value;
|
|
61
|
+
if (checkValue(val)) {
|
|
97
62
|
if (debounceTime) {
|
|
98
|
-
|
|
63
|
+
setInternalValue(val);
|
|
64
|
+
debounceOnChange(e);
|
|
99
65
|
}
|
|
100
66
|
else {
|
|
101
|
-
onChange?.(
|
|
67
|
+
onChange?.(e);
|
|
102
68
|
}
|
|
103
69
|
}
|
|
104
70
|
}
|
|
105
|
-
function handleKeyDown(event) {
|
|
106
|
-
onKeyDown({
|
|
107
|
-
...event,
|
|
108
|
-
target: {
|
|
109
|
-
name: event.target.name,
|
|
110
|
-
value: getValue(valueRef.current),
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
function handleKeyUp(event) {
|
|
115
|
-
onKeyUp({
|
|
116
|
-
...event,
|
|
117
|
-
target: {
|
|
118
|
-
name: event.target.name,
|
|
119
|
-
value: getValue(valueRef.current),
|
|
120
|
-
},
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
71
|
function clearHandler() {
|
|
124
|
-
|
|
72
|
+
localRef.current?.setAttribute('value', '');
|
|
125
73
|
onClear?.();
|
|
126
74
|
}
|
|
127
75
|
return (_jsxs("div", { style: {
|
|
128
|
-
...(renderIcon ||
|
|
76
|
+
...((renderIcon || canClear) && { padding: '0 5px' }),
|
|
129
77
|
...styles.inputWrapper,
|
|
130
78
|
...style?.inputWrapper,
|
|
131
79
|
}, className: `input ${className || ''}`, children: [renderIcon?.(), _jsx("input", { ...otherProps, ref: combinedRef, name: name, style: {
|
|
132
80
|
...styles.input,
|
|
133
81
|
...style?.input,
|
|
134
|
-
}, type:
|
|
82
|
+
}, type: type, value: mapValue(value), onChange: onChangeHandler, list: `${name || ''}-data-list` }), canClear && value && (_jsx("button", { type: "button", style: styles.clearButton, onClick: clearHandler, children: _jsx("span", { style: { display: 'block', margin: '0 auto' }, children: "\u2715" }) })), _jsx("datalist", { id: `${name || ''}-data-list`, children: datalist.map((value) => (_jsx("option", { value: value }, value))) })] }));
|
|
135
83
|
});
|
|
136
84
|
export default Input;
|
|
@@ -24,7 +24,6 @@ export const messagesColorPalettes = {
|
|
|
24
24
|
function Message(props) {
|
|
25
25
|
const { style = {}, type, children } = props;
|
|
26
26
|
return (_jsx("div", { style: {
|
|
27
|
-
fontSize: '1rem',
|
|
28
27
|
padding: '0.375rem 0.75rem',
|
|
29
28
|
borderRadius: '0.25rem',
|
|
30
29
|
backgroundColor: messagesColorPalettes[type].tint,
|
|
@@ -7,6 +7,7 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
7
7
|
max?: any;
|
|
8
8
|
value?: number;
|
|
9
9
|
style?: CSSProperties;
|
|
10
|
+
autoSelect?: boolean;
|
|
10
11
|
}
|
|
11
12
|
declare const NumberInput: import("react").ForwardRefExoticComponent<NumberInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
12
13
|
export default NumberInput;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import { forwardRef, useEffect } from 'react';
|
|
3
|
+
import useCombinedRefs from '../hooks/useCombinedRefs';
|
|
3
4
|
const inputStyle = {
|
|
4
5
|
height: '100%',
|
|
5
6
|
width: '100px',
|
|
@@ -7,7 +8,13 @@ const inputStyle = {
|
|
|
7
8
|
border: '0.55px solid #c7c7c7',
|
|
8
9
|
textAlign: 'center',
|
|
9
10
|
};
|
|
10
|
-
const NumberInput = forwardRef(({ name, value: valueProp, style = {}, onChange, pattern = '^\\d*.\\d*$', step = 'any', min = 'any', max = 'any', ...otherProps }, ref) => {
|
|
11
|
-
|
|
11
|
+
const NumberInput = forwardRef(({ name, value: valueProp, style = {}, onChange, pattern = '^\\d*.\\d*$', step = 'any', min = 'any', max = 'any', autoSelect = false, ...otherProps }, ref) => {
|
|
12
|
+
const combinedRef = useCombinedRefs([ref]);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (autoSelect) {
|
|
15
|
+
combinedRef?.current?.select();
|
|
16
|
+
}
|
|
17
|
+
}, [autoSelect, combinedRef]);
|
|
18
|
+
return (_jsx("input", { ref: combinedRef, name: name, style: { ...inputStyle, ...style }, type: "number", pattern: pattern, value: valueProp, step: step, onChange: onChange, min: min, max: max, ...otherProps }));
|
|
12
19
|
});
|
|
13
20
|
export default NumberInput;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FaCog } from 'react-icons/fa';
|
|
3
|
+
import ToolTip from './ToolTip/ToolTip';
|
|
4
|
+
export function PreferencesButton({ onClick }) {
|
|
5
|
+
return (_jsx(ToolTip, { title: "Preferences", popupPlacement: "left", children: _jsx("button", { type: "button", onClick: onClick, children: _jsx(FaCog, {}) }) }));
|
|
6
|
+
}
|
|
@@ -3,9 +3,9 @@ export interface InputMapValueFunctions {
|
|
|
3
3
|
mapOnChangeValue?: (value: string | number) => any;
|
|
4
4
|
mapValue?: (value: any) => string | number;
|
|
5
5
|
}
|
|
6
|
-
interface FormikInputProps extends
|
|
6
|
+
interface FormikInputProps extends InputMapValueFunctions {
|
|
7
7
|
name: string;
|
|
8
8
|
checkErrorAfterInputTouched?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare function FormikInput(props: FormikInputProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function FormikInput(props: FormikInputProps & InputProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default FormikInput;
|
|
@@ -2,14 +2,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useFormikContext } from 'formik';
|
|
3
3
|
import lodashGet from 'lodash/get';
|
|
4
4
|
import Input from '../Input';
|
|
5
|
-
function identity(value) {
|
|
6
|
-
return value;
|
|
7
|
-
}
|
|
8
5
|
function FormikInput(props) {
|
|
9
|
-
const { name, style = { label: {}, input: {}, inputWrapper: {} }, onChange
|
|
6
|
+
const { name, style = { label: {}, input: {}, inputWrapper: {} }, onChange, type = 'text', className = '', value = null, checkErrorAfterInputTouched = true, mapOnChangeValue, mapValue, ...resProps } = props;
|
|
10
7
|
const { values, handleChange, errors, touched, setFieldValue } = useFormikContext();
|
|
11
8
|
function changeHandler(e) {
|
|
12
|
-
onChange(e);
|
|
9
|
+
onChange?.(e);
|
|
13
10
|
if (mapOnChangeValue) {
|
|
14
11
|
void setFieldValue(name, mapOnChangeValue(e.target.value));
|
|
15
12
|
}
|
|
@@ -36,6 +33,6 @@ function FormikInput(props) {
|
|
|
36
33
|
}
|
|
37
34
|
: {}),
|
|
38
35
|
},
|
|
39
|
-
},
|
|
36
|
+
}, className: className, ...resProps }));
|
|
40
37
|
}
|
|
41
38
|
export default FormikInput;
|
|
@@ -60,6 +60,6 @@ function ConfirmationDialog({ style = {}, buttons = [], onClose, message, render
|
|
|
60
60
|
onClose();
|
|
61
61
|
}
|
|
62
62
|
}, [onClose]);
|
|
63
|
-
return (_jsxs("div", { style: style, css: styles, "data-
|
|
63
|
+
return (_jsxs("div", { style: style, css: styles, "data-testid": id, children: [render ? (render({ message, className: 'message' })) : (_jsx("p", { className: "message", children: message })), _jsx("div", { className: "buttons-container", children: buttons.map((option) => (_jsx("button", { type: "button", onClick: (e) => optionsHandler(e, option), style: option.style && option.style, children: option.text }, option.text))) })] }));
|
|
64
64
|
}
|
|
65
65
|
export default ConfirmationDialog;
|
|
@@ -28,21 +28,30 @@ const initialValues = {
|
|
|
28
28
|
};
|
|
29
29
|
function ApodizationOptionsInnerPanel(props) {
|
|
30
30
|
const dispatch = useDispatch();
|
|
31
|
-
const
|
|
31
|
+
const previousPreviewRef = useRef(initialValues.livePreview);
|
|
32
32
|
function handleApplyFilter(values, triggerSource = 'apply') {
|
|
33
|
-
const { livePreview, ...
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
const { livePreview, ...options } = values;
|
|
34
|
+
switch (triggerSource) {
|
|
35
|
+
case 'onChange': {
|
|
36
|
+
if (livePreview || previousPreviewRef.current !== livePreview) {
|
|
37
|
+
dispatch({
|
|
38
|
+
type: 'CALCULATE_APODIZATION_FILTER',
|
|
39
|
+
payload: { livePreview, options },
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
case 'apply': {
|
|
45
|
+
dispatch({
|
|
46
|
+
type: 'APPLY_APODIZATION_FILTER',
|
|
47
|
+
payload: { options },
|
|
48
|
+
});
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
default:
|
|
52
|
+
break;
|
|
45
53
|
}
|
|
54
|
+
previousPreviewRef.current = livePreview;
|
|
46
55
|
}
|
|
47
56
|
function handleCancelFilter() {
|
|
48
57
|
dispatch({
|
|
@@ -53,7 +62,7 @@ function ApodizationOptionsInnerPanel(props) {
|
|
|
53
62
|
if (props.filter) {
|
|
54
63
|
formData = { ...initialValues, ...props.filter.value, livePreview: true };
|
|
55
64
|
}
|
|
56
|
-
return (
|
|
65
|
+
return (_jsx(HeaderContainer, { children: _jsx(Formik, { onSubmit: (values) => handleApplyFilter(values), initialValues: formData, validationSchema: validationSchema, children: ({ submitForm }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Line broadening : ", shortTitle: "LB :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "lineBroadening", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "Gauss broadening :", shortTitle: "GB :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "gaussBroadening", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "lineBroadeningCenter [0 - 1] : ", shortTitle: "LB Center :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "lineBroadeningCenter", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "Live preview ", htmlFor: "livePreview", style: { label: { padding: '0 5px' } }, children: _jsx(FormikCheckBox, { name: "livePreview" }) }), _jsx(FormikOnChange, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true }), _jsx(ActionButtons, { onDone: submitForm, onCancel: handleCancelFilter })] })) }) }));
|
|
57
66
|
}
|
|
58
67
|
const MemoizedApodizationPanel = memo(ApodizationOptionsInnerPanel);
|
|
59
68
|
export default function ApodizationOptionsPanel() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Formik } from 'formik';
|
|
3
3
|
import { Filters } from 'nmr-processing';
|
|
4
|
-
import {
|
|
4
|
+
import { useState, memo, useRef } from 'react';
|
|
5
5
|
import * as Yup from 'yup';
|
|
6
6
|
import { useDispatch } from '../context/DispatchContext';
|
|
7
7
|
import ActionButtons from '../elements/ActionButtons';
|
|
@@ -65,16 +65,37 @@ const formData = (algorithm, filterValues) => {
|
|
|
65
65
|
};
|
|
66
66
|
function BaseLineCorrectionInnerPanel(props) {
|
|
67
67
|
const dispatch = useDispatch();
|
|
68
|
-
const
|
|
68
|
+
const previousPreviewRef = useRef(true);
|
|
69
69
|
const { algorithm: baseAlgorithm = 'polynomial' } = props?.filter?.value || {};
|
|
70
70
|
const [algorithm, setAlgorithm] = useState(baseAlgorithm);
|
|
71
71
|
const handleApplyFilter = (values, triggerSource = 'apply') => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
const { livePreview, ...options } = values;
|
|
73
|
+
switch (triggerSource) {
|
|
74
|
+
case 'onChange': {
|
|
75
|
+
if (livePreview || previousPreviewRef !== livePreview) {
|
|
76
|
+
dispatch({
|
|
77
|
+
type: 'CALCULATE_BASE_LINE_CORRECTION_FILTER',
|
|
78
|
+
payload: {
|
|
79
|
+
options,
|
|
80
|
+
livePreview,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
case 'apply': {
|
|
87
|
+
dispatch({
|
|
88
|
+
type: 'APPLY_BASE_LINE_CORRECTION_FILTER',
|
|
89
|
+
payload: {
|
|
90
|
+
options,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
default:
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
previousPreviewRef.current = livePreview;
|
|
78
99
|
};
|
|
79
100
|
const handleCancelFilter = () => {
|
|
80
101
|
dispatch({
|
|
@@ -85,8 +106,8 @@ function BaseLineCorrectionInnerPanel(props) {
|
|
|
85
106
|
setAlgorithm(selectedAlgorithm);
|
|
86
107
|
}
|
|
87
108
|
const form = formData(algorithm, props?.filter?.value || {});
|
|
88
|
-
return (_jsxs(HeaderContainer, { children: [_jsx(Label, { title: "Algorithm: ", style: headerLabelStyle, children: _jsx(Select, { items: getAlgorithmsList(), value: algorithm, onChange: handleChangeAlgorithm }) }), _jsx(Formik, {
|
|
89
|
-
['autoPolynomial', 'polynomial'].includes(algorithm) && (_jsx(Label, { title: "degree [ 1 - 6 ]:", shortTitle: "degree :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "degree", min: 1, max: 6, style: inputStyle, debounceTime: 250 }) })), _jsx(Label, { title: "live preview ", htmlFor: "livePreview", style: headerLabelStyle, children: _jsx(FormikCheckBox, { name: "livePreview" }) }), _jsx(FormikOnChange, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true })
|
|
109
|
+
return (_jsxs(HeaderContainer, { children: [_jsx(Label, { title: "Algorithm: ", style: headerLabelStyle, children: _jsx(Select, { items: getAlgorithmsList(), value: algorithm, onChange: handleChangeAlgorithm }) }), _jsx(Formik, { onSubmit: (values) => handleApplyFilter(values), initialValues: form.values, validationSchema: form.validation, enableReinitialize: true, children: ({ submitForm }) => (_jsxs(_Fragment, { children: [algorithm && algorithm === 'airpls' && (_jsxs("div", { style: { display: 'flex' }, children: [_jsx(Label, { title: "maxIterations:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "maxIterations", debounceTime: 250, style: inputStyle }) }), _jsx(Label, { title: "tolerance:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "tolerance", debounceTime: 250, style: inputStyle }) })] })), algorithm &&
|
|
110
|
+
['autoPolynomial', 'polynomial'].includes(algorithm) && (_jsx(Label, { title: "degree [ 1 - 6 ]:", shortTitle: "degree :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "degree", min: 1, max: 6, style: inputStyle, debounceTime: 250 }) })), _jsx(Label, { title: "live preview ", htmlFor: "livePreview", style: headerLabelStyle, children: _jsx(FormikCheckBox, { name: "livePreview" }) }), _jsx(FormikOnChange, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true }), _jsx(ActionButtons, { onDone: submitForm, onCancel: handleCancelFilter })] })) })] }));
|
|
90
111
|
}
|
|
91
112
|
const MemoizedBaseLineCorrectionPanel = memo(BaseLineCorrectionInnerPanel);
|
|
92
113
|
export default function BaseLineCorrectionPanel() {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { LabelStyle } from '../elements/Label';
|
|
2
2
|
export declare const headerLabelStyle: LabelStyle;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
interface HeaderInnerProps {
|
|
4
|
+
onEnableFullscreen: () => void;
|
|
5
|
+
isFullscreenEnabled: boolean;
|
|
6
|
+
selectedOptionPanel: string | null;
|
|
7
|
+
height: number;
|
|
8
|
+
}
|
|
9
|
+
export default function HeaderWrapper({ isFullscreenEnabled, onEnableFullscreen, }: {
|
|
10
|
+
isFullscreenEnabled: HeaderInnerProps['isFullscreenEnabled'];
|
|
11
|
+
onEnableFullscreen: HeaderInnerProps['onEnableFullscreen'];
|
|
6
12
|
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -11,8 +11,8 @@ import Button from '../elements/Button';
|
|
|
11
11
|
import { Header } from '../elements/Header';
|
|
12
12
|
import DropDownButton from '../elements/dropDownButton/DropDownButton';
|
|
13
13
|
import { useSaveSettings } from '../hooks/useSaveSettings';
|
|
14
|
-
import AboutUsModal from '../modal/AboutUsModal';
|
|
15
14
|
import { LogsHistoryModal } from '../modal/LogsHistoryModal';
|
|
15
|
+
import AboutUsModal from '../modal/aboutUs/AboutUsModal';
|
|
16
16
|
import GeneralSettingsModal from '../modal/setting/GeneralSettings';
|
|
17
17
|
import WorkspaceItem from '../modal/setting/WorkspaceItem';
|
|
18
18
|
import { options } from '../toolbar/ToolTypes';
|
|
@@ -61,7 +61,7 @@ const styles = css `
|
|
|
61
61
|
}
|
|
62
62
|
`;
|
|
63
63
|
function HeaderInner(props) {
|
|
64
|
-
const {
|
|
64
|
+
const { isFullscreenEnabled, onEnableFullscreen, selectedOptionPanel, height, } = props;
|
|
65
65
|
const { current: { display: { general }, }, workspace, dispatch, } = usePreferences();
|
|
66
66
|
const workspacesList = useWorkspacesList();
|
|
67
67
|
const hideGeneralSettings = !!(general?.hideGeneralSettings && workspace.base);
|
|
@@ -100,7 +100,7 @@ function HeaderInner(props) {
|
|
|
100
100
|
alignItems: 'center',
|
|
101
101
|
}, children: [_jsx("div", { children: _jsx(Toolbar, { orientation: "horizontal", children: _jsx(AboutUsModal, {}) }) }), _jsx("div", { className: "toolOptionsPanel", style: { flex: 1 }, children: selectedPanel })] }), _jsxs(HeaderContainer, { style: {
|
|
102
102
|
alignItems: 'center',
|
|
103
|
-
}, children: [!hideGeneralSettings && (_jsxs(_Fragment, { children: [_jsx(DropDownButton, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem }), _jsx(SaveButton, {})] })), !general?.hideLogs && _jsx(LogsHistoryModal, {}), _jsx("div", { children: _jsxs(Toolbar, { orientation: "horizontal", children: [_jsx(Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(docsBaseUrl, '_blank'), children: _jsx(FaQuestionCircle, {}) }), !hideGeneralSettings && (_jsx(GeneralSettingsModal, { height: height / 2 })), !
|
|
103
|
+
}, children: [!hideGeneralSettings && (_jsxs(_Fragment, { children: [_jsx(DropDownButton, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem }), _jsx(SaveButton, {})] })), !general?.hideLogs && _jsx(LogsHistoryModal, {}), _jsx("div", { children: _jsxs(Toolbar, { orientation: "horizontal", children: [_jsx(Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(docsBaseUrl, '_blank'), children: _jsx(FaQuestionCircle, {}) }), !hideGeneralSettings && (_jsx(GeneralSettingsModal, { height: height / 2 })), !isFullscreenEnabled && (_jsx(Toolbar.Item, { id: "full-screen", onClick: onEnableFullscreen, title: "Full Screen", className: "windowButton", children: _jsx(FaRegWindowMaximize, {}) }))] }) })] })] }) }));
|
|
104
104
|
}
|
|
105
105
|
function SaveButton() {
|
|
106
106
|
const { workspace, workspaces, originalWorkspaces } = usePreferences();
|
|
@@ -117,10 +117,10 @@ function SaveButton() {
|
|
|
117
117
|
}), toolTip: "Save workspace locally in the browser", children: _jsx(FaRegSave, {}) }), _jsx(SaveSettingsModal, {})] }));
|
|
118
118
|
}
|
|
119
119
|
const MemoizedHeader = memo(HeaderInner);
|
|
120
|
-
export default function HeaderWrapper({
|
|
120
|
+
export default function HeaderWrapper({ isFullscreenEnabled, onEnableFullscreen, }) {
|
|
121
121
|
const { toolOptions: { selectedOptionPanel }, height, } = useChartData();
|
|
122
122
|
return (_jsx(MemoizedHeader, { selectedOptionPanel,
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
isFullscreenEnabled,
|
|
124
|
+
onEnableFullscreen,
|
|
125
125
|
height }));
|
|
126
126
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Formik } from 'formik';
|
|
2
3
|
import { Filters } from 'nmr-processing';
|
|
3
|
-
import {
|
|
4
|
-
import { Checkbox } from 'react-science/ui';
|
|
4
|
+
import { memo, useRef } from 'react';
|
|
5
5
|
import generateNumbersPowerOfX from '../../data/utilities/generateNumbersPowerOfX';
|
|
6
6
|
import { useDispatch } from '../context/DispatchContext';
|
|
7
7
|
import ActionButtons from '../elements/ActionButtons';
|
|
8
8
|
import Label from '../elements/Label';
|
|
9
|
-
import
|
|
9
|
+
import FormikCheckBox from '../elements/formik/FormikCheckBox';
|
|
10
|
+
import FormikOnChange from '../elements/formik/FormikOnChange';
|
|
11
|
+
import FormikSelect from '../elements/formik/FormikSelect';
|
|
10
12
|
import { useFilter } from '../hooks/useFilter';
|
|
11
13
|
import useSpectrum from '../hooks/useSpectrum';
|
|
12
14
|
import { headerLabelStyle } from './Header';
|
|
@@ -24,40 +26,44 @@ function useInitZeroFillingSize() {
|
|
|
24
26
|
return 0;
|
|
25
27
|
}
|
|
26
28
|
function ZeroFillingOptionsInnerPanel(props) {
|
|
29
|
+
const { size } = props;
|
|
27
30
|
const dispatch = useDispatch();
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
const previousPreviewRef = useRef(true);
|
|
32
|
+
function handleApplyFilter(values, triggerSource = 'apply') {
|
|
33
|
+
const { livePreview, ...options } = values;
|
|
34
|
+
switch (triggerSource) {
|
|
35
|
+
case 'onChange': {
|
|
36
|
+
if (livePreview || previousPreviewRef !== livePreview) {
|
|
37
|
+
dispatch({
|
|
38
|
+
type: 'CALCULATE_ZERO_FILLING_FILTER',
|
|
39
|
+
payload: {
|
|
40
|
+
options,
|
|
41
|
+
livePreview,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
case 'apply': {
|
|
48
|
+
dispatch({
|
|
49
|
+
type: 'APPLY_ZERO_FILLING_FILTER',
|
|
50
|
+
payload: {
|
|
51
|
+
options,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
default:
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
previousPreviewRef.current = livePreview;
|
|
37
60
|
}
|
|
38
61
|
function handleCancelFilter() {
|
|
39
62
|
dispatch({
|
|
40
63
|
type: 'RESET_SELECTED_TOOL',
|
|
41
64
|
});
|
|
42
65
|
}
|
|
43
|
-
|
|
44
|
-
dispatch({
|
|
45
|
-
type: 'CALCULATE_ZERO_FILLING_FILTER',
|
|
46
|
-
payload: {
|
|
47
|
-
nbPoints,
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function handleChangeSizeHandler(value) {
|
|
52
|
-
setSize(value);
|
|
53
|
-
}
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (livePreview && size) {
|
|
56
|
-
dispatchLiveChanges(size);
|
|
57
|
-
}
|
|
58
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
|
-
}, [size, livePreview]);
|
|
60
|
-
return (_jsxs(HeaderContainer, { children: [_jsx(Label, { title: "Size: ", style: headerLabelStyle, children: _jsx(Select, { items: Sizes, style: { marginLeft: 10, marginRight: 10 }, value: size, onChange: handleChangeSizeHandler }) }), _jsx(Checkbox, { label: "Live preview", checked: livePreview, onChange: setLivePreview }), _jsx(ActionButtons, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
|
|
66
|
+
return (_jsx(HeaderContainer, { children: _jsx(Formik, { onSubmit: (values) => handleApplyFilter(values), initialValues: { nbPoints: size, livePreview: true }, children: ({ submitForm }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Size: ", style: headerLabelStyle, children: _jsx(FormikSelect, { items: Sizes, style: { marginLeft: 10, marginRight: 10 }, name: "nbPoints" }) }), _jsx(Label, { title: "Live preview ", htmlFor: "livePreview", style: { label: { padding: '0 5px' } }, children: _jsx(FormikCheckBox, { name: "livePreview" }) }), _jsx(FormikOnChange, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true }), _jsx(ActionButtons, { onDone: submitForm, onCancel: handleCancelFilter })] })) }) }));
|
|
61
67
|
}
|
|
62
68
|
const MemoizedZeroFillingOptionsPanel = memo(ZeroFillingOptionsInnerPanel);
|
|
63
69
|
export default function ZeroFillingOptionsPanel() {
|
|
@@ -7,6 +7,7 @@ export declare enum HighlightEventSource {
|
|
|
7
7
|
SIGNAL = "SIGNAL",
|
|
8
8
|
RANGE = "RANGE",
|
|
9
9
|
ZONE = "ZONE",
|
|
10
|
+
BASELINE_ZONE = "BASELINE_ZONE",
|
|
10
11
|
EXCLUSION_ZONE = "EXCLUSION_ZONE",
|
|
11
12
|
MATRIX_GENERATION_EXCLUSION_ZONE = "MATRIX_GENERATION_EXCLUSION_ZONE",
|
|
12
13
|
MULTIPLE_ANALYSIS_ZONE = "MULTIPLE_ANALYSIS_ZONE",
|
|
@@ -7,6 +7,7 @@ export var HighlightEventSource;
|
|
|
7
7
|
HighlightEventSource["SIGNAL"] = "SIGNAL";
|
|
8
8
|
HighlightEventSource["RANGE"] = "RANGE";
|
|
9
9
|
HighlightEventSource["ZONE"] = "ZONE";
|
|
10
|
+
HighlightEventSource["BASELINE_ZONE"] = "BASELINE_ZONE";
|
|
10
11
|
HighlightEventSource["EXCLUSION_ZONE"] = "EXCLUSION_ZONE";
|
|
11
12
|
HighlightEventSource["MATRIX_GENERATION_EXCLUSION_ZONE"] = "MATRIX_GENERATION_EXCLUSION_ZONE";
|
|
12
13
|
HighlightEventSource["MULTIPLE_ANALYSIS_ZONE"] = "MULTIPLE_ANALYSIS_ZONE";
|
|
@@ -3,24 +3,28 @@ import { useCallback } from 'react';
|
|
|
3
3
|
import { useChartData } from '../context/ChartContext';
|
|
4
4
|
import { usePreferences } from '../context/PreferencesContext';
|
|
5
5
|
import { options } from '../toolbar/ToolTypes';
|
|
6
|
+
import useCheckExperimentalFeature from './useCheckExperimentalFeature';
|
|
6
7
|
import useSpectrum from './useSpectrum';
|
|
7
8
|
export function useCheckToolsVisibility() {
|
|
8
9
|
const { displayerMode } = useChartData();
|
|
9
10
|
const preferences = usePreferences();
|
|
10
11
|
const spectrum = useSpectrum(null);
|
|
12
|
+
const isExperimentalFeatureActivated = useCheckExperimentalFeature();
|
|
11
13
|
return useCallback((toolKey, checkOptions = {}) => {
|
|
12
14
|
const { checkMode = true, checkSpectrumType = true, extraInfoCheckParameters, } = checkOptions;
|
|
15
|
+
const { spectraOptions, mode, isExperimental } = options[toolKey];
|
|
13
16
|
const flag = lodashGet(preferences.current, `display.toolBarButtons.${toolKey}`, false);
|
|
14
|
-
const { spectraOptions, mode } = options[toolKey];
|
|
15
17
|
const modeFlag = !checkMode || (checkMode && (!mode || displayerMode === mode));
|
|
16
18
|
const spectrumCheckFlag = !checkSpectrumType ||
|
|
17
19
|
(checkSpectrumType && checkSpectrum(spectrum, spectraOptions));
|
|
18
|
-
|
|
20
|
+
const isToolActivated = (flag && !isExperimental) ||
|
|
21
|
+
(isExperimental && isExperimentalFeatureActivated);
|
|
22
|
+
return (isToolActivated &&
|
|
19
23
|
modeFlag &&
|
|
20
24
|
spectrumCheckFlag &&
|
|
21
25
|
(!extraInfoCheckParameters ||
|
|
22
26
|
checkInfo(extraInfoCheckParameters, spectrum?.info)));
|
|
23
|
-
}, [displayerMode, preferences, spectrum]);
|
|
27
|
+
}, [displayerMode, isExperimentalFeatureActivated, preferences, spectrum]);
|
|
24
28
|
}
|
|
25
29
|
function checkSpectrum(spectrum, options) {
|
|
26
30
|
let outerConditionResult = false;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useChartData } from '../context/ChartContext';
|
|
2
|
+
import { useKeyModifiers } from '../context/KeyModifierContext';
|
|
3
|
+
export function useResizerStatus(toolKey) {
|
|
4
|
+
const { toolOptions: { selectedTool }, } = useChartData();
|
|
5
|
+
const { shiftKey } = useKeyModifiers();
|
|
6
|
+
return !shiftKey && selectedTool === toolKey;
|
|
7
|
+
}
|
|
@@ -5,7 +5,7 @@ export default function useSpectrum(defaultValue = null) {
|
|
|
5
5
|
const { data } = useChartData();
|
|
6
6
|
const activeSpectrum = useActiveSpectrum();
|
|
7
7
|
return useMemo(() => {
|
|
8
|
-
if (data && activeSpectrum
|
|
8
|
+
if (data && activeSpectrum?.id) {
|
|
9
9
|
const datum = data.find((datum) => datum.id === activeSpectrum.id) || defaultValue;
|
|
10
10
|
return datum;
|
|
11
11
|
}
|