@complat/react-spectra-editor 1.3.5 → 1.4.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.
Files changed (95) hide show
  1. package/dist/__tests__/fixtures/nmr1h_2_jcamp.js +3199 -1944
  2. package/dist/__tests__/units/components/cmd_bar/01_viewer.test.js +21 -18
  3. package/dist/__tests__/units/components/cmd_bar/02_zoom.test.js +15 -13
  4. package/dist/__tests__/units/components/cmd_bar/03_peak.test.js +35 -26
  5. package/dist/__tests__/units/components/cmd_bar/07_pecker.test.js +17 -14
  6. package/dist/__tests__/units/components/cmd_bar/r08_change_axes.test.js +15 -13
  7. package/dist/__tests__/units/components/common/comps.test.js +9 -8
  8. package/dist/__tests__/units/components/common/draw.test.js +26 -34
  9. package/dist/__tests__/units/components/panel/graph_selection.test.js +25 -22
  10. package/dist/__tests__/units/components/panel/info.test.js +30 -25
  11. package/dist/__tests__/units/components/panel/peaks.test.js +29 -24
  12. package/dist/actions/manager.js +6 -2
  13. package/dist/actions/ui.js +13 -21
  14. package/dist/app.js +45 -45
  15. package/dist/components/cmd_bar/01_viewer.js +38 -31
  16. package/dist/components/cmd_bar/02_zoom.js +34 -27
  17. package/dist/components/cmd_bar/03_peak.js +85 -64
  18. package/dist/components/cmd_bar/04_integration.js +97 -76
  19. package/dist/components/cmd_bar/05_multiplicity.js +94 -67
  20. package/dist/components/cmd_bar/06_undo_redo.js +41 -32
  21. package/dist/components/cmd_bar/07_pecker.js +70 -47
  22. package/dist/components/cmd_bar/common.js +8 -8
  23. package/dist/components/cmd_bar/index.js +20 -21
  24. package/dist/components/cmd_bar/r01_layout.js +201 -137
  25. package/dist/components/cmd_bar/r02_scan.js +63 -51
  26. package/dist/components/cmd_bar/r03_threshold.js +95 -69
  27. package/dist/components/cmd_bar/r04_submit.js +155 -133
  28. package/dist/components/cmd_bar/r05_submit_btn.js +39 -36
  29. package/dist/components/cmd_bar/r06_predict_btn.js +66 -52
  30. package/dist/components/cmd_bar/r07_wavelength_btn.js +35 -31
  31. package/dist/components/cmd_bar/r08_change_axes.js +65 -56
  32. package/dist/components/cmd_bar/r09_detector.js +38 -33
  33. package/dist/components/cmd_bar/tri_btn.js +37 -25
  34. package/dist/components/common/comps.js +5 -6
  35. package/dist/components/d3_line/index.js +2 -1
  36. package/dist/components/d3_line/line_focus.js +32 -34
  37. package/dist/components/d3_multi/index.js +2 -1
  38. package/dist/components/d3_multi/multi_focus.js +60 -37
  39. package/dist/components/d3_rect/index.js +2 -1
  40. package/dist/components/d3_rect/rect_focus.js +18 -20
  41. package/dist/components/forecast/comps.js +169 -132
  42. package/dist/components/forecast/ir_comps.js +88 -69
  43. package/dist/components/forecast/ir_viewer.js +35 -28
  44. package/dist/components/forecast/nmr_comps.js +105 -76
  45. package/dist/components/forecast/nmr_viewer.js +36 -29
  46. package/dist/components/forecast/section_loading.js +22 -17
  47. package/dist/components/forecast_viewer.js +19 -17
  48. package/dist/components/multi_jcamps_viewer.js +44 -38
  49. package/dist/components/panel/compare.js +92 -76
  50. package/dist/components/panel/cyclic_voltamery_data.js +171 -122
  51. package/dist/components/panel/graph_selection.js +113 -90
  52. package/dist/components/panel/index.js +43 -39
  53. package/dist/components/panel/info.js +203 -156
  54. package/dist/components/panel/multiplicity.js +85 -63
  55. package/dist/components/panel/multiplicity_coupling.js +36 -29
  56. package/dist/components/panel/multiplicity_select.js +20 -19
  57. package/dist/components/panel/peaks.js +78 -56
  58. package/dist/constants/action_type.js +2 -1
  59. package/dist/helpers/cfg.js +1 -2
  60. package/dist/helpers/chem.js +5 -13
  61. package/dist/helpers/converter.js +1 -2
  62. package/dist/helpers/extractParams.js +1 -2
  63. package/dist/helpers/extractPeaksEdit.js +3 -6
  64. package/dist/helpers/format.js +28 -63
  65. package/dist/helpers/init.js +5 -9
  66. package/dist/helpers/integration.js +1 -2
  67. package/dist/helpers/mount.js +1 -2
  68. package/dist/index.js +306 -276
  69. package/dist/layer_content.js +14 -14
  70. package/dist/layer_init.js +12 -11
  71. package/dist/layer_prism.js +83 -72
  72. package/dist/reducers/reducer_axes.js +2 -5
  73. package/dist/reducers/reducer_curve.js +8 -6
  74. package/dist/reducers/reducer_detector.js +1 -3
  75. package/dist/reducers/reducer_edit_peak.js +1 -3
  76. package/dist/reducers/reducer_forecast.js +1 -3
  77. package/dist/reducers/reducer_integration.js +1 -3
  78. package/dist/reducers/reducer_jcamp.js +5 -8
  79. package/dist/reducers/reducer_layout.js +1 -3
  80. package/dist/reducers/reducer_manager.js +1 -3
  81. package/dist/reducers/reducer_meta.js +1 -3
  82. package/dist/reducers/reducer_multiplicity.js +3 -3
  83. package/dist/reducers/reducer_scan.js +1 -3
  84. package/dist/reducers/reducer_shift.js +1 -3
  85. package/dist/reducers/reducer_simulation.js +1 -3
  86. package/dist/reducers/reducer_status.js +1 -3
  87. package/dist/reducers/reducer_submit.js +1 -3
  88. package/dist/reducers/reducer_threshold.js +199 -29
  89. package/dist/reducers/reducer_ui.js +1 -3
  90. package/dist/reducers/reducer_voltammetry.js +3 -7
  91. package/dist/reducers/reducer_wavelength.js +1 -3
  92. package/dist/sagas/saga_multi_entities.js +35 -14
  93. package/dist/sagas/saga_multiplicity.js +1 -2
  94. package/dist/third_party/jAnalyzer.js +1 -1
  95. package/package.json +18 -1
