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
|
@@ -16,10 +16,10 @@ const index_1 = require("../highlight/index");
|
|
|
16
16
|
const useCheckToolsVisibility_1 = require("../hooks/useCheckToolsVisibility");
|
|
17
17
|
const useExport_1 = __importDefault(require("../hooks/useExport"));
|
|
18
18
|
const useToolsFunctions_1 = __importDefault(require("../hooks/useToolsFunctions"));
|
|
19
|
-
const Constants_1 = require("../reducer/core/Constants");
|
|
20
19
|
const ToolTypes_1 = require("../toolbar/ToolTypes");
|
|
21
|
-
function KeysListenerTracker() {
|
|
22
|
-
const {
|
|
20
|
+
function KeysListenerTracker(props) {
|
|
21
|
+
const { mainDivRef } = props;
|
|
22
|
+
const { keysPreferences, displayerMode, data, view: { spectra: { activeTab }, }, } = (0, ChartContext_1.useChartData)();
|
|
23
23
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
24
24
|
const { dispatch: dispatchPreferences } = (0, PreferencesContext_1.usePreferences)();
|
|
25
25
|
const alert = (0, Alert_1.useAlert)();
|
|
@@ -29,9 +29,28 @@ function KeysListenerTracker() {
|
|
|
29
29
|
const { saveToClipboardHandler, saveAsJSONHandler, saveAsHandler } = (0, useExport_1.default)();
|
|
30
30
|
const isToolVisible = (0, useCheckToolsVisibility_1.useCheckToolsVisibility)();
|
|
31
31
|
const { highlight, remove } = (0, index_1.useHighlightData)();
|
|
32
|
+
const mouseIsOverDisplayer = (0, react_1.useRef)(false);
|
|
33
|
+
(0, react_1.useEffect)(() => {
|
|
34
|
+
const div = mainDivRef.current;
|
|
35
|
+
if (!div) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
function mouseEnterHandler() {
|
|
39
|
+
mouseIsOverDisplayer.current = true;
|
|
40
|
+
}
|
|
41
|
+
function mouseLeaveHandler() {
|
|
42
|
+
mouseIsOverDisplayer.current = false;
|
|
43
|
+
}
|
|
44
|
+
div.addEventListener('mouseenter', mouseEnterHandler);
|
|
45
|
+
div.addEventListener('mouseleave', mouseLeaveHandler);
|
|
46
|
+
return () => {
|
|
47
|
+
div.removeEventListener('mouseenter', mouseEnterHandler);
|
|
48
|
+
div.removeEventListener('mouseleave', mouseLeaveHandler);
|
|
49
|
+
};
|
|
50
|
+
}, [mainDivRef]);
|
|
32
51
|
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
33
52
|
const allow1DTool = (0, react_1.useMemo)(() => {
|
|
34
|
-
return displayerMode ===
|
|
53
|
+
return displayerMode === '1D' && data && data.length > 0;
|
|
35
54
|
}, [data, displayerMode]);
|
|
36
55
|
const deleteHandler = (0, react_1.useCallback)(async (sourceData) => {
|
|
37
56
|
const { type, extra } = sourceData;
|
|
@@ -175,6 +194,15 @@ function KeysListenerTracker() {
|
|
|
175
194
|
}
|
|
176
195
|
break;
|
|
177
196
|
}
|
|
197
|
+
case index_1.HighlightEventSource.BASELINE_ZONE: {
|
|
198
|
+
const { id } = extra || {};
|
|
199
|
+
if (id) {
|
|
200
|
+
dispatch({ type: 'DELETE_BASE_LINE_ZONE', payload: { id } });
|
|
201
|
+
// remove keys from the highlighted list after delete
|
|
202
|
+
remove();
|
|
203
|
+
}
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
178
206
|
default:
|
|
179
207
|
break;
|
|
180
208
|
}
|
|
@@ -228,7 +256,6 @@ function KeysListenerTracker() {
|
|
|
228
256
|
handleFullZoomOut();
|
|
229
257
|
}
|
|
230
258
|
break;
|
|
231
|
-
case 'z':
|
|
232
259
|
case 'Escape':
|
|
233
260
|
if (isToolVisible('zoom')) {
|
|
234
261
|
handleChangeOption(ToolTypes_1.options.zoom.id);
|
|
@@ -243,6 +270,12 @@ function KeysListenerTracker() {
|
|
|
243
270
|
}
|
|
244
271
|
break;
|
|
245
272
|
}
|
|
273
|
+
case 'z': {
|
|
274
|
+
if (isToolVisible('zeroFilling')) {
|
|
275
|
+
handleChangeOption(ToolTypes_1.options.zeroFilling.id);
|
|
276
|
+
}
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
246
279
|
case 'a': {
|
|
247
280
|
if (isToolVisible('apodization')) {
|
|
248
281
|
handleChangeOption(ToolTypes_1.options.apodization.id);
|
|
@@ -252,6 +285,14 @@ function KeysListenerTracker() {
|
|
|
252
285
|
}
|
|
253
286
|
break;
|
|
254
287
|
}
|
|
288
|
+
case 't': {
|
|
289
|
+
if (isToolVisible('fft')) {
|
|
290
|
+
dispatch({
|
|
291
|
+
type: 'APPLY_FFT_FILTER',
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
255
296
|
case 'b': {
|
|
256
297
|
if (isToolVisible('baselineCorrection')) {
|
|
257
298
|
handleChangeOption(ToolTypes_1.options.baselineCorrection.id);
|
|
@@ -348,7 +389,7 @@ function KeysListenerTracker() {
|
|
|
348
389
|
saveToClipboardHandler,
|
|
349
390
|
]);
|
|
350
391
|
const handleOnKeyDown = (0, react_1.useCallback)((e) => {
|
|
351
|
-
if (checkNotInputField(e) &&
|
|
392
|
+
if (checkNotInputField(e) && mouseIsOverDisplayer.current) {
|
|
352
393
|
const num = Number(e.code.slice(-1)) || 0;
|
|
353
394
|
if (num > 0) {
|
|
354
395
|
keysPreferencesListenerHandler(e, num);
|
|
@@ -366,7 +407,6 @@ function KeysListenerTracker() {
|
|
|
366
407
|
deleteHandler,
|
|
367
408
|
highlight,
|
|
368
409
|
keysPreferencesListenerHandler,
|
|
369
|
-
overDisplayer,
|
|
370
410
|
toolsListenerHandler,
|
|
371
411
|
]);
|
|
372
412
|
(0, react_1.useEffect)(() => {
|
|
@@ -6,16 +6,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.AssignmentProvider = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
+
const ChartContext_1 = require("../context/ChartContext");
|
|
9
10
|
const AssignmentsContext_1 = require("./AssignmentsContext");
|
|
10
11
|
const AssignmentsReducer_1 = __importDefault(require("./AssignmentsReducer"));
|
|
11
12
|
function AssignmentProvider(props) {
|
|
12
|
-
const {
|
|
13
|
+
const { children } = props;
|
|
14
|
+
const { data: spectra } = (0, ChartContext_1.useChartData)();
|
|
13
15
|
const [data, dispatch] = (0, react_1.useReducer)(AssignmentsReducer_1.default, AssignmentsContext_1.assignmentState);
|
|
14
16
|
const state = (0, react_1.useMemo)(() => ({ data, dispatch }), [data]);
|
|
15
17
|
(0, react_1.useEffect)(() => {
|
|
16
18
|
if (spectra) {
|
|
17
19
|
dispatch({
|
|
18
20
|
type: 'INITIATE_ASSIGNMENTS',
|
|
21
|
+
// TODO: Fix this type error. It's been here for a long time because this component wasn't typed.
|
|
22
|
+
// @ts-expect-error This should be fixed.
|
|
19
23
|
payload: { spectra },
|
|
20
24
|
});
|
|
21
25
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyModifiersProvider = exports.useKeyModifiers = exports.KeyModifierContext = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const defaultKeyModifiersState = {
|
|
7
|
+
ctrlKey: false,
|
|
8
|
+
shiftKey: false,
|
|
9
|
+
altKey: false,
|
|
10
|
+
};
|
|
11
|
+
exports.KeyModifierContext = (0, react_1.createContext)(defaultKeyModifiersState);
|
|
12
|
+
function useKeyModifiers() {
|
|
13
|
+
const context = (0, react_1.useContext)(exports.KeyModifierContext);
|
|
14
|
+
if (!context) {
|
|
15
|
+
throw new Error('key modifiers context was not found');
|
|
16
|
+
}
|
|
17
|
+
return context;
|
|
18
|
+
}
|
|
19
|
+
exports.useKeyModifiers = useKeyModifiers;
|
|
20
|
+
const isMac = navigator !== undefined && navigator.userAgent.toLowerCase().includes('mac');
|
|
21
|
+
function getModifiers(event) {
|
|
22
|
+
const { shiftKey, altKey, metaKey } = event;
|
|
23
|
+
const ctrlKey = isMac ? metaKey : event.ctrlKey;
|
|
24
|
+
return { ctrlKey, shiftKey, altKey };
|
|
25
|
+
}
|
|
26
|
+
function KeyModifiersProvider({ children }) {
|
|
27
|
+
const [modifiers, setModifiers] = (0, react_1.useState)(defaultKeyModifiersState);
|
|
28
|
+
(0, react_1.useEffect)(() => {
|
|
29
|
+
function handleKeyDown(event) {
|
|
30
|
+
setModifiers(getModifiers(event));
|
|
31
|
+
}
|
|
32
|
+
function handleKeyUp(event) {
|
|
33
|
+
setModifiers(getModifiers(event));
|
|
34
|
+
}
|
|
35
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
36
|
+
document.addEventListener('keyup', handleKeyUp);
|
|
37
|
+
return () => {
|
|
38
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
39
|
+
document.removeEventListener('keyup', handleKeyUp);
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)(exports.KeyModifierContext.Provider, { value: modifiers, children: children }));
|
|
43
|
+
}
|
|
44
|
+
exports.KeyModifiersProvider = KeyModifiersProvider;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
4
|
+
//TODO resolve the eslint rules
|
|
5
|
+
/* eslint-disable react/no-unused-prop-types */
|
|
4
6
|
/** @jsxImportSource @emotion/react */
|
|
5
7
|
const react_1 = require("@emotion/react");
|
|
6
8
|
const fa_1 = require("react-icons/fa");
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CounterLabel = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const labelStyle = {
|
|
6
|
+
margin: 0,
|
|
7
|
+
textAlign: 'right',
|
|
8
|
+
lineHeight: '22px',
|
|
9
|
+
padding: '0 5px',
|
|
10
|
+
whiteSpace: 'nowrap',
|
|
11
|
+
};
|
|
12
|
+
function CounterLabel(props) {
|
|
13
|
+
const { children, style = {} } = props;
|
|
14
|
+
return (0, jsx_runtime_1.jsx)("p", { style: { ...labelStyle, ...style }, children: children });
|
|
15
|
+
}
|
|
16
|
+
exports.CounterLabel = CounterLabel;
|
|
@@ -10,6 +10,7 @@ const EditableColumn = (0, react_1.forwardRef)(function EditableColumn(props, re
|
|
|
10
10
|
const { onSave = () => null, value, type = 'text', style, onEditStart = () => null, editStatus = false, validate = () => true, textOverFlowEllipses = false, ...InputProps } = props;
|
|
11
11
|
const [enabled, enableEdit] = (0, react_1.useState)();
|
|
12
12
|
const [isValid, setValid] = (0, react_1.useState)(true);
|
|
13
|
+
const [val, setVal] = (0, react_1.useState)(value);
|
|
13
14
|
(0, react_1.useEffect)(() => {
|
|
14
15
|
enableEdit(editStatus);
|
|
15
16
|
}, [editStatus]);
|
|
@@ -27,13 +28,13 @@ const EditableColumn = (0, react_1.forwardRef)(function EditableColumn(props, re
|
|
|
27
28
|
window.removeEventListener('mousedown', mouseClickCallback);
|
|
28
29
|
}
|
|
29
30
|
}, []);
|
|
30
|
-
|
|
31
|
+
function startEditHandler() {
|
|
31
32
|
window.addEventListener('mousedown', mouseClickCallback);
|
|
32
33
|
onEditStart(true);
|
|
33
34
|
enableEdit(true);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const valid = validate(
|
|
35
|
+
}
|
|
36
|
+
function editHandler(event) {
|
|
37
|
+
const valid = validate(val);
|
|
37
38
|
setValid(valid);
|
|
38
39
|
// when press Enter or Tab
|
|
39
40
|
if (valid && ['Enter', 'Tab'].includes(event.key)) {
|
|
@@ -45,7 +46,10 @@ const EditableColumn = (0, react_1.forwardRef)(function EditableColumn(props, re
|
|
|
45
46
|
enableEdit(false);
|
|
46
47
|
window.removeEventListener('mousedown', mouseClickCallback);
|
|
47
48
|
}
|
|
48
|
-
}
|
|
49
|
+
}
|
|
50
|
+
function handleChange(e) {
|
|
51
|
+
setVal(e.target.value);
|
|
52
|
+
}
|
|
49
53
|
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
50
54
|
display: 'table',
|
|
51
55
|
width: '100%',
|
|
@@ -67,8 +71,10 @@ const EditableColumn = (0, react_1.forwardRef)(function EditableColumn(props, re
|
|
|
67
71
|
width: '100%',
|
|
68
72
|
},
|
|
69
73
|
input: {
|
|
74
|
+
padding: '5px',
|
|
70
75
|
width: '100%',
|
|
76
|
+
minWidth: '60px',
|
|
71
77
|
},
|
|
72
|
-
},
|
|
78
|
+
}, autoSelect: true, className: "editable-column", value: val, type: type, onChange: handleChange, onKeyUp: editHandler, onMouseDown: (e) => e.stopPropagation(), ...InputProps }) }))] }));
|
|
73
79
|
});
|
|
74
80
|
exports.default = EditableColumn;
|
|
@@ -8,10 +8,6 @@ const debounce_1 = __importDefault(require("lodash/debounce"));
|
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const useCombinedRefs_1 = __importDefault(require("../hooks/useCombinedRefs"));
|
|
10
10
|
const styles = {
|
|
11
|
-
label: {
|
|
12
|
-
lineHeight: 2,
|
|
13
|
-
userSelect: 'none',
|
|
14
|
-
},
|
|
15
11
|
inputWrapper: {
|
|
16
12
|
borderRadius: '5px',
|
|
17
13
|
borderWidth: '0.55px',
|
|
@@ -26,7 +22,6 @@ const styles = {
|
|
|
26
22
|
outline: 'none',
|
|
27
23
|
flex: 1,
|
|
28
24
|
height: '100%',
|
|
29
|
-
textAlign: 'center',
|
|
30
25
|
width: '100%',
|
|
31
26
|
},
|
|
32
27
|
clearButton: {
|
|
@@ -39,103 +34,56 @@ const styles = {
|
|
|
39
34
|
padding: 0,
|
|
40
35
|
},
|
|
41
36
|
};
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
const pattern = /^(?:-?\d*|\d+)(?:\.\d{0,20})?$/;
|
|
45
|
-
if (value.trim() === '' || pattern.test(value)) {
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
function identity(value) {
|
|
53
|
-
return value;
|
|
54
|
-
}
|
|
55
|
-
function preventPropagate(event) {
|
|
56
|
-
event.stopPropagation();
|
|
37
|
+
function mapValue(value) {
|
|
38
|
+
return typeof value === 'number' && value === 0 ? value : value || '';
|
|
57
39
|
}
|
|
58
40
|
const Input = (0, react_1.forwardRef)((props, ref) => {
|
|
59
|
-
const { value =
|
|
41
|
+
const { value: externalValue = undefined, name, style = {
|
|
60
42
|
input: {},
|
|
61
43
|
inputWrapper: {},
|
|
62
|
-
}, onChange
|
|
63
|
-
const [
|
|
64
|
-
const
|
|
44
|
+
}, onChange, checkValue = () => true, type = 'text', autoSelect = false, className, renderIcon, canClear = false, onClear, datalist = [], debounceTime = 0, ...otherProps } = props;
|
|
45
|
+
const [internalValue, setInternalValue] = (0, react_1.useState)();
|
|
46
|
+
const value = debounceTime ? internalValue : externalValue;
|
|
65
47
|
const localRef = (0, react_1.useRef)();
|
|
66
48
|
const combinedRef = (0, useCombinedRefs_1.default)([ref, localRef]);
|
|
67
|
-
const debounceOnChange = (0, react_1.useMemo)(() => (0, debounce_1.default)((
|
|
68
|
-
onChange?.(
|
|
49
|
+
const debounceOnChange = (0, react_1.useMemo)(() => (0, debounce_1.default)((e) => {
|
|
50
|
+
onChange?.(e);
|
|
69
51
|
}, debounceTime), [debounceTime, onChange]);
|
|
70
52
|
(0, react_1.useEffect)(() => {
|
|
71
|
-
|
|
72
|
-
}, [value]);
|
|
73
|
-
(0, react_1.useEffect)(() => {
|
|
74
|
-
if (enableAutoSelect) {
|
|
53
|
+
if (autoSelect) {
|
|
75
54
|
combinedRef?.current?.select();
|
|
76
55
|
}
|
|
77
|
-
}, [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
? null
|
|
84
|
-
: Number(value)
|
|
85
|
-
: nullable && !value
|
|
86
|
-
? null
|
|
87
|
-
: value;
|
|
88
|
-
return format()(val);
|
|
89
|
-
}
|
|
56
|
+
}, [autoSelect, combinedRef]);
|
|
57
|
+
(0, react_1.useEffect)(() => {
|
|
58
|
+
if (debounceTime) {
|
|
59
|
+
setInternalValue(externalValue);
|
|
60
|
+
}
|
|
61
|
+
}, [debounceTime, externalValue]);
|
|
90
62
|
function onChangeHandler(e) {
|
|
91
63
|
e.stopPropagation();
|
|
92
64
|
e.preventDefault();
|
|
93
|
-
const
|
|
94
|
-
if (
|
|
95
|
-
const formatValue = format();
|
|
96
|
-
setVal(formatValue(_value));
|
|
97
|
-
valueRef.current = _value;
|
|
98
|
-
const val = {
|
|
99
|
-
...e,
|
|
100
|
-
target: { name: e.target.name, value: getValue(_value) },
|
|
101
|
-
};
|
|
65
|
+
const val = e.target.value;
|
|
66
|
+
if (checkValue(val)) {
|
|
102
67
|
if (debounceTime) {
|
|
103
|
-
|
|
68
|
+
setInternalValue(val);
|
|
69
|
+
debounceOnChange(e);
|
|
104
70
|
}
|
|
105
71
|
else {
|
|
106
|
-
onChange?.(
|
|
72
|
+
onChange?.(e);
|
|
107
73
|
}
|
|
108
74
|
}
|
|
109
75
|
}
|
|
110
|
-
function handleKeyDown(event) {
|
|
111
|
-
onKeyDown({
|
|
112
|
-
...event,
|
|
113
|
-
target: {
|
|
114
|
-
name: event.target.name,
|
|
115
|
-
value: getValue(valueRef.current),
|
|
116
|
-
},
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
function handleKeyUp(event) {
|
|
120
|
-
onKeyUp({
|
|
121
|
-
...event,
|
|
122
|
-
target: {
|
|
123
|
-
name: event.target.name,
|
|
124
|
-
value: getValue(valueRef.current),
|
|
125
|
-
},
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
76
|
function clearHandler() {
|
|
129
|
-
|
|
77
|
+
localRef.current?.setAttribute('value', '');
|
|
130
78
|
onClear?.();
|
|
131
79
|
}
|
|
132
80
|
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
133
|
-
...(renderIcon ||
|
|
81
|
+
...((renderIcon || canClear) && { padding: '0 5px' }),
|
|
134
82
|
...styles.inputWrapper,
|
|
135
83
|
...style?.inputWrapper,
|
|
136
84
|
}, className: `input ${className || ''}`, children: [renderIcon?.(), (0, jsx_runtime_1.jsx)("input", { ...otherProps, ref: combinedRef, name: name, style: {
|
|
137
85
|
...styles.input,
|
|
138
86
|
...style?.input,
|
|
139
|
-
}, type:
|
|
87
|
+
}, type: type, value: mapValue(value), onChange: onChangeHandler, list: `${name || ''}-data-list` }), canClear && value && ((0, jsx_runtime_1.jsx)("button", { type: "button", style: styles.clearButton, onClick: clearHandler, children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'block', margin: '0 auto' }, children: "\u2715" }) })), (0, jsx_runtime_1.jsx)("datalist", { id: `${name || ''}-data-list`, children: datalist.map((value) => ((0, jsx_runtime_1.jsx)("option", { value: value }, value))) })] }));
|
|
140
88
|
});
|
|
141
89
|
exports.default = Input;
|
|
@@ -27,7 +27,6 @@ exports.messagesColorPalettes = {
|
|
|
27
27
|
function Message(props) {
|
|
28
28
|
const { style = {}, type, children } = props;
|
|
29
29
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
30
|
-
fontSize: '1rem',
|
|
31
30
|
padding: '0.375rem 0.75rem',
|
|
32
31
|
borderRadius: '0.25rem',
|
|
33
32
|
backgroundColor: exports.messagesColorPalettes[type].tint,
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
7
|
const react_1 = require("react");
|
|
8
|
+
const useCombinedRefs_1 = __importDefault(require("../hooks/useCombinedRefs"));
|
|
5
9
|
const inputStyle = {
|
|
6
10
|
height: '100%',
|
|
7
11
|
width: '100px',
|
|
@@ -9,7 +13,13 @@ const inputStyle = {
|
|
|
9
13
|
border: '0.55px solid #c7c7c7',
|
|
10
14
|
textAlign: 'center',
|
|
11
15
|
};
|
|
12
|
-
const NumberInput = (0, react_1.forwardRef)(({ name, value: valueProp, style = {}, onChange, pattern = '^\\d*.\\d*$', step = 'any', min = 'any', max = 'any', ...otherProps }, ref) => {
|
|
13
|
-
|
|
16
|
+
const NumberInput = (0, react_1.forwardRef)(({ name, value: valueProp, style = {}, onChange, pattern = '^\\d*.\\d*$', step = 'any', min = 'any', max = 'any', autoSelect = false, ...otherProps }, ref) => {
|
|
17
|
+
const combinedRef = (0, useCombinedRefs_1.default)([ref]);
|
|
18
|
+
(0, react_1.useEffect)(() => {
|
|
19
|
+
if (autoSelect) {
|
|
20
|
+
combinedRef?.current?.select();
|
|
21
|
+
}
|
|
22
|
+
}, [autoSelect, combinedRef]);
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)("input", { ref: combinedRef, name: name, style: { ...inputStyle, ...style }, type: "number", pattern: pattern, value: valueProp, step: step, onChange: onChange, min: min, max: max, ...otherProps }));
|
|
14
24
|
});
|
|
15
25
|
exports.default = NumberInput;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PreferencesButton = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const fa_1 = require("react-icons/fa");
|
|
9
|
+
const ToolTip_1 = __importDefault(require("./ToolTip/ToolTip"));
|
|
10
|
+
function PreferencesButton({ onClick }) {
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Preferences", popupPlacement: "left", children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClick, children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) }) }));
|
|
12
|
+
}
|
|
13
|
+
exports.PreferencesButton = PreferencesButton;
|
|
@@ -7,14 +7,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const formik_1 = require("formik");
|
|
8
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
9
|
const Input_1 = __importDefault(require("../Input"));
|
|
10
|
-
function identity(value) {
|
|
11
|
-
return value;
|
|
12
|
-
}
|
|
13
10
|
function FormikInput(props) {
|
|
14
|
-
const { name, style = { label: {}, input: {}, inputWrapper: {} }, onChange
|
|
11
|
+
const { name, style = { label: {}, input: {}, inputWrapper: {} }, onChange, type = 'text', className = '', value = null, checkErrorAfterInputTouched = true, mapOnChangeValue, mapValue, ...resProps } = props;
|
|
15
12
|
const { values, handleChange, errors, touched, setFieldValue } = (0, formik_1.useFormikContext)();
|
|
16
13
|
function changeHandler(e) {
|
|
17
|
-
onChange(e);
|
|
14
|
+
onChange?.(e);
|
|
18
15
|
if (mapOnChangeValue) {
|
|
19
16
|
void setFieldValue(name, mapOnChangeValue(e.target.value));
|
|
20
17
|
}
|
|
@@ -41,6 +38,6 @@ function FormikInput(props) {
|
|
|
41
38
|
}
|
|
42
39
|
: {}),
|
|
43
40
|
},
|
|
44
|
-
},
|
|
41
|
+
}, className: className, ...resProps }));
|
|
45
42
|
}
|
|
46
43
|
exports.default = FormikInput;
|
|
@@ -62,6 +62,6 @@ function ConfirmationDialog({ style = {}, buttons = [], onClose, message, render
|
|
|
62
62
|
onClose();
|
|
63
63
|
}
|
|
64
64
|
}, [onClose]);
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: style, css: styles, "data-
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: style, css: styles, "data-testid": id, children: [render ? (render({ message, className: 'message' })) : ((0, jsx_runtime_1.jsx)("p", { className: "message", children: message })), (0, jsx_runtime_1.jsx)("div", { className: "buttons-container", children: buttons.map((option) => ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: (e) => optionsHandler(e, option), style: option.style && option.style, children: option.text }, option.text))) })] }));
|
|
66
66
|
}
|
|
67
67
|
exports.default = ConfirmationDialog;
|
|
@@ -56,21 +56,30 @@ const initialValues = {
|
|
|
56
56
|
};
|
|
57
57
|
function ApodizationOptionsInnerPanel(props) {
|
|
58
58
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
59
|
-
const
|
|
59
|
+
const previousPreviewRef = (0, react_1.useRef)(initialValues.livePreview);
|
|
60
60
|
function handleApplyFilter(values, triggerSource = 'apply') {
|
|
61
|
-
const { livePreview, ...
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
const { livePreview, ...options } = values;
|
|
62
|
+
switch (triggerSource) {
|
|
63
|
+
case 'onChange': {
|
|
64
|
+
if (livePreview || previousPreviewRef.current !== livePreview) {
|
|
65
|
+
dispatch({
|
|
66
|
+
type: 'CALCULATE_APODIZATION_FILTER',
|
|
67
|
+
payload: { livePreview, options },
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
case 'apply': {
|
|
73
|
+
dispatch({
|
|
74
|
+
type: 'APPLY_APODIZATION_FILTER',
|
|
75
|
+
payload: { options },
|
|
76
|
+
});
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
default:
|
|
80
|
+
break;
|
|
73
81
|
}
|
|
82
|
+
previousPreviewRef.current = livePreview;
|
|
74
83
|
}
|
|
75
84
|
function handleCancelFilter() {
|
|
76
85
|
dispatch({
|
|
@@ -81,7 +90,7 @@ function ApodizationOptionsInnerPanel(props) {
|
|
|
81
90
|
if (props.filter) {
|
|
82
91
|
formData = { ...initialValues, ...props.filter.value, livePreview: true };
|
|
83
92
|
}
|
|
84
|
-
return ((0, jsx_runtime_1.
|
|
93
|
+
return ((0, jsx_runtime_1.jsx)(HeaderContainer_1.HeaderContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { onSubmit: (values) => handleApplyFilter(values), initialValues: formData, validationSchema: validationSchema, children: ({ submitForm }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Line broadening : ", shortTitle: "LB :", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "lineBroadening", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Gauss broadening :", shortTitle: "GB :", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "gaussBroadening", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "lineBroadeningCenter [0 - 1] : ", shortTitle: "LB Center :", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "lineBroadeningCenter", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Live preview ", htmlFor: "livePreview", style: { label: { padding: '0 5px' } }, children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "livePreview" }) }), (0, jsx_runtime_1.jsx)(FormikOnChange_1.default, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true }), (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { onDone: submitForm, onCancel: handleCancelFilter })] })) }) }));
|
|
85
94
|
}
|
|
86
95
|
const MemoizedApodizationPanel = (0, react_1.memo)(ApodizationOptionsInnerPanel);
|
|
87
96
|
function ApodizationOptionsPanel() {
|
|
@@ -93,16 +93,37 @@ const formData = (algorithm, filterValues) => {
|
|
|
93
93
|
};
|
|
94
94
|
function BaseLineCorrectionInnerPanel(props) {
|
|
95
95
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
96
|
-
const
|
|
96
|
+
const previousPreviewRef = (0, react_1.useRef)(true);
|
|
97
97
|
const { algorithm: baseAlgorithm = 'polynomial' } = props?.filter?.value || {};
|
|
98
98
|
const [algorithm, setAlgorithm] = (0, react_1.useState)(baseAlgorithm);
|
|
99
99
|
const handleApplyFilter = (values, triggerSource = 'apply') => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
const { livePreview, ...options } = values;
|
|
101
|
+
switch (triggerSource) {
|
|
102
|
+
case 'onChange': {
|
|
103
|
+
if (livePreview || previousPreviewRef !== livePreview) {
|
|
104
|
+
dispatch({
|
|
105
|
+
type: 'CALCULATE_BASE_LINE_CORRECTION_FILTER',
|
|
106
|
+
payload: {
|
|
107
|
+
options,
|
|
108
|
+
livePreview,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
case 'apply': {
|
|
115
|
+
dispatch({
|
|
116
|
+
type: 'APPLY_BASE_LINE_CORRECTION_FILTER',
|
|
117
|
+
payload: {
|
|
118
|
+
options,
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
default:
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
previousPreviewRef.current = livePreview;
|
|
106
127
|
};
|
|
107
128
|
const handleCancelFilter = () => {
|
|
108
129
|
dispatch({
|
|
@@ -113,8 +134,8 @@ function BaseLineCorrectionInnerPanel(props) {
|
|
|
113
134
|
setAlgorithm(selectedAlgorithm);
|
|
114
135
|
}
|
|
115
136
|
const form = formData(algorithm, props?.filter?.value || {});
|
|
116
|
-
return ((0, jsx_runtime_1.jsxs)(HeaderContainer_1.HeaderContainer, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Algorithm: ", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(Select_1.default, { items: getAlgorithmsList(), value: algorithm, onChange: handleChangeAlgorithm }) }), (0, jsx_runtime_1.jsx)(formik_1.Formik, {
|
|
117
|
-
['autoPolynomial', 'polynomial'].includes(algorithm) && ((0, jsx_runtime_1.jsx)(Label_1.default, { title: "degree [ 1 - 6 ]:", shortTitle: "degree :", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "degree", min: 1, max: 6, style: inputStyle, debounceTime: 250 }) })), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "live preview ", htmlFor: "livePreview", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "livePreview" }) }), (0, jsx_runtime_1.jsx)(FormikOnChange_1.default, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true })
|
|
137
|
+
return ((0, jsx_runtime_1.jsxs)(HeaderContainer_1.HeaderContainer, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Algorithm: ", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(Select_1.default, { items: getAlgorithmsList(), value: algorithm, onChange: handleChangeAlgorithm }) }), (0, jsx_runtime_1.jsx)(formik_1.Formik, { onSubmit: (values) => handleApplyFilter(values), initialValues: form.values, validationSchema: form.validation, enableReinitialize: true, children: ({ submitForm }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [algorithm && algorithm === 'airpls' && ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "maxIterations:", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "maxIterations", debounceTime: 250, style: inputStyle }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "tolerance:", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "tolerance", debounceTime: 250, style: inputStyle }) })] })), algorithm &&
|
|
138
|
+
['autoPolynomial', 'polynomial'].includes(algorithm) && ((0, jsx_runtime_1.jsx)(Label_1.default, { title: "degree [ 1 - 6 ]:", shortTitle: "degree :", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "degree", min: 1, max: 6, style: inputStyle, debounceTime: 250 }) })), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "live preview ", htmlFor: "livePreview", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "livePreview" }) }), (0, jsx_runtime_1.jsx)(FormikOnChange_1.default, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true }), (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { onDone: submitForm, onCancel: handleCancelFilter })] })) })] }));
|
|
118
139
|
}
|
|
119
140
|
const MemoizedBaseLineCorrectionPanel = (0, react_1.memo)(BaseLineCorrectionInnerPanel);
|
|
120
141
|
function BaseLineCorrectionPanel() {
|