nmrium 0.38.1 → 0.38.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/ApodizationLine.js +27 -4
- package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib/component/1d/FooterBanner.js +5 -5
- package/lib/component/1d/SpectraLegends.js +2 -3
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/integral/Integral.d.ts +1 -1
- package/lib/component/1d/integral/IntegralResizable.d.ts +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -1
- 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 +2 -1
- package/lib/component/1d/ranges/Range.d.ts +1 -1
- package/lib/component/1d/tool/PeakPointer.js +6 -6
- package/lib/component/1d/tool/XLabelPointer.js +5 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
- package/lib/component/1d-2d/tools/BrushX.js +2 -3
- package/lib/component/1d-2d/tools/BrushXY.js +2 -3
- package/lib/component/1d-2d/tools/CrossLinePointer.js +4 -5
- package/lib/component/2d/Chart2D.js +4 -4
- package/lib/component/2d/FooterBanner.js +5 -5
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +5 -5
- package/lib/component/2d/zones/Signal.d.ts +1 -1
- package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts +20 -12
- package/lib/component/EventsTrackers/BrushTracker.js +35 -22
- package/lib/component/EventsTrackers/MouseTracker.d.ts +6 -2
- package/lib/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib/component/NMRium.d.ts +4 -5
- package/lib/component/NMRium.js +11 -14
- package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
- package/lib/component/context/PreferencesContext.d.ts +6 -6
- package/lib/component/elements/Button.d.ts +13 -11
- package/lib/component/elements/Button.js +16 -25
- package/lib/component/elements/ColorInput.d.ts +0 -1
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/EditableColumn.js +5 -2
- package/lib/component/elements/Input.js +2 -4
- package/lib/component/elements/Label.d.ts +1 -0
- package/lib/component/elements/Label.js +2 -2
- package/lib/component/elements/MolecularFormulaInput.d.ts +2 -2
- package/lib/component/elements/MolecularFormulaInput.js +15 -18
- package/lib/component/elements/NextPrev.d.ts +5 -3
- package/lib/component/elements/NextPrev.js +26 -8
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
- package/lib/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +4 -0
- package/lib/component/elements/formik/FormikColumnFormatField.js +19 -16
- package/lib/component/elements/formik/FormikInput.js +10 -6
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/header/ApodizationOptionsPanel.js +4 -3
- package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -7
- package/lib/component/header/BaseLineCorrectionPanel.js +5 -2
- package/lib/component/header/PhaseCorrectionPanel.js +5 -2
- package/lib/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectra.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrum.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts +1 -1
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +2 -0
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.js +17 -0
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -2
- package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +3 -2
- package/lib/component/hooks/useExport.js +1 -1
- package/lib/component/hooks/useFilter.d.ts +2 -1
- package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
- package/lib/component/hooks/usePanelPreferences.js +4 -0
- package/lib/component/hooks/useSaveSettings.d.ts +1 -1
- package/lib/component/hooks/useSaveSettings.js +1 -1
- package/lib/component/hooks/useVerticalAlign.d.ts +1 -1
- package/lib/component/loader/DropZone.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
- package/lib/component/modal/LoadJCAMPModal.d.ts +3 -3
- package/lib/component/modal/LoadJCAMPModal.js +35 -66
- package/lib/component/modal/ModalStyle.js +0 -10
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +2 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
- package/lib/component/modal/PredictSpectraModal.d.ts +4 -2
- package/lib/component/modal/PredictSpectraModal.js +43 -105
- package/lib/component/modal/SaveAsModal.d.ts +2 -0
- package/lib/component/modal/SaveAsModal.js +21 -14
- package/lib/component/modal/changeSum/ChangeSumModal.js +25 -38
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -2
- package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib/component/modal/setting/GeneralSettings.js +1 -6
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -15
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +1 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +20 -25
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +6 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +71 -81
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +39 -53
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +7 -22
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
- 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/SpectraTable.js +5 -1
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -24
- package/lib/component/panels/databasePanel/DatabasePreferences.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +2 -3
- package/lib/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib/component/panels/header/PanelHeader.d.ts +7 -0
- package/lib/component/panels/header/PanelHeader.js +12 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +9 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +94 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +107 -37
- package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +3 -0
- package/lib/component/panels/predictionPanel/PredictionPreferences.js +24 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.d.ts +2 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +44 -0
- package/lib/component/reducer/Reducer.d.ts +5 -87
- package/lib/component/reducer/Reducer.js +1 -29
- package/lib/component/reducer/actions/FiltersActions.d.ts +1 -2
- package/lib/component/reducer/actions/FiltersActions.js +47 -52
- package/lib/component/reducer/actions/HistoryActions.d.ts +4 -0
- package/lib/component/reducer/actions/HistoryActions.js +40 -0
- package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
- package/lib/component/reducer/actions/LoadActions.d.ts +1 -2
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +7 -4
- package/lib/component/reducer/actions/MoleculeActions.js +57 -28
- package/lib/component/reducer/actions/PeaksActions.d.ts +1 -2
- package/lib/component/reducer/actions/PeaksActions.js +3 -3
- package/lib/component/reducer/actions/RangesActions.d.ts +4 -5
- package/lib/component/reducer/actions/RangesActions.js +5 -27
- package/lib/component/reducer/actions/SpectrumsActions.js +2 -2
- package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
- package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
- package/lib/component/reducer/actions/ZonesActions.js +1 -2
- package/lib/component/reducer/helper/getActiveSpectra.d.ts +1 -1
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +1 -1
- package/lib/component/reducer/helper/getVerticalAlign.d.ts +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getActiveWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +2 -3
- package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +1 -1
- package/lib/component/toolbar/BasicToolBar.js +6 -11
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/toolbar/ToolTypes.js +1 -1
- package/lib/component/workspaces/assignment.d.ts +1 -1
- package/lib/component/workspaces/basic.d.ts +1 -1
- package/lib/component/workspaces/embedded.d.ts +1 -1
- package/lib/component/workspaces/exercise.d.ts +1 -1
- package/lib/component/workspaces/index.d.ts +6 -6
- package/lib/component/workspaces/prediction.d.ts +1 -1
- package/lib/component/workspaces/prediction.js +193 -0
- package/lib/component/workspaces/process1D.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/PredictionManager.js +16 -2
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/constants/DefaultApodizationOptions.d.ts +2 -0
- package/lib/data/constants/DefaultApodizationOptions.js +5 -0
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +1 -5
- package/lib/data/data1d/Spectrum1D/index.js +1 -5
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -24
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +37 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +1 -1
- package/lib/data/data1d/database.js +2 -4
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +3 -30
- package/lib/data/data1d/multipleSpectraAnalysis.js +4 -15
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib/data/data2d/Spectrum2D/getSlice.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -1
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +3 -2
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/types/data1d/ComplexData1D.d.ts +2 -2
- package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
- package/lib/data/utilities/FindUtilities.d.ts +2 -1
- package/lib/data/utilities/RangeUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/calculateSanPlot.d.ts +2 -2
- package/lib/types/NMRiumDataReturn.d.ts +1 -3
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +28 -5
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +3 -26
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +5 -28
- package/lib-cjs/component/1d/FooterBanner.js +2 -2
- package/lib-cjs/component/1d/SpectraLegends.js +1 -2
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -3
- package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
- package/lib-cjs/component/1d-2d/tools/BrushX.js +1 -2
- package/lib-cjs/component/1d-2d/tools/BrushXY.js +1 -2
- package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +2 -3
- package/lib-cjs/component/2d/Chart2D.js +4 -4
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +36 -22
- package/lib-cjs/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib-cjs/component/NMRium.js +8 -11
- package/lib-cjs/component/elements/Button.js +16 -25
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +5 -2
- package/lib-cjs/component/elements/Input.js +2 -4
- package/lib-cjs/component/elements/Label.js +2 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +14 -16
- package/lib-cjs/component/elements/NextPrev.js +26 -8
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +20 -16
- package/lib-cjs/component/elements/formik/FormikInput.js +10 -6
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +6 -5
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +15 -6
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
- package/lib-cjs/component/header/PhaseCorrectionPanel.js +6 -26
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -25
- package/lib-cjs/component/hooks/useCheckPointsNumberInWindowArea.js +24 -0
- package/lib-cjs/component/hooks/useExport.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +4 -0
- package/lib-cjs/component/hooks/useSaveSettings.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +60 -67
- package/lib-cjs/component/modal/ModalStyle.js +0 -10
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib-cjs/component/modal/PredictSpectraModal.js +43 -126
- package/lib-cjs/component/modal/SaveAsModal.js +22 -14
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +24 -37
- package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -6
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +6 -14
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +19 -24
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +76 -86
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +38 -52
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -24
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +25 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib-cjs/component/panels/header/PanelHeader.js +15 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +122 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +107 -37
- package/lib-cjs/component/panels/predictionPanel/PredictionPreferences.js +29 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +72 -0
- package/lib-cjs/component/reducer/Reducer.js +2 -31
- package/lib-cjs/component/reducer/actions/FiltersActions.js +66 -94
- package/lib-cjs/component/reducer/actions/HistoryActions.js +45 -0
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +58 -32
- package/lib-cjs/component/reducer/actions/PeaksActions.js +3 -3
- package/lib-cjs/component/reducer/actions/RangesActions.js +7 -52
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +4 -27
- package/lib-cjs/component/reducer/actions/ZonesActions.js +4 -28
- package/lib-cjs/component/toolbar/BasicToolBar.js +5 -10
- package/lib-cjs/component/toolbar/ToolTypes.js +9 -32
- package/lib-cjs/component/workspaces/prediction.js +193 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +21 -44
- package/lib-cjs/data/PredictionManager.js +16 -2
- package/lib-cjs/data/constants/DefaultApodizationOptions.js +8 -0
- package/lib-cjs/data/data1d/Spectrum1D/index.js +7 -11
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -32
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +7 -26
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +3 -4
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib-cjs/data/data1d/database.js +2 -4
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +5 -16
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -26
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +2 -25
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +25 -25
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +0 -7
- package/lib/component/panels/predictionPanel/PredictionOptions.js +0 -74
- package/lib/component/workspaces/Workspace.d.ts +0 -188
- package/lib/component/workspaces/Workspace.js +0 -1
- package/lib/data/Filters.d.ts +0 -12
- package/lib/data/Filters.js +0 -12
- package/lib/data/FiltersManager.d.ts +0 -30
- package/lib/data/FiltersManager.js +0 -175
- package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.js +0 -6
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -4
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +0 -7
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -9
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +0 -12
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -36
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -6
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -26
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +0 -3
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -45
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -7
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +0 -4
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -78
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -9
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -5
- package/lib/data/data1d/filter1d/apodization.d.ts +0 -27
- package/lib/data/data1d/filter1d/apodization.js +0 -81
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +0 -33
- package/lib/data/data1d/filter1d/baselineCorrection.js +0 -51
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +0 -20
- package/lib/data/data1d/filter1d/digitalFilter.js +0 -44
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +0 -33
- package/lib/data/data1d/filter1d/equallySpaced.js +0 -52
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +0 -15
- package/lib/data/data1d/filter1d/exclusionZones.js +0 -32
- package/lib/data/data1d/filter1d/fft.d.ts +0 -18
- package/lib/data/data1d/filter1d/fft.js +0 -90
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +0 -26
- package/lib/data/data1d/filter1d/phaseCorrection.js +0 -64
- package/lib/data/data1d/filter1d/shiftX.d.ts +0 -20
- package/lib/data/data1d/filter1d/shiftX.js +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.d.ts +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.js +0 -65
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +0 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -35
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +0 -22
- package/lib/data/data1d/filter1d/zeroFilling.js +0 -60
- package/lib/data/data2d/filter2d/shiftX.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftX.js +0 -27
- package/lib/data/data2d/filter2d/shiftY.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftY.js +0 -27
- package/lib/data/types/view-state/PeaksViewState.d.ts +0 -17
- package/lib/data/types/view-state/PeaksViewState.js +0 -1
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -7
- package/lib/types/NMRiumGeneralPreferences.js +0 -1
- package/lib/types/NMRiumPanelPreferences.d.ts +0 -17
- package/lib/types/NMRiumPanelPreferences.js +0 -1
- package/lib/types/NMRiumToolBarPreferences.d.ts +0 -22
- package/lib/types/NMRiumToolBarPreferences.js +0 -1
- package/lib/types/PanelPreferencesType.d.ts +0 -4
- package/lib/types/PanelPreferencesType.js +0 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +0 -102
- package/lib-cjs/component/workspaces/Workspace.js +0 -2
- package/lib-cjs/data/Filters.js +0 -38
- package/lib-cjs/data/FiltersManager.js +0 -206
- package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +0 -33
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -8
- package/lib-cjs/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -40
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -10
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -30
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -49
- package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -11
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -82
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/filter1d/apodization.js +0 -88
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +0 -60
- package/lib-cjs/data/data1d/filter1d/digitalFilter.js +0 -50
- package/lib-cjs/data/data1d/filter1d/equallySpaced.js +0 -61
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +0 -38
- package/lib-cjs/data/data1d/filter1d/fft.js +0 -96
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +0 -70
- package/lib-cjs/data/data1d/filter1d/shiftX.js +0 -32
- package/lib-cjs/data/data1d/filter1d/signalProcessing.js +0 -95
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -39
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +0 -66
- package/lib-cjs/data/data2d/filter2d/shiftX.js +0 -33
- package/lib-cjs/data/data2d/filter2d/shiftY.js +0 -33
- package/lib-cjs/data/types/view-state/PeaksViewState.js +0 -2
- package/lib-cjs/types/NMRiumGeneralPreferences.js +0 -2
- package/lib-cjs/types/NMRiumPanelPreferences.js +0 -2
- package/lib-cjs/types/NMRiumToolBarPreferences.js +0 -2
- package/lib-cjs/types/PanelPreferencesType.js +0 -2
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { WebSource } from 'filelist-utils';
|
|
2
3
|
import { CorrelationData } from 'nmr-correlation';
|
|
3
|
-
import {
|
|
4
|
+
import { NmriumState, CustomWorkspaces, WorkspacePreferences as NMRiumPreferences, Spectrum } from 'nmr-load-save';
|
|
4
5
|
import { ReactElement, ReactNode } from 'react';
|
|
5
6
|
import { ErrorBoundaryPropsWithComponent } from 'react-error-boundary';
|
|
6
7
|
import { BlobObject } from './utility/export';
|
|
7
|
-
import { CustomWorkspaces, WorkspacePreferences as NMRiumPreferences } from './workspaces/Workspace';
|
|
8
8
|
export { serializeNmriumState } from 'nmr-load-save';
|
|
9
|
-
export type { NmriumState } from 'nmr-load-save';
|
|
10
|
-
export type { WorkspacePreferences as NMRiumPreferences } from './workspaces/Workspace';
|
|
9
|
+
export type { NmriumState, WorkspacePreferences as NMRiumPreferences, } from 'nmr-load-save';
|
|
11
10
|
export type NMRiumWorkspace = 'exercise' | 'process1D' | 'default' | 'prediction' | 'embedded' | 'assignment' | (string & {});
|
|
12
11
|
export type OnNMRiumChange = (state: NmriumState, source: 'data' | 'view' | 'settings') => void;
|
|
13
12
|
export interface NMRiumProps {
|
|
@@ -30,7 +29,7 @@ type DeepPartial<T> = {
|
|
|
30
29
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
31
30
|
};
|
|
32
31
|
export interface NMRiumData {
|
|
33
|
-
source?:
|
|
32
|
+
source?: WebSource;
|
|
34
33
|
molecules?: Molecules;
|
|
35
34
|
spectra: DeepPartial<Spectrum>[];
|
|
36
35
|
correlations?: CorrelationData;
|
package/lib/component/NMRium.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { readNMRiumObject } from 'nmr-load-save';
|
|
5
|
-
import { useEffect, useCallback, useReducer,
|
|
4
|
+
import { readNMRiumObject, } from 'nmr-load-save';
|
|
5
|
+
import { useEffect, useCallback, useReducer, useRef, memo, forwardRef, useImperativeHandle, } from 'react';
|
|
6
6
|
import { ErrorBoundary, } from 'react-error-boundary';
|
|
7
7
|
import { RootLayout, useOnOff } from 'react-science/ui';
|
|
8
8
|
import { useFullscreen } from 'react-use';
|
|
@@ -28,7 +28,7 @@ import DropZone from './loader/DropZone';
|
|
|
28
28
|
import { defaultGetSpinner, SpinnerProvider } from './loader/SpinnerContext';
|
|
29
29
|
import Panels from './panels/Panels';
|
|
30
30
|
import checkActionType from './reducer/IgnoreActions';
|
|
31
|
-
import { spectrumReducer, initialState,
|
|
31
|
+
import { spectrumReducer, initialState, initState } from './reducer/Reducer';
|
|
32
32
|
import { DISPLAYER_MODE } from './reducer/core/Constants';
|
|
33
33
|
import preferencesReducer, { preferencesInitialState, initPreferencesState, } from './reducer/preferences/preferencesReducer';
|
|
34
34
|
import ToolBar from './toolbar/ToolBar';
|
|
@@ -87,6 +87,7 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
|
|
|
87
87
|
const elementsWrapperRef = useRef(null);
|
|
88
88
|
const viewerRef = useRef(null);
|
|
89
89
|
const [show, , setOff, toggle] = useOnOff(false);
|
|
90
|
+
const mainDivRef = useRef(null);
|
|
90
91
|
const handleChange = useRef(onChange);
|
|
91
92
|
useEffect(() => {
|
|
92
93
|
handleChange.current = onChange;
|
|
@@ -124,9 +125,6 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
|
|
|
124
125
|
// trigger onChange callback if settings changed
|
|
125
126
|
handleChange.current?.(stateRef.current, 'settings');
|
|
126
127
|
}, [preferencesState]);
|
|
127
|
-
const dispatchMiddleWare = useMemo(() => {
|
|
128
|
-
return dispatchMiddleware(dispatch);
|
|
129
|
-
}, []);
|
|
130
128
|
useEffect(() => {
|
|
131
129
|
rootRef.current?.focus();
|
|
132
130
|
}, [isFullscreen]);
|
|
@@ -147,14 +145,14 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
|
|
|
147
145
|
},
|
|
148
146
|
}), []);
|
|
149
147
|
useEffect(() => {
|
|
150
|
-
|
|
148
|
+
dispatch({
|
|
151
149
|
type: 'SET_LOADING_FLAG',
|
|
152
150
|
payload: { isLoading: true },
|
|
153
151
|
});
|
|
154
152
|
if (dataProp) {
|
|
155
153
|
void readNMRiumObject(dataProp)
|
|
156
154
|
.then((nmriumState) => {
|
|
157
|
-
|
|
155
|
+
dispatch({ type: 'INITIATE', payload: { nmriumState } });
|
|
158
156
|
})
|
|
159
157
|
.catch((error) => {
|
|
160
158
|
dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
|
|
@@ -163,26 +161,25 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
|
|
|
163
161
|
reportError(error);
|
|
164
162
|
});
|
|
165
163
|
}
|
|
166
|
-
}, [dataProp
|
|
164
|
+
}, [dataProp]);
|
|
167
165
|
const preventContextMenuHandler = useCallback((e) => {
|
|
168
166
|
if (!checkModifierKeyActivated(e)) {
|
|
169
167
|
e.preventDefault();
|
|
170
168
|
}
|
|
171
169
|
}, []);
|
|
172
|
-
const mainDivRef = useRef(null);
|
|
173
170
|
useEffect(() => {
|
|
174
171
|
const div = mainDivRef.current;
|
|
175
172
|
if (!div) {
|
|
176
173
|
return;
|
|
177
174
|
}
|
|
178
175
|
function mouseEnterHandler() {
|
|
179
|
-
|
|
176
|
+
dispatch({
|
|
180
177
|
type: 'SET_MOUSE_OVER_DISPLAYER',
|
|
181
178
|
payload: { isMouseOverDisplayer: true },
|
|
182
179
|
});
|
|
183
180
|
}
|
|
184
181
|
function mouseLeaveHandler() {
|
|
185
|
-
|
|
182
|
+
dispatch({
|
|
186
183
|
type: 'SET_MOUSE_OVER_DISPLAYER',
|
|
187
184
|
payload: { isMouseOverDisplayer: false },
|
|
188
185
|
});
|
|
@@ -193,12 +190,12 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
|
|
|
193
190
|
div.removeEventListener('mouseenter', mouseEnterHandler);
|
|
194
191
|
div.removeEventListener('mouseleave', mouseLeaveHandler);
|
|
195
192
|
};
|
|
196
|
-
}, [
|
|
193
|
+
}, []);
|
|
197
194
|
return (_jsx(GlobalProvider, { value: {
|
|
198
195
|
rootRef: rootRef.current,
|
|
199
196
|
elementsWrapperRef: elementsWrapperRef.current,
|
|
200
197
|
viewerRef: viewerRef.current,
|
|
201
|
-
}, children: _jsx(PreferencesProvider, { value: preferencesState, children: _jsx("div", { ref: mainDivRef, style: { height: '100%', position: 'relative' }, children: _jsx(LoggerProvider, { children: _jsx(AlertProvider, { wrapperRef: elementsWrapperRef.current, children: _jsx(DispatchProvider, { value:
|
|
198
|
+
}, children: _jsx(PreferencesProvider, { value: preferencesState, children: _jsx("div", { ref: mainDivRef, style: { height: '100%', position: 'relative' }, children: _jsx(LoggerProvider, { children: _jsx(AlertProvider, { wrapperRef: elementsWrapperRef.current, children: _jsx(DispatchProvider, { value: dispatch, children: _jsx(ChartDataProvider, { value: state, children: _jsx(ModalProvider, { wrapperRef: elementsWrapperRef.current, children: _jsx(HighlightProvider, { children: _jsx(AssignmentProvider, { spectraData: spectraData, children: _jsx(SpinnerProvider, { value: getSpinner, children: _jsx("div", { className: "nmrium-container", ref: rootRef, css: containerStyles, onContextMenu: preventContextMenuHandler, style: { height: '100%', width: '100%' }, children: _jsx(DropZone, { children: _jsxs("div", { style: {
|
|
202
199
|
display: 'flex',
|
|
203
200
|
flexDirection: 'column',
|
|
204
201
|
backgroundColor: 'white',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NmrData1D, NmrData2D } from 'cheminfo-types';
|
|
2
2
|
import { ActionType } from '../reducer/types/ActionType';
|
|
3
3
|
import { AssignmentDimension, AssignmentState, Axis } from './AssignmentsContext';
|
|
4
4
|
export type InitiateAction = ActionType<'INITIATE_ASSIGNMENTS', {
|
|
5
|
-
spectra: (
|
|
5
|
+
spectra: (NmrData1D | NmrData2D)[];
|
|
6
6
|
}>;
|
|
7
7
|
export type ToggleAction = ActionType<'TOGGLE', {
|
|
8
8
|
atomIDs: string[];
|
|
@@ -16,7 +16,7 @@ export declare function usePreferences(): {
|
|
|
16
16
|
type: "ADD_WORKSPACE";
|
|
17
17
|
payload: {
|
|
18
18
|
workspace: string;
|
|
19
|
-
data?: Omit<import("
|
|
19
|
+
data?: Omit<import("nmr-load-save").Workspace, "label" | "version"> | undefined;
|
|
20
20
|
};
|
|
21
21
|
} | {
|
|
22
22
|
type: "ANALYZE_SPECTRA";
|
|
@@ -43,12 +43,12 @@ export declare function usePreferences(): {
|
|
|
43
43
|
type: "SET_SPECTRA_ANALYSIS_PREFERENCES";
|
|
44
44
|
payload: {
|
|
45
45
|
nucleus: string;
|
|
46
|
-
data: import("
|
|
46
|
+
data: import("nmr-load-save").MultipleSpectraAnalysisPreferences;
|
|
47
47
|
};
|
|
48
48
|
} | {
|
|
49
49
|
type: "APPLY_General_PREFERENCES";
|
|
50
50
|
payload: {
|
|
51
|
-
data: Omit<import("
|
|
51
|
+
data: Omit<import("nmr-load-save").Workspace, "label" | "version">;
|
|
52
52
|
};
|
|
53
53
|
} | {
|
|
54
54
|
type: "ADD_MATRIX_GENERATION_EXCLUSION_ZONE";
|
|
@@ -76,14 +76,14 @@ export declare function usePreferences(): {
|
|
|
76
76
|
} | import("../reducer/preferences/preferencesReducer").SetWorkspaceAction | {
|
|
77
77
|
type: "INIT_PREFERENCES";
|
|
78
78
|
payload: {
|
|
79
|
-
display: import("
|
|
79
|
+
display: import("nmr-load-save").WorkspacePreferences;
|
|
80
80
|
workspace: import("../NMRium").NMRiumWorkspace;
|
|
81
|
-
customWorkspaces: Record<string, import("
|
|
81
|
+
customWorkspaces: Record<string, import("nmr-load-save").Workspace>;
|
|
82
82
|
dispatch: any;
|
|
83
83
|
};
|
|
84
84
|
} | {
|
|
85
85
|
type: "SET_PREFERENCES";
|
|
86
|
-
payload: Partial<import("
|
|
86
|
+
payload: Partial<import("nmr-load-save").Workspace>;
|
|
87
87
|
} | {
|
|
88
88
|
type: "SET_PANELS_PREFERENCES";
|
|
89
89
|
payload: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import { CSSObject } from '@emotion/react';
|
|
3
|
-
import {
|
|
3
|
+
import { CSSProperties, ComponentPropsWithoutRef, ElementType } from 'react';
|
|
4
4
|
type Size = 'xSmall' | 'small' | 'medium' | 'large';
|
|
5
5
|
type Color = CSSProperties['color'];
|
|
6
6
|
interface BaseColor {
|
|
@@ -21,21 +21,23 @@ interface ButtonStyle {
|
|
|
21
21
|
wrapperStyle?: CSSProperties;
|
|
22
22
|
}
|
|
23
23
|
type TooltipOrientation = 'vertical' | 'horizontal';
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
children: ReactNode;
|
|
24
|
+
type ElementProps<E = unknown> = E extends ElementType ? ComponentPropsWithoutRef<E> : never;
|
|
25
|
+
export interface InnerButtonProps<E extends ElementType = 'button'> extends Partial<ButtonStyle> {
|
|
27
26
|
toolTip?: string;
|
|
28
27
|
tooltipOrientation?: TooltipOrientation;
|
|
29
28
|
wrapperClassName?: string;
|
|
30
29
|
theme?: ColorTheme;
|
|
30
|
+
as?: E;
|
|
31
|
+
disabled?: boolean;
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
export type ButtonProps<E extends ElementType = 'button'> = InnerButtonProps<E> & Omit<ElementProps<E>, 'color' | 'style' | 'disabled' | 'fill'>;
|
|
34
|
+
declare function Button<E extends ElementType = 'button'>(props: ButtonProps<E>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
33
35
|
declare namespace Button {
|
|
34
|
-
var Done: (props: ButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
35
|
-
var Danger: (props: ButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
36
|
-
var Action: (props: ButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
37
|
-
var Secondary: (props: ButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
38
|
-
var Info: (props: Omit<ButtonProps
|
|
39
|
-
var BarButton: (props: ButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
36
|
+
var Done: <E extends ElementType = "button">(props: ButtonProps<E>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
37
|
+
var Danger: <E extends ElementType = "button">(props: ButtonProps<E>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
38
|
+
var Action: <E extends ElementType = "button">(props: ButtonProps<E>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
39
|
+
var Secondary: <E extends ElementType = "button">(props: ButtonProps<E>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
40
|
+
var Info: <E extends ElementType = "button">(props: Omit<ButtonProps<E>, "children">) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
41
|
+
var BarButton: <E extends ElementType = "button">(props: ButtonProps<E>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
40
42
|
}
|
|
41
43
|
export default Button;
|
|
@@ -91,7 +91,7 @@ function getFillStyle(props) {
|
|
|
91
91
|
}
|
|
92
92
|
const styles = {
|
|
93
93
|
button: (props) => {
|
|
94
|
-
const { size, backgroundColor: { hover, active }, color, borderRadius, } = props;
|
|
94
|
+
const { size, backgroundColor: { hover, active }, color, borderRadius, element, } = props;
|
|
95
95
|
const basic = css `
|
|
96
96
|
display: flex;
|
|
97
97
|
flex-direction: row;
|
|
@@ -103,17 +103,18 @@ const styles = {
|
|
|
103
103
|
}
|
|
104
104
|
`;
|
|
105
105
|
const fillStyle = getFillStyle(props);
|
|
106
|
-
const
|
|
107
|
-
&:disabled
|
|
106
|
+
const basicDisabledStyle = css `
|
|
107
|
+
&:disabled,
|
|
108
|
+
&.disabled {
|
|
108
109
|
opacity: 0.25;
|
|
109
110
|
}
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
`;
|
|
112
|
+
const colorStyle = css `
|
|
113
|
+
&:not(${element === 'button' ? '[disabled]' : '.disabled'}):hover {
|
|
112
114
|
background-color: ${hover};
|
|
113
115
|
color: ${color.hover};
|
|
114
116
|
}
|
|
115
|
-
|
|
116
|
-
&:not([disabled]):active {
|
|
117
|
+
&:not(${element === 'button' ? '[disabled]' : '.disabled'}):active {
|
|
117
118
|
background-color: ${active || hover};
|
|
118
119
|
color: ${color?.active || color.hover};
|
|
119
120
|
}
|
|
@@ -122,6 +123,7 @@ const styles = {
|
|
|
122
123
|
basic,
|
|
123
124
|
sizeConfig[size],
|
|
124
125
|
fillStyle,
|
|
126
|
+
basicDisabledStyle,
|
|
125
127
|
colorStyle,
|
|
126
128
|
{ borderRadius },
|
|
127
129
|
]);
|
|
@@ -161,8 +163,11 @@ function Button(props) {
|
|
|
161
163
|
base,
|
|
162
164
|
hover: shade,
|
|
163
165
|
active: tint,
|
|
164
|
-
}, borderColor = 'transparent', fill = 'solid', borderRadius, style = {}, wrapperStyle = {}, toolTip, tooltipOrientation = 'vertical', wrapperClassName, ...restProps } = buttonProps;
|
|
165
|
-
|
|
166
|
+
}, borderColor = 'transparent', fill = 'solid', borderRadius, style = {}, wrapperStyle = {}, toolTip, tooltipOrientation = 'vertical', wrapperClassName = '', as: Wrapper = 'button', disabled = false, className = '', ...restProps } = buttonProps;
|
|
167
|
+
const isDivDisabled = Wrapper === 'div' && disabled;
|
|
168
|
+
return (_jsxs("div", { style: { position: 'relative', ...wrapperStyle }, className: wrapperClassName, children: [_jsx(Wrapper, { ...(Wrapper === 'button' && { type: 'button', disabled }), onClick: Wrapper === 'button' || (Wrapper === 'div' && !disabled)
|
|
169
|
+
? onClick
|
|
170
|
+
: (e) => e.stopPropagation(), css: [
|
|
166
171
|
styles.button({
|
|
167
172
|
size,
|
|
168
173
|
backgroundColor,
|
|
@@ -170,29 +175,15 @@ function Button(props) {
|
|
|
170
175
|
borderColor,
|
|
171
176
|
fill,
|
|
172
177
|
borderRadius,
|
|
178
|
+
element: Wrapper,
|
|
173
179
|
}),
|
|
174
180
|
style,
|
|
175
|
-
], ...restProps, children: _jsx("span", { style: { flex: 1, pointerEvents: 'none' }, children: props.children }) }), toolTip && (_jsx("div", { className: "content", css: toolTipStyle(tooltipOrientation), children: _jsx("span", { style: {
|
|
181
|
+
], className: `${className} ${isDivDisabled ? 'disabled' : ''}`, ...restProps, children: _jsx("span", { style: { flex: 1, pointerEvents: 'none' }, children: props.children }) }), toolTip && (_jsx("div", { className: "content", css: toolTipStyle(tooltipOrientation), children: _jsx("span", { style: {
|
|
176
182
|
display: 'flex',
|
|
177
183
|
margin: 'auto',
|
|
178
184
|
justifyContent: 'center',
|
|
179
185
|
}, children: toolTip }) }))] }));
|
|
180
186
|
}
|
|
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
|
-
// }
|
|
196
187
|
Button.Done = function ButtonDone(props) {
|
|
197
188
|
return _jsx(Button, { ...props, theme: "success" });
|
|
198
189
|
};
|
|
@@ -64,7 +64,7 @@ const style = css `
|
|
|
64
64
|
}
|
|
65
65
|
`;
|
|
66
66
|
function ColorInput(props) {
|
|
67
|
-
const {
|
|
67
|
+
const { onColorChange = () => null, name, value = '#000000' } = props;
|
|
68
68
|
const [displayColorPicker, showColorPicker] = useState(false);
|
|
69
69
|
const [selectedColor, setColor] = useState(value);
|
|
70
70
|
useEffect(() => {
|
|
@@ -81,6 +81,6 @@ function ColorInput(props) {
|
|
|
81
81
|
setColor(hex);
|
|
82
82
|
onColorChange({ ...colorEvent, hex, name });
|
|
83
83
|
}, [name, onColorChange]);
|
|
84
|
-
return (_jsxs("div", { css: style, children: [
|
|
84
|
+
return (_jsxs("div", { css: style, children: [_jsxs("div", { className: "swatch", onClick: handleClick, children: [_jsx("div", { className: "color", style: { backgroundColor: selectedColor } }), _jsx("input", { type: "hidden", value: selectedColor, name: name })] }), displayColorPicker ? (_jsxs("div", { className: "color-popover", children: [_jsx("div", { className: "cover", onClick: handleClose }), _jsx(ColorPicker, { color: { hex: selectedColor }, onChangeComplete: handleOnColorChanged })] })) : null] }));
|
|
85
85
|
}
|
|
86
86
|
export default memo(ColorInput);
|
|
@@ -52,14 +52,17 @@ const EditableColumn = forwardRef(function EditableColumn(props, ref) {
|
|
|
52
52
|
}, className: "editable-column-input", onDoubleClick: startEditHandler, children: [!enabled && (_jsx("span", { style: {
|
|
53
53
|
display: 'table-cell',
|
|
54
54
|
verticalAlign: 'middle',
|
|
55
|
-
width: '
|
|
55
|
+
width: '100%',
|
|
56
56
|
...(textOverFlowEllipses
|
|
57
57
|
? { textOverflow: 'ellipsis', overflow: 'hidden' }
|
|
58
58
|
: {}),
|
|
59
59
|
}, children: value })), enabled && (_jsx("div", { style: { display: 'table-cell', verticalAlign: 'middle' }, children: _jsx(Input, { style: {
|
|
60
60
|
inputWrapper: {
|
|
61
|
-
width: '100%',
|
|
62
61
|
...(!isValid && { borderColor: 'red' }),
|
|
62
|
+
width: '100%',
|
|
63
|
+
},
|
|
64
|
+
input: {
|
|
65
|
+
width: '100%',
|
|
63
66
|
},
|
|
64
67
|
}, enableAutoSelect: true, className: "editable-column", value: value, type: type, onKeyUp: editHandler, ...InputProps }) }))] }));
|
|
65
68
|
});
|
|
@@ -8,8 +8,6 @@ const styles = {
|
|
|
8
8
|
userSelect: 'none',
|
|
9
9
|
},
|
|
10
10
|
inputWrapper: {
|
|
11
|
-
height: '100%',
|
|
12
|
-
width: '100px',
|
|
13
11
|
borderRadius: '5px',
|
|
14
12
|
borderWidth: '0.55px',
|
|
15
13
|
borderColor: '#c7c7c7',
|
|
@@ -57,7 +55,7 @@ const Input = forwardRef((props, ref) => {
|
|
|
57
55
|
input: {},
|
|
58
56
|
inputWrapper: {},
|
|
59
57
|
}, 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;
|
|
60
|
-
const [val, setVal] = useState(value);
|
|
58
|
+
const [val, setVal] = useState(value ?? '');
|
|
61
59
|
const valueRef = useRef(value);
|
|
62
60
|
const localRef = useRef();
|
|
63
61
|
const combinedRef = useCombinedRefs([ref, localRef]);
|
|
@@ -65,7 +63,7 @@ const Input = forwardRef((props, ref) => {
|
|
|
65
63
|
onChange?.(val);
|
|
66
64
|
}, debounceTime), [debounceTime, onChange]);
|
|
67
65
|
useEffect(() => {
|
|
68
|
-
setVal(value);
|
|
66
|
+
setVal((prevVal) => (prevVal !== value ? value ?? '' : prevVal));
|
|
69
67
|
}, [value]);
|
|
70
68
|
useEffect(() => {
|
|
71
69
|
if (enableAutoSelect) {
|
|
@@ -3,12 +3,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import Button from './Button';
|
|
5
5
|
export default function Label(props) {
|
|
6
|
-
const { title, shortTitle, className = '', children, style, description, ...otherProps } = props;
|
|
6
|
+
const { title, shortTitle, className = '', children, style, description, renderTitle, ...otherProps } = props;
|
|
7
7
|
return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', ...style?.container }, children: [_jsxs("label", { className: className, style: {
|
|
8
8
|
fontSize: '12px',
|
|
9
9
|
color: '#232323',
|
|
10
10
|
paddingRight: '10px',
|
|
11
11
|
width: 'max-content',
|
|
12
12
|
...style?.label,
|
|
13
|
-
}, ...otherProps, children: [_jsx("span", { className: shortTitle ? 'large-label' : '', children: title }), shortTitle && (_jsx("span", { className: "small-label", css: css({ display: 'none' }), children: shortTitle })), description && (_jsx(Button.Info, { toolTip: description, tooltipOrientation: "horizontal", style: { display: 'inline-block' }, backgroundColor: { hover: 'white', base: 'white' }, color: { base: 'gray', hover: 'black' } }))] }), _jsx("div", { style: style?.wrapper, children: children })] }));
|
|
13
|
+
}, ...otherProps, children: [renderTitle ? (renderTitle(title)) : (_jsx("span", { className: shortTitle ? 'large-label' : '', children: title })), shortTitle && (_jsx("span", { className: "small-label", css: css({ display: 'none' }), children: shortTitle })), description && (_jsx(Button.Info, { toolTip: description, tooltipOrientation: "horizontal", style: { display: 'inline-block' }, backgroundColor: { hover: 'white', base: 'white' }, color: { base: 'gray', hover: 'black' } }))] }), _jsx("div", { style: style?.wrapper, children: children })] }));
|
|
14
14
|
}
|
|
@@ -2,5 +2,5 @@ interface MolecularFormulaInputProps {
|
|
|
2
2
|
onSave?: (element: string) => void;
|
|
3
3
|
previousMF: string;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
export
|
|
5
|
+
export default function MolecularFormulaInput({ onSave, previousMF, }: MolecularFormulaInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -29,27 +29,25 @@ const inputStyle = css `
|
|
|
29
29
|
background-color: gray;
|
|
30
30
|
}
|
|
31
31
|
`;
|
|
32
|
-
function
|
|
32
|
+
function isValidMf(mf) {
|
|
33
|
+
if (mf.trim().length === 0) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
getAtomsFromMF(mf);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export default function MolecularFormulaInput({ onSave = () => null, previousMF, }) {
|
|
33
45
|
const [mf, setMF] = useState('');
|
|
34
46
|
const [isValidMF, setIsValidMF] = useState(true);
|
|
35
47
|
const [hasChanged, setHasChanged] = useState(false);
|
|
36
|
-
const checkMF = useCallback((mf) => {
|
|
37
|
-
if (mf.trim().length === 0) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
getAtomsFromMF(mf);
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
// TODO: handle error.
|
|
46
|
-
reportError(error);
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
}, []);
|
|
50
48
|
const onChangeHandler = useCallback((e) => {
|
|
51
49
|
setHasChanged(true);
|
|
52
|
-
if (
|
|
50
|
+
if (isValidMf(e.target.value)) {
|
|
53
51
|
setIsValidMF(true);
|
|
54
52
|
setMF(e.target.value);
|
|
55
53
|
}
|
|
@@ -57,10 +55,9 @@ function MolecularFormulaInput({ onSave = () => null, previousMF, }) {
|
|
|
57
55
|
setIsValidMF(false);
|
|
58
56
|
setMF('');
|
|
59
57
|
}
|
|
60
|
-
}, [
|
|
58
|
+
}, []);
|
|
61
59
|
const onSaveHandler = useCallback(() => {
|
|
62
60
|
onSave(hasChanged ? mf.trim() : previousMF);
|
|
63
61
|
}, [hasChanged, mf, onSave, previousMF]);
|
|
64
62
|
return (_jsxs("div", { css: inputStyle, children: [_jsx("input", { type: "text", onChange: onChangeHandler, defaultValue: previousMF }), _jsx("button", { type: "button", onClick: onSaveHandler, disabled: !isValidMF, children: isValidMF ? 'Set' : 'Invalid' })] }));
|
|
65
63
|
}
|
|
66
|
-
export default MolecularFormulaInput;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
3
2
|
interface NextPrevProps {
|
|
4
3
|
children: ReactNode;
|
|
5
4
|
loop?: boolean;
|
|
6
5
|
defaultIndex?: number;
|
|
7
6
|
onChange?: (element: number) => void;
|
|
7
|
+
style?: {
|
|
8
|
+
arrowContainer?: CSSProperties;
|
|
9
|
+
};
|
|
8
10
|
}
|
|
9
|
-
declare function NextPrev(
|
|
11
|
+
declare function NextPrev(props: NextPrevProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
10
12
|
declare const _default: import("react").MemoExoticComponent<typeof NextPrev>;
|
|
11
13
|
export default _default;
|
|
@@ -4,12 +4,9 @@ import { css } from '@emotion/react';
|
|
|
4
4
|
import { useState, Children, useMemo, useEffect, useCallback, memo, } from 'react';
|
|
5
5
|
import { FaAngleLeft } from 'react-icons/fa';
|
|
6
6
|
import { useMeasure } from 'react-use';
|
|
7
|
-
function Arrow({ direction, onClick }) {
|
|
7
|
+
function Arrow({ direction, onClick, style = {} }) {
|
|
8
8
|
return (_jsx("div", { onClick: onClick, css: css `
|
|
9
|
-
display: flex;
|
|
10
|
-
position: absolute;
|
|
11
|
-
top: 50%;
|
|
12
|
-
${direction === 'right' ? `right: 25px` : `left: 25px`};
|
|
9
|
+
display: inline-flex;
|
|
13
10
|
height: 40px;
|
|
14
11
|
width: 40px;
|
|
15
12
|
justify-content: center;
|
|
@@ -20,6 +17,7 @@ function Arrow({ direction, onClick }) {
|
|
|
20
17
|
border: none;
|
|
21
18
|
transition: transform ease-in 0.1s;
|
|
22
19
|
background-color: #f7f7f7;
|
|
20
|
+
pointer-events: auto;
|
|
23
21
|
|
|
24
22
|
&:hover {
|
|
25
23
|
transform: scale(1.1);
|
|
@@ -34,10 +32,11 @@ function Arrow({ direction, onClick }) {
|
|
|
34
32
|
outline: 0;
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
|
-
`, children: _jsx(FaAngleLeft, { style: { transform: `scaleX(${direction === 'right' ? '-1' : '1'})` } }) }));
|
|
35
|
+
`, style: style, children: _jsx(FaAngleLeft, { style: { transform: `scaleX(${direction === 'right' ? '-1' : '1'})` } }) }));
|
|
38
36
|
}
|
|
39
37
|
const transition = 0.45;
|
|
40
|
-
function NextPrev(
|
|
38
|
+
function NextPrev(props) {
|
|
39
|
+
const { children, loop = false, defaultIndex = 0, onChange = () => null, style = {}, } = props;
|
|
41
40
|
const [ref, { width }] = useMeasure();
|
|
42
41
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
43
42
|
useEffect(() => {
|
|
@@ -98,6 +97,25 @@ function NextPrev({ children, loop = false, defaultIndex = 0, onChange = () => n
|
|
|
98
97
|
height: 100%;
|
|
99
98
|
width: ${slidersWidth}px;
|
|
100
99
|
display: flex;
|
|
101
|
-
`, children: Sliders }),
|
|
100
|
+
`, children: Sliders }), _jsxs("div", { style: {
|
|
101
|
+
position: 'absolute',
|
|
102
|
+
top: '50%',
|
|
103
|
+
padding: '0 10px',
|
|
104
|
+
justifyContent: 'space-between',
|
|
105
|
+
width: '100%',
|
|
106
|
+
display: 'flex',
|
|
107
|
+
pointerEvents: 'none',
|
|
108
|
+
...style?.arrowContainer,
|
|
109
|
+
}, children: [_jsx(Arrow, { direction: "left", onClick: prevHandler, style: {
|
|
110
|
+
...(activeIndex === 0 && {
|
|
111
|
+
visibility: 'hidden',
|
|
112
|
+
pointerEvents: 'none',
|
|
113
|
+
}),
|
|
114
|
+
} }), _jsx(Arrow, { direction: "right", onClick: nextHandler, style: {
|
|
115
|
+
...((!Sliders || activeIndex === Sliders.length - 1) && {
|
|
116
|
+
visibility: 'hidden',
|
|
117
|
+
pointerEvents: 'none',
|
|
118
|
+
}),
|
|
119
|
+
} })] })] }));
|
|
102
120
|
}
|
|
103
121
|
export default memo(NextPrev);
|
|
@@ -7,7 +7,7 @@ const inputStyle = {
|
|
|
7
7
|
border: '0.55px solid #c7c7c7',
|
|
8
8
|
textAlign: 'center',
|
|
9
9
|
};
|
|
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 }));
|
|
10
|
+
const NumberInput = forwardRef(({ name, value: valueProp, style = {}, onChange, pattern = '^\\d*.\\d*$', step = 'any', min = 'any', max = 'any', ...otherProps }, 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, ...otherProps }));
|
|
12
12
|
});
|
|
13
13
|
export default NumberInput;
|
|
@@ -102,8 +102,8 @@ const ReactTableInner = forwardRef(function ReactTableInner(props, ref) {
|
|
|
102
102
|
? approxColumnWidth * (columns.length + 1)
|
|
103
103
|
: '100%',
|
|
104
104
|
pointerEvents: 'none',
|
|
105
|
-
} }), _jsxs("table", { ...getTableProps(), css: ReactTableStyle, style: styles.table(enableVirtualScroll, enableColumnsVirtualScroll), children: [_jsx(ReactTableHeader, { headerGroups: headerGroups, onClick: headerClickHandler }), _jsxs("tbody", { ...getTableBodyProps(), children: [!
|
|
106
|
-
(
|
|
105
|
+
} }), _jsxs("table", { ...getTableProps(), css: ReactTableStyle, style: styles.table(enableVirtualScroll, enableColumnsVirtualScroll), children: [_jsx(ReactTableHeader, { headerGroups: headerGroups, onClick: headerClickHandler }), _jsxs("tbody", { ...getTableBodyProps(), children: [!data ||
|
|
106
|
+
(data?.length === 0 && (_jsx(EmptyDataRow, { columns: columns, text: emptyDataRowText }))), rowsData.map((row, index) => {
|
|
107
107
|
prepareRow(row);
|
|
108
108
|
prepareRowSpan(rows, enableVirtualScroll
|
|
109
109
|
? index + virtualBoundary.rows.start
|
|
@@ -122,7 +122,7 @@ const ReactTableInner = forwardRef(function ReactTableInner(props, ref) {
|
|
|
122
122
|
opacity: !isCounterVisible ? '0' : '1',
|
|
123
123
|
transition: 'all 0.5s',
|
|
124
124
|
visibility: !isCounterVisible ? 'hidden' : 'visible',
|
|
125
|
-
}, children: [enableColumnsVirtualScroll && typeof startColumn === 'string' && (_jsxs("span", { style: { left: 0 }, children: [`Column ${startColumn}`, " "] })), index + 1, " / ", total] }))] }));
|
|
125
|
+
}, children: [enableColumnsVirtualScroll && typeof startColumn === 'string' && (_jsxs("span", { style: { left: 0 }, children: [`Column ${startColumn}`, " "] })), typeof index === 'number' ? index + 1 : total, " / ", total] }))] }));
|
|
126
126
|
});
|
|
127
127
|
function ReactTable(props) {
|
|
128
128
|
const { data, approxItemHeight = 40, approxColumnWidth = 40, groupKey, onSortEnd, columns, style = {}, } = props;
|
|
@@ -159,7 +159,7 @@ function ReactTable(props) {
|
|
|
159
159
|
}, [approxColumnWidth, approxItemHeight, height, width]);
|
|
160
160
|
function lookForGroupIndex(currentIndex, side) {
|
|
161
161
|
const currentItem = data[currentIndex];
|
|
162
|
-
if (currentItem
|
|
162
|
+
if (currentItem?.index && groupKey) {
|
|
163
163
|
switch (side) {
|
|
164
164
|
case -1: {
|
|
165
165
|
let index = currentIndex - 1;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { CheckBoxProps } from '../CheckBox';
|
|
3
3
|
export interface FormikCheckBoxProps extends Omit<CheckBoxProps, 'style'> {
|
|
4
4
|
name: string;
|
|
@@ -11,6 +11,7 @@ export interface FormikCheckBoxProps extends Omit<CheckBoxProps, 'style'> {
|
|
|
11
11
|
checkbox?: CSSProperties;
|
|
12
12
|
};
|
|
13
13
|
defaultValue?: any;
|
|
14
|
+
renderLabel?: (label?: any) => ReactNode;
|
|
14
15
|
}
|
|
15
16
|
declare function FormikCheckBox(props: FormikCheckBoxProps): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export default FormikCheckBox;
|
|
@@ -4,7 +4,7 @@ import lodashGet from 'lodash/get';
|
|
|
4
4
|
import { useCallback } from 'react';
|
|
5
5
|
import CheckBox from '../CheckBox';
|
|
6
6
|
function FormikCheckBox(props) {
|
|
7
|
-
const { label, name, onChange = () => null, className = 'checkbox', reverse = false, style = { container: {}, label: {}, checkbox: {} }, defaultValue, ...resProps } = props;
|
|
7
|
+
const { label, name, onChange = () => null, className = 'checkbox', reverse = false, style = { container: {}, label: {}, checkbox: {} }, defaultValue, renderLabel, ...resProps } = props;
|
|
8
8
|
const { values, setFieldValue } = useFormikContext();
|
|
9
9
|
const value = reverse
|
|
10
10
|
? !lodashGet(values, name, defaultValue)
|
|
@@ -14,6 +14,6 @@ function FormikCheckBox(props) {
|
|
|
14
14
|
onChange(e);
|
|
15
15
|
void setFieldValue(name, reverse ? value : !value);
|
|
16
16
|
}, [name, onChange, reverse, setFieldValue, value]);
|
|
17
|
-
return (_jsxs("div", { className: `${className} check-${value}`, style: style.container
|
|
17
|
+
return (_jsxs("div", { className: `${className} check-${value}`, style: { display: 'flex', justifyContent: 'center', ...style.container }, children: [renderLabel?.(label), label && !renderLabel && (_jsx("label", { htmlFor: name, className: "checkbox-label", style: style.label || {}, children: label })), _jsx(CheckBox, { ...resProps, name: name, id: name, checked: value, onChange: changeHandler, style: style.checkbox || {} })] }));
|
|
18
18
|
}
|
|
19
19
|
export default FormikCheckBox;
|