nmrium 0.42.0 → 0.43.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.
Files changed (217) hide show
  1. package/lib/component/1d/ApodizationLine.js +1 -1
  2. package/lib/component/1d/Chart1D.js +3 -2
  3. package/lib/component/1d/Line.js +1 -1
  4. package/lib/component/1d/Viewer1D.js +15 -3
  5. package/lib/component/1d/integral/IntegralResizable.js +4 -3
  6. package/lib/component/1d/multiAnalysis/AnalysisRange.js +3 -1
  7. package/lib/component/1d/peaks/PeakAnnotations.js +20 -25
  8. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts +2 -0
  9. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +59 -0
  10. package/lib/component/1d/peaks/PeakEditionManager.d.ts +18 -0
  11. package/lib/component/1d/peaks/PeakEditionManager.js +98 -0
  12. package/lib/component/1d/peaks/Peaks.d.ts +1 -0
  13. package/lib/component/1d/peaks/Peaks.js +22 -0
  14. package/lib/component/1d/ranges/Range.js +3 -1
  15. package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
  16. package/lib/component/1d/tool/BaseLineZones.js +11 -31
  17. package/lib/component/1d/utilities/intersectionResolver.d.ts +25 -0
  18. package/lib/component/1d/utilities/intersectionResolver.js +71 -0
  19. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +3 -2
  20. package/lib/component/2d/SlicingView.js +1 -1
  21. package/lib/component/2d/ft/Contours.js +1 -1
  22. package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +5 -1
  23. package/lib/component/EventsTrackers/KeysListenerTracker.js +47 -6
  24. package/lib/component/assignment/index.d.ts +6 -1
  25. package/lib/component/assignment/index.js +5 -1
  26. package/lib/component/context/DispatchContext.d.ts +1 -2
  27. package/lib/component/context/KeyModifierContext.d.ts +13 -0
  28. package/lib/component/context/KeyModifierContext.js +39 -0
  29. package/lib/component/context/PreferencesContext.d.ts +39 -39
  30. package/lib/component/elements/Button.js +2 -0
  31. package/lib/component/elements/NumberInput.d.ts +1 -0
  32. package/lib/component/elements/NumberInput.js +10 -3
  33. package/lib/component/elements/formik/FormikOnChange.js +1 -1
  34. package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  35. package/lib/component/header/ApodizationOptionsPanel.js +23 -14
  36. package/lib/component/header/BaseLineCorrectionPanel.js +31 -10
  37. package/lib/component/header/Header.d.ts +10 -3
  38. package/lib/component/header/Header.js +5 -5
  39. package/lib/component/header/ZeroFillingOptionsPanel.js +37 -31
  40. package/lib/component/highlight/index.d.ts +1 -0
  41. package/lib/component/highlight/index.js +1 -0
  42. package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
  43. package/lib/component/hooks/useCheckToolsVisibility.js +7 -3
  44. package/lib/component/hooks/useResizerStatus.d.ts +2 -0
  45. package/lib/component/hooks/useResizerStatus.js +7 -0
  46. package/lib/component/hooks/useSpectrum.js +1 -1
  47. package/lib/component/main/ErrorOverlay.js +20 -0
  48. package/lib/component/main/InnerNMRium.d.ts +7 -0
  49. package/lib/component/main/InnerNMRium.js +52 -0
  50. package/lib/component/main/InnerNMRiumContents.d.ts +14 -0
  51. package/lib/component/main/InnerNMRiumContents.js +89 -0
  52. package/lib/component/main/NMRium.d.ts +23 -0
  53. package/lib/component/main/NMRium.js +13 -0
  54. package/lib/component/main/NMRiumStateProvider.d.ts +9 -0
  55. package/lib/component/main/NMRiumStateProvider.js +74 -0
  56. package/lib/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
  57. package/lib/component/main/StateError.d.ts +4 -0
  58. package/lib/component/main/StateError.js +16 -0
  59. package/lib/component/main/index.d.ts +3 -0
  60. package/lib/component/main/index.js +3 -0
  61. package/lib/component/main/types.d.ts +18 -0
  62. package/lib/component/main/types.js +2 -0
  63. package/lib/component/modal/PredictSpectraModal.js +1 -1
  64. package/lib/component/modal/changeSum/ChangeSumModal.d.ts +5 -16
  65. package/lib/component/modal/changeSum/ChangeSumModal.js +6 -115
  66. package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts +18 -0
  67. package/lib/component/modal/changeSum/ChangeSumModalContents.js +94 -0
  68. package/lib/component/modal/setting/GeneralSettings.js +2 -2
  69. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
  70. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +6 -11
  71. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
  72. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +3 -9
  73. package/lib/component/panels/MoleculesPanel/Utilities.js +14 -10
  74. package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +3 -3
  75. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +4 -4
  76. package/lib/component/panels/PeaksPanel/PeaksPanel.js +11 -5
  77. package/lib/component/panels/RangesPanel/RangesHeader.js +6 -10
  78. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
  79. package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -3
  80. package/lib/component/panels/ZonesPanel/ZonesPanel.js +3 -2
  81. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
  82. package/lib/component/panels/header/DefaultPanelHeader.d.ts +3 -4
  83. package/lib/component/panels/header/DefaultPanelHeader.js +9 -5
  84. package/lib/component/panels/predictionPanel/PredictionPanel.js +1 -1
  85. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
  86. package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
  87. package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
  88. package/lib/component/reducer/IgnoreActions.js +0 -1
  89. package/lib/component/reducer/Reducer.d.ts +1 -6
  90. package/lib/component/reducer/Reducer.js +30 -6
  91. package/lib/component/reducer/actions/FiltersActions.d.ts +32 -11
  92. package/lib/component/reducer/actions/FiltersActions.js +96 -28
  93. package/lib/component/reducer/actions/IntegralsActions.d.ts +6 -2
  94. package/lib/component/reducer/actions/IntegralsActions.js +44 -20
  95. package/lib/component/reducer/actions/MoleculeActions.js +1 -1
  96. package/lib/component/reducer/actions/PeaksActions.d.ts +6 -4
  97. package/lib/component/reducer/actions/PeaksActions.js +19 -1
  98. package/lib/component/reducer/actions/RangesActions.d.ts +6 -2
  99. package/lib/component/reducer/actions/RangesActions.js +31 -3
  100. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  101. package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +1 -1
  102. package/lib/component/toolbar/FunctionToolBar.js +13 -3
  103. package/lib/component/toolbar/ToolTypes.d.ts +1 -0
  104. package/lib/component/toolbar/ToolTypes.js +36 -0
  105. package/lib/component/utility/export.js +7 -4
  106. package/lib/component/utility/filterType.d.ts +3 -0
  107. package/lib/component/utility/filterType.js +1 -0
  108. package/lib/component/workspaces/basic.js +2 -0
  109. package/lib/component/workspaces/embedded.js +2 -0
  110. package/lib/component/workspaces/exercise.js +2 -0
  111. package/lib/component/workspaces/prediction.js +9 -0
  112. package/lib/component/workspaces/process1D.js +2 -0
  113. package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
  114. package/lib/data/PredictionManager.d.ts +3 -3
  115. package/lib/data/PredictionManager.js +10 -10
  116. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +1 -2
  117. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +2 -8
  118. package/lib/data/molecules/Molecule.js +2 -2
  119. package/lib/data/utilities/checkModifierKeyActivated.d.ts +1 -1
  120. package/lib/data/utilities/checkModifierKeyActivated.js +8 -13
  121. package/lib/versionInfo.js +1 -1
  122. package/lib-cjs/component/1d/ApodizationLine.js +1 -1
  123. package/lib-cjs/component/1d/Chart1D.js +3 -2
  124. package/lib-cjs/component/1d/Line.js +1 -1
  125. package/lib-cjs/component/1d/Viewer1D.js +15 -3
  126. package/lib-cjs/component/1d/integral/IntegralResizable.js +4 -3
  127. package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +3 -1
  128. package/lib-cjs/component/1d/peaks/PeakAnnotations.js +19 -24
  129. package/lib-cjs/component/1d/peaks/PeakAnnotationsSpreadMode.js +64 -0
  130. package/lib-cjs/component/1d/peaks/PeakEditionManager.js +129 -0
  131. package/lib-cjs/component/1d/peaks/Peaks.js +29 -0
  132. package/lib-cjs/component/1d/ranges/Range.js +3 -1
  133. package/lib-cjs/component/1d/tool/BaseLineZones.js +11 -34
  134. package/lib-cjs/component/1d/utilities/intersectionResolver.js +75 -0
  135. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +3 -2
  136. package/lib-cjs/component/2d/SlicingView.js +1 -1
  137. package/lib-cjs/component/2d/ft/Contours.js +1 -1
  138. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +46 -5
  139. package/lib-cjs/component/assignment/index.js +5 -1
  140. package/lib-cjs/component/context/KeyModifierContext.js +44 -0
  141. package/lib-cjs/component/elements/Button.js +2 -0
  142. package/lib-cjs/component/elements/NumberInput.js +12 -2
  143. package/lib-cjs/component/elements/formik/FormikOnChange.js +1 -1
  144. package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  145. package/lib-cjs/component/header/ApodizationOptionsPanel.js +23 -14
  146. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +30 -9
  147. package/lib-cjs/component/header/Header.js +5 -5
  148. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +35 -29
  149. package/lib-cjs/component/highlight/index.js +1 -0
  150. package/lib-cjs/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
  151. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +7 -3
  152. package/lib-cjs/component/hooks/useResizerStatus.js +11 -0
  153. package/lib-cjs/component/hooks/useSpectrum.js +1 -1
  154. package/lib-cjs/component/main/ErrorOverlay.js +26 -0
  155. package/lib-cjs/component/main/InnerNMRium.js +82 -0
  156. package/lib-cjs/component/main/InnerNMRiumContents.js +96 -0
  157. package/lib-cjs/component/main/NMRium.js +19 -0
  158. package/lib-cjs/component/main/NMRiumStateProvider.js +80 -0
  159. package/lib-cjs/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
  160. package/lib-cjs/component/main/StateError.js +20 -0
  161. package/lib-cjs/component/main/index.js +21 -0
  162. package/lib-cjs/component/main/types.js +3 -0
  163. package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
  164. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +6 -141
  165. package/lib-cjs/component/modal/changeSum/ChangeSumModalContents.js +124 -0
  166. package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -2
  167. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +29 -11
  168. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
  169. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +14 -10
  170. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +4 -4
  171. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +32 -3
  172. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +29 -10
  173. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
  174. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +27 -3
  175. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +26 -2
  176. package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
  177. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +11 -5
  178. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +1 -1
  179. package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
  180. package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
  181. package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
  182. package/lib-cjs/component/reducer/IgnoreActions.js +0 -1
  183. package/lib-cjs/component/reducer/Reducer.js +29 -5
  184. package/lib-cjs/component/reducer/actions/FiltersActions.js +98 -28
  185. package/lib-cjs/component/reducer/actions/IntegralsActions.js +45 -20
  186. package/lib-cjs/component/reducer/actions/MoleculeActions.js +1 -1
  187. package/lib-cjs/component/reducer/actions/PeaksActions.js +20 -1
  188. package/lib-cjs/component/reducer/actions/RangesActions.js +31 -2
  189. package/lib-cjs/component/toolbar/FunctionToolBar.js +13 -3
  190. package/lib-cjs/component/toolbar/ToolTypes.js +36 -0
  191. package/lib-cjs/component/utility/export.js +7 -4
  192. package/lib-cjs/component/utility/filterType.js +2 -0
  193. package/lib-cjs/component/workspaces/basic.js +2 -0
  194. package/lib-cjs/component/workspaces/embedded.js +2 -0
  195. package/lib-cjs/component/workspaces/exercise.js +2 -0
  196. package/lib-cjs/component/workspaces/prediction.js +9 -0
  197. package/lib-cjs/component/workspaces/process1D.js +2 -0
  198. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +2 -0
  199. package/lib-cjs/data/PredictionManager.js +9 -9
  200. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +1 -7
  201. package/lib-cjs/data/molecules/Molecule.js +2 -2
  202. package/lib-cjs/data/utilities/checkModifierKeyActivated.js +8 -13
  203. package/lib-cjs/versionInfo.js +1 -1
  204. package/package.json +26 -25
  205. package/lib/component/1d/peaks/PeakAnnotation.d.ts +0 -12
  206. package/lib/component/1d/peaks/PeakAnnotation.js +0 -116
  207. package/lib/component/ErrorOverlay.js +0 -27
  208. package/lib/component/NMRium.d.ts +0 -42
  209. package/lib/component/NMRium.js +0 -237
  210. package/lib/component/reducer/actions/GlobalActions.d.ts +0 -9
  211. package/lib/component/reducer/actions/GlobalActions.js +0 -4
  212. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +0 -118
  213. package/lib-cjs/component/ErrorOverlay.js +0 -30
  214. package/lib-cjs/component/NMRium.js +0 -267
  215. package/lib-cjs/component/reducer/actions/GlobalActions.js +0 -7
  216. /package/lib/component/{ErrorOverlay.d.ts → main/ErrorOverlay.d.ts} +0 -0
  217. /package/lib/component/{SplitPaneWrapper.d.ts → main/SplitPaneWrapper.d.ts} +0 -0
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
@@ -18,7 +41,7 @@ const Modal_1 = require("../../elements/popup/Modal");
18
41
  const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
