nmrium 0.24.1 → 0.25.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/IntegralResizable.js +13 -13
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +30 -31
- package/lib/component/1d/ranges/Range.js +18 -28
- package/lib/component/NMRium.js +22 -29
- package/lib/component/context/GlobalContext.d.ts +12 -3
- package/lib/component/context/GlobalContext.js +1 -1
- package/lib/component/elements/ActionButtons.d.ts +10 -0
- package/lib/component/elements/ActionButtons.js +14 -0
- package/lib/component/elements/Button.d.ts +30 -5
- package/lib/component/elements/Button.js +150 -4
- package/lib/component/elements/ContextMenu.js +6 -6
- package/lib/component/elements/ToolTip/ToolTip.js +3 -2
- package/lib/component/elements/resizer/DivResizer.d.ts +2 -0
- package/lib/component/elements/resizer/DivResizer.js +107 -0
- package/lib/component/elements/resizer/Resizer.d.ts +18 -0
- package/lib/component/elements/resizer/Resizer.js +12 -0
- package/lib/component/elements/resizer/SVGResizer.d.ts +2 -0
- package/lib/component/elements/resizer/SVGResizer.js +71 -0
- package/lib/component/elements/resizer/useDraggable.d.ts +19 -0
- package/lib/component/elements/resizer/useDraggable.js +52 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.js +4 -15
- package/lib/component/header/BaseLineCorrectionPanel.js +2 -9
- package/lib/component/header/ManualPhaseCorrectionPanel.js +2 -9
- package/lib/component/header/RangesPickingOptionPanel.js +3 -16
- package/lib/component/header/ZeroFillingOptionsPanel.js +2 -9
- package/lib/component/header/Zones2DOptionPanel.js +3 -14
- package/lib/component/hooks/useExport.js +11 -9
- package/lib/component/loader/DropZone.js +1 -0
- package/lib/component/modal/AlignSpectraModal.js +2 -1
- package/lib/component/modal/ExportAsMatrixModal.js +2 -1
- package/lib/component/modal/ImportPublicationStringModal.js +2 -1
- package/lib/component/modal/LoadJCAMPModal.js +7 -6
- package/lib/component/modal/ModalStyle.js +4 -26
- package/lib/component/modal/MoleculeStructureEditorModal.js +2 -1
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +2 -1
- package/lib/component/modal/PredictSpectraModal.js +2 -7
- package/lib/component/modal/SaveAsModal.d.ts +1 -1
- package/lib/component/modal/SaveAsModal.js +2 -1
- package/lib/component/modal/setting/GeneralSettings.js +2 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +10 -4
- package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -18
- package/lib/component/utility/Export.d.ts +3 -3
- package/lib/component/utility/Export.js +10 -9
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/IntegralResizable.js +12 -12
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +29 -30
- package/lib-cjs/component/1d/ranges/Range.js +18 -28
- package/lib-cjs/component/NMRium.js +22 -29
- package/lib-cjs/component/context/GlobalContext.js +1 -1
- package/lib-cjs/component/elements/ActionButtons.js +20 -0
- package/lib-cjs/component/elements/Button.js +149 -4
- package/lib-cjs/component/elements/ContextMenu.js +6 -6
- package/lib-cjs/component/elements/ToolTip/ToolTip.js +3 -2
- package/lib-cjs/component/elements/resizer/DivResizer.js +113 -0
- package/lib-cjs/component/elements/resizer/Resizer.js +18 -0
- package/lib-cjs/component/elements/resizer/SVGResizer.js +77 -0
- package/lib-cjs/component/elements/resizer/useDraggable.js +55 -0
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +3 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +2 -9
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +2 -9
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +2 -15
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -9
- package/lib-cjs/component/header/Zones2DOptionPanel.js +2 -13
- package/lib-cjs/component/hooks/useExport.js +11 -9
- package/lib-cjs/component/loader/DropZone.js +1 -0
- package/lib-cjs/component/modal/AlignSpectraModal.js +2 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -1
- package/lib-cjs/component/modal/ImportPublicationStringModal.js +2 -1
- package/lib-cjs/component/modal/LoadJCAMPModal.js +7 -6
- package/lib-cjs/component/modal/ModalStyle.js +4 -26
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +5 -1
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +2 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +2 -7
- package/lib-cjs/component/modal/SaveAsModal.js +2 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +10 -4
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -18
- package/lib-cjs/component/utility/Export.js +10 -9
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +16 -17
- package/lib/component/1d/Resizable.d.ts +0 -12
- package/lib/component/1d/Resizable.js +0 -105
- package/lib-cjs/component/1d/Resizable.js +0 -110
|
@@ -36,6 +36,7 @@ const Select_1 = __importDefault(require("../elements/Select"));
|
|
|
36
36
|
const FormikForm_1 = __importDefault(require("../elements/formik/FormikForm"));
|
|
37
37
|
const FormikInput_1 = __importDefault(require("../elements/formik/FormikInput"));
|
|
38
38
|
const Types_1 = require("../reducer/types/Types");
|
|
39
|
+
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
39
40
|
const styles = {
|
|
40
41
|
container: {
|
|
41
42
|
padding: '5px',
|
|
@@ -47,14 +48,6 @@ const styles = {
|
|
|
47
48
|
lineHeight: 2,
|
|
48
49
|
userSelect: 'none',
|
|
49
50
|
},
|
|
50
|
-
actionButton: {
|
|
51
|
-
height: '100%',
|
|
52
|
-
width: '60px',
|
|
53
|
-
borderRadius: '5px',
|
|
54
|
-
border: '0.55px solid #c7c7c7',
|
|
55
|
-
margin: '0px 5px',
|
|
56
|
-
userSelect: 'none',
|
|
57
|
-
},
|
|
58
51
|
};
|
|
59
52
|
function BaseLineCorrectionPanel() {
|
|
60
53
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
@@ -120,6 +113,6 @@ function BaseLineCorrectionPanel() {
|
|
|
120
113
|
return { validation: {}, initialValue: {} };
|
|
121
114
|
}
|
|
122
115
|
}, [algorithm]);
|
|
123
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.label, children: "Algorithm: " }), (0, jsx_runtime_1.jsx)(Select_1.default, { ref: algorithmRef, data: getAlgorithmsList(), style: { marginLeft: 10, marginRight: 10 }, onChange: changeAlgorithmHandler, defaultValue: "polynomial" }), (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: formRef, onSubmit: handleApplyFilter, initialValues: formData.initialValue, validationSchema: formData.validation, children: [algorithm && algorithm === 'airpls' && ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "maxIterations:", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "maxIterations" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "tolerance:", style: { label: { padding: '0 5px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "tolerance" }) })] })), algorithm && ['autoPolynomial', 'polynomial'].includes(algorithm) && ((0, jsx_runtime_1.jsx)(Label_1.default, { title: "degree [ 1 - 6 ]:", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "degree", min: 1, max: 6, style: { inputWrapper: { height: '100%' } } }) }))] }, JSON.stringify(formData.initialValue)), (0, jsx_runtime_1.jsx)(
|
|
116
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.label, children: "Algorithm: " }), (0, jsx_runtime_1.jsx)(Select_1.default, { ref: algorithmRef, data: getAlgorithmsList(), style: { marginLeft: 10, marginRight: 10 }, onChange: changeAlgorithmHandler, defaultValue: "polynomial" }), (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: formRef, onSubmit: handleApplyFilter, initialValues: formData.initialValue, validationSchema: formData.validation, children: [algorithm && algorithm === 'airpls' && ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "maxIterations:", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "maxIterations" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "tolerance:", style: { label: { padding: '0 5px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "tolerance" }) })] })), algorithm && ['autoPolynomial', 'polynomial'].includes(algorithm) && ((0, jsx_runtime_1.jsx)(Label_1.default, { title: "degree [ 1 - 6 ]:", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { type: "number", name: "degree", min: 1, max: 6, style: { inputWrapper: { height: '100%' } } }) }))] }, JSON.stringify(formData.initialValue)), (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { onDone: () => formRef.current.submitForm(), onCancel: handleCancelFilter })] }));
|
|
124
117
|
}
|
|
125
118
|
exports.default = BaseLineCorrectionPanel;
|
|
@@ -31,6 +31,7 @@ const react_1 = require("react");
|
|
|
31
31
|
const Filters = __importStar(require("../../data/Filters"));
|
|
32
32
|
const ChartContext_1 = require("../context/ChartContext");
|
|
33
33
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
34
|
+
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
34
35
|
const Input_1 = __importDefault(require("../elements/Input"));
|
|
35
36
|
const InputRange_1 = __importDefault(require("../elements/InputRange"));
|
|
36
37
|
const Label_1 = __importDefault(require("../elements/Label"));
|
|
@@ -46,14 +47,6 @@ const styles = {
|
|
|
46
47
|
input: {
|
|
47
48
|
width: '100px',
|
|
48
49
|
},
|
|
49
|
-
actionButton: {
|
|
50
|
-
height: '100%',
|
|
51
|
-
width: '60px',
|
|
52
|
-
borderRadius: '5px',
|
|
53
|
-
border: '0.55px solid #c7c7c7',
|
|
54
|
-
margin: '0px 5px',
|
|
55
|
-
userSelect: 'none',
|
|
56
|
-
},
|
|
57
50
|
select: {
|
|
58
51
|
marginLeft: '5px',
|
|
59
52
|
marginRight: '10px',
|
|
@@ -163,7 +156,7 @@ function ManualPhaseCorrectionPanelInner({ data, pivot, filter, }) {
|
|
|
163
156
|
const onChangeHandler = (0, react_1.useCallback)((val) => {
|
|
164
157
|
setPhaseCorrectionType(val);
|
|
165
158
|
}, []);
|
|
166
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)(Select_1.default, { onChange: onChangeHandler, data: algorithms, defaultValue: phaseCorrectionTypes.manual, style: styles.select }), phaseCorrectionType === phaseCorrectionTypes.manual && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "PH0 :", style: { wrapper: { marginRight: '5px' } }, children: (0, jsx_runtime_1.jsx)(Input_1.default, { name: "ph0", style: { input: styles.input }, onChange: handleInput, value: value.ph0, type: "number", debounceTime: 250 }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "PH1 :", children: (0, jsx_runtime_1.jsx)(Input_1.default, { name: "ph1", style: { input: styles.input }, onChange: handleInput, value: value.ph1, type: "number", debounceTime: 250 }) }), (0, jsx_runtime_1.jsx)(InputRange_1.default, { ref: ph0Ref, name: "ph0", label: "Change Ph0 By mouse click and drag", style: { width: '20%' }, onChange: handleRangeChange }), (0, jsx_runtime_1.jsx)(InputRange_1.default, { ref: ph1Ref, name: "ph1", label: "Change Ph1 By mouse click and drag", style: { width: '20%' }, onChange: handleRangeChange })] })), (0, jsx_runtime_1.jsx)(
|
|
159
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)(Select_1.default, { onChange: onChangeHandler, data: algorithms, defaultValue: phaseCorrectionTypes.manual, style: styles.select }), phaseCorrectionType === phaseCorrectionTypes.manual && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "PH0 :", style: { wrapper: { marginRight: '5px' } }, children: (0, jsx_runtime_1.jsx)(Input_1.default, { name: "ph0", style: { input: styles.input }, onChange: handleInput, value: value.ph0, type: "number", debounceTime: 250 }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "PH1 :", children: (0, jsx_runtime_1.jsx)(Input_1.default, { name: "ph1", style: { input: styles.input }, onChange: handleInput, value: value.ph1, type: "number", debounceTime: 250 }) }), (0, jsx_runtime_1.jsx)(InputRange_1.default, { ref: ph0Ref, name: "ph0", label: "Change Ph0 By mouse click and drag", style: { width: '20%' }, onChange: handleRangeChange }), (0, jsx_runtime_1.jsx)(InputRange_1.default, { ref: ph1Ref, name: "ph1", label: "Change Ph1 By mouse click and drag", style: { width: '20%' }, onChange: handleRangeChange })] })), (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
|
|
167
160
|
}
|
|
168
161
|
const MemoizedManualPhaseCorrectionPanel = (0, react_1.memo)(ManualPhaseCorrectionPanelInner);
|
|
169
162
|
const emptyData = { datum: {}, filter: null };
|
|
@@ -6,6 +6,7 @@ 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 DispatchContext_1 = require("../context/DispatchContext");
|
|
9
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
9
10
|
const CheckBox_1 = __importDefault(require("../elements/CheckBox"));
|
|
10
11
|
const NumberInput_1 = __importDefault(require("../elements/NumberInput"));
|
|
11
12
|
const Types_1 = require("../reducer/types/Types");
|
|
@@ -31,15 +32,6 @@ const styles = {
|
|
|
31
32
|
label: {
|
|
32
33
|
flex: 5,
|
|
33
34
|
},
|
|
34
|
-
actionButton: {
|
|
35
|
-
height: '100%',
|
|
36
|
-
minWidth: '60px',
|
|
37
|
-
borderRadius: '5px',
|
|
38
|
-
border: '0.55px solid #c7c7c7',
|
|
39
|
-
margin: '0px 5px',
|
|
40
|
-
userSelect: 'none',
|
|
41
|
-
padding: '3px',
|
|
42
|
-
},
|
|
43
35
|
hint: {
|
|
44
36
|
lineHeight: 2,
|
|
45
37
|
userSelect: 'none',
|
|
@@ -61,15 +53,10 @@ function RangesPickingOptionPanel() {
|
|
|
61
53
|
},
|
|
62
54
|
});
|
|
63
55
|
}, [dispatch]);
|
|
64
|
-
const handleCancelFilter = (0, react_1.useCallback)(() => {
|
|
65
|
-
dispatch({
|
|
66
|
-
type: Types_1.RESET_SELECTED_TOOL,
|
|
67
|
-
});
|
|
68
|
-
}, [dispatch]);
|
|
69
56
|
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsxs)("div", { style: { justifyItems: 'baseline', margin: '0 10px' }, children: [(0, jsx_runtime_1.jsx)("label", { style: { marginRight: '2px', lineHeight: 2, userSelect: 'none' }, htmlFor: "lookNegative", children: "Detect negative:" }), (0, jsx_runtime_1.jsx)(CheckBox_1.default, { name: "lookNegative", ref: lookNegativeRef })] }), (0, jsx_runtime_1.jsx)(NumberInput_1.default, { ref: minMaxRatioRef, label: "Min Max Ratio:", name: "minMaxRatio", style: {
|
|
70
57
|
input: styles.input,
|
|
71
58
|
inputContainer: styles.inputContainer,
|
|
72
59
|
label: styles.label,
|
|
73
|
-
}, defaultValue: 0.05, step: "0.01" }), (0, jsx_runtime_1.jsx)(
|
|
60
|
+
}, defaultValue: 0.05, step: "0.01" }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleApplyFilter, style: { margin: '0 10px' }, children: "Auto ranges picking" }), (0, jsx_runtime_1.jsx)("span", { style: styles.hint, children: "Manual selection using SHIFT + select zone or click on Auto peak picking" })] }));
|
|
74
61
|
}
|
|
75
62
|
exports.default = RangesPickingOptionPanel;
|
|
@@ -8,6 +8,7 @@ const react_1 = require("react");
|
|
|
8
8
|
const generateNumbersPowerOfX_1 = __importDefault(require("../../data/utilities/generateNumbersPowerOfX"));
|
|
9
9
|
const ChartContext_1 = require("../context/ChartContext");
|
|
10
10
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
11
|
+
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
11
12
|
const Select_1 = __importDefault(require("../elements/Select"));
|
|
12
13
|
const Types_1 = require("../reducer/types/Types");
|
|
13
14
|
const styles = {
|
|
@@ -24,14 +25,6 @@ const styles = {
|
|
|
24
25
|
margin: '0px 5px 0px 5px',
|
|
25
26
|
textAlign: 'center',
|
|
26
27
|
},
|
|
27
|
-
actionButton: {
|
|
28
|
-
height: '100%',
|
|
29
|
-
width: '60px',
|
|
30
|
-
borderRadius: '5px',
|
|
31
|
-
border: '0.55px solid #c7c7c7',
|
|
32
|
-
margin: '0px 5px',
|
|
33
|
-
userSelect: 'none',
|
|
34
|
-
},
|
|
35
28
|
label: {
|
|
36
29
|
lineHeight: 2,
|
|
37
30
|
userSelect: 'none',
|
|
@@ -72,6 +65,6 @@ function ZeroFillingOptionsPanel() {
|
|
|
72
65
|
type: Types_1.RESET_SELECTED_TOOL,
|
|
73
66
|
});
|
|
74
67
|
}, [dispatch]);
|
|
75
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.label, children: "Size: " }), (0, jsx_runtime_1.jsx)(Select_1.default, { ref: sizeTextInputRef, data: Sizes, style: { marginLeft: 10, marginRight: 10 }, defaultValue: getDefaultValue() }), (0, jsx_runtime_1.jsx)("span", { style: styles.label, children: "Line Broadening: " }), (0, jsx_runtime_1.jsx)("input", { name: "line-broadening", style: styles.input, type: "number", defaultValue: lineBroadeningValue, onInput: handleInput, pattern: "^\\d*(\\.\\d{0,2})?$", step: "any" }), (0, jsx_runtime_1.jsx)(
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.label, children: "Size: " }), (0, jsx_runtime_1.jsx)(Select_1.default, { ref: sizeTextInputRef, data: Sizes, style: { marginLeft: 10, marginRight: 10 }, defaultValue: getDefaultValue() }), (0, jsx_runtime_1.jsx)("span", { style: styles.label, children: "Line Broadening: " }), (0, jsx_runtime_1.jsx)("input", { name: "line-broadening", style: styles.input, type: "number", defaultValue: lineBroadeningValue, onInput: handleInput, pattern: "^\\d*(\\.\\d{0,2})?$", step: "any" }), (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
|
|
76
69
|
}
|
|
77
70
|
exports.default = ZeroFillingOptionsPanel;
|
|
@@ -6,6 +6,7 @@ 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 DispatchContext_1 = require("../context/DispatchContext");
|
|
9
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
9
10
|
const NumberInput_1 = __importDefault(require("../elements/NumberInput"));
|
|
10
11
|
const Types_1 = require("../reducer/types/Types");
|
|
11
12
|
const styles = {
|
|
@@ -24,13 +25,6 @@ const styles = {
|
|
|
24
25
|
label: {
|
|
25
26
|
flex: '5',
|
|
26
27
|
},
|
|
27
|
-
actionButton: {
|
|
28
|
-
height: '100%',
|
|
29
|
-
borderRadius: '5px',
|
|
30
|
-
border: '0.55px solid #c7c7c7',
|
|
31
|
-
margin: '0px 5px',
|
|
32
|
-
userSelect: 'none',
|
|
33
|
-
},
|
|
34
28
|
};
|
|
35
29
|
function Zones2DOptionPanel() {
|
|
36
30
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
@@ -43,11 +37,6 @@ function Zones2DOptionPanel() {
|
|
|
43
37
|
},
|
|
44
38
|
});
|
|
45
39
|
}, [dispatch]);
|
|
46
|
-
const handleCancelFilter = (0, react_1.useCallback)(() => {
|
|
47
|
-
dispatch({
|
|
48
|
-
type: Types_1.RESET_SELECTED_TOOL,
|
|
49
|
-
});
|
|
50
|
-
}, [dispatch]);
|
|
51
40
|
const handleInput = (0, react_1.useCallback)((e) => {
|
|
52
41
|
if (e.target) {
|
|
53
42
|
dispatch({ type: Types_1.CHANGE_ZONES_NOISE_FACTOR, payload: e.target.value });
|
|
@@ -57,6 +46,6 @@ function Zones2DOptionPanel() {
|
|
|
57
46
|
input: styles.input,
|
|
58
47
|
inputContainer: styles.inputContainer,
|
|
59
48
|
label: styles.label,
|
|
60
|
-
}, defaultValue: 1, onChange: handleInput }), (0, jsx_runtime_1.jsx)(
|
|
49
|
+
}, defaultValue: 1, onChange: handleInput }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleApplyFilter, style: { margin: '0 10px' }, children: "Auto Zones Picking" })] }));
|
|
61
50
|
}
|
|
62
51
|
exports.default = Zones2DOptionPanel;
|
|
@@ -7,25 +7,27 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const SpectraManager_1 = require("../../data/SpectraManager");
|
|
9
9
|
const ChartContext_1 = require("../context/ChartContext");
|
|
10
|
+
const GlobalContext_1 = require("../context/GlobalContext");
|
|
10
11
|
const Alert_1 = require("../elements/popup/Alert");
|
|
11
12
|
const Modal_1 = require("../elements/popup/Modal");
|
|
12
13
|
const SaveAsModal_1 = __importDefault(require("../modal/SaveAsModal"));
|
|
13
14
|
const Export_1 = require("../utility/Export");
|
|
14
15
|
const nmriumToNmredata_1 = require("../utility/nmriumToNmredata");
|
|
15
16
|
function useExport() {
|
|
17
|
+
const { rootRef } = (0, GlobalContext_1.useGlobal)();
|
|
16
18
|
const modal = (0, Modal_1.useModal)();
|
|
17
19
|
const alert = (0, Alert_1.useAlert)();
|
|
18
20
|
const state = (0, ChartContext_1.useChartData)();
|
|
19
21
|
const saveToClipboardHandler = (0, react_1.useCallback)(async () => {
|
|
20
|
-
if (state.data.length > 0) {
|
|
22
|
+
if (state.data.length > 0 && rootRef) {
|
|
21
23
|
const hideLoading = await alert.showLoading('Exporting as NMRium process in progress');
|
|
22
24
|
setTimeout(() => {
|
|
23
|
-
(0, Export_1.copyPNGToClipboard)('nmrSVG');
|
|
25
|
+
(0, Export_1.copyPNGToClipboard)(rootRef, 'nmrSVG');
|
|
24
26
|
hideLoading();
|
|
25
27
|
alert.success('Image copied to clipboard');
|
|
26
28
|
}, 0);
|
|
27
29
|
}
|
|
28
|
-
}, [alert, state]);
|
|
30
|
+
}, [rootRef, alert, state]);
|
|
29
31
|
const saveAsJSONHandler = (0, react_1.useCallback)(async (spaceIndent = 0, isCompressed = true) => {
|
|
30
32
|
if (state.data.length > 0) {
|
|
31
33
|
const hideLoading = await alert.showLoading('Exporting as NMRium process in progress');
|
|
@@ -56,25 +58,25 @@ function useExport() {
|
|
|
56
58
|
}
|
|
57
59
|
}, [alert, state]);
|
|
58
60
|
const saveAsSVGHandler = (0, react_1.useCallback)(async () => {
|
|
59
|
-
if (state.data.length > 0) {
|
|
61
|
+
if (state.data.length > 0 && rootRef) {
|
|
60
62
|
const hideLoading = await alert.showLoading('Exporting as SVG process in progress');
|
|
61
63
|
setTimeout(() => {
|
|
62
64
|
const fileName = state.data[0]?.display?.name;
|
|
63
|
-
(0, Export_1.exportAsSVG)('nmrSVG', fileName);
|
|
65
|
+
(0, Export_1.exportAsSVG)(rootRef, 'nmrSVG', fileName);
|
|
64
66
|
hideLoading();
|
|
65
67
|
}, 0);
|
|
66
68
|
}
|
|
67
|
-
}, [alert, state.data]);
|
|
69
|
+
}, [rootRef, alert, state.data]);
|
|
68
70
|
const saveAsPNGHandler = (0, react_1.useCallback)(async () => {
|
|
69
|
-
if (state.data.length > 0) {
|
|
71
|
+
if (state.data.length > 0 && rootRef) {
|
|
70
72
|
const hideLoading = await alert.showLoading('Exporting as PNG process in progress');
|
|
71
73
|
setTimeout(() => {
|
|
72
74
|
const fileName = state.data[0]?.display?.name;
|
|
73
|
-
(0, Export_1.exportAsPng)('nmrSVG', fileName);
|
|
75
|
+
(0, Export_1.exportAsPng)(rootRef, 'nmrSVG', fileName);
|
|
74
76
|
hideLoading();
|
|
75
77
|
}, 0);
|
|
76
78
|
}
|
|
77
|
-
}, [alert, state.data]);
|
|
79
|
+
}, [rootRef, alert, state.data]);
|
|
78
80
|
const saveHandler = (0, react_1.useCallback)((options) => {
|
|
79
81
|
async function handler() {
|
|
80
82
|
const { name, pretty, compressed, dataExportOption } = options;
|
|
@@ -200,6 +200,7 @@ function DropZone(props) {
|
|
|
200
200
|
const { getRootProps, getInputProps, isDragActive, open: openImportDialog, } = (0, react_dropzone_1.useDropzone)({
|
|
201
201
|
onDrop,
|
|
202
202
|
noClick: true,
|
|
203
|
+
noKeyboard: true,
|
|
203
204
|
});
|
|
204
205
|
const open = (0, react_2.useCallback)(() => {
|
|
205
206
|
openImportDialog();
|
|
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const References_1 = require("../../data/constants/References");
|
|
10
10
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
11
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
11
12
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
12
13
|
const Label_1 = __importDefault(require("../elements/Label"));
|
|
13
14
|
const Select_1 = __importDefault(require("../elements/Select"));
|
|
@@ -56,6 +57,6 @@ function AlignSpectraModal({ onClose = () => null, nucleus, }) {
|
|
|
56
57
|
...resValues,
|
|
57
58
|
});
|
|
58
59
|
}, [nucleus]);
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Spectra calibration" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", style: { flex: 1 }, children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: { from: -1, to: 1, nbPeaks: 1, targetX: 0 }, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Options :" }), (0, jsx_runtime_1.jsx)(Select_1.default, { data: List, style: { width: 270, height: 30, marginBottom: '20px' }, onChange: optionChangeHandler })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Range :" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "to", type: "number" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: " margin-10", children: (0, jsx_runtime_1.jsx)(Label_1.default, { className: "custom-label", title: "Number of Peaks : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "nbPeaks", type: "number" }) }) }), (0, jsx_runtime_1.jsx)("div", { className: " margin-10", children: (0, jsx_runtime_1.jsx)(Label_1.default, { className: "custom-label", title: "Target PPM :", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "targetX", type: "number" }) }) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(
|
|
60
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Spectra calibration" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", style: { flex: 1 }, children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: { from: -1, to: 1, nbPeaks: 1, targetX: 0 }, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Options :" }), (0, jsx_runtime_1.jsx)(Select_1.default, { data: List, style: { width: 270, height: 30, marginBottom: '20px' }, onChange: optionChangeHandler })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Range :" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "to", type: "number" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: " margin-10", children: (0, jsx_runtime_1.jsx)(Label_1.default, { className: "custom-label", title: "Number of Peaks : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "nbPeaks", type: "number" }) }) }), (0, jsx_runtime_1.jsx)("div", { className: " margin-10", children: (0, jsx_runtime_1.jsx)(Label_1.default, { className: "custom-label", title: "Target PPM :", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "targetX", type: "number" }) }) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleSave, children: "Done" }) })] }));
|
|
60
61
|
}
|
|
61
62
|
exports.default = AlignSpectraModal;
|
|
@@ -7,6 +7,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const ChartContext_1 = require("../context/ChartContext");
|
|
10
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
10
11
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
11
12
|
const Label_1 = __importDefault(require("../elements/Label"));
|
|
12
13
|
const FormikForm_1 = __importDefault(require("../elements/formik/FormikForm"));
|
|
@@ -35,6 +36,6 @@ function ExportAsMatrixModal({ onClose = () => null, }) {
|
|
|
35
36
|
Events_1.default.off('brushEnd', handler);
|
|
36
37
|
};
|
|
37
38
|
}, []);
|
|
38
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Export spectra as a Matrix" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: INITIAL_VALUE, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Range :" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "to", type: "number" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "row margin-10", children: (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Number of Points :", className: "custom-label", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "nbPoints", type: "number" }) }) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Export spectra as a Matrix" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: INITIAL_VALUE, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Range :" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To : ", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "to", type: "number" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "row margin-10", children: (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Number of Points :", className: "custom-label", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "nbPoints", type: "number" }) }) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleSave, children: "Export Now" }) })] }));
|
|
39
40
|
}
|
|
40
41
|
exports.default = ExportAsMatrixModal;
|
|
@@ -32,6 +32,7 @@ const react_1 = require("@emotion/react");
|
|
|
32
32
|
const react_2 = require("react");
|
|
33
33
|
const yup = __importStar(require("yup"));
|
|
34
34
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
35
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
35
36
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
36
37
|
const FormikForm_1 = __importDefault(require("../elements/formik/FormikForm"));
|
|
37
38
|
const FormikTextarea_1 = __importDefault(require("../elements/formik/FormikTextarea"));
|
|
@@ -79,6 +80,6 @@ function ImportPublicationStringModal({ onClose, }) {
|
|
|
79
80
|
}, [alert, dispatch, onClose]);
|
|
80
81
|
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Import from publication string" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { ref: formRef, initialValues: {
|
|
81
82
|
publicationText: '1H NMR (CDCl3, 400MHz) δ 10.58 (b, 1H), 7.40 (d, 1H, J = 8.0 Hz), 6.19 (d, 1H, J = 7.6 Hz), 4.88 (s, 1H), 2.17 (s, 3H), 1.02 (s, 9H), 1.01 (s, 9H), 0.89 (s, 9H)',
|
|
82
|
-
}, validationSchema: validationSchema, onSubmit: publicationStringHandler, children: (0, jsx_runtime_1.jsx)(FormikTextarea_1.default, { name: "publicationText", className: "text-area", placeholder: "Enter publication string" }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(
|
|
83
|
+
}, validationSchema: validationSchema, onSubmit: publicationStringHandler, children: (0, jsx_runtime_1.jsx)(FormikTextarea_1.default, { name: "publicationText", className: "text-area", placeholder: "Enter publication string" }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: () => formRef.current.submitForm(), children: "Import" }) })] }));
|
|
83
84
|
}
|
|
84
85
|
exports.default = ImportPublicationStringModal;
|
|
@@ -7,6 +7,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const react_2 = require("react");
|
|
10
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
10
11
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
11
12
|
const FileUtility_1 = require("../utility/FileUtility");
|
|
12
13
|
const styles = (0, react_1.css) `
|
|
@@ -38,12 +39,13 @@ const styles = (0, react_1.css) `
|
|
|
38
39
|
.container {
|
|
39
40
|
display: flex;
|
|
40
41
|
margin: 30px 5px;
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
align-items: center;
|
|
43
|
+
height: 36px;
|
|
44
|
+
|
|
45
|
+
input {
|
|
43
46
|
padding: 5px;
|
|
44
47
|
border: 1px solid gray;
|
|
45
48
|
border-radius: 5px;
|
|
46
|
-
height: 36px;
|
|
47
49
|
margin: 2px;
|
|
48
50
|
}
|
|
49
51
|
input {
|
|
@@ -51,8 +53,7 @@ const styles = (0, react_1.css) `
|
|
|
51
53
|
}
|
|
52
54
|
button {
|
|
53
55
|
flex: 2;
|
|
54
|
-
|
|
55
|
-
background-color: gray;
|
|
56
|
+
height: 100%;
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
`;
|
|
@@ -78,6 +79,6 @@ function LoadJCAMPModal({ onLoadClick, onClose, startLoading, }) {
|
|
|
78
79
|
onLoadClick(null);
|
|
79
80
|
}
|
|
80
81
|
}, [onLoadClick, startLoading]);
|
|
81
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Load JCAMP Dialog" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose })] }), (0, jsx_runtime_1.jsxs)("div", { className: "container", children: [(0, jsx_runtime_1.jsx)("input", { ref: pathReft, type: "text", placeholder: "Enter URL to JCAMP-DX file" }), (0, jsx_runtime_1.jsx)(
|
|
82
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Load JCAMP Dialog" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose })] }), (0, jsx_runtime_1.jsxs)("div", { className: "container", children: [(0, jsx_runtime_1.jsx)("input", { ref: pathReft, type: "text", placeholder: "Enter URL to JCAMP-DX file" }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: loadJCAMPHandler, children: "Load" })] })] }));
|
|
82
83
|
}
|
|
83
84
|
exports.default = LoadJCAMPModal;
|
|
@@ -31,34 +31,12 @@ exports.ModalStyles = (0, react_1.css) `
|
|
|
31
31
|
overflow: auto;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
button:focus {
|
|
35
|
-
outline: none;
|
|
36
|
-
}
|
|
37
|
-
button:not([disabled]):hover {
|
|
38
|
-
color: black;
|
|
39
|
-
}
|
|
40
|
-
.btn:not([disabled]):hover {
|
|
41
|
-
background-color: #ffffff;
|
|
42
|
-
}
|
|
43
|
-
.btn:disabled {
|
|
44
|
-
opacity: 0.5;
|
|
45
|
-
}
|
|
46
|
-
.btn {
|
|
47
|
-
border: none;
|
|
48
|
-
padding: 0 15px;
|
|
49
|
-
background-color: #ffffff5e;
|
|
50
|
-
border-radius: 5px;
|
|
51
|
-
height: 25px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.primary {
|
|
55
|
-
background-color: #e2e2e2;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
34
|
.footer-container {
|
|
59
35
|
display: flex;
|
|
60
|
-
flex-direction: row
|
|
61
|
-
align-items:
|
|
36
|
+
flex-direction: row;
|
|
37
|
+
align-items: end;
|
|
38
|
+
justify-content: end;
|
|
39
|
+
|
|
62
40
|
background: rgb(242, 242, 242);
|
|
63
41
|
background: -moz-linear-gradient(
|
|
64
42
|
0deg,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
4
7
|
/** @jsxImportSource @emotion/react */
|
|
5
8
|
const react_1 = require("react");
|
|
6
9
|
const full_1 = require("react-ocl/full");
|
|
7
10
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
11
|
+
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
8
12
|
const Types_1 = require("../reducer/types/Types");
|
|
9
13
|
const ModalStyle_1 = require("./ModalStyle");
|
|
10
14
|
function MoleculeStructureEditorModal(props) {
|
|
@@ -36,6 +40,6 @@ function MoleculeStructureEditorModal(props) {
|
|
|
36
40
|
onClose('new');
|
|
37
41
|
}
|
|
38
42
|
}, [dispatch, selectedMolecule, molfile, onClose]);
|
|
39
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsx)(full_1.StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }), (0, jsx_runtime_1.
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsx)(full_1.StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleClose }) })] }));
|
|
40
44
|
}
|
|
41
45
|
exports.default = MoleculeStructureEditorModal;
|
|
@@ -33,6 +33,7 @@ const react_2 = require("react");
|
|
|
33
33
|
const Filters = __importStar(require("../../../data/Filters"));
|
|
34
34
|
const References_1 = require("../../../data/constants/References");
|
|
35
35
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
36
|
+
const ActionButtons_1 = __importDefault(require("../../elements/ActionButtons"));
|
|
36
37
|
const CloseButton_1 = __importDefault(require("../../elements/CloseButton"));
|
|
37
38
|
const Select_1 = __importDefault(require("../../elements/Select"));
|
|
38
39
|
const FormikForm_1 = __importDefault(require("../../elements/formik/FormikForm"));
|
|
@@ -142,6 +143,6 @@ function MultipleSpectraFiltersModal({ onClose = () => null, nucleus = '', }) {
|
|
|
142
143
|
break;
|
|
143
144
|
}
|
|
144
145
|
}, [filter, submitHandler]);
|
|
145
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Apply filters" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "inner-content container", children: [(0, jsx_runtime_1.jsx)("p", { className: "infoText", children: "This filter will use the exclusions zones defined in the first spectrum." }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Filter :" }), (0, jsx_runtime_1.jsx)(Select_1.default, { data: List, style: { width: 275, height: 30, margin: 0 }, onChange: filterChangeHandler })] }), filterOptions] }), (0, jsx_runtime_1.
|
|
146
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Apply filters" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "inner-content container", children: [(0, jsx_runtime_1.jsx)("p", { className: "infoText", children: "This filter will use the exclusions zones defined in the first spectrum." }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Filter :" }), (0, jsx_runtime_1.jsx)(Select_1.default, { data: List, style: { width: 275, height: 30, margin: 0 }, onChange: filterChangeHandler })] }), filterOptions] }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: onClose, cancelLabel: "Close" }) })] }));
|
|
146
147
|
}
|
|
147
148
|
exports.default = MultipleSpectraFiltersModal;
|
|
@@ -35,6 +35,7 @@ const PredictionManager_1 = require("../../data/PredictionManager");
|
|
|
35
35
|
const generateNumbersPowerOfX_1 = __importDefault(require("../../data/utilities/generateNumbersPowerOfX"));
|
|
36
36
|
const ChartContext_1 = require("../context/ChartContext");
|
|
37
37
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
38
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
38
39
|
const CheckBox_1 = __importDefault(require("../elements/CheckBox"));
|
|
39
40
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
40
41
|
const IsotopesViewer_1 = __importDefault(require("../elements/IsotopesViewer"));
|
|
@@ -88,12 +89,6 @@ const styles = (0, react_1.css) `
|
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
|
|
91
|
-
button[disabled],
|
|
92
|
-
button[disabled]:hover {
|
|
93
|
-
opacity: 0.5;
|
|
94
|
-
color: black;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
92
|
.middle-x {
|
|
98
93
|
padding: 0 10px;
|
|
99
94
|
}
|
|
@@ -189,6 +184,6 @@ function PredictSpectraModal({ onClose = () => null, molfile, }) {
|
|
|
189
184
|
const approveCheckHandler = (0, react_2.useCallback)((e) => {
|
|
190
185
|
setApproved(e.target.checked);
|
|
191
186
|
}, []);
|
|
192
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Prediction of NMR spectrum" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "inner-content", children: [(0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: initValues, validationSchema: predictionFormValidation, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsx)(FormikErrorsSummary_1.default, {}), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Name :" }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "name", style: { input: { width: '200px', textAlign: 'left' } } })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Spectrometer Frequency :" }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: PredictionManager_1.FREQUENCIES, style: { width: 290, height: 30, margin: 0 }, name: "frequency" })] }), (0, jsx_runtime_1.jsx)("span", { className: "group-label", children: "1D Options " }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "1H", className: "custom-label" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.to", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "13C", className: "custom-label" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.to", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Line Width : " }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.lineWidth", type: "number", style: { input: { margin: 0 } } }), (0, jsx_runtime_1.jsx)("span", { style: { paddingLeft: '0.4rem' }, children: " Hz " })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Number of Points : " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: NUMBER_OF_POINTS_1D, name: "1d.nbPoints", style: { width: 290, height: 30, margin: 0 } })] }), (0, jsx_runtime_1.jsx)("span", { className: "group-label", children: "2D Options " }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Number of Points : " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.x", style: { margin: 0, height: 30 } }), (0, jsx_runtime_1.jsx)("span", { className: "middle-x", children: " X " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.y", style: { margin: 0, height: 30 } })] }), (0, jsx_runtime_1.jsx)("div", { className: "row margin-10", children: (0, jsx_runtime_1.jsx)("span", { className: "group-label", children: "Spectra " }) }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", style: { justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.proton" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "1H", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.carbon" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "13C", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.cosy" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "COSY", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.hsqc" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "HSQC", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.hmbc" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "HMBC", className: "nucleus-label" })] })] })] }), (0, jsx_runtime_1.jsx)("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), (0, jsx_runtime_1.jsxs)("div", { className: "warning-container", children: [(0, jsx_runtime_1.jsx)(CheckBox_1.default, { onChange: approveCheckHandler, checked: isApproved }, String(isApproved)), (0, jsx_runtime_1.jsx)("p", { children: "I confirm that the chemical structure is not confidential." })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(
|
|
187
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Prediction of NMR spectrum" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "inner-content", children: [(0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: initValues, validationSchema: predictionFormValidation, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsx)(FormikErrorsSummary_1.default, {}), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Name :" }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "name", style: { input: { width: '200px', textAlign: 'left' } } })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Spectrometer Frequency :" }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: PredictionManager_1.FREQUENCIES, style: { width: 290, height: 30, margin: 0 }, name: "frequency" })] }), (0, jsx_runtime_1.jsx)("span", { className: "group-label", children: "1D Options " }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "1H", className: "custom-label" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.to", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "13C", className: "custom-label" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.to", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Line Width : " }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.lineWidth", type: "number", style: { input: { margin: 0 } } }), (0, jsx_runtime_1.jsx)("span", { style: { paddingLeft: '0.4rem' }, children: " Hz " })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Number of Points : " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: NUMBER_OF_POINTS_1D, name: "1d.nbPoints", style: { width: 290, height: 30, margin: 0 } })] }), (0, jsx_runtime_1.jsx)("span", { className: "group-label", children: "2D Options " }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Number of Points : " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.x", style: { margin: 0, height: 30 } }), (0, jsx_runtime_1.jsx)("span", { className: "middle-x", children: " X " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.y", style: { margin: 0, height: 30 } })] }), (0, jsx_runtime_1.jsx)("div", { className: "row margin-10", children: (0, jsx_runtime_1.jsx)("span", { className: "group-label", children: "Spectra " }) }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", style: { justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.proton" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "1H", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.carbon" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "13C", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.cosy" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "COSY", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.hsqc" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "HSQC", className: "nucleus-label" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "spectra.hmbc" }), (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "HMBC", className: "nucleus-label" })] })] })] }), (0, jsx_runtime_1.jsx)("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), (0, jsx_runtime_1.jsxs)("div", { className: "warning-container", children: [(0, jsx_runtime_1.jsx)(CheckBox_1.default, { onChange: approveCheckHandler, checked: isApproved }, String(isApproved)), (0, jsx_runtime_1.jsx)("p", { children: "I confirm that the chemical structure is not confidential." })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] }));
|
|
193
188
|
}
|
|
194
189
|
exports.default = PredictSpectraModal;
|
|
@@ -9,6 +9,7 @@ const react_1 = require("@emotion/react");
|
|
|
9
9
|
const formik_1 = require("formik");
|
|
10
10
|
const react_2 = require("react");
|
|
11
11
|
const SpectraManager_1 = require("../../data/SpectraManager");
|
|
12
|
+
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
12
13
|
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
13
14
|
const FormikCheckBox_1 = __importDefault(require("../elements/formik/FormikCheckBox"));
|
|
14
15
|
const FormikForm_1 = __importDefault(require("../elements/formik/FormikForm"));
|
|
@@ -61,6 +62,6 @@ function SaveAsModal({ onClose, onSave, name }) {
|
|
|
61
62
|
}, [onClose, onSave]);
|
|
62
63
|
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Save as ... " }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: { ...INITIAL_VALUE, name }, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Name" }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "name", className: "name", style: {
|
|
63
64
|
inputWrapper: { width: '100%' },
|
|
64
|
-
} })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Compressed" }), (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "compressed" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Pretty Format" }), (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "pretty" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: " Include " }), (0, jsx_runtime_1.jsxs)("div", { className: "data-export-group", children: [(0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)(formik_1.Field, { type: "radio", name: "dataExportOption", value: SpectraManager_1.DataExportOptions.ROW_DATA }), "Raw Data"] }), (0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)(formik_1.Field, { type: "radio", name: "dataExportOption", value: SpectraManager_1.DataExportOptions.DATA_SOURCE }), "Data Source"] })] })] })] }) }), (0, jsx_runtime_1.
|
|
65
|
+
} })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Compressed" }), (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "compressed" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Pretty Format" }), (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "pretty" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: " Include " }), (0, jsx_runtime_1.jsxs)("div", { className: "data-export-group", children: [(0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)(formik_1.Field, { type: "radio", name: "dataExportOption", value: SpectraManager_1.DataExportOptions.ROW_DATA }), "Raw Data"] }), (0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)(formik_1.Field, { type: "radio", name: "dataExportOption", value: SpectraManager_1.DataExportOptions.DATA_SOURCE }), "Data Source"] })] })] })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: () => onClose?.() }) })] }));
|
|
65
66
|
}
|
|
66
67
|
exports.default = SaveAsModal;
|
|
@@ -31,6 +31,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
31
31
|
const react_1 = require("@emotion/react");
|
|
32
32
|
const react_2 = require("react");
|
|
33
33
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
34
|
+
const ActionButtons_1 = __importDefault(require("../../elements/ActionButtons"));
|
|
34
35
|
const CloseButton_1 = __importDefault(require("../../elements/CloseButton"));
|
|
35
36
|
const Tab_1 = __importDefault(require("../../elements/Tab/Tab"));
|
|
36
37
|
const Tabs_1 = __importStar(require("../../elements/Tab/Tabs"));
|
|
@@ -173,6 +174,6 @@ function GeneralSettings({ onClose }) {
|
|
|
173
174
|
const renderItem = (0, react_2.useCallback)((item) => {
|
|
174
175
|
return ((0, jsx_runtime_1.jsx)(WorkspaceItem_1.default, { item: item, onSave: addWorkSpaceHandler, onDelete: deleteWorkSpaceHandler }));
|
|
175
176
|
}, [addWorkSpaceHandler, deleteWorkSpaceHandler]);
|
|
176
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "General Settings" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "workspace-container", children: [(0, jsx_runtime_1.jsx)("span", { className: "label", children: "Workspace : " }), (0, jsx_runtime_1.jsx)(DropDownButton_1.default, { data: workspacesList, renderItem: renderItem, selectedKey: preferences?.workspace.current, onSelect: ChangeWorkspaceHandler })] }), (0, jsx_runtime_1.jsx)("div", { className: "main-content", children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { ref: refForm, initialValues: preferences.current, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(Tabs_1.default, { position: Tabs_1.PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [(0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Controllers", tabid: "controllers", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(ControllersTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Formatting", tabid: "formatting", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(FormattingTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Display", tabid: "display", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(DisplayTabContent_1.default, { preferences: preferences.current.display }) }) })] }) }, JSON.stringify(preferences.current)) }), (0, jsx_runtime_1.
|
|
177
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "General Settings" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "workspace-container", children: [(0, jsx_runtime_1.jsx)("span", { className: "label", children: "Workspace : " }), (0, jsx_runtime_1.jsx)(DropDownButton_1.default, { data: workspacesList, renderItem: renderItem, selectedKey: preferences?.workspace.current, onSelect: ChangeWorkspaceHandler })] }), (0, jsx_runtime_1.jsx)("div", { className: "main-content", children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { ref: refForm, initialValues: preferences.current, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(Tabs_1.default, { position: Tabs_1.PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [(0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Controllers", tabid: "controllers", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(ControllersTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Formatting", tabid: "formatting", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(FormattingTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Display", tabid: "display", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(DisplayTabContent_1.default, { preferences: preferences.current.display }) }) })] }) }, JSON.stringify(preferences.current)) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleReset, cancelLabel: "Reset" }) })] }));
|
|
177
178
|
}
|
|
178
179
|
exports.default = GeneralSettings;
|
|
@@ -11,6 +11,7 @@ const react_2 = require("react");
|
|
|
11
11
|
const fa_1 = require("react-icons/fa");
|
|
12
12
|
const assignment_1 = require("../../assignment");
|
|
13
13
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
14
|
+
const GlobalContext_1 = require("../../context/GlobalContext");
|
|
14
15
|
const ButtonToolTip_1 = __importDefault(require("../../elements/ButtonToolTip"));
|
|
15
16
|
const MenuButton_1 = __importDefault(require("../../elements/MenuButton"));
|
|
16
17
|
const ToolTip_1 = __importDefault(require("../../elements/ToolTip/ToolTip"));
|
|
@@ -61,17 +62,22 @@ const MOL_EXPORT_MENU = [
|
|
|
61
62
|
},
|
|
62
63
|
];
|
|
63
64
|
function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange = () => null, onOpenMoleculeEditor = () => null, actionsOptions = {}, }) {
|
|
65
|
+
const { rootRef } = (0, GlobalContext_1.useGlobal)();
|
|
64
66
|
const alert = (0, Alert_1.useAlert)();
|
|
65
67
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
66
68
|
const modal = (0, Modal_1.useModal)();
|
|
67
69
|
const assignmentData = (0, assignment_1.useAssignmentData)();
|
|
68
70
|
const saveAsSVGHandler = (0, react_2.useCallback)(() => {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
if (!rootRef)
|
|
72
|
+
return;
|
|
73
|
+
(0, Export_1.exportAsSVG)(rootRef, `molSVG${currentIndex}`, 'molFile');
|
|
74
|
+
}, [rootRef, currentIndex]);
|
|
71
75
|
const saveAsPNGHandler = (0, react_2.useCallback)(() => {
|
|
72
|
-
|
|
76
|
+
if (!rootRef)
|
|
77
|
+
return;
|
|
78
|
+
(0, Export_1.copyPNGToClipboard)(rootRef, `molSVG${currentIndex}`);
|
|
73
79
|
alert.success('MOL copied as PNG to clipboard');
|
|
74
|
-
}, [alert, currentIndex]);
|
|
80
|
+
}, [rootRef, alert, currentIndex]);
|
|
75
81
|
const saveAsMolHandler = (0, react_2.useCallback)(() => {
|
|
76
82
|
if (molecules[currentIndex]) {
|
|
77
83
|
void (0, Export_1.copyTextToClipboard)(molecules[currentIndex].molfile).then((flag) => {
|