@complat/react-spectra-editor 1.5.4 → 1.7.0

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.
@@ -7,11 +7,13 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
+ var _classnames = _interopRequireDefault(require("classnames"));
10
11
  var _reactRedux = require("react-redux");
11
12
  var _redux = require("redux");
12
13
  var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
13
14
  var _styles = require("@mui/styles");
14
15
  var _index = _interopRequireDefault(require("./panel/index"));
16
+ var _cyclic_voltamery_data = _interopRequireDefault(require("./panel/cyclic_voltamery_data"));
15
17
  var _index2 = _interopRequireDefault(require("./cmd_bar/index"));
16
18
  var _index3 = _interopRequireDefault(require("./d3_multi/index"));
17
19
  var _curve = require("../actions/curve");
@@ -33,6 +35,32 @@ const styles = () => ({
33
35
  },
34
36
  tabLabel: {
35
37
  fontSize: '14px'
38
+ },
39
+ cvEditor: {
40
+ height: 'calc(90vh - 220px)',
41
+ display: 'flex',
42
+ flexDirection: 'column',
43
+ minHeight: 0,
44
+ overflow: 'hidden'
45
+ },
46
+ cvTopRow: {
47
+ flex: '1 1 auto',
48
+ minHeight: 0,
49
+ overflow: 'hidden'
50
+ },
51
+ cvViewerCol: {
52
+ height: '100%',
53
+ minHeight: 0,
54
+ display: 'flex',
55
+ flexDirection: 'column'
56
+ },
57
+ cvViewerWrap: {
58
+ flex: '1 1 auto',
59
+ minHeight: 0
60
+ },
61
+ cvPanelBelow: {
62
+ marginTop: 16,
63
+ width: '100%'
36
64
  }
37
65
  });
38
66
  const seperatingSubLayout = (entities, featureCondition, layoutSt) => {
@@ -86,6 +114,7 @@ class MultiJcampsViewer extends _react.default.Component {
86
114
  integrations
87
115
  } = integrationSt;
88
116
  const currentIntegration = integrations[curveIdx];
117
+ const isCyclicVolta = _format.default.isCyclicVoltaLayout(layoutSt);
89
118
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
90
119
  className: classes.root,
91
120
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.default, {
@@ -94,19 +123,31 @@ class MultiJcampsViewer extends _react.default.Component {
94
123
  editorOnly: true,
95
124
  hideThreshold: !_format.default.isNmrLayout(layoutSt)
96
125
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
97
- className: "react-spectrum-editor",
126
+ className: (0, _classnames.default)('react-spectrum-editor', isCyclicVolta && classes.cvEditor),
98
127
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Grid.default, {
99
128
  container: true,
100
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
129
+ className: isCyclicVolta ? classes.cvTopRow : undefined,
130
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Grid.default, {
101
131
  item: true,
102
132
  xs: 9,
103
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.default, {
104
- entities: entities,
105
- topic: topic,
106
- xLabel: feature.xUnit,
107
- yLabel: feature.yUnit,
108
- feature: feature
109
- })
133
+ className: isCyclicVolta ? classes.cvViewerCol : undefined,
134
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
135
+ className: isCyclicVolta ? classes.cvViewerWrap : undefined,
136
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.default, {
137
+ entities: entities,
138
+ topic: topic,
139
+ xLabel: feature.xUnit,
140
+ yLabel: feature.yUnit,
141
+ feature: feature
142
+ })
143
+ }), isCyclicVolta ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
144
+ className: classes.cvPanelBelow,
145
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_cyclic_voltamery_data.default, {
146
+ jcampIdx: curveIdx,
147
+ feature: feature,
148
+ userManualLink: userManualLink ? userManualLink.cv : undefined
149
+ })
150
+ }) : null]
110
151
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
111
152
  item: true,
112
153
  xs: 3,
@@ -122,7 +163,8 @@ class MultiJcampsViewer extends _react.default.Component {
122
163
  integration: currentIntegration,
123
164
  descriptions: descriptions,
124
165
  canChangeDescription: canChangeDescription,
125
- onDescriptionChanged: onDescriptionChanged
166
+ onDescriptionChanged: onDescriptionChanged,
167
+ hideCyclicVolta: isCyclicVolta
126
168
  })
127
169
  })]
128
170
  })