19
42
  const ChangeSumModal_1 = __importDefault(require("../../modal/changeSum/ChangeSumModal"));
20
43
  const BasicPanelStyle_1 = require("../extra/BasicPanelStyle");
21
- const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
44
+ const DefaultPanelHeader_1 = __importStar(require("../header/DefaultPanelHeader"));
22
45
  const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader"));
23
46
  const IntegralTable_1 = __importDefault(require("./IntegralTable"));
24
47
  const IntegralsPreferences_1 = __importDefault(require("./IntegralsPreferences"));
@@ -48,16 +71,10 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
48
71
  }, [modal, yesHandler]);
49
72
  const changeIntegralSumHandler = (0, react_2.useCallback)((options) => {
50
73
  dispatch({ type: 'CHANGE_INTEGRAL_SUM', payload: { options } });
51
- modal.close();
52
- }, [dispatch, modal]);
74
+ }, [dispatch]);
53
75
  const currentSum = (0, react_2.useMemo)(() => {
54
76
  return (0, get_1.default)(integrals, 'options.sum', null);
55
77
  }, [integrals]);
56
- const showChangeIntegralSumModal = (0, react_2.useCallback)(() => {
57
- modal.show((0, jsx_runtime_1.jsx)(ChangeSumModal_1.default, { onClose: () => modal.close(), onSave: changeIntegralSumHandler, header: currentSum
58
- ? `Set new integrals Sum (Current: ${Number(currentSum).toFixed(2)})`
59
- : 'Set new integrals Sum', sumOptions: integrals?.options }));
60
- }, [changeIntegralSumHandler, currentSum, integrals?.options, modal]);
61
78
  const settingsPanelHandler = (0, react_2.useCallback)(() => {
62
79
  setFlipStatus(!isFlipped);
63
80
  }, [isFlipped]);
