nmrium 0.31.0 → 0.33.0-pre.1667632695
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/Chart1D.js +1 -1
- package/lib/component/1d/FooterBanner.js +17 -10
- package/lib/component/1d/LinesSeries.js +1 -1
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/XAxis.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib/component/1d/{Integral.d.ts → integral/Integral.d.ts} +0 -0
- package/lib/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib/component/1d/integral/IntegralIndicator.d.ts +9 -0
- package/lib/component/1d/integral/IntegralIndicator.js +27 -0
- package/lib/component/1d/{IntegralResizable.d.ts → integral/IntegralResizable.d.ts} +0 -0
- package/lib/component/1d/integral/IntegralResizable.js +69 -0
- package/lib/component/1d/{IntegralsSeries.d.ts → integral/IntegralsSeries.d.ts} +0 -0
- package/lib/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib/component/1d/ranges/Range.js +27 -50
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +2 -2
- package/lib/component/2d/Contours.js +61 -42
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/Left1DChart.js +1 -1
- package/lib/component/2d/Top1DChart.js +1 -1
- package/lib/component/2d/Viewer2D.js +11 -14
- package/lib/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib/component/2d/zones/IndicationLines.js +5 -8
- package/lib/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +6 -6
- package/lib/component/SplitPaneWrapper.js +1 -1
- package/lib/component/assignment/actions/initAssignment.js +17 -17
- package/lib/component/assignment/index.js +2 -2
- package/lib/component/context/PreferencesContext.js +3 -6
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/CheckBoxCell.js +1 -1
- package/lib/component/elements/ContextMenu.js +2 -2
- package/lib/component/elements/EditableColumn.d.ts +3 -1
- package/lib/component/elements/EditableColumn.js +21 -8
- package/lib/component/elements/GroupPane.d.ts +12 -0
- package/lib/component/elements/GroupPane.js +14 -0
- package/lib/component/elements/Input.js +7 -4
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/Label.js +1 -2
- package/lib/component/elements/MolecularFormulaInput.js +2 -0
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -1
- package/lib/component/elements/ReactTable/ReactTable.js +72 -38
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +3 -2
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib/component/elements/accordion/Accordion.js +2 -2
- package/lib/component/elements/draggble/useDraggable.js +1 -3
- package/lib/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
- package/lib/component/elements/formik/FormikColorPicker.js +5 -8
- package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib/component/elements/formik/FormikForm.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput.js +12 -20
- package/lib/component/elements/formik/FormikOnChange.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.js +13 -10
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/elements/formik/FormikSlider.d.ts +2 -4
- package/lib/component/elements/formik/FormikSlider.js +8 -11
- package/lib/component/elements/formik/FormikTextarea.js +1 -1
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib/component/elements/popup/Alert/Provider.js +7 -7
- package/lib/component/elements/popup/Alert/index.d.ts +3 -4
- package/lib/component/elements/popup/Alert/index.js +3 -4
- package/lib/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib/component/elements/popup/Modal/Provider.js +16 -31
- package/lib/component/elements/popup/Modal/index.d.ts +4 -5
- package/lib/component/elements/popup/Modal/index.js +4 -5
- package/lib/component/header/Header.js +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib/component/hooks/useCombinedRefs.js +2 -2
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +9 -6
- package/lib/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib/component/hooks/usePanelPreferences.js +9 -7
- package/lib/component/loader/DropZone.js +10 -2
- package/lib/component/modal/AlignSpectraModal.js +1 -1
- package/lib/component/modal/ExportAsMatrixModal.js +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +2 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib/component/modal/PredictSpectraModal.js +5 -5
- package/lib/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib/component/modal/setting/GeneralSettings.js +11 -14
- package/lib/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -1
- package/lib/component/modal/setting/WorkspaceItem.js +36 -48
- package/lib/component/modal/setting/settingsValidation.d.ts +58 -57
- package/lib/component/modal/setting/settingsValidation.js +14 -12
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib/component/panels/InformationPanel.js +52 -56
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +5 -5
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +3 -26
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +3 -3
- package/lib/component/reducer/Reducer.d.ts +26 -45
- package/lib/component/reducer/Reducer.js +13 -12
- package/lib/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/DomainActions.js +52 -69
- package/lib/component/reducer/actions/FiltersActions.js +15 -6
- package/lib/component/reducer/actions/HistoryActions.js +5 -5
- package/lib/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib/component/reducer/actions/LoadActions.js +12 -0
- package/lib/component/reducer/actions/PeaksActions.js +7 -6
- package/lib/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +28 -24
- package/lib/component/reducer/actions/SpectrumsActions.js +13 -6
- package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +28 -41
- package/lib/component/reducer/actions/ZonesActions.js +11 -10
- package/lib/component/reducer/core/Constants.js +1 -1
- package/lib/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrum.js +4 -0
- package/lib/component/reducer/helper/getSpectrum.js +3 -5
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +1 -1
- package/lib/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib/component/reducer/preferences/actions/setPreferences.js +5 -6
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +2 -2
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -4
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib/component/tool/BrushX.js +3 -3
- package/lib/component/tool/BrushXY.js +5 -5
- package/lib/component/tool/CrossLinePointer.js +3 -3
- package/lib/component/toolbar/BasicToolBar.js +9 -8
- package/lib/component/utility/Evaluate.js +2 -2
- package/lib/component/utility/FileUtility.d.ts +2 -9
- package/lib/component/utility/FileUtility.js +11 -28
- package/lib/component/utility/GroupByInfoKey.d.ts +1 -1
- package/lib/component/utility/GroupByInfoKey.js +11 -13
- package/lib/component/utility/PathBuilder.js +1 -1
- package/lib/component/utility/PreferencesHelper.js +2 -3
- package/lib/component/utility/{Export.d.ts → export.d.ts} +0 -0
- package/lib/component/utility/{Export.js → export.js} +54 -73
- package/lib/component/utility/formatNumber.d.ts +6 -1
- package/lib/component/utility/formatNumber.js +5 -4
- package/lib/component/workspaces/Workspace.d.ts +1 -1
- package/lib/component/workspaces/exercise.js +4 -4
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/Filters.d.ts +16 -18
- package/lib/data/Filters.js +16 -18
- package/lib/data/FiltersManager.js +4 -3
- package/lib/data/PredictionManager.js +8 -10
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/SpectraManager.js +25 -60
- package/lib/data/data1d/MultipleAnalysis.js +74 -70
- package/lib/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +24 -25
- package/lib/data/data1d/Spectrum1D/index.js +24 -25
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib/data/data1d/database.js +45 -28
- package/lib/data/data1d/filter1d/apodization.js +2 -1
- package/lib/data/data1d/filter1d/fft.js +24 -7
- package/lib/data/data1d/filter1d/phaseCorrection.js +11 -5
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +10 -20
- package/lib/data/data2d/Spectrum2D/contours.d.ts +40 -0
- package/lib/data/data2d/Spectrum2D/contours.js +132 -0
- package/lib/data/data2d/Spectrum2D/index.d.ts +10 -11
- package/lib/data/data2d/Spectrum2D/index.js +10 -11
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/index.d.ts +12 -13
- package/lib/data/types/data2d/Data2D.d.ts +2 -0
- package/lib/data/types/data2d/Datum2D.d.ts +0 -1
- package/lib/data/types/data2d/index.d.ts +8 -9
- package/lib/data/utilities/RangeUtilities.js +13 -9
- package/lib/data/utilities/ZoneUtilities.js +17 -13
- package/lib/data/utilities/calculateSanPlot.d.ts +8 -0
- package/lib/data/utilities/calculateSanPlot.js +31 -0
- package/lib/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib/data/utilities/generateChar.js +8 -6
- package/lib/data/utilities/getAtom.js +1 -1
- package/lib/data/utilities/getAtomsFromMF.js +2 -2
- package/lib/data/utilities/getColor.js +3 -3
- package/lib/data/utilities/getSum.js +6 -3
- package/lib/types/NMRiumGeneralPreferences.d.ts +2 -2
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +16 -9
- package/lib-cjs/component/1d/LinesSeries.js +1 -1
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/XAxis.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib-cjs/component/1d/integral/IntegralIndicator.js +31 -0
- package/lib-cjs/component/1d/integral/IntegralResizable.js +74 -0
- package/lib-cjs/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib-cjs/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib-cjs/component/1d/ranges/Range.js +27 -50
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +2 -2
- package/lib-cjs/component/2d/Contours.js +60 -41
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/Left1DChart.js +1 -1
- package/lib-cjs/component/2d/Top1DChart.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +11 -14
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +5 -8
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib-cjs/component/NMRium.js +7 -7
- package/lib-cjs/component/SplitPaneWrapper.js +1 -1
- package/lib-cjs/component/assignment/actions/initAssignment.js +17 -17
- package/lib-cjs/component/assignment/index.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +3 -6
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/CheckBoxCell.js +1 -1
- package/lib-cjs/component/elements/ContextMenu.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +21 -8
- package/lib-cjs/component/elements/GroupPane.js +18 -0
- package/lib-cjs/component/elements/Input.js +7 -4
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/Label.js +1 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +2 -0
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +71 -37
- package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib-cjs/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib-cjs/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -2
- package/lib-cjs/component/elements/draggble/useDraggable.js +1 -3
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +4 -7
- package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib-cjs/component/elements/formik/FormikForm.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +12 -20
- package/lib-cjs/component/elements/formik/FormikOnChange.js +13 -10
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSlider.js +7 -10
- package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
- package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +8 -8
- package/lib-cjs/component/elements/popup/Alert/index.js +5 -5
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +16 -31
- package/lib-cjs/component/elements/popup/Modal/index.js +7 -7
- package/lib-cjs/component/header/Header.js +1 -1
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib-cjs/component/hooks/useCombinedRefs.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +14 -11
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +9 -7
- package/lib-cjs/component/loader/DropZone.js +10 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib-cjs/component/modal/PredictSpectraModal.js +5 -5
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib-cjs/component/modal/setting/GeneralSettings.js +11 -14
- package/lib-cjs/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +37 -49
- package/lib-cjs/component/modal/setting/settingsValidation.js +14 -12
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib-cjs/component/panels/InformationPanel.js +51 -55
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -25
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +3 -3
- package/lib-cjs/component/reducer/Reducer.js +12 -11
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +52 -69
- package/lib-cjs/component/reducer/actions/FiltersActions.js +15 -6
- package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
- package/lib-cjs/component/reducer/actions/PeaksActions.js +7 -6
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib-cjs/component/reducer/actions/RangesActions.js +28 -24
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +12 -5
- package/lib-cjs/component/reducer/actions/ToolsActions.js +28 -41
- package/lib-cjs/component/reducer/actions/ZonesActions.js +11 -10
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib-cjs/component/reducer/helper/getActiveSpectrum.js +8 -0
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -5
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +5 -9
- package/lib-cjs/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib-cjs/component/tool/BrushX.js +3 -3
- package/lib-cjs/component/tool/BrushXY.js +5 -5
- package/lib-cjs/component/tool/CrossLinePointer.js +3 -3
- package/lib-cjs/component/toolbar/BasicToolBar.js +8 -7
- package/lib-cjs/component/utility/Evaluate.js +2 -2
- package/lib-cjs/component/utility/FileUtility.js +11 -29
- package/lib-cjs/component/utility/GroupByInfoKey.js +11 -13
- package/lib-cjs/component/utility/PathBuilder.js +1 -1
- package/lib-cjs/component/utility/PreferencesHelper.js +2 -3
- package/lib-cjs/component/utility/{Export.js → export.js} +78 -74
- package/lib-cjs/component/utility/formatNumber.js +5 -4
- package/lib-cjs/component/workspaces/exercise.js +4 -4
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib-cjs/data/Filters.js +17 -35
- package/lib-cjs/data/FiltersManager.js +4 -3
- package/lib-cjs/data/PredictionManager.js +8 -10
- package/lib-cjs/data/SpectraManager.js +26 -62
- package/lib-cjs/data/data1d/MultipleAnalysis.js +74 -70
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/index.js +25 -25
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib-cjs/data/data1d/database.js +45 -28
- package/lib-cjs/data/data1d/filter1d/apodization.js +2 -1
- package/lib-cjs/data/data1d/filter1d/fft.js +23 -6
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +10 -4
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Processing2D.js +10 -20
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +138 -0
- package/lib-cjs/data/data2d/Spectrum2D/index.js +11 -11
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/RangeUtilities.js +13 -9
- package/lib-cjs/data/utilities/ZoneUtilities.js +17 -13
- package/lib-cjs/data/utilities/calculateSanPlot.js +35 -0
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib-cjs/data/utilities/generateChar.js +8 -6
- package/lib-cjs/data/utilities/getAtom.js +1 -1
- package/lib-cjs/data/utilities/getAtomsFromMF.js +2 -2
- package/lib-cjs/data/utilities/getColor.js +3 -3
- package/lib-cjs/data/utilities/getSum.js +6 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +36 -31
- package/lib/component/1d/IntegralResizable.js +0 -72
- package/lib/component/elements/popup/helpers.d.ts +0 -1
- package/lib/component/elements/popup/helpers.js +0 -9
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.js +0 -8
- package/lib/data/data1d/Data1DManager.d.ts +0 -3
- package/lib/data/data1d/Data1DManager.js +0 -98
- package/lib/data/data1d/filter1d/absolute.d.ts +0 -13
- package/lib/data/data1d/filter1d/absolute.js +0 -26
- package/lib/data/data2d/Data2DManager.d.ts +0 -3
- package/lib/data/data2d/Data2DManager.js +0 -34
- package/lib/data/types/data2d/Contour.d.ts +0 -4
- package/lib/data/types/data2d/Contour.js +0 -1
- package/lib/data/types/data2d/Contours.d.ts +0 -2
- package/lib/data/types/data2d/Contours.js +0 -1
- package/lib-cjs/component/1d/IntegralResizable.js +0 -77
- package/lib-cjs/component/elements/popup/helpers.js +0 -13
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +0 -14
- package/lib-cjs/data/data1d/Data1DManager.js +0 -104
- package/lib-cjs/data/data1d/filter1d/absolute.js +0 -32
- package/lib-cjs/data/data2d/Data2DManager.js +0 -40
- package/lib-cjs/data/types/data2d/Contour.js +0 -2
- package/lib-cjs/data/types/data2d/Contours.js +0 -2
|
@@ -7,7 +7,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const Input_1 = __importDefault(require("./Input"));
|
|
9
9
|
const EditableColumn = (0, react_1.forwardRef)(function EditableColumn(props, ref) {
|
|
10
|
-
const { onSave = () => null, value, type = 'text', style, onEditStart = () => null, editStatus = false, validate = () => true, } = props;
|
|
10
|
+
const { onSave = () => null, value, type = 'text', style, onEditStart = () => null, editStatus = false, validate = () => true, textOverFlowEllipses = false, ...InputProps } = props;
|
|
11
11
|
const [enabled, enableEdit] = (0, react_1.useState)();
|
|
12
12
|
const [isValid, setValid] = (0, react_1.useState)(true);
|
|
13
13
|
(0, react_1.useEffect)(() => {
|
|
@@ -36,11 +36,9 @@ const EditableColumn = (0, react_1.forwardRef)(function EditableColumn(props, re
|
|
|
36
36
|
const valid = validate(event?.target.value);
|
|
37
37
|
setValid(valid);
|
|
38
38
|
// when press Enter or Tab
|
|
39
|
-
if (valid) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
enableEdit(false);
|
|
43
|
-
}
|
|
39
|
+
if (valid && ['Enter', 'Tab'].includes(event.key)) {
|
|
40
|
+
onSave(event);
|
|
41
|
+
enableEdit(false);
|
|
44
42
|
}
|
|
45
43
|
// close edit mode if press Enter, Tab or Escape
|
|
46
44
|
if (['Escape'].includes(event.key)) {
|
|
@@ -48,11 +46,26 @@ const EditableColumn = (0, react_1.forwardRef)(function EditableColumn(props, re
|
|
|
48
46
|
window.removeEventListener('mousedown', mouseClickCallback);
|
|
49
47
|
}
|
|
50
48
|
}, [mouseClickCallback, onSave, validate]);
|
|
51
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
49
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
50
|
+
display: 'table',
|
|
51
|
+
width: '100%',
|
|
52
|
+
height: '100%',
|
|
53
|
+
...(textOverFlowEllipses
|
|
54
|
+
? { whiteSpace: 'nowrap', overflow: 'hidden', display: 'inline-flex' }
|
|
55
|
+
: {}),
|
|
56
|
+
...style,
|
|
57
|
+
}, className: "editable-column-input", onDoubleClick: startEditHandler, children: [!enabled && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
58
|
+
display: 'table-cell',
|
|
59
|
+
verticalAlign: 'middle',
|
|
60
|
+
width: 'inherit',
|
|
61
|
+
...(textOverFlowEllipses
|
|
62
|
+
? { textOverflow: 'ellipsis', overflow: 'hidden' }
|
|
63
|
+
: {}),
|
|
64
|
+
}, children: value })), enabled && ((0, jsx_runtime_1.jsx)("div", { style: { display: 'table-cell', verticalAlign: 'middle' }, children: (0, jsx_runtime_1.jsx)(Input_1.default, { style: {
|
|
52
65
|
inputWrapper: {
|
|
53
66
|
width: '100%',
|
|
54
67
|
...(!isValid && { borderColor: 'red' }),
|
|
55
68
|
},
|
|
56
|
-
}, enableAutoSelect: true, className: "editable-column", value: value, type: type, onKeyUp: editHandler }) }))] }));
|
|
69
|
+
}, enableAutoSelect: true, className: "editable-column", value: value, type: type, onKeyUp: editHandler, ...InputProps }) }))] }));
|
|
57
70
|
});
|
|
58
71
|
exports.default = EditableColumn;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupPane = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const styles = {
|
|
6
|
+
header: {
|
|
7
|
+
fontSize: '13px',
|
|
8
|
+
color: '#2ca8ff',
|
|
9
|
+
marginBottom: '10px',
|
|
10
|
+
borderBottom: '0.55px solid #f9f9f9',
|
|
11
|
+
padding: '6px 2px',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
function GroupPane(props) {
|
|
15
|
+
const { text, style, children, renderHeader } = props;
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: style?.container, children: [!renderHeader ? ((0, jsx_runtime_1.jsx)("p", { style: { ...styles.header, ...style?.header }, children: text })) : (renderHeader(text)), children] }));
|
|
17
|
+
}
|
|
18
|
+
exports.GroupPane = GroupPane;
|
|
@@ -41,10 +41,13 @@ const styles = {
|
|
|
41
41
|
padding: 0,
|
|
42
42
|
},
|
|
43
43
|
};
|
|
44
|
+
function identity(value) {
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
44
47
|
const Input = (0, react_1.forwardRef)(({ value = '', name, style = {
|
|
45
48
|
input: {},
|
|
46
49
|
inputWrapper: {},
|
|
47
|
-
}, onChange = () => null, debounceTime = 0, onKeyDown = () => null, onKeyUp = () => null, checkValue = () => true, type = 'text', enableAutoSelect = false, className, format = () =>
|
|
50
|
+
}, 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, onClear, ...props }, ref) => {
|
|
48
51
|
const [val, setVal] = (0, react_1.useState)(value);
|
|
49
52
|
const valueRef = (0, react_1.useRef)(value);
|
|
50
53
|
const localRef = (0, react_1.useRef)();
|
|
@@ -74,7 +77,7 @@ const Input = (0, react_1.forwardRef)(({ value = '', name, style = {
|
|
|
74
77
|
e.preventDefault();
|
|
75
78
|
function check(value) {
|
|
76
79
|
if (type === 'number') {
|
|
77
|
-
const pattern = /^(
|
|
80
|
+
const pattern = /^(?:-?\d*|\d+)(?:\.\d{0,20})?$/;
|
|
78
81
|
if (value.trim() === '' || pattern.test(value)) {
|
|
79
82
|
return true;
|
|
80
83
|
}
|
|
@@ -134,10 +137,10 @@ const Input = (0, react_1.forwardRef)(({ value = '', name, style = {
|
|
|
134
137
|
}, [onClear]);
|
|
135
138
|
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
136
139
|
...styles.inputWrapper,
|
|
137
|
-
...
|
|
140
|
+
...style?.inputWrapper,
|
|
138
141
|
}, className: `input ${className || ''}`, children: [renderIcon?.(), (0, jsx_runtime_1.jsx)("input", { ...props, ref: combinedRef, name: name, style: {
|
|
139
142
|
...styles.input,
|
|
140
|
-
...
|
|
143
|
+
...style?.input,
|
|
141
144
|
}, type: "text", value: val, onChange: onChangeHandler, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onKeyPress: preventPropagate, onDoubleClick: (e) => e.stopPropagation(), onFocus: onFocus, onBlur: onBlur }), canClear && val && ((0, jsx_runtime_1.jsx)("button", { type: "button", style: styles.clearButton, onClick: clearHandler, children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'block', margin: '0 auto' }, children: "\u2715" }) }))] }));
|
|
142
145
|
});
|
|
143
146
|
exports.default = Input;
|
|
@@ -5,7 +5,7 @@ function IsotopesViewer({ value = '', ...othersProps }) {
|
|
|
5
5
|
return ((0, jsx_runtime_1.jsx)("div", { ...othersProps,
|
|
6
6
|
// eslint-disable-next-line react/no-danger
|
|
7
7
|
dangerouslySetInnerHTML: {
|
|
8
|
-
__html: value.replace(/(?<isotope
|
|
8
|
+
__html: value.replace(/(?<isotope>\d+)/g, '<sup>$<isotope></sup>'),
|
|
9
9
|
} }));
|
|
10
10
|
}
|
|
11
11
|
exports.default = IsotopesViewer;
|
|
@@ -4,8 +4,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
4
4
|
function Label(props) {
|
|
5
5
|
const { title, className = '', children, style, ...otherProps } = props;
|
|
6
6
|
return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center', ...style?.container }, children: [(0, jsx_runtime_1.jsx)("label", { className: className, style: {
|
|
7
|
-
fontSize: '
|
|
8
|
-
fontWeight: 'bold',
|
|
7
|
+
fontSize: '12px',
|
|
9
8
|
color: '#232323',
|
|
10
9
|
paddingRight: '10px',
|
|
11
10
|
width: 'max-content',
|
|
@@ -36,10 +36,10 @@ const NumberInput = (0, react_1.forwardRef)(({ label, name, defaultValue = 0, st
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
else {
|
|
39
|
-
const _ref = ref
|
|
39
|
+
const _ref = ref || localRef;
|
|
40
40
|
_ref.current.value = Number(defaultValue);
|
|
41
41
|
}
|
|
42
42
|
}, [defaultValue, onChange, ref]);
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { ...styles.container, ...style.container }, children: [(0, jsx_runtime_1.jsx)("span", { style: { ...styles.label, ...style.label }, children: label }), (0, jsx_runtime_1.jsx)("div", { style: { ...styles.inputContainer, ...style.inputContainer }, children: (0, jsx_runtime_1.jsx)("input", { ref: ref
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { ...styles.container, ...style.container }, children: [(0, jsx_runtime_1.jsx)("span", { style: { ...styles.label, ...style.label }, children: label }), (0, jsx_runtime_1.jsx)("div", { style: { ...styles.inputContainer, ...style.inputContainer }, children: (0, jsx_runtime_1.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) })] }));
|
|
44
44
|
});
|
|
45
45
|
exports.default = NumberInput;
|
|
@@ -27,12 +27,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
30
|
+
/* eslint-disable unicorn/prefer-logical-operator-over-ternary */
|
|
30
31
|
/** @jsxImportSource @emotion/react */
|
|
31
32
|
const react_1 = require("react");
|
|
32
33
|
const react_table_1 = require("react-table");
|
|
33
34
|
const react_use_1 = require("react-use");
|
|
34
35
|
const checkModifierKeyActivated_1 = __importDefault(require("../../../data/utilities/checkModifierKeyActivated"));
|
|
35
|
-
const useCombinedRefs_1 = __importDefault(require("../../hooks/useCombinedRefs"));
|
|
36
36
|
const ContextMenu_1 = __importDefault(require("../ContextMenu"));
|
|
37
37
|
const ReactTableHeader_1 = __importDefault(require("./Elements/ReactTableHeader"));
|
|
38
38
|
const ReactTableRow_1 = __importDefault(require("./Elements/ReactTableRow"));
|
|
@@ -46,11 +46,24 @@ const styles = {
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
};
|
|
49
|
+
const counterStyle = {
|
|
50
|
+
position: 'absolute',
|
|
51
|
+
bottom: 0,
|
|
52
|
+
width: '100%',
|
|
53
|
+
backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
|
54
|
+
pointerEvents: 'none',
|
|
55
|
+
textAlign: 'center',
|
|
56
|
+
fontWeight: 'bolder',
|
|
57
|
+
color: 'white',
|
|
58
|
+
fontSize: '1.4em',
|
|
59
|
+
};
|
|
49
60
|
const ReactTableInner = (0, react_1.forwardRef)(function ReactTableInner(props, ref) {
|
|
50
|
-
const { data, columns, highlightedSource, context = null, onScroll, approxItemHeight = 40, enableVirtualScroll = false, groupKey, onClick, highlightActiveRow = false, } = props;
|
|
61
|
+
const { data, columns, highlightedSource, context = null, onScroll, approxItemHeight = 40, enableVirtualScroll = false, groupKey, onClick, highlightActiveRow = false, totalCount, indexKey = 'index', } = props;
|
|
51
62
|
const contextRef = (0, react_1.useRef)(null);
|
|
52
63
|
const { index: indexBoundary } = (0, ReactTableContext_1.useReactTableContext)();
|
|
53
64
|
const [rowIndex, setRowIndex] = (0, react_1.useState)();
|
|
65
|
+
const timeoutIdRef = (0, react_1.useRef)();
|
|
66
|
+
const [isCounterVisible, setCounterVisibility] = (0, react_1.useState)(false);
|
|
54
67
|
const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow, rowSpanHeaders, } = (0, react_table_1.useTable)({
|
|
55
68
|
columns,
|
|
56
69
|
data,
|
|
@@ -68,46 +81,64 @@ const ReactTableInner = (0, react_1.forwardRef)(function ReactTableInner(props,
|
|
|
68
81
|
setRowIndex(row.index);
|
|
69
82
|
onClick?.(event, row);
|
|
70
83
|
}, [onClick]);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
function scrollHandler(e) {
|
|
85
|
+
if (enableVirtualScroll) {
|
|
86
|
+
onScroll(e);
|
|
87
|
+
}
|
|
88
|
+
if (timeoutIdRef.current) {
|
|
89
|
+
clearTimeout(timeoutIdRef.current);
|
|
90
|
+
setCounterVisibility(true);
|
|
91
|
+
}
|
|
92
|
+
timeoutIdRef.current = setTimeout(() => {
|
|
93
|
+
setCounterVisibility(false);
|
|
94
|
+
}, 1000);
|
|
95
|
+
}
|
|
96
|
+
const index = rowsData[rowsData.length - 1]?.original[indexKey] ||
|
|
97
|
+
rowsData[rowsData.length - 1]?.index;
|
|
98
|
+
const total = totalCount ? totalCount : data.length;
|
|
99
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { ref: ref, className: "table-container", style: {
|
|
100
|
+
overflowY: 'auto',
|
|
101
|
+
position: 'relative',
|
|
102
|
+
height: '100%',
|
|
103
|
+
}, onScroll: scrollHandler, children: [enableVirtualScroll && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
104
|
+
height: approxItemHeight * data.length,
|
|
105
|
+
position: 'absolute',
|
|
106
|
+
width: '100%',
|
|
107
|
+
pointerEvents: 'none',
|
|
108
|
+
} })), (0, jsx_runtime_1.jsxs)("table", { ...getTableProps(), css: Style_1.ReactTableStyle, style: styles.table(enableVirtualScroll), children: [(0, jsx_runtime_1.jsx)(ReactTableHeader_1.default, { headerGroups: headerGroups }), (0, jsx_runtime_1.jsx)("tbody", { ...getTableBodyProps(), children: rowsData.map((row, index) => {
|
|
109
|
+
prepareRow(row);
|
|
110
|
+
(0, useRowSpan_1.prepareRowSpan)(rows, enableVirtualScroll ? index + indexBoundary.start : index, rowSpanHeaders, groupKey);
|
|
111
|
+
return ((0, jsx_runtime_1.jsx)(ReactTableRow_1.default, { row: row, ...row.getRowProps(), onContextMenu: (e) => contextMenuHandler(e, row), onClick: highlightActiveRow ? clickHandler : onClick, highlightedSource: highlightedSource, isRowActive: rowIndex === index }, row.key));
|
|
112
|
+
}) })] }), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { ref: contextRef, context: context })] }), enableVirtualScroll && ((0, jsx_runtime_1.jsxs)("p", { style: {
|
|
113
|
+
...counterStyle,
|
|
114
|
+
opacity: !isCounterVisible ? '0' : '1',
|
|
115
|
+
transition: 'all 0.5s',
|
|
116
|
+
visibility: !isCounterVisible ? 'hidden' : 'visible',
|
|
117
|
+
}, children: [index + 1, " / ", total] }))] }));
|
|
85
118
|
});
|
|
86
119
|
function ReactTable(props) {
|
|
87
120
|
const { data, approxItemHeight = 40, groupKey } = props;
|
|
88
|
-
const
|
|
121
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
89
122
|
const [mRef, { height }] = (0, react_use_1.useMeasure)();
|
|
90
|
-
const combineRef = (0, useCombinedRefs_1.default)([mRef, ref]);
|
|
91
123
|
const [tableVirtualConfig, setTableVirtualConfig] = (0, react_1.useState)({
|
|
92
|
-
offsetHeight: 0,
|
|
93
124
|
scrollHeight: 0,
|
|
94
125
|
numberOfVisibleRows: 0,
|
|
95
126
|
index: { start: 0, end: 0 },
|
|
96
127
|
});
|
|
97
128
|
(0, react_1.useEffect)(() => {
|
|
98
|
-
if (
|
|
99
|
-
const { scrollHeight } =
|
|
100
|
-
const
|
|
129
|
+
if (containerRef.current) {
|
|
130
|
+
const { scrollHeight } = containerRef.current;
|
|
131
|
+
const header = containerRef.current.querySelectorAll('thead');
|
|
132
|
+
const numberOfVisibleRows = Math.ceil((height - header[0].clientHeight) / approxItemHeight);
|
|
101
133
|
setTableVirtualConfig((prev) => ({
|
|
102
134
|
...prev,
|
|
103
|
-
offsetHeight: height,
|
|
104
135
|
scrollHeight,
|
|
105
|
-
numberOfVisibleRows,
|
|
106
|
-
index: { start: 0, end: numberOfVisibleRows
|
|
136
|
+
numberOfVisibleRows: numberOfVisibleRows - 1,
|
|
137
|
+
index: { start: 0, end: numberOfVisibleRows },
|
|
107
138
|
}));
|
|
108
139
|
}
|
|
109
|
-
}, [approxItemHeight,
|
|
110
|
-
|
|
140
|
+
}, [approxItemHeight, height]);
|
|
141
|
+
function lookForGroupIndex(currentIndex, side) {
|
|
111
142
|
const currentItem = data[currentIndex];
|
|
112
143
|
if (currentItem.index && groupKey) {
|
|
113
144
|
switch (side) {
|
|
@@ -136,24 +167,24 @@ function ReactTable(props) {
|
|
|
136
167
|
}
|
|
137
168
|
}
|
|
138
169
|
return currentIndex;
|
|
139
|
-
}
|
|
140
|
-
|
|
170
|
+
}
|
|
171
|
+
function findStartIndex(index, numberOfVisibleRows) {
|
|
141
172
|
const newIndex = index - numberOfVisibleRows;
|
|
142
173
|
const currentIndx = newIndex >= data.length ? newIndex : index;
|
|
143
174
|
// return currentIndx;
|
|
144
175
|
// Look for the first index of the group
|
|
145
176
|
return lookForGroupIndex(currentIndx, -1);
|
|
146
|
-
}
|
|
147
|
-
|
|
177
|
+
}
|
|
178
|
+
function findEndIndex(index, numberOfVisibleRows) {
|
|
148
179
|
const newIndex = index + numberOfVisibleRows;
|
|
149
180
|
const currentIndx = newIndex >= data.length ? data.length - 1 : newIndex;
|
|
150
181
|
// return currentIndx;
|
|
151
182
|
// Look for the last index of the group
|
|
152
183
|
return lookForGroupIndex(currentIndx, 1);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (
|
|
156
|
-
const { scrollTop } =
|
|
184
|
+
}
|
|
185
|
+
function scrollHandler() {
|
|
186
|
+
if (containerRef.current && tableVirtualConfig) {
|
|
187
|
+
const { scrollTop } = containerRef.current;
|
|
157
188
|
const { numberOfVisibleRows, index } = tableVirtualConfig;
|
|
158
189
|
const currentIndx = Math.ceil(scrollTop / approxItemHeight);
|
|
159
190
|
const start = findStartIndex(currentIndx, numberOfVisibleRows);
|
|
@@ -165,7 +196,10 @@ function ReactTable(props) {
|
|
|
165
196
|
});
|
|
166
197
|
}
|
|
167
198
|
}
|
|
168
|
-
}
|
|
169
|
-
return ((0, jsx_runtime_1.jsx)(ReactTableContext_1.ReactTableProvider, { value: tableVirtualConfig, children: (0, jsx_runtime_1.jsx)(
|
|
199
|
+
}
|
|
200
|
+
return ((0, jsx_runtime_1.jsx)(ReactTableContext_1.ReactTableProvider, { value: tableVirtualConfig, children: (0, jsx_runtime_1.jsx)("div", { ref: mRef, style: {
|
|
201
|
+
position: 'relative',
|
|
202
|
+
height: '100%',
|
|
203
|
+
}, children: (0, jsx_runtime_1.jsx)(ReactTableInner, { onScroll: scrollHandler, ref: containerRef, ...{ ...props } }) }) }));
|
|
170
204
|
}
|
|
171
205
|
exports.default = (0, react_1.memo)(ReactTable);
|
|
@@ -5,12 +5,12 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_table_1 = require("react-table");
|
|
7
7
|
const Style_1 = require("./Style");
|
|
8
|
-
function ReactTableFlexLayout({ data, columns, onMouseDown = () => null, }) {
|
|
8
|
+
function ReactTableFlexLayout({ data, columns, onMouseDown = () => null, style = {}, }) {
|
|
9
9
|
const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } = (0, react_table_1.useTable)({
|
|
10
10
|
columns,
|
|
11
11
|
data,
|
|
12
12
|
}, react_table_1.useSortBy, react_table_1.useFlexLayout);
|
|
13
|
-
return ((0, jsx_runtime_1.jsxs)("table", { ...getTableProps(), css: Style_1.ReactTableStyle, style: { height: '100%' }, children: [(0, jsx_runtime_1.jsx)("thead", { children: headerGroups.map((headerGroup) => ((0, jsx_runtime_1.jsx)("tr", { ...headerGroup.getHeaderGroupProps(), children: headerGroup.headers.map((column) => ((0, jsx_runtime_1.jsxs)("th", { ...column.getHeaderProps(column.getSortByToggleProps()), children: [column.render('Header'), (0, jsx_runtime_1.jsx)("span", { children: column.isSorted ? (column.isSortedDesc ? ' ▼' : ' ▲') : '' })] }, column.getHeaderProps().key))) }, headerGroup.getHeaderGroupProps().key))) }), (0, jsx_runtime_1.jsx)("tbody", { ...getTableBodyProps(), style: { display: 'block', height: '100%', overflowY: 'auto' }, children: rows.map((row) => {
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("table", { ...getTableProps(), css: Style_1.ReactTableStyle, style: { height: '100%', ...style }, children: [(0, jsx_runtime_1.jsx)("thead", { children: headerGroups.map((headerGroup) => ((0, jsx_runtime_1.jsx)("tr", { ...headerGroup.getHeaderGroupProps(), children: headerGroup.headers.map((column) => ((0, jsx_runtime_1.jsxs)("th", { ...column.getHeaderProps(column.getSortByToggleProps()), children: [column.render('Header'), (0, jsx_runtime_1.jsx)("span", { children: column.isSorted ? (column.isSortedDesc ? ' ▼' : ' ▲') : '' })] }, column.getHeaderProps().key))) }, headerGroup.getHeaderGroupProps().key))) }), (0, jsx_runtime_1.jsx)("tbody", { ...getTableBodyProps(), style: { display: 'block', height: '100%', overflowY: 'auto' }, children: rows.map((row) => {
|
|
14
14
|
prepareRow(row);
|
|
15
15
|
return ((0, jsx_runtime_1.jsx)("tr", { ...row.getRowProps(), onMouseDown: onMouseDown, children: row.cells.map((cell) => {
|
|
16
16
|
return ((0, jsx_runtime_1.jsx)("td", { ...cell.getCellProps(), style: { ...cell.getCellProps().style, padding: '0px' }, children: cell.render('Cell') }, cell.getCellProps().key));
|
|
@@ -4,9 +4,9 @@ function addCustomColumn(array, options) {
|
|
|
4
4
|
const { index, Header = () => null, extraParams, accessor = null, Cell = null, sortType = 'basic', enableRowSpan = false, style = {}, id, } = options || {};
|
|
5
5
|
array.push({
|
|
6
6
|
index,
|
|
7
|
-
...
|
|
8
|
-
...
|
|
9
|
-
...
|
|
7
|
+
...(id && { id }),
|
|
8
|
+
...(accessor && { accessor }),
|
|
9
|
+
...(Cell && { Cell }),
|
|
10
10
|
Header,
|
|
11
11
|
sortType,
|
|
12
12
|
enableRowSpan,
|
|
@@ -7,13 +7,9 @@ function useRowSpan(hooks) {
|
|
|
7
7
|
exports.default = useRowSpan;
|
|
8
8
|
function reducer(instance) {
|
|
9
9
|
const { allColumns } = instance;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (enableRowSpan !== undefined && enableRowSpan !== false) {
|
|
14
|
-
rowSpanHeaders.push({ id, cellValue: null, cellIndex: 0 });
|
|
15
|
-
}
|
|
16
|
-
});
|
|
10
|
+
const rowSpanHeaders = allColumns
|
|
11
|
+
.filter(({ enableRowSpan }) => enableRowSpan !== undefined && enableRowSpan !== false)
|
|
12
|
+
.map(({ id }) => ({ id, cellValue: null, cellIndex: 0 }));
|
|
17
13
|
Object.assign(instance, {
|
|
18
14
|
rowSpanHeaders,
|
|
19
15
|
});
|
|
@@ -54,10 +54,10 @@ function Accordion({ children, defaultOpenIndex = 0 }) {
|
|
|
54
54
|
if (prevState.length > 0) {
|
|
55
55
|
return prevState.map((e, i) => !forcedOpenedElementsRef.current[i] ? i === defaultOpenIndex : e);
|
|
56
56
|
}
|
|
57
|
-
forcedOpenedElementsRef.current = Array(children.length)
|
|
57
|
+
forcedOpenedElementsRef.current = new Array(children.length)
|
|
58
58
|
.fill(false)
|
|
59
59
|
.map((e) => e);
|
|
60
|
-
return Array(children.length)
|
|
60
|
+
return new Array(children.length)
|
|
61
61
|
.fill(false)
|
|
62
62
|
.map((e, i) => (i === defaultOpenIndex ? true : e));
|
|
63
63
|
});
|
|
@@ -16,9 +16,7 @@ function useDraggable(props) {
|
|
|
16
16
|
const classes = e.target.getAttribute('class')?.split(' ') || [];
|
|
17
17
|
if ((dragHandleClassName && classes.includes(dragHandleClassName)) ||
|
|
18
18
|
!dragHandleClassName) {
|
|
19
|
-
const _parentElement = parentElement
|
|
20
|
-
? parentElement
|
|
21
|
-
: eventTarget?.parentElement;
|
|
19
|
+
const _parentElement = parentElement || eventTarget?.parentElement;
|
|
22
20
|
if (_parentElement) {
|
|
23
21
|
const parentBounding = _parentElement.getBoundingClientRect();
|
|
24
22
|
const currentBounding = eventTarget?.getBoundingClientRect();
|
|
@@ -19,6 +19,6 @@ function FormikCheckBox(props) {
|
|
|
19
19
|
onChange(e);
|
|
20
20
|
setFieldValue(name, reverse ? value : !value);
|
|
21
21
|
}, [name, onChange, reverse, setFieldValue, value]);
|
|
22
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: `${className} check-${value}`, style: style.container
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `${className} check-${value}`, style: style.container || {}, children: [label && ((0, jsx_runtime_1.jsx)("label", { htmlFor: name, className: "checkbox-label", style: style.label || {}, children: label })), (0, jsx_runtime_1.jsx)(CheckBox_1.default, { ...resProps, name: name, checked: value, onChange: changeHandler, style: style.checkbox || {} })] }));
|
|
23
23
|
}
|
|
24
24
|
exports.default = FormikCheckBox;
|
|
@@ -10,15 +10,12 @@ const get_1 = __importDefault(require("lodash/get"));
|
|
|
10
10
|
const react_1 = require("react");
|
|
11
11
|
const getColor_1 = require("../../../data/utilities/getColor");
|
|
12
12
|
function FormikColorPicker(props) {
|
|
13
|
-
const { onColorChange = () => null, name
|
|
14
|
-
const { values, setFieldValue
|
|
15
|
-
|
|
13
|
+
const { onColorChange = () => null, name } = props;
|
|
14
|
+
const { values, setFieldValue } = (0, formik_1.useFormikContext)();
|
|
15
|
+
function colorChangeHandler(color) {
|
|
16
16
|
setFieldValue(name, `${color.hex}${Math.round(color.rgb.a * 255).toString(16)}`, false);
|
|
17
17
|
onColorChange(color);
|
|
18
|
-
|
|
19
|
-
setTimeout(submitForm, 1);
|
|
20
|
-
}
|
|
21
|
-
}, [name, onColorChange, setFieldValue, submitForm, triggerSubmit]);
|
|
18
|
+
}
|
|
22
19
|
return ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.ColorPicker, { color: { hex: (0, get_1.default)(values, name, '#000') }, presetColors: getColor_1.COLORS, onChangeComplete: colorChangeHandler, style: { boxShadow: 'none' } }));
|
|
23
20
|
}
|
|
24
21
|
exports.default = (0, react_1.memo)(FormikColorPicker);
|
|
@@ -19,14 +19,14 @@ const styles = {
|
|
|
19
19
|
const getErrors = (errorObj) => {
|
|
20
20
|
const result = [];
|
|
21
21
|
function errorsIterators(obj) {
|
|
22
|
-
|
|
22
|
+
for (const key in obj) {
|
|
23
23
|
if (typeof obj[key] === 'object') {
|
|
24
24
|
errorsIterators(obj[key]);
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
27
|
result.push(obj[key]);
|
|
28
28
|
}
|
|
29
|
-
}
|
|
29
|
+
}
|
|
30
30
|
}
|
|
31
31
|
errorsIterators(errorObj);
|
|
32
32
|
return result;
|
|
@@ -4,7 +4,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
4
4
|
const formik_1 = require("formik");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const FormikForm = (0, react_1.forwardRef)((props, ref) => {
|
|
7
|
-
const { onSubmit = () => null, initialValues = {}, validationSchema = null, } = props;
|
|
8
|
-
return ((0, jsx_runtime_1.jsx)(formik_1.Formik, { innerRef: ref, initialValues: initialValues, onSubmit: onSubmit, validationSchema: validationSchema, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children:
|
|
7
|
+
const { onSubmit = () => null, initialValues = {}, validationSchema = null, children, } = props;
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(formik_1.Formik, { innerRef: ref, initialValues: initialValues, onSubmit: onSubmit, validationSchema: validationSchema, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }) }));
|
|
9
9
|
});
|
|
10
10
|
exports.default = FormikForm;
|
|
@@ -6,30 +6,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const formik_1 = require("formik");
|
|
8
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
|
-
const react_1 = require("react");
|
|
10
9
|
const Input_1 = __importDefault(require("../Input"));
|
|
10
|
+
function identity(value) {
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
11
13
|
function FormikInput(props) {
|
|
12
|
-
const { name, style = { label: {}, input: {} }, onChange = () => null, checkValue = () => true, type = 'text', className = '', value = null, format = () =>
|
|
13
|
-
const { values, handleChange,
|
|
14
|
-
|
|
14
|
+
const { name, style = { label: {}, input: {} }, onChange = () => null, checkValue = () => true, type = 'text', className = '', value = null, format = () => identity, checkErrorAfterInputTouched = true, ...resProps } = props;
|
|
15
|
+
const { values, handleChange, errors, touched } = (0, formik_1.useFormikContext)();
|
|
16
|
+
function changeHandler(e) {
|
|
15
17
|
onChange(e);
|
|
16
18
|
handleChange(e);
|
|
17
|
-
}
|
|
18
|
-
(0,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}, [name, setFieldValue, submitForm, triggerSubmit, value]);
|
|
26
|
-
const isInvalid = (0, react_1.useMemo)(() => {
|
|
27
|
-
if (checkErrorAfterInputTouched) {
|
|
28
|
-
return (0, get_1.default)(errors, name) && (0, get_1.default)(touched, name);
|
|
29
|
-
}
|
|
30
|
-
return (0, get_1.default)(errors, name);
|
|
31
|
-
}, [checkErrorAfterInputTouched, errors, name, touched]);
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(Input_1.default, { name: name, value: value ? value : (0, get_1.default)(values, name), onChange: changeHandler, type: type, style: {
|
|
19
|
+
}
|
|
20
|
+
let isInvalid = (0, get_1.default)(errors, name);
|
|
21
|
+
if (checkErrorAfterInputTouched) {
|
|
22
|
+
isInvalid = (0, get_1.default)(errors, name) && (0, get_1.default)(touched, name);
|
|
23
|
+
}
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(Input_1.default, { name: name, value: value || (0, get_1.default)(values, name), onChange: changeHandler, type: type, style: {
|
|
33
25
|
...style,
|
|
34
26
|
inputWrapper: {
|
|
35
27
|
...style.input,
|
|
@@ -5,22 +5,25 @@ const react_1 = require("react");
|
|
|
5
5
|
const FormikOnChange = (props) => {
|
|
6
6
|
const { onChange = () => null, enableValidation = true } = props;
|
|
7
7
|
const oldValuesRef = (0, react_1.useRef)({});
|
|
8
|
-
const { values, errors,
|
|
8
|
+
const { values, errors, setTouched, initialValues } = (0, formik_1.useFormikContext)();
|
|
9
9
|
(0, react_1.useEffect)(() => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const isNewValue = JSON.stringify(values) !== JSON.stringify(initialValues);
|
|
11
|
+
if (isNewValue) {
|
|
12
|
+
if (enableValidation) {
|
|
13
|
+
if (Object.keys(errors).length === 0 &&
|
|
14
|
+
JSON.stringify(oldValuesRef.current) !== JSON.stringify(values)) {
|
|
15
|
+
onChange(values);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
setTouched(errors);
|
|
19
|
+
}
|
|
14
20
|
}
|
|
15
21
|
else {
|
|
16
|
-
|
|
22
|
+
onChange(values);
|
|
17
23
|
}
|
|
18
24
|
}
|
|
19
|
-
else {
|
|
20
|
-
onChange(values);
|
|
21
|
-
}
|
|
22
25
|
oldValuesRef.current = values;
|
|
23
|
-
}, [values, enableValidation, errors, onChange,
|
|
26
|
+
}, [values, enableValidation, errors, onChange, setTouched, initialValues]);
|
|
24
27
|
return null;
|
|
25
28
|
};
|
|
26
29
|
exports.default = (0, react_1.memo)(FormikOnChange);
|
|
@@ -20,6 +20,6 @@ const FormikSelect = function FormikSelect(props) {
|
|
|
20
20
|
setFieldValue(name, value);
|
|
21
21
|
}
|
|
22
22
|
}, [name, setFieldValue, value]);
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(Select_1.default, { name: name, defaultValue: value
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(Select_1.default, { name: name, defaultValue: value || (0, get_1.default)(values, name), onChange: changeHandler, ...resProps }));
|
|
24
24
|
};
|
|
25
25
|
exports.default = FormikSelect;
|
|
@@ -5,19 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const formik_1 = require("formik");
|
|
8
|
+
const debounce_1 = __importDefault(require("lodash/debounce"));
|
|
8
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
10
|
const react_1 = require("react");
|
|
10
11
|
const react_slider_1 = __importDefault(require("react-slider"));
|
|
11
12
|
function FormikSlider(props) {
|
|
12
|
-
const {
|
|
13
|
-
const { values, setFieldValue
|
|
14
|
-
const
|
|
15
|
-
onAfterChange(value);
|
|
13
|
+
const { name, debounceTime = 0 } = props;
|
|
14
|
+
const { values, setFieldValue } = (0, formik_1.useFormikContext)();
|
|
15
|
+
const debounceOnChange = (0, react_1.useRef)((0, debounce_1.default)((value) => {
|
|
16
16
|
setFieldValue(name, value);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
}, [name, onAfterChange, setFieldValue, submitForm, triggerSubmit]);
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(react_slider_1.default, { className: "horizontal-slider", thumbClassName: "thumb", trackClassName: "track", defaultValue: (0, get_1.default)(values, name, [0, 100]), onAfterChange: changeHandler, renderThumb: (props, state) => ((0, jsx_runtime_1.jsx)("div", { ...props, children: (0, jsx_runtime_1.jsx)("span", { children: state.valueNow }) })), pearling: true, minDistance: 10, ...sliderProps }));
|
|
17
|
+
}, debounceTime)).current;
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(react_slider_1.default, { className: "horizontal-slider", thumbClassName: "thumb", trackClassName: "track", defaultValue: (0, get_1.default)(values, name, [0, 100]), onAfterChange: (value) => debounceOnChange(value), renderThumb: (props, state) => ((0, jsx_runtime_1.jsx)("div", { ...props, children: (0, jsx_runtime_1.jsx)("span", { children: state.valueNow }) })), pearling: true, minDistance: 10 }));
|
|
22
19
|
}
|
|
23
|
-
exports.default =
|
|
20
|
+
exports.default = FormikSlider;
|