@complat/react-spectra-editor 1.0.0-rc13.beta.0 → 1.0.0-rc14

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.
@@ -23,6 +23,7 @@ var _list_layout = require("../../constants/list_layout");
23
23
  var _list_shift = require("../../constants/list_shift");
24
24
  var _cfg = _interopRequireDefault(require("../../helpers/cfg"));
25
25
  var _common = require("./common");
26
+ var _format = _interopRequireDefault(require("../../helpers/format"));
26
27
  /* eslint-disable prefer-object-spread, function-paren-newline,
27
28
  react/function-component-definition */
28
29
 
@@ -58,7 +59,7 @@ const shiftSelect = (classes, layoutSt, setShiftRefAct, shiftSt, curveSt) => {
58
59
  key: ref.name
59
60
  }, /*#__PURE__*/_react.default.createElement("span", {
60
61
  className: (0, _classnames.default)(classes.txtOpt, 'option-sv-bar-shift')
61
- }, `${ref.name}: ${ref.value} ppm`)));
62
+ }, `${ref.name}: ${_format.default.strNumberFixedDecimal(ref.value, 2)} ppm`)));
62
63
  return /*#__PURE__*/_react.default.createElement(_FormControl.default, {
63
64
  className: (0, _classnames.default)(classes.fieldShift),
64
65
  variant: "outlined"
@@ -13,14 +13,14 @@ const noReference = {
13
13
  label: false
14
14
  };
15
15
  const cActicAcidD4Sept = {
16
- name: 'Actic acid-d4 (sept)',
16
+ name: 'Acetic acid-d4 (sept)',
17
17
  value: 20.0,
18
- label: 'Actic acid-d4'
18
+ label: 'Acetic acid-d4'
19
19
  };
20
20
  const cActicAcidD4S = {
21
- name: 'Actic acid-d4 (s)',
21
+ name: 'Acetic acid-d4 (s)',
22
22
  value: 178.990,
23
- label: 'Actic acid-d4'
23
+ label: 'Acetic acid-d4'
24
24
  };
25
25
  const cAcetoneD6Sep = {
26
26
  name: 'Acetone-d6 (sep)',
@@ -193,14 +193,14 @@ const cTrifluoroethanolD3Broad = {
193
193
  const LIST_SHIFT_13C = [noReference, cActicAcidD4Sept, cActicAcidD4S, cAcetoneD6Sep, cAcetoneD6Broad, cAcetonitrileD3Sep, cAcetonitrileD3S, cBenzeneT, cChloroformDT, cCyclohexaneD12Quin, cDichloromethaneD2Quin, cDmfD7Sep1, cDmfD7Sep2, cDmfD7T3, cDioxaneD8Quin, cDmsoD6, cEthanolD6Sep, cEthanolD6Quin, cMethanolD4Sep, cPyridineD5T1, cPyridineD5T2, cPyridineD5T3, cThfD8Quin1, cThfD8Quin2, cTmsS, cTolueneD8Sep1, cTolueneD8T2, cTolueneD8T3, cTolueneD8T4, cTolueneD8T5, cTfaDQ1, cTfaDQ2, cTrifluoroethanolD3Quin, cTrifluoroethanolD3Broad];
194
194
  exports.LIST_SHIFT_13C = LIST_SHIFT_13C;
195
195
  const hActicAcidD4Quin = {
196
- name: 'Actic acid-d4 (quin)',
196
+ name: 'Acetic acid-d4 (quin)',
197
197
  value: 2.04,
198
- label: 'Actic acid-d4'
198
+ label: 'Acetic acid-d4'
199
199
  };
200
200
  const hActicAcidD4S = {
201
- name: 'Actic acid-d4 (s)',
201
+ name: 'Acetic acid-d4 (s)',
202
202
  value: 11.65,
203
- label: 'Actic acid-d4'
203
+ label: 'Acetic acid-d4'
204
204
  };
205
205
  const hAcetoneD6Quin = {
206
206
  name: 'Acetone-d6 (quin)',
@@ -222,7 +222,7 @@ const hBenzeneS = {
222
222
  };
223
223
  const hChloroformDS = {
224
224
  name: 'Chloroform-d (s)',
225
- value: 7.27,
225
+ value: 7.26,
226
226
  label: 'CDCl$3',
227
227
  nsdb: 'Chloroform-D1 (CDCl3)'
228
228
  };
@@ -480,6 +480,13 @@ const formatPeaksByPrediction = function (peaks, layout, isAscend, decimal) {
480
480
  };
481
481
  const compareColors = idx => ['#ABB2B9', '#EDBB99', '#ABEBC6', '#D2B4DE', '#F9E79F'][idx % 5];
482
482
  const mutiEntitiesColors = idx => ['#fa8231', '#f7b731', '#0fb9b1', '#2d98da', '#3867d6', '#8854d0', '#4b6584'][idx % 7];
483
+ const strNumberFixedDecimal = function (number) {
484
+ let decimal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
485
+ if (decimal <= 0) {
486
+ return `${number}`;
487
+ }
488
+ return number.toFixed(Math.max(decimal, (number.toString().split('.')[1] || []).length));
489
+ };
483
490
  const Format = {
484
491
  toPeakStr,
485
492
  buildData,
@@ -518,7 +525,8 @@ const Format = {
518
525
  mutiEntitiesColors,
519
526
  hasMultiCurves,
520
527
  isAIFLayout,
521
- isDLSACFLayout
528
+ isDLSACFLayout,
529
+ strNumberFixedDecimal
522
530
  };
523
531
  var _default = Format;
524
532
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@complat/react-spectra-editor",
3
- "version": "1.0.0-rc13.beta.0",
3
+ "version": "1.0.0-rc14",
4
4
  "description": "An editor to View and Edit Chemical Spectra data (NMR, IR and MS, CV, UIVIS, XRD).",
5
5
  "repository": {
6
6
  "type": "git",