@@ -92,6 +109,7 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
92
109
  }
93
110
  return [];
94
111
  }, [filterIsActive, info.dimension, integrals, xDomain]);
112
+ const counter = integrals?.values?.length || 0;
95
113
  return ((0, jsx_runtime_1.jsxs)("div", { css: [
96
114
  BasicPanelStyle_1.tablePanelStyle,
97
115
  style,
@@ -101,9 +119,9 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
101
119
  position: relative;
102
120
  }
103
121
  `,
104
- ], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: integrals?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Integrals", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all integrals' : 'Hide integrals out of view', filterIsActive: filterIsActive, counterFiltered: filteredData.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: [(0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: currentSum
105
- ? `Change Integrals Sum (${Number(currentSum).toFixed(2)})`
106
- : 'Change Integrals Sum', popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { className: "icon", popupTitle: "Fix integral values", popupPlacement: "right", onClick: toggleConstantSumHandler, value: integrals?.options?.isSumConstant || false, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(IntegralTable_1.default, { data: filteredData, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(IntegralsPreferences_1.default, { ref: settingRef })) })] }));
122
+ ], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: counter, counterLabel: (0, DefaultPanelHeader_1.createFilterLabel)(counter, filterIsActive && filteredData?.length), onDelete: handleDeleteAll, deleteToolTip: "Delete All Integrals", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all integrals' : 'Hide integrals out of view', showSettingButton: true, onSettingClick: settingsPanelHandler, children: [(0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: currentSum
123
+ ? `Change integration sum (${currentSum.toFixed(2)})`
124
+ : 'Change integration sum', popupPlacement: "right", children: (0, jsx_runtime_1.jsx)(ChangeSumModal_1.default, { onSave: changeIntegralSumHandler, sumType: "integrals", currentSum: currentSum, sumOptions: integrals?.options, renderButton: (onClick) => ((0, jsx_runtime_1.jsx)("button", { className: "sum-button", type: "button", onClick: onClick, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) })) }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { className: "icon", popupTitle: "Fixed integration values", popupPlacement: "right", onClick: toggleConstantSumHandler, value: integrals?.options?.isSumConstant || false, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(IntegralTable_1.default, { data: filteredData, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(IntegralsPreferences_1.default, { ref: settingRef })) })] }));
107
125
  }
108
126
  const MemoizedIntegralPanel = (0, react_2.memo)(IntegralPanelInner);
109
127
  const emptyData = { integrals: {}, info: {} };
@@ -27,7 +27,7 @@ const styles = {
27
27
  margin: 0,
28
28
  textAlign: 'right',
29
29
  lineHeight: '22px',
30
- padding: '0 10px',
30
+ padding: '0 5px',
31
31
  whiteSpace: 'nowrap',
32
32
  },
33
33
  atomLabel: {
@@ -165,8 +165,6 @@ function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMolecul
165
165
  });
166
166
  }
167
167
  const hasMolecules = molecules && molecules.length > 0;
168
- return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { children: [renderSource === 'predictionPanel' && (0, jsx_runtime_1.jsx)(AboutPredictionModal_1.default, {}), renderSource === 'moleculePanel' && ((0, jsx_runtime_1.jsx)(ui_1.DropdownMenu, { trigger: "click", options: MOL_EXPORT_MENU, onSelect: exportHandler, children: (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { as: "div", disabled: !hasMolecules, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Export As", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }) })), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: handlePasteMolfileAction, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Paste molfile", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaPaste, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: onOpenMoleculeEditor, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Add molecule", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }), renderSource === 'moleculePanel' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: handleDelete, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Delete molecule", tooltipOrientation: "horizontal", disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }), hasMolecules && ((0, jsx_runtime_1.jsx)(PredictSpectraModal_1.default, { molecule: molecules[currentIndex] }))] })), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { value: moleculesView?.[moleculeKey]?.floating.visible || false, popupTitle: "Float molecule", popupPlacement: "left", onClick: floatMoleculeHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(io5_1.IoOpenOutline, {}) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px' }, value: moleculesView?.[moleculeKey]?.showAtomNumber || false, popupTitle: "Show atom number", popupPlacement: "left", onClick: showAtomNumbersHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)("p", { style: styles.atomLabel, children: "#" }) }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 }, children: children }), (0, jsx_runtime_1.jsxs)("p", { style: styles.counter, children: [molecules &&
169
- molecules.length > 0 &&
170
- `${+(currentIndex + 1)} / ${molecules.length}`, ' '] }), onClickPreferences && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'black' }, onClick: onClickPreferences, toolTip: "Preferences", tooltipOrientation: "vertical", children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) })), (0, jsx_runtime_1.jsx)(clipboardComponents_1.ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePasteMolfile, text: text, label: "Molfile" })] }));
168
+ return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { children: [renderSource === 'predictionPanel' && (0, jsx_runtime_1.jsx)(AboutPredictionModal_1.default, {}), renderSource === 'moleculePanel' && ((0, jsx_runtime_1.jsx)(ui_1.DropdownMenu, { trigger: "click", options: MOL_EXPORT_MENU, onSelect: exportHandler, children: (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { as: "div", disabled: !hasMolecules, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Export As", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }) })), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: handlePasteMolfileAction, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Paste molfile", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaPaste, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: onOpenMoleculeEditor, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Add molecule", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }), renderSource === 'moleculePanel' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: handleDelete, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Delete molecule", tooltipOrientation: "horizontal", disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }), hasMolecules && ((0, jsx_runtime_1.jsx)(PredictSpectraModal_1.default, { molecule: molecules[currentIndex] }))] })), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { value: moleculesView?.[moleculeKey]?.floating.visible || false, popupTitle: "Float molecule", popupPlacement: "left", onClick: floatMoleculeHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(io5_1.IoOpenOutline, {}) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px' }, value: moleculesView?.[moleculeKey]?.showAtomNumber || false, popupTitle: "Show atom number", popupPlacement: "left", onClick: showAtomNumbersHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)("p", { style: styles.atomLabel, children: "#" }) }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 }, children: children }), molecules && molecules.length > 0 && ((0, jsx_runtime_1.jsx)("p", { style: styles.counter, children: `${+(currentIndex + 1)} / ${molecules.length}` })), onClickPreferences && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'black' }, onClick: onClickPreferences, toolTip: "Preferences", tooltipOrientation: "vertical", children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) })), (0, jsx_runtime_1.jsx)(clipboardComponents_1.ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePasteMolfile, text: text, label: "Molfile" })] }));
171
169
  }
172
170
  exports.default = MoleculePanelHeader;
@@ -13,31 +13,35 @@ function getElements(activeTab) {
13
13
  * In case of an heavy atom with bonded hydrogens the OCL id(s)
14
14
  * and number of these hydrogens are added as well.
15
15
  *
16
- * @param {Atom} atom - atom returned by OCLnmr component
16
+ * @param {DiaIDAndInfo} diaIDAndInfo - atom returned by OCLnmr component
17
17
  * @param {string} activeTab - active tab
18
18
  * @param {Axis} axis - current axis
19
19
  *
20
20
  */
21
- function extractFromAtom(atom, activeTab, axis) {
21
+ function extractFromAtom(diaIDAndInfo, activeTab, axis) {
22
22
  const elements = getElements(activeTab);
23
- if (elements && elements.length > 0 && Object.keys(atom).length > 0) {
23
+ if (elements && elements.length > 0 && diaIDAndInfo) {
24
24
  const dim = axis === 'x' ? 0 : axis === 'y' ? 1 : null;
25
25
  switch (dim !== null && elements[dim]) {
26
- case atom.atomLabel: {
26
+ case diaIDAndInfo.atomLabel: {
27
27
  // take always oclID if atom type is same as element of activeTab)
28
- return { oclIDs: [atom.oclID], nbAtoms: atom.nbAtoms };
28
+ return {
29
+ oclIDs: [diaIDAndInfo.idCode],
30
+ nbAtoms: diaIDAndInfo.nbEquivalentAtoms,
31
+ };
29
32
  }
30
33
  case 'H': {
31
34
  // if we are in proton spectrum and use then the IDs of attached hydrogens of an atom
32
35
  return {
33
- oclIDs: atom.hydrogenOCLIDs,
34
- nbAtoms: atom.nbAtoms * atom.nbHydrogens,
36
+ oclIDs: diaIDAndInfo.attachedHydrogensIDCodes,
37
+ nbAtoms: diaIDAndInfo.nbEquivalentAtoms * diaIDAndInfo.nbAttachedHydrogens,
35
38
  };
36
39
  }
37
40
  default:
38
41
  return {
39
- oclIDs: [atom.oclID].concat(atom.hydrogenOCLIDs),
40
- nbAtoms: atom.nbAtoms + atom.nbAtoms * atom.nbHydrogens,
42
+ oclIDs: [diaIDAndInfo.idCode].concat(diaIDAndInfo.attachedHydrogensIDCodes),
43
+ nbAtoms: diaIDAndInfo.nbEquivalentAtoms +
44
+ diaIDAndInfo.nbEquivalentAtoms * diaIDAndInfo.nbAttachedHydrogens,
41
45
  };
42
46
  }
43
47
  }
@@ -87,7 +91,7 @@ function getCurrentDiaIDsToHighlight(assignmentData) {
87
91
  const { highlighted, assignments } = assignmentData.data;
88
92
  const assignment = highlighted ? assignments[highlighted.id] : null;
89
93
  const axisHover = highlighted ? highlighted.axis : null;
90
- if (axisHover && assignment && assignment[axisHover]) {
94
+ if (axisHover && assignment?.[axisHover]) {
91
95
  return assignment[axisHover];
92
96
  }
93
97
  else {
@@ -105,11 +105,11 @@ function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }
105
105
  // see revision cc13abc18f77b6787b923e3c4edaef51750d9e90
106
106
  return (0, Utilities_1.toggleDiaIDs)(diaID, atomInformation);
107
107
  }, []);
108
- const handleOnClickAtom = (0, react_1.useCallback)((atom, event) => {
108
+ const handleOnClickAtom = (0, react_1.useCallback)((diaIDAndInfo, event) => {
109
109
  if (!(0, checkModifierKeyActivated_1.default)(event) && activeAssignment.activated) {
110
110
  const { axis, id } = activeAssignment.activated;
111
111
  if (id && axis) {
112
- const atomInformation = (0, Utilities_1.extractFromAtom)(atom, nucleus, axis);
112
+ const atomInformation = (0, Utilities_1.extractFromAtom)(diaIDAndInfo, nucleus, axis);
113
113
  if (atomInformation.nbAtoms > 0) {
114
114
  // save assignment in assignment hook
115
115
  const dimension = displayerMode === Constants_1.DISPLAYER_MODE.DM_1D ? '1D' : '2D';
@@ -178,8 +178,8 @@ function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }
178
178
  nucleus,
179
179
  toggleAssignment,
180
180
  ]);
181
- const handleOnAtomHover = (0, react_1.useCallback)((atom) => {
182
- const { oclIDs } = (0, Utilities_1.extractFromAtom)(atom, nucleus);
181
+ const handleOnAtomHover = (0, react_1.useCallback)((diaIDAndInfo) => {
182
+ const { oclIDs } = (0, Utilities_1.extractFromAtom)(diaIDAndInfo, nucleus);
183
183
  // on enter the atom
184
184
  if (oclIDs.length > 0) {
185
185
  // set all IDs to highlight when hovering over an atom from assignment data
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
@@ -23,7 +46,7 @@ const useCheckExperimentalFeature_1 = __importDefault(require("../../hooks/useCh
23
46
  const useFormatNumberByNucleus_1 = require("../../hooks/useFormatNumberByNucleus");
24
47
  const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
25
48
  const BasicPanelStyle_1 = require("../extra/BasicPanelStyle");
26
- const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
49
+ const DefaultPanelHeader_1 = __importStar(require("../header/DefaultPanelHeader"));
27
50
  const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader"));
28
51
  const PeaksPreferences_1 = __importDefault(require("./PeaksPreferences"));
29
52
  const PeaksTable_1 = __importDefault(require("./PeaksTable"));
@@ -91,6 +114,10 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
91
114
  function toggleViewProperty(key) {
92
115
  dispatch({ type: 'TOGGLE_PEAKS_VIEW_PROPERTY', payload: { key } });
93
116
  }
117
+ function toggleDisplayingMode() {
118
+ dispatch({ type: 'TOGGLE_PEAKS_DISPLAYING_MODE' });
119
+ }
120
+ const counter = peaks?.values?.length || 0;
94
121
  return ((0, jsx_runtime_1.jsxs)("div", { css: [
95
122
  BasicPanelStyle_1.tablePanelStyle,
96
123
  isFlipped &&
@@ -102,11 +129,13 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
102
129
  }
103
130
  }
104
131
  `,
105
- ], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: peaks?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Peaks", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all peaks' : 'Hide peaks out of view', filterIsActive: filterIsActive, counterFiltered: filteredPeaks.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: [isExperimental && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.showPeaksShapes
132
+ ], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: counter, counterLabel: (0, DefaultPanelHeader_1.createFilterLabel)(counter, filterIsActive && filteredPeaks?.length), onDelete: handleDeleteAll, deleteToolTip: "Delete All Peaks", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all peaks' : 'Hide peaks out of view', showSettingButton: true, onSettingClick: settingsPanelHandler, children: [isExperimental && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.showPeaksShapes
106
133
  ? 'Hide peaks shapes'
107
134
  : 'Show peaks shapes', popupPlacement: "right", onClick: () => toggleViewProperty('showPeaksShapes'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.showPeaksShapes, children: (0, jsx_runtime_1.jsx)(Peaks_1.default, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.showPeaksSum
108
135
  ? 'Hide peaks sum'
109
- : 'Show peaks sum', popupPlacement: "right", onClick: () => toggleViewProperty('showPeaksSum'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.showPeaksSum, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrFt, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: optimizePeaksHandler, toolTip: "Optimize peaks", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaThinkPeaks, {}) })] })), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.isPeaksVisible ? 'Hide peaks' : 'Show peaks', popupPlacement: "right", onClick: () => toggleViewProperty('isPeaksVisible'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.isPeaksVisible, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPeaks, { style: { pointerEvents: 'none', fontSize: '12px' } }) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(PeaksTable_1.default, { data: filteredPeaks, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(PeaksPreferences_1.default, { ref: settingRef })) })] }));
136
+ : 'Show peaks sum', popupPlacement: "right", onClick: () => toggleViewProperty('showPeaksSum'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.showPeaksSum, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrFt, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: optimizePeaksHandler, toolTip: "Optimize peaks", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaThinkPeaks, {}) })] })), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.isPeaksVisible ? 'Hide peaks' : 'Show peaks', popupPlacement: "right", onClick: () => toggleViewProperty('isPeaksVisible'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.isPeaksVisible, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPeaks, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.displayingMode === 'spread'
137
+ ? 'Single Mode'
138
+ : 'Spread mode', popupPlacement: "right", onClick: toggleDisplayingMode, disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.displayingMode === 'spread', children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPeaksTopLabels, { style: { pointerEvents: 'none', fontSize: '12px' } }) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(PeaksTable_1.default, { data: filteredPeaks, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(PeaksPreferences_1.default, { ref: settingRef })) })] }));
110
139
  }
