nmrium 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib/component/1d/IntegralsSeries.js +2 -6
- package/lib/component/1d/PeakAnnotation.js +2 -2
- package/lib/component/1d/PeakAnnotations.js +2 -4
- package/lib/component/1d/SpectraTracker.js +2 -2
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +28 -26
- package/lib/component/1d/ranges/Range.d.ts +1 -2
- package/lib/component/1d/ranges/Range.js +3 -4
- package/lib/component/1d/ranges/Ranges.js +3 -4
- package/lib/component/1d/tool/BaseLineZones.js +3 -6
- package/lib/component/1d/tool/VerticalIndicator.js +1 -1
- package/lib/component/2d/Contours.js +1 -5
- package/lib/component/2d/SignalDeltaLine.js +1 -1
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/YAxis.js +2 -2
- package/lib/component/2d/zones/IndicationLines.js +2 -3
- package/lib/component/EventsTrackers/KeysListenerTracker.js +59 -41
- package/lib/component/NMRium.d.ts +14 -49
- package/lib/component/NMRium.js +14 -6
- package/lib/component/SplitPaneWrapper.js +2 -2
- package/lib/component/context/PreferencesContext.d.ts +3 -43
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/Logo.js +1 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -0
- package/lib/component/elements/Tab/Tabs.js +2 -1
- package/lib/component/elements/ToggleButton.js +2 -2
- package/lib/component/elements/accordion/Accordion.js +2 -6
- package/lib/component/elements/formik/Input.js +1 -1
- package/lib/component/elements/popup/Modal/Modal.js +1 -1
- package/lib/component/elements/popup/Modal/ModalContent.js +1 -1
- package/lib/component/elements/toggle/ToggleButtonGroup.js +2 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +7 -4
- package/lib/component/header/Header.js +2 -2
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +2 -1
- package/lib/component/hooks/useExport.js +2 -2
- package/lib/component/hooks/useFormatNumberByNucleus.js +3 -4
- package/lib/component/loader/DropZone.js +8 -2
- package/lib/component/loader/NoData.d.ts +3 -2
- package/lib/component/loader/NoData.js +31 -30
- package/lib/component/modal/MoleculeStructureEditorModal.js +2 -2
- package/lib/component/modal/editRange/EditRangeModal.d.ts +3 -3
- package/lib/component/modal/editRange/EditRangeModal.js +49 -54
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +9 -22
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +12 -50
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.d.ts +2 -0
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +34 -0
- package/lib/component/modal/editRange/forms/components/SignalFormTab.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/SignalFormTab.js +11 -14
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +18 -29
- package/lib/component/modal/editZone/SignalsForm.js +1 -1
- package/lib/component/modal/setting/DatabasesTabContent.d.ts +2 -1
- package/lib/component/modal/setting/DatabasesTabContent.js +28 -30
- package/lib/component/modal/setting/settingsValidation.d.ts +150 -42
- package/lib/component/modal/setting/settingsValidation.js +6 -4
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +13 -15
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +8 -15
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/Panels.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +12 -3
- package/lib/component/panels/RangesPanel/RangesPanel.js +19 -19
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +4 -4
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +48 -30
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -3
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -8
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
- package/lib/component/panels/SummaryPanel/utilities/{IsInView.d.ts → useInView.d.ts} +2 -2
- package/lib/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +13 -13
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +4 -0
- package/lib/component/panels/databasePanel/DatabasePanel.js +80 -26
- package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.d.ts +7 -0
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js +8 -0
- package/lib/component/panels/databasePanel/DatabaseTable.js +14 -9
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +2 -4
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -3
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib/component/reducer/Reducer.d.ts +8 -66
- package/lib/component/reducer/Reducer.js +13 -8
- package/lib/component/reducer/actions/DatabaseActions.d.ts +3 -2
- package/lib/component/reducer/actions/DatabaseActions.js +21 -3
- package/lib/component/reducer/actions/DomainActions.js +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts +2 -1
- package/lib/component/reducer/actions/FiltersActions.js +25 -4
- package/lib/component/reducer/actions/PreferencesActions.js +32 -20
- package/lib/component/reducer/actions/RangesActions.d.ts +2 -2
- package/lib/component/reducer/actions/RangesActions.js +45 -11
- package/lib/component/reducer/actions/SpectrumsActions.js +6 -9
- package/lib/component/reducer/actions/ToolsActions.js +66 -53
- package/lib/component/reducer/helper/getSpectrum.d.ts +5 -0
- package/lib/component/reducer/helper/getSpectrum.js +14 -0
- package/lib/component/reducer/preferences/actions/initPreferences.js +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +4 -4
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +23 -10
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib/component/reducer/types/Types.d.ts +3 -1
- package/lib/component/reducer/types/Types.js +3 -1
- package/lib/component/tool/BrushX.js +1 -1
- package/lib/component/tool/BrushXY.js +1 -1
- package/lib/component/tool/CrossLinePointer.js +1 -1
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +4 -3
- package/lib/component/toolbar/BasicToolBar.js +0 -1
- package/lib/component/toolbar/FunctionToolBar.js +9 -13
- package/lib/component/toolbar/ToolTypes.d.ts +1 -1
- package/lib/component/toolbar/ToolTypes.js +3 -3
- package/lib/component/utility/Export.d.ts +7 -1
- package/lib/component/utility/Export.js +3 -3
- package/lib/component/utility/formatNumber.d.ts +1 -1
- package/lib/component/utility/formatNumber.js +4 -2
- package/lib/component/utility/isGoogleDocument.d.ts +1 -0
- package/lib/component/utility/isGoogleDocument.js +3 -0
- package/lib/component/utility/nmredataToNmrium.js +1 -2
- package/lib/component/utility/nmriumToNmredata.d.ts +2 -2
- package/lib/component/utility/nmriumToNmredata.js +2 -2
- package/lib/component/utility/util/nmredata/addSource.js +2 -2
- package/lib/component/workspaces/Workspace.d.ts +9 -4
- package/lib/component/workspaces/basic.js +15 -8
- package/lib/component/workspaces/exercise.js +2 -2
- package/lib/component/workspaces/process1D.js +1 -1
- package/lib/data/FiltersManager.js +1 -1
- package/lib/data/PredictionManager.js +7 -9
- package/lib/data/SpectraManager.d.ts +4 -12
- package/lib/data/SpectraManager.js +14 -23
- package/lib/data/data1d/Data1DManager.js +8 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +8 -10
- package/lib/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +36 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +38 -15
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -1
- package/lib/data/data1d/database.d.ts +5 -3
- package/lib/data/data1d/database.js +54 -4
- package/lib/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib/data/data2d/Processing2D.js +1 -1
- package/lib/data/molecules/Molecule.d.ts +4 -5
- package/lib/data/molecules/Molecule.js +3 -1
- package/lib/data/utilities/FindUtilities.js +1 -3
- package/lib/data/utilities/RangeUtilities.js +5 -6
- package/lib/data/utilities/ZoneUtilities.js +1 -1
- package/lib/data/utilities/getSum.js +1 -3
- package/lib/data/utilities/isMolFileEmpty.d.ts +1 -0
- package/lib/data/utilities/isMolFileEmpty.js +6 -0
- package/lib/types/NMRiumDataReturn.d.ts +15 -0
- package/lib/types/NMRiumDataReturn.js +1 -0
- package/lib/types/NMRiumGeneralPreferences.d.ts +10 -0
- package/lib/types/NMRiumGeneralPreferences.js +1 -0
- package/lib/types/NMRiumPanelPreferences.d.ts +16 -0
- package/lib/types/NMRiumPanelPreferences.js +1 -0
- package/lib/types/NMRiumToolBarPreferences.d.ts +20 -0
- package/lib/types/NMRiumToolBarPreferences.js +1 -0
- package/lib/types/Preferences.d.ts +5 -0
- package/lib/types/Preferences.js +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib-cjs/component/1d/IntegralsSeries.js +2 -6
- package/lib-cjs/component/1d/PeakAnnotation.js +2 -2
- package/lib-cjs/component/1d/PeakAnnotations.js +2 -4
- package/lib-cjs/component/1d/SpectraTracker.js +2 -2
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +30 -25
- package/lib-cjs/component/1d/ranges/Range.js +3 -4
- package/lib-cjs/component/1d/ranges/Ranges.js +3 -4
- package/lib-cjs/component/1d/tool/BaseLineZones.js +3 -6
- package/lib-cjs/component/1d/tool/VerticalIndicator.js +1 -1
- package/lib-cjs/component/2d/Contours.js +1 -5
- package/lib-cjs/component/2d/SignalDeltaLine.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +1 -1
- package/lib-cjs/component/2d/YAxis.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +2 -3
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +59 -41
- package/lib-cjs/component/NMRium.js +13 -5
- package/lib-cjs/component/SplitPaneWrapper.js +2 -2
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/Logo.js +1 -1
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -0
- package/lib-cjs/component/elements/Tab/Tabs.js +2 -1
- package/lib-cjs/component/elements/ToggleButton.js +2 -2
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -6
- package/lib-cjs/component/elements/formik/Input.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/Modal.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +1 -1
- package/lib-cjs/component/elements/toggle/ToggleButtonGroup.js +2 -2
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
- package/lib-cjs/component/header/Header.js +2 -2
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +2 -1
- package/lib-cjs/component/hooks/useExport.js +2 -2
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +2 -3
- package/lib-cjs/component/loader/DropZone.js +8 -2
- package/lib-cjs/component/loader/NoData.js +31 -30
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +2 -2
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +47 -52
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +9 -22
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +12 -50
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +38 -0
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormTab.js +13 -16
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +18 -29
- package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +31 -33
- package/lib-cjs/component/modal/setting/settingsValidation.js +6 -4
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +12 -14
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +8 -15
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
- package/lib-cjs/component/panels/Panels.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +10 -1
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +18 -18
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +47 -29
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +6 -8
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
- package/lib-cjs/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +12 -12
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +78 -24
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabaseStructureSearchModal.js +15 -0
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +14 -9
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +2 -4
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -3
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib-cjs/component/reducer/Reducer.js +13 -8
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +22 -3
- package/lib-cjs/component/reducer/actions/DomainActions.js +1 -1
- package/lib-cjs/component/reducer/actions/FiltersActions.js +26 -4
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +30 -18
- package/lib-cjs/component/reducer/actions/RangesActions.js +46 -12
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +4 -7
- package/lib-cjs/component/reducer/actions/ToolsActions.js +63 -73
- package/lib-cjs/component/reducer/helper/getSpectrum.js +18 -0
- package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +1 -1
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +4 -4
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib-cjs/component/reducer/types/Types.js +5 -3
- package/lib-cjs/component/tool/BrushX.js +1 -1
- package/lib-cjs/component/tool/BrushXY.js +1 -1
- package/lib-cjs/component/tool/CrossLinePointer.js +1 -1
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +3 -2
- package/lib-cjs/component/toolbar/BasicToolBar.js +0 -1
- package/lib-cjs/component/toolbar/FunctionToolBar.js +9 -13
- package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
- package/lib-cjs/component/utility/Export.js +4 -3
- package/lib-cjs/component/utility/formatNumber.js +3 -1
- package/lib-cjs/component/utility/isGoogleDocument.js +7 -0
- package/lib-cjs/component/utility/nmredataToNmrium.js +1 -2
- package/lib-cjs/component/utility/util/nmredata/addSource.js +2 -2
- package/lib-cjs/component/workspaces/basic.js +15 -8
- package/lib-cjs/component/workspaces/exercise.js +2 -2
- package/lib-cjs/component/workspaces/process1D.js +1 -1
- package/lib-cjs/data/FiltersManager.js +1 -1
- package/lib-cjs/data/PredictionManager.js +7 -9
- package/lib-cjs/data/SpectraManager.js +14 -23
- package/lib-cjs/data/data1d/Data1DManager.js +8 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +40 -16
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -1
- package/lib-cjs/data/data1d/database.js +55 -5
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib-cjs/data/data2d/Processing2D.js +1 -1
- package/lib-cjs/data/molecules/Molecule.js +3 -1
- package/lib-cjs/data/utilities/FindUtilities.js +1 -3
- package/lib-cjs/data/utilities/RangeUtilities.js +8 -6
- package/lib-cjs/data/utilities/ZoneUtilities.js +1 -1
- package/lib-cjs/data/utilities/getSum.js +1 -3
- package/lib-cjs/data/utilities/isMolFileEmpty.js +10 -0
- package/lib-cjs/types/NMRiumDataReturn.js +2 -0
- package/lib-cjs/types/NMRiumGeneralPreferences.js +2 -0
- package/lib-cjs/types/NMRiumPanelPreferences.js +2 -0
- package/lib-cjs/types/NMRiumToolBarPreferences.js +2 -0
- package/lib-cjs/types/Preferences.js +2 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +31 -31
- package/lib/component/1d/multiplicityTree/TempMultiplicityTree.d.ts +0 -2
- package/lib/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -14
- package/lib/component/panels/databasePanel/useDatabases.d.ts +0 -5
- package/lib/component/panels/databasePanel/useDatabases.js +0 -10
- package/lib-cjs/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -20
- package/lib-cjs/component/panels/databasePanel/useDatabases.js +0 -14
|
@@ -3,28 +3,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("
|
|
7
|
-
/** @jsxImportSource @emotion/react */
|
|
8
|
-
const react_1 = require("@emotion/react");
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
7
|
const formik_1 = require("formik");
|
|
10
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
11
|
-
const
|
|
9
|
+
const react_1 = require("react");
|
|
12
10
|
const fa_1 = require("react-icons/fa");
|
|
11
|
+
const generateID_1 = __importDefault(require("../../../data/utilities/generateID"));
|
|
13
12
|
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
14
13
|
const FormikCheckBox_1 = __importDefault(require("../../elements/formik/FormikCheckBox"));
|
|
15
14
|
const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
|
|
15
|
+
const isGoogleDocument_1 = require("../../utility/isGoogleDocument");
|
|
16
16
|
const workspaces_1 = __importDefault(require("../../workspaces"));
|
|
17
17
|
const style = {
|
|
18
|
-
addButton: (0, react_1.css) `
|
|
19
|
-
background-color: transparent;
|
|
20
|
-
border: 0;
|
|
21
|
-
outline: none;
|
|
22
|
-
margin-left: 5px;
|
|
23
|
-
svg {
|
|
24
|
-
font-size: 14px;
|
|
25
|
-
fill: green;
|
|
26
|
-
}
|
|
27
|
-
`,
|
|
28
18
|
table: {
|
|
29
19
|
width: '100%',
|
|
30
20
|
},
|
|
@@ -32,7 +22,7 @@ const style = {
|
|
|
32
22
|
fontSize: '12px',
|
|
33
23
|
},
|
|
34
24
|
input: {
|
|
35
|
-
|
|
25
|
+
width: '100%',
|
|
36
26
|
},
|
|
37
27
|
labelCol: {
|
|
38
28
|
width: '30%',
|
|
@@ -40,41 +30,49 @@ const style = {
|
|
|
40
30
|
serialCol: {
|
|
41
31
|
width: '5%',
|
|
42
32
|
},
|
|
33
|
+
checkbox: {
|
|
34
|
+
display: 'block',
|
|
35
|
+
margin: '0 auto',
|
|
36
|
+
width: 'fit-content',
|
|
37
|
+
},
|
|
43
38
|
};
|
|
44
39
|
function DatabasesTabContent({ currentWorkspace }) {
|
|
45
40
|
const { values, setFieldValue } = (0, formik_1.useFormikContext)();
|
|
46
|
-
const databases = (0,
|
|
47
|
-
const deleteHandler = (0,
|
|
48
|
-
const _database = databases.slice();
|
|
41
|
+
const databases = (0, react_1.useMemo)(() => (0, get_1.default)(values, 'databases', []), [values]);
|
|
42
|
+
const deleteHandler = (0, react_1.useCallback)((index) => {
|
|
43
|
+
const _database = databases.data.slice();
|
|
49
44
|
_database.splice(index, 1);
|
|
50
|
-
setFieldValue('databases', _database);
|
|
45
|
+
setFieldValue('databases.data', _database);
|
|
51
46
|
}, [databases, setFieldValue]);
|
|
52
|
-
const addNewDatabaseHandler = (0,
|
|
47
|
+
const addNewDatabaseHandler = (0, react_1.useCallback)(() => {
|
|
53
48
|
const newDatabase = {
|
|
49
|
+
key: (0, generateID_1.default)(),
|
|
54
50
|
label: '',
|
|
55
51
|
url: '',
|
|
56
52
|
enabled: true,
|
|
57
53
|
};
|
|
58
|
-
setFieldValue('databases', [...databases, newDatabase]);
|
|
54
|
+
setFieldValue('databases.data', [...databases.data, newDatabase]);
|
|
59
55
|
}, [databases, setFieldValue]);
|
|
60
|
-
const resetDatabaseHandler = (0,
|
|
61
|
-
const database = workspaces_1.default?.[currentWorkspace]?.databases ||
|
|
62
|
-
|
|
56
|
+
const resetDatabaseHandler = (0, react_1.useCallback)(() => {
|
|
57
|
+
const database = workspaces_1.default?.[currentWorkspace]?.databases.data ||
|
|
58
|
+
workspaces_1.default.default.databases.data;
|
|
59
|
+
setFieldValue('databases.data', database);
|
|
63
60
|
}, [currentWorkspace, setFieldValue]);
|
|
64
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)("fieldset", { onClick: (e) => {
|
|
62
|
+
if (e.target.checked) {
|
|
63
|
+
e.target.checked = false;
|
|
64
|
+
setFieldValue('databases.defaultDatabase', '');
|
|
65
|
+
}
|
|
66
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: "section-header", style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)("p", { style: { flex: 1 }, children: "Databases" }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Danger, { fill: "clear", size: "xSmall", onClick: resetDatabaseHandler, style: { margin: '0 5px' }, children: "Reset Databases" }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "outline", size: "xSmall", onClick: addNewDatabaseHandler, children: "Add Database" })] })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("table", { style: style.table, children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { style: style.th, children: "#" }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "Label " }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "URL" }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "Enabled" }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "Auto Load" }), (0, jsx_runtime_1.jsx)("th", {})] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: databases?.data.map((item, index) => {
|
|
65
67
|
const num = index + 1;
|
|
66
68
|
return (
|
|
67
69
|
// eslint-disable-next-line react/no-array-index-key
|
|
68
|
-
(0, jsx_runtime_1.jsxs)("tr", { style: { height: '33px' }, children: [(0, jsx_runtime_1.jsxs)("td", { style: style.serialCol, children: [(0, jsx_runtime_1.jsx)("span", { children: num }), ' '] }), (0, jsx_runtime_1.jsx)("td", { style: style.labelCol, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { style: style.input, name: `databases.${index}.label`, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { style: style.input, name: `databases.${index}.url`, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { style: {
|
|
69
|
-
container:
|
|
70
|
-
|
|
71
|
-
margin: '0 auto',
|
|
72
|
-
width: 'fit-content',
|
|
73
|
-
},
|
|
74
|
-
}, className: "checkbox-element", name: `databases.${index}.enabled` }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
70
|
+
(0, jsx_runtime_1.jsxs)("tr", { style: { height: '33px' }, children: [(0, jsx_runtime_1.jsxs)("td", { style: style.serialCol, children: [(0, jsx_runtime_1.jsx)("span", { children: num }), ' '] }), (0, jsx_runtime_1.jsx)("td", { style: style.labelCol, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { style: { input: style.input }, name: `databases.data.${index}.label`, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { style: { input: style.input }, name: `databases.data.${index}.url`, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { style: {
|
|
71
|
+
container: style.checkbox,
|
|
72
|
+
}, className: "checkbox-element", name: `databases.data.${index}.enabled` }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(formik_1.Field, { style: style.checkbox, type: "radio", name: "databases.defaultDatabase", value: item.key }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
75
73
|
display: 'flex',
|
|
76
74
|
height: '100%',
|
|
77
|
-
}, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: () => deleteHandler(index), children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }), databases.length === index + 1 && ((0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", style: { fontSize: '14px' }, onClick: addNewDatabaseHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }))] }) })] }, `${index}`));
|
|
75
|
+
}, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: () => deleteHandler(index), children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }), databases.length === index + 1 && ((0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", style: { fontSize: '14px' }, onClick: addNewDatabaseHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) })), (0, isGoogleDocument_1.isGoogleDocument)(item.url) && ((0, jsx_runtime_1.jsx)(Button_1.default.Action, { style: { fontSize: '13px' }, fill: "clear", onClick: () => window.open(item.url, '_blank'), children: (0, jsx_runtime_1.jsx)(fa_1.FaLink, {}) }))] }) })] }, `${index}`));
|
|
78
76
|
}) })] }) })] }));
|
|
79
77
|
}
|
|
80
78
|
exports.default = DatabasesTabContent;
|
|
@@ -62,10 +62,12 @@ const formattingValidation = (obj) => Yup.object().shape({
|
|
|
62
62
|
return new Yup.ValidationError(errors);
|
|
63
63
|
}),
|
|
64
64
|
});
|
|
65
|
-
const databasesValidation = Yup.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
const databasesValidation = Yup.object().shape({
|
|
66
|
+
data: Yup.array().of(Yup.object().shape({
|
|
67
|
+
label: Yup.string().trim().required('Label is a required field'),
|
|
68
|
+
url: Yup.string().trim().url().required('URL is a required field'),
|
|
69
|
+
})),
|
|
70
|
+
});
|
|
69
71
|
exports.validation = Yup.lazy((obj) => Yup.object().shape({
|
|
70
72
|
formatting: formattingValidation(obj),
|
|
71
73
|
databases: databasesValidation,
|
|
@@ -99,20 +99,18 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
99
99
|
}
|
|
100
100
|
return [];
|
|
101
101
|
}, [filterIsActive, info.dimension, integrals, xDomain]);
|
|
102
|
-
return ((0, jsx_runtime_1.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
? `Change Integrals Sum (${Number(currentSum).toFixed(2)})`
|
|
115
|
-
: 'Change Integrals Sum', popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { className: "fix-integral-toggle-btn", popupTitle: "fix integral values", popupPlacement: "right", onClick: toggleConstantSumHandler, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(IntegralTable_1.default, { data: filteredData, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(IntegralsPreferences_1.default, { ref: settingRef })) })] }) }));
|
|
102
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: [
|
|
103
|
+
BasicPanelStyle_1.tablePanelStyle,
|
|
104
|
+
style,
|
|
105
|
+
isFlipped &&
|
|
106
|
+
(0, react_1.css) `
|
|
107
|
+
th {
|
|
108
|
+
position: relative;
|
|
109
|
+
}
|
|
110
|
+
`,
|
|
111
|
+
], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: integrals?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Integrals", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all integrals' : 'Hide integrals out of view', filterIsActive: filterIsActive, counterFiltered: filteredData.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: [(0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: currentSum
|
|
112
|
+
? `Change Integrals Sum (${Number(currentSum).toFixed(2)})`
|
|
113
|
+
: 'Change Integrals Sum', popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { className: "fix-integral-toggle-btn", popupTitle: "fix integral values", popupPlacement: "right", onClick: toggleConstantSumHandler, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(IntegralTable_1.default, { data: filteredData, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(IntegralsPreferences_1.default, { ref: settingRef })) })] }));
|
|
116
114
|
}
|
|
117
115
|
const MemoizedIntegralPanel = (0, react_2.memo)(IntegralPanelInner);
|
|
118
116
|
const emptyData = { integrals: {}, info: {} };
|
|
@@ -22,8 +22,6 @@ const useAtomAssignment_1 = __importDefault(require("./useAtomAssignment"));
|
|
|
22
22
|
const styles = {
|
|
23
23
|
panel: (0, react_1.css)({
|
|
24
24
|
display: 'flex',
|
|
25
|
-
overflow: 'auto',
|
|
26
|
-
flexGrow: 1,
|
|
27
25
|
width: '100%',
|
|
28
26
|
height: '100%',
|
|
29
27
|
flexDirection: 'column',
|
|
@@ -32,26 +30,21 @@ const styles = {
|
|
|
32
30
|
display: 'flex',
|
|
33
31
|
flex: '1',
|
|
34
32
|
flexDirection: 'column',
|
|
35
|
-
overflow: 'auto',
|
|
36
33
|
}),
|
|
37
34
|
molecule: (0, react_1.css)({
|
|
38
|
-
|
|
39
|
-
flex: '1',
|
|
35
|
+
flex: 1,
|
|
40
36
|
}),
|
|
41
37
|
slider: (0, react_1.css)({
|
|
42
38
|
display: 'flex',
|
|
43
39
|
flexDirection: 'column',
|
|
44
40
|
justifyContent: 'center',
|
|
45
41
|
alignItems: 'center',
|
|
46
|
-
|
|
47
|
-
minHeight: 0,
|
|
42
|
+
flex: 1,
|
|
48
43
|
}),
|
|
49
44
|
items: (0, react_1.css)({
|
|
50
45
|
display: 'flex',
|
|
51
46
|
flexDirection: 'column',
|
|
52
|
-
flex: '1 1 0%',
|
|
53
47
|
height: '100%',
|
|
54
|
-
minHeight: 0,
|
|
55
48
|
}),
|
|
56
49
|
};
|
|
57
50
|
function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab, displayerMode, onMoleculeChange, actionsOptions, children, }) {
|
|
@@ -83,17 +76,17 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
|
|
|
83
76
|
const moleculeIndexHandler = (0, react_2.useCallback)((index) => {
|
|
84
77
|
setCurrentIndex(index);
|
|
85
78
|
}, []);
|
|
86
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: styles.panel, children: [(0, jsx_runtime_1.jsx)(MoleculePanelHeader_1.default, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditor(), onMoleculeIndexChange: moleculeIndexHandler, actionsOptions: actionsOptions }), (0, jsx_runtime_1.jsxs)("div", { css: styles.innerPanel, children: [(0, jsx_runtime_1.jsx)("div", { css: styles.molecule, children: (0, jsx_runtime_1.jsx)(NextPrev_1.default, { onChange: (slideIndex) => setCurrentIndex(slideIndex), defaultIndex: currentIndex, children:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
79
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: styles.panel, children: [(0, jsx_runtime_1.jsx)(MoleculePanelHeader_1.default, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditor(), onMoleculeIndexChange: moleculeIndexHandler, actionsOptions: actionsOptions }), (0, jsx_runtime_1.jsxs)("div", { css: styles.innerPanel, children: [(0, jsx_runtime_1.jsx)("div", { css: styles.molecule, children: (0, jsx_runtime_1.jsx)(NextPrev_1.default, { onChange: (slideIndex) => setCurrentIndex(slideIndex), defaultIndex: currentIndex, children: (0, jsx_runtime_1.jsx)(react_d3_utils_1.ResponsiveChart, { children: ({ height, width }) => {
|
|
80
|
+
return molecules && molecules.length > 0 ? (molecules.map((mol, index) => ((0, jsx_runtime_1.jsxs)("div", { css: styles.items, children: [(0, jsx_runtime_1.jsx)(MoleculeHeader_1.default, { currentMolecule: mol, molecules: molecules }), (0, jsx_runtime_1.jsx)("div", { css: styles.slider, className: "mol-svg-container", onDoubleClick: () => openMoleculeEditor(mol), style: {
|
|
81
|
+
backgroundColor: (index + 1) % 2 !== 0 ? '#fafafa' : 'white',
|
|
82
|
+
}, children: (0, jsx_runtime_1.jsx)(react_ocl_nmr_1.default, { OCL: full_1.default, id: `molSVG${index}`, width: width, height: height - 60, molfile: mol.molfile || '', setMolfile: (molfile) => handleReplaceMolecule(mol, molfile), setSelectedAtom: handleOnClickAtom, atomHighlightColor: currentDiaIDsToHighlight &&
|
|
90
83
|
currentDiaIDsToHighlight.length > 0
|
|
91
84
|
? 'red'
|
|
92
85
|
: '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight &&
|
|
93
86
|
currentDiaIDsToHighlight.length > 0
|
|
94
87
|
? currentDiaIDsToHighlight
|
|
95
|
-
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }));
|
|
96
|
-
|
|
88
|
+
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }) })] }, mol.key)))) : ((0, jsx_runtime_1.jsx)("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditor(), children: (0, jsx_runtime_1.jsx)("span", { children: "Click to draw molecule" }) }));
|
|
89
|
+
} }) }) }), children] })] }));
|
|
97
90
|
}
|
|
98
91
|
const MemoizedMoleculePanel = (0, react_2.memo)(MoleculePanelInner);
|
|
99
92
|
const emptyData = { ranges: {}, zones: {} };
|
|
@@ -134,7 +134,7 @@ function PanelsInner({ displayerMode: displayedMode }) {
|
|
|
134
134
|
const check = (0, react_1.useCallback)((item) => {
|
|
135
135
|
const panelOptions = getPanelPreferences(item);
|
|
136
136
|
return ((panelOptions?.hidden !== true &&
|
|
137
|
-
panelOptions?.display
|
|
137
|
+
panelOptions?.display &&
|
|
138
138
|
item.isExperimental === undefined &&
|
|
139
139
|
(item.mode == null || item.mode === displayedMode)) ||
|
|
140
140
|
(item.isExperimental && isExperimental));
|
|
@@ -25,6 +25,7 @@ const Types_1 = require("../../reducer/types/Types");
|
|
|
25
25
|
const Export_1 = require("../../utility/Export");
|
|
26
26
|
const formatNumber_1 = require("../../utility/formatNumber");
|
|
27
27
|
const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
|
|
28
|
+
const useEditRangeModal_1 = __importDefault(require("./hooks/useEditRangeModal"));
|
|
28
29
|
const style = (0, react_1.css) `
|
|
29
30
|
.btn {
|
|
30
31
|
background-color: transparent;
|
|
@@ -130,10 +131,18 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
|
|
|
130
131
|
payload: flag,
|
|
131
132
|
});
|
|
132
133
|
}, [dispatch]);
|
|
134
|
+
const { editRange } = (0, useEditRangeModal_1.default)();
|
|
135
|
+
const addRangeHandler = (0, react_2.useCallback)(() => {
|
|
136
|
+
dispatch({
|
|
137
|
+
type: Types_1.ADD_RANGE,
|
|
138
|
+
payload: { id: 'new' },
|
|
139
|
+
});
|
|
140
|
+
editRange(true);
|
|
141
|
+
}, [dispatch, editRange]);
|
|
133
142
|
return ((0, jsx_runtime_1.jsx)("div", { css: style, children: (0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: ranges?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Ranges", onFilter: onFilterActivated, filterToolTip: isFilterActive ? 'Show all ranges' : 'Hide ranges out of view', filterIsActive: isFilterActive, counterFiltered: filterCounter, showSettingButton: true, onSettingClick: onSettingClick, children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Preview publication string", popupPlacement: "right", onClick: saveAsHTMLHandler, className: "btn preview-publication-icon", children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: currentSum
|
|
134
143
|
? `Change Ranges Sum (${Number(currentSum).toFixed(2)})`
|
|
135
144
|
: 'Change Ranges Sum', popupPlacement: "right", onClick: showChangeRangesSumModal, className: "btn icon", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Remove all Assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !ranges || !ranges.values || ranges.values.length === 0, className: "btn icon", children: (0, jsx_runtime_1.jsx)(fa_1.FaUnlink, {}) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { testID: "toggle-multiplicity-tree-btn", popupTitle: showMultiplicityTrees
|
|
136
145
|
? 'Hide Multiplicity Trees in Spectrum'
|
|
137
|
-
: 'Show Multiplicity Trees in Spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, defaultValue: showRangesIntegrals, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { className: "icon", popupTitle: "fix integral values", popupPlacement: "right", onClick: changeSumConstantFlagHandler, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) })] }) }));
|
|
146
|
+
: 'Show Multiplicity Trees in Spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, defaultValue: showRangesIntegrals, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { className: "icon", popupTitle: "fix integral values", popupPlacement: "right", onClick: changeSumConstantFlagHandler, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Add range", popupPlacement: "right", onClick: addRangeHandler, className: "btn icon", children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) })] }) }));
|
|
138
147
|
}
|
|
139
148
|
exports.default = RangesHeader;
|
|
@@ -103,24 +103,24 @@ function RangesTablePanelInner({ ranges, data, info, xDomain, preferences, activ
|
|
|
103
103
|
settingRef.current.saveSetting();
|
|
104
104
|
setFlipStatus(false);
|
|
105
105
|
}, []);
|
|
106
|
-
return ((0, jsx_runtime_1.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
106
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: [
|
|
107
|
+
BasicPanelStyle_1.tablePanelStyle,
|
|
108
|
+
isFlipped &&
|
|
109
|
+
(0, react_1.css) `
|
|
110
|
+
th {
|
|
111
|
+
position: relative;
|
|
112
|
+
}
|
|
113
|
+
`,
|
|
114
|
+
], children: [!isFlipped && ((0, jsx_runtime_1.jsx)(RangesHeader_1.default, { ...{
|
|
115
|
+
ranges,
|
|
116
|
+
info,
|
|
117
|
+
activeTab,
|
|
118
|
+
molecules,
|
|
119
|
+
showRangesIntegrals,
|
|
120
|
+
showMultiplicityTrees,
|
|
121
|
+
showJGraph,
|
|
122
|
+
isFilterActive,
|
|
123
|
+
}, onUnlink: unlinkRangeHandler, onFilterActivated: filterHandler, onSettingClick: settingsPanelHandler, filterCounter: rangesData.length })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)("div", { className: "table-container", children: rangesData && rangesData.length > 0 ? ((0, jsx_runtime_1.jsx)(RangesTable_1.default, { activeTab: activeTab, tableData: rangesData, onUnlink: unlinkRangeHandler, context: contextMenu, preferences: preferences, info: info })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, {})) })) : ((0, jsx_runtime_1.jsx)(RangesPreferences_1.default, { ref: settingRef })) })] }));
|
|
124
124
|
}
|
|
125
125
|
const MemoizedRangesTablePanel = (0, react_2.memo)(RangesTablePanelInner);
|
|
126
126
|
const emptyData = { ranges: {}, data: {}, info: {} };
|
|
@@ -33,6 +33,6 @@ const selectBoxStyle = {
|
|
|
33
33
|
};
|
|
34
34
|
function ActionsColumn({ rowData, onHoverSignal, rowSpanTags, showKind, }) {
|
|
35
35
|
const { editRange, deleteRange, changeRangeSignalKind, zoomRange } = (0, useEditRangeModal_1.default)(rowData);
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Fragment, { children: [showKind && ((0, jsx_runtime_1.jsx)("td", { ...onHoverSignal, children: (0, jsx_runtime_1.jsx)(Select_1.default, { onChange: changeRangeSignalKind, data: SignalsKinds_1.SignalKinds, defaultValue: rowData.tableMetaInfo.signal.kind, style: selectBoxStyle }) })), (0, jsx_runtime_1.jsxs)("td", { ...rowSpanTags, css: styles, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", className: "delete-button", onClick: deleteRange, children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "zoom-button", onClick: zoomRange, children: (0, jsx_runtime_1.jsx)(fa_1.FaSearchPlus, { title: "Zoom to range in spectrum" }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "edit-button", onClick: editRange, children: (0, jsx_runtime_1.jsx)(fa_1.FaEdit, { color: "blue" }) })] })] }));
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Fragment, { children: [showKind && ((0, jsx_runtime_1.jsx)("td", { ...onHoverSignal, children: (0, jsx_runtime_1.jsx)(Select_1.default, { onChange: changeRangeSignalKind, data: SignalsKinds_1.SignalKinds, defaultValue: rowData.tableMetaInfo.signal.kind, style: selectBoxStyle }) })), (0, jsx_runtime_1.jsxs)("td", { ...rowSpanTags, css: styles, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", className: "delete-button", onClick: () => deleteRange(), children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "zoom-button", onClick: () => zoomRange(), children: (0, jsx_runtime_1.jsx)(fa_1.FaSearchPlus, { title: "Zoom to range in spectrum" }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "edit-button", onClick: () => editRange(), children: (0, jsx_runtime_1.jsx)(fa_1.FaEdit, { color: "blue" }) })] })] }));
|
|
37
37
|
}
|
|
38
38
|
exports.default = ActionsColumn;
|
|
@@ -16,30 +16,39 @@ function useEditRangeModal(range) {
|
|
|
16
16
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
17
17
|
const modal = (0, Modal_1.useModal)();
|
|
18
18
|
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
19
|
-
const zoomRange = (0, react_1.useCallback)(() => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
const zoomRange = (0, react_1.useCallback)((modalRange) => {
|
|
20
|
+
const _range = modalRange ? modalRange : range;
|
|
21
|
+
if (_range) {
|
|
22
|
+
const { from, to } = _range;
|
|
23
|
+
const margin = Math.abs(from - to);
|
|
24
|
+
dispatch({
|
|
25
|
+
type: Types_1.SET_X_DOMAIN,
|
|
26
|
+
xDomain: [from - margin, to + margin],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}, [dispatch, range]);
|
|
30
|
+
const deleteRange = (0, react_1.useCallback)((id, resetSelectTool = false) => {
|
|
31
|
+
if (range || id) {
|
|
32
|
+
dispatch({
|
|
33
|
+
type: Types_1.DELETE_RANGE,
|
|
34
|
+
payload: {
|
|
35
|
+
data: { id: id ? id : range?.id, assignmentData },
|
|
36
|
+
resetSelectTool,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}, [assignmentData, dispatch, range]);
|
|
34
41
|
const changeRangeSignalKind = (0, react_1.useCallback)((value) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
if (range) {
|
|
43
|
+
dispatch({
|
|
44
|
+
type: Types_1.CHANGE_RANGE_SIGNAL_KIND,
|
|
45
|
+
payload: {
|
|
46
|
+
data: { rowData: range, value },
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}
|
|
41
50
|
}, [dispatch, range]);
|
|
42
|
-
const saveEditRangeHandler = (0, react_1.useCallback)((editedRowData) => {
|
|
51
|
+
const saveEditRangeHandler = (0, react_1.useCallback)((editedRowData, automaticCloseModal = true) => {
|
|
43
52
|
dispatch({
|
|
44
53
|
type: Types_1.SAVE_EDITED_RANGE,
|
|
45
54
|
payload: {
|
|
@@ -47,21 +56,30 @@ function useEditRangeModal(range) {
|
|
|
47
56
|
assignmentData,
|
|
48
57
|
},
|
|
49
58
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
59
|
+
if (automaticCloseModal) {
|
|
60
|
+
modal.close();
|
|
61
|
+
}
|
|
62
|
+
}, [assignmentData, dispatch, modal]);
|
|
63
|
+
const closeEditRangeHandler = (0, react_1.useCallback)((range, originalRange) => {
|
|
64
|
+
if (range.id === 'new') {
|
|
65
|
+
deleteRange(range.id, true);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
saveEditRangeHandler(originalRange, false);
|
|
69
|
+
}
|
|
53
70
|
modal.close();
|
|
54
|
-
}, [
|
|
55
|
-
const editRange = (0, react_1.useCallback)(() => {
|
|
71
|
+
}, [deleteRange, modal, saveEditRangeHandler]);
|
|
72
|
+
const editRange = (0, react_1.useCallback)((isManual = false) => {
|
|
56
73
|
dispatch({
|
|
57
74
|
type: Types_1.SET_SELECTED_TOOL,
|
|
58
|
-
payload: { selectedTool: ToolTypes_1.options.editRange.id
|
|
75
|
+
payload: { selectedTool: ToolTypes_1.options.editRange.id },
|
|
59
76
|
});
|
|
60
|
-
modal.show((0, jsx_runtime_1.jsx)(EditRangeModal_1.default, { onCloseEditRangeModal: closeEditRangeHandler, onSaveEditRangeModal: saveEditRangeHandler, onZoomEditRangeModal: zoomRange, range: range }), {
|
|
77
|
+
modal.show((0, jsx_runtime_1.jsx)(EditRangeModal_1.default, { onCloseEditRangeModal: closeEditRangeHandler, onSaveEditRangeModal: saveEditRangeHandler, onZoomEditRangeModal: zoomRange, range: isManual ? {} : range, manualRange: isManual }), {
|
|
61
78
|
position: options_1.positions.MIDDLE_RIGHT,
|
|
62
79
|
transition: options_1.transitions.SCALE,
|
|
63
80
|
isBackgroundBlur: false,
|
|
64
81
|
});
|
|
82
|
+
zoomRange();
|
|
65
83
|
}, [
|
|
66
84
|
closeEditRangeHandler,
|
|
67
85
|
dispatch,
|
|
@@ -29,7 +29,7 @@ function SpectrumsTabsInner({ data, activeSpectrum, activeTab, onTabChange, }) {
|
|
|
29
29
|
if (data) {
|
|
30
30
|
const visibleMarkers = data.reduce((acc, datum) => {
|
|
31
31
|
if (datum.info.dimension === 1 &&
|
|
32
|
-
datum.display.isPeaksMarkersVisible
|
|
32
|
+
datum.display.isPeaksMarkersVisible) {
|
|
33
33
|
acc.push({ id: datum.id });
|
|
34
34
|
}
|
|
35
35
|
return acc;
|
|
@@ -4,7 +4,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
4
4
|
const cheminfo_font_1 = require("cheminfo-font");
|
|
5
5
|
function ShowHideMarkersButton({ data, onChangeMarkersVisibility, markersVisible, style, }) {
|
|
6
6
|
const isMarkerVisible = (id) => {
|
|
7
|
-
return markersVisible.findIndex((v) => v.id === id) !== -1
|
|
7
|
+
return markersVisible.findIndex((v) => v.id === id) !== -1;
|
|
8
8
|
};
|
|
9
9
|
return ((0, jsx_runtime_1.jsx)("button", { style: {
|
|
10
10
|
...style,
|
|
@@ -12,8 +12,8 @@ const generateID_1 = __importDefault(require("../../../../data/utilities/generat
|
|
|
12
12
|
const ContextMenu_1 = __importDefault(require("../../../elements/ContextMenu"));
|
|
13
13
|
const Modal_1 = require("../../../elements/popup/Modal");
|
|
14
14
|
const highlight_1 = require("../../../highlight");
|
|
15
|
-
const IsInView_1 = __importDefault(require("../utilities/IsInView"));
|
|
16
15
|
const Utilities_1 = require("../utilities/Utilities");
|
|
16
|
+
const useInView_1 = __importDefault(require("../utilities/useInView"));
|
|
17
17
|
const EditLinkModal_1 = __importDefault(require("./editLink/EditLinkModal"));
|
|
18
18
|
function AdditionalColumnField({ rowCorrelation, columnCorrelation, commonLinks, correlations, spectraData, onEdit, }) {
|
|
19
19
|
const contextRef = (0, react_1.useRef)();
|
|
@@ -141,8 +141,8 @@ function AdditionalColumnField({ rowCorrelation, columnCorrelation, commonLinks,
|
|
|
141
141
|
return arr;
|
|
142
142
|
}, [])
|
|
143
143
|
.join('/'), [commonLinks]);
|
|
144
|
-
const isInViewRow = (0,
|
|
145
|
-
const isInViewColumn = (0,
|
|
144
|
+
const isInViewRow = (0, useInView_1.default)({ correlation: rowCorrelation });
|
|
145
|
+
const isInViewColumn = (0, useInView_1.default)({ correlation: columnCorrelation });
|
|
146
146
|
return ((0, jsx_runtime_1.jsxs)("td", { onContextMenu: (e) => {
|
|
147
147
|
if (contextMenu.length > 0) {
|
|
148
148
|
contextMenuHandler(e);
|
|
@@ -12,8 +12,8 @@ const FindUtilities_1 = require("../../../../data/utilities/FindUtilities");
|
|
|
12
12
|
const ContextMenu_1 = __importDefault(require("../../../elements/ContextMenu"));
|
|
13
13
|
const Modal_1 = require("../../../elements/popup/Modal");
|
|
14
14
|
const highlight_1 = require("../../../highlight");
|
|
15
|
-
const IsInView_1 = __importDefault(require("../utilities/IsInView"));
|
|
16
15
|
const Utilities_1 = require("../utilities/Utilities");
|
|
16
|
+
const useInView_1 = __importDefault(require("../utilities/useInView"));
|
|
17
17
|
const EditLinkModal_1 = __importDefault(require("./editLink/EditLinkModal"));
|
|
18
18
|
function AdditionalColumnHeader({ spectraData, correlationsData, correlation, onEdit, }) {
|
|
19
19
|
const contextRef = (0, react_1.useRef)();
|
|
@@ -44,7 +44,7 @@ function AdditionalColumnHeader({ spectraData, correlationsData, correlation, on
|
|
|
44
44
|
event.currentTarget.blur();
|
|
45
45
|
highlightAdditionalColumn.hide();
|
|
46
46
|
}, [highlightAdditionalColumn]);
|
|
47
|
-
const isInView = (0,
|
|
47
|
+
const isInView = (0, useInView_1.default)({ correlation });
|
|
48
48
|
const tableHeaderProps = (0, react_1.useMemo)(() => {
|
|
49
49
|
return {
|
|
50
50
|
style: {
|
|
@@ -12,8 +12,8 @@ const ContextMenu_1 = __importDefault(require("../../../elements/ContextMenu"));
|
|
|
12
12
|
const EditableColumn_1 = __importDefault(require("../../../elements/EditableColumn"));
|
|
13
13
|
const Modal_1 = require("../../../elements/popup/Modal");
|
|
14
14
|
const highlight_1 = require("../../../highlight");
|
|
15
|
-
const IsInView_1 = __importDefault(require("../utilities/IsInView"));
|
|
16
15
|
const Utilities_1 = require("../utilities/Utilities");
|
|
16
|
+
const useInView_1 = __importDefault(require("../utilities/useInView"));
|
|
17
17
|
const AdditionalColumnField_1 = __importDefault(require("./AdditionalColumnField"));
|
|
18
18
|
const EditLinkModal_1 = __importDefault(require("./editLink/EditLinkModal"));
|
|
19
19
|
function CorrelationTableRow({ additionalColumnData, correlations, correlation, styleRow, styleLabel, onSaveEditEquivalences, onSaveEditNumericValues, onEditCorrelationTableCellHandler, spectraData, }) {
|
|
@@ -93,7 +93,7 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
93
93
|
event.currentTarget.blur();
|
|
94
94
|
highlightRow.hide();
|
|
95
95
|
}, [highlightRow]);
|
|
96
|
-
const isInView = (0,
|
|
96
|
+
const isInView = (0, useInView_1.default)({ correlation });
|
|
97
97
|
const tableDataProps = (0, react_1.useMemo)(() => {
|
|
98
98
|
return {
|
|
99
99
|
style: {
|
|
@@ -117,14 +117,12 @@ function SummaryPanel() {
|
|
|
117
117
|
if ((0, Utilities_1.findSignalMatch2D)(spectrum, firstLink2D, factor, xDomain0, xDomain1, yDomain0, yDomain1)) {
|
|
118
118
|
return true;
|
|
119
119
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return true;
|
|
127
|
-
}
|
|
120
|
+
// try to find a link which contains the belonging 2D signal in the spectra in view
|
|
121
|
+
else if (correlation.link.some((link) => {
|
|
122
|
+
const spectrum = (0, FindUtilities_1.findSpectrum)(spectraData, link.experimentID, true);
|
|
123
|
+
return (0, Utilities_1.findSignalMatch2D)(spectrum, link, factor, xDomain0, xDomain1, yDomain0, yDomain1);
|
|
124
|
+
})) {
|
|
125
|
+
return true;
|
|
128
126
|
}
|
|
129
127
|
}
|
|
130
128
|
// do not show correlation
|
|
@@ -330,14 +330,12 @@ function isInView(spectraData, activeTab, activeSpectrum, xDomain, yDomain, disp
|
|
|
330
330
|
if (findSignalMatch2D(spectrum, firstLink2D, factor, xDomain0, xDomain1, yDomain0, yDomain1)) {
|
|
331
331
|
return true;
|
|
332
332
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
return true;
|
|
340
|
-
}
|
|
333
|
+
// try to find a link which contains the belonging 2D signal in the spectra in view
|
|
334
|
+
else if (correlation.link.some((link) => {
|
|
335
|
+
const spectrum = (0, FindUtilities_1.findSpectrum)(spectraData, link.experimentID, true);
|
|
336
|
+
return findSignalMatch2D(spectrum, link, factor, xDomain0, xDomain1, yDomain0, yDomain1);
|
|
337
|
+
})) {
|
|
338
|
+
return true;
|
|
341
339
|
}
|
|
342
340
|
}
|
|
343
341
|
// do not show correlation
|