nmrium 0.59.0 → 0.60.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/LinesSeries.js +17 -5
- package/lib/component/1d/Viewer1D.js +10 -4
- package/lib/component/1d/ranges/Range.js +4 -2
- package/lib/component/1d/tool/PivotIndicator.d.ts +1 -0
- package/lib/component/1d/tool/{VerticalIndicator.js → PivotIndicator.js} +8 -4
- package/lib/component/1d-2d/tools/BrushXY.js +0 -1
- package/lib/component/1d-2d/tools/CrossLinePointer.js +0 -1
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/tools/PivotIndicator.d.ts +1 -2
- package/lib/component/2d/tools/PivotIndicator.js +2 -3
- package/lib/component/elements/DialogManager.d.ts +34 -0
- package/lib/component/elements/DialogManager.js +96 -0
- package/lib/component/elements/DraggableDialog.d.ts +13 -0
- package/lib/component/elements/DraggableDialog.js +156 -0
- package/lib/component/elements/TabTitle.d.ts +9 -0
- package/lib/component/elements/TabTitle.js +18 -0
- package/lib/component/header/ApodizationOptionsPanel.js +2 -2
- package/lib/component/hooks/useSaveSettings.d.ts +1 -1
- package/lib/component/hooks/useSaveSettings.js +18 -22
- package/lib/component/main/InnerNMRium.js +2 -2
- package/lib/component/main/InnerNMRiumContents.js +5 -0
- package/lib/component/modal/EditPeakShapeModal.d.ts +4 -6
- package/lib/component/modal/EditPeakShapeModal.js +45 -33
- package/lib/component/modal/editRange/EditRangeModal.d.ts +2 -10
- package/lib/component/modal/editRange/EditRangeModal.js +26 -54
- package/lib/component/modal/editZone/EditZoneModal.d.ts +3 -8
- package/lib/component/modal/editZone/EditZoneModal.js +74 -91
- package/lib/component/modal/editZone/SignalsForm.d.ts +1 -2
- package/lib/component/modal/editZone/SignalsForm.js +33 -50
- package/lib/component/modal/editZone/validation/isDefaultPathLength.d.ts +1 -2
- package/lib/component/modal/editZone/validation/isDefaultPathLength.js +3 -5
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +13 -3
- package/lib/component/panels/PeaksPanel/PeaksTable.js +7 -13
- package/lib/component/panels/RangesPanel/RangesHeader.js +0 -3
- package/lib/component/panels/RangesPanel/RangesTable.js +6 -3
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +21 -3
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +6 -5
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +41 -64
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.d.ts +1 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +33 -41
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +66 -55
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +68 -60
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.d.ts +13 -8
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +17 -81
- package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts +3 -0
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +62 -43
- package/lib/component/panels/ZonesPanel/ZonesTable.js +4 -1
- package/lib/component/panels/ZonesPanel/hooks/useZoneActions.d.ts +5 -0
- package/lib/component/panels/ZonesPanel/hooks/useZoneActions.js +40 -0
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -0
- package/lib/component/reducer/actions/RangesActions.js +9 -4
- package/lib/component/reducer/actions/ToolsActions.js +0 -17
- package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts +0 -4
- package/lib/component/reducer/preferences/actions/matrixGeneration.js +1 -2
- package/lib/component/toolbar/ToolTypes.d.ts +1 -1
- package/lib/component/toolbar/ToolTypes.js +0 -14
- package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +1 -7
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +1 -7
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -7
- package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +1 -7
- package/lib/data/molecules/MoleculeManager.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.js +5 -11
- package/lib/versionInfo.js +1 -1
- package/package.json +2 -2
- package/lib/component/1d/tool/VerticalIndicator.d.ts +0 -2
- package/lib/component/elements/ContextMenu.d.ts +0 -9
- package/lib/component/elements/ContextMenu.js +0 -116
- package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +0 -21
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +0 -68
- package/lib/component/elements/popup/Modal/Context.d.ts +0 -2
- package/lib/component/elements/popup/Modal/Context.js +0 -6
- package/lib/component/elements/popup/Modal/Modal.d.ts +0 -9
- package/lib/component/elements/popup/Modal/Modal.js +0 -42
- package/lib/component/elements/popup/Modal/ModalContent.d.ts +0 -6
- package/lib/component/elements/popup/Modal/ModalContent.js +0 -27
- package/lib/component/elements/popup/Modal/Provider.d.ts +0 -11
- package/lib/component/elements/popup/Modal/Provider.js +0 -172
- package/lib/component/elements/popup/Modal/index.d.ts +0 -4
- package/lib/component/elements/popup/Modal/index.js +0 -4
- package/lib/component/elements/popup/Transition.d.ts +0 -14
- package/lib/component/elements/popup/Transition.js +0 -35
- package/lib/component/elements/popup/Wrapper.d.ts +0 -8
- package/lib/component/elements/popup/Wrapper.js +0 -83
- package/lib/component/elements/popup/options.d.ts +0 -28
- package/lib/component/elements/popup/options.js +0 -25
- package/lib/component/elements/popup/utility.d.ts +0 -2
- package/lib/component/elements/popup/utility.js +0 -13
- package/lib/component/modal/editZone/EditPathLengthFormik.d.ts +0 -5
- package/lib/component/modal/editZone/EditPathLengthFormik.js +0 -67
- package/lib/component/modal/editZone/SignalFormTab.d.ts +0 -5
- package/lib/component/modal/editZone/SignalFormTab.js +0 -6
- package/lib/component/modal/editZone/validation/EditZoneValidation.d.ts +0 -14
- package/lib/component/modal/editZone/validation/EditZoneValidation.js +0 -14
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
import { v4 } from '@lukeed/uuid';
|
|
5
|
-
import { useRef, useState, useEffect, useCallback, Fragment, useMemo, } from 'react';
|
|
6
|
-
import { createPortal } from 'react-dom';
|
|
7
|
-
import { Rnd } from 'react-rnd';
|
|
8
|
-
import { TransitionGroup } from 'react-transition-group';
|
|
9
|
-
import Transition from '../Transition';
|
|
10
|
-
import Wrapper from '../Wrapper';
|
|
11
|
-
import { positions, transitions } from '../options';
|
|
12
|
-
import ConfirmDialog from './ConfirmDialog';
|
|
13
|
-
import { ModalProvider } from './Context';
|
|
14
|
-
import ModalContent from './ModalContent';
|
|
15
|
-
const transitionStyles = {
|
|
16
|
-
[transitions.FADE]: {
|
|
17
|
-
entering: { opacity: 0 },
|
|
18
|
-
entered: { opacity: 1 },
|
|
19
|
-
},
|
|
20
|
-
[transitions.SCALE]: {
|
|
21
|
-
entering: { transform: 'scale(0)' },
|
|
22
|
-
entered: { transform: 'scale(1)' },
|
|
23
|
-
exiting: { transform: 'scale(0)' },
|
|
24
|
-
exited: { transform: 'scale(0)' },
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
function Provider({ children, style, offset = '0px', position = positions.MIDDLE, transition = transitions.SCALE, wrapperRef = null, }) {
|
|
28
|
-
const root = useRef();
|
|
29
|
-
const modalRef = useRef();
|
|
30
|
-
const [modals, setModal] = useState([]);
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
root.current = document.createElement('div');
|
|
33
|
-
const ref = root.current;
|
|
34
|
-
if (wrapperRef) {
|
|
35
|
-
wrapperRef.append(ref);
|
|
36
|
-
}
|
|
37
|
-
return () => {
|
|
38
|
-
if (ref && wrapperRef) {
|
|
39
|
-
ref.remove();
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}, [wrapperRef]);
|
|
43
|
-
const close = useCallback((modal) => {
|
|
44
|
-
setModal((prevModals) => {
|
|
45
|
-
if (modal) {
|
|
46
|
-
return prevModals.filter((m) => m.id !== modal.id);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
return modals.slice(0, -1);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}, [modals]);
|
|
53
|
-
// todo: optimize this
|
|
54
|
-
const parentStyle = wrapperRef?.getBoundingClientRect() || {
|
|
55
|
-
top: 0,
|
|
56
|
-
left: 0,
|
|
57
|
-
width: window.innerWidth,
|
|
58
|
-
height: window.innerHeight,
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
62
|
-
* @param {*} component <component />
|
|
63
|
-
* @param {object} options {onYest:()=>{}, prop1, .... etc}
|
|
64
|
-
* @param {transitions} options.transition
|
|
65
|
-
* @param {positions} options.position
|
|
66
|
-
* @param {boolean} options.isBackgroundBlur
|
|
67
|
-
* @param {boolean} options.enableResizing
|
|
68
|
-
*/
|
|
69
|
-
const show = useCallback((component, options = {}) => {
|
|
70
|
-
const _modal = {
|
|
71
|
-
id: v4(),
|
|
72
|
-
component,
|
|
73
|
-
options: { isBackgroundBlur: true, enableResizing: false, ...options },
|
|
74
|
-
};
|
|
75
|
-
_modal.close = () => close(_modal);
|
|
76
|
-
setModal((prevModals) => [...prevModals, _modal]);
|
|
77
|
-
if (_modal.options.onOpen)
|
|
78
|
-
_modal.options.onOpen();
|
|
79
|
-
return _modal;
|
|
80
|
-
}, [close]);
|
|
81
|
-
/**
|
|
82
|
-
* @param {object} dialogOptions
|
|
83
|
-
* @param {object} dialogOptions.message
|
|
84
|
-
* @param {Array<{ handler: Function,text: string,style: object}>} dialogOptions.buttons
|
|
85
|
-
* @param {object} dialogOptions.style
|
|
86
|
-
*/
|
|
87
|
-
const showConfirmDialog = useCallback((dialogOptions, options = {}) => {
|
|
88
|
-
const { enableResizing = false, ...otherOptions } = options;
|
|
89
|
-
const _modal = {
|
|
90
|
-
id: v4(),
|
|
91
|
-
component: _jsx(ConfirmDialog, { ...dialogOptions }),
|
|
92
|
-
options: { isBackgroundBlur: true, enableResizing, ...otherOptions },
|
|
93
|
-
};
|
|
94
|
-
_modal.close = () => close(_modal);
|
|
95
|
-
setModal((prevModals) => [...prevModals, _modal]);
|
|
96
|
-
if (_modal.options.onOpen)
|
|
97
|
-
_modal.options.onOpen();
|
|
98
|
-
return _modal;
|
|
99
|
-
}, [close]);
|
|
100
|
-
useEffect(() => {
|
|
101
|
-
function keyHandler(e) {
|
|
102
|
-
if (['Escape', 'Esc'].includes(e.key)) {
|
|
103
|
-
close();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
document.addEventListener('keydown', keyHandler, false);
|
|
107
|
-
return () => document.removeEventListener('keydown', keyHandler, false);
|
|
108
|
-
}, [close, modals]);
|
|
109
|
-
const styles = css `
|
|
110
|
-
position: absolute;
|
|
111
|
-
inset: 0;
|
|
112
|
-
z-index: 0;
|
|
113
|
-
pointer-events: all;
|
|
114
|
-
|
|
115
|
-
.handle {
|
|
116
|
-
cursor: move;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.rnd-container {
|
|
120
|
-
box-sizing: initial;
|
|
121
|
-
background-color: #fff;
|
|
122
|
-
box-shadow:
|
|
123
|
-
0 0 0 0,
|
|
124
|
-
0 8px 16px rgb(0 0 0 / 30%);
|
|
125
|
-
border-radius: 5px;
|
|
126
|
-
}
|
|
127
|
-
`;
|
|
128
|
-
const modalContextValue = useMemo(() => ({ show, close, showConfirmDialog }), [show, close, showConfirmDialog]);
|
|
129
|
-
const contentLayoutHandler = useCallback(({ modal, layout }) => {
|
|
130
|
-
const width = modal.options.width ||
|
|
131
|
-
(layout.width > parentStyle.width ? parentStyle.width : layout.width);
|
|
132
|
-
const height = modal.options.height ||
|
|
133
|
-
(layout.height > parentStyle.height
|
|
134
|
-
? parentStyle.height
|
|
135
|
-
: layout.height);
|
|
136
|
-
modalRef.current.updateSize({ width, height });
|
|
137
|
-
}, [parentStyle.height, parentStyle.width]);
|
|
138
|
-
return (_jsxs(ModalProvider, { value: modalContextValue, children: [children, root.current &&
|
|
139
|
-
createPortal(_jsx(Fragment, { children: modals?.length > 0
|
|
140
|
-
? modals.map((modal) => (_jsx("div", { css: styles, style: {
|
|
141
|
-
...(modal?.options.isBackgroundBlur
|
|
142
|
-
? { backgroundColor: 'rgba(255,255,255,0.8)' }
|
|
143
|
-
: { pointerEvents: 'none' }),
|
|
144
|
-
}, children: _jsx(TransitionGroup, { appear: true, options: {
|
|
145
|
-
position: modal.options.position || position,
|
|
146
|
-
}, containerStyle: parentStyle, component: Wrapper, children: _jsx(Transition, { type: modal.options.transition || transition, transitionStyles: {
|
|
147
|
-
...transitionStyles,
|
|
148
|
-
default: {
|
|
149
|
-
width: modal.options.width
|
|
150
|
-
? `${modal.options.width}px`
|
|
151
|
-
: 'auto',
|
|
152
|
-
},
|
|
153
|
-
height: modal.options.height
|
|
154
|
-
? `${modal.options.height}px`
|
|
155
|
-
: 'auto',
|
|
156
|
-
}, children: _jsx(Rnd, { maxWidth: parentStyle.width, maxHeight: parentStyle.height, ref: modalRef, default: {
|
|
157
|
-
width: modal.options.width || 'auto',
|
|
158
|
-
height: modal.options.height || 'auto',
|
|
159
|
-
x: 0,
|
|
160
|
-
y: 0,
|
|
161
|
-
}, className: "rnd-container", style: {
|
|
162
|
-
...style,
|
|
163
|
-
margin: offset,
|
|
164
|
-
position: 'static',
|
|
165
|
-
pointerEvents: 'all',
|
|
166
|
-
userSelect: 'none',
|
|
167
|
-
}, enableResizing: modal.options.enableResizing, dragHandleClassName: "handle", enableUserSelectHack: false, children: _jsx(ModalContent, { modal: modal, onClose: () => {
|
|
168
|
-
close(modal);
|
|
169
|
-
}, onLayout: contentLayoutHandler }) }) }, modal.id) }, positions[modal.options.transition || transition]) }, modal.id)))
|
|
170
|
-
: null }), root.current)] }));
|
|
171
|
-
}
|
|
172
|
-
export default Provider;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
type TransitionStyles = Record<string, Partial<{
|
|
3
|
-
entering: CSSProperties;
|
|
4
|
-
entered: CSSProperties;
|
|
5
|
-
exiting: CSSProperties;
|
|
6
|
-
exited: CSSProperties;
|
|
7
|
-
}>>;
|
|
8
|
-
interface TransitionProps {
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
type: string;
|
|
11
|
-
transitionStyles?: TransitionStyles;
|
|
12
|
-
}
|
|
13
|
-
export default function Transtion({ children, type, transitionStyles, ...props }: TransitionProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef } from 'react';
|
|
3
|
-
import { Transition as ContainerTransition } from 'react-transition-group';
|
|
4
|
-
import { transitions } from './options';
|
|
5
|
-
const duration = 250;
|
|
6
|
-
const defaultStyle = {
|
|
7
|
-
[transitions.FADE]: {
|
|
8
|
-
transition: `opacity ${duration}ms ease`,
|
|
9
|
-
opacity: 0,
|
|
10
|
-
},
|
|
11
|
-
[transitions.SCALE]: {
|
|
12
|
-
transform: 'scale(1)',
|
|
13
|
-
transition: `all ${duration}ms ease-in-out`,
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
const defaultTransitionStyles = {
|
|
17
|
-
[transitions.FADE]: {
|
|
18
|
-
entering: { opacity: 0 },
|
|
19
|
-
entered: { opacity: 1 },
|
|
20
|
-
},
|
|
21
|
-
[transitions.SCALE]: {
|
|
22
|
-
entering: { transform: 'scale(0)' },
|
|
23
|
-
entered: { transform: 'scale(1)' },
|
|
24
|
-
exiting: { transform: 'scale(0)' },
|
|
25
|
-
exited: { transform: 'scale(1)' },
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
export default function Transtion({ children, type, transitionStyles = defaultTransitionStyles, ...props }) {
|
|
29
|
-
const ref = useRef(null);
|
|
30
|
-
return (_jsx(ContainerTransition, { nodeRef: ref, ...props, timeout: duration, children: (state) => (_jsx("div", { ref: ref, style: {
|
|
31
|
-
...defaultStyle[type],
|
|
32
|
-
...transitionStyles[type][state],
|
|
33
|
-
...transitionStyles.default,
|
|
34
|
-
}, children: children })) }));
|
|
35
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { positions } from './options';
|
|
4
|
-
function getStyles(position, containerStyle) {
|
|
5
|
-
const initialStyles = {
|
|
6
|
-
position: 'fixed',
|
|
7
|
-
display: 'flex',
|
|
8
|
-
justifyContent: 'center',
|
|
9
|
-
alignItems: 'center',
|
|
10
|
-
flexDirection: 'column',
|
|
11
|
-
pointerEvents: 'none',
|
|
12
|
-
overflow: 'visible',
|
|
13
|
-
...(containerStyle
|
|
14
|
-
? {
|
|
15
|
-
top: `${containerStyle.top}px`,
|
|
16
|
-
left: `${containerStyle.left}px`,
|
|
17
|
-
height: `${containerStyle.height}px`,
|
|
18
|
-
width: `${containerStyle.width}px`,
|
|
19
|
-
}
|
|
20
|
-
: { width: '100%', height: '100%' }),
|
|
21
|
-
};
|
|
22
|
-
switch (position) {
|
|
23
|
-
case positions.TOP_LEFT:
|
|
24
|
-
return {
|
|
25
|
-
...initialStyles,
|
|
26
|
-
justifyContent: 'flex-start',
|
|
27
|
-
alignItems: 'flex-start',
|
|
28
|
-
};
|
|
29
|
-
case positions.TOP_CENTER:
|
|
30
|
-
return {
|
|
31
|
-
...initialStyles,
|
|
32
|
-
justifyContent: 'flex-start',
|
|
33
|
-
};
|
|
34
|
-
case positions.TOP_RIGHT:
|
|
35
|
-
return {
|
|
36
|
-
...initialStyles,
|
|
37
|
-
justifyContent: 'flex-start',
|
|
38
|
-
alignItems: 'flex-end',
|
|
39
|
-
};
|
|
40
|
-
case positions.MIDDLE_LEFT:
|
|
41
|
-
return {
|
|
42
|
-
...initialStyles,
|
|
43
|
-
justifyContent: 'center',
|
|
44
|
-
alignItems: 'flex-start',
|
|
45
|
-
};
|
|
46
|
-
case positions.MIDDLE: {
|
|
47
|
-
return {
|
|
48
|
-
...initialStyles,
|
|
49
|
-
justifyContent: 'center',
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
case positions.MIDDLE_RIGHT:
|
|
53
|
-
return {
|
|
54
|
-
...initialStyles,
|
|
55
|
-
justifyContent: 'center',
|
|
56
|
-
alignItems: 'flex-end',
|
|
57
|
-
};
|
|
58
|
-
case positions.BOTTOM_LEFT:
|
|
59
|
-
return {
|
|
60
|
-
...initialStyles,
|
|
61
|
-
justifyContent: 'flex-end',
|
|
62
|
-
alignItems: 'flex-start',
|
|
63
|
-
};
|
|
64
|
-
case positions.BOTTOM_CENTER:
|
|
65
|
-
return {
|
|
66
|
-
...initialStyles,
|
|
67
|
-
justifyContent: 'flex-end',
|
|
68
|
-
};
|
|
69
|
-
case positions.BOTTOM_RIGHT:
|
|
70
|
-
return {
|
|
71
|
-
...initialStyles,
|
|
72
|
-
justifyContent: 'flex-end',
|
|
73
|
-
alignItems: 'flex-end',
|
|
74
|
-
};
|
|
75
|
-
default: {
|
|
76
|
-
return initialStyles;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
export default function Wrapper({ children, options: { position }, containerStyle, ...props }) {
|
|
81
|
-
const styles = useMemo(() => getStyles(position, containerStyle), [position, containerStyle]);
|
|
82
|
-
return (children.length > 0 && (_jsx("div", { style: styles, ...props, children: children })));
|
|
83
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export declare const positions: {
|
|
2
|
-
readonly TOP_LEFT: "top left";
|
|
3
|
-
readonly TOP_CENTER: "top center";
|
|
4
|
-
readonly TOP_RIGHT: "top right";
|
|
5
|
-
readonly MIDDLE_LEFT: "middle left";
|
|
6
|
-
readonly MIDDLE: "middle";
|
|
7
|
-
readonly MIDDLE_RIGHT: "middle right";
|
|
8
|
-
readonly BOTTOM_LEFT: "bottom left";
|
|
9
|
-
readonly BOTTOM_CENTER: "bottom center";
|
|
10
|
-
readonly BOTTOM_RIGHT: "bottom right";
|
|
11
|
-
};
|
|
12
|
-
export type Position = (typeof positions)[keyof typeof positions];
|
|
13
|
-
export declare const types: {
|
|
14
|
-
readonly INFO: "info";
|
|
15
|
-
readonly SUCCESS: "success";
|
|
16
|
-
readonly ERROR: "error";
|
|
17
|
-
readonly PROGRESS_INDICATOR: "progress_indicator";
|
|
18
|
-
};
|
|
19
|
-
export type Type = (typeof types)[keyof typeof types];
|
|
20
|
-
export declare const transitions: {
|
|
21
|
-
readonly FADE: "fade";
|
|
22
|
-
readonly SCALE: "scale";
|
|
23
|
-
readonly SLIDE_RIGHT: "slide_right";
|
|
24
|
-
readonly SLIDE_LEFT: "slide_left";
|
|
25
|
-
readonly SLIDE_TOP: "slide_top";
|
|
26
|
-
readonly SLIDE_BOTTOM: "slide_bottom";
|
|
27
|
-
};
|
|
28
|
-
export type Transition = (typeof transitions)[keyof typeof transitions];
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export const positions = {
|
|
2
|
-
TOP_LEFT: 'top left',
|
|
3
|
-
TOP_CENTER: 'top center',
|
|
4
|
-
TOP_RIGHT: 'top right',
|
|
5
|
-
MIDDLE_LEFT: 'middle left',
|
|
6
|
-
MIDDLE: 'middle',
|
|
7
|
-
MIDDLE_RIGHT: 'middle right',
|
|
8
|
-
BOTTOM_LEFT: 'bottom left',
|
|
9
|
-
BOTTOM_CENTER: 'bottom center',
|
|
10
|
-
BOTTOM_RIGHT: 'bottom right',
|
|
11
|
-
};
|
|
12
|
-
export const types = {
|
|
13
|
-
INFO: 'info',
|
|
14
|
-
SUCCESS: 'success',
|
|
15
|
-
ERROR: 'error',
|
|
16
|
-
PROGRESS_INDICATOR: 'progress_indicator',
|
|
17
|
-
};
|
|
18
|
-
export const transitions = {
|
|
19
|
-
FADE: 'fade',
|
|
20
|
-
SCALE: 'scale',
|
|
21
|
-
SLIDE_RIGHT: 'slide_right',
|
|
22
|
-
SLIDE_LEFT: 'slide_left',
|
|
23
|
-
SLIDE_TOP: 'slide_top',
|
|
24
|
-
SLIDE_BOTTOM: 'slide_bottom',
|
|
25
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
async function load(filePath) {
|
|
2
|
-
const response = await fetch(filePath);
|
|
3
|
-
checkStatus(response);
|
|
4
|
-
const data = await response.text();
|
|
5
|
-
return data;
|
|
6
|
-
}
|
|
7
|
-
function checkStatus(response) {
|
|
8
|
-
if (!response.ok) {
|
|
9
|
-
throw new Error(`HTTP ${response.status} - ${response.statusText}`);
|
|
10
|
-
}
|
|
11
|
-
return response;
|
|
12
|
-
}
|
|
13
|
-
export { load };
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
import { useFormikContext } from 'formik';
|
|
5
|
-
import DefaultPathLengths from '../../../data/constants/DefaultPathLengths';
|
|
6
|
-
import Label from '../../elements/Label';
|
|
7
|
-
import FormikNumberInput from '../../elements/formik/FormikNumberInput';
|
|
8
|
-
const editPathLengthsStyles = css `
|
|
9
|
-
width: 100%;
|
|
10
|
-
height: 100%;
|
|
11
|
-
margin-top: 10px;
|
|
12
|
-
text-align: center;
|
|
13
|
-
|
|
14
|
-
.input-container {
|
|
15
|
-
width: 100%;
|
|
16
|
-
margin-top: 5px;
|
|
17
|
-
text-align: center;
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
align-items: center;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
|
|
23
|
-
input::-webkit-outer-spin-button,
|
|
24
|
-
input::-webkit-inner-spin-button {
|
|
25
|
-
appearance: none;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
button {
|
|
30
|
-
flex: 2;
|
|
31
|
-
padding: 5px;
|
|
32
|
-
border: 1px solid gray;
|
|
33
|
-
border-radius: 5px;
|
|
34
|
-
height: 30px;
|
|
35
|
-
margin: 0 auto;
|
|
36
|
-
margin-top: 15px;
|
|
37
|
-
display: block;
|
|
38
|
-
width: 60px;
|
|
39
|
-
color: white;
|
|
40
|
-
background-color: gray;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.warning {
|
|
44
|
-
margin-top: 5px;
|
|
45
|
-
color: red;
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
function EditPathLengthFormik({ signalIndex }) {
|
|
49
|
-
const { errors, values, } = useFormikContext();
|
|
50
|
-
return (_jsxs("div", { css: editPathLengthsStyles, children: [_jsx("p", { children: "Setting of the minimum and maximum path length (J coupling)." }), _jsxs("div", { className: "input-container", children: [_jsx(Label, { title: "Min:", children: _jsx(FormikNumberInput, { name: `signals[${signalIndex}].j.pathLength.from`, defaultValue: values.signals[signalIndex].j?.pathLength?.from ||
|
|
51
|
-
DefaultPathLengths[values.experimentType]?.from ||
|
|
52
|
-
1, style: {
|
|
53
|
-
color: errors.signals?.[signalIndex].j?.pathLength?.from
|
|
54
|
-
? 'red'
|
|
55
|
-
: 'black',
|
|
56
|
-
}, min: 1, max: values.signals[signalIndex].j?.pathLength?.to ||
|
|
57
|
-
DefaultPathLengths[values.experimentType]?.to, pattern: "[1-9]+" }) }), _jsx(Label, { title: "Max:", children: _jsx(FormikNumberInput, { name: `signals[${signalIndex}].j.pathLength.to`, defaultValue: values.signals[signalIndex].j?.pathLength?.to ||
|
|
58
|
-
DefaultPathLengths[values.experimentType]?.to ||
|
|
59
|
-
1, style: {
|
|
60
|
-
color: errors.signals?.[signalIndex].j?.pathLength?.to
|
|
61
|
-
? 'red'
|
|
62
|
-
: 'black',
|
|
63
|
-
}, min: values.signals[signalIndex].j?.pathLength?.from ||
|
|
64
|
-
DefaultPathLengths[values.experimentType]?.from ||
|
|
65
|
-
1, pattern: "[1-9]+" }) })] })] }));
|
|
66
|
-
}
|
|
67
|
-
export default EditPathLengthFormik;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as Yup from 'yup';
|
|
2
|
-
declare const zoneFormValidation: Yup.ObjectSchema<{
|
|
3
|
-
signals: {
|
|
4
|
-
j: {
|
|
5
|
-
pathLength: {
|
|
6
|
-
from: number;
|
|
7
|
-
to: number;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
}[] | undefined;
|
|
11
|
-
}, Yup.AnyObject, {
|
|
12
|
-
signals: "";
|
|
13
|
-
}, "">;
|
|
14
|
-
export default zoneFormValidation;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as Yup from 'yup';
|
|
2
|
-
const zoneFormValidation = Yup.object().shape({
|
|
3
|
-
signals: Yup.array()
|
|
4
|
-
.of(Yup.object().shape({
|
|
5
|
-
j: Yup.object().shape({
|
|
6
|
-
pathLength: Yup.object().shape({
|
|
7
|
-
from: Yup.number().required().positive().integer(),
|
|
8
|
-
to: Yup.number().required().positive().integer(),
|
|
9
|
-
}),
|
|
10
|
-
}),
|
|
11
|
-
}))
|
|
12
|
-
.min(1, 'There must be at least one signal in a zone!'),
|
|
13
|
-
});
|
|
14
|
-
export default zoneFormValidation;
|