111
140
  const MemoizedPeaksPanel = (0, react_2.memo)(PeaksPanelInner);
112
141
  const emptyData = { peaks: null, info: {} };
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
@@ -23,7 +46,7 @@ const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
23
46
  const CopyClipboardModal_1 = __importDefault(require("../../modal/CopyClipboardModal"));
24
47
  const ChangeSumModal_1 = __importDefault(require("../../modal/changeSum/ChangeSumModal"));
25
48
  const formatNumber_1 = require("../../utility/formatNumber");
26
- const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
49
+ const DefaultPanelHeader_1 = __importStar(require("../header/DefaultPanelHeader"));
27
50
  const style = (0, react_1.css) `
28
51
  .btn {
29
52
  background-color: transparent;
@@ -53,11 +76,6 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
53
76
  dispatch({ type: 'CHANGE_RANGE_SUM', payload: { options } });
54
77
  modal.close();
55
78
  }
56
- function showChangeRangesSumModal() {
57
- modal.show((0, jsx_runtime_1.jsx)(ChangeSumModal_1.default, { onClose: () => modal.close(), onSave: changeRangesSumHandler, header: currentSum
58
- ? `Set new Ranges Sum (Current: ${Number(currentSum).toFixed(2)})`
59
- : 'Set new Ranges Sum', sumOptions: ranges?.options }));
60
- }
61
79
  function removeAssignments() {
62
80
  onUnlink();
63
81
  }
@@ -117,10 +135,11 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
117
135
  });
118
136
  }
119
137
  const hasRanges = Array.isArray(ranges?.values) && ranges.values.length > 0;
120
- return ((0, jsx_runtime_1.jsxs)("div", { css: style, children: [(0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: ranges?.values?.length || 0, onDelete: handleDeleteAll, deleteToolTip: "Delete All Ranges", onFilter: onFilterActivated, filterToolTip: isFilterActive ? 'Show all ranges' : 'Hide ranges out of view', filterIsActive: isFilterActive, counterFiltered: filterCounter, showSettingButton: true, onSettingClick: onSettingClick, children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Preview publication string", popupPlacement: "right", onClick: saveAsHTMLHandler, className: "btn preview-publication-icon", disabled: !hasRanges, children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: currentSum
121
- ? `Change ranges sum (${Number(currentSum).toFixed(2)})`
122
- : 'Change ranges sum', popupPlacement: "right", onClick: showChangeRangesSumModal, className: "btn icon", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Remove all assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !hasRanges, className: "btn icon", children: (0, jsx_runtime_1.jsx)(fa_1.FaUnlink, {}) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showMultiplicityTrees
138
+ const counter = ranges?.values?.length || 0;
139
+ return ((0, jsx_runtime_1.jsxs)("div", { css: style, children: [(0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: counter, counterLabel: (0, DefaultPanelHeader_1.createFilterLabel)(counter, isFilterActive && filterCounter), onDelete: handleDeleteAll, deleteToolTip: "Delete All Ranges", onFilter: onFilterActivated, filterToolTip: isFilterActive ? 'Show all ranges' : 'Hide ranges out of view', showSettingButton: true, onSettingClick: onSettingClick, children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Preview publication string", popupPlacement: "right", onClick: saveAsHTMLHandler, className: "btn preview-publication-icon", disabled: !hasRanges, children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }), (0, jsx_runtime_1.jsx)(ChangeSumModal_1.default, { onSave: changeRangesSumHandler, sumType: "ranges", currentSum: currentSum, sumOptions: ranges?.options, renderButton: (onClick) => ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: currentSum
140
+ ? `Change ranges sum (${currentSum.toFixed(2)})`
141
+ : 'Change ranges sum', popupPlacement: "right", className: "btn icon", onClick: onClick, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) })) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Remove all assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !hasRanges, className: "btn icon", children: (0, jsx_runtime_1.jsx)(fa_1.FaUnlink, {}) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showMultiplicityTrees
123
142
  ? 'Hide multiplicity trees in spectrum'
124
- : 'Show multiplicity trees in spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, value: showMultiplicityTrees, disabled: !hasRanges, children: (0, jsx_runtime_1.jsx)(fa_1.FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, value: showJGraph, disabled: !hasRanges, children: (0, jsx_runtime_1.jsx)(fa_1.FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, value: showRangesIntegrals, disabled: !hasRanges, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { className: "icon", popupTitle: "Fix integral values", popupPlacement: "right", onClick: changeSumConstantFlagHandler, value: ranges?.options?.isSumConstant, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) })] }), (0, jsx_runtime_1.jsx)(clipboardComponents_1.ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Preview publication string" })] }));
143
+ : 'Show multiplicity trees in spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, value: showMultiplicityTrees, disabled: !hasRanges, children: (0, jsx_runtime_1.jsx)(fa_1.FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, value: showJGraph, disabled: !hasRanges, children: (0, jsx_runtime_1.jsx)(fa_1.FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, value: showRangesIntegrals, disabled: !hasRanges, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { className: "icon", popupTitle: "Fixed integration sum", popupPlacement: "right", onClick: changeSumConstantFlagHandler, value: ranges?.options?.isSumConstant, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) })] }), (0, jsx_runtime_1.jsx)(clipboardComponents_1.ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Preview publication string" })] }));
125
144
  }
126
145
  exports.default = RangesHeader;
@@ -31,7 +31,7 @@ function DisplayButtons1D(props) {
31
31
  return null;
32
32
  }
33
33
  const display = data.display;
34
- return ((0, jsx_runtime_1.jsx)("button", { "data-test-id": "hide-show-spectrum-button", style: buttonStyle, type: "button", onClick: (e) => {
34
+ return ((0, jsx_runtime_1.jsx)("button", { "data-testid": "hide-show-spectrum-button", style: buttonStyle, type: "button", onClick: (e) => {
35
35
  e.stopPropagation();
36
36
  onChangeVisibility(data, 'isVisible');
37
37
  }, children: (0, jsx_runtime_1.jsx)(fa_1.FaEye, { style: {
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
@@ -17,7 +40,7 @@ const Select_1 = __importDefault(require("../../elements/Select"));
17
40
  const ToolTip_1 = __importDefault(require("../../elements/ToolTip/ToolTip"));
18
41
  const Modal_1 = require("../../elements/popup/Modal");
19
42
  const Constants_1 = require("../../reducer/core/Constants");
20
- const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
43
+ const DefaultPanelHeader_1 = __importStar(require("../header/DefaultPanelHeader"));
21
44
  const CorrelationTable_1 = __importDefault(require("./CorrelationTable/CorrelationTable"));
22
45
  const Overview_1 = __importDefault(require("./Overview"));
23
46
  const SetMolecularFormulaModal_1 = __importDefault(require("./SetMolecularFormulaModal"));
@@ -314,9 +337,10 @@ function SummaryPanel() {
314
337
  const handleOnFilter = (0, react_2.useCallback)(() => {
315
338
  setFilterIsActive(!filterIsActive);
316
339
  }, [filterIsActive]);
317
- return ((0, jsx_runtime_1.jsxs)("div", { css: panelStyle, children: [(0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { canDelete: false, counter: correlationsData ? correlationsData.values.length : 0, onFilter: handleOnFilter, filterToolTip: filterIsActive
340
+ const counter = correlationsData ? correlationsData.values.length : 0;
341
+ return ((0, jsx_runtime_1.jsxs)("div", { css: panelStyle, children: [(0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { canDelete: false, counter: counter, counterLabel: (0, DefaultPanelHeader_1.createFilterLabel)(counter, filterIsActive && filteredCorrelationsData?.values.length), onFilter: handleOnFilter, filterToolTip: filterIsActive
318
342
  ? 'Show all correlations'
319
- : 'Hide correlations out of view', filterIsActive: filterIsActive, counterFiltered: filteredCorrelationsData?.values.length, children: [(0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: `Set molecular formula (${correlationsData.options.mf})`, popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: showSetMolecularFormulaModal, children: (0, jsx_runtime_1.jsx)(fa_1.FaFlask, {}) }) }), (0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: `Set shift tolerance`, popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: showSetShiftToleranceModal, children: (0, jsx_runtime_1.jsx)(fa_1.FaSlidersH, {}) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "extra-header-content", children: [(0, jsx_runtime_1.jsx)("div", { className: "overview-container", children: (0, jsx_runtime_1.jsx)(Overview_1.default, { correlationsData: correlationsData }) }), (0, jsx_runtime_1.jsx)("div", { className: "table-view-selection", children: (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("label", { children: "View:" }), (0, jsx_runtime_1.jsx)(Select_1.default, { onChange: (selection) => {
343
+ : 'Hide correlations out of view', children: [(0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: `Set molecular formula (${correlationsData.options.mf})`, popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: showSetMolecularFormulaModal, children: (0, jsx_runtime_1.jsx)(fa_1.FaFlask, {}) }) }), (0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: `Set shift tolerance`, popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: showSetShiftToleranceModal, children: (0, jsx_runtime_1.jsx)(fa_1.FaSlidersH, {}) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "extra-header-content", children: [(0, jsx_runtime_1.jsx)("div", { className: "overview-container", children: (0, jsx_runtime_1.jsx)(Overview_1.default, { correlationsData: correlationsData }) }), (0, jsx_runtime_1.jsx)("div", { className: "table-view-selection", children: (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("label", { children: "View:" }), (0, jsx_runtime_1.jsx)(Select_1.default, { onChange: (selection) => {
320
344
  setSelectedAdditionalColumnsAtomType(selection);
321
345
  if (selection === 'H-H') {
322
346
  setShowProtonsAsRows(true);
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
@@ -18,7 +41,7 @@ const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
18
41
  const Reducer_1 = require("../../reducer/Reducer");
19
42
  const BasicPanelStyle_1 = require("../extra/BasicPanelStyle");
20
43
  const NoTableData_1 = __importDefault(require("../extra/placeholder/NoTableData"));
21
- const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
44
+ const DefaultPanelHeader_1 = __importStar(require("../header/DefaultPanelHeader"));
22
45
  const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader"));
23
46
  const ZonesPreferences_1 = __importDefault(require("./ZonesPreferences"));
24
47
  const ZonesTable_1 = __importDefault(require("./ZonesTable"));
@@ -136,6 +159,7 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, experiment, showZ
136
159
  const handleSetShowPeaks = () => {
137
160
  dispatch({ type: 'SHOW_ZONES_PEAKS', payload: { id } });
138
161
  };
162
+ const counter = zones?.values?.length || 0;
139
163
  return ((0, jsx_runtime_1.jsxs)("div", { css: [
140
164
  BasicPanelStyle_1.tablePanelStyle,
141
165
  style,
@@ -145,7 +169,7 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, experiment, showZ
145
169
  position: relative;
146
170
  }
147
171
  `,
