nmrium 0.29.0 → 0.31.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/README.md +12 -2
- package/lib/component/1d/ApodizationLine.d.ts +3 -0
- package/lib/component/1d/ApodizationLine.js +49 -0
- package/lib/component/1d/Chart1D.js +4 -2
- package/lib/component/1d/ExclusionZoneAnnotation.d.ts +1 -1
- package/lib/component/1d/ExclusionZoneAnnotation.js +14 -7
- package/lib/component/1d/FooterBanner.js +3 -1
- package/lib/component/1d/IntegralResizable.js +5 -4
- package/lib/component/1d/IntegralsSeries.js +3 -1
- package/lib/component/1d/LinesSeries.js +7 -5
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +10 -13
- package/lib/component/1d/database/DatabaseElements.js +2 -2
- package/lib/component/1d/database/DatabaseSpectrum.js +3 -3
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +3 -3
- package/lib/component/1d/jCouplingGraph/JGraph.js +5 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +16 -14
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +6 -5
- package/lib/component/1d/{PeakAnnotation.d.ts → peaks/PeakAnnotation.d.ts} +1 -2
- package/lib/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib/component/1d/{PeakAnnotations.d.ts → peaks/PeakAnnotations.d.ts} +0 -0
- package/lib/component/1d/peaks/PeakAnnotations.js +28 -0
- package/lib/component/1d/peaks/PeaksShapes.d.ts +3 -0
- package/lib/component/1d/peaks/PeaksShapes.js +37 -0
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +13 -0
- package/lib/component/1d/peaks/usePeakShapesPath.js +49 -0
- package/lib/component/1d/ranges/Range.js +4 -4
- package/lib/component/1d/ranges/Ranges.js +8 -2
- package/lib/component/1d/tool/PeakPointer.js +3 -1
- package/lib/component/1d/tool/XLabelPointer.js +3 -1
- package/lib/component/2d/Contours.js +3 -1
- package/lib/component/2d/FooterBanner.js +5 -3
- package/lib/component/2d/Viewer2D.js +6 -6
- package/lib/component/2d/XAxis.js +2 -2
- package/lib/component/2d/YAxis.js +2 -2
- package/lib/component/2d/tools/XYLabelPointer.js +3 -1
- package/lib/component/2d/tools/slicing/SlicingView.js +3 -1
- package/lib/component/2d/zones/IndicationLines.js +1 -1
- package/lib/component/2d/zones/Signal.d.ts +3 -2
- package/lib/component/2d/zones/Signal.js +3 -3
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/2d/zones/Zone.js +4 -4
- package/lib/component/2d/zones/Zones.js +14 -19
- package/lib/component/EventsTrackers/KeysListenerTracker.js +91 -52
- package/lib/component/NMRium.d.ts +2 -0
- package/lib/component/NMRium.js +14 -3
- package/lib/component/assignment/AssignmentsContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.js +3 -3
- package/lib/component/elements/ActiveButton.d.ts +17 -0
- package/lib/component/elements/ActiveButton.js +28 -0
- package/lib/component/elements/Button.d.ts +6 -6
- package/lib/component/elements/Button.js +5 -5
- package/lib/component/elements/ButtonToolTip.js +1 -1
- package/lib/component/elements/CheckBox.d.ts +2 -6
- package/lib/component/elements/CheckBox.js +4 -6
- package/lib/component/elements/Input.d.ts +5 -4
- package/lib/component/elements/Input.js +1 -1
- package/lib/component/elements/Label.d.ts +8 -6
- package/lib/component/elements/Label.js +3 -3
- package/lib/component/elements/MoleculeSelection.d.ts +2 -2
- package/lib/component/elements/MoleculeSelection.js +1 -1
- package/lib/component/elements/NextPrev.js +1 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
- package/lib/component/elements/Select.d.ts +7 -11
- package/lib/component/elements/Select.js +6 -8
- package/lib/component/elements/Tab/Tab.js +1 -1
- package/lib/component/elements/Table/Table.d.ts +1 -2
- package/lib/component/elements/Table/Table.js +2 -2
- package/lib/component/elements/ToggleButton.d.ts +1 -2
- package/lib/component/elements/ToggleButton.js +3 -2
- package/lib/component/elements/accordion/AccordionItem.js +2 -2
- package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.d.ts +3 -2
- package/lib/component/elements/formik/FormikOnChange.js +11 -5
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib/component/elements/popup/Modal/Provider.d.ts +3 -3
- package/lib/component/elements/popup/Modal/Provider.js +8 -11
- package/lib/component/elements/resizer/DivResizer.js +3 -3
- package/lib/component/elements/resizer/Resizer.d.ts +1 -0
- package/lib/component/elements/resizer/SVGResizer.js +3 -3
- package/lib/component/header/ApodizationOptionsPanel.d.ts +2 -0
- package/lib/component/header/ApodizationOptionsPanel.js +81 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +2 -1
- package/lib/component/header/AutoPeakPickingOptionPanel.js +40 -36
- package/lib/component/header/BaseLineCorrectionPanel.d.ts +1 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +84 -52
- package/lib/component/header/Header.js +5 -2
- package/lib/component/header/HeaderContainer.d.ts +7 -0
- package/lib/component/header/HeaderContainer.js +10 -0
- package/lib/component/header/ManualPhaseCorrectionPanel.js +27 -29
- package/lib/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib/component/header/ZeroFillingOptionsPanel.js +52 -47
- package/lib/component/header/Zones2DOptionPanel.js +11 -13
- package/lib/component/highlight/index.d.ts +27 -10
- package/lib/component/highlight/index.js +19 -17
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +10 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib/component/hooks/useDatumWithSpectraStatistics.js +3 -1
- package/lib/component/hooks/useExport.d.ts +0 -1
- package/lib/component/hooks/useExport.js +1 -17
- package/lib/component/hooks/useFilter.d.ts +1 -0
- package/lib/component/hooks/useFilter.js +7 -0
- package/lib/component/hooks/useIntegralPath.js +5 -2
- package/lib/component/hooks/useNucleus.js +4 -4
- package/lib/component/hooks/useSpectraPerNucleus.js +1 -1
- package/lib/component/hooks/useSpectrum.js +3 -1
- package/lib/component/hooks/useToolsFunctions.js +1 -1
- package/lib/component/loader/DropZone.js +8 -148
- package/lib/component/modal/AlignSpectraModal.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +9 -0
- package/lib/component/modal/EditPeakShapeModal.js +85 -0
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js +2 -3
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib/component/modal/PredictSpectraModal.js +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib/component/modal/changeSum/SelectMolecule.js +2 -2
- package/lib/component/modal/editRange/EditRangeModal.js +3 -3
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +4 -9
- package/lib/component/modal/setting/DatabasesTabContent.js +2 -2
- package/lib/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib/component/modal/setting/GeneralSettings.js +1 -1
- package/lib/component/modal/setting/ToolsTabContent.js +17 -13
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -2
- package/lib/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +5 -4
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +13 -10
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +4 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +5 -3
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +12 -4
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/Panels.js +3 -3
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +47 -22
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib/component/panels/PeaksPanel/PeaksTable.js +44 -13
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts +2 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +10 -9
- package/lib/component/panels/RangesPanel/RangesPanel.js +7 -3
- package/lib/component/panels/RangesPanel/RangesTableRow.js +4 -4
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +3 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +3 -3
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -1
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib/component/panels/SummaryPanel/utilities/useInView.js +3 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +19 -10
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -13
- package/lib/component/panels/databasePanel/DatabaseTable.js +3 -3
- package/lib/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.js +3 -12
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +2 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib/component/reducer/IgnoreActions.js +5 -0
- package/lib/component/reducer/Reducer.d.ts +141 -51
- package/lib/component/reducer/Reducer.js +69 -45
- package/lib/component/reducer/actions/DomainActions.d.ts +1 -1
- package/lib/component/reducer/actions/DomainActions.js +11 -9
- package/lib/component/reducer/actions/FiltersActions.d.ts +13 -7
- package/lib/component/reducer/actions/FiltersActions.js +326 -204
- package/lib/component/reducer/actions/IntegralsActions.js +15 -10
- package/lib/component/reducer/actions/LoadActions.d.ts +2 -5
- package/lib/component/reducer/actions/LoadActions.js +19 -34
- package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -1
- package/lib/component/reducer/actions/MoleculeActions.js +48 -19
- package/lib/component/reducer/actions/PeaksActions.d.ts +4 -1
- package/lib/component/reducer/actions/PeaksActions.js +52 -13
- package/lib/component/reducer/actions/PreferencesActions.js +8 -10
- package/lib/component/reducer/actions/RangesActions.d.ts +3 -3
- package/lib/component/reducer/actions/RangesActions.js +87 -29
- package/lib/component/reducer/actions/SpectraAnalysisAction.js +5 -5
- package/lib/component/reducer/actions/SpectrumsActions.js +14 -11
- package/lib/component/reducer/actions/ToolsActions.js +47 -95
- package/lib/component/reducer/actions/ZonesActions.d.ts +4 -1
- package/lib/component/reducer/actions/ZonesActions.js +68 -17
- package/lib/component/reducer/helper/Zoom1DManager.js +2 -1
- package/lib/component/reducer/helper/getActiveSpectrumOrFail.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrumOrFail.js +6 -0
- package/lib/component/reducer/helper/getSpectrum.js +3 -2
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +7 -0
- package/lib/component/reducer/helper/getStrongestPeak.js +15 -0
- package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +23 -15
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib/component/reducer/types/Types.d.ts +12 -0
- package/lib/component/reducer/types/Types.js +12 -0
- package/lib/component/tool/BrushX.js +1 -1
- package/lib/component/tool/BrushXY.js +4 -3
- package/lib/component/tool/CrossLinePointer.js +5 -4
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +8 -2
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +22 -7
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +3 -2
- package/lib/component/tool/FloatMoleculeStructures/index.js +19 -6
- package/lib/component/toolbar/BasicToolBar.js +7 -14
- package/lib/component/toolbar/FunctionToolBar.js +13 -23
- package/lib/component/toolbar/ToolTypes.d.ts +7 -1
- package/lib/component/toolbar/ToolTypes.js +119 -9
- package/lib/component/utility/assert.d.ts +1 -0
- package/lib/component/utility/assert.js +5 -0
- package/lib/component/workspaces/Workspace.d.ts +4 -1
- package/lib/component/workspaces/basic.js +12 -11
- package/lib/component/workspaces/embedded.js +14 -13
- package/lib/component/workspaces/exercise.js +10 -6
- package/lib/component/workspaces/prediction.js +14 -13
- package/lib/component/workspaces/process1D.js +20 -19
- package/lib/component/workspaces/workspaceDefaultProperties.js +14 -15
- package/lib/constants.js +1 -1
- package/lib/data/Filters.d.ts +2 -2
- package/lib/data/Filters.js +2 -2
- package/lib/data/FiltersManager.js +3 -3
- package/lib/data/PredictionManager.d.ts +0 -1
- package/lib/data/PredictionManager.js +15 -15
- package/lib/data/SpectraManager.d.ts +2 -5
- package/lib/data/SpectraManager.js +4 -95
- package/lib/data/constants/SignalsKinds.d.ts +0 -1
- package/lib/data/constants/SignalsKinds.js +0 -8
- package/lib/data/data1d/Data1DManager.js +5 -5
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +5 -5
- package/lib/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +2 -2
- package/lib/data/data1d/Spectrum1D/index.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/index.js +2 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -2
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -16
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +8 -0
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +24 -0
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +2 -0
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -3
- package/lib/data/data1d/database.js +4 -6
- package/lib/data/data1d/filter1d/apodization.d.ts +25 -0
- package/lib/data/data1d/filter1d/apodization.js +63 -0
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +24 -7
- package/lib/data/data1d/filter1d/baselineCorrection.js +10 -17
- package/lib/data/data1d/filter1d/fft.js +11 -0
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +2 -0
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +35 -0
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.d.ts +9 -0
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.js +24 -0
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +3 -2
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +1 -1
- package/lib/data/molecules/Molecule.d.ts +20 -6
- package/lib/data/molecules/Molecule.js +5 -8
- package/lib/data/molecules/MoleculeManager.d.ts +4 -4
- package/lib/data/molecules/MoleculeManager.js +5 -5
- package/lib/data/types/data1d/SumOptions.d.ts +1 -1
- package/lib/data/utilities/generateNumbersPowerOfX.d.ts +0 -1
- package/lib/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib/data/utilities/isInRange.d.ts +7 -0
- package/lib/data/utilities/isInRange.js +4 -0
- package/lib/types/NMRiumDataReturn.d.ts +2 -2
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -2
- package/lib/types/NMRiumToolBarPreferences.d.ts +14 -13
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +77 -0
- package/lib-cjs/component/1d/Chart1D.js +4 -2
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +15 -8
- package/lib-cjs/component/1d/FooterBanner.js +3 -1
- package/lib-cjs/component/1d/IntegralResizable.js +4 -3
- package/lib-cjs/component/1d/IntegralsSeries.js +3 -1
- package/lib-cjs/component/1d/LinesSeries.js +6 -4
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +10 -13
- package/lib-cjs/component/1d/database/DatabaseElements.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -2
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +5 -1
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +15 -13
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -3
- package/lib-cjs/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib-cjs/component/1d/peaks/PeakAnnotations.js +33 -0
- package/lib-cjs/component/1d/peaks/PeaksShapes.js +42 -0
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +53 -0
- package/lib-cjs/component/1d/ranges/Range.js +3 -3
- package/lib-cjs/component/1d/ranges/Ranges.js +7 -1
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -1
- package/lib-cjs/component/1d/tool/XLabelPointer.js +3 -1
- package/lib-cjs/component/2d/Contours.js +3 -1
- package/lib-cjs/component/2d/FooterBanner.js +5 -3
- package/lib-cjs/component/2d/Viewer2D.js +6 -6
- package/lib-cjs/component/2d/XAxis.js +2 -2
- package/lib-cjs/component/2d/YAxis.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +3 -1
- package/lib-cjs/component/2d/tools/slicing/SlicingView.js +3 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +1 -1
- package/lib-cjs/component/2d/zones/Signal.js +3 -3
- package/lib-cjs/component/2d/zones/Zone.js +3 -3
- package/lib-cjs/component/2d/zones/Zones.js +13 -18
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +89 -50
- package/lib-cjs/component/NMRium.js +14 -3
- package/lib-cjs/component/context/GlobalContext.js +4 -4
- package/lib-cjs/component/elements/ActiveButton.js +33 -0
- package/lib-cjs/component/elements/Button.js +5 -5
- package/lib-cjs/component/elements/ButtonToolTip.js +1 -1
- package/lib-cjs/component/elements/CheckBox.js +3 -5
- package/lib-cjs/component/elements/Input.js +1 -1
- package/lib-cjs/component/elements/Label.js +3 -3
- package/lib-cjs/component/elements/MoleculeSelection.js +1 -1
- package/lib-cjs/component/elements/NextPrev.js +1 -1
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/Select.js +6 -8
- package/lib-cjs/component/elements/Tab/Tab.js +1 -1
- package/lib-cjs/component/elements/Table/Table.js +2 -2
- package/lib-cjs/component/elements/ToggleButton.js +3 -2
- package/lib-cjs/component/elements/accordion/AccordionItem.js +2 -2
- package/lib-cjs/component/elements/formik/FormikOnChange.js +10 -4
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +8 -11
- package/lib-cjs/component/elements/resizer/DivResizer.js +3 -3
- package/lib-cjs/component/elements/resizer/SVGResizer.js +2 -2
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +110 -0
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +39 -35
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +82 -49
- package/lib-cjs/component/header/Header.js +5 -2
- package/lib-cjs/component/header/HeaderContainer.js +14 -0
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +26 -28
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +73 -45
- package/lib-cjs/component/header/Zones2DOptionPanel.js +11 -13
- package/lib-cjs/component/highlight/index.js +20 -18
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib-cjs/component/hooks/useDatumWithSpectraStatistics.js +3 -1
- package/lib-cjs/component/hooks/useExport.js +0 -16
- package/lib-cjs/component/hooks/useFilter.js +14 -0
- package/lib-cjs/component/hooks/useIntegralPath.js +5 -2
- package/lib-cjs/component/hooks/useNucleus.js +4 -4
- package/lib-cjs/component/hooks/useSpectraPerNucleus.js +1 -1
- package/lib-cjs/component/hooks/useSpectrum.js +3 -1
- package/lib-cjs/component/hooks/useToolsFunctions.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +7 -150
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
- package/lib-cjs/component/modal/EditPeakShapeModal.js +113 -0
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +2 -3
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib-cjs/component/modal/changeSum/SelectMolecule.js +2 -2
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -3
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +3 -8
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +17 -13
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +1 -1
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -9
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +11 -3
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib-cjs/component/panels/Panels.js +3 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +45 -20
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +42 -11
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +10 -9
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +7 -3
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +3 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib-cjs/component/panels/SummaryPanel/utilities/useInView.js +3 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +18 -9
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -13
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +3 -12
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib-cjs/component/reducer/IgnoreActions.js +5 -0
- package/lib-cjs/component/reducer/Reducer.js +72 -50
- package/lib-cjs/component/reducer/actions/DomainActions.js +11 -9
- package/lib-cjs/component/reducer/actions/FiltersActions.js +332 -205
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +15 -10
- package/lib-cjs/component/reducer/actions/LoadActions.js +18 -36
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +49 -19
- package/lib-cjs/component/reducer/actions/PeaksActions.js +54 -12
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +8 -10
- package/lib-cjs/component/reducer/actions/RangesActions.js +87 -29
- package/lib-cjs/component/reducer/actions/SpectraAnalysisAction.js +5 -5
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +14 -11
- package/lib-cjs/component/reducer/actions/ToolsActions.js +46 -94
- package/lib-cjs/component/reducer/actions/ZonesActions.js +71 -17
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -1
- package/lib-cjs/component/reducer/helper/getActiveSpectrumOrFail.js +10 -0
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -2
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +19 -0
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -5
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib-cjs/component/reducer/types/Types.js +15 -3
- package/lib-cjs/component/tool/BrushX.js +1 -1
- package/lib-cjs/component/tool/BrushXY.js +4 -3
- package/lib-cjs/component/tool/CrossLinePointer.js +5 -4
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +21 -6
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +19 -6
- package/lib-cjs/component/toolbar/BasicToolBar.js +7 -14
- package/lib-cjs/component/toolbar/FunctionToolBar.js +12 -22
- package/lib-cjs/component/toolbar/ToolTypes.js +119 -9
- package/lib-cjs/component/utility/assert.js +9 -0
- package/lib-cjs/component/workspaces/basic.js +12 -11
- package/lib-cjs/component/workspaces/embedded.js +14 -13
- package/lib-cjs/component/workspaces/exercise.js +10 -6
- package/lib-cjs/component/workspaces/prediction.js +14 -13
- package/lib-cjs/component/workspaces/process1D.js +20 -19
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +14 -15
- package/lib-cjs/constants.js +1 -1
- package/lib-cjs/data/Filters.js +3 -3
- package/lib-cjs/data/FiltersManager.js +3 -6
- package/lib-cjs/data/PredictionManager.js +15 -15
- package/lib-cjs/data/SpectraManager.js +5 -100
- package/lib-cjs/data/constants/SignalsKinds.js +0 -8
- package/lib-cjs/data/data1d/Data1DManager.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +2 -5
- package/lib-cjs/data/data1d/Spectrum1D/index.js +3 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -19
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +28 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +2 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -5
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -6
- package/lib-cjs/data/data1d/database.js +4 -6
- package/lib-cjs/data/data1d/filter1d/apodization.js +70 -0
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +11 -18
- package/lib-cjs/data/data1d/filter1d/fft.js +11 -0
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +39 -0
- package/lib-cjs/data/data1d/filter1d/zeroFillingAndApodization.js +30 -0
- package/lib-cjs/data/data2d/Processing2D.js +3 -2
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -6
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +3 -6
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -6
- package/lib-cjs/data/molecules/Molecule.js +5 -8
- package/lib-cjs/data/molecules/MoleculeManager.js +5 -5
- package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib-cjs/data/utilities/isInRange.js +7 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +36 -35
- package/lib/component/1d/PeakAnnotations.js +0 -41
- package/lib/component/utility/nmredataToNmrium.d.ts +0 -4
- package/lib/component/utility/nmredataToNmrium.js +0 -66
- package/lib/component/utility/nmriumToNmredata.d.ts +0 -2
- package/lib/component/utility/nmriumToNmredata.js +0 -80
- package/lib/component/utility/util/nmredata/addRanges.d.ts +0 -1
- package/lib/component/utility/util/nmredata/addRanges.js +0 -52
- package/lib/component/utility/util/nmredata/addSource.d.ts +0 -6
- package/lib/component/utility/util/nmredata/addSource.js +0 -54
- package/lib/component/utility/util/nmredata/addZones.d.ts +0 -1
- package/lib/component/utility/util/nmredata/addZones.js +0 -41
- package/lib/component/utility/util/nmredata/flat2DSignals.d.ts +0 -1
- package/lib/component/utility/util/nmredata/flat2DSignals.js +0 -7
- package/lib/component/utility/util/nmredata/get1DSignals.d.ts +0 -10
- package/lib/component/utility/util/nmredata/get1DSignals.js +0 -96
- package/lib/component/utility/util/nmredata/get2DSignals.d.ts +0 -8
- package/lib/component/utility/util/nmredata/get2DSignals.js +0 -59
- package/lib/component/utility/util/nmredata/getCouplingObserved.d.ts +0 -1
- package/lib/component/utility/util/nmredata/getCouplingObserved.js +0 -11
- package/lib/component/utility/util/nmredata/getLabels.d.ts +0 -9
- package/lib/component/utility/util/nmredata/getLabels.js +0 -66
- package/lib/component/utility/util/nmredata/getToFix.d.ts +0 -1
- package/lib/component/utility/util/nmredata/getToFix.js +0 -19
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +0 -14
- package/lib/data/data1d/filter1d/lineBroadening.js +0 -57
- package/lib/data/migration/MigrationManager.d.ts +0 -2
- package/lib/data/migration/MigrationManager.js +0 -17
- package/lib/data/migration/changeKeys.d.ts +0 -1
- package/lib/data/migration/changeKeys.js +0 -9
- package/lib/data/migration/migrateToVersion1.d.ts +0 -11
- package/lib/data/migration/migrateToVersion1.js +0 -32
- package/lib/data/migration/migrateToVersion2.d.ts +0 -1
- package/lib/data/migration/migrateToVersion2.js +0 -111
- package/lib/data/utilities/generateID.d.ts +0 -1
- package/lib/data/utilities/generateID.js +0 -9
- package/lib-cjs/component/1d/PeakAnnotations.js +0 -46
- package/lib-cjs/component/utility/nmredataToNmrium.js +0 -73
- package/lib-cjs/component/utility/nmriumToNmredata.js +0 -87
- package/lib-cjs/component/utility/util/nmredata/addRanges.js +0 -56
- package/lib-cjs/component/utility/util/nmredata/addSource.js +0 -61
- package/lib-cjs/component/utility/util/nmredata/addZones.js +0 -48
- package/lib-cjs/component/utility/util/nmredata/flat2DSignals.js +0 -11
- package/lib-cjs/component/utility/util/nmredata/get1DSignals.js +0 -100
- package/lib-cjs/component/utility/util/nmredata/get2DSignals.js +0 -63
- package/lib-cjs/component/utility/util/nmredata/getCouplingObserved.js +0 -15
- package/lib-cjs/component/utility/util/nmredata/getLabels.js +0 -70
- package/lib-cjs/component/utility/util/nmredata/getToFix.js +0 -23
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +0 -63
- package/lib-cjs/data/migration/MigrationManager.js +0 -24
- package/lib-cjs/data/migration/changeKeys.js +0 -13
- package/lib-cjs/data/migration/migrateToVersion1.js +0 -35
- package/lib-cjs/data/migration/migrateToVersion2.js +0 -114
- package/lib-cjs/data/utilities/generateID.js +0 -12
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
-
export interface
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export interface SelectProps {
|
|
8
|
-
onChange?: (element: string) => void;
|
|
9
|
-
data: Array<SelectEntry>;
|
|
2
|
+
export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'style' | 'onChange'> {
|
|
3
|
+
onChange?: (element: any) => void;
|
|
4
|
+
items: any[];
|
|
5
|
+
defaultValue?: string | number | undefined;
|
|
10
6
|
style?: CSSProperties;
|
|
11
|
-
defaultValue?: string | number;
|
|
12
|
-
name?: string;
|
|
13
|
-
className?: string;
|
|
14
7
|
placeholder?: string;
|
|
8
|
+
itemValueField?: string;
|
|
9
|
+
itemTextField?: string;
|
|
10
|
+
returnValue?: boolean;
|
|
15
11
|
}
|
|
16
12
|
declare const Select: import("react").ForwardRefExoticComponent<SelectProps & import("react").RefAttributes<HTMLSelectElement>>;
|
|
17
13
|
export default Select;
|
|
@@ -29,14 +29,12 @@ const styles = {
|
|
|
29
29
|
`,
|
|
30
30
|
};
|
|
31
31
|
const Select = forwardRef(function Select(props, ref) {
|
|
32
|
-
const {
|
|
32
|
+
const { items, style = { width: 100 }, onChange = () => null, defaultValue, value, name = '', className = '', placeholder = '', itemValueField = 'value', itemTextField = 'label', returnValue = true, } = props;
|
|
33
33
|
const handleOnChanged = useCallback((e) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, [onChange]);
|
|
40
|
-
return (_jsxs("select", { ref: ref, css: styles.select(style?.width), name: name, onChange: handleOnChanged, defaultValue: defaultValue, className: className, style: style, required: true, children: [placeholder && (_jsx("option", { value: "", disabled: true, children: placeholder })), data.map((d) => (_jsx("option", { value: d.value, children: d.label }, `${d.key}`)))] }));
|
|
34
|
+
const [option] = e.target.selectedOptions;
|
|
35
|
+
const selectedData = JSON.parse(option.dataset.value);
|
|
36
|
+
onChange(returnValue ? selectedData[itemValueField] : selectedData);
|
|
37
|
+
}, [itemValueField, onChange, returnValue]);
|
|
38
|
+
return (_jsxs("select", { ref: ref, css: styles.select(style?.width), name: name, onChange: handleOnChanged, defaultValue: defaultValue, value: value, className: className, style: style, required: true, children: [placeholder && (_jsx("option", { value: "", disabled: true, children: placeholder })), items.map((option) => (_jsx("option", { value: option[itemValueField], "data-value": JSON.stringify(option), children: option[itemTextField] }, JSON.stringify(option))))] }));
|
|
41
39
|
});
|
|
42
40
|
export default Select;
|
|
@@ -30,7 +30,7 @@ export function InternalTab({ tabid, tablabel, isActive, onClick = () => null, c
|
|
|
30
30
|
e.stopPropagation();
|
|
31
31
|
onDelete({ ...e, tablabel, tabid });
|
|
32
32
|
}, [onDelete, tablabel, tabid]);
|
|
33
|
-
return (_jsxs("li", { className: className, onClick: clickHandler, css: styles(tabstyles),
|
|
33
|
+
return (_jsxs("li", { className: className, onClick: clickHandler, css: styles(tabstyles), children: [canDelete && _jsx(DeleteButton, { onDelete: deleteHandler }), render
|
|
34
34
|
? render({ isActive, title: tablabel || '', id: tabid })
|
|
35
35
|
: tablabel] }));
|
|
36
36
|
}
|
|
@@ -3,8 +3,7 @@ interface TableProps {
|
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: CSSProperties;
|
|
6
|
-
testID?: string;
|
|
7
6
|
}
|
|
8
|
-
declare function Table({ children, className, style
|
|
7
|
+
declare function Table({ children, className, style }: TableProps): JSX.Element;
|
|
9
8
|
declare const _default: import("react").MemoExoticComponent<typeof Table>;
|
|
10
9
|
export default _default;
|
|
@@ -7,7 +7,7 @@ const styles = {
|
|
|
7
7
|
display: 'flex',
|
|
8
8
|
flexDirection: 'column',
|
|
9
9
|
};
|
|
10
|
-
function Table({ children, className, style
|
|
11
|
-
return (_jsx("div", { className: className, style: { ...styles, ...style },
|
|
10
|
+
function Table({ children, className, style }) {
|
|
11
|
+
return (_jsx("div", { className: className, style: { ...styles, ...style }, children: children }));
|
|
12
12
|
}
|
|
13
13
|
export default memo(Table);
|
|
@@ -8,8 +8,7 @@ interface ToggleButtonProps {
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
className?: string;
|
|
11
|
-
testID?: string;
|
|
12
11
|
}
|
|
13
|
-
declare function ToggleButton({ children, style, onClick, popupTitle, popupPlacement, defaultValue, disabled, className,
|
|
12
|
+
declare function ToggleButton({ children, style, onClick, popupTitle, popupPlacement, defaultValue, disabled, className, }: ToggleButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
13
|
declare const _default: import("react").MemoExoticComponent<typeof ToggleButton>;
|
|
15
14
|
export default _default;
|
|
@@ -7,6 +7,7 @@ const styles = css `
|
|
|
7
7
|
background-color: #f5f5f5;
|
|
8
8
|
border: none;
|
|
9
9
|
border-radius: 5px;
|
|
10
|
+
padding: 5px;
|
|
10
11
|
|
|
11
12
|
&:hover {
|
|
12
13
|
background-color: lightgray !important;
|
|
@@ -18,12 +19,12 @@ const styles = css `
|
|
|
18
19
|
color: white;
|
|
19
20
|
}
|
|
20
21
|
`;
|
|
21
|
-
function ToggleButton({ children, style = {}, onClick = () => null, popupTitle = '', popupPlacement = 'right', defaultValue = false, disabled = false, className = '',
|
|
22
|
+
function ToggleButton({ children, style = {}, onClick = () => null, popupTitle = '', popupPlacement = 'right', defaultValue = false, disabled = false, className = '', }) {
|
|
22
23
|
const [flag, toggle] = useState(defaultValue);
|
|
23
24
|
const toggleHandler = useCallback(() => {
|
|
24
25
|
onClick(!flag);
|
|
25
26
|
toggle(!flag);
|
|
26
27
|
}, [onClick, flag]);
|
|
27
|
-
return (_jsx(ToolTip, { title: popupTitle, popupPlacement: popupPlacement, children: _jsx("button", {
|
|
28
|
+
return (_jsx(ToolTip, { title: popupTitle, popupPlacement: popupPlacement, children: _jsx("button", { disabled: disabled, css: styles, style: style, className: (flag ? 'toggle toggle-active ' : 'toggle ') + className, type: "button", onClick: toggleHandler, children: children }) }));
|
|
28
29
|
}
|
|
29
30
|
export default memo(ToggleButton);
|
|
@@ -70,10 +70,10 @@ function AccordionItem({ title, children, index, isOpen, onOpen = () => null, st
|
|
|
70
70
|
...styles.container,
|
|
71
71
|
flex: active == null ? 0 : '1 1 1px',
|
|
72
72
|
transition: isOpen ? 'flex 0.2s ease' : '',
|
|
73
|
-
}, className: "custom-accordion", children: [_jsx("button", { type: "button", style: styles.button, onClick: toggleAccordion, onDoubleClick: dbClickHandler,
|
|
73
|
+
}, className: "custom-accordion", children: [_jsx("button", { type: "button", style: styles.button, onClick: toggleAccordion, onDoubleClick: dbClickHandler, children: _jsx("p", { style: styles.buttonTitle, children: title }) }), _jsx("div", { ref: refContent, style: {
|
|
74
74
|
...styles.content,
|
|
75
75
|
maxHeight: active == null ? 0 : '100%',
|
|
76
76
|
...style,
|
|
77
|
-
},
|
|
77
|
+
}, children: children })] }));
|
|
78
78
|
}
|
|
79
79
|
export default AccordionItem;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { NumberInputProps } from '../NumberInput';
|
|
3
3
|
interface FormikNumberInputProps extends NumberInputProps {
|
|
4
|
-
label
|
|
4
|
+
label?: string;
|
|
5
5
|
name: string;
|
|
6
6
|
}
|
|
7
7
|
declare function FormikNumberInput(props: FormikNumberInputProps): JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
interface FormikOnChangeProps {
|
|
2
3
|
onChange?: (any: any) => void;
|
|
3
4
|
enableValidation?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const
|
|
6
|
-
export default
|
|
6
|
+
declare const _default: import("react").MemoExoticComponent<(props: FormikOnChangeProps) => null>;
|
|
7
|
+
export default _default;
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { useFormikContext } from 'formik';
|
|
2
|
-
import { useEffect } from 'react';
|
|
2
|
+
import { useEffect, memo, useRef } from 'react';
|
|
3
3
|
const FormikOnChange = (props) => {
|
|
4
4
|
const { onChange = () => null, enableValidation = true } = props;
|
|
5
|
-
const
|
|
5
|
+
const oldValuesRef = useRef({});
|
|
6
|
+
const { values, errors, submitForm, setTouched } = useFormikContext();
|
|
6
7
|
useEffect(() => {
|
|
7
8
|
if (enableValidation) {
|
|
8
|
-
if (Object.keys(errors).length === 0
|
|
9
|
+
if (Object.keys(errors).length === 0 &&
|
|
10
|
+
JSON.stringify(oldValuesRef.current) !== JSON.stringify(values)) {
|
|
9
11
|
onChange(values);
|
|
10
12
|
}
|
|
13
|
+
else {
|
|
14
|
+
setTouched(errors);
|
|
15
|
+
}
|
|
11
16
|
}
|
|
12
17
|
else {
|
|
13
18
|
onChange(values);
|
|
14
19
|
}
|
|
15
|
-
|
|
20
|
+
oldValuesRef.current = values;
|
|
21
|
+
}, [values, enableValidation, errors, onChange, submitForm, setTouched]);
|
|
16
22
|
return null;
|
|
17
23
|
};
|
|
18
|
-
export default FormikOnChange;
|
|
24
|
+
export default memo(FormikOnChange);
|
|
@@ -3,9 +3,9 @@ interface ProviderProps {
|
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
style?: CSSProperties;
|
|
5
5
|
offset?: string;
|
|
6
|
-
position?:
|
|
7
|
-
transition?:
|
|
8
|
-
wrapperRef?:
|
|
6
|
+
position?: string;
|
|
7
|
+
transition?: string;
|
|
8
|
+
wrapperRef?: HTMLDivElement | null;
|
|
9
9
|
}
|
|
10
10
|
declare function Provider({ children, style, offset, position, transition, wrapperRef, }: ProviderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default Provider;
|
|
@@ -23,7 +23,7 @@ const transitionStyles = {
|
|
|
23
23
|
exited: { transform: 'scale(0)' },
|
|
24
24
|
},
|
|
25
25
|
};
|
|
26
|
-
function Provider({ children, style
|
|
26
|
+
function Provider({ children, style, offset = '0px', position = positions.MIDDLE, transition = transitions.SCALE, wrapperRef = null, }) {
|
|
27
27
|
const root = useRef();
|
|
28
28
|
const modalRef = useRef();
|
|
29
29
|
const [modal, setModal] = useState();
|
|
@@ -44,16 +44,13 @@ function Provider({ children, style = undefined, offset = '0px', position = posi
|
|
|
44
44
|
const close = useCallback(function close() {
|
|
45
45
|
setModal(null);
|
|
46
46
|
}, [setModal]);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
height: window.innerHeight,
|
|
55
|
-
};
|
|
56
|
-
}, [wrapperRef]);
|
|
47
|
+
// todo: optimize this
|
|
48
|
+
const parentStyle = wrapperRef?.getBoundingClientRect() || {
|
|
49
|
+
top: 0,
|
|
50
|
+
left: 0,
|
|
51
|
+
width: window.innerWidth,
|
|
52
|
+
height: window.innerHeight,
|
|
53
|
+
};
|
|
57
54
|
/**
|
|
58
55
|
*
|
|
59
56
|
* @param {*} component <component />
|
|
@@ -54,9 +54,9 @@ const styles = {
|
|
|
54
54
|
},
|
|
55
55
|
};
|
|
56
56
|
export default function DivResizer(props) {
|
|
57
|
-
const { children } = props;
|
|
57
|
+
const { children, disabled } = props;
|
|
58
58
|
const { left, right, prevPosition, currentPosition, isActive } = useResizer(props);
|
|
59
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { "data-no-export": "true", onMouseDown: right.onMouseDown, css: styles.container(right.position.value.x), children: _jsx("div", { style: anchorStyle }) }), _jsx("div", { css: styles.content(left, right, prevPosition), children: typeof children === 'function'
|
|
59
|
+
return (_jsxs(_Fragment, { children: [!disabled && (_jsx("div", { "data-no-export": "true", onMouseDown: right.onMouseDown, css: styles.container(right.position.value.x), children: _jsx("div", { style: anchorStyle }) })), _jsx("div", { css: styles.content(left, right, prevPosition), children: typeof children === 'function'
|
|
60
60
|
? children?.(currentPosition, isActive)
|
|
61
|
-
: children }), _jsx("div", { "data-no-export": "true", onMouseDown: left.onMouseDown, css: styles.container(left.position.value.x), children: _jsx("div", { style: anchorStyle }) })] }));
|
|
61
|
+
: children }), !disabled && (_jsx("div", { "data-no-export": "true", onMouseDown: left.onMouseDown, css: styles.container(left.position.value.x), children: _jsx("div", { style: anchorStyle }) }))] }));
|
|
62
62
|
}
|
|
@@ -14,6 +14,7 @@ export interface ResizerProps {
|
|
|
14
14
|
tag?: 'div' | 'svg';
|
|
15
15
|
parentElement?: HTMLElement | null;
|
|
16
16
|
dragHandleClassName?: string;
|
|
17
|
+
disabled?: boolean;
|
|
17
18
|
}
|
|
18
19
|
declare type PositionChangeHandler = (data: Position) => void;
|
|
19
20
|
export default function Resizer(props: ResizerProps): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import useResizer from './useResizer';
|
|
@@ -29,13 +29,13 @@ const styles = {
|
|
|
29
29
|
`,
|
|
30
30
|
};
|
|
31
31
|
export default function SVGResizer(props) {
|
|
32
|
-
const { children } = props;
|
|
32
|
+
const { children, disabled } = props;
|
|
33
33
|
const { left, right, currentPosition, isActive } = useResizer(props);
|
|
34
34
|
return (_jsxs("g", { style: {
|
|
35
35
|
transform: `translateX(${currentPosition.x1}px)`,
|
|
36
36
|
}, children: [typeof children === 'function'
|
|
37
37
|
? children(currentPosition, isActive)
|
|
38
|
-
: children, _jsx(SVGResizerHandle, { onMouseDown: left.onMouseDown, position: 0 }), _jsx(SVGResizerHandle, { onMouseDown: right.onMouseDown, position: Math.ceil(currentPosition.x2 - currentPosition.x1) })] }));
|
|
38
|
+
: children, !disabled && (_jsxs(_Fragment, { children: [' ', _jsx(SVGResizerHandle, { onMouseDown: left.onMouseDown, position: 0 }), _jsx(SVGResizerHandle, { onMouseDown: right.onMouseDown, position: Math.ceil(currentPosition.x2 - currentPosition.x1) })] }))] }));
|
|
39
39
|
}
|
|
40
40
|
function SVGResizerHandle(props) {
|
|
41
41
|
return (_jsxs("g", { onMouseDown: props.onMouseDown, css: styles.container, style: { transform: `translateX(${props.position}px)` }, "data-no-export": "true", children: [_jsx("rect", { x: "-5px", style: style.innerContainer }), _jsx("rect", { x: "-2.5px", style: style.anchor })] }));
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, memo } from 'react';
|
|
3
|
+
import * as Yup from 'yup';
|
|
4
|
+
import * as Filters from '../../data/Filters';
|
|
5
|
+
import { defaultApodizationOptions } from '../../data/data1d/filter1d/apodization';
|
|
6
|
+
import { useDispatch } from '../context/DispatchContext';
|
|
7
|
+
import ActionButtons from '../elements/ActionButtons';
|
|
8
|
+
import Label from '../elements/Label';
|
|
9
|
+
import FormikCheckBox from '../elements/formik/FormikCheckBox';
|
|
10
|
+
import FormikForm from '../elements/formik/FormikForm';
|
|
11
|
+
import FormikInput from '../elements/formik/FormikInput';
|
|
12
|
+
import FormikOnChange from '../elements/formik/FormikOnChange';
|
|
13
|
+
import { useFilter } from '../hooks/useFilter';
|
|
14
|
+
import { APPLY_APODIZATION_FILTER, CALCULATE_APODIZATION_FILTER, DISABLE_FILTER_LIVE_PREVIEW, RESET_SELECTED_TOOL, } from '../reducer/types/Types';
|
|
15
|
+
import { options } from '../toolbar/ToolTypes';
|
|
16
|
+
import { HeaderContainer } from './HeaderContainer';
|
|
17
|
+
const labelStyle = {
|
|
18
|
+
label: {
|
|
19
|
+
fontWeight: 'normal',
|
|
20
|
+
fontSize: '12px',
|
|
21
|
+
},
|
|
22
|
+
wrapper: {
|
|
23
|
+
paddingRight: '5px',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
const inputStyle = {
|
|
27
|
+
input: { height: '24px', width: '60px' },
|
|
28
|
+
};
|
|
29
|
+
const validationSchema = Yup.object().shape({
|
|
30
|
+
lineBroadening: Yup.number().required(),
|
|
31
|
+
gaussBroadening: Yup.number().required(),
|
|
32
|
+
lineBroadeningCenter: Yup.number().required().min(0).max(1),
|
|
33
|
+
});
|
|
34
|
+
const initialValues = {
|
|
35
|
+
...defaultApodizationOptions,
|
|
36
|
+
livePreview: true,
|
|
37
|
+
};
|
|
38
|
+
function ApodizationOptionsInnerPanel(props) {
|
|
39
|
+
const dispatch = useDispatch();
|
|
40
|
+
const formRef = useRef();
|
|
41
|
+
const handleApplyFilter = (values, triggerSource = 'apply') => {
|
|
42
|
+
const { livePreview, ...filterOptions } = values;
|
|
43
|
+
if (livePreview && triggerSource === 'onChange') {
|
|
44
|
+
dispatch({
|
|
45
|
+
type: CALCULATE_APODIZATION_FILTER,
|
|
46
|
+
payload: filterOptions,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
else if (triggerSource === 'apply') {
|
|
50
|
+
dispatch({
|
|
51
|
+
type: APPLY_APODIZATION_FILTER,
|
|
52
|
+
payload: filterOptions,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const handleCancelFilter = () => {
|
|
57
|
+
dispatch({
|
|
58
|
+
type: RESET_SELECTED_TOOL,
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (props.filter) {
|
|
63
|
+
formRef.current.setValues({ ...props.filter.value, livePreview: true });
|
|
64
|
+
}
|
|
65
|
+
}, [props?.filter]);
|
|
66
|
+
const disableLivePreviewHandler = (event) => {
|
|
67
|
+
//disable filter Live preview
|
|
68
|
+
if (!event.target.checked) {
|
|
69
|
+
dispatch({
|
|
70
|
+
type: DISABLE_FILTER_LIVE_PREVIEW,
|
|
71
|
+
payload: { selectedTool: options.apodization.id },
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return (_jsxs(HeaderContainer, { children: [_jsxs(FormikForm, { ref: formRef, onSubmit: (values) => handleApplyFilter(values), initialValues: initialValues, validationSchema: validationSchema, children: [_jsx(Label, { title: "Line broadening : ", style: labelStyle, children: _jsx(FormikInput, { type: "number", name: "lineBroadening", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "Gauss broadening :", style: labelStyle, children: _jsx(FormikInput, { type: "number", name: "gaussBroadening", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "lineBroadeningCenter [0 - 1] : ", style: labelStyle, children: _jsx(FormikInput, { type: "number", name: "lineBroadeningCenter", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "live preview ", htmlFor: "livePreview", style: { label: { padding: '0 5px' } }, children: _jsx(FormikCheckBox, { name: "livePreview", onChange: disableLivePreviewHandler }) }), _jsx(FormikOnChange, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableValidation: true })] }), _jsx(ActionButtons, { onDone: () => formRef.current.submitForm(), onCancel: handleCancelFilter })] }));
|
|
76
|
+
}
|
|
77
|
+
const MemoziedApodizationPanel = memo(ApodizationOptionsInnerPanel);
|
|
78
|
+
export default function ApodizationOptionsPanel() {
|
|
79
|
+
const filter = useFilter(Filters.apodization.id);
|
|
80
|
+
return _jsx(MemoziedApodizationPanel, { filter: filter });
|
|
81
|
+
}
|
|
@@ -1,56 +1,60 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useRef } from 'react';
|
|
2
|
+
import { memo, useCallback, useRef } from 'react';
|
|
3
3
|
import { useDispatch } from '../context/DispatchContext';
|
|
4
4
|
import Button from '../elements/Button';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import Label from '../elements/Label';
|
|
6
|
+
import FormikForm from '../elements/formik/FormikForm';
|
|
7
|
+
import FormikNumberInput from '../elements/formik/FormikNumberInput';
|
|
8
|
+
import FormikSelect from '../elements/formik/FormikSelect';
|
|
7
9
|
import { AUTO_PEAK_PICKING } from '../reducer/types/Types';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
height: '100%',
|
|
11
|
-
display: 'flex',
|
|
12
|
-
fontSize: '12px',
|
|
13
|
-
alignItems: 'center',
|
|
14
|
-
},
|
|
10
|
+
import { HeaderContainer } from './HeaderContainer';
|
|
11
|
+
const inputStyle = {
|
|
15
12
|
input: {
|
|
16
13
|
width: '50px',
|
|
14
|
+
margin: '0px',
|
|
17
15
|
},
|
|
18
16
|
inputContainer: {
|
|
19
17
|
flex: '2',
|
|
20
18
|
},
|
|
19
|
+
};
|
|
20
|
+
const labelStyle = {
|
|
21
21
|
label: {
|
|
22
|
-
|
|
22
|
+
fontWeight: 'normal',
|
|
23
|
+
fontSize: '12px',
|
|
24
|
+
},
|
|
25
|
+
wrapper: {
|
|
26
|
+
paddingRight: '5px',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
const LookFor = [
|
|
30
|
+
{
|
|
31
|
+
label: 'Positive',
|
|
32
|
+
value: 'positive',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Negative',
|
|
36
|
+
value: 'negative',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: 'Both',
|
|
40
|
+
value: 'both',
|
|
23
41
|
},
|
|
42
|
+
];
|
|
43
|
+
const INIT_VALUES = {
|
|
44
|
+
maxNumberOfPeaks: 50,
|
|
45
|
+
minMaxRatio: 0.1,
|
|
46
|
+
noiseFactor: 3,
|
|
47
|
+
direction: 'positive',
|
|
24
48
|
};
|
|
25
49
|
function AutoPeakPickingOptionPanel() {
|
|
26
50
|
const dispatch = useDispatch();
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const noiseFactor = useRef();
|
|
30
|
-
const lookNegativeRef = useRef();
|
|
31
|
-
const handleApplyFilter = useCallback(() => {
|
|
51
|
+
const formRef = useRef();
|
|
52
|
+
const handleApplyFilter = useCallback((values) => {
|
|
32
53
|
dispatch({
|
|
33
54
|
type: AUTO_PEAK_PICKING,
|
|
34
|
-
options:
|
|
35
|
-
maxNumberOfPeaks: maxNumberOfPeaksRef.current.value,
|
|
36
|
-
minMaxRatio: minMaxRatioRef.current.value,
|
|
37
|
-
noiseFactor: noiseFactor.current.value,
|
|
38
|
-
lookNegative: lookNegativeRef.current.checked,
|
|
39
|
-
},
|
|
55
|
+
options: values,
|
|
40
56
|
});
|
|
41
57
|
}, [dispatch]);
|
|
42
|
-
return (_jsxs(
|
|
43
|
-
input: styles.input,
|
|
44
|
-
inputContainer: styles.inputContainer,
|
|
45
|
-
label: styles.label,
|
|
46
|
-
}, defaultValue: 50 }), _jsx(NumberInput, { ref: noiseFactor, label: "Noise factor", name: "noiseFactor", style: {
|
|
47
|
-
input: styles.input,
|
|
48
|
-
inputContainer: styles.inputContainer,
|
|
49
|
-
label: styles.label,
|
|
50
|
-
}, defaultValue: 3 }), _jsx(NumberInput, { ref: minMaxRatioRef, label: "Min Max Ratio:", name: "minMaxRatio", style: {
|
|
51
|
-
input: styles.input,
|
|
52
|
-
inputContainer: styles.inputContainer,
|
|
53
|
-
label: styles.label,
|
|
54
|
-
}, defaultValue: 0.1, step: "0.01" }), _jsxs("div", { style: { justifyItems: 'baseline', marginRight: '3px' }, children: [_jsx("label", { style: { marginRight: '2px', lineHeight: 2, userSelect: 'none' }, htmlFor: "lookNegative", children: "Detect Negative:" }), _jsx(CheckBox, { name: "lookNegative", ref: lookNegativeRef })] }), _jsx(Button.Done, { onClick: handleApplyFilter, style: { margin: '0 10px' }, children: "Apply" })] }));
|
|
58
|
+
return (_jsxs(HeaderContainer, { children: [_jsxs(FormikForm, { ref: formRef, initialValues: INIT_VALUES, onSubmit: handleApplyFilter, children: [_jsx(Label, { title: "Direction : ", style: labelStyle, children: _jsx(FormikSelect, { name: "direction", items: LookFor, style: { marginLeft: 10, marginRight: 10 }, defaultValue: "positive" }) }), _jsx(Label, { title: "Max Number Of Peaks :", style: labelStyle, children: _jsx(FormikNumberInput, { name: "maxNumberOfPeaks", style: inputStyle }) }), _jsx(Label, { title: "Noise factor :", style: labelStyle, children: _jsx(FormikNumberInput, { name: "noiseFactor", style: inputStyle }) }), _jsx(Label, { title: "Min Max Ratio :", style: labelStyle, children: _jsx(FormikNumberInput, { name: "minMaxRatio", style: inputStyle, step: "0.01" }) })] }), _jsx(Button.Done, { onClick: () => formRef.current.handleSubmit(), style: { margin: '0 10px' }, children: "Apply" })] }));
|
|
55
59
|
}
|
|
56
|
-
export default AutoPeakPickingOptionPanel;
|
|
60
|
+
export default memo(AutoPeakPickingOptionPanel);
|