@@ -13,6 +13,7 @@ var _index = _interopRequireDefault(require("./components/d3_line/index"));
13
13
  var _index2 = _interopRequireDefault(require("./components/d3_rect/index"));
14
14
  var _forecast_viewer = _interopRequireDefault(require("./components/forecast_viewer"));
15
15
  var _format = _interopRequireDefault(require("./helpers/format"));
16
+ var _jsxRuntime = require("react/jsx-runtime");
16
17
  /* eslint-disable prefer-object-spread, default-param-last, react/function-component-definition */
17
18
 
18
19
  const extractLayout = (forecast, layoutSt) => {
@@ -32,17 +33,16 @@ const extractLayout = (forecast, layoutSt) => {
32
33
  isXRD
33
34
  };
34
35
  };
35
- const Content = _ref => {
36
- let {
37
- topic,
38
- feature,
39
- cLabel,
40
- xLabel,
41
- yLabel,
42
- forecast,
43
- operations,
44
- layoutSt
45
- } = _ref;
36
+ const Content = ({
37
+ topic,
38
+ feature,
39
+ cLabel,
40
+ xLabel,
41
+ yLabel,
42
+ forecast,
43
+ operations,
44
+ layoutSt
45
+ }) => {
46
46
  const {
47
47
  showForecast,
48
48
  isNmr,
@@ -52,7 +52,7 @@ const Content = _ref => {
52
52
  isXRD
53
53
  } = extractLayout(forecast, layoutSt);
54
54
  if (showForecast) {
55
- return /*#__PURE__*/_react.default.createElement(_forecast_viewer.default, {
55
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_forecast_viewer.default, {
56
56
  topic: topic,
57
57
  cLabel: cLabel,
58
58
  xLabel: xLabel,
@@ -67,7 +67,7 @@ const Content = _ref => {
67
67
  });
68
68
  }
69
69
  if (isMs) {
70
- return /*#__PURE__*/_react.default.createElement(_index2.default, {
70
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.default, {
71
71
  topic: topic,
72
72
  cLabel: cLabel,
73
73
  xLabel: xLabel,
@@ -76,7 +76,7 @@ const Content = _ref => {
76
76
  isHidden: false
77
77
  });
78
78
  }
79
- return /*#__PURE__*/_react.default.createElement(_index.default, {
79
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
80
80
  topic: topic,
81
81
  cLabel: cLabel,
82
82
  xLabel: xLabel,
@@ -18,6 +18,7 @@ var _layer_prism = _interopRequireDefault(require("./layer_prism"));
18
18
  var _format = _interopRequireDefault(require("./helpers/format"));
19
19
  var _multi_jcamps_viewer = _interopRequireDefault(require("./components/multi_jcamps_viewer"));
20
20
  var _curve = require("./actions/curve");
21
+ var _jsxRuntime = require("react/jsx-runtime");
21
22
  /* eslint-disable prefer-object-spread, default-param-last */
22
23
 
23
24
  const styles = () => ({});
@@ -42,14 +43,10 @@ class LayerInit extends _react.default.Component {
42
43
  this.updateMultiEntities();
43
44
  }
44
45
  normChange(prevProps) {
45
- const prevFeatures = prevProps.entity.features;
46
- const prevPeak = prevFeatures.editPeak || prevFeatures.autoPeak;
47
46
  const {
48
47
  entity
49
48
  } = this.props;
50
- const nextFeatures = entity.features;
51
- const nextPeak = nextFeatures.editPeak || nextFeatures.autoPeak;
52
- if (prevPeak !== nextPeak) {
49
+ if (prevProps.entity !== entity) {
53
50
  this.execReset();
54
51
  }
55
52
  }
@@ -62,7 +59,8 @@ class LayerInit extends _react.default.Component {
62
59
  resetInitNmrAct,
63
60
  resetInitCommonWithIntergationAct,
64
61
  resetDetectorAct,
65
- updateDSCMetaDataAct
62
+ updateDSCMetaDataAct,
63
+ resetMultiplicityAct
66
64
  } = this.props;
67
65
  resetInitCommonAct();
68
66
  resetDetectorAct();
@@ -76,8 +74,7 @@ class LayerInit extends _react.default.Component {
76
74
  const editPeak = features.editPeak || features[0];
77
75
  const baseFeat = editPeak || autoPeak;
78
76
  resetInitMsAct(baseFeat);
79
- }
80
- if (_format.default.isNmrLayout(layout)) {
77
+ } else if (_format.default.isNmrLayout(layout)) {
81
78
  const {
82
79
  integration,
83
80
  multiplicity,
@@ -102,6 +99,8 @@ class LayerInit extends _react.default.Component {
102
99
  dscMetaData
103
100
  } = features;
104
101
  updateDSCMetaDataAct(dscMetaData);
102
+ } else {
103
+ resetMultiplicityAct();
105
104
  }
106
105
  }
107
106
  initReducer() {
@@ -150,7 +149,7 @@ class LayerInit extends _react.default.Component {
150
149
  const xxLabel = !xLabel && xLabel === '' ? `X (${target.xUnit})` : xLabel;
151
150
  const yyLabel = !yLabel && yLabel === '' ? `Y (${target.yUnit})` : yLabel;
152
151
  if (multiEntities) {
153
- return /*#__PURE__*/_react.default.createElement(_multi_jcamps_viewer.default, {
152
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_multi_jcamps_viewer.default, {
154
153
  multiEntities: multiEntities,
155
154
  entityFileNames: entityFileNames,
156
155
  userManualLink: userManualLink,
@@ -160,7 +159,7 @@ class LayerInit extends _react.default.Component {
160
159
  });
161
160
  } else if (_format.default.isCyclicVoltaLayout(layout)) {
162
161
  // eslint-disable-line
163
- return /*#__PURE__*/_react.default.createElement(_multi_jcamps_viewer.default, {
162
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_multi_jcamps_viewer.default, {
164
163
  multiEntities: [entity],
165
164
  entityFileNames: entityFileNames,
166
165
  userManualLink: userManualLink,
@@ -169,7 +168,7 @@ class LayerInit extends _react.default.Component {
169
168
  operations: operations
170
169
  });
171
170
  }
172
- return /*#__PURE__*/_react.default.createElement(_layer_prism.default, {
171
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_layer_prism.default, {
173
172
  entity: entity,
174
173
  cLabel: cLabel,
175
174
  xLabel: xxLabel,
@@ -194,6 +193,7 @@ const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({
194
193
  resetInitMsAct: _manager.resetInitMs,
195
194
  resetInitCommonWithIntergationAct: _manager.resetInitCommonWithIntergation,
196
195
  resetDetectorAct: _manager.resetDetector,
196
+ resetMultiplicityAct: _manager.resetMultiplicity,
197
197
  updateOperationAct: _submit.updateOperation,
198
198
  updateMetaPeaksAct: _meta.updateMetaPeaks,
199
199
  addOthersAct: _jcamp.addOthers,
@@ -230,6 +230,7 @@ LayerInit.propTypes = {
230
230
  userManualLink: _propTypes.default.object,
231
231
  // eslint-disable-line
232
232
  resetDetectorAct: _propTypes.default.func.isRequired,
233
+ resetMultiplicityAct: _propTypes.default.func.isRequired,
233
234
  updateDSCMetaDataAct: _propTypes.default.func.isRequired
234
235
  };
235
236
  var _default = exports.default = (0, _reactRedux.connect)(
@@ -16,29 +16,29 @@ var _index2 = _interopRequireDefault(require("./components/cmd_bar/index"));
16
16
  var _layer_content = _interopRequireDefault(require("./layer_content"));
17
17
  var _list_ui = require("./constants/list_ui");
18
18
  var _extractParams = require("./helpers/extractParams");
19
+ var _jsxRuntime = require("react/jsx-runtime");
19
20
  /* eslint-disable prefer-object-spread, default-param-last,
20
21
  react/function-component-definition, react/require-default-props
21
22
  */
22
23
 
23
24
  const styles = () => ({});
24
- const LayerPrism = _ref => {
25
- let {
26
- entity,
27
- cLabel,
28
- xLabel,
29
- yLabel,
30
- forecast,
31
- operations,
32
- descriptions,
33
- molSvg,
34
- editorOnly,
35
- exactMass,
36
- thresSt,
37
- scanSt,
38
- uiSt,
39
- canChangeDescription,
40
- onDescriptionChanged
41
- } = _ref;
25
+ const LayerPrism = ({
26
+ entity,
27
+ cLabel,
28
+ xLabel,
29
+ yLabel,
30
+ forecast,
31
+ operations,
32
+ descriptions,
33
+ molSvg,
34
+ editorOnly,
35
+ exactMass,
36
+ thresSt,
37
+ scanSt,
38
+ uiSt,
39
+ canChangeDescription,
40
+ onDescriptionChanged
41
+ }) => {
42
42
  const {
43
43
  topic,
44
44
  feature,
@@ -50,70 +50,81 @@ const LayerPrism = _ref => {
50
50
  viewer
51
51
  } = uiSt;
52
52
  if (viewer === _list_ui.LIST_UI_VIEWER_TYPE.ANALYSIS) {
53
- return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_index2.default, {
53
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
54
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.default, {
55
+ feature: feature,
56
+ hasEdit: hasEdit,
57
+ forecast: forecast,
58
+ operations: operations,
59
+ editorOnly: editorOnly
60
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
61
+ className: "react-spectrum-editor",
62
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
63
+ container: true,
64
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
65
+ item: true,
66
+ xs: 12,
67
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_layer_content.default, {
68
+ topic: topic,
69
+ feature: feature,
70
+ cLabel: cLabel,
71
+ xLabel: xLabel,
72
+ yLabel: yLabel,
73
+ forecast: forecast,
74
+ operations: operations
75
+ })
76
+ })
77
+ })
78
+ })]
79
+ });
80
+ }
81
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
82
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.default, {
54
83
  feature: feature,
55
84
  hasEdit: hasEdit,
56
85
  forecast: forecast,
57
86
  operations: operations,
58
87
  editorOnly: editorOnly
59
- }), /*#__PURE__*/_react.default.createElement("div", {
60
- className: "react-spectrum-editor"
61
- }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
62
- container: true
63
- }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
64
- item: true,
65
- xs: 12
66
- }, /*#__PURE__*/_react.default.createElement(_layer_content.default, {
67
- topic: topic,
68
- feature: feature,
69
- cLabel: cLabel,
70
- xLabel: xLabel,
71
- yLabel: yLabel,
72
- forecast: forecast,
73
- operations: operations
74
- })))));
75
- }
76
- return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_index2.default, {
77
- feature: feature,
78
- hasEdit: hasEdit,
79
- forecast: forecast,
80
- operations: operations,
81
- editorOnly: editorOnly
82
- }), /*#__PURE__*/_react.default.createElement("div", {
83
- className: "react-spectrum-editor"
84
- }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
85
- container: true
86
- }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
87
- item: true,
88
- xs: 9
89
- }, /*#__PURE__*/_react.default.createElement(_layer_content.default, {
90
- topic: topic,
91
- feature: feature,
92
- cLabel: cLabel,
93
- xLabel: xLabel,
94
- yLabel: yLabel,
95
- forecast: forecast,
96
- operations: operations
97
- })), /*#__PURE__*/_react.default.createElement(_Grid.default, {
98
- item: true,
99
- xs: 3,
100
- align: "center"
101
- }, /*#__PURE__*/_react.default.createElement(_index.default, {
102
- feature: feature,
103
- integration: integration,
104
- editorOnly: editorOnly,
105
- molSvg: molSvg,
106
- exactMass: exactMass,
107
- descriptions: descriptions,
108
- canChangeDescription: canChangeDescription,
109
- onDescriptionChanged: onDescriptionChanged
110
- })))));
88
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
89
+ className: "react-spectrum-editor",
90
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Grid.default, {
91
+ container: true,
92
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
93
+ item: true,
94
+ xs: 9,
95
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_layer_content.default, {
96
+ topic: topic,
97
+ feature: feature,
98
+ cLabel: cLabel,
99
+ xLabel: xLabel,
100
+ yLabel: yLabel,
101
+ forecast: forecast,
102
+ operations: operations
103
+ })
104
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
105
+ item: true,
106
+ xs: 3,
107
+ align: "center",
108
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
109
+ feature: feature,
110
+ integration: integration,
111
+ editorOnly: editorOnly,
112
+ molSvg: molSvg,
113
+ exactMass: exactMass,
114
+ descriptions: descriptions,
115
+ canChangeDescription: canChangeDescription,
116
+ onDescriptionChanged: onDescriptionChanged
117
+ })
118
+ })]
119
+ })
120
+ })]
121
+ });
111
122
  };