148
- ], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: zones.values ? zones.values.length : 0, onDelete: handleDeleteAll, deleteToolTip: "Delete All Zones", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all zones' : 'Hide zones out of view', filterIsActive: filterIsActive, counterFiltered: tableData?.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: [(0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: `Remove all assignments`, popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { className: "remove-assignments-btn", type: "button", onClick: handleOnRemoveAssignments, disabled: !zones.values || zones.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaUnlink, {}) }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: "Show/Hide zones", popupPlacement: "right", value: showZones, onClick: handleSetShowZones, children: (0, jsx_runtime_1.jsx)("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "z" }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: "Show/Hide signals", popupPlacement: "right", value: showSignals, onClick: handleSetShowSignals, children: (0, jsx_runtime_1.jsx)("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "s" }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: "Show/Hide peaks", popupPlacement: "right", value: showPeaks, onClick: handleSetShowPeaks, children: (0, jsx_runtime_1.jsx)("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "p" }) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)("div", { className: "table-container", children: tableData && tableData.length > 0 ? ((0, jsx_runtime_1.jsx)(ZonesTable_1.default, { tableData: tableData, onUnlink: unlinkZoneHandler, nuclei: activeTab && activeTab.split(',').length === 2
172
+ ], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: counter, counterLabel: (0, DefaultPanelHeader_1.createFilterLabel)(counter, filterIsActive && tableData?.length), onDelete: handleDeleteAll, deleteToolTip: "Delete All Zones", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all zones' : 'Hide zones out of view', showSettingButton: true, onSettingClick: settingsPanelHandler, children: [(0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: `Remove all assignments`, popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { className: "remove-assignments-btn", type: "button", onClick: handleOnRemoveAssignments, disabled: !zones.values || zones.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaUnlink, {}) }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: "Show/Hide zones", popupPlacement: "right", value: showZones, onClick: handleSetShowZones, children: (0, jsx_runtime_1.jsx)("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "z" }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: "Show/Hide signals", popupPlacement: "right", value: showSignals, onClick: handleSetShowSignals, children: (0, jsx_runtime_1.jsx)("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "s" }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: "Show/Hide peaks", popupPlacement: "right", value: showPeaks, onClick: handleSetShowPeaks, children: (0, jsx_runtime_1.jsx)("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "p" }) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)("div", { className: "table-container", children: tableData && tableData.length > 0 ? ((0, jsx_runtime_1.jsx)(ZonesTable_1.default, { tableData: tableData, onUnlink: unlinkZoneHandler, nuclei: activeTab && activeTab.split(',').length === 2
149
173
  ? activeTab.split(',')
