nmrium 0.34.0 → 0.35.0-pre.1683281080
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/LinesSeries.js +4 -5
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +5 -7
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +142 -160
- package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +4 -4
- package/lib/component/1d/ranges/AssignmentActionsButtons.d.ts +11 -0
- package/lib/component/1d/ranges/AssignmentActionsButtons.js +11 -0
- package/lib/component/1d/ranges/Range.d.ts +3 -10
- package/lib/component/1d/ranges/Range.js +32 -45
- package/lib/component/1d/ranges/Ranges.js +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -2
- package/lib/component/2d/1d-tracer/Left1DChart.d.ts +2 -2
- package/lib/component/2d/1d-tracer/Top1DChart.d.ts +2 -2
- package/lib/component/2d/Chart2D.d.ts +2 -2
- package/lib/component/2d/ft/Contours.js +13 -13
- package/lib/component/2d/ft/FTContainer.d.ts +2 -2
- package/lib/component/2d/zones/Signal.d.ts +1 -1
- package/lib/component/2d/zones/Signal.js +1 -2
- package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
- package/lib/component/2d/zones/SignalCrosshair.js +0 -1
- package/lib/component/2d/zones/Zone.d.ts +2 -2
- package/lib/component/NMRium.d.ts +2 -5
- package/lib/component/NMRium.js +10 -2
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -2
- package/lib/component/assignment/actions/removeAssignment.js +2 -2
- package/lib/component/context/PreferencesContext.d.ts +10 -21
- package/lib/component/context/PreferencesContext.js +4 -7
- package/lib/component/elements/Button.d.ts +4 -2
- package/lib/component/elements/Button.js +26 -15
- package/lib/component/elements/Input.js +38 -46
- package/lib/component/elements/NumberInput.d.ts +4 -12
- package/lib/component/elements/NumberInput.js +10 -40
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -4
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +3 -2
- package/lib/component/elements/ReactTable/ReactTable.d.ts +7 -6
- package/lib/component/elements/ReactTable/ReactTable.js +3 -12
- package/lib/component/elements/ReactTable/Style.js +0 -8
- package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
- package/lib/component/elements/formik/FormikNumberInput.js +13 -3
- package/lib/component/header/ApodizationOptionsPanel.js +2 -12
- package/lib/component/header/AutoPeakPickingOptionPanel.js +11 -15
- package/lib/component/header/BaseLineCorrectionPanel.js +2 -12
- package/lib/component/header/Header.js +2 -2
- package/lib/component/header/PhaseCorrectionPanel.d.ts +2 -0
- package/lib/component/header/{ManualPhaseCorrectionPanel.js → PhaseCorrectionPanel.js} +23 -22
- package/lib/component/header/RangesPickingOptionPanel.js +17 -28
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -2
- package/lib/component/header/Zones2DOptionPanel.js +16 -23
- package/lib/component/highlight/index.d.ts +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -2
- package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +2 -3
- package/lib/component/hooks/useFilter.d.ts +1 -1
- package/lib/component/hooks/useSpectraPerNucleus.d.ts +2 -3
- package/lib/component/hooks/useSpectrum.d.ts +2 -3
- package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
- package/lib/component/modal/ExportAsJcampModal.d.ts +8 -0
- package/lib/component/modal/ExportAsJcampModal.js +62 -0
- package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +1 -1
- package/lib/component/modal/editZone/EditPathLengthFormik.js +11 -14
- package/lib/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +1 -1
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.d.ts +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +3 -3
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +2 -3
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/PanelNoData.d.ts +6 -0
- package/lib/component/panels/PanelNoData.js +24 -0
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +4 -4
- package/lib/component/panels/RangesPanel/RangesPanel.js +12 -7
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +4 -5
- package/lib/component/panels/RangesPanel/RangesTable.js +4 -14
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +5 -4
- package/lib/component/panels/RangesPanel/RangesTableRow.js +15 -11
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +6 -5
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +37 -33
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.d.ts +4 -0
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.js +8 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +6 -11
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraTable.d.ts +3 -4
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +65 -17
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.d.ts +3 -4
- package/lib/component/panels/SpectrumsPanel/base/SpectrumName.d.ts +2 -3
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +0 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +11 -8
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +4 -5
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +1 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js +3 -13
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js +77 -7
- package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +17 -9
- package/lib/component/panels/filtersPanel/FiltersTable.js +16 -30
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib/component/panels/header/PreferencesHeader.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +0 -1
- package/lib/component/reducer/Reducer.d.ts +4 -960
- package/lib/component/reducer/Reducer.js +3 -7
- package/lib/component/reducer/actions/AssignmentsActions.js +2 -4
- package/lib/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +5 -6
- package/lib/component/reducer/actions/DomainActions.js +17 -11
- package/lib/component/reducer/actions/FiltersActions.d.ts +14 -19
- package/lib/component/reducer/actions/FiltersActions.js +257 -152
- package/lib/component/reducer/actions/LoadActions.d.ts +2 -3
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/PeaksActions.d.ts +1 -1
- package/lib/component/reducer/actions/PeaksActions.js +6 -2
- package/lib/component/reducer/actions/PreferencesActions.js +3 -0
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +19 -11
- package/lib/component/reducer/actions/SpectrumsActions.js +15 -13
- package/lib/component/reducer/actions/ToolsActions.d.ts +6 -2
- package/lib/component/reducer/actions/ToolsActions.js +41 -38
- package/lib/component/reducer/actions/ZonesActions.d.ts +1 -1
- package/lib/component/reducer/actions/ZonesActions.js +7 -3
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.js +6 -3
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -4843
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -4
- package/lib/component/reducer/types/Types.d.ts +0 -2
- package/lib/component/reducer/types/Types.js +0 -2
- package/lib/component/toolbar/BasicToolBar.js +3 -3
- package/lib/component/toolbar/FunctionToolBar.js +2 -2
- package/lib/component/toolbar/ToolTypes.d.ts +1 -2
- package/lib/component/toolbar/ToolTypes.js +13 -13
- package/lib/component/utility/getSpectraByNucleus.d.ts +2 -3
- package/lib/component/utility/getSpectraObjectPaths.d.ts +2 -3
- package/lib/component/workspaces/Workspace.d.ts +1 -0
- package/lib/component/workspaces/assignment.js +1 -1
- package/lib/component/workspaces/basic.js +1 -1
- package/lib/component/workspaces/embedded.js +1 -1
- package/lib/component/workspaces/exercise.js +1 -1
- package/lib/component/workspaces/prediction.js +1 -1
- package/lib/component/workspaces/process1D.js +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/Filters.d.ts +0 -4
- package/lib/data/Filters.js +0 -4
- package/lib/data/FiltersManager.d.ts +17 -5
- package/lib/data/FiltersManager.js +21 -14
- package/lib/data/PredictionManager.d.ts +2 -3
- package/lib/data/SpectraManager.d.ts +11 -0
- package/lib/data/SpectraManager.js +47 -5
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -2
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.js +3 -3
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +16 -17
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +7 -7
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +3 -4
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.js +10 -0
- package/lib/data/data1d/Spectrum1D/isSpectrum1D.d.ts +2 -3
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -5
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +7 -7
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +5 -5
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +8 -9
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +13 -7
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +13 -7
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +9 -9
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +6 -5
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +10 -9
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +6 -6
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.d.ts +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +2 -2
- package/lib/data/data1d/filter1d/apodization.d.ts +8 -6
- package/lib/data/data1d/filter1d/apodization.js +4 -0
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +6 -4
- package/lib/data/data1d/filter1d/baselineCorrection.js +4 -0
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +7 -6
- package/lib/data/data1d/filter1d/digitalFilter.js +15 -11
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +5 -5
- package/lib/data/data1d/filter1d/equallySpaced.js +10 -10
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +7 -5
- package/lib/data/data1d/filter1d/exclusionZones.js +13 -9
- package/lib/data/data1d/filter1d/fft.d.ts +6 -4
- package/lib/data/data1d/filter1d/fft.js +27 -23
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +6 -5
- package/lib/data/data1d/filter1d/phaseCorrection.js +22 -17
- package/lib/data/data1d/filter1d/shiftX.d.ts +5 -3
- package/lib/data/data1d/filter1d/shiftX.js +7 -3
- package/lib/data/data1d/filter1d/signalProcessing.d.ts +7 -5
- package/lib/data/data1d/filter1d/signalProcessing.js +15 -11
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +2 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +6 -6
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +7 -6
- package/lib/data/data1d/filter1d/zeroFilling.js +15 -11
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +4 -5
- package/lib/data/data2d/Spectrum2D/contours.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/contours.js +5 -4
- package/lib/data/data2d/Spectrum2D/get2DColor.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/get2DSpectrumErrorValue.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/get2DSpectrumErrorValue.js +2 -2
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +2 -3
- package/lib/data/data2d/Spectrum2D/getShift.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/getShift.js +3 -3
- package/lib/data/data2d/Spectrum2D/getSlice.d.ts +4 -4
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/isSpectrum2D.d.ts +2 -3
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +4 -10
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +6 -12
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.js +2 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +6 -12
- package/lib/data/data2d/Spectrum2D/zones/mapZones.js +1 -0
- package/lib/data/data2d/Spectrum2D/zones/updateZones.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/updateZones.js +2 -2
- package/lib/data/data2d/filter2d/shiftX.d.ts +6 -4
- package/lib/data/data2d/filter2d/shiftX.js +10 -6
- package/lib/data/data2d/filter2d/shiftY.d.ts +5 -3
- package/lib/data/data2d/filter2d/shiftY.js +5 -1
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.js +2 -2
- package/lib/data/parseMeta/linkMetaWithSpectra.d.ts +2 -3
- package/lib/data/types/common/Info.d.ts +1 -0
- package/lib/data/types/data1d/ComplexData1D.d.ts +1 -1
- package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
- package/lib/data/types/data1d/index.d.ts +0 -11
- package/lib/data/types/data2d/index.d.ts +0 -7
- package/lib/data/utilities/FindUtilities.d.ts +7 -9
- package/lib/data/utilities/RangeUtilities.d.ts +7 -2
- package/lib/data/utilities/RangeUtilities.js +9 -16
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.js +6 -6
- package/lib/data/utilities/calculateSanPlot.d.ts +2 -3
- package/lib/data/utilities/convertSpectraListToObject.d.ts +2 -3
- package/lib/data/utilities/generateColor.d.ts +1 -1
- package/lib/types/NMRiumDataReturn.d.ts +2 -3
- package/lib/types/NMRiumToolBarPreferences.d.ts +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/LinesSeries.js +4 -5
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +144 -160
- package/lib-cjs/component/1d/ranges/AssignmentActionsButtons.js +18 -0
- package/lib-cjs/component/1d/ranges/Range.js +31 -44
- package/lib-cjs/component/1d/ranges/Ranges.js +1 -1
- package/lib-cjs/component/2d/ft/Contours.js +13 -13
- package/lib-cjs/component/2d/zones/Signal.js +1 -2
- package/lib-cjs/component/2d/zones/SignalCrosshair.js +0 -1
- package/lib-cjs/component/NMRium.js +10 -2
- package/lib-cjs/component/assignment/actions/removeAssignment.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +4 -7
- package/lib-cjs/component/elements/Button.js +26 -15
- package/lib-cjs/component/elements/Input.js +37 -45
- package/lib-cjs/component/elements/NumberInput.js +8 -38
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +3 -2
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +3 -12
- package/lib-cjs/component/elements/ReactTable/Style.js +0 -8
- package/lib-cjs/component/elements/formik/FormikNumberInput.js +13 -3
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +1 -11
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +33 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +1 -11
- package/lib-cjs/component/header/Header.js +2 -2
- package/lib-cjs/component/header/{ManualPhaseCorrectionPanel.js → PhaseCorrectionPanel.js} +24 -23
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +38 -26
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +0 -1
- package/lib-cjs/component/header/Zones2DOptionPanel.js +37 -21
- package/lib-cjs/component/modal/ExportAsJcampModal.js +67 -0
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +11 -14
- package/lib-cjs/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/ToolsTabContent.js +1 -1
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +3 -3
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
- package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib-cjs/component/panels/PanelNoData.js +28 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +4 -4
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +12 -7
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +4 -14
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +15 -10
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +36 -32
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.js +12 -0
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +6 -11
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +63 -15
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +0 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +11 -8
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -12
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +76 -6
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +15 -7
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +16 -30
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib-cjs/component/panels/header/PreferencesHeader.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +0 -1
- package/lib-cjs/component/reducer/Reducer.js +3 -7
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +2 -4
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib-cjs/component/reducer/actions/DomainActions.js +17 -11
- package/lib-cjs/component/reducer/actions/FiltersActions.js +257 -153
- package/lib-cjs/component/reducer/actions/LoadActions.js +1 -1
- package/lib-cjs/component/reducer/actions/PeaksActions.js +6 -2
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +3 -0
- package/lib-cjs/component/reducer/actions/RangesActions.js +19 -11
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +13 -11
- package/lib-cjs/component/reducer/actions/ToolsActions.js +38 -35
- package/lib-cjs/component/reducer/actions/ZonesActions.js +7 -3
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +6 -3
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -4
- package/lib-cjs/component/reducer/types/Types.js +2 -4
- package/lib-cjs/component/toolbar/BasicToolBar.js +3 -3
- package/lib-cjs/component/toolbar/FunctionToolBar.js +2 -2
- package/lib-cjs/component/toolbar/ToolTypes.js +13 -13
- package/lib-cjs/component/workspaces/assignment.js +1 -1
- package/lib-cjs/component/workspaces/basic.js +1 -1
- package/lib-cjs/component/workspaces/embedded.js +1 -1
- package/lib-cjs/component/workspaces/exercise.js +1 -1
- package/lib-cjs/component/workspaces/prediction.js +1 -1
- package/lib-cjs/component/workspaces/process1D.js +1 -1
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib-cjs/data/Filters.js +1 -5
- package/lib-cjs/data/FiltersManager.js +22 -14
- package/lib-cjs/data/SpectraManager.js +48 -5
- package/lib-cjs/data/data1d/Spectrum1D/get1DDataXY.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +16 -17
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/isRangeAssigned.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +13 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +13 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +9 -9
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +6 -6
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +2 -2
- package/lib-cjs/data/data1d/filter1d/apodization.js +5 -1
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +5 -1
- package/lib-cjs/data/data1d/filter1d/digitalFilter.js +16 -12
- package/lib-cjs/data/data1d/filter1d/equallySpaced.js +10 -10
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +14 -10
- package/lib-cjs/data/data1d/filter1d/fft.js +27 -23
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +23 -18
- package/lib-cjs/data/data1d/filter1d/shiftX.js +8 -4
- package/lib-cjs/data/data1d/filter1d/signalProcessing.js +16 -12
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +6 -6
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +16 -12
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +5 -4
- package/lib-cjs/data/data2d/Spectrum2D/get2DSpectrumErrorValue.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -3
- package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/initiateZones.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/zones/isZoneExists.js +3 -3
- package/lib-cjs/data/data2d/Spectrum2D/zones/mapZones.js +1 -0
- package/lib-cjs/data/data2d/Spectrum2D/zones/updateZones.js +2 -2
- package/lib-cjs/data/data2d/filter2d/shiftX.js +11 -7
- package/lib-cjs/data/data2d/filter2d/shiftY.js +6 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +2 -2
- package/lib-cjs/data/utilities/RangeUtilities.js +9 -16
- package/lib-cjs/data/utilities/ZoneUtilities.js +6 -6
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +37 -36
- package/lib/component/header/ManualPhaseCorrectionPanel.d.ts +0 -2
- package/lib/data/data1d/filter1d/centerMean.d.ts +0 -13
- package/lib/data/data1d/filter1d/centerMean.js +0 -37
- package/lib/data/data1d/filter1d/fromTo.d.ts +0 -13
- package/lib/data/data1d/filter1d/fromTo.js +0 -31
- package/lib/data/data1d/filter1d/pareto.d.ts +0 -13
- package/lib/data/data1d/filter1d/pareto.js +0 -29
- package/lib/data/data1d/filter1d/standardDeviation.d.ts +0 -13
- package/lib/data/data1d/filter1d/standardDeviation.js +0 -37
- package/lib/data/types/data1d/Data1D.d.ts +0 -5
- package/lib/data/types/data1d/Data1D.js +0 -1
- package/lib/data/types/data1d/Datum1D.d.ts +0 -23
- package/lib/data/types/data1d/Datum1D.js +0 -1
- package/lib/data/types/data1d/Display1D.d.ts +0 -5
- package/lib/data/types/data1d/Display1D.js +0 -1
- package/lib/data/types/data1d/Info1D.d.ts +0 -8
- package/lib/data/types/data1d/Info1D.js +0 -1
- package/lib/data/types/data1d/Integral.d.ts +0 -10
- package/lib/data/types/data1d/Integral.js +0 -1
- package/lib/data/types/data1d/Integrals.d.ts +0 -6
- package/lib/data/types/data1d/Integrals.js +0 -1
- package/lib/data/types/data1d/Peak.d.ts +0 -5
- package/lib/data/types/data1d/Peak.js +0 -1
- package/lib/data/types/data1d/Peaks.d.ts +0 -5
- package/lib/data/types/data1d/Peaks.js +0 -1
- package/lib/data/types/data1d/Range.d.ts +0 -11
- package/lib/data/types/data1d/Range.js +0 -1
- package/lib/data/types/data1d/Ranges.d.ts +0 -6
- package/lib/data/types/data1d/Ranges.js +0 -1
- package/lib/data/types/data1d/Signal1D.d.ts +0 -5
- package/lib/data/types/data1d/Signal1D.js +0 -1
- package/lib/data/types/data1d/SumOptions.d.ts +0 -7
- package/lib/data/types/data1d/SumOptions.js +0 -1
- package/lib/data/types/data2d/Data2D.d.ts +0 -20
- package/lib/data/types/data2d/Data2D.js +0 -1
- package/lib/data/types/data2d/Datum2D.d.ts +0 -19
- package/lib/data/types/data2d/Datum2D.js +0 -1
- package/lib/data/types/data2d/Display2D.d.ts +0 -11
- package/lib/data/types/data2d/Display2D.js +0 -1
- package/lib/data/types/data2d/Info2D.d.ts +0 -5
- package/lib/data/types/data2d/Info2D.js +0 -1
- package/lib/data/types/data2d/Signal2D.d.ts +0 -7
- package/lib/data/types/data2d/Signal2D.js +0 -1
- package/lib/data/types/data2d/Signal2DAxisData.d.ts +0 -4
- package/lib/data/types/data2d/Signal2DAxisData.js +0 -1
- package/lib/data/types/data2d/Zone.d.ts +0 -9
- package/lib/data/types/data2d/Zone.js +0 -1
- package/lib/data/types/data2d/Zone2DAxisData.d.ts +0 -6
- package/lib/data/types/data2d/Zone2DAxisData.js +0 -1
- package/lib/data/types/data2d/Zones.d.ts +0 -7
- package/lib/data/types/data2d/Zones.js +0 -1
- package/lib-cjs/data/data1d/filter1d/centerMean.js +0 -43
- package/lib-cjs/data/data1d/filter1d/fromTo.js +0 -37
- package/lib-cjs/data/data1d/filter1d/pareto.js +0 -35
- package/lib-cjs/data/data1d/filter1d/standardDeviation.js +0 -43
- package/lib-cjs/data/types/data1d/Data1D.js +0 -2
- package/lib-cjs/data/types/data1d/Datum1D.js +0 -2
- package/lib-cjs/data/types/data1d/Display1D.js +0 -2
- package/lib-cjs/data/types/data1d/Info1D.js +0 -2
- package/lib-cjs/data/types/data1d/Integral.js +0 -2
- package/lib-cjs/data/types/data1d/Integrals.js +0 -2
- package/lib-cjs/data/types/data1d/Peak.js +0 -2
- package/lib-cjs/data/types/data1d/Peaks.js +0 -2
- package/lib-cjs/data/types/data1d/Range.js +0 -2
- package/lib-cjs/data/types/data1d/Ranges.js +0 -2
- package/lib-cjs/data/types/data1d/Signal1D.js +0 -2
- package/lib-cjs/data/types/data1d/SumOptions.js +0 -2
- package/lib-cjs/data/types/data2d/Data2D.js +0 -2
- package/lib-cjs/data/types/data2d/Datum2D.js +0 -2
- package/lib-cjs/data/types/data2d/Display2D.js +0 -2
- package/lib-cjs/data/types/data2d/Info2D.js +0 -2
- package/lib-cjs/data/types/data2d/Signal2D.js +0 -2
- package/lib-cjs/data/types/data2d/Signal2DAxisData.js +0 -2
- package/lib-cjs/data/types/data2d/Zone.js +0 -2
- package/lib-cjs/data/types/data2d/Zone2DAxisData.js +0 -2
- package/lib-cjs/data/types/data2d/Zones.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { Spectrum1D } from 'nmr-load-save';
|
|
3
3
|
interface Top1DChartProps {
|
|
4
4
|
margin?: number;
|
|
5
|
-
data:
|
|
5
|
+
data: Spectrum1D;
|
|
6
6
|
}
|
|
7
7
|
declare function Top1DChart({ margin: marginProps, data: spectrum, }: Top1DChartProps): JSX.Element | null;
|
|
8
8
|
declare const _default: import("react").MemoExoticComponent<typeof Top1DChart>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { Spectrum1D } from 'nmr-load-save';
|
|
3
3
|
interface Chart2DProps {
|
|
4
|
-
spectra?:
|
|
4
|
+
spectra?: Spectrum1D[];
|
|
5
5
|
}
|
|
6
6
|
export default function Chart2D({ spectra }: Chart2DProps): JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -11,9 +11,9 @@ import { useActiveSpectrum } from '../../hooks/useActiveSpectrum';
|
|
|
11
11
|
import { PathBuilder } from '../../utility/PathBuilder';
|
|
12
12
|
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
|
|
13
13
|
import { get2DXScale, get2DYScale } from '../utilities/scale';
|
|
14
|
-
function usePath(
|
|
14
|
+
function usePath(spectrum, contours) {
|
|
15
15
|
const { margin, width, height, xDomain, yDomain } = useChartData();
|
|
16
|
-
const shift = getShift(
|
|
16
|
+
const shift = getShift(spectrum);
|
|
17
17
|
const _scaleX = get2DXScale({ margin, width, xDomain });
|
|
18
18
|
const _scaleY = get2DYScale({ margin, height, yDomain });
|
|
19
19
|
const pathBuilder = new PathBuilder();
|
|
@@ -37,31 +37,31 @@ function usePath(datum, contours) {
|
|
|
37
37
|
pathBuilder.closePath();
|
|
38
38
|
return pathBuilder.toString();
|
|
39
39
|
}
|
|
40
|
-
const useContoursLevel = (
|
|
40
|
+
const useContoursLevel = (spectrum, sign) => {
|
|
41
41
|
const { view: { zoom: { levels }, }, } = useChartData();
|
|
42
|
-
const { id, display: { contourOptions }, } =
|
|
42
|
+
const { id, display: { contourOptions }, } = spectrum;
|
|
43
43
|
const defaultLevel = getDefaultContoursLevel(contourOptions);
|
|
44
44
|
const level = levels?.[id]?.[sign];
|
|
45
45
|
return typeof level !== 'number' ? defaultLevel[sign] : level;
|
|
46
46
|
};
|
|
47
|
-
function ContoursPaths({ id: spectrumID, sign, color,
|
|
47
|
+
function ContoursPaths({ id: spectrumID, sign, color, spectrum, onTimeout, }) {
|
|
48
48
|
const activeSpectrum = useActiveSpectrum();
|
|
49
49
|
const preferences = usePreferences();
|
|
50
|
-
const level = useContoursLevel(
|
|
50
|
+
const level = useContoursLevel(spectrum, sign);
|
|
51
51
|
const contours = useMemo(() => {
|
|
52
|
-
const { contours, timeout } = drawContours(level,
|
|
52
|
+
const { contours, timeout } = drawContours(level, spectrum, sign === 'negative');
|
|
53
53
|
if (timeout) {
|
|
54
54
|
onTimeout();
|
|
55
55
|
}
|
|
56
56
|
return contours;
|
|
57
|
-
}, [
|
|
58
|
-
const path = usePath(
|
|
57
|
+
}, [spectrum, level, onTimeout, sign]);
|
|
58
|
+
const path = usePath(spectrum, contours);
|
|
59
59
|
const opacity = activeSpectrum === null || spectrumID === activeSpectrum.id
|
|
60
60
|
? '1'
|
|
61
61
|
: get(preferences.current, 'general.dimmedSpectraOpacity', 0.1);
|
|
62
62
|
return (_jsx("path", { fill: "none", "data-test-id": "spectrum-line", stroke: color, strokeWidth: "1", opacity: opacity, d: path }));
|
|
63
63
|
}
|
|
64
|
-
function ContoursInner({
|
|
64
|
+
function ContoursInner({ spectra, displayerKey }) {
|
|
65
65
|
const alert = useAlert();
|
|
66
66
|
const debounceAlert = useRef(debounce(() => {
|
|
67
67
|
alert.error('Too many contour lines, only showing the first ones');
|
|
@@ -69,13 +69,13 @@ function ContoursInner({ data, displayerKey }) {
|
|
|
69
69
|
function timeoutHandler() {
|
|
70
70
|
debounceAlert.current();
|
|
71
71
|
}
|
|
72
|
-
return (_jsx("g", { clipPath: `url(#${displayerKey}clip-chart-2d)`, className: "contours", children:
|
|
72
|
+
return (_jsx("g", { clipPath: `url(#${displayerKey}clip-chart-2d)`, className: "contours", children: spectra?.map((spectrum) => (_jsxs("g", { children: [spectrum.display.isPositiveVisible && (_jsx(ContoursPaths, { id: spectrum.id, sign: "positive", spectrum: spectrum, color: spectrum.display.positiveColor, onTimeout: timeoutHandler })), spectrum.display.isNegativeVisible && (_jsx(ContoursPaths, { id: spectrum.id, sign: "negative", spectrum: spectrum, color: spectrum.display.negativeColor, onTimeout: timeoutHandler }))] }, spectrum.id))) }));
|
|
73
73
|
}
|
|
74
74
|
const MemoizedContours = memo(ContoursInner);
|
|
75
75
|
export default function Contours() {
|
|
76
76
|
const { data: spectra, displayerKey, view: { spectra: { activeTab }, }, } = useChartData();
|
|
77
|
-
const
|
|
77
|
+
const spectra2d = useMemo(() => {
|
|
78
78
|
return getSpectraByNucleus(activeTab, spectra).filter((datum) => datum.info.isFt);
|
|
79
79
|
}, [activeTab, spectra]);
|
|
80
|
-
return _jsx(MemoizedContours, { ...{
|
|
80
|
+
return _jsx(MemoizedContours, { ...{ spectra: spectra2d, displayerKey } });
|
|
81
81
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { Spectrum1D } from 'nmr-load-save';
|
|
3
3
|
interface FTContainerProps {
|
|
4
|
-
spectra?:
|
|
4
|
+
spectra?: Spectrum1D[];
|
|
5
5
|
}
|
|
6
6
|
export declare function FTContainer(props: FTContainerProps): JSX.Element | null;
|
|
7
7
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
/** @jsxImportSource @emotion/react */
|
|
3
2
|
import { memo, useState, useEffect, useCallback } from 'react';
|
|
4
3
|
import { buildID } from '../../../data/utilities/Concatenation';
|
|
5
4
|
import { useAssignment } from '../../assignment/AssignmentsContext';
|
|
@@ -41,7 +40,7 @@ function Signal({ signal, isVisible }) {
|
|
|
41
40
|
assignment.hide();
|
|
42
41
|
highlight.hide();
|
|
43
42
|
}, cx: scaleX(signal.x.delta || 0), cy: scaleY(signal.y.delta || 0), r: isHighlighted ? 6 : 4, fill: isHighlighted ? 'green' : 'darkgreen' }, signal.id)] })), _jsx("g", { className: "zone-signal-peak", style: { pointerEvents: 'none' }, children: isVisible.peaks &&
|
|
44
|
-
signal
|
|
43
|
+
signal?.peaks &&
|
|
45
44
|
signal.peaks.map((peak, i) => (_jsx("circle", { cx: scaleX(peak.x), cy: scaleY(peak.y), r: 2, fill: "black" }, `${signal.id + i}`))) })] }));
|
|
46
45
|
}
|
|
47
46
|
export default memo(Signal);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import { CorrelationData } from 'nmr-correlation';
|
|
3
|
-
import { Source, NmriumState } from 'nmr-load-save';
|
|
3
|
+
import { Source, NmriumState, Spectrum } from 'nmr-load-save';
|
|
4
4
|
import { ReactElement, ReactNode } from 'react';
|
|
5
|
-
import { Datum1D } from '../data/types/data1d';
|
|
6
|
-
import { Datum2D } from '../data/types/data2d';
|
|
7
5
|
import { BlobObject } from './utility/export';
|
|
8
6
|
import { CustomWorkspaces, WorkspacePreferences as NMRiumPreferences } from './workspaces/Workspace';
|
|
9
7
|
export { serializeNmriumState } from 'nmr-load-save';
|
|
@@ -26,14 +24,13 @@ export interface NMRiumProps {
|
|
|
26
24
|
export type Molecules = Array<{
|
|
27
25
|
molfile: string;
|
|
28
26
|
}>;
|
|
29
|
-
export type Spectra = Array<Datum1D | Datum2D>;
|
|
30
27
|
type DeepPartial<T> = {
|
|
31
28
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
32
29
|
};
|
|
33
30
|
export interface NMRiumData {
|
|
34
31
|
source?: Source;
|
|
35
32
|
molecules?: Molecules;
|
|
36
|
-
spectra: DeepPartial<
|
|
33
|
+
spectra: DeepPartial<Spectrum>[];
|
|
37
34
|
correlations?: CorrelationData;
|
|
38
35
|
}
|
|
39
36
|
export interface NMRiumRef {
|
package/lib/component/NMRium.js
CHANGED
|
@@ -102,8 +102,16 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
|
|
|
102
102
|
const stateRef = useRef();
|
|
103
103
|
useEffect(() => {
|
|
104
104
|
const { workspace, workspaces = {} } = preferencesState;
|
|
105
|
-
stateRef.current = toJSON({ data: spectraData, molecules, correlations, source, view }, { current: workspaces[workspace.current] }, { serialize: false, exportTarget: 'onChange' });
|
|
106
|
-
}, [
|
|
105
|
+
stateRef.current = toJSON({ data: spectraData, molecules, correlations, source, view, actionType }, { current: workspaces[workspace.current] }, { serialize: false, exportTarget: 'onChange' });
|
|
106
|
+
}, [
|
|
107
|
+
actionType,
|
|
108
|
+
correlations,
|
|
109
|
+
molecules,
|
|
110
|
+
preferencesState,
|
|
111
|
+
source,
|
|
112
|
+
spectraData,
|
|
113
|
+
view,
|
|
114
|
+
]);
|
|
107
115
|
useEffect(() => {
|
|
108
116
|
// trigger onChange callback if data object changed
|
|
109
117
|
if (checkActionType(actionType)) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Data1D } from '
|
|
2
|
-
import { Data2D } from '../../data/types/data2d';
|
|
1
|
+
import { Data1D, Data2D } from 'nmr-load-save';
|
|
3
2
|
import { ActionType } from '../reducer/types/Types';
|
|
4
3
|
import { AssignmentDimension, AssignmentState, Axis } from './AssignmentsContext';
|
|
5
4
|
export type InitiateAction = ActionType<'INITIATE_ASSIGNMENTS', {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export function removeAssignment(state, options) {
|
|
2
2
|
const { id, atomID = '', axis } = options;
|
|
3
|
-
|
|
3
|
+
let atomIDs = state.assignments?.[id]?.[axis] || null;
|
|
4
4
|
if (atomIDs) {
|
|
5
5
|
if (atomID) {
|
|
6
|
-
atomIDs.filter((id) => id !== atomID);
|
|
6
|
+
atomIDs = atomIDs.filter((id) => id !== atomID);
|
|
7
7
|
state.assignments[id][axis] = atomIDs;
|
|
8
8
|
}
|
|
9
9
|
else {
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { PreferencesState } from '../reducer/preferences/preferencesReducer';
|
|
2
|
+
import { PreferencesState, WorkspaceWithSource } from '../reducer/preferences/preferencesReducer';
|
|
3
3
|
export interface PreferencesContextData extends PreferencesState {
|
|
4
4
|
isCurrentWorkspaceReadOnly: boolean;
|
|
5
|
+
current: WorkspaceWithSource;
|
|
5
6
|
}
|
|
6
7
|
export declare const PreferencesContext: import("react").Context<PreferencesState>;
|
|
7
8
|
export declare const PreferencesProvider: import("react").Provider<PreferencesState>;
|
|
8
9
|
export declare function usePreferences(): {
|
|
9
|
-
current:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
base: import("../NMRium").NMRiumWorkspace | null;
|
|
13
|
-
};
|
|
10
|
+
current: any;
|
|
11
|
+
isCurrentWorkspaceReadOnly: boolean;
|
|
12
|
+
version: number;
|
|
14
13
|
workspaces: import("../reducer/preferences/preferencesReducer").WorkspacesWithSource;
|
|
15
14
|
originalWorkspaces: import("../reducer/preferences/preferencesReducer").WorkspacesWithSource;
|
|
16
15
|
dispatch: (action?: ({
|
|
@@ -108,19 +107,9 @@ export declare function usePreferences(): {
|
|
|
108
107
|
nucleus: string;
|
|
109
108
|
};
|
|
110
109
|
}) | undefined) => void;
|
|
111
|
-
|
|
110
|
+
workspace: {
|
|
111
|
+
current: import("../NMRium").NMRiumWorkspace;
|
|
112
|
+
base: import("../NMRium").NMRiumWorkspace | null;
|
|
113
|
+
};
|
|
112
114
|
};
|
|
113
|
-
export declare function useWorkspacesList():
|
|
114
|
-
visible: boolean;
|
|
115
|
-
version: number;
|
|
116
|
-
label: string;
|
|
117
|
-
display: import("../workspaces/Workspace").DisplayPreferences;
|
|
118
|
-
general: import("../workspaces/Workspace").GeneralPreferences;
|
|
119
|
-
formatting: import("../workspaces/Workspace").Formatting;
|
|
120
|
-
databases: import("../workspaces/Workspace").Databases;
|
|
121
|
-
nmrLoaders: import("../workspaces/Workspace").LoadersPreferences;
|
|
122
|
-
infoBlock: import("../workspaces/Workspace").InfoBlock;
|
|
123
|
-
onLoadProcessing: Partial<Record<import("../../data/types/common/Nucleus").Nucleus, import("../../data/FiltersManager").BaseFilter[]>>;
|
|
124
|
-
source: import("../workspaces/Workspace").WorkSpaceSource;
|
|
125
|
-
key: string;
|
|
126
|
-
}[];
|
|
115
|
+
export declare function useWorkspacesList(): any[];
|
|
@@ -8,17 +8,14 @@ export function usePreferences() {
|
|
|
8
8
|
if (!context) {
|
|
9
9
|
throw new Error('Preferences context was not found');
|
|
10
10
|
}
|
|
11
|
-
const { workspace, workspaces
|
|
11
|
+
const { workspace, workspaces } = context;
|
|
12
12
|
return useMemo(() => {
|
|
13
13
|
return {
|
|
14
|
-
|
|
15
|
-
workspace,
|
|
16
|
-
workspaces,
|
|
17
|
-
originalWorkspaces,
|
|
18
|
-
dispatch,
|
|
14
|
+
...context,
|
|
15
|
+
current: workspaces?.[workspace.current] || workspaces.default,
|
|
19
16
|
isCurrentWorkspaceReadOnly: isReadOnlyWorkspace(context),
|
|
20
17
|
};
|
|
21
|
-
}, [workspaces, workspace,
|
|
18
|
+
}, [workspaces, workspace, context]);
|
|
22
19
|
}
|
|
23
20
|
export function useWorkspacesList() {
|
|
24
21
|
const { workspaces } = usePreferences();
|
|
@@ -9,6 +9,7 @@ interface BaseColor {
|
|
|
9
9
|
active?: Color;
|
|
10
10
|
}
|
|
11
11
|
type Fill = 'clear' | 'outline' | 'solid';
|
|
12
|
+
type ColorTheme = 'success' | 'danger' | 'warning' | 'medium' | 'light' | 'secondary';
|
|
12
13
|
interface ButtonStyle {
|
|
13
14
|
color: BaseColor;
|
|
14
15
|
size: Size;
|
|
@@ -16,16 +17,17 @@ interface ButtonStyle {
|
|
|
16
17
|
backgroundColor: BaseColor;
|
|
17
18
|
borderRadius?: CSSProperties['borderRadius'];
|
|
18
19
|
fill?: Fill;
|
|
19
|
-
style?: CSSObject;
|
|
20
|
+
style?: CSSObject | CSSProperties;
|
|
20
21
|
wrapperStyle?: CSSProperties;
|
|
21
22
|
}
|
|
22
23
|
type TooltipOrientation = 'vertical' | 'horizontal';
|
|
23
|
-
interface ButtonProps extends Partial<ButtonStyle>, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'style'> {
|
|
24
|
+
export interface ButtonProps extends Partial<ButtonStyle>, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'style'> {
|
|
24
25
|
onClick?: (event?: MouseEvent<HTMLButtonElement>) => void;
|
|
25
26
|
children: ReactNode;
|
|
26
27
|
toolTip?: string;
|
|
27
28
|
tooltipOrientation?: TooltipOrientation;
|
|
28
29
|
wrapperClassName?: string;
|
|
30
|
+
theme?: ColorTheme;
|
|
29
31
|
}
|
|
30
32
|
declare function Button(props: ButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
31
33
|
declare namespace Button {
|
|
@@ -155,7 +155,13 @@ const toolTipStyle = (orientation) => {
|
|
|
155
155
|
]);
|
|
156
156
|
};
|
|
157
157
|
function Button(props) {
|
|
158
|
-
const {
|
|
158
|
+
const { theme = 'light', ...buttonProps } = props;
|
|
159
|
+
const { base, shade, tint } = colorPalettes[theme];
|
|
160
|
+
const { onClick, size = 'small', color = { base: shade, hover: 'white' }, backgroundColor = {
|
|
161
|
+
base,
|
|
162
|
+
hover: shade,
|
|
163
|
+
active: tint,
|
|
164
|
+
}, borderColor = 'transparent', fill = 'solid', borderRadius, style = {}, wrapperStyle = {}, toolTip, tooltipOrientation = 'vertical', wrapperClassName, ...restProps } = buttonProps;
|
|
159
165
|
return (_jsxs("div", { style: { position: 'relative', ...wrapperStyle }, ...(wrapperClassName && { className: wrapperClassName }), children: [_jsx("button", { type: "button", onClick: onClick, css: [
|
|
160
166
|
styles.button({
|
|
161
167
|
size,
|
|
@@ -172,27 +178,32 @@ function Button(props) {
|
|
|
172
178
|
justifyContent: 'center',
|
|
173
179
|
}, children: toolTip }) }))] }));
|
|
174
180
|
}
|
|
175
|
-
function ThemeButton(props) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
181
|
+
// function ThemeButton(props: { colorTheme: ColorTheme } & ButtonProps) {
|
|
182
|
+
// const { colorTheme, ...buttonProps } = props;
|
|
183
|
+
// const { base, shade, tint } = colorPalettes[colorTheme];
|
|
184
|
+
// const {
|
|
185
|
+
// color = { base: shade, hover: 'white' },
|
|
186
|
+
// backgroundColor = {
|
|
187
|
+
// base,
|
|
188
|
+
// hover: shade,
|
|
189
|
+
// active: tint,
|
|
190
|
+
// },
|
|
191
|
+
// fill = 'solid',
|
|
192
|
+
// ...restProps
|
|
193
|
+
// } = buttonProps;
|
|
194
|
+
// return <Button {...{ fill, ...restProps, backgroundColor, color }} />;
|
|
195
|
+
// }
|
|
185
196
|
Button.Done = function ButtonDone(props) {
|
|
186
|
-
return _jsx(
|
|
197
|
+
return _jsx(Button, { ...props, theme: "success" });
|
|
187
198
|
};
|
|
188
199
|
Button.Danger = function ButtonDanger(props) {
|
|
189
|
-
return _jsx(
|
|
200
|
+
return _jsx(Button, { ...props, theme: "danger" });
|
|
190
201
|
};
|
|
191
202
|
Button.Action = function ButtonAction(props) {
|
|
192
|
-
return _jsx(
|
|
203
|
+
return _jsx(Button, { ...props, theme: "medium" });
|
|
193
204
|
};
|
|
194
205
|
Button.Secondary = function ButtonAction(props) {
|
|
195
|
-
return _jsx(
|
|
206
|
+
return _jsx(Button, { ...props, theme: "secondary" });
|
|
196
207
|
};
|
|
197
208
|
Button.Info = function ButtonInfo(props) {
|
|
198
209
|
return (_jsx(Button, { ...props, children: _jsx(FaInfoCircle, {}) }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import debounce from 'lodash/debounce';
|
|
3
|
-
import { useState, useEffect,
|
|
3
|
+
import { useState, useEffect, useRef, forwardRef, useMemo, } from 'react';
|
|
4
4
|
import useCombinedRefs from '../hooks/useCombinedRefs';
|
|
5
5
|
const styles = {
|
|
6
6
|
label: {
|
|
@@ -36,20 +36,34 @@ const styles = {
|
|
|
36
36
|
padding: 0,
|
|
37
37
|
},
|
|
38
38
|
};
|
|
39
|
+
function check(value, type) {
|
|
40
|
+
if (type === 'number') {
|
|
41
|
+
const pattern = /^(?:-?\d*|\d+)(?:\.\d{0,20})?$/;
|
|
42
|
+
if (value.trim() === '' || pattern.test(value)) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
39
49
|
function identity(value) {
|
|
40
50
|
return value;
|
|
41
51
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
52
|
+
function preventPropagate(event) {
|
|
53
|
+
event.stopPropagation();
|
|
54
|
+
}
|
|
55
|
+
const Input = forwardRef((props, ref) => {
|
|
56
|
+
const { value = '', name, style = {
|
|
57
|
+
input: {},
|
|
58
|
+
inputWrapper: {},
|
|
59
|
+
}, onChange = () => null, debounceTime = 0, onKeyDown = () => null, onKeyUp = () => null, checkValue = () => true, type = 'text', enableAutoSelect = false, className, format = () => identity, onBlur = () => null, onFocus = () => null, renderIcon = null, canClear = false, nullable = false, onClear, datalist = [], ...otherProps } = props;
|
|
46
60
|
const [val, setVal] = useState(value);
|
|
47
61
|
const valueRef = useRef(value);
|
|
48
62
|
const localRef = useRef();
|
|
49
63
|
const combinedRef = useCombinedRefs([ref, localRef]);
|
|
50
|
-
const debounceOnChange =
|
|
51
|
-
onChange(
|
|
52
|
-
}, debounceTime))
|
|
64
|
+
const debounceOnChange = useMemo(() => debounce((val) => {
|
|
65
|
+
onChange?.(val);
|
|
66
|
+
}, debounceTime), [debounceTime, onChange]);
|
|
53
67
|
useEffect(() => {
|
|
54
68
|
setVal(value);
|
|
55
69
|
}, [value]);
|
|
@@ -58,9 +72,8 @@ const Input = forwardRef(({ value = '', name, style = {
|
|
|
58
72
|
combinedRef?.current?.select();
|
|
59
73
|
}
|
|
60
74
|
}, [enableAutoSelect, combinedRef]);
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
return formatValue(type === 'number'
|
|
75
|
+
function getValue(value) {
|
|
76
|
+
const val = type === 'number'
|
|
64
77
|
? String(value).trim() === '-'
|
|
65
78
|
? Number(0)
|
|
66
79
|
: nullable && !value
|
|
@@ -68,24 +81,14 @@ const Input = forwardRef(({ value = '', name, style = {
|
|
|
68
81
|
: Number(value)
|
|
69
82
|
: nullable && !value
|
|
70
83
|
? null
|
|
71
|
-
: value
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
84
|
+
: value;
|
|
85
|
+
return format()(val);
|
|
86
|
+
}
|
|
87
|
+
function onChangeHandler(e) {
|
|
75
88
|
e.stopPropagation();
|
|
76
89
|
e.preventDefault();
|
|
77
|
-
function check(value) {
|
|
78
|
-
if (type === 'number') {
|
|
79
|
-
const pattern = /^(?:-?\d*|\d+)(?:\.\d{0,20})?$/;
|
|
80
|
-
if (value.trim() === '' || pattern.test(value)) {
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
90
|
const _value = e.target.value;
|
|
88
|
-
if (check(_value) && checkValue(_value)) {
|
|
91
|
+
if (check(_value, type) && checkValue(_value)) {
|
|
89
92
|
const formatValue = format();
|
|
90
93
|
setVal(formatValue(_value));
|
|
91
94
|
valueRef.current = _value;
|
|
@@ -97,19 +100,11 @@ const Input = forwardRef(({ value = '', name, style = {
|
|
|
97
100
|
debounceOnChange(val);
|
|
98
101
|
}
|
|
99
102
|
else {
|
|
100
|
-
onChange(val);
|
|
103
|
+
onChange?.(val);
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
debounceOnChange,
|
|
106
|
-
debounceTime,
|
|
107
|
-
format,
|
|
108
|
-
getValue,
|
|
109
|
-
onChange,
|
|
110
|
-
type,
|
|
111
|
-
]);
|
|
112
|
-
const handleKeyDown = useCallback((event) => {
|
|
106
|
+
}
|
|
107
|
+
function handleKeyDown(event) {
|
|
113
108
|
onKeyDown({
|
|
114
109
|
...event,
|
|
115
110
|
target: {
|
|
@@ -117,8 +112,8 @@ const Input = forwardRef(({ value = '', name, style = {
|
|
|
117
112
|
value: getValue(valueRef.current),
|
|
118
113
|
},
|
|
119
114
|
});
|
|
120
|
-
}
|
|
121
|
-
|
|
115
|
+
}
|
|
116
|
+
function handleKeyUp(event) {
|
|
122
117
|
onKeyUp({
|
|
123
118
|
...event,
|
|
124
119
|
target: {
|
|
@@ -126,18 +121,15 @@ const Input = forwardRef(({ value = '', name, style = {
|
|
|
126
121
|
value: getValue(valueRef.current),
|
|
127
122
|
},
|
|
128
123
|
});
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
event.stopPropagation();
|
|
132
|
-
}, []);
|
|
133
|
-
const clearHandler = useCallback(() => {
|
|
124
|
+
}
|
|
125
|
+
function clearHandler() {
|
|
134
126
|
setVal('');
|
|
135
127
|
onClear?.();
|
|
136
|
-
}
|
|
128
|
+
}
|
|
137
129
|
return (_jsxs("div", { style: {
|
|
138
130
|
...styles.inputWrapper,
|
|
139
131
|
...style?.inputWrapper,
|
|
140
|
-
}, className: `input ${className || ''}`, children: [renderIcon?.(), _jsx("input", { ...
|
|
132
|
+
}, className: `input ${className || ''}`, children: [renderIcon?.(), _jsx("input", { ...otherProps, ref: combinedRef, name: name, style: {
|
|
141
133
|
...styles.input,
|
|
142
134
|
...style?.input,
|
|
143
135
|
}, type: "text", value: val, onChange: onChangeHandler, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onKeyPress: preventPropagate, onDoubleClick: (e) => e.stopPropagation(), onFocus: onFocus, onBlur: onBlur, list: `${name || ''}-data-list` }), canClear && val && (_jsx("button", { type: "button", style: styles.clearButton, onClick: clearHandler, children: _jsx("span", { style: { display: 'block', margin: '0 auto' }, children: "\u2715" }) })), _jsx("datalist", { id: `${name || ''}-data-list`, children: datalist.map((value) => (_jsx("option", { value: value }, value))) })] }));
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
export interface NumberInputProps {
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'style'> {
|
|
3
3
|
pattern?: string;
|
|
4
|
-
label?: string;
|
|
5
4
|
name?: string;
|
|
6
5
|
step?: any;
|
|
7
6
|
min?: any;
|
|
8
7
|
max?: any;
|
|
9
|
-
|
|
10
|
-
style?:
|
|
11
|
-
container?: any;
|
|
12
|
-
label?: any;
|
|
13
|
-
inputContainer?: any;
|
|
14
|
-
input?: any;
|
|
15
|
-
};
|
|
16
|
-
onChange?: (element: any) => void;
|
|
17
|
-
onInput?: () => void;
|
|
8
|
+
value?: number;
|
|
9
|
+
style?: CSSProperties;
|
|
18
10
|
}
|
|
19
11
|
declare const NumberInput: import("react").ForwardRefExoticComponent<NumberInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
20
12
|
export default NumberInput;
|
|
@@ -1,43 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { forwardRef
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
userSelect: 'none',
|
|
10
|
-
flex: '2',
|
|
11
|
-
},
|
|
12
|
-
inputContainer: {
|
|
13
|
-
flex: '4',
|
|
14
|
-
display: 'flex',
|
|
15
|
-
justifyContent: 'flex-start',
|
|
16
|
-
},
|
|
17
|
-
input: {
|
|
18
|
-
height: '100%',
|
|
19
|
-
width: '100px',
|
|
20
|
-
borderRadius: '5px',
|
|
21
|
-
border: '0.55px solid #c7c7c7',
|
|
22
|
-
margin: '0px 5px 0px 5px',
|
|
23
|
-
textAlign: 'center',
|
|
24
|
-
},
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
const inputStyle = {
|
|
4
|
+
height: '100%',
|
|
5
|
+
width: '100px',
|
|
6
|
+
borderRadius: '5px',
|
|
7
|
+
border: '0.55px solid #c7c7c7',
|
|
8
|
+
textAlign: 'center',
|
|
25
9
|
};
|
|
26
|
-
const NumberInput = forwardRef(({
|
|
27
|
-
|
|
28
|
-
const changeHander = useCallback((e) => {
|
|
29
|
-
if (e.target.checkValidity()) {
|
|
30
|
-
const value = Number(e.target.value === '' ? defaultValue : e.target.value);
|
|
31
|
-
onChange({
|
|
32
|
-
...e,
|
|
33
|
-
target: { ...e.target, name: e.target.name, value },
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
const _ref = ref || localRef;
|
|
38
|
-
_ref.current.value = Number(defaultValue);
|
|
39
|
-
}
|
|
40
|
-
}, [defaultValue, onChange, ref]);
|
|
41
|
-
return (_jsxs("div", { style: { ...styles.container, ...style.container }, children: [_jsx("span", { style: { ...styles.label, ...style.label }, children: label }), _jsx("div", { style: { ...styles.inputContainer, ...style.inputContainer }, children: _jsx("input", { ref: ref || localRef, name: name, style: { ...styles.input, ...style.input }, type: "number", pattern: pattern, defaultValue: defaultValue, step: step, onChange: changeHander, onInput: onInput, min: min, max: max }, defaultValue) })] }));
|
|
10
|
+
const NumberInput = forwardRef(({ name, value: valueProp, style = {}, onChange, pattern = '^\\d*.\\d*$', step = 'any', min = 'any', max = 'any', }, ref) => {
|
|
11
|
+
return (_jsx("input", { ref: ref, name: name, style: { ...inputStyle, ...style }, type: "number", pattern: pattern, value: valueProp, step: step, onChange: onChange, min: min, max: max }));
|
|
42
12
|
});
|
|
43
13
|
export default NumberInput;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import { MouseEvent } from 'react';
|
|
3
2
|
import { HighlightEventSource } from '../../../highlight/index';
|
|
4
|
-
import { BaseRowStyle } from '../ReactTable';
|
|
3
|
+
import { BaseRowStyle, ContextMenuProps } from '../ReactTable';
|
|
5
4
|
export interface ClickEvent {
|
|
6
5
|
onClick?: (event: Event, data: unknown) => void;
|
|
7
6
|
}
|
|
8
|
-
interface ReactTableRowProps extends ClickEvent {
|
|
7
|
+
interface ReactTableRowProps extends ClickEvent, ContextMenuProps {
|
|
9
8
|
row: any;
|
|
10
9
|
highlightedSource?: HighlightEventSource;
|
|
11
|
-
onContextMenu: (e: MouseEvent<HTMLTableRowElement>) => void;
|
|
12
10
|
isRowActive: boolean;
|
|
13
11
|
rowStyle: BaseRowStyle | undefined;
|
|
14
12
|
disableDefaultRowStyle?: boolean;
|