@complat/react-spectra-editor 0.10.13-beta.3 → 0.10.13

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 (36) hide show
  1. package/dist/actions/integration.js +2 -10
  2. package/dist/actions/manager.js +10 -2
  3. package/dist/actions/wavelength.js +17 -0
  4. package/dist/components/cmd_bar/04_integration.js +9 -2
  5. package/dist/components/cmd_bar/05_multiplicity.js +1 -1
  6. package/dist/components/cmd_bar/index.js +6 -1
  7. package/dist/components/cmd_bar/r01_layout.js +9 -0
  8. package/dist/components/cmd_bar/r05_submit_btn.js +11 -6
  9. package/dist/components/cmd_bar/r07_wavelength_btn.js +135 -0
  10. package/dist/components/cmd_bar/tri_btn.js +2 -2
  11. package/dist/components/d3_line/index.js +15 -5
  12. package/dist/components/d3_line/line_focus.js +209 -101
  13. package/dist/components/forecast_viewer.js +9 -4
  14. package/dist/components/panel/info.js +14 -9
  15. package/dist/constants/action_type.js +9 -4
  16. package/dist/constants/list_layout.js +2 -1
  17. package/dist/constants/list_wavelength.js +36 -0
  18. package/dist/helpers/calc.js +6 -1
  19. package/dist/helpers/cfg.js +3 -3
  20. package/dist/helpers/chem.js +18 -4
  21. package/dist/helpers/compass.js +25 -5
  22. package/dist/helpers/extractPeaksEdit.js +5 -7
  23. package/dist/helpers/format.js +55 -4
  24. package/dist/helpers/integration.js +39 -2
  25. package/dist/helpers/mount.js +2 -1
  26. package/dist/index.js +27 -10
  27. package/dist/layer_content.js +7 -4
  28. package/dist/layer_init.js +11 -1
  29. package/dist/layer_prism.js +2 -11
  30. package/dist/reducers/index.js +6 -1
  31. package/dist/reducers/reducer_integration.js +2 -12
  32. package/dist/reducers/reducer_wavelength.js +25 -0
  33. package/dist/reducers/undo_redo_config.js +3 -3
  34. package/dist/sagas/saga_manager.js +30 -2
  35. package/dist/sagas/saga_ui.js +1 -1
  36. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.loadObservedIntegration = exports.clearIntegrationAll = exports.setIntegrationFkr = exports.sweepIntegration = undefined;
6
+ exports.clearIntegrationAll = exports.setIntegrationFkr = exports.sweepIntegration = undefined;
7
7
 
8
8
  var _action_type = require('../constants/action_type');
9
9
 
@@ -28,14 +28,6 @@ var clearIntegrationAll = function clearIntegrationAll(payload) {
28
28
  };
29
29
  };
30
30
 
31
- var loadObservedIntegration = function loadObservedIntegration(payload) {
32
- return {
33
- type: _action_type.INTEGRATION.LOAD_OBSERVED_INTEGRALS,
34
- payload: payload
35
- };
36
- };
37
-
38
31
  exports.sweepIntegration = sweepIntegration;
39
32
  exports.setIntegrationFkr = setIntegrationFkr;
40
- exports.clearIntegrationAll = clearIntegrationAll;
41
- exports.loadObservedIntegration = loadObservedIntegration; // eslint-disable-line
33
+ exports.clearIntegrationAll = clearIntegrationAll; // eslint-disable-line
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.resetInitMs = exports.resetInitNmr = exports.resetInitCommon = exports.resetAll = undefined;
6
+ exports.resetInitCommonWithIntergation = exports.resetInitMs = exports.resetInitNmr = exports.resetInitCommon = exports.resetAll = undefined;
7
7
 
8
8
  var _action_type = require('../constants/action_type');
9
9
 
@@ -35,7 +35,15 @@ var resetInitMs = function resetInitMs(payload) {
35
35
  };