150
174
  : ['?', '?'], experiment: experiment })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, {})) })) : ((0, jsx_runtime_1.jsx)(ZonesPreferences_1.default, { ref: settingRef })) })] }));
151
175
  }
@@ -28,7 +28,7 @@ function ZonesPreferences(props, ref) {
28
28
  const nuclei = (0, react_1.useMemo)(() => (0, getUniqueNuclei_1.getUniqueNuclei)(nucleus), [nucleus]);
29
29
  const zonesPreferences = (0, usePanelPreferences_1.usePanelPreferencesByNuclei)('zones', nuclei);
30
30
  (0, react_1.useEffect)(() => {
31
- formRef.current?.setValues(zonesPreferences);
31
+ void formRef.current?.setValues(zonesPreferences);
32
32
  }, [zonesPreferences]);
33
33
  const saveHandler = (0, react_1.useCallback)((values) => {
34
34
  preferences.dispatch({
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createFilterLabel = void 0;
6
7
  const jsx_runtime_1 = require("react/jsx-runtime");
7
8
  const fa_1 = require("react-icons/fa");
8
9
  const Button_1 = __importDefault(require("../../elements/Button"));
@@ -19,13 +20,18 @@ const styles = {
19
20
  margin: 0,
20
21
  textAlign: 'right',
21
22
  lineHeight: '22px',
22
- padding: '0 10px',
23
+ padding: '0 5px',
23
24
  whiteSpace: 'nowrap',
24
25
  },
25
26
  };
26
- function DefaultPanelHeader({ counter, onDelete = () => null, deleteToolTip = 'Delete', onFilter = () => null, filterToolTip = '', filterIsActive = false, counterFiltered = 0, children, onSettingClick = () => null, showSettingButton = false, canDelete = true, disableDelete = false, style = {}, className = '', renderRightButtons, }) {
27
- return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { style, className, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.leftContainer, children: [canDelete && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'red' }, onClick: onDelete, disabled: counter === 0 || disableDelete, toolTip: deleteToolTip, tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) })), filterToolTip ? ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: filterToolTip, popupPlacement: "right", onClick: onFilter, defaultValue: filterIsActive, children: (0, jsx_runtime_1.jsx)(fa_1.FaFilter, { style: { pointerEvents: 'none', fontSize: '12px' } }) })) : null, children] }), renderRightButtons?.(), counter !== undefined && ((0, jsx_runtime_1.jsxs)("p", { style: styles.counterLabel, children: ["[", ' ', filterIsActive && counterFiltered !== undefined
28
- ? `${counterFiltered}/${counter}`
29
- : counter, ' ', "]"] })), showSettingButton && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Preferences", popupPlacement: "left", children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onSettingClick, children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) }) }))] }));
27
+ function createFilterLabel(total, counter) {
28
+ if (typeof counter === 'boolean') {
29
+ return `[ ${total || 0} ]`;
30
+ }
31
+ return `[ ${counter}/${total} ]`;
32
+ }
33
+ exports.createFilterLabel = createFilterLabel;
34
+ function DefaultPanelHeader({ counter, counterLabel, onDelete = () => null, deleteToolTip = 'Delete', onFilter = () => null, filterToolTip = '', children, onSettingClick = () => null, showSettingButton = false, canDelete = true, disableDelete = false, style = {}, className = '', renderRightButtons, }) {
35
+ return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { style, className, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.leftContainer, children: [canDelete && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'red' }, onClick: onDelete, disabled: counter === 0 || disableDelete, toolTip: deleteToolTip, tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) })), filterToolTip ? ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: filterToolTip, popupPlacement: "right", onClick: onFilter, children: (0, jsx_runtime_1.jsx)(fa_1.FaFilter, { style: { pointerEvents: 'none', fontSize: '12px' } }) })) : null, children] }), renderRightButtons?.(), counterLabel && (0, jsx_runtime_1.jsx)("p", { style: styles.counterLabel, children: counterLabel }), showSettingButton && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Preferences", popupPlacement: "left", children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onSettingClick, children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) }) }))] }));
30
36
  }
