@complat/react-spectra-editor 1.0.0-rc2 → 1.0.0-rc20.patch-1
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/README.md +16 -0
- package/dist/__tests__/fixtures/aif_jcamp_1.js +136 -0
- package/dist/__tests__/fixtures/aif_jcamp_2.js +122 -0
- package/dist/__tests__/fixtures/backup/nmr1h_a.js +3518 -0
- package/dist/__tests__/fixtures/backup/xrd_jcamp_1.js +10705 -0
- package/dist/__tests__/fixtures/cds_jcamp.js +861 -0
- package/dist/__tests__/fixtures/compare_ir_1_jcamp.js +585 -0
- package/dist/__tests__/fixtures/compare_ir_2_jcamp.js +515 -0
- package/dist/__tests__/fixtures/compare_uv_vis_jcamp.js +640 -0
- package/dist/__tests__/fixtures/cyclic_voltammetry_1.js +778 -0
- package/dist/__tests__/fixtures/cyclic_voltammetry_2.js +758 -0
- package/dist/__tests__/fixtures/cyclic_voltammetry_3.js +759 -0
- package/dist/__tests__/fixtures/dls_acf_jcamp.js +148 -0
- package/dist/__tests__/fixtures/dls_intensity_jcamp.js +151 -0
- package/dist/__tests__/fixtures/emissions_jcamp.js +883 -0
- package/dist/__tests__/fixtures/hplc_uvvis_jcamp.js +638 -0
- package/dist/__tests__/fixtures/hplc_uvvis_jcamp_2.js +221 -0
- package/dist/__tests__/fixtures/ir_jcamp.js +148 -0
- package/dist/__tests__/fixtures/ir_result.js +46 -0
- package/dist/__tests__/fixtures/ir_svg.js +8 -0
- package/dist/__tests__/fixtures/ms_jcamp.js +64 -0
- package/dist/__tests__/fixtures/nmr13c_dept_jcamp.js +3543 -0
- package/dist/__tests__/fixtures/nmr13c_jcamp.js +1229 -0
- package/dist/__tests__/fixtures/nmr15n_jcamp.js +7177 -0
- package/dist/__tests__/fixtures/nmr19f_jcamp.js +6560 -0
- package/dist/__tests__/fixtures/nmr1h_2_jcamp.js +2005 -0
- package/dist/__tests__/fixtures/nmr1h_jcamp.js +4516 -0
- package/dist/__tests__/fixtures/nmr29si_jcamp.js +3029 -0
- package/dist/__tests__/fixtures/nmr31p_jcamp.js +3418 -0
- package/dist/__tests__/fixtures/nmr_result.js +68 -0
- package/dist/__tests__/fixtures/nmr_svg.js +8 -0
- package/dist/__tests__/fixtures/phenylalanin.js +142 -0
- package/dist/__tests__/fixtures/qDescValue.js +65 -0
- package/dist/__tests__/fixtures/raman_jcamp.js +410 -0
- package/dist/__tests__/fixtures/sec_1_jcamp.js +425 -0
- package/dist/__tests__/fixtures/sec_2_jcamp.js +407 -0
- package/dist/__tests__/fixtures/sec_3_jcamp.js +408 -0
- package/dist/__tests__/fixtures/sec_4_jcamp.js +407 -0
- package/dist/__tests__/fixtures/tga_jcamp.js +4157 -0
- package/dist/__tests__/fixtures/uv_vis_jcamp.js +249 -0
- package/dist/__tests__/fixtures/xrd_jcamp_1.js +436 -0
- package/dist/__tests__/fixtures/xrd_jcamp_2.js +955 -0
- package/dist/__tests__/fixtures/xrd_jcamp_3.js +1871 -0
- package/dist/__tests__/units/components/panel/graph_selection.test.js +72 -0
- package/dist/__tests__/units/components/panel/peaks.test.js +87 -0
- package/dist/actions/curve.js +15 -14
- package/dist/actions/cyclic_voltammetry.js +40 -60
- package/dist/actions/edit_peak.js +8 -12
- package/dist/actions/forecast.js +16 -24
- package/dist/actions/integration.js +12 -18
- package/dist/actions/jcamp.js +16 -24
- package/dist/actions/layout.js +4 -6
- package/dist/actions/manager.js +20 -30
- package/dist/actions/meta.js +4 -6
- package/dist/actions/multiplicity.js +24 -36
- package/dist/actions/scan.js +12 -18
- package/dist/actions/shift.js +8 -12
- package/dist/actions/status.js +12 -18
- package/dist/actions/submit.js +16 -24
- package/dist/actions/threshold.js +20 -30
- package/dist/actions/ui.js +25 -31
- package/dist/actions/wavelength.js +4 -6
- package/dist/app.js +25 -23
- package/dist/components/cmd_bar/01_viewer.js +24 -34
- package/dist/components/cmd_bar/02_zoom.js +18 -28
- package/dist/components/cmd_bar/03_peak.js +50 -66
- package/dist/components/cmd_bar/04_integration.js +70 -84
- package/dist/components/cmd_bar/05_multiplicity.js +42 -56
- package/dist/components/cmd_bar/06_undo_redo.js +22 -36
- package/dist/components/cmd_bar/07_pecker.js +24 -34
- package/dist/components/cmd_bar/common.js +11 -7
- package/dist/components/cmd_bar/index.js +17 -23
- package/dist/components/cmd_bar/r01_layout.js +79 -56
- package/dist/components/cmd_bar/r02_scan.js +70 -87
- package/dist/components/cmd_bar/r03_threshold.js +54 -68
- package/dist/components/cmd_bar/r04_submit.js +71 -83
- package/dist/components/cmd_bar/r05_submit_btn.js +64 -72
- package/dist/components/cmd_bar/r06_predict_btn.js +142 -152
- package/dist/components/cmd_bar/r07_wavelength_btn.js +28 -36
- package/dist/components/cmd_bar/tri_btn.js +91 -113
- package/dist/components/common/chem.js +2 -3
- package/dist/components/common/comps.js +2 -2
- package/dist/components/common/draw.js +30 -11
- package/dist/components/d3_line/index.js +154 -176
- package/dist/components/d3_line/line_focus.js +595 -739
- package/dist/components/d3_multi/index.js +153 -174
- package/dist/components/d3_multi/multi_focus.js +725 -850
- package/dist/components/d3_rect/index.js +112 -134
- package/dist/components/d3_rect/rect_focus.js +163 -208
- package/dist/components/forecast/comps.js +60 -68
- package/dist/components/forecast/ir_comps.js +49 -56
- package/dist/components/forecast/ir_viewer.js +61 -68
- package/dist/components/forecast/nmr_comps.js +62 -72
- package/dist/components/forecast/nmr_viewer.js +59 -68
- package/dist/components/forecast/section_loading.js +39 -63
- package/dist/components/forecast_viewer.js +109 -119
- package/dist/components/multi_jcamps_viewer.js +97 -113
- package/dist/components/panel/compare.js +183 -192
- package/dist/components/panel/cyclic_voltamery_data.js +149 -165
- package/dist/components/panel/graph_selection.js +143 -132
- package/dist/components/panel/index.js +112 -144
- package/dist/components/panel/info.js +125 -132
- package/dist/components/panel/multiplicity.js +215 -223
- package/dist/components/panel/multiplicity_coupling.js +108 -136
- package/dist/components/panel/multiplicity_select.js +43 -51
- package/dist/components/panel/peaks.js +130 -132
- package/dist/constants/action_type.js +23 -39
- package/dist/constants/list_layout.js +7 -4
- package/dist/constants/list_shift.js +117 -103
- package/dist/constants/list_ui.js +3 -6
- package/dist/constants/list_wavelength.js +7 -8
- package/dist/fn.js +2 -3
- package/dist/helpers/brush.js +49 -65
- package/dist/helpers/calc.js +2 -4
- package/dist/helpers/carbonFeatures.js +22 -20
- package/dist/helpers/cfg.js +49 -67
- package/dist/helpers/chem.js +450 -393
- package/dist/helpers/compass.js +92 -83
- package/dist/helpers/converter.js +52 -65
- package/dist/helpers/extractParams.js +60 -52
- package/dist/helpers/extractPeaksEdit.js +29 -25
- package/dist/helpers/focus.js +2 -6
- package/dist/helpers/format.js +416 -361
- package/dist/helpers/init.js +41 -37
- package/dist/helpers/integration.js +18 -21
- package/dist/helpers/mount.js +57 -61
- package/dist/helpers/multiplicity.js +19 -24
- package/dist/helpers/multiplicity_calc.js +39 -50
- package/dist/helpers/multiplicity_complat.js +21 -47
- package/dist/helpers/multiplicity_manual.js +49 -55
- package/dist/helpers/multiplicity_verify_basic.js +108 -111
- package/dist/helpers/shift.js +15 -23
- package/dist/helpers/zoom.js +7 -11
- package/dist/index.js +680 -630
- package/dist/layer_content.js +40 -43
- package/dist/layer_init.js +162 -184
- package/dist/layer_prism.js +38 -41
- package/dist/reducers/index.js +2 -3
- package/dist/reducers/reducer_curve.js +35 -26
- package/dist/reducers/reducer_edit_peak.js +122 -98
- package/dist/reducers/reducer_forecast.js +57 -44
- package/dist/reducers/reducer_integration.js +135 -103
- package/dist/reducers/reducer_jcamp.js +49 -44
- package/dist/reducers/reducer_layout.js +5 -6
- package/dist/reducers/reducer_manager.js +5 -6
- package/dist/reducers/reducer_meta.js +5 -6
- package/dist/reducers/reducer_multiplicity.js +100 -77
- package/dist/reducers/reducer_scan.js +17 -20
- package/dist/reducers/reducer_shift.js +115 -70
- package/dist/reducers/reducer_simulation.js +7 -8
- package/dist/reducers/reducer_status.js +5 -6
- package/dist/reducers/reducer_submit.js +12 -15
- package/dist/reducers/reducer_threshold.js +5 -6
- package/dist/reducers/reducer_ui.js +5 -6
- package/dist/reducers/reducer_voltammetry.js +156 -96
- package/dist/reducers/reducer_wavelength.js +5 -6
- package/dist/reducers/undo_redo_config.js +3 -5
- package/dist/sagas/index.js +2 -15
- package/dist/sagas/saga_edit_peak.js +54 -68
- package/dist/sagas/saga_manager.js +86 -130
- package/dist/sagas/saga_meta.js +25 -31
- package/dist/sagas/saga_multi_entities.js +40 -103
- package/dist/sagas/saga_multiplicity.js +336 -406
- package/dist/sagas/saga_ui.js +296 -475
- package/dist/setupTests.js +8 -0
- package/dist/third_party/jAnalyzer.js +66 -67
- package/dist/third_party/peakInterval.js +34 -34
- package/package.json +14 -14
- package/dist/components/cmd_bar/03_peak_bk.js +0 -139
- package/dist/components/cmd_bar/04_integration_bk.js +0 -180
- package/dist/components/cmd_bar/05_multiplicity_bk.js +0 -131
- package/dist/components/cmd_bar/r01_layout_bk.js +0 -186
- package/dist/components/cmd_bar/r06_predict_btn_bk.js +0 -220
- package/dist/components/d3_line/line_focus_bk.js +0 -825
- package/dist/components/d3_multi/index_bk.js +0 -210
- package/dist/components/d3_multi/multi_focus_bk.js +0 -533
- package/dist/components/panel/compare_bk.js +0 -256
- package/dist/components/panel/cyclic_voltamery_data_bk.js +0 -292
- package/dist/components/panel/index_bk.js +0 -178
- package/dist/components/panel/info_bk.js +0 -235
- package/dist/components/panel/multiplicity_bk.js +0 -280
- package/dist/helpers/carbonFeatures_bk.js +0 -45
- package/dist/helpers/cfg_bk.js +0 -80
- package/dist/helpers/chem_bk.js +0 -787
- package/dist/helpers/compass_bk.js +0 -149
- package/dist/helpers/converter_bk.js +0 -96
- package/dist/helpers/extractPeaksEdit_bk.js +0 -53
- package/dist/helpers/format_bk.js +0 -497
- package/dist/index_bk.js +0 -640
- package/dist/layer_content_bk.js +0 -105
- package/dist/layer_init_bk.js +0 -235
- package/dist/layer_prism_bk.js +0 -133
- package/dist/reducers/reducer_edit_peak_bk.js +0 -108
- package/dist/reducers/reducer_integration_bk.js +0 -134
- package/dist/reducers/reducer_jcamp_bk.js +0 -71
- package/dist/reducers/reducer_multiplicity_bk.js +0 -126
- package/dist/reducers/reducer_shift_bk.js +0 -88
- package/dist/reducers/reducer_voltammetry_bk.js +0 -287
- package/dist/sagas/saga_edit_peak_bk.js +0 -73
- package/dist/sagas/saga_multi_entities_bk.js +0 -106
- package/dist/sagas/saga_multiplicity_bk.js +0 -351
- package/dist/sagas/saga_ui_bk.js +0 -453
|
@@ -12,8 +12,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
12
12
|
var _reactRedux = require("react-redux");
|
|
13
13
|
var _redux = require("redux");
|
|
14
14
|
var _reactDropzone = _interopRequireDefault(require("react-dropzone"));
|
|
15
|
-
var
|
|
16
|
-
var _ExpansionPanelSummary = _interopRequireDefault(require("@material-ui/core/ExpansionPanelSummary"));
|
|
15
|
+
var _core = require("@material-ui/core");
|
|
17
16
|
var _ExpandMore = _interopRequireDefault(require("@material-ui/icons/ExpandMore"));
|
|
18
17
|
var _HighlightOff = _interopRequireDefault(require("@material-ui/icons/HighlightOff"));
|
|
19
18
|
var _Table = _interopRequireDefault(require("@material-ui/core/Table"));
|
|
@@ -31,122 +30,120 @@ var _jcamp = require("../../actions/jcamp");
|
|
|
31
30
|
/* eslint-disable function-paren-newline, react/jsx-props-no-spreading,
|
|
32
31
|
react/function-component-definition */
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
backgroundColor: theme.palette.background.default
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
rmBtn: {
|
|
67
|
-
color: 'red',
|
|
68
|
-
padding: '0 5px 0 5px',
|
|
69
|
-
'&:hover': {
|
|
70
|
-
borderRadius: 12,
|
|
71
|
-
backgroundColor: 'red',
|
|
72
|
-
color: 'white'
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
showBtn: {
|
|
76
|
-
color: 'steelblue',
|
|
77
|
-
padding: '0 5px 0 5px',
|
|
78
|
-
'&:hover': {
|
|
79
|
-
borderRadius: 12,
|
|
80
|
-
backgroundColor: 'steelblue',
|
|
81
|
-
color: 'white'
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
hideBtn: {
|
|
85
|
-
color: 'gray',
|
|
86
|
-
padding: '0 5px 0 5px',
|
|
87
|
-
'&:hover': {
|
|
88
|
-
borderRadius: 12,
|
|
89
|
-
backgroundColor: 'gray',
|
|
90
|
-
color: 'white'
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
square: {
|
|
94
|
-
textAlign: 'center !important'
|
|
95
|
-
},
|
|
96
|
-
baseDD: {
|
|
97
|
-
backgroundColor: 'white',
|
|
98
|
-
border: '1px dashed black',
|
|
99
|
-
borderRadius: 5,
|
|
100
|
-
height: 26,
|
|
101
|
-
lineHeight: '26px',
|
|
102
|
-
margin: '7px 0 7px 0',
|
|
103
|
-
textAlign: 'center',
|
|
104
|
-
verticalAlign: 'middle',
|
|
105
|
-
width: '90%'
|
|
106
|
-
},
|
|
107
|
-
enableDD: {
|
|
108
|
-
border: '2px dashed #000',
|
|
109
|
-
color: '#000'
|
|
110
|
-
},
|
|
111
|
-
disableDD: {
|
|
112
|
-
border: '2px dashed #aaa',
|
|
113
|
-
color: '#aaa'
|
|
114
|
-
},
|
|
115
|
-
tpCard: {},
|
|
116
|
-
tpMoreTxt: {
|
|
117
|
-
padding: '0 0 0 60px'
|
|
118
|
-
},
|
|
119
|
-
tpLabel: {
|
|
120
|
-
fontSize: 16
|
|
33
|
+
const styles = theme => ({
|
|
34
|
+
panel: {
|
|
35
|
+
backgroundColor: '#eee',
|
|
36
|
+
display: 'table-row'
|
|
37
|
+
},
|
|
38
|
+
panelSummary: {
|
|
39
|
+
backgroundColor: '#eee',
|
|
40
|
+
height: 32
|
|
41
|
+
},
|
|
42
|
+
txtBadge: {},
|
|
43
|
+
panelDetail: {
|
|
44
|
+
backgroundColor: '#fff',
|
|
45
|
+
maxHeight: 'calc(90vh - 220px)',
|
|
46
|
+
// ROI
|
|
47
|
+
overflow: 'auto'
|
|
48
|
+
},
|
|
49
|
+
table: {
|
|
50
|
+
width: '100%'
|
|
51
|
+
},
|
|
52
|
+
tTxt: {
|
|
53
|
+
padding: 0
|
|
54
|
+
},
|
|
55
|
+
tTxtHide: {
|
|
56
|
+
color: '#D5D8DC'
|
|
57
|
+
},
|
|
58
|
+
tRow: {
|
|
59
|
+
height: 28,
|
|
60
|
+
'&:nth-of-type(even)': {
|
|
61
|
+
backgroundColor: theme.palette.background.default
|
|
121
62
|
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
63
|
+
},
|
|
64
|
+
rmBtn: {
|
|
65
|
+
color: 'red',
|
|
66
|
+
padding: '0 5px 0 5px',
|
|
67
|
+
'&:hover': {
|
|
68
|
+
borderRadius: 12,
|
|
69
|
+
backgroundColor: 'red',
|
|
70
|
+
color: 'white'
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
showBtn: {
|
|
74
|
+
color: 'steelblue',
|
|
75
|
+
padding: '0 5px 0 5px',
|
|
76
|
+
'&:hover': {
|
|
77
|
+
borderRadius: 12,
|
|
78
|
+
backgroundColor: 'steelblue',
|
|
79
|
+
color: 'white'
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
hideBtn: {
|
|
83
|
+
color: 'gray',
|
|
84
|
+
padding: '0 5px 0 5px',
|
|
85
|
+
'&:hover': {
|
|
86
|
+
borderRadius: 12,
|
|
87
|
+
backgroundColor: 'gray',
|
|
88
|
+
color: 'white'
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
square: {
|
|
92
|
+
textAlign: 'center !important'
|
|
93
|
+
},
|
|
94
|
+
baseDD: {
|
|
95
|
+
backgroundColor: 'white',
|
|
96
|
+
border: '1px dashed black',
|
|
97
|
+
borderRadius: 5,
|
|
98
|
+
height: 26,
|
|
99
|
+
lineHeight: '26px',
|
|
100
|
+
margin: '7px 0 7px 0',
|
|
101
|
+
textAlign: 'center',
|
|
102
|
+
verticalAlign: 'middle',
|
|
103
|
+
width: '90%'
|
|
104
|
+
},
|
|
105
|
+
enableDD: {
|
|
106
|
+
border: '2px dashed #000',
|
|
107
|
+
color: '#000'
|
|
108
|
+
},
|
|
109
|
+
disableDD: {
|
|
110
|
+
border: '2px dashed #aaa',
|
|
111
|
+
color: '#aaa'
|
|
112
|
+
},
|
|
113
|
+
tpCard: {},
|
|
114
|
+
tpMoreTxt: {
|
|
115
|
+
padding: '0 0 0 60px'
|
|
116
|
+
},
|
|
117
|
+
tpLabel: {
|
|
118
|
+
fontSize: 16
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
const msgDefault = 'Add spectra to compare.';
|
|
122
|
+
const tpHint = classes => /*#__PURE__*/_react.default.createElement("span", {
|
|
123
|
+
className: (0, _classnames.default)(classes.tpCard)
|
|
124
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
125
|
+
className: (0, _classnames.default)(classes.tpLabel, 'txt-sv-tp')
|
|
126
|
+
}, "- Accept *.dx, *.jdx, *.JCAMP,"), /*#__PURE__*/_react.default.createElement("p", {
|
|
127
|
+
className: (0, _classnames.default)(classes.tpLabel, 'txt-sv-tp')
|
|
128
|
+
}, "- Max 5 spectra."));
|
|
129
|
+
const content = (classes, desc) => /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
130
|
+
title: tpHint(classes),
|
|
131
|
+
placement: "bottom"
|
|
132
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
133
|
+
className: (0, _classnames.default)(classes.tpLabel, 'txt-sv-tp')
|
|
134
|
+
}, desc));
|
|
135
|
+
const inputOthers = (classes, jcampSt) => {
|
|
136
|
+
const {
|
|
137
|
+
selectedIdx,
|
|
138
|
+
jcamps
|
|
139
|
+
} = jcampSt;
|
|
140
|
+
const selectedJcamp = jcamps[selectedIdx];
|
|
141
|
+
const {
|
|
142
|
+
addOthersCb
|
|
143
|
+
} = selectedJcamp;
|
|
144
|
+
const fileName = '';
|
|
145
|
+
const desc = fileName || msgDefault;
|
|
146
|
+
const onDrop = jcampFiles => {
|
|
150
147
|
if (!addOthersCb) return;
|
|
151
148
|
addOthersCb({
|
|
152
149
|
jcamps: jcampFiles
|
|
@@ -155,79 +152,79 @@ var inputOthers = function inputOthers(classes, jcampSt) {
|
|
|
155
152
|
return /*#__PURE__*/_react.default.createElement(_reactDropzone.default, {
|
|
156
153
|
className: "dropbox",
|
|
157
154
|
onDrop: onDrop
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
|
|
155
|
+
}, _ref => {
|
|
156
|
+
let {
|
|
157
|
+
getRootProps,
|
|
158
|
+
getInputProps
|
|
159
|
+
} = _ref;
|
|
161
160
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, getRootProps(), {
|
|
162
161
|
className: (0, _classnames.default)(classes.baseDD)
|
|
163
162
|
}), /*#__PURE__*/_react.default.createElement("input", getInputProps()), content(classes, desc));
|
|
164
163
|
});
|
|
165
164
|
};
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
};
|
|
184
|
-
});
|
|
165
|
+
const compareList = (classes, jcampSt, rmOthersOneAct, toggleShowAct) => {
|
|
166
|
+
const {
|
|
167
|
+
selectedIdx,
|
|
168
|
+
jcamps
|
|
169
|
+
} = jcampSt;
|
|
170
|
+
const selectedJcamp = jcamps[selectedIdx];
|
|
171
|
+
const {
|
|
172
|
+
others
|
|
173
|
+
} = selectedJcamp;
|
|
174
|
+
const rows = others.map((o, idx) => ({
|
|
175
|
+
idx,
|
|
176
|
+
title: o.spectra[0].title,
|
|
177
|
+
color: _format.default.compareColors(idx),
|
|
178
|
+
rmCb: () => rmOthersOneAct(idx),
|
|
179
|
+
isShow: o.show,
|
|
180
|
+
toggleShowCb: () => toggleShowAct(idx)
|
|
181
|
+
}));
|
|
185
182
|
return /*#__PURE__*/_react.default.createElement(_Table.default, {
|
|
186
183
|
className: classes.table
|
|
187
|
-
}, /*#__PURE__*/_react.default.createElement(_TableBody.default, null, rows.map(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
})));
|
|
214
|
-
})));
|
|
184
|
+
}, /*#__PURE__*/_react.default.createElement(_TableBody.default, null, rows.map(row => /*#__PURE__*/_react.default.createElement(_TableRow.default, {
|
|
185
|
+
key: row.idx,
|
|
186
|
+
className: classes.tRow,
|
|
187
|
+
hover: true
|
|
188
|
+
}, /*#__PURE__*/_react.default.createElement(_TableCell.default, {
|
|
189
|
+
align: "right",
|
|
190
|
+
className: (0, _classnames.default)(classes.tTxt, classes.square, 'txt-sv-panel-txt'),
|
|
191
|
+
style: {
|
|
192
|
+
backgroundColor: row.color
|
|
193
|
+
}
|
|
194
|
+
}, row.idx + 1), /*#__PURE__*/_react.default.createElement(_TableCell.default, {
|
|
195
|
+
align: "right",
|
|
196
|
+
className: (0, _classnames.default)(classes.tTxt, 'txt-sv-panel-txt', row.isShow ? null : classes.tTxtHide)
|
|
197
|
+
}, row.title), /*#__PURE__*/_react.default.createElement(_TableCell.default, {
|
|
198
|
+
align: "right",
|
|
199
|
+
className: (0, _classnames.default)(classes.tTxt, 'txt-sv-panel-txt')
|
|
200
|
+
}, row.isShow ? /*#__PURE__*/_react.default.createElement(_VisibilityOutlined.default, {
|
|
201
|
+
onClick: row.toggleShowCb,
|
|
202
|
+
className: classes.showBtn
|
|
203
|
+
}) : /*#__PURE__*/_react.default.createElement(_VisibilityOffOutlined.default, {
|
|
204
|
+
onClick: row.toggleShowCb,
|
|
205
|
+
className: classes.hideBtn
|
|
206
|
+
}), /*#__PURE__*/_react.default.createElement(_HighlightOff.default, {
|
|
207
|
+
onClick: row.rmCb,
|
|
208
|
+
className: classes.rmBtn
|
|
209
|
+
}))))));
|
|
215
210
|
};
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
211
|
+
const ComparePanel = _ref2 => {
|
|
212
|
+
let {
|
|
213
|
+
classes,
|
|
214
|
+
expand,
|
|
215
|
+
onExapnd,
|
|
216
|
+
jcampSt,
|
|
217
|
+
rmOthersOneAct,
|
|
218
|
+
toggleShowAct
|
|
219
|
+
} = _ref2;
|
|
220
|
+
return /*#__PURE__*/_react.default.createElement(_core.Accordion, {
|
|
224
221
|
expanded: expand,
|
|
225
222
|
onChange: onExapnd,
|
|
226
223
|
className: (0, _classnames.default)(classes.panel),
|
|
227
224
|
TransitionProps: {
|
|
228
225
|
unmountOnExit: true
|
|
229
226
|
} // increase ExpansionPanel performance
|
|
230
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
227
|
+
}, /*#__PURE__*/_react.default.createElement(_core.AccordionSummary, {
|
|
231
228
|
expandIcon: /*#__PURE__*/_react.default.createElement(_ExpandMore.default, null),
|
|
232
229
|
className: (0, _classnames.default)(classes.panelSummary)
|
|
233
230
|
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
@@ -238,20 +235,15 @@ var ComparePanel = function ComparePanel(_ref2) {
|
|
|
238
235
|
className: (0, _classnames.default)(classes.panelDetail)
|
|
239
236
|
}, compareList(classes, jcampSt, rmOthersOneAct, toggleShowAct)));
|
|
240
237
|
};
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
return (0, _redux.bindActionCreators)({
|
|
251
|
-
rmOthersOneAct: _jcamp.rmOthersOne,
|
|
252
|
-
toggleShowAct: _jcamp.toggleShow
|
|
253
|
-
}, dispatch);
|
|
254
|
-
};
|
|
238
|
+
const mapStateToProps = (state, props) => (
|
|
239
|
+
// eslint-disable-line
|
|
240
|
+
{
|
|
241
|
+
jcampSt: state.jcamp
|
|
242
|
+
});
|
|
243
|
+
const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({
|
|
244
|
+
rmOthersOneAct: _jcamp.rmOthersOne,
|
|
245
|
+
toggleShowAct: _jcamp.toggleShow
|
|
246
|
+
}, dispatch);
|
|
255
247
|
ComparePanel.propTypes = {
|
|
256
248
|
classes: _propTypes.default.object.isRequired,
|
|
257
249
|
expand: _propTypes.default.bool.isRequired,
|
|
@@ -260,5 +252,4 @@ ComparePanel.propTypes = {
|
|
|
260
252
|
rmOthersOneAct: _propTypes.default.func.isRequired,
|
|
261
253
|
toggleShowAct: _propTypes.default.func.isRequired
|
|
262
254
|
};
|
|
263
|
-
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)((0, _styles.withStyles)(styles)(ComparePanel));
|
|
264
|
-
exports.default = _default;
|
|
255
|
+
var _default = exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)((0, _styles.withStyles)(styles)(ComparePanel));
|