@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.
Files changed (202) hide show
  1. package/README.md +16 -0
  2. package/dist/__tests__/fixtures/aif_jcamp_1.js +136 -0
  3. package/dist/__tests__/fixtures/aif_jcamp_2.js +122 -0
  4. package/dist/__tests__/fixtures/backup/nmr1h_a.js +3518 -0
  5. package/dist/__tests__/fixtures/backup/xrd_jcamp_1.js +10705 -0
  6. package/dist/__tests__/fixtures/cds_jcamp.js +861 -0
  7. package/dist/__tests__/fixtures/compare_ir_1_jcamp.js +585 -0
  8. package/dist/__tests__/fixtures/compare_ir_2_jcamp.js +515 -0
  9. package/dist/__tests__/fixtures/compare_uv_vis_jcamp.js +640 -0
  10. package/dist/__tests__/fixtures/cyclic_voltammetry_1.js +778 -0
  11. package/dist/__tests__/fixtures/cyclic_voltammetry_2.js +758 -0
  12. package/dist/__tests__/fixtures/cyclic_voltammetry_3.js +759 -0
  13. package/dist/__tests__/fixtures/dls_acf_jcamp.js +148 -0
  14. package/dist/__tests__/fixtures/dls_intensity_jcamp.js +151 -0
  15. package/dist/__tests__/fixtures/emissions_jcamp.js +883 -0
  16. package/dist/__tests__/fixtures/hplc_uvvis_jcamp.js +638 -0
  17. package/dist/__tests__/fixtures/hplc_uvvis_jcamp_2.js +221 -0
  18. package/dist/__tests__/fixtures/ir_jcamp.js +148 -0
  19. package/dist/__tests__/fixtures/ir_result.js +46 -0
  20. package/dist/__tests__/fixtures/ir_svg.js +8 -0
  21. package/dist/__tests__/fixtures/ms_jcamp.js +64 -0
  22. package/dist/__tests__/fixtures/nmr13c_dept_jcamp.js +3543 -0
  23. package/dist/__tests__/fixtures/nmr13c_jcamp.js +1229 -0
  24. package/dist/__tests__/fixtures/nmr15n_jcamp.js +7177 -0
  25. package/dist/__tests__/fixtures/nmr19f_jcamp.js +6560 -0
  26. package/dist/__tests__/fixtures/nmr1h_2_jcamp.js +2005 -0
  27. package/dist/__tests__/fixtures/nmr1h_jcamp.js +4516 -0
  28. package/dist/__tests__/fixtures/nmr29si_jcamp.js +3029 -0
  29. package/dist/__tests__/fixtures/nmr31p_jcamp.js +3418 -0
  30. package/dist/__tests__/fixtures/nmr_result.js +68 -0
  31. package/dist/__tests__/fixtures/nmr_svg.js +8 -0
  32. package/dist/__tests__/fixtures/phenylalanin.js +142 -0
  33. package/dist/__tests__/fixtures/qDescValue.js +65 -0
  34. package/dist/__tests__/fixtures/raman_jcamp.js +410 -0
  35. package/dist/__tests__/fixtures/sec_1_jcamp.js +425 -0
  36. package/dist/__tests__/fixtures/sec_2_jcamp.js +407 -0
  37. package/dist/__tests__/fixtures/sec_3_jcamp.js +408 -0
  38. package/dist/__tests__/fixtures/sec_4_jcamp.js +407 -0
  39. package/dist/__tests__/fixtures/tga_jcamp.js +4157 -0
  40. package/dist/__tests__/fixtures/uv_vis_jcamp.js +249 -0
  41. package/dist/__tests__/fixtures/xrd_jcamp_1.js +436 -0
  42. package/dist/__tests__/fixtures/xrd_jcamp_2.js +955 -0
  43. package/dist/__tests__/fixtures/xrd_jcamp_3.js +1871 -0
  44. package/dist/__tests__/units/components/panel/graph_selection.test.js +72 -0
  45. package/dist/__tests__/units/components/panel/peaks.test.js +87 -0
  46. package/dist/actions/curve.js +15 -14
  47. package/dist/actions/cyclic_voltammetry.js +40 -60
  48. package/dist/actions/edit_peak.js +8 -12
  49. package/dist/actions/forecast.js +16 -24
  50. package/dist/actions/integration.js +12 -18
  51. package/dist/actions/jcamp.js +16 -24
  52. package/dist/actions/layout.js +4 -6
  53. package/dist/actions/manager.js +20 -30
  54. package/dist/actions/meta.js +4 -6
  55. package/dist/actions/multiplicity.js +24 -36
  56. package/dist/actions/scan.js +12 -18
  57. package/dist/actions/shift.js +8 -12
  58. package/dist/actions/status.js +12 -18
  59. package/dist/actions/submit.js +16 -24
  60. package/dist/actions/threshold.js +20 -30
  61. package/dist/actions/ui.js +25 -31
  62. package/dist/actions/wavelength.js +4 -6
  63. package/dist/app.js +25 -23
  64. package/dist/components/cmd_bar/01_viewer.js +24 -34
  65. package/dist/components/cmd_bar/02_zoom.js +18 -28
  66. package/dist/components/cmd_bar/03_peak.js +50 -66
  67. package/dist/components/cmd_bar/04_integration.js +70 -84
  68. package/dist/components/cmd_bar/05_multiplicity.js +42 -56
  69. package/dist/components/cmd_bar/06_undo_redo.js +22 -36
  70. package/dist/components/cmd_bar/07_pecker.js +24 -34
  71. package/dist/components/cmd_bar/common.js +11 -7
  72. package/dist/components/cmd_bar/index.js +17 -23
  73. package/dist/components/cmd_bar/r01_layout.js +79 -56
  74. package/dist/components/cmd_bar/r02_scan.js +70 -87
  75. package/dist/components/cmd_bar/r03_threshold.js +54 -68
  76. package/dist/components/cmd_bar/r04_submit.js +71 -83
  77. package/dist/components/cmd_bar/r05_submit_btn.js +64 -72
  78. package/dist/components/cmd_bar/r06_predict_btn.js +142 -152
  79. package/dist/components/cmd_bar/r07_wavelength_btn.js +28 -36
  80. package/dist/components/cmd_bar/tri_btn.js +91 -113
  81. package/dist/components/common/chem.js +2 -3
  82. package/dist/components/common/comps.js +2 -2
  83. package/dist/components/common/draw.js +30 -11
  84. package/dist/components/d3_line/index.js +154 -176
  85. package/dist/components/d3_line/line_focus.js +595 -739
  86. package/dist/components/d3_multi/index.js +153 -174
  87. package/dist/components/d3_multi/multi_focus.js +725 -850
  88. package/dist/components/d3_rect/index.js +112 -134
  89. package/dist/components/d3_rect/rect_focus.js +163 -208
  90. package/dist/components/forecast/comps.js +60 -68
  91. package/dist/components/forecast/ir_comps.js +49 -56
  92. package/dist/components/forecast/ir_viewer.js +61 -68
  93. package/dist/components/forecast/nmr_comps.js +62 -72
  94. package/dist/components/forecast/nmr_viewer.js +59 -68
  95. package/dist/components/forecast/section_loading.js +39 -63
  96. package/dist/components/forecast_viewer.js +109 -119
  97. package/dist/components/multi_jcamps_viewer.js +97 -113
  98. package/dist/components/panel/compare.js +183 -192
  99. package/dist/components/panel/cyclic_voltamery_data.js +149 -165
  100. package/dist/components/panel/graph_selection.js +143 -132
  101. package/dist/components/panel/index.js +112 -144
  102. package/dist/components/panel/info.js +125 -132
  103. package/dist/components/panel/multiplicity.js +215 -223
  104. package/dist/components/panel/multiplicity_coupling.js +108 -136
  105. package/dist/components/panel/multiplicity_select.js +43 -51
  106. package/dist/components/panel/peaks.js +130 -132
  107. package/dist/constants/action_type.js +23 -39
  108. package/dist/constants/list_layout.js +7 -4
  109. package/dist/constants/list_shift.js +117 -103
  110. package/dist/constants/list_ui.js +3 -6
  111. package/dist/constants/list_wavelength.js +7 -8
  112. package/dist/fn.js +2 -3
  113. package/dist/helpers/brush.js +49 -65
  114. package/dist/helpers/calc.js +2 -4
  115. package/dist/helpers/carbonFeatures.js +22 -20
  116. package/dist/helpers/cfg.js +49 -67
  117. package/dist/helpers/chem.js +450 -393
  118. package/dist/helpers/compass.js +92 -83
  119. package/dist/helpers/converter.js +52 -65
  120. package/dist/helpers/extractParams.js +60 -52
  121. package/dist/helpers/extractPeaksEdit.js +29 -25
  122. package/dist/helpers/focus.js +2 -6
  123. package/dist/helpers/format.js +416 -361
  124. package/dist/helpers/init.js +41 -37
  125. package/dist/helpers/integration.js +18 -21
  126. package/dist/helpers/mount.js +57 -61
  127. package/dist/helpers/multiplicity.js +19 -24
  128. package/dist/helpers/multiplicity_calc.js +39 -50
  129. package/dist/helpers/multiplicity_complat.js +21 -47
  130. package/dist/helpers/multiplicity_manual.js +49 -55
  131. package/dist/helpers/multiplicity_verify_basic.js +108 -111
  132. package/dist/helpers/shift.js +15 -23
  133. package/dist/helpers/zoom.js +7 -11
  134. package/dist/index.js +680 -630
  135. package/dist/layer_content.js +40 -43
  136. package/dist/layer_init.js +162 -184
  137. package/dist/layer_prism.js +38 -41
  138. package/dist/reducers/index.js +2 -3
  139. package/dist/reducers/reducer_curve.js +35 -26
  140. package/dist/reducers/reducer_edit_peak.js +122 -98
  141. package/dist/reducers/reducer_forecast.js +57 -44
  142. package/dist/reducers/reducer_integration.js +135 -103
  143. package/dist/reducers/reducer_jcamp.js +49 -44
  144. package/dist/reducers/reducer_layout.js +5 -6
  145. package/dist/reducers/reducer_manager.js +5 -6
  146. package/dist/reducers/reducer_meta.js +5 -6
  147. package/dist/reducers/reducer_multiplicity.js +100 -77
  148. package/dist/reducers/reducer_scan.js +17 -20
  149. package/dist/reducers/reducer_shift.js +115 -70
  150. package/dist/reducers/reducer_simulation.js +7 -8
  151. package/dist/reducers/reducer_status.js +5 -6
  152. package/dist/reducers/reducer_submit.js +12 -15
  153. package/dist/reducers/reducer_threshold.js +5 -6
  154. package/dist/reducers/reducer_ui.js +5 -6
  155. package/dist/reducers/reducer_voltammetry.js +156 -96
  156. package/dist/reducers/reducer_wavelength.js +5 -6
  157. package/dist/reducers/undo_redo_config.js +3 -5
  158. package/dist/sagas/index.js +2 -15
  159. package/dist/sagas/saga_edit_peak.js +54 -68
  160. package/dist/sagas/saga_manager.js +86 -130
  161. package/dist/sagas/saga_meta.js +25 -31
  162. package/dist/sagas/saga_multi_entities.js +40 -103
  163. package/dist/sagas/saga_multiplicity.js +336 -406
  164. package/dist/sagas/saga_ui.js +296 -475
  165. package/dist/setupTests.js +8 -0
  166. package/dist/third_party/jAnalyzer.js +66 -67
  167. package/dist/third_party/peakInterval.js +34 -34
  168. package/package.json +14 -14
  169. package/dist/components/cmd_bar/03_peak_bk.js +0 -139
  170. package/dist/components/cmd_bar/04_integration_bk.js +0 -180
  171. package/dist/components/cmd_bar/05_multiplicity_bk.js +0 -131
  172. package/dist/components/cmd_bar/r01_layout_bk.js +0 -186
  173. package/dist/components/cmd_bar/r06_predict_btn_bk.js +0 -220
  174. package/dist/components/d3_line/line_focus_bk.js +0 -825
  175. package/dist/components/d3_multi/index_bk.js +0 -210
  176. package/dist/components/d3_multi/multi_focus_bk.js +0 -533
  177. package/dist/components/panel/compare_bk.js +0 -256
  178. package/dist/components/panel/cyclic_voltamery_data_bk.js +0 -292
  179. package/dist/components/panel/index_bk.js +0 -178
  180. package/dist/components/panel/info_bk.js +0 -235
  181. package/dist/components/panel/multiplicity_bk.js +0 -280
  182. package/dist/helpers/carbonFeatures_bk.js +0 -45
  183. package/dist/helpers/cfg_bk.js +0 -80
  184. package/dist/helpers/chem_bk.js +0 -787
  185. package/dist/helpers/compass_bk.js +0 -149
  186. package/dist/helpers/converter_bk.js +0 -96
  187. package/dist/helpers/extractPeaksEdit_bk.js +0 -53
  188. package/dist/helpers/format_bk.js +0 -497
  189. package/dist/index_bk.js +0 -640
  190. package/dist/layer_content_bk.js +0 -105
  191. package/dist/layer_init_bk.js +0 -235
  192. package/dist/layer_prism_bk.js +0 -133
  193. package/dist/reducers/reducer_edit_peak_bk.js +0 -108
  194. package/dist/reducers/reducer_integration_bk.js +0 -134
  195. package/dist/reducers/reducer_jcamp_bk.js +0 -71
  196. package/dist/reducers/reducer_multiplicity_bk.js +0 -126
  197. package/dist/reducers/reducer_shift_bk.js +0 -88
  198. package/dist/reducers/reducer_voltammetry_bk.js +0 -287
  199. package/dist/sagas/saga_edit_peak_bk.js +0 -73
  200. package/dist/sagas/saga_multi_entities_bk.js +0 -106
  201. package/dist/sagas/saga_multiplicity_bk.js +0 -351
  202. package/dist/sagas/saga_ui_bk.js +0 -453