31
37
  exports.default = DefaultPanelHeader;
@@ -77,7 +77,7 @@ function PredictionPanel() {
77
77
  }
78
78
  const hideLoading = await alert.showLoading(`Predict ${predictedSpectra.join(',')} in progress`);
79
79
  try {
80
- const data = await (0, PredictionManager_1.predictSpectra)(molfile);
80
+ const data = await (0, PredictionManager_1.predictSpectra)(molfile, predictionPreferences.spectra);
81
81
  dispatch({
82
82
  type: 'PREDICT_SPECTRA',
83
83
  payload: {
@@ -65,7 +65,6 @@ function PredictionSimpleOptions() {
65
65
  display: 'flex',
66
66
  justifyContent: 'flex-end',
67
67
  flex: '1',
68
- padding: '0 10px',
69
68
  height: '100%',
70
69
  }, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Frequency", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: PredictionManager_1.FREQUENCIES, style: selectStyles, name: "frequency" }) }), (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "Line Width", style: labelStyle, children: [(0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "1d.lineWidth", type: "number", style: { margin: 0, width: '40px' } }), (0, jsx_runtime_1.jsx)("span", { style: { padding: '0 5px' }, children: "Hz" })] }), (0, jsx_runtime_1.jsx)(FormikOnChange_1.default, { enableValidation: true, onChange: optionsChangeHandler })] }) }));
71
70
  }
@@ -69,7 +69,7 @@ function SpectrumSimulation() {
69
69
  }
70
70
  function saveSettingsHandler(values) {
71
71
  simulateHandler(values);
72
- formRef.current?.setValues(values);
72
+ void formRef.current?.setValues(values);
73
73
  }
74
74
  return ((0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: { ...spectrumSimulation_1.defaultSimulationOptions, data }, enableReinitialize: true,
75
75
  // eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -25,7 +25,6 @@ function SpectrumSimulationSimpleOptions({ onSpinSystemChange, spinSystem, }) {
25
25
  display: 'flex',
26
26
  justifyContent: 'flex-end',
27
27
  flex: '1',
28
- padding: '0 10px',
29
- }, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Spin system", style: labelStyle, children: (0, jsx_runtime_1.jsx)(Select_1.default, { items: SPIN_SYSTEMS, style: selectStyles, onChange: onSpinSystemChange, value: spinSystem }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Frequency", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: PredictionManager_1.FREQUENCIES, style: selectStyles, name: "options.frequency" }) }), (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "Line Width", style: labelStyle, children: [(0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "options.lineWidth", type: "number", style: { margin: 0, width: '40px' } }), (0, jsx_runtime_1.jsx)("span", { style: { padding: '0 5px' }, children: "Hz" })] })] }));
28
+ }, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "", style: labelStyle, children: (0, jsx_runtime_1.jsx)(Select_1.default, { items: SPIN_SYSTEMS, style: selectStyles, onChange: onSpinSystemChange, value: spinSystem }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Frequency", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: PredictionManager_1.FREQUENCIES, style: selectStyles, name: "options.frequency" }) }), (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "Line Width", style: labelStyle, children: [(0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "options.lineWidth", type: "number", style: { margin: 0, width: '40px' } }), (0, jsx_runtime_1.jsx)("span", { style: { padding: '0 5px' }, children: "Hz" })] })] }));
30
29
  }
31
30
  exports.default = SpectrumSimulationSimpleOptions;
@@ -21,7 +21,6 @@ const ignoreActions = new Set([
21
21
  'CHANGE_SPECTRUM_VISIBILITY',
22
22
  'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
23
23
  'CHANGE_ACTIVE_SPECTRUM',
24
- 'SET_MOUSE_OVER_DISPLAYER',
25
24
  'CHANGE_FLOAT_MOLECULE_POSITION',
26
25
  'ALIGN_SPECTRA',
27
26
  'TOGGLE_REAL_IMAGINARY_VISIBILITY',