36
36
  };
37
37
 
38
+ var resetInitCommonWithIntergation = function resetInitCommonWithIntergation(payload) {
39
+ return {
40
+ type: _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION,
41
+ payload: payload
42
+ };
43
+ };
44
+
38
45
  exports.resetAll = resetAll;
39
46
  exports.resetInitCommon = resetInitCommon;
40
47
  exports.resetInitNmr = resetInitNmr;
41
- exports.resetInitMs = resetInitMs; // eslint-disable-line
48
+ exports.resetInitMs = resetInitMs;
49
+ exports.resetInitCommonWithIntergation = resetInitCommonWithIntergation; // eslint-disable-line
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.updateWaveLength = undefined;
7
+
8
+ var _action_type = require("../constants/action_type");
9
+
10
+ var updateWaveLength = function updateWaveLength(payload) {
11
+ return {
12
+ type: _action_type.XRD.UPDATE_WAVE_LENGTH,
13
+ payload: payload
14
+ };
15
+ };
16
+
17
+ exports.updateWaveLength = updateWaveLength; // eslint-disable-line
@@ -52,6 +52,10 @@ var _tri_btn2 = _interopRequireDefault(_tri_btn);
52
52
 
53
53
  var _common = require('./common');
54
54
 
55
+ var _format = require('../../helpers/format');
56
+
57
+ var _format2 = _interopRequireDefault(_format);
58
+
55
59
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
56
60
 
57
61
  var styles = function styles() {
@@ -107,6 +111,7 @@ var iconColor = function iconColor(criteria) {
107
111
  var Integration = function Integration(_ref) {
108
112
  var classes = _ref.classes,
109
113
  refFactorSt = _ref.refFactorSt,
114
+ ignoreRef = _ref.ignoreRef,
110
115
  isDisableSt = _ref.isDisableSt,
111
116
  isFocusAddIntgSt = _ref.isFocusAddIntgSt,
112
117
  isFocusRmIntgSt = _ref.isFocusRmIntgSt,
@@ -216,7 +221,7 @@ var Integration = function Integration(_ref) {
216
221
  )
217
222
  )
218
223
  ),
219
- setFactor(classes, isDisableSt, refFactorSt, setIntegrationFkrAct),
224
+ !ignoreRef ? setFactor(classes, isDisableSt, refFactorSt, setIntegrationFkrAct) : null,
220
225
  _react2.default.createElement(
221
226
  _tri_btn2.default,
222
227
  {
@@ -245,7 +250,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
245
250
  isFocusAddIntgSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_ADD,
246
251
  isFocusRmIntgSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_RM,
247
252
  isFocusSetRefSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_SET_REF,
248
- refFactorSt: state.integration.present.refFactor
253
+ refFactorSt: state.integration.present.refFactor,
254
+ ignoreRef: _format2.default.isHplcUvVisLayout(state.layout)
249
255
  }
250
256
  );
251
257
  };
@@ -265,6 +271,7 @@ Integration.propTypes = {
265
271
  isFocusRmIntgSt: _propTypes2.default.bool.isRequired,
266
272
  isFocusSetRefSt: _propTypes2.default.bool.isRequired,
267
273
  refFactorSt: _propTypes2.default.number.isRequired,
274
+ ignoreRef: _propTypes2.default.bool.isRequired,
268
275
  setUiSweepTypeAct: _propTypes2.default.func.isRequired,
269
276
  setIntegrationFkrAct: _propTypes2.default.func.isRequired,
270
277
  clearIntegrationAllAct: _propTypes2.default.func.isRequired
@@ -176,7 +176,7 @@ var Multiplicity = function Multiplicity(_ref) {
176
176
  )
177
177
  )
178
178
  ),