@@ -15,39 +15,42 @@ var _forecast_viewer = _interopRequireDefault(require("./components/forecast_vie
15
15
  var _format = _interopRequireDefault(require("./helpers/format"));
16
16
  /* eslint-disable prefer-object-spread, default-param-last, react/function-component-definition */
17
17
 
18
- var extractLayout = function extractLayout(forecast, layoutSt) {
19
- var isEmpty = Object.keys(forecast).length === 0 && forecast.constructor === Object;
20
- var isNmr = _format.default.isNmrLayout(layoutSt);
21
- var isMs = _format.default.isMsLayout(layoutSt);
22
- var isIr = _format.default.isIrLayout(layoutSt);
23
- var isUvvis = _format.default.isUvVisLayout(layoutSt) || _format.default.isHplcUvVisLayout(layoutSt);
24
- var isXRD = _format.default.isXRDLayout(layoutSt);
25
- var showForecast = !isEmpty && (isNmr || isIr || isUvvis || isXRD);
18
+ const extractLayout = (forecast, layoutSt) => {
19
+ const isEmpty = Object.keys(forecast).length === 0 && forecast.constructor === Object;
20
+ const isNmr = _format.default.isNmrLayout(layoutSt);
21
+ const isMs = _format.default.isMsLayout(layoutSt);
22
+ const isIr = _format.default.isIrLayout(layoutSt);
23
+ const isUvvis = _format.default.isUvVisLayout(layoutSt) || _format.default.isHplcUvVisLayout(layoutSt);
24
+ const isXRD = _format.default.isXRDLayout(layoutSt);
25
+ const showForecast = !isEmpty && (isNmr || isIr || isUvvis || isXRD);
26
26
  return {
27
- showForecast: showForecast,
28
- isNmr: isNmr,
29
- isIr: isIr,
30
- isMs: isMs,
31
- isUvvis: isUvvis,
32
- isXRD: isXRD
27
+ showForecast,
28
+ isNmr,
29
+ isIr,
30
+ isMs,
31
+ isUvvis,
32
+ isXRD
33
33
  };
34
34
  };
35
- var Content = function Content(_ref) {
36
- var topic = _ref.topic,
37
- feature = _ref.feature,
38
- cLabel = _ref.cLabel,
39
- xLabel = _ref.xLabel,
40
- yLabel = _ref.yLabel,
41
- forecast = _ref.forecast,
42
- operations = _ref.operations,
43
- layoutSt = _ref.layoutSt;
44
- var _extractLayout = extractLayout(forecast, layoutSt),
45
- showForecast = _extractLayout.showForecast,
46
- isNmr = _extractLayout.isNmr,
47
- isIr = _extractLayout.isIr,
48
- isMs = _extractLayout.isMs,
49
- isUvvis = _extractLayout.isUvvis,
50
- isXRD = _extractLayout.isXRD;
35
+ const Content = _ref => {
36
+ let {
37
+ topic,
38
+ feature,
39
+ cLabel,
40
+ xLabel,
41
+ yLabel,
42
+ forecast,
43
+ operations,
44
+ layoutSt
45
+ } = _ref;
46
+ const {
47
+ showForecast,
48
+ isNmr,
49
+ isIr,
50
+ isMs,
51
+ isUvvis,
52
+ isXRD
53
+ } = extractLayout(forecast, layoutSt);
51
54
  if (showForecast) {
52
55
  return /*#__PURE__*/_react.default.createElement(_forecast_viewer.default, {
53
56
  topic: topic,
@@ -82,17 +85,12 @@ var Content = function Content(_ref) {
82
85
  isHidden: false
83
86
  });
84
87
  };
85
- var mapStateToProps = function mapStateToProps(state, _) {
86
- return (
87
- // eslint-disable-line
88
- {
89
- layoutSt: state.layout
90
- }
91
- );
92
- };
93
- var mapDispatchToProps = function mapDispatchToProps(dispatch) {
94
- return (0, _redux.bindActionCreators)({}, dispatch);
95
- };
88
+ const mapStateToProps = (state, _) => (
89
+ // eslint-disable-line
90
+ {
91
+ layoutSt: state.layout
92
+ });
93
+ const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({}, dispatch);
96
94
  Content.propTypes = {
97
95
  topic: _propTypes.default.object.isRequired,
98
96
  feature: _propTypes.default.object.isRequired,
@@ -103,5 +101,4 @@ Content.propTypes = {
103
101
  operations: _propTypes.default.array.isRequired,
104
102
  layoutSt: _propTypes.default.string.isRequired
105
103
  };
106
- var _default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(Content);
107
- exports.default = _default;
104
+ var _default = exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(Content);
@@ -5,12 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
8
  var _react = _interopRequireDefault(require("react"));
15
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
16
10
  var _reactRedux = require("react-redux");
@@ -24,189 +18,174 @@ var _layer_prism = _interopRequireDefault(require("./layer_prism"));
24
18
  var _format = _interopRequireDefault(require("./helpers/format"));
25
19
  var _multi_jcamps_viewer = _interopRequireDefault(require("./components/multi_jcamps_viewer"));
26
20
  var _curve = require("./actions/curve");
27
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
28
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable prefer-object-spread, default-param-last */
29
- var styles = function styles() {
30
- return {};
31
- };
32
- var LayerInit = /*#__PURE__*/function (_React$Component) {
33
- (0, _inherits2.default)(LayerInit, _React$Component);
34
- var _super = _createSuper(LayerInit);
35
- function LayerInit(props) {
36
- var _this;
37
- (0, _classCallCheck2.default)(this, LayerInit);
38
- _this = _super.call(this, props);
39
- _this.normChange = _this.normChange.bind((0, _assertThisInitialized2.default)(_this));
40
- _this.execReset = _this.execReset.bind((0, _assertThisInitialized2.default)(_this));
41
- _this.initReducer = _this.initReducer.bind((0, _assertThisInitialized2.default)(_this));
42
- _this.updateOthers = _this.updateOthers.bind((0, _assertThisInitialized2.default)(_this));
43
- _this.updateMultiEntities = _this.updateMultiEntities.bind((0, _assertThisInitialized2.default)(_this));
44
- return _this;
21
+ /* eslint-disable prefer-object-spread, default-param-last */
22
+
23
+ const styles = () => ({});
24
+ class LayerInit extends _react.default.Component {
25
+ constructor(props) {
26
+ super(props);
27
+ this.normChange = this.normChange.bind(this);
28
+ this.execReset = this.execReset.bind(this);
29
+ this.initReducer = this.initReducer.bind(this);
30
+ this.updateOthers = this.updateOthers.bind(this);
31
+ this.updateMultiEntities = this.updateMultiEntities.bind(this);
32
+ }
33
+ componentDidMount() {
34
+ this.execReset();
35
+ this.initReducer();
36
+ this.updateOthers();
37
+ this.updateMultiEntities();
45
38
  }
46
- (0, _createClass2.default)(LayerInit, [{
47
- key: "componentDidMount",
48
- value: function componentDidMount() {
39
+ componentDidUpdate(prevProps) {
40
+ this.normChange(prevProps);
41
+ this.updateOthers();
42
+ this.updateMultiEntities();
43
+ }
44
+ normChange(prevProps) {
45
+ const prevFeatures = prevProps.entity.features;
46
+ const prevPeak = prevFeatures.editPeak || prevFeatures.autoPeak;
47
+ const {
48
+ entity
49
+ } = this.props;
50
+ const nextFeatures = entity.features;
51
+ const nextPeak = nextFeatures.editPeak || nextFeatures.autoPeak;
52
+ if (prevPeak !== nextPeak) {
49
53
  this.execReset();
50
- this.initReducer();
51
- this.updateOthers();
52
- this.updateMultiEntities();
53
- }
54
- }, {
55
- key: "componentDidUpdate",
56
- value: function componentDidUpdate(prevProps) {
57
- this.normChange(prevProps);
58
- this.updateOthers();
59
- this.updateMultiEntities();
60
- }
61
- }, {
62
- key: "normChange",
63
- value: function normChange(prevProps) {
64
- var prevFeatures = prevProps.entity.features;
65
- var prevPeak = prevFeatures.editPeak || prevFeatures.autoPeak;
66
- var entity = this.props.entity;
67
- var nextFeatures = entity.features;
68
- var nextPeak = nextFeatures.editPeak || nextFeatures.autoPeak;
69
- if (prevPeak !== nextPeak) {
70
- this.execReset();
71
- }
72
54
  }
73
- }, {
74
- key: "execReset",
75
- value: function execReset() {
76
- var _this$props = this.props,
77
- entity = _this$props.entity,
78
- updateMetaPeaksAct = _this$props.updateMetaPeaksAct,
79
- resetInitCommonAct = _this$props.resetInitCommonAct,
80
- resetInitMsAct = _this$props.resetInitMsAct,
81
- resetInitNmrAct = _this$props.resetInitNmrAct,
82
- resetInitCommonWithIntergationAct = _this$props.resetInitCommonWithIntergationAct;
83
- resetInitCommonAct();
84
- var layout = entity.layout,
85
- features = entity.features;
86
- if (_format.default.isMsLayout(layout)) {
87
- // const { autoPeak, editPeak } = features; // TBD
88
- var autoPeak = features.autoPeak || features[0];
89
- var editPeak = features.editPeak || features[0];
90
- var baseFeat = editPeak || autoPeak;
91
- resetInitMsAct(baseFeat);
92
- }
93
- if (_format.default.isNmrLayout(layout)) {
94
- var integration = features.integration,
95
- multiplicity = features.multiplicity,
96
- simulation = features.simulation;
97
- updateMetaPeaksAct(entity);
98
- resetInitNmrAct({
99
- integration: integration,
100
- multiplicity: multiplicity,
101
- simulation: simulation
102
- });
103
- } else if (_format.default.isHplcUvVisLayout(layout)) {
104
- var _integration = features.integration;
105
- updateMetaPeaksAct(entity);
106
- resetInitCommonWithIntergationAct({
107
- integration: _integration
108
- });
109
- }
110
- }
111
- }, {
112
- key: "initReducer",
113
- value: function initReducer() {
114
- var _this$props2 = this.props,
115
- operations = _this$props2.operations,
116
- updateOperationAct = _this$props2.updateOperationAct;
117
- updateOperationAct(operations[0]);
118
- }
119
- }, {
120
- key: "updateOthers",
121
- value: function updateOthers() {
122
- var _this$props3 = this.props,
123
- others = _this$props3.others,
124
- addOthersAct = _this$props3.addOthersAct;
125
- addOthersAct(others);
55
+ }
56
+ execReset() {
57
+ const {
58
+ entity,
59
+ updateMetaPeaksAct,
60
+ resetInitCommonAct,
61
+ resetInitMsAct,
62
+ resetInitNmrAct,
63
+ resetInitCommonWithIntergationAct
64
+ } = this.props;
65
+ resetInitCommonAct();
66
+ const {
67
+ layout,
68
+ features
69
+ } = entity;
70
+ if (_format.default.isMsLayout(layout)) {
71
+ // const { autoPeak, editPeak } = features; // TBD
72
+ const autoPeak = features.autoPeak || features[0];
73
+ const editPeak = features.editPeak || features[0];
74
+ const baseFeat = editPeak || autoPeak;
75
+ resetInitMsAct(baseFeat);
126
76
  }
127
- }, {
128
- key: "updateMultiEntities",
129
- value: function updateMultiEntities() {
130
- var _this$props4 = this.props,
131
- multiEntities = _this$props4.multiEntities,
132
- setAllCurvesAct = _this$props4.setAllCurvesAct;
133
- setAllCurvesAct(multiEntities);
77
+ if (_format.default.isNmrLayout(layout)) {
78
+ const {
79
+ integration,
80
+ multiplicity,
81
+ simulation
82
+ } = features;
83
+ updateMetaPeaksAct(entity);
84
+ resetInitNmrAct({
85
+ integration,
86
+ multiplicity,
87
+ simulation
88
+ });
89
+ } else if (_format.default.isHplcUvVisLayout(layout)) {
90
+ const {
91
+ integration
92
+ } = features;
93
+ updateMetaPeaksAct(entity);
94
+ resetInitCommonWithIntergationAct({
95
+ integration
96
+ });
134
97
  }
135
- }, {
136
- key: "render",
137
- value: function render() {
138
- var _this$props5 = this.props,
139
- entity = _this$props5.entity,
140
- cLabel = _this$props5.cLabel,
141
- xLabel = _this$props5.xLabel,
142
- yLabel = _this$props5.yLabel,
143
- forecast = _this$props5.forecast,
144
- operations = _this$props5.operations,
145
- descriptions = _this$props5.descriptions,
146
- molSvg = _this$props5.molSvg,
147
- editorOnly = _this$props5.editorOnly,
148
- canChangeDescription = _this$props5.canChangeDescription,
149
- onDescriptionChanged = _this$props5.onDescriptionChanged,
150
- multiEntities = _this$props5.multiEntities,
151
- entityFileNames = _this$props5.entityFileNames,
152
- userManualLink = _this$props5.userManualLink;
153
- var target = entity.spectra[0];
154
- var layout = entity.layout;
155
- var xxLabel = !xLabel && xLabel === '' ? "X (".concat(target.xUnit, ")") : xLabel;
156
- var yyLabel = !yLabel && yLabel === '' ? "Y (".concat(target.yUnit, ")") : yLabel;
157
- if (multiEntities) {
158
- return /*#__PURE__*/_react.default.createElement(_multi_jcamps_viewer.default, {
159
- multiEntities: multiEntities,
160
- entityFileNames: entityFileNames,
161
- userManualLink: userManualLink,
162
- molSvg: molSvg,
163
- operations: operations
164
- });
165
- } else if (_format.default.isCyclicVoltaLayout(layout)) {
166
- // eslint-disable-line
167
- return /*#__PURE__*/_react.default.createElement(_multi_jcamps_viewer.default, {
168
- multiEntities: [entity],
169
- entityFileNames: entityFileNames,
170
- userManualLink: userManualLink,
171
- molSvg: molSvg,
172
- operations: operations
173
- });
174
- }
175
- return /*#__PURE__*/_react.default.createElement(_layer_prism.default, {
176
- entity: entity,
177
- cLabel: cLabel,
178
- xLabel: xxLabel,
179
- yLabel: yyLabel,
180
- forecast: forecast,
181
- operations: operations,
182
- descriptions: descriptions,
98
+ }
99
+ initReducer() {
100
+ const {
101
+ operations,
102
+ updateOperationAct
103
+ } = this.props;
104
+ updateOperationAct(operations[0]);
105
+ }
106
+ updateOthers() {
107
+ const {
108
+ others,
109
+ addOthersAct
110
+ } = this.props;
111
+ addOthersAct(others);
112
+ }
113
+ updateMultiEntities() {
114
+ const {
115
+ multiEntities,
116
+ setAllCurvesAct
117
+ } = this.props;
118
+ setAllCurvesAct(multiEntities);
119
+ }
120
+ render() {
121
+ const {
122
+ entity,
123
+ cLabel,
124
+ xLabel,
125
+ yLabel,
126
+ forecast,
127
+ operations,
128
+ descriptions,
129
+ molSvg,
130
+ editorOnly,
131
+ canChangeDescription,
132
+ onDescriptionChanged,
133
+ multiEntities,
134
+ entityFileNames,
135
+ userManualLink
136
+ } = this.props;
137
+ const target = entity.spectra[0];
138
+ const {
139
+ layout
140
+ } = entity;
141
+ const xxLabel = !xLabel && xLabel === '' ? `X (${target.xUnit})` : xLabel;
142
+ const yyLabel = !yLabel && yLabel === '' ? `Y (${target.yUnit})` : yLabel;
143
+ if (multiEntities) {
144
+ return /*#__PURE__*/_react.default.createElement(_multi_jcamps_viewer.default, {
145
+ multiEntities: multiEntities,
146
+ entityFileNames: entityFileNames,
147
+ userManualLink: userManualLink,
148
+ molSvg: molSvg,
149
+ operations: operations
150
+ });
151
+ } else if (_format.default.isCyclicVoltaLayout(layout)) {
152
+ // eslint-disable-line
153
+ return /*#__PURE__*/_react.default.createElement(_multi_jcamps_viewer.default, {
154
+ multiEntities: [entity],
155
+ entityFileNames: entityFileNames,
156
+ userManualLink: userManualLink,
183
157
  molSvg: molSvg,
184
- editorOnly: editorOnly,
185
- canChangeDescription: canChangeDescription,
186
- onDescriptionChanged: onDescriptionChanged
158
+ operations: operations
187
159
  });
188
160
  }
189
- }]);
190
- return LayerInit;
191
- }(_react.default.Component);
192
- var mapStateToProps = function mapStateToProps(state, props) {
193
- return (
194
- // eslint-disable-line
195
- {}
196
- );
197
- };
198
- var mapDispatchToProps = function mapDispatchToProps(dispatch) {
199
- return (0, _redux.bindActionCreators)({
200
- resetInitCommonAct: _manager.resetInitCommon,
201
- resetInitNmrAct: _manager.resetInitNmr,
202
- resetInitMsAct: _manager.resetInitMs,
203
- resetInitCommonWithIntergationAct: _manager.resetInitCommonWithIntergation,
204
- updateOperationAct: _submit.updateOperation,
205
- updateMetaPeaksAct: _meta.updateMetaPeaks,
206
- addOthersAct: _jcamp.addOthers,
207
- setAllCurvesAct: _curve.setAllCurves
208
- }, dispatch);
209
- };
161
+ return /*#__PURE__*/_react.default.createElement(_layer_prism.default, {
162
+ entity: entity,
163
+ cLabel: cLabel,
164
+ xLabel: xxLabel,
165
+ yLabel: yyLabel,
166
+ forecast: forecast,
167
+ operations: operations,
168
+ descriptions: descriptions,
169
+ molSvg: molSvg,
170
+ editorOnly: editorOnly,
171
+ canChangeDescription: canChangeDescription,
172
+ onDescriptionChanged: onDescriptionChanged
173
+ });
174
+ }
175
+ }
176
+ const mapStateToProps = (state, props) => (
177
+ // eslint-disable-line
178
+ {});
179
+ const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({
180
+ resetInitCommonAct: _manager.resetInitCommon,
181
+ resetInitNmrAct: _manager.resetInitNmr,
182
+ resetInitMsAct: _manager.resetInitMs,
183
+ resetInitCommonWithIntergationAct: _manager.resetInitCommonWithIntergation,
184
+ updateOperationAct: _submit.updateOperation,
185
+ updateMetaPeaksAct: _meta.updateMetaPeaks,
186
+ addOthersAct: _jcamp.addOthers,
187
+ setAllCurvesAct: _curve.setAllCurves
188
+ }, dispatch);
210
189
  LayerInit.propTypes = {
211
190
  entity: _propTypes.default.object.isRequired,
212
191
  multiEntities: _propTypes.default.array,
@@ -235,7 +214,6 @@ LayerInit.propTypes = {
235
214
  setAllCurvesAct: _propTypes.default.func.isRequired,
236
215
  userManualLink: _propTypes.default.object // eslint-disable-line
237
216
  };
238
- var _default = (0, _reactRedux.connect)(
217
+ var _default = exports.default = (0, _reactRedux.connect)(
239
218
  // eslint-disable-line
240
- mapStateToProps, mapDispatchToProps)((0, _styles.withStyles)(styles)(LayerInit)); // eslint-disable-line
241
- exports.default = _default;
219
+ mapStateToProps, mapDispatchToProps)((0, _styles.withStyles)(styles)(LayerInit)); // eslint-disable-line
@@ -15,36 +15,39 @@ var _index = _interopRequireDefault(require("./components/panel/index"));
15
15
  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
- var _extractParams2 = require("./helpers/extractParams");
18
+ var _extractParams = require("./helpers/extractParams");
19
19
  /* eslint-disable prefer-object-spread, default-param-last,
20
20
  react/function-component-definition, react/require-default-props
21
21
  */
22
22
 
23
- var styles = function styles() {
24
- return {};
25
- };
26
- var LayerPrism = function LayerPrism(_ref) {
27
- var entity = _ref.entity,
28
- cLabel = _ref.cLabel,
29
- xLabel = _ref.xLabel,
30
- yLabel = _ref.yLabel,
31
- forecast = _ref.forecast,
32
- operations = _ref.operations,
33
- descriptions = _ref.descriptions,
34
- molSvg = _ref.molSvg,
35
- editorOnly = _ref.editorOnly,
36
- thresSt = _ref.thresSt,
37
- scanSt = _ref.scanSt,
38
- uiSt = _ref.uiSt,
39
- canChangeDescription = _ref.canChangeDescription,
40
- onDescriptionChanged = _ref.onDescriptionChanged;
41
- var _extractParams = (0, _extractParams2.extractParams)(entity, thresSt, scanSt),
42
- topic = _extractParams.topic,
43
- feature = _extractParams.feature,
44
- hasEdit = _extractParams.hasEdit,
45
- integration = _extractParams.integration;
23
+ 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
+ thresSt,
36
+ scanSt,
37
+ uiSt,
38
+ canChangeDescription,
39
+ onDescriptionChanged
40
+ } = _ref;
41
+ const {
42
+ topic,
43
+ feature,
44
+ hasEdit,
45
+ integration
46
+ } = (0, _extractParams.extractParams)(entity, thresSt, scanSt);
46
47
  if (!topic) return null;
47
- var viewer = uiSt.viewer;
48
+ const {
49
+ viewer
50
+ } = uiSt;
48
51
  if (viewer === _list_ui.LIST_UI_VIEWER_TYPE.ANALYSIS) {
49
52
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_index2.default, {
50
53
  feature: feature,
@@ -104,19 +107,14 @@ var LayerPrism = function LayerPrism(_ref) {
104
107
  onDescriptionChanged: onDescriptionChanged
105
108
  })))));
106
109
  };
107
- var mapStateToProps = function mapStateToProps(state, props) {
108
- return (
109
- // eslint-disable-line
110
- {
111
- scanSt: state.scan,
112
- thresSt: state.threshold,
113
- uiSt: state.ui
114
- }
115
- );
116
- };
117
- var mapDispatchToProps = function mapDispatchToProps(dispatch) {
118
- return (0, _redux.bindActionCreators)({}, dispatch);
119
- };
110
+ const mapStateToProps = (state, props) => (
111
+ // eslint-disable-line
112
+ {
113
+ scanSt: state.scan,
114
+ thresSt: state.threshold,
115
+ uiSt: state.ui
116
+ });
117
+ const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({}, dispatch);
120
118
  LayerPrism.propTypes = {
121
119
  entity: _propTypes.default.object.isRequired,
122
120
  cLabel: _propTypes.default.string.isRequired,
@@ -133,7 +131,6 @@ LayerPrism.propTypes = {
133
131
  canChangeDescription: _propTypes.default.bool.isRequired,
134
132
  onDescriptionChanged: _propTypes.default.func
135
133
  };
136
- var _default = (0, _reactRedux.connect)(
134
+ var _default = exports.default = (0, _reactRedux.connect)(
137
135
  // eslint-disable-line
138
- mapStateToProps, mapDispatchToProps)((0, _styles.withStyles)(styles)(LayerPrism)); // eslint-disable-line
139
- exports.default = _default;
136
+ mapStateToProps, mapDispatchToProps)((0, _styles.withStyles)(styles)(LayerPrism)); // eslint-disable-line
@@ -24,7 +24,7 @@ var _reducer_jcamp = _interopRequireDefault(require("./reducer_jcamp"));
24
24
  var _reducer_wavelength = _interopRequireDefault(require("./reducer_wavelength"));
25
25
  var _reducer_voltammetry = _interopRequireDefault(require("./reducer_voltammetry"));
26
26
  var _reducer_curve = _interopRequireDefault(require("./reducer_curve"));
27
- var rootReducer = (0, _redux.combineReducers)({
27
+ const rootReducer = (0, _redux.combineReducers)({
28
28
  threshold: _reducer_threshold.default,
29
29
  editPeak: _reducer_edit_peak.default,
30
30
  status: _reducer_status.default,
@@ -44,5 +44,4 @@ var rootReducer = (0, _redux.combineReducers)({
44
44
  cyclicvolta: _reducer_voltammetry.default,
45
45
  curve: _reducer_curve.default
46
46
  });
47
- var _default = rootReducer;
48
- exports.default = _default;
47
+ var _default = exports.default = rootReducer;