nmrium 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/Chart1D.js +3 -2
- package/lib/component/1d/FooterBanner.js +1 -1
- package/lib/component/1d/Integral.d.ts +2 -1
- package/lib/component/1d/Integral.js +5 -12
- package/lib/component/1d/IntegralResizable.d.ts +2 -1
- package/lib/component/1d/IntegralResizable.js +10 -5
- package/lib/component/1d/IntegralsSeries.js +3 -3
- package/lib/component/1d/Line.d.ts +2 -2
- package/lib/component/1d/PeakAnnotation.js +5 -4
- package/lib/component/1d/database/DatabaseElements.d.ts +3 -0
- package/lib/component/1d/database/DatabaseElements.js +18 -0
- package/lib/component/1d/database/DatabaseSpectrum.d.ts +3 -0
- package/lib/component/1d/database/DatabaseSpectrum.js +58 -0
- package/lib/component/1d/{ResurrectedDatabaseRanges.d.ts → database/ResurrectedDatabaseRanges.d.ts} +0 -0
- package/lib/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
- package/lib/component/1d/jCouplingGraph/JGraph.js +4 -10
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +10 -5
- package/lib/component/1d/ranges/Range.d.ts +2 -1
- package/lib/component/1d/ranges/Range.js +17 -9
- package/lib/component/1d/ranges/Ranges.js +6 -3
- package/lib/component/1d/tool/XLabelPointer.js +1 -1
- package/lib/component/2d/Chart2D.js +2 -1
- package/lib/component/2d/Contours.js +4 -1
- package/lib/component/2d/FooterBanner.js +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +1 -1
- package/lib/component/2d/tools/slicing/HorizontalSliceChart.d.ts +2 -2
- package/lib/component/2d/tools/slicing/SliceScale.d.ts +1 -1
- package/lib/component/2d/tools/slicing/VerticalSliceChart.d.ts +2 -2
- package/lib/component/EventsTrackers/KeysListenerTracker.js +10 -4
- package/lib/component/NMRium.d.ts +5 -1
- package/lib/component/NMRium.js +6 -3
- package/lib/component/SplitPaneWrapper.d.ts +4 -0
- package/lib/component/SplitPaneWrapper.js +8 -0
- package/lib/component/context/GlobalContext.d.ts +3 -0
- package/lib/component/context/GlobalContext.js +1 -1
- package/lib/component/context/PreferencesContext.d.ts +15 -12
- package/lib/component/context/PreferencesContext.js +1 -1
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/ContextMenu.d.ts +8 -3
- package/lib/component/elements/EditableColumn.d.ts +3 -2
- package/lib/component/elements/EditableColumn.js +27 -20
- package/lib/component/elements/Input.d.ts +9 -1
- package/lib/component/elements/Input.js +18 -5
- package/lib/component/elements/Select.d.ts +1 -0
- package/lib/component/elements/Select.js +21 -15
- package/lib/component/elements/ToggleButton.d.ts +2 -1
- package/lib/component/elements/ToggleButton.js +2 -2
- package/lib/component/elements/draggble/SVGDraggable.d.ts +17 -0
- package/lib/component/elements/draggble/SVGDraggable.js +33 -0
- package/lib/component/elements/{resizer → draggble}/useDraggable.d.ts +9 -6
- package/lib/component/elements/draggble/useDraggable.js +70 -0
- package/lib/component/elements/formik/FormikColorPicker.d.ts +1 -0
- package/lib/component/elements/formik/FormikColorPicker.js +10 -7
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +5 -4
- package/lib/component/elements/formik/FormikColumnFormatField.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +1 -0
- package/lib/component/elements/formik/FormikInput.js +6 -3
- package/lib/component/elements/formik/FormikSlider.d.ts +1 -0
- package/lib/component/elements/formik/FormikSlider.js +6 -3
- package/lib/component/elements/popup/Alert/Provider.js +1 -1
- package/lib/component/elements/resizer/DivResizer.js +17 -62
- package/lib/component/elements/resizer/Resizer.d.ts +3 -1
- package/lib/component/elements/resizer/SVGResizer.js +24 -53
- package/lib/component/elements/resizer/useResizer.d.ts +11 -0
- package/lib/component/elements/resizer/useResizer.js +65 -0
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +3 -0
- package/lib/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +0 -9
- package/lib/component/hooks/usePanelPreferences.d.ts +7 -0
- package/lib/component/hooks/usePanelPreferences.js +54 -0
- package/lib/component/hooks/useXYReduce.d.ts +2 -2
- package/lib/component/loader/DefaultSpinnerComponent.d.ts +3 -1
- package/lib/component/loader/DefaultSpinnerComponent.js +2 -2
- package/lib/component/loader/SpinnerContext.d.ts +3 -3
- package/lib/component/loader/SpinnerContext.js +2 -2
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -4
- package/lib/component/modal/MoleculeStructureEditorModal.js +22 -1
- package/lib/component/modal/editRange/EditRangeModal.js +6 -5
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +2 -0
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +3 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +12 -9
- package/lib/component/modal/setting/DatabasesTabContent.d.ts +6 -0
- package/lib/component/modal/setting/DatabasesTabContent.js +75 -0
- package/lib/component/modal/setting/DisplayTabContent.js +11 -7
- package/lib/component/modal/setting/FormattingTabContent.js +5 -5
- package/lib/component/modal/setting/GeneralSettings.js +2 -1
- package/lib/component/modal/setting/settingsValidation.d.ts +48 -0
- package/lib/component/modal/setting/settingsValidation.js +33 -27
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +10 -5
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +0 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -5
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -11
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +26 -74
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +8 -0
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +38 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +12 -23
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +10 -2
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +12 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +11 -0
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -1
- package/lib/component/panels/Panels.js +2 -3
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +3 -3
- package/lib/component/panels/PeaksPanel/PeaksPreferences.d.ts +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +29 -82
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +18 -25
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts +2 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +15 -9
- package/lib/component/panels/RangesPanel/RangesPanel.js +4 -10
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +55 -66
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +11 -6
- package/lib/component/panels/RangesPanel/RangesTable.js +3 -7
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +5 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.js +3 -3
- package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts +2 -1
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.d.ts +2 -1
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +13 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +14 -0
- package/lib/component/panels/RangesPanel/TableColumns/format.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.d.ts +18 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.js +18 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +7 -68
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +7 -68
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +6 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +51 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +5 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
- package/lib/component/panels/ZonesPanel/ZonesPreferences.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +20 -84
- package/lib/component/panels/ZonesPanel/ZonesTable.js +4 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +5 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +2 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js +73 -40
- package/lib/component/panels/databasePanel/DatabasePreferences.js +10 -42
- package/lib/component/panels/databasePanel/DatabaseTable.js +23 -11
- package/lib/component/panels/databasePanel/useDatabases.d.ts +5 -0
- package/lib/component/panels/databasePanel/useDatabases.js +10 -0
- package/lib/component/panels/extra/placeholder/NoTableData.d.ts +3 -1
- package/lib/component/panels/extra/placeholder/NoTableData.js +2 -2
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +3 -3
- package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts +13 -0
- package/lib/component/panels/extra/preferences/NucleusPreferences.js +22 -0
- package/lib/component/panels/extra/preferences/PreferencesContainer.d.ts +6 -0
- package/lib/component/panels/extra/preferences/PreferencesContainer.js +10 -0
- package/lib/component/panels/extra/preferences/PreferencesGroup.d.ts +7 -0
- package/lib/component/panels/extra/preferences/PreferencesGroup.js +21 -0
- package/lib/component/reducer/Reducer.d.ts +358 -45
- package/lib/component/reducer/Reducer.js +5 -1
- package/lib/component/reducer/actions/LoadActions.js +2 -2
- package/lib/component/reducer/actions/MoleculeActions.d.ts +4 -2
- package/lib/component/reducer/actions/MoleculeActions.js +15 -3
- package/lib/component/reducer/actions/PreferencesActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +1 -1
- package/lib/component/reducer/preferences/actions/addWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/addWorkspace.js +19 -0
- package/lib/component/reducer/preferences/actions/initPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/initPreferences.js +60 -0
- package/lib/component/reducer/preferences/actions/removeWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +20 -0
- package/lib/component/reducer/preferences/actions/resetPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/resetPreferences.js +14 -0
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +13 -0
- package/lib/component/reducer/preferences/actions/setPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setPreferences.js +34 -0
- package/lib/component/reducer/preferences/actions/setWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setWorkspace.js +8 -0
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +7 -0
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +55 -0
- package/lib/component/reducer/{preferencesReducer.d.ts → preferences/preferencesReducer.d.ts} +131 -7
- package/lib/component/reducer/preferences/preferencesReducer.js +80 -0
- package/lib/component/reducer/preferences/utilites/checkKeysExists.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/checkKeysExists.js +14 -0
- package/lib/component/reducer/preferences/utilites/filterObject.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/filterObject.js +7 -0
- package/lib/component/reducer/preferences/utilites/flatObject.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/flatObject.js +9 -0
- package/lib/component/reducer/preferences/utilites/getActiveWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/utilites/getActiveWorkspace.js +3 -0
- package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.d.ts +2 -0
- package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +4 -0
- package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.d.ts +5 -0
- package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.js +8 -0
- package/lib/component/reducer/types/Types.d.ts +2 -0
- package/lib/component/reducer/types/Types.js +2 -0
- package/lib/component/tool/FloatMoleculeStructures/ActionsButton.d.ts +4 -0
- package/lib/component/tool/FloatMoleculeStructures/ActionsButton.js +7 -0
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +14 -0
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +43 -0
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +15 -0
- package/lib/component/tool/FloatMoleculeStructures/index.js +28 -0
- package/lib/component/utility/Export.js +6 -0
- package/lib/component/utility/PathBuilder.js +2 -1
- package/lib/component/utility/formatNumber.d.ts +3 -0
- package/lib/component/utility/formatNumber.js +10 -0
- package/lib/component/utility/getUniqueNuclei.d.ts +1 -0
- package/lib/component/utility/getUniqueNuclei.js +10 -0
- package/lib/component/workspaces/Workspace.d.ts +72 -1
- package/lib/component/workspaces/basic.js +9 -1
- package/lib/component/workspaces/embedded.d.ts +2 -0
- package/lib/component/workspaces/embedded.js +32 -0
- package/lib/component/workspaces/exercise.js +2 -0
- package/lib/component/workspaces/index.d.ts +1 -0
- package/lib/component/workspaces/index.js +2 -1
- package/lib/component/workspaces/prediction.js +2 -0
- package/lib/component/workspaces/process1D.js +2 -0
- package/lib/data/data1d/Data1DManager.js +4 -0
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.js +10 -0
- package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
- package/lib/data/data1d/database.d.ts +8 -13
- package/lib/data/data1d/database.js +14 -19
- package/lib/data/data1d/filter1d/absolute.d.ts +3 -2
- package/lib/data/data1d/filter1d/autoPhaseCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/centerMean.d.ts +3 -2
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +3 -2
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +3 -2
- package/lib/data/data1d/filter1d/exclusionZones.js +4 -4
- package/lib/data/data1d/filter1d/fft.d.ts +3 -2
- package/lib/data/data1d/filter1d/fft.js +2 -2
- package/lib/data/data1d/filter1d/fromTo.d.ts +3 -2
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +3 -2
- package/lib/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib/data/data1d/filter1d/pareto.d.ts +3 -2
- package/lib/data/data1d/filter1d/pareto.js +2 -2
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/shiftX.d.ts +2 -1
- package/lib/data/data1d/filter1d/standardDeviation.d.ts +3 -2
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +3 -2
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Data2DManager.js +4 -0
- package/lib/data/data2d/filter2d/shiftX.d.ts +4 -3
- package/lib/data/data2d/filter2d/shiftX.js +2 -2
- package/lib/data/data2d/filter2d/shiftY.d.ts +4 -3
- package/lib/data/data2d/filter2d/shiftY.js +2 -2
- package/lib/data/molecules/Molecule.d.ts +3 -3
- package/lib/data/molecules/Molecule.js +7 -1
- package/lib/data/molecules/MoleculeManager.d.ts +4 -1
- package/lib/data/molecules/MoleculeManager.js +33 -2
- package/lib/data/types/data1d/Data1D.d.ts +3 -3
- package/lib/data/types/data1d/Info1D.d.ts +1 -0
- package/lib/data/types/data2d/Signal2DAxisData.d.ts +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +3 -2
- package/lib-cjs/component/1d/FooterBanner.js +2 -2
- package/lib-cjs/component/1d/Integral.js +5 -12
- package/lib-cjs/component/1d/IntegralResizable.js +10 -5
- package/lib-cjs/component/1d/IntegralsSeries.js +3 -3
- package/lib-cjs/component/1d/PeakAnnotation.js +5 -4
- package/lib-cjs/component/1d/database/DatabaseElements.js +23 -0
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +60 -0
- package/lib-cjs/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
- package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +4 -10
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +10 -5
- package/lib-cjs/component/1d/ranges/Range.js +17 -9
- package/lib-cjs/component/1d/ranges/Ranges.js +6 -3
- package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
- package/lib-cjs/component/2d/Chart2D.js +2 -1
- package/lib-cjs/component/2d/Contours.js +4 -1
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +10 -4
- package/lib-cjs/component/NMRium.js +5 -2
- package/lib-cjs/component/SplitPaneWrapper.js +12 -0
- package/lib-cjs/component/context/GlobalContext.js +1 -1
- package/lib-cjs/component/context/PreferencesContext.js +1 -1
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +27 -20
- package/lib-cjs/component/elements/Input.js +18 -5
- package/lib-cjs/component/elements/Select.js +20 -14
- package/lib-cjs/component/elements/ToggleButton.js +2 -2
- package/lib-cjs/component/elements/draggble/SVGDraggable.js +39 -0
- package/lib-cjs/component/elements/draggble/useDraggable.js +73 -0
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +10 -7
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +6 -3
- package/lib-cjs/component/elements/formik/FormikSlider.js +6 -3
- package/lib-cjs/component/elements/popup/Alert/Provider.js +1 -1
- package/lib-cjs/component/elements/resizer/DivResizer.js +17 -62
- package/lib-cjs/component/elements/resizer/SVGResizer.js +24 -53
- package/lib-cjs/component/elements/resizer/useResizer.js +71 -0
- package/lib-cjs/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +1 -11
- package/lib-cjs/component/hooks/usePanelPreferences.js +62 -0
- package/lib-cjs/component/loader/DefaultSpinnerComponent.js +2 -2
- package/lib-cjs/component/loader/SpinnerContext.js +2 -2
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +6 -5
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +12 -9
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +80 -0
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +11 -7
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +4 -4
- package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +33 -27
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +10 -5
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +2 -5
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -11
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +24 -72
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +44 -0
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -23
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +9 -1
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +11 -0
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/Panels.js +2 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -4
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +27 -80
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +18 -48
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +15 -9
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +4 -10
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +53 -64
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +3 -7
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +16 -0
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/PlotChart.js +21 -0
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +10 -68
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +10 -68
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +55 -0
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +18 -82
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +4 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +2 -2
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +72 -39
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +10 -42
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +22 -10
- package/lib-cjs/component/panels/databasePanel/useDatabases.js +14 -0
- package/lib-cjs/component/panels/extra/placeholder/NoTableData.js +2 -2
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +3 -3
- package/lib-cjs/component/panels/extra/preferences/NucleusPreferences.js +29 -0
- package/lib-cjs/component/panels/extra/preferences/PreferencesContainer.js +14 -0
- package/lib-cjs/component/panels/extra/preferences/PreferencesGroup.js +25 -0
- package/lib-cjs/component/reducer/Reducer.js +5 -1
- package/lib-cjs/component/reducer/actions/LoadActions.js +2 -2
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +17 -3
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +1 -1
- package/lib-cjs/component/reducer/actions/ToolsActions.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +26 -0
- package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +67 -0
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +24 -0
- package/lib-cjs/component/reducer/preferences/actions/resetPreferences.js +18 -0
- package/lib-cjs/component/reducer/preferences/actions/setPanelsPreferences.js +17 -0
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +38 -0
- package/lib-cjs/component/reducer/preferences/actions/setWorkspace.js +12 -0
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +62 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +87 -0
- package/lib-cjs/component/reducer/preferences/utilites/checkKeysExists.js +18 -0
- package/lib-cjs/component/reducer/preferences/utilites/filterObject.js +11 -0
- package/lib-cjs/component/reducer/preferences/utilites/flatObject.js +13 -0
- package/lib-cjs/component/reducer/preferences/utilites/getActiveWorkspace.js +7 -0
- package/lib-cjs/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +11 -0
- package/lib-cjs/component/reducer/preferences/utilites/mapNucleiFormatting.js +12 -0
- package/lib-cjs/component/reducer/types/Types.js +5 -3
- package/lib-cjs/component/tool/FloatMoleculeStructures/ActionsButton.js +13 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +50 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +36 -0
- package/lib-cjs/component/utility/Export.js +6 -0
- package/lib-cjs/component/utility/PathBuilder.js +2 -1
- package/lib-cjs/component/utility/formatNumber.js +17 -0
- package/lib-cjs/component/utility/getUniqueNuclei.js +14 -0
- package/lib-cjs/component/workspaces/basic.js +9 -1
- package/lib-cjs/component/workspaces/embedded.js +35 -0
- package/lib-cjs/component/workspaces/exercise.js +2 -0
- package/lib-cjs/component/workspaces/index.js +2 -1
- package/lib-cjs/component/workspaces/prediction.js +2 -0
- package/lib-cjs/component/workspaces/process1D.js +2 -0
- package/lib-cjs/data/data1d/Data1DManager.js +4 -0
- package/lib-cjs/data/data1d/Spectrum1D/convertDataToFloat64Array.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
- package/lib-cjs/data/data1d/database.js +15 -21
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +4 -4
- package/lib-cjs/data/data1d/filter1d/fft.js +2 -2
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib-cjs/data/data1d/filter1d/pareto.js +2 -2
- package/lib-cjs/data/data1d/filter1d/shiftX.js +2 -2
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Data2DManager.js +4 -0
- package/lib-cjs/data/data2d/filter2d/shiftX.js +4 -4
- package/lib-cjs/data/data2d/filter2d/shiftY.js +4 -4
- package/lib-cjs/data/molecules/Molecule.js +7 -1
- package/lib-cjs/data/molecules/MoleculeManager.js +37 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +42 -40
- package/lib/component/elements/resizer/useDraggable.js +0 -52
- package/lib/component/panels/extra/preferences/defaultValues.d.ts +0 -54
- package/lib/component/panels/extra/preferences/defaultValues.js +0 -54
- package/lib/component/reducer/preferencesReducer.js +0 -269
- package/lib/component/utility/FormatNumber.d.ts +0 -6
- package/lib-cjs/component/elements/resizer/useDraggable.js +0 -55
- package/lib-cjs/component/panels/extra/preferences/defaultValues.js +0 -61
- package/lib-cjs/component/reducer/preferencesReducer.js +0 -276
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const Input_1 = __importDefault(require("./Input"));
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const { onSave = () => null, value, type = 'text', style, onEditStart = () => null, editStatus = false, } = props;
|
|
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;
|
|
12
11
|
const [enabled, enableEdit] = (0, react_1.useState)();
|
|
12
|
+
const [isValid, setValid] = (0, react_1.useState)(true);
|
|
13
13
|
(0, react_1.useEffect)(() => {
|
|
14
14
|
enableEdit(editStatus);
|
|
15
15
|
}, [editStatus]);
|
|
@@ -27,25 +27,32 @@ function EditableColumn(props, ref) {
|
|
|
27
27
|
window.removeEventListener('mousedown', mouseClickCallback);
|
|
28
28
|
}
|
|
29
29
|
}, []);
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const startEditHandler = (0, react_1.useCallback)(() => {
|
|
31
|
+
window.addEventListener('mousedown', mouseClickCallback);
|
|
32
|
+
onEditStart(true);
|
|
33
|
+
enableEdit(true);
|
|
34
|
+
}, [mouseClickCallback, onEditStart]);
|
|
35
|
+
const editHandler = (0, react_1.useCallback)((event) => {
|
|
36
|
+
const valid = validate(event?.target.value);
|
|
37
|
+
setValid(valid);
|
|
38
|
+
// when press Enter or Tab
|
|
39
|
+
if (valid) {
|
|
33
40
|
if (['Enter', 'Tab'].includes(event.key)) {
|
|
34
41
|
onSave(event);
|
|
35
|
-
|
|
36
|
-
// close edit mode if press Enter, Tab or Escape
|
|
37
|
-
if (['Enter', 'Tab', 'Escape'].includes(event.key)) {
|
|
38
|
-
enableEdit(flag);
|
|
39
|
-
window.removeEventListener('mousedown', mouseClickCallback);
|
|
42
|
+
enableEdit(false);
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
enableEdit(flag);
|
|
45
|
+
// close edit mode if press Enter, Tab or Escape
|
|
46
|
+
if (['Escape'].includes(event.key)) {
|
|
47
|
+
enableEdit(false);
|
|
48
|
+
window.removeEventListener('mousedown', mouseClickCallback);
|
|
47
49
|
}
|
|
48
|
-
}, [mouseClickCallback,
|
|
49
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'table', width: '100%', height: '100%', ...style }, onDoubleClick:
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
}, [mouseClickCallback, onSave, validate]);
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'table', width: '100%', height: '100%', ...style }, onDoubleClick: startEditHandler, children: [!enabled && ((0, jsx_runtime_1.jsx)("span", { style: { display: 'table-cell', verticalAlign: 'middle' }, 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
|
+
inputWrapper: {
|
|
53
|
+
width: '100%',
|
|
54
|
+
...(!isValid && { borderColor: 'red' }),
|
|
55
|
+
},
|
|
56
|
+
}, enableAutoSelect: true, className: "editable-column", value: value, type: type, onKeyUp: editHandler }) }))] }));
|
|
57
|
+
});
|
|
58
|
+
exports.default = EditableColumn;
|
|
@@ -44,8 +44,9 @@ const styles = {
|
|
|
44
44
|
const Input = (0, react_1.forwardRef)(({ value = '', name, style = {
|
|
45
45
|
input: {},
|
|
46
46
|
inputWrapper: {},
|
|
47
|
-
}, onChange = () => null, debounceTime = 0, onKeyDown = () => null, checkValue = () => true, type = 'text', enableAutoSelect = false, className, format = () => (value) => value, onBlur = () => null, onFocus = () => null, renderIcon = null, canClear = false, onClear, ...props }, ref) => {
|
|
47
|
+
}, onChange = () => null, debounceTime = 0, onKeyDown = () => null, onKeyUp = () => null, checkValue = () => true, type = 'text', enableAutoSelect = false, className, format = () => (value) => value, onBlur = () => null, onFocus = () => null, renderIcon = null, canClear = false, onClear, ...props }, ref) => {
|
|
48
48
|
const [val, setVal] = (0, react_1.useState)(value);
|
|
49
|
+
const valueRef = (0, react_1.useRef)(value);
|
|
49
50
|
const localRef = (0, react_1.useRef)();
|
|
50
51
|
const combinedRef = (0, useCombinedRefs_1.default)([ref, localRef]);
|
|
51
52
|
const debounceOnChange = (0, react_1.useRef)((0, debounce_1.default)((value) => {
|
|
@@ -85,6 +86,7 @@ const Input = (0, react_1.forwardRef)(({ value = '', name, style = {
|
|
|
85
86
|
if (check(_value) && checkValue(_value)) {
|
|
86
87
|
const formatValue = format();
|
|
87
88
|
setVal(formatValue(_value));
|
|
89
|
+
valueRef.current = _value;
|
|
88
90
|
const val = {
|
|
89
91
|
...e,
|
|
90
92
|
target: { name: e.target.name, value: getValue(_value) },
|
|
@@ -106,12 +108,23 @@ const Input = (0, react_1.forwardRef)(({ value = '', name, style = {
|
|
|
106
108
|
type,
|
|
107
109
|
]);
|
|
108
110
|
const handleKeyDown = (0, react_1.useCallback)((event) => {
|
|
109
|
-
event.persist();
|
|
110
111
|
onKeyDown({
|
|
111
112
|
...event,
|
|
112
|
-
target: {
|
|
113
|
+
target: {
|
|
114
|
+
name: event.target.name,
|
|
115
|
+
value: getValue(valueRef.current),
|
|
116
|
+
},
|
|
113
117
|
});
|
|
114
|
-
}, [getValue, onKeyDown
|
|
118
|
+
}, [getValue, onKeyDown]);
|
|
119
|
+
const handleKeyUp = (0, react_1.useCallback)((event) => {
|
|
120
|
+
onKeyUp({
|
|
121
|
+
...event,
|
|
122
|
+
target: {
|
|
123
|
+
name: event.target.name,
|
|
124
|
+
value: getValue(valueRef.current),
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
}, [getValue, onKeyUp]);
|
|
115
128
|
const preventPropagate = (0, react_1.useCallback)((event) => {
|
|
116
129
|
event.stopPropagation();
|
|
117
130
|
}, []);
|
|
@@ -125,6 +138,6 @@ const Input = (0, react_1.forwardRef)(({ value = '', name, style = {
|
|
|
125
138
|
}, className: `input ${className || ''}`, children: [renderIcon?.(), (0, jsx_runtime_1.jsx)("input", { ...props, ref: combinedRef, name: name, style: {
|
|
126
139
|
...styles.input,
|
|
127
140
|
...(style?.input ? style.input : {}),
|
|
128
|
-
}, "data-test-id": name ? `input-${name}` : '', type: "text", value: val, onChange: onChangeHandler, onKeyDown: handleKeyDown, 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" }) }))] }));
|
|
141
|
+
}, "data-test-id": name ? `input-${name}` : '', 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" }) }))] }));
|
|
129
142
|
});
|
|
130
143
|
exports.default = Input;
|
|
@@ -5,20 +5,12 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("@emotion/react");
|
|
6
6
|
const react_2 = require("react");
|
|
7
7
|
const arrowDownIcon = `url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="960px" height="560px" viewBox="0 0 960 560" enable-background="new 0 0 960 560" xml:space="preserve"><g id="Rounded_Rectangle_33_copy_4_1_"><path d="M480,344.181L268.869,131.889c-15.756-15.859-41.3-15.859-57.054,0c-15.754,15.857-15.754,41.57,0,57.431l237.632,238.937c8.395,8.451,19.562,12.254,30.553,11.698c10.993,0.556,22.159-3.247,30.555-11.698l237.631-238.937c15.756-15.86,15.756-41.571,0-57.431s-41.299-15.859-57.051,0L480,344.181z"/></g></svg>')`;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const handleOnChanged = (0, react_2.useCallback)((e) => {
|
|
11
|
-
let value = e.target.value;
|
|
12
|
-
if (!isNaN(value)) {
|
|
13
|
-
value = Number(value);
|
|
14
|
-
}
|
|
15
|
-
onChange(value);
|
|
16
|
-
}, [onChange]);
|
|
17
|
-
const styles = (0, react_1.css) `
|
|
8
|
+
const styles = {
|
|
9
|
+
select: (width) => (0, react_1.css) `
|
|
18
10
|
padding: 0px 5px;
|
|
19
11
|
border: 0.55px solid #cacaca;
|
|
20
12
|
font-size: 14px;
|
|
21
|
-
width: ${
|
|
13
|
+
width: ${width ? Number(width) - 5 : 115}px;
|
|
22
14
|
margin: 0;
|
|
23
15
|
height: 100%;
|
|
24
16
|
background: ${arrowDownIcon} no-repeat right white;
|
|
@@ -28,11 +20,25 @@ const Select = (0, react_2.forwardRef)(function Select(props, ref) {
|
|
|
28
20
|
border-radius: 5px;
|
|
29
21
|
margin: 0px 5px;
|
|
30
22
|
align-self: center;
|
|
31
|
-
|
|
23
|
+
&:focus,
|
|
32
24
|
input:focus {
|
|
33
25
|
outline: none;
|
|
34
26
|
}
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
|
|
28
|
+
&:required:invalid {
|
|
29
|
+
color: #666;
|
|
30
|
+
}
|
|
31
|
+
`,
|
|
32
|
+
};
|
|
33
|
+
const Select = (0, react_2.forwardRef)(function Select(props, ref) {
|
|
34
|
+
const { data, style = { width: 100 }, onChange = () => null, defaultValue = '', name = '', className = '', placeholder = '', } = props;
|
|
35
|
+
const handleOnChanged = (0, react_2.useCallback)((e) => {
|
|
36
|
+
let value = e.target.value;
|
|
37
|
+
if (!isNaN(value)) {
|
|
38
|
+
value = Number(value);
|
|
39
|
+
}
|
|
40
|
+
onChange(value);
|
|
41
|
+
}, [onChange]);
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)("select", { ref: ref, css: styles.select(style?.width), name: name, onChange: handleOnChanged, defaultValue: defaultValue, className: className, style: style, required: true, children: [placeholder && ((0, jsx_runtime_1.jsx)("option", { value: "", disabled: true, children: placeholder })), data.map((d) => ((0, jsx_runtime_1.jsx)("option", { value: d.value, children: d.label }, `${d.key}`)))] }));
|
|
37
43
|
});
|
|
38
44
|
exports.default = Select;
|
|
@@ -23,12 +23,12 @@ const styles = (0, react_1.css) `
|
|
|
23
23
|
color: white;
|
|
24
24
|
}
|
|
25
25
|
`;
|
|
26
|
-
function ToggleButton({ children, style = {}, onClick = () => null, popupTitle = '', popupPlacement = 'right', defaultValue = false, disabled = false, className = '', }) {
|
|
26
|
+
function ToggleButton({ children, style = {}, onClick = () => null, popupTitle = '', popupPlacement = 'right', defaultValue = false, disabled = false, className = '', testID, }) {
|
|
27
27
|
const [flag, Toggle] = (0, react_2.useState)(defaultValue);
|
|
28
28
|
const toggleHandler = (0, react_2.useCallback)(() => {
|
|
29
29
|
onClick(!flag);
|
|
30
30
|
Toggle(!flag);
|
|
31
31
|
}, [onClick, flag]);
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: popupTitle, popupPlacement: popupPlacement, children: (0, jsx_runtime_1.jsx)("button", { disabled: disabled, css: styles, style: style, className: (flag ? 'toggle toggle-active ' : 'toggle ') + className, type: "button", onClick: toggleHandler, children: children }) }));
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: popupTitle, popupPlacement: popupPlacement, children: (0, jsx_runtime_1.jsx)("button", { "data-test-id": testID, disabled: disabled, css: styles, style: style, className: (flag ? 'toggle toggle-active ' : 'toggle ') + className, type: "button", onClick: toggleHandler, children: children }) }));
|
|
33
33
|
}
|
|
34
34
|
exports.default = (0, react_2.memo)(ToggleButton);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const useDraggable_1 = __importDefault(require("./useDraggable"));
|
|
9
|
+
function SVGDraggable(props) {
|
|
10
|
+
const { children, initialPosition = { x: 0, y: 0 }, width, height, onStart, onMove, onEnd, parentElement, dragHandleClassName, } = props;
|
|
11
|
+
const { position: { value: { x, y }, action, }, onMouseDown, } = (0, useDraggable_1.default)({
|
|
12
|
+
position: initialPosition,
|
|
13
|
+
parentElement,
|
|
14
|
+
dragHandleClassName,
|
|
15
|
+
});
|
|
16
|
+
(0, react_1.useEffect)(() => {
|
|
17
|
+
const position = {
|
|
18
|
+
x,
|
|
19
|
+
y,
|
|
20
|
+
};
|
|
21
|
+
switch (action) {
|
|
22
|
+
case 'start':
|
|
23
|
+
onStart?.(position);
|
|
24
|
+
break;
|
|
25
|
+
case 'move':
|
|
26
|
+
onMove?.(position);
|
|
27
|
+
break;
|
|
28
|
+
case 'end':
|
|
29
|
+
onEnd?.(position);
|
|
30
|
+
break;
|
|
31
|
+
default:
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}, [action, onEnd, onMove, onStart, x, y]);
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)("g", { style: {
|
|
36
|
+
transform: `translate(${x}px,${y}px)`,
|
|
37
|
+
}, onMouseDown: onMouseDown, children: typeof children === 'function' ? children(width, height) : children }));
|
|
38
|
+
}
|
|
39
|
+
exports.default = SVGDraggable;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
function useDraggable(props) {
|
|
5
|
+
const { position: { x, y }, parentElement, fromEdge = false, dragHandleClassName, } = props;
|
|
6
|
+
const isActive = (0, react_1.useRef)(false);
|
|
7
|
+
const positionRef = (0, react_1.useRef)({ x, y });
|
|
8
|
+
const [position, setPosition] = (0, react_1.useState)({
|
|
9
|
+
value: { x, y },
|
|
10
|
+
action: null,
|
|
11
|
+
});
|
|
12
|
+
const onMouseDown = (0, react_1.useCallback)((e) => {
|
|
13
|
+
e.stopPropagation();
|
|
14
|
+
isActive.current = true;
|
|
15
|
+
const eventTarget = e.currentTarget;
|
|
16
|
+
const classes = e.target.getAttribute('class')?.split(' ') || [];
|
|
17
|
+
if ((dragHandleClassName && classes.includes(dragHandleClassName)) ||
|
|
18
|
+
!dragHandleClassName) {
|
|
19
|
+
const _parentElement = parentElement
|
|
20
|
+
? parentElement
|
|
21
|
+
: eventTarget?.parentElement;
|
|
22
|
+
if (_parentElement) {
|
|
23
|
+
const parentBounding = _parentElement.getBoundingClientRect();
|
|
24
|
+
const currentBounding = eventTarget?.getBoundingClientRect();
|
|
25
|
+
const startPosition = {
|
|
26
|
+
x: parentBounding.x +
|
|
27
|
+
(!fromEdge ? e.clientX - currentBounding.x : 0),
|
|
28
|
+
y: parentBounding.y +
|
|
29
|
+
(!fromEdge ? e.clientY - currentBounding.y : 0),
|
|
30
|
+
};
|
|
31
|
+
if (parentBounding) {
|
|
32
|
+
positionRef.current = startPosition;
|
|
33
|
+
}
|
|
34
|
+
setPosition((prevPortion) => ({ ...prevPortion, action: 'start' }));
|
|
35
|
+
}
|
|
36
|
+
window.addEventListener('mousemove', onMouseMove);
|
|
37
|
+
window.addEventListener('mouseup', onMouseUp);
|
|
38
|
+
}
|
|
39
|
+
function onMouseUp(e) {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
if (isActive.current) {
|
|
42
|
+
setPosition({
|
|
43
|
+
value: {
|
|
44
|
+
x: e.clientX - positionRef.current.x,
|
|
45
|
+
y: e.clientY - positionRef.current.y,
|
|
46
|
+
},
|
|
47
|
+
action: 'end',
|
|
48
|
+
});
|
|
49
|
+
isActive.current = false;
|
|
50
|
+
}
|
|
51
|
+
window.removeEventListener('mousemove', onMouseMove);
|
|
52
|
+
window.removeEventListener('mouseup', onMouseUp);
|
|
53
|
+
}
|
|
54
|
+
function onMouseMove(e) {
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
if (isActive.current) {
|
|
57
|
+
setPosition({
|
|
58
|
+
value: {
|
|
59
|
+
x: e.clientX - positionRef.current.x,
|
|
60
|
+
y: e.clientY - positionRef.current.y,
|
|
61
|
+
},
|
|
62
|
+
action: 'move',
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}, [dragHandleClassName, fromEdge, parentElement]);
|
|
67
|
+
return (0, react_1.useMemo)(() => ({
|
|
68
|
+
onMouseDown,
|
|
69
|
+
position,
|
|
70
|
+
isActive: isActive.current,
|
|
71
|
+
}), [onMouseDown, position]);
|
|
72
|
+
}
|
|
73
|
+
exports.default = useDraggable;
|
|
@@ -4,18 +4,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const analysis_ui_components_1 = require("analysis-ui-components");
|
|
7
8
|
const formik_1 = require("formik");
|
|
8
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
10
|
const react_1 = require("react");
|
|
10
|
-
const react_color_1 = require("react-color");
|
|
11
11
|
const getColor_1 = require("../../../data/utilities/getColor");
|
|
12
12
|
function FormikColorPicker(props) {
|
|
13
|
-
const { onColorChange = () => null, name } = props;
|
|
14
|
-
const { values, setFieldValue } = (0, formik_1.useFormikContext)();
|
|
15
|
-
const
|
|
13
|
+
const { onColorChange = () => null, name, triggerSubmit = false } = props;
|
|
14
|
+
const { values, setFieldValue, submitForm } = (0, formik_1.useFormikContext)();
|
|
15
|
+
const colorChangeHandler = (0, react_1.useCallback)((color) => {
|
|
16
|
+
setFieldValue(name, `${color.hex}${Math.round(color.rgb.a * 255).toString(16)}`, false);
|
|
16
17
|
onColorChange(color);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
if (triggerSubmit) {
|
|
19
|
+
setTimeout(submitForm, 1);
|
|
20
|
+
}
|
|
21
|
+
}, [name, onColorChange, setFieldValue, submitForm, triggerSubmit]);
|
|
22
|
+
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' } }));
|
|
20
23
|
}
|
|
21
24
|
exports.default = (0, react_1.memo)(FormikColorPicker);
|
|
@@ -26,7 +26,7 @@ const styles = {
|
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
28
|
function FormikColumnFormatField(props) {
|
|
29
|
-
const { label, checkControllerName, formatControllerName, disableFormat = false,
|
|
29
|
+
const { label, checkControllerName, formatControllerName, disableFormat = false, hideFormatField = false, hideCheckField = false, } = props;
|
|
30
30
|
const { values, handleChange, setFieldValue } = (0, formik_1.useFormikContext)();
|
|
31
31
|
const changeHandler = (0, react_1.useCallback)((e) => {
|
|
32
32
|
handleChange(e);
|
|
@@ -39,6 +39,6 @@ function FormikColumnFormatField(props) {
|
|
|
39
39
|
display: 'flex',
|
|
40
40
|
flexDirection: 'row',
|
|
41
41
|
alignItems: 'center',
|
|
42
|
-
}, children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", style: { margin: '0px 5px' }, name: checkControllerName, onChange: checkChangeHandler, checked: (0, get_1.default)(values, checkControllerName, false) }), !
|
|
42
|
+
}, children: [!hideCheckField && checkControllerName && ((0, jsx_runtime_1.jsx)("input", { type: "checkbox", style: { margin: '0px 5px' }, name: checkControllerName, onChange: checkChangeHandler, checked: (0, get_1.default)(values, checkControllerName, false) })), !hideFormatField && formatControllerName && ((0, jsx_runtime_1.jsx)(Input_1.default, { style: { inputWrapper: styles.input }, name: formatControllerName, value: (0, get_1.default)(values, formatControllerName, ''), onChange: changeHandler, type: "text", disabled: disableFormat }))] })] }));
|
|
43
43
|
}
|
|
44
44
|
exports.default = (0, react_1.memo)(FormikColumnFormatField);
|
|
@@ -9,8 +9,8 @@ const get_1 = __importDefault(require("lodash/get"));
|
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const Input_1 = __importDefault(require("../Input"));
|
|
11
11
|
function FormikInput(props) {
|
|
12
|
-
const { name, style = { label: {}, input: {} }, onChange = () => null, checkValue = () => true, type = 'text', className = '', value = null, format = () => (value) => value, checkErrorAfterInputTouched = true, ...resProps } = props;
|
|
13
|
-
const { values, handleChange, setFieldValue, errors, touched } = (0, formik_1.useFormikContext)();
|
|
12
|
+
const { name, style = { label: {}, input: {} }, onChange = () => null, checkValue = () => true, type = 'text', className = '', value = null, format = () => (value) => value, checkErrorAfterInputTouched = true, triggerSubmit = false, ...resProps } = props;
|
|
13
|
+
const { values, handleChange, setFieldValue, errors, touched, submitForm } = (0, formik_1.useFormikContext)();
|
|
14
14
|
const changeHandler = (0, react_1.useCallback)((e) => {
|
|
15
15
|
onChange(e);
|
|
16
16
|
handleChange(e);
|
|
@@ -18,8 +18,11 @@ function FormikInput(props) {
|
|
|
18
18
|
(0, react_1.useEffect)(() => {
|
|
19
19
|
if (value) {
|
|
20
20
|
setFieldValue(name, value);
|
|
21
|
+
if (triggerSubmit) {
|
|
22
|
+
setTimeout(submitForm, 1);
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
|
-
}, [name, setFieldValue, value]);
|
|
25
|
+
}, [name, setFieldValue, submitForm, triggerSubmit, value]);
|
|
23
26
|
const isInvalid = (0, react_1.useMemo)(() => {
|
|
24
27
|
if (checkErrorAfterInputTouched) {
|
|
25
28
|
return (0, get_1.default)(errors, name) && (0, get_1.default)(touched, name);
|
|
@@ -9,12 +9,15 @@ const get_1 = __importDefault(require("lodash/get"));
|
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const react_slider_1 = __importDefault(require("react-slider"));
|
|
11
11
|
function FormikSlider(props) {
|
|
12
|
-
const { onAfterChange = () => null, name, ...sliderProps } = props;
|
|
13
|
-
const { values, setFieldValue } = (0, formik_1.useFormikContext)();
|
|
12
|
+
const { onAfterChange = () => null, name, triggerSubmit = false, ...sliderProps } = props;
|
|
13
|
+
const { values, setFieldValue, submitForm } = (0, formik_1.useFormikContext)();
|
|
14
14
|
const changeHandler = (0, react_1.useCallback)((value) => {
|
|
15
15
|
onAfterChange(value);
|
|
16
16
|
setFieldValue(name, value);
|
|
17
|
-
|
|
17
|
+
if (triggerSubmit) {
|
|
18
|
+
setTimeout(submitForm, 1);
|
|
19
|
+
}
|
|
20
|
+
}, [name, onAfterChange, setFieldValue, submitForm, triggerSubmit]);
|
|
18
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 }));
|
|
19
22
|
}
|
|
20
23
|
exports.default = (0, react_1.memo)(FormikSlider);
|
|
@@ -45,7 +45,7 @@ function Provider({ children, wrapperRef = null, offset = '5px', position = opti
|
|
|
45
45
|
});
|
|
46
46
|
}, []);
|
|
47
47
|
const show = (0, react_1.useCallback)((message = '', options = {}) => {
|
|
48
|
-
const id = Math.random().toString(36).
|
|
48
|
+
const id = Math.random().toString(36).substring(2, 9);
|
|
49
49
|
const alertOptions = {
|
|
50
50
|
position: options.position || position,
|
|
51
51
|
timeout,
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
|
-
const
|
|
10
|
-
const useDraggable_1 = __importDefault(require("./useDraggable"));
|
|
9
|
+
const useResizer_1 = __importDefault(require("./useResizer"));
|
|
11
10
|
const anchorStyle = {
|
|
12
11
|
marginLeft: '5px',
|
|
13
12
|
width: '2px',
|
|
@@ -32,82 +31,38 @@ const styles = {
|
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
`,
|
|
35
|
-
content: (
|
|
36
|
-
const width =
|
|
34
|
+
content: (left, right, prevPosition) => {
|
|
35
|
+
const width = prevPosition.x2 - prevPosition.x1;
|
|
37
36
|
const baseCss = (0, react_1.css) `
|
|
38
37
|
position: absolute;
|
|
39
38
|
width: ${width}px;
|
|
40
39
|
overflow: hidden;
|
|
41
40
|
`;
|
|
42
41
|
if (right.position.action === 'move' || left.position.action === 'move') {
|
|
43
|
-
const scale = (right.position.x - left.position.x) / width;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
];
|
|
52
|
-
}
|
|
53
|
-
else if (anchorSide === 'LEFT') {
|
|
54
|
-
return (0, react_1.css)([
|
|
55
|
-
baseCss,
|
|
56
|
-
(0, react_1.css) `
|
|
57
|
-
transform: translateX(${left.position.x}px) scaleX(${scale});
|
|
58
|
-
transform-origin: left center;
|
|
59
|
-
`,
|
|
60
|
-
]);
|
|
61
|
-
}
|
|
42
|
+
const scale = (right.position.value.x - left.position.value.x) / width;
|
|
43
|
+
return [
|
|
44
|
+
baseCss,
|
|
45
|
+
(0, react_1.css) `
|
|
46
|
+
transform: translateX(${left.position.value.x}px) scaleX(${scale});
|
|
47
|
+
transform-origin: left center;
|
|
48
|
+
`,
|
|
49
|
+
];
|
|
62
50
|
}
|
|
63
51
|
else {
|
|
64
52
|
return (0, react_1.css)([
|
|
65
53
|
baseCss,
|
|
66
54
|
(0, react_1.css) `
|
|
67
|
-
transform: translateX(${left.position.x}px);
|
|
55
|
+
transform: translateX(${left.position.value.x}px);
|
|
68
56
|
`,
|
|
69
57
|
]);
|
|
70
58
|
}
|
|
71
59
|
},
|
|
72
60
|
};
|
|
73
61
|
function DivResizer(props) {
|
|
74
|
-
const { children
|
|
75
|
-
const right = (0,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const left = (0, useDraggable_1.default)({
|
|
80
|
-
x: initialPosition.x1,
|
|
81
|
-
anchor: 'LEFT',
|
|
82
|
-
});
|
|
83
|
-
const anchor = left.isActive
|
|
84
|
-
? left.anchor
|
|
85
|
-
: right.isActive
|
|
86
|
-
? right.anchor
|
|
87
|
-
: '';
|
|
88
|
-
(0, react_2.useEffect)(() => {
|
|
89
|
-
const position = { x1: left.position.x, x2: right.position.x };
|
|
90
|
-
const status = left.isActive
|
|
91
|
-
? left.position.action
|
|
92
|
-
: right.isActive
|
|
93
|
-
? right.position.action
|
|
94
|
-
: '';
|
|
95
|
-
switch (status) {
|
|
96
|
-
case 'start':
|
|
97
|
-
onStart?.(position);
|
|
98
|
-
break;
|
|
99
|
-
case 'move':
|
|
100
|
-
onMove?.(position);
|
|
101
|
-
break;
|
|
102
|
-
case 'end':
|
|
103
|
-
onEnd?.(position);
|
|
104
|
-
break;
|
|
105
|
-
default:
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
}, [left, onEnd, onMove, onStart, right]);
|
|
109
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { "data-no-export": "true", onMouseDown: right.onMouseDown, css: styles.container(right.position.x), children: (0, jsx_runtime_1.jsx)("div", { style: anchorStyle }) }), (0, jsx_runtime_1.jsx)("div", { css: styles.content(anchor, left, right), children: typeof children === 'function'
|
|
110
|
-
? children?.(left.position.x, right.position.x)
|
|
111
|
-
: children }), (0, jsx_runtime_1.jsx)("div", { "data-no-export": "true", onMouseDown: left.onMouseDown, css: styles.container(left.position.x), children: (0, jsx_runtime_1.jsx)("div", { style: anchorStyle }) })] }));
|
|
62
|
+
const { children } = props;
|
|
63
|
+
const { left, right, prevPosition, currentPosition, isActive } = (0, useResizer_1.default)(props);
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { "data-no-export": "true", onMouseDown: right.onMouseDown, css: styles.container(right.position.value.x), children: (0, jsx_runtime_1.jsx)("div", { style: anchorStyle }) }), (0, jsx_runtime_1.jsx)("div", { css: styles.content(left, right, prevPosition), children: typeof children === 'function'
|
|
65
|
+
? children?.(currentPosition, isActive)
|
|
66
|
+
: children }), (0, jsx_runtime_1.jsx)("div", { "data-no-export": "true", onMouseDown: left.onMouseDown, css: styles.container(left.position.value.x), children: (0, jsx_runtime_1.jsx)("div", { style: anchorStyle }) })] }));
|
|
112
67
|
}
|
|
113
68
|
exports.default = DivResizer;
|
|
@@ -6,72 +6,43 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const useResizer_1 = __importDefault(require("./useResizer"));
|
|
10
|
+
const style = {
|
|
11
|
+
anchor: {
|
|
12
|
+
width: '2px',
|
|
13
|
+
height: '100%',
|
|
14
|
+
pointerEvents: 'none',
|
|
15
|
+
fill: 'transparent',
|
|
16
|
+
},
|
|
17
|
+
innerContainer: {
|
|
18
|
+
position: 'absolute',
|
|
19
|
+
height: '100%',
|
|
20
|
+
fill: 'transparent',
|
|
21
|
+
width: '10px',
|
|
22
|
+
cursor: 'e-resize',
|
|
23
|
+
userSelect: 'none',
|
|
24
|
+
zIndex: 99999999,
|
|
25
|
+
},
|
|
16
26
|
};
|
|
17
27
|
const styles = {
|
|
18
|
-
container: (
|
|
19
|
-
transform: translateX(${position}px);
|
|
20
|
-
|
|
28
|
+
container: (0, react_1.css) `
|
|
21
29
|
&:hover {
|
|
22
30
|
rect:last-child {
|
|
23
31
|
fill: red !important;
|
|
24
32
|
}
|
|
25
33
|
}
|
|
26
34
|
`,
|
|
27
|
-
innerContainer: (0, react_1.css) `
|
|
28
|
-
position: absolute;
|
|
29
|
-
height: 100%;
|
|
30
|
-
fill: transparent;
|
|
31
|
-
width: 10px;
|
|
32
|
-
cursor: e-resize;
|
|
33
|
-
user-select: none;
|
|
34
|
-
z-index: 99999999;
|
|
35
|
-
`,
|
|
36
35
|
};
|
|
37
36
|
function SVGResizer(props) {
|
|
38
|
-
const { children
|
|
39
|
-
const right = (0,
|
|
40
|
-
x: initialPosition.x2,
|
|
41
|
-
anchor: 'RIGHT',
|
|
42
|
-
});
|
|
43
|
-
const left = (0, useDraggable_1.default)({
|
|
44
|
-
x: initialPosition.x1,
|
|
45
|
-
anchor: 'LEFT',
|
|
46
|
-
});
|
|
47
|
-
(0, react_2.useEffect)(() => {
|
|
48
|
-
const position = { x1: left.position.x, x2: right.position.x };
|
|
49
|
-
const status = left.isActive
|
|
50
|
-
? left.position.action
|
|
51
|
-
: right.isActive
|
|
52
|
-
? right.position.action
|
|
53
|
-
: '';
|
|
54
|
-
switch (status) {
|
|
55
|
-
case 'start':
|
|
56
|
-
onStart?.(position);
|
|
57
|
-
break;
|
|
58
|
-
case 'move':
|
|
59
|
-
onMove?.(position);
|
|
60
|
-
break;
|
|
61
|
-
case 'end':
|
|
62
|
-
onEnd?.(position);
|
|
63
|
-
break;
|
|
64
|
-
default:
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
}, [left, onEnd, onMove, onStart, right]);
|
|
37
|
+
const { children } = props;
|
|
38
|
+
const { left, right, currentPosition, isActive } = (0, useResizer_1.default)(props);
|
|
68
39
|
return ((0, jsx_runtime_1.jsxs)("g", { style: {
|
|
69
|
-
transform: `translateX(${
|
|
40
|
+
transform: `translateX(${currentPosition.x1}px)`,
|
|
70
41
|
}, children: [typeof children === 'function'
|
|
71
|
-
? children(
|
|
72
|
-
: children, (0, jsx_runtime_1.jsx)(SVGResizerHandle, { onMouseDown: left.onMouseDown, position: 0 }), (0, jsx_runtime_1.jsx)(SVGResizerHandle, { onMouseDown: right.onMouseDown, position:
|
|
42
|
+
? children(currentPosition, isActive)
|
|
43
|
+
: children, (0, jsx_runtime_1.jsx)(SVGResizerHandle, { onMouseDown: left.onMouseDown, position: 0 }), (0, jsx_runtime_1.jsx)(SVGResizerHandle, { onMouseDown: right.onMouseDown, position: Math.ceil(currentPosition.x2 - currentPosition.x1) })] }));
|
|
73
44
|
}
|
|
74
45
|
exports.default = SVGResizer;
|
|
75
46
|
function SVGResizerHandle(props) {
|
|
76
|
-
return ((0, jsx_runtime_1.jsxs)("g", { onMouseDown: props.onMouseDown, css: styles.container(props.position), "data-no-export": "true", children: [(0, jsx_runtime_1.jsx)("rect", { x: "-5px",
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)("g", { onMouseDown: props.onMouseDown, css: styles.container, style: { transform: `translateX(${props.position}px)` }, "data-no-export": "true", children: [(0, jsx_runtime_1.jsx)("rect", { x: "-5px", style: style.innerContainer }), (0, jsx_runtime_1.jsx)("rect", { x: "-2.5px", style: style.anchor })] }));
|
|
77
48
|
}
|