179
- _react2.default.createElement(
179
+ disableAddMpySt ? null : _react2.default.createElement(
180
180
  _tri_btn2.default,
181
181
  {
182
182
  content: { tp: 'Clear All Multiplicity' },
@@ -56,6 +56,10 @@ var _r04_submit = require('./r04_submit');
56
56
 
57
57
  var _r04_submit2 = _interopRequireDefault(_r04_submit);
58
58
 
59
+ var _r07_wavelength_btn = require('./r07_wavelength_btn');
60
+
61
+ var _r07_wavelength_btn2 = _interopRequireDefault(_r07_wavelength_btn);
62
+
59
63
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
60
64
 
61
65
  var styles = function styles() {
@@ -87,7 +91,8 @@ var CmdBar = function CmdBar(_ref) {
87
91
  disabled: false
88
92
  }),
89
93
  _react2.default.createElement(_r03_threshold2.default, { feature: feature, hasEdit: hasEdit }),
90
- _react2.default.createElement(_r01_layout2.default, { feature: feature, hasEdit: hasEdit })
94
+ _react2.default.createElement(_r01_layout2.default, { feature: feature, hasEdit: hasEdit }),
95
+ _react2.default.createElement(_r07_wavelength_btn2.default, null)
91
96
  );
92
97
  };
93
98
 
@@ -181,6 +181,15 @@ var layoutSelect = function layoutSelect(classes, layoutSt, updateLayoutAct) {
181
181
  'UV/VIS'
182
182
  )
183
183
  ),
184
+ _react2.default.createElement(
185
+ _MenuItem2.default,
186
+ { value: _list_layout.LIST_LAYOUT.HPLC_UVVIS },
187
+ _react2.default.createElement(
188
+ 'span',
189
+ { className: (0, _classnames2.default)(classes.txtOpt, 'option-sv-bar-layout') },
190
+ 'HPLC UV/VIS'
191
+ )
192
+ ),
184
193
  _react2.default.createElement(
185
194
  _MenuItem2.default,
186
195
  { value: _list_layout.LIST_LAYOUT.TGA },
@@ -42,7 +42,7 @@ var styles = function styles() {
42
42
  return Object.assign({}, _common.commonStyle);
43
43
  };
44
44
 
45
- var onClickCb = function onClickCb(operation, peaksEdit, isAscend, isIntensity, scan, thres, layoutSt, shiftSt, analysis, decimalSt, integrationSt, multiplicitySt, aucValues) {
45
+ var onClickCb = function onClickCb(operation, peaksEdit, isAscend, isIntensity, scan, thres, layoutSt, shiftSt, analysis, decimalSt, integrationSt, multiplicitySt, allIntegrationSt, aucValues, waveLengthSt) {
46
46
  return function () {
47
47
  operation({
48
48
  peaks: peaksEdit,
@@ -56,7 +56,9 @@ var onClickCb = function onClickCb(operation, peaksEdit, isAscend, isIntensity,
56
56
  decimal: decimalSt,
57
57
  integration: integrationSt,
58
58
  multiplicity: multiplicitySt,
59
- aucValues: aucValues
59
+ allIntegration: allIntegrationSt,
60
+ aucValues: aucValues,
61
+ waveLength: waveLengthSt
60
62
  });
61
63
  };
62
64
  };
@@ -76,7 +78,8 @@ var BtnSubmit = function BtnSubmit(_ref) {
76
78
  decimalSt = _ref.decimalSt,
77
79
  integrationSt = _ref.integrationSt,
78
80
  multiplicitySt = _ref.multiplicitySt,
79
- allIntegrationSt = _ref.allIntegrationSt;
81
+ allIntegrationSt = _ref.allIntegrationSt,
82
+ waveLengthSt = _ref.waveLengthSt;
80
83
 
81
84
  var peaksEdit = (0, _extractPeaksEdit.extractPeaksEdit)(feature, editPeakSt, thresSt, shiftSt, layoutSt);
82
85
  // const disBtn = peaksEdit.length === 0 || statusSt.btnSubmit || disabled;
@@ -98,7 +101,7 @@ var BtnSubmit = function BtnSubmit(_ref) {
98
101
  {
99
102
  className: (0, _classnames2.default)('btn-sv-bar-submit'),
100
103
  color: 'primary',
101
- onClick: onClickCb(operation.value, peaksEdit, isAscend, isIntensity, scan, thres, layoutSt, shiftSt, forecastSt.predictions, decimalSt, integrationSt, multiplicitySt, allIntegrationSt, aucValues)
104
+ onClick: onClickCb(operation.value, peaksEdit, isAscend, isIntensity, scan, thres, layoutSt, shiftSt, forecastSt.predictions, decimalSt, integrationSt, multiplicitySt, allIntegrationSt, aucValues, waveLengthSt)
102
105
  },
103
106
  _react2.default.createElement(_PlayCircleOutline2.default, { className: classes.icon })
104
107
  )
@@ -117,7 +120,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
117
120
  decimalSt: state.submit.decimal,
118
121
  integrationSt: state.integration.present,
119
122
  multiplicitySt: state.multiplicity.present,
120
- allIntegrationSt: state.integration.past.concat(state.integration.present)
123
+ allIntegrationSt: state.integration.past.concat(state.integration.present),
124
+ waveLengthSt: state.wavelength
121
125
  }
122
126
  );
123
127
  };
@@ -141,7 +145,8 @@ BtnSubmit.propTypes = {
141
145
  decimalSt: _propTypes2.default.number.isRequired,
142
146
  integrationSt: _propTypes2.default.object.isRequired,
143
147
  multiplicitySt: _propTypes2.default.object.isRequired,
144
- allIntegrationSt: _propTypes2.default.object.isRequired
148
+ allIntegrationSt: _propTypes2.default.object.isRequired,
149
+ waveLengthSt: _propTypes2.default.object.isRequired
145
150
  };
146
151
 
147
152
  exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _styles.withStyles)(styles))(BtnSubmit);