112
123
  const mapStateToProps = (state, props) => (
113
124
  // eslint-disable-line
114
125
  {
115
126
  scanSt: state.scan,
116
- thresSt: state.threshold,
127
+ thresSt: state.threshold.list[state.curve.curveIdx],
117
128
  uiSt: state.ui
118
129
  });
119
130
  const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({}, dispatch);
@@ -13,8 +13,7 @@ const initialState = {
13
13
  yUnit: ''
14
14
  }]
15
15
  };
16
- const updateAxis = function (state, payload) {
17
- let isYAxis = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
16
+ const updateAxis = (state, payload, isYAxis = false) => {
18
17
  const {
19
18
  value,
20
19
  curveIndex
@@ -44,9 +43,7 @@ const updateAxis = function (state, payload) {
44
43
  axes
45
44
  });
46
45
  };
47
- const axesReducer = function () {
48
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
49
- let action = arguments.length > 1 ? arguments[1] : undefined;
46
+ const axesReducer = (state = initialState, action) => {
50
47
  switch (action.type) {
51
48
  case _action_type.AXES.UPDATE_X_AXIS:
52
49
  return updateAxis(state, action.payload);
@@ -9,7 +9,7 @@ var _action_type = require("../constants/action_type");
9
9
  var _extractParams = require("../helpers/extractParams");
10
10
  var _chem = require("../helpers/chem");
11
11
  var _format = _interopRequireDefault(require("../helpers/format"));
12
- /* eslint-disable prefer-object-spread, default-param-last */
12
+ /* eslint-disable prefer-object-spread, default-param-last, max-len */
13
13
 
14
14
  const initialState = {
15
15
  listCurves: [],
@@ -26,8 +26,11 @@ const setAllCurves = (state, action) => {
26
26
  topic,
27
27
  feature,
28
28
  hasEdit,
29
- integration
30
- } = (0, _extractParams.extractParams)(entity, 1);
29
+ integration,
30
+ multiplicity
31
+ } = (0, _extractParams.extractParams)(entity, {
32
+ isEdit: true
33
+ });
31
34
  // const layout = entity.layout;
32
35
  const {
33
36
  layout
@@ -40,6 +43,7 @@ const setAllCurves = (state, action) => {
40
43
  feature,
41
44
  hasEdit,
42
45
  integration,
46
+ multiplicity,
43
47
  maxminPeak,
44
48
  color,
45
49
  curveIdx: idx
@@ -55,9 +59,7 @@ const setAllCurves = (state, action) => {
55
59
  listCurves: payload
56
60
  });
57
61
  };
58
- const curveReducer = function () {
59
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
60
- let action = arguments.length > 1 ? arguments[1] : undefined;
62
+ const curveReducer = (state = initialState, action) => {
61
63
  switch (action.type) {
62
64
  case _action_type.CURVE.SELECT_WORKING_CURVE:
63
65
  return Object.assign({}, state, {
@@ -25,9 +25,7 @@ const updateOrAppendCurve = (curves, targetCurveIdx, newCurve) => {
25
25
  }
26
26
  return [...curves, newCurve];
27
27
  };
28
- const detectorReducer = function () {
29
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
30
- let action = arguments.length > 1 ? arguments[1] : undefined;
28
+ const detectorReducer = (state = initialState, action) => {
31
29
  switch (action.type) {
32
30
  case _action_type.SEC.UPDATE_DETECTOR:
33
31
  const {
@@ -202,9 +202,7 @@ const clearAllPeaks = (state, action) => {
202
202
  peaks: newPeaks
203
203
  });
204
204
  };
205
- const editPeakReducer = function () {
206
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
207
- let action = arguments.length > 1 ? arguments[1] : undefined;
205
+ const editPeakReducer = (state = initialState, action) => {
208
206
  switch (action.type) {
209
207
  case _action_type.EDITPEAK.ADD_POSITIVE:
210
208
  return addToPos(state, action);
@@ -101,9 +101,7 @@ const updateNmrStatus = (state, action) => {
101
101
  });
102
102
  return newSt;
103
103
  };
104
- const forecastReducer = function () {
105
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
106
- let action = arguments.length > 1 ? arguments[1] : undefined;
104
+ const forecastReducer = (state = initialState, action) => {
107
105
  switch (action.type) {
108
106
  case _action_type.FORECAST.INIT_STATUS:
109
107
  if (!action.payload) return state;
@@ -208,9 +208,7 @@ const clearAll = (state, action) => {
208
208
  selectedIdx: curveIdx
209
209
  });
210
210
  };
211
- const integrationReducer = function () {
212
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
213
- let action = arguments.length > 1 ? arguments[1] : undefined;
211
+ const integrationReducer = (state = initialState, action) => {
214
212
  switch (action.type) {
215
213
  case _action_type.UI.SWEEP.SELECT_INTEGRATION:
216
214
  return addToStack(state, action);
@@ -14,11 +14,10 @@ const initialState = {
14
14
  addOthersCb: false
15
15
  }]
16
16
  };
17
- const addOthers = (state, _ref) => {
18
- let {
19
- others,
20
- addOthersCb
21
- } = _ref;
17
+ const addOthers = (state, {
18
+ others,
19
+ addOthersCb
20
+ }) => {
22
21
  const {
23
22
  selectedIdx,
24
23
  jcamps
@@ -81,9 +80,7 @@ const toggleShow = (state, payload) => {
81
80
  jcamps
82
81
  });
83
82
  };
84
- const layoutReducer = function () {
85
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
86
- let action = arguments.length > 1 ? arguments[1] : undefined;
83
+ const layoutReducer = (state = initialState, action) => {
87
84
  switch (action.type) {
88
85
  case _action_type.JCAMP.ADD_OTHERS:
89
86
  return addOthers(state, action.payload);
@@ -9,9 +9,7 @@ var _list_layout = require("../constants/list_layout");
9
9
  /* eslint-disable prefer-object-spread, default-param-last */
10
10
 
11
11
  const initialState = _list_layout.LIST_LAYOUT.C13;
12
- const layoutReducer = function () {
13
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
14
- let action = arguments.length > 1 ? arguments[1] : undefined;
12
+ const layoutReducer = (state = initialState, action) => {
15
13
  switch (action.type) {
16
14
  case _action_type.LAYOUT.UPDATE:
17
15
  return action.payload;
@@ -8,9 +8,7 @@ exports.default = void 0;
8
8
  // import { MANAGER } from '../constants/action_type';
9
9
 
10
10
  const initialState = {};
11
- const managerReducer = function () {
12
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
13
- let action = arguments.length > 1 ? arguments[1] : undefined;
11
+ const managerReducer = (state = initialState, action) => {
14
12
  switch (action.type) {
15
13
  default:
16
14
  return state;
@@ -27,9 +27,7 @@ const updateMetaData = (state, action) => {
27
27
  dscMetaData
28
28
  });
29
29
  };
30
- const metaReducer = function () {
31
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
32
- let action = arguments.length > 1 ? arguments[1] : undefined;
30
+ const metaReducer = (state = initialState, action) => {
33
31
  switch (action.type) {
34
32
  case _action_type.META.UPDATE_PEAKS_RDC:
35
33
  return Object.assign({}, state, action.payload);
@@ -164,9 +164,7 @@ const clearAll = (state, action) => {
164
164
  multiplicities: newMultiplicities
165
165
  });
166
166
  };
167
- const multiplicityReducer = function () {
168
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
169
- let action = arguments.length > 1 ? arguments[1] : undefined;
167
+ const multiplicityReducer = (state = initialState, action) => {
170
168
  switch (action.type) {
171
169
  case _action_type.EDITPEAK.SHIFT:
172
170
  return setShift(state, action);
@@ -191,6 +189,8 @@ const multiplicityReducer = function () {
191
189
  return clearAll(state, action);
192
190
  case _action_type.MANAGER.RESETALL:
193
191
  return state;
192
+ case _action_type.MANAGER.RESET_MULTIPLICITY:
193
+ return initialState;
194
194
  default:
195
195
  return _undo_redo_config.undoRedoActions.indexOf(action.type) >= 0 ? Object.assign({}, state) : state;
196
196
  }
@@ -30,9 +30,7 @@ const toggleIsAuto = state => Object.assign({}, state, {
30
30
  isAuto: !state.isAuto,
31
31
  target: false
32
32
  });
33
- const scanReducer = function () {
34
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
35
- let action = arguments.length > 1 ? arguments[1] : undefined;
33
+ const scanReducer = (state = initialState, action) => {
36
34
  switch (action.type) {
37
35
  case _action_type.SCAN.SET_TARGET:
38
36
  case _action_type.SCAN.RESET_TARGET:
@@ -217,9 +217,7 @@ const addNegative = (state, action) => {
217
217
  selectedIdx: curveIdx
218
218
  });
219
219
  };
220
- const shiftReducer = function () {
221
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
222
- let action = arguments.length > 1 ? arguments[1] : undefined;
220
+ const shiftReducer = (state = initialState, action) => {
223
221
  switch (action.type) {
224
222
  case _action_type.SHIFT.SET_REF:
225
223
  return setRef(state, action);
@@ -14,9 +14,7 @@ const resetAll = (state, action) => {
14
14
  const newState = action.payload;
15
15
  return Object.assign({}, state, newState);
16
16
  };
17
- const simulatioinReducer = function () {
18
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
19
- let action = arguments.length > 1 ? arguments[1] : undefined;
17
+ const simulatioinReducer = (state = initialState, action) => {
20
18
  switch (action.type) {
21
19
  case _action_type.SIMULATION.RESET_ALL_RDC:
22
20
  return resetAll(state, action);
@@ -10,9 +10,7 @@ var _action_type = require("../constants/action_type");
10
10
  const initialState = {
11
11
  btnSubmit: false
12
12
  };
13
- const statusReducer = function () {
14
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
15
- let action = arguments.length > 1 ? arguments[1] : undefined;
13
+ const statusReducer = (state = initialState, action) => {
16
14
  switch (action.type) {
17
15
  case _action_type.STATUS.TOGGLEBTNSUBMIT:
18
16
  return Object.assign({}, state, {
@@ -20,9 +20,7 @@ const initialState = {
20
20
  const updateOperation = action => ({
21
21
  operation: action.payload || initialState.operation
22
22
  });
23
- const submitReducer = function () {
24
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
25
- let action = arguments.length > 1 ? arguments[1] : undefined;
23
+ const submitReducer = (state = initialState, action) => {
26
24
  switch (action.type) {
27
25
  case _action_type.SUBMIT.TOGGLE_IS_ASCEND:
28
26
  return Object.assign({}, state, {