@@ -0,0 +1,135 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _react = require('react');
8
+
9
+ var _react2 = _interopRequireDefault(_react);
10
+
11
+ var _propTypes = require('prop-types');
12
+
13
+ var _propTypes2 = _interopRequireDefault(_propTypes);
14
+
15
+ var _reactRedux = require('react-redux');
16
+
17
+ var _classnames = require('classnames');
18
+
19
+ var _classnames2 = _interopRequireDefault(_classnames);
20
+
21
+ var _redux = require('redux');
22
+
23
+ var _core = require('@material-ui/core');
24
+
25
+ var _styles = require('@material-ui/core/styles');
26
+
27
+ var _wavelength = require('../../actions/wavelength');
28
+
29
+ var _format = require('../../helpers/format');
30
+
31
+ var _format2 = _interopRequireDefault(_format);
32
+
33
+ var _common = require('./common');
34
+
35
+ var _list_wavelength = require('../../constants/list_wavelength');
36
+
37
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
38
+
39
+ var styles = function styles() {
40
+ return Object.assign({
41
+ fieldShift: {
42
+ width: 160
43
+ },
44
+ fieldLayout: {
45
+ width: 100
46
+ }
47
+ }, _common.commonStyle);
48
+ };
49
+
50
+ var wavelengthSelect = function wavelengthSelect(classes, waveLengthSt, layoutSt, updateWaveLengthAct) {
51
+
52
+ if (!_format2.default.isXRDLayout(layoutSt)) {
53
+ return _react2.default.createElement('i', null);
54
+ }
55
+
56
+ var onChange = function onChange(e) {
57
+ return updateWaveLengthAct(e.target.value);
58
+ };
59
+
60
+ return _react2.default.createElement(
61
+ _core.FormControl,
62
+ {
63
+ className: (0, _classnames2.default)(classes.fieldLayout),
64
+ variant: 'outlined'
65
+ },
66
+ _react2.default.createElement(
67
+ _core.InputLabel,
68
+ { className: (0, _classnames2.default)(classes.selectLabel, 'select-sv-bar-label') },
69
+ 'Wavelength'
70
+ ),
71
+ _react2.default.createElement(
72
+ _core.Select,
73
+ {
74
+ value: waveLengthSt,
75
+ onChange: onChange,
76
+ input: _react2.default.createElement(_core.OutlinedInput, {
77
+ className: (0, _classnames2.default)(classes.selectInput, 'input-sv-bar-layout'),
78
+ labelWidth: 60
79
+ })
80
+ },
81
+ _list_wavelength.LIST_WAVE_LENGTH.map(function (item) {
82
+ return _react2.default.createElement(
83
+ _core.MenuItem,
84
+ { value: item },
85
+ _react2.default.createElement(
86
+ 'span',
87
+ { className: (0, _classnames2.default)(classes.txtOpt, 'option-sv-bar-layout') },
88
+ item.label,
89
+ ' (',
90
+ item.value,
91
+ ' ',
92
+ item.unit,
93
+ ')'
94
+ )
95
+ );
96
+ })
97
+ )
98
+ );
99
+ };
100
+
101
+ var Wavelength = function Wavelength(_ref) {
102
+ var classes = _ref.classes,
103
+ waveLengthSt = _ref.waveLengthSt,
104
+ layoutSt = _ref.layoutSt,
105
+ updateWaveLengthAct = _ref.updateWaveLengthAct;
106
+ return _react2.default.createElement(
107
+ 'span',
108
+ { className: classes.groupRight },
109
+ wavelengthSelect(classes, waveLengthSt, layoutSt, updateWaveLengthAct)
110
+ );
111
+ };
112
+
113
+ var mapStateToProps = function mapStateToProps(state, props) {
114
+ return (// eslint-disable-line
115
+ {
116
+ waveLengthSt: state.wavelength,
117
+ layoutSt: state.layout
118
+ }
119
+ );
120
+ };
121
+
122
+ var mapDispatchToProps = function mapDispatchToProps(dispatch) {
123
+ return (0, _redux.bindActionCreators)({
124
+ updateWaveLengthAct: _wavelength.updateWaveLength
125
+ }, dispatch);
126
+ };
127
+
128
+ Wavelength.propTypes = {
129
+ classes: _propTypes2.default.object.isRequired,
130
+ layoutSt: _propTypes2.default.string.isRequired,
131
+ waveLengthSt: _propTypes2.default.object.isRequired,
132
+ updateWaveLengthAct: _propTypes2.default.func.isRequired
133
+ };
134
+
135
+ exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)((0, _styles.withStyles)(styles)(Wavelength));
@@ -109,7 +109,7 @@ var TriBtn = function (_React$Component) {
109
109
  _common.MuButton,
110
110
  {
111
111
  className: (0, _classnames2.default)('btn-sv-bar-one'),
112
- disabled: _cfg2.default.btnCmdMpy(layoutSt),
112
+ disabled: _cfg2.default.btnCmdMpy(layoutSt) && _cfg2.default.btnCmdIntg(layoutSt),
113
113
  onClick: this.onToggle
114
114
  },
115
115
  children
@@ -134,7 +134,7 @@ var TriBtn = function (_React$Component) {
134
134
 
135
135
  return _react2.default.createElement(
136
136
  'span',
137
- { disabled: _cfg2.default.btnCmdMpy(layoutSt) },
137
+ { disabled: _cfg2.default.btnCmdMpy(layoutSt) && _cfg2.default.btnCmdIntg(layoutSt) },
138
138
  _react2.default.createElement(
139
139
  'span',
140
140
  { className: (0, _classnames2.default)(classes.txtLabel, 'txt-sv-bar-desc') },
@@ -86,6 +86,7 @@ var ViewerLine = function (_React$Component) {
86
86
  isUiAddIntgSt = _props.isUiAddIntgSt,
87
87
  isUiNoBrushSt = _props.isUiNoBrushSt,
88
88
  isHidden = _props.isHidden,
89
+ wavelength = _props.wavelength,
89
90
  resetAllAct = _props.resetAllAct;
90
91
 
91
92
  (0, _draw.drawDestroy)(this.rootKlass);
@@ -108,7 +109,8 @@ var ViewerLine = function (_React$Component) {
108
109
  mtplySt: mtplySt,
109
110
  sweepExtentSt: sweepExtentSt,
110
111
  isUiAddIntgSt: isUiAddIntgSt,
111
- isUiNoBrushSt: isUiNoBrushSt
112
+ isUiNoBrushSt: isUiNoBrushSt,
113
+ wavelength: wavelength
112
114
  });
113
115
  (0, _draw.drawLabel)(this.rootKlass, cLabel, xLabel, yLabel);
114
116
  (0, _draw.drawDisplay)(this.rootKlass, isHidden);
@@ -119,6 +121,9 @@ var ViewerLine = function (_React$Component) {
119
121
  var _props2 = this.props,
120
122
  seed = _props2.seed,
121
123
  peak = _props2.peak,
124
+ cLabel = _props2.cLabel,
125
+ xLabel = _props2.xLabel,
126
+ yLabel = _props2.yLabel,
122
127
  freq = _props2.freq,
123
128
  comparisons = _props2.comparisons,
124
129
  tTrEndPts = _props2.tTrEndPts,
@@ -130,7 +135,8 @@ var ViewerLine = function (_React$Component) {
130
135
  sweepExtentSt = _props2.sweepExtentSt,
131
136
  isUiAddIntgSt = _props2.isUiAddIntgSt,
132
137
  isUiNoBrushSt = _props2.isUiNoBrushSt,
133
- isHidden = _props2.isHidden;
138
+ isHidden = _props2.isHidden,
139
+ wavelength = _props2.wavelength;
134
140
 
135
141
  this.normChange(prevProps);
136
142
 
@@ -150,8 +156,10 @@ var ViewerLine = function (_React$Component) {
150
156
  mtplySt: mtplySt,
151
157
  sweepExtentSt: sweepExtentSt,
152
158
  isUiAddIntgSt: isUiAddIntgSt,
153
- isUiNoBrushSt: isUiNoBrushSt
159
+ isUiNoBrushSt: isUiNoBrushSt,
160
+ wavelength: wavelength
154
161
  });
162
+ (0, _draw.drawLabel)(this.rootKlass, cLabel, xLabel, yLabel);
155
163
  (0, _draw.drawDisplay)(this.rootKlass, isHidden);
156
164
  }
157
165
  }, {
@@ -195,7 +203,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
195
203
  mtplySt: state.multiplicity.present,
196
204
  sweepExtentSt: state.ui.sweepExtent,
197
205
  isUiAddIntgSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_ADD,
198
- isUiNoBrushSt: _list_ui.LIST_NON_BRUSH_TYPES.indexOf(state.ui.sweepType) < 0
206
+ isUiNoBrushSt: _list_ui.LIST_NON_BRUSH_TYPES.indexOf(state.ui.sweepType) < 0,
207
+ wavelength: state.wavelength
199
208
  };
200
209
  };
201
210
 
@@ -230,7 +239,8 @@ ViewerLine.propTypes = {
230
239
  clickUiTargetAct: _propTypes2.default.func.isRequired,
231
240
  selectUiSweepAct: _propTypes2.default.func.isRequired,
232
241
  scrollUiWheelAct: _propTypes2.default.func.isRequired,
233
- isHidden: _propTypes2.default.bool.isRequired
242
+ isHidden: _propTypes2.default.bool.isRequired,
243
+ wavelength: _propTypes2.default.object.isRequired
234
244
  };
235
245
 
236
246
  exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(ViewerLine);