nmrium 0.53.0 → 0.55.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 (178) hide show
  1. package/lib/component/1d/Viewer1D.js +48 -17
  2. package/lib/component/1d/XAxis.js +1 -1
  3. package/lib/component/1d/integral/IntegralsSeries.js +2 -2
  4. package/lib/component/1d/integral/Integration.d.ts +3 -1
  5. package/lib/component/1d/integral/Integration.js +3 -2
  6. package/lib/component/1d/peaks/PeakEditionManager.js +5 -3
  7. package/lib/component/1d/ranges/AssignmentActionsButtons.d.ts +1 -0
  8. package/lib/component/1d/ranges/AssignmentActionsButtons.js +3 -3
  9. package/lib/component/1d/ranges/AssignmentLabel.d.ts +1 -1
  10. package/lib/component/1d/ranges/AssignmentLabel.js +31 -4
  11. package/lib/component/1d/ranges/Atoms.js +4 -5
  12. package/lib/component/1d/ranges/Range.js +62 -12
  13. package/lib/component/1d/ranges/Ranges.js +2 -1
  14. package/lib/component/1d/ranges/RangesIntegrals.js +11 -4
  15. package/lib/component/1d/tool/XLabelPointer.js +4 -12
  16. package/lib/component/1d-2d/FieldEdition.d.ts +13 -0
  17. package/lib/component/1d-2d/FieldEdition.js +42 -0
  18. package/lib/component/2d/Chart2D.js +5 -3
  19. package/lib/component/2d/tools/XYLabelPointer.js +3 -9
  20. package/lib/component/2d/zones/Zone.js +18 -2
  21. package/lib/component/2d/zones/ZonesAssignmentsLabels.d.ts +7 -0
  22. package/lib/component/2d/zones/ZonesAssignmentsLabels.js +286 -0
  23. package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -1
  24. package/lib/component/context/LoggerContext.js +11 -4
  25. package/lib/component/context/ShareDataContext.d.ts +10 -0
  26. package/lib/component/context/ShareDataContext.js +22 -0
  27. package/lib/component/elements/ActionsButtonsPopover.d.ts +10 -0
  28. package/lib/component/elements/ActionsButtonsPopover.js +22 -0
  29. package/lib/component/elements/CloseButton.d.ts +1 -1
  30. package/lib/component/elements/CustomToolTip.d.ts +8 -0
  31. package/lib/component/elements/CustomToolTip.js +107 -0
  32. package/lib/component/elements/EditableColumn.js +3 -2
  33. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +7 -5
  34. package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
  35. package/lib/component/elements/SVGButton.d.ts +14 -0
  36. package/lib/component/elements/SVGButton.js +6 -0
  37. package/lib/component/elements/SVGGroup.js +15 -13
  38. package/lib/component/elements/SVGText.d.ts +8 -0
  39. package/lib/component/elements/SVGText.js +24 -0
  40. package/lib/component/elements/SaveButton.d.ts +1 -1
  41. package/lib/component/elements/draggable/SVGDraggable.d.ts +2 -2
  42. package/lib/component/elements/formik/FormikError.js +2 -4
  43. package/lib/component/elements/formik/FormikInput.d.ts +2 -1
  44. package/lib/component/elements/formik/FormikInput.js +5 -4
  45. package/lib/component/header/Header.js +8 -11
  46. package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.js +41 -10
  47. package/lib/component/hooks/useActiveSpectrumZonesViewState.js +1 -0
  48. package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +1 -1
  49. package/lib/component/hooks/useFormatNumberByNucleus.d.ts +1 -1
  50. package/lib/component/hooks/useFormatNumberByNucleus.js +8 -7
  51. package/lib/component/hooks/useIntegralPath.d.ts +2 -0
  52. package/lib/component/hooks/useIntegralPath.js +3 -1
  53. package/lib/component/hooks/usePanelPreferences.js +1 -2
  54. package/lib/component/hooks/useSaveSettings.js +7 -14
  55. package/lib/component/hooks/useTriggerNewAssignmentLabel.d.ts +4 -0
  56. package/lib/component/hooks/useTriggerNewAssignmentLabel.js +8 -0
  57. package/lib/component/hooks/useWorkspaceAction.d.ts +7 -0
  58. package/lib/component/hooks/useWorkspaceAction.js +89 -0
  59. package/lib/component/loader/DropZone.js +0 -3
  60. package/lib/component/main/InnerNMRium.js +3 -1
  61. package/lib/component/main/InnerNMRiumContents.js +14 -2
  62. package/lib/component/main/NMRiumStateProvider.js +15 -3
  63. package/lib/component/modal/AboutPredictionModal.js +1 -1
  64. package/lib/component/modal/AboutSpectrumSimulationModal.js +1 -1
  65. package/lib/component/modal/CopyClipboardModal.js +1 -1
  66. package/lib/component/modal/EditPeakShapeModal.js +1 -1
  67. package/lib/component/modal/ImportPublicationStringModal.js +11 -5
  68. package/lib/component/modal/PredictSpectraModal.js +1 -1
  69. package/lib/component/modal/aboutUs/AboutUsModal.js +1 -1
  70. package/lib/component/modal/changeSum/ChangeSumModal.js +1 -1
  71. package/lib/component/modal/editRange/EditRangeModal.js +1 -1
  72. package/lib/component/modal/editRange/forms/components/DeltaInput.js +3 -3
  73. package/lib/component/modal/editRange/forms/components/NewSignalTab.js +17 -12
  74. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +30 -13
  75. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +26 -16
  76. package/lib/component/modal/editZone/EditZoneModal.js +1 -1
  77. package/lib/component/modal/setting/GeneralSettings.js +18 -39
  78. package/lib/component/modal/setting/WorkspaceItem.js +1 -1
  79. package/lib/component/modal/setting/settings-tabs/NucleiTabContent.d.ts +2 -0
  80. package/lib/component/modal/setting/settings-tabs/NucleiTabContent.js +99 -0
  81. package/lib/component/modal/setting/settingsValidation.js +36 -40
  82. package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +2 -2
  83. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -2
  84. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +2 -2
  85. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
  86. package/lib/component/panels/PeaksPanel/PeaksPanel.js +5 -5
  87. package/lib/component/panels/RangesPanel/RangesHeader.js +11 -11
  88. package/lib/component/panels/RangesPanel/RangesPreferences.js +16 -16
  89. package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
  90. package/lib/component/panels/RangesPanel/RangesTableRow.js +2 -2
  91. package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +22 -8
  92. package/lib/component/panels/SpectraPanel/SpectraPreferences.js +13 -1
  93. package/lib/component/panels/SpectraPanel/base/setting/PlotChart.js +1 -1
  94. package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DHistogram.js +1 -1
  95. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +1 -1
  96. package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.d.ts +5 -5
  97. package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +79 -89
  98. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.d.ts +5 -4
  99. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +66 -98
  100. package/lib/component/panels/SummaryPanel/SummaryPanel.js +13 -32
  101. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.d.ts +6 -0
  102. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.js +16 -0
  103. package/lib/component/panels/ZonesPanel/ZonesPanel.js +22 -6
  104. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +15 -9
  105. package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -2
  106. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
  107. package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +2 -2
  108. package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
  109. package/lib/component/panels/header/PreferencesHeader.js +1 -1
  110. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
  111. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +4 -4
  112. package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +1 -1
  113. package/lib/component/reducer/IgnoreActions.js +1 -0
  114. package/lib/component/reducer/Reducer.js +8 -0
  115. package/lib/component/reducer/actions/DomainActions.d.ts +7 -2
  116. package/lib/component/reducer/actions/DomainActions.js +29 -1
  117. package/lib/component/reducer/actions/FiltersActions.d.ts +3 -2
  118. package/lib/component/reducer/actions/FiltersActions.js +27 -1
  119. package/lib/component/reducer/actions/MoleculeActions.js +1 -1
  120. package/lib/component/reducer/actions/RangesActions.d.ts +2 -3
  121. package/lib/component/reducer/actions/RangesActions.js +28 -26
  122. package/lib/component/reducer/actions/SpectraActions.d.ts +5 -4
  123. package/lib/component/reducer/actions/SpectraActions.js +5 -1
  124. package/lib/component/reducer/actions/ZonesActions.d.ts +15 -2
  125. package/lib/component/reducer/actions/ZonesActions.js +47 -13
  126. package/lib/component/reducer/helper/setRangesViewProperty.d.ts +1 -0
  127. package/lib/component/reducer/helper/setRangesViewProperty.js +11 -11
  128. package/lib/component/reducer/preferences/actions/addWorkspace.js +4 -23
  129. package/lib/component/reducer/preferences/actions/analyzeSpectra.js +4 -4
  130. package/lib/component/reducer/preferences/actions/initPreferences.js +2 -4
  131. package/lib/component/reducer/preferences/actions/matrixGeneration.js +3 -3
  132. package/lib/component/reducer/preferences/actions/removeWorkspace.js +0 -5
  133. package/lib/component/reducer/preferences/actions/setActiveWorkspace.js +0 -4
  134. package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +1 -1
  135. package/lib/component/reducer/preferences/actions/setPreferences.js +2 -16
  136. package/lib/component/reducer/preferences/actions/setWorkspace.js +4 -3
  137. package/lib/component/reducer/preferences/preferencesReducer.d.ts +7 -0
  138. package/lib/component/reducer/preferences/preferencesReducer.js +21 -18
  139. package/lib/component/toolbar/ToolBar.js +115 -25
  140. package/lib/component/utility/PreferencesHelper.js +5 -4
  141. package/lib/component/utility/export.js +4 -0
  142. package/lib/component/workspaces/assignment.js +0 -1
  143. package/lib/component/workspaces/basic.js +0 -1
  144. package/lib/component/workspaces/embedded.js +0 -1
  145. package/lib/component/workspaces/exercise.js +26 -29
  146. package/lib/component/workspaces/prediction.js +171 -174
  147. package/lib/component/workspaces/process1D.js +0 -1
  148. package/lib/component/workspaces/simulation.js +35 -38
  149. package/lib/component/workspaces/workspaceDefaultProperties.js +16 -23
  150. package/lib/data/data1d/Spectrum1D/get1DColor.d.ts +10 -3
  151. package/lib/data/data1d/Spectrum1D/get1DColor.js +28 -2
  152. package/lib/data/data1d/Spectrum1D/index.d.ts +2 -2
  153. package/lib/data/data1d/Spectrum1D/index.js +2 -2
  154. package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +50 -0
  155. package/lib/data/data1d/Spectrum1D/ranges/createRange.js +51 -0
  156. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +2 -1
  157. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +4 -2
  158. package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +52 -0
  159. package/lib/data/data1d/Spectrum1D/ranges/resizeRange.js +28 -0
  160. package/lib/data/data2d/Spectrum2D/get2DColor.d.ts +11 -3
  161. package/lib/data/data2d/Spectrum2D/get2DColor.js +20 -4
  162. package/lib/data/data2d/Spectrum2D/getSlice.js +1 -1
  163. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -0
  164. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +1 -0
  165. package/lib/data/utilities/generateColor.d.ts +7 -3
  166. package/lib/data/utilities/generateColor.js +5 -17
  167. package/lib/versionInfo.js +1 -1
  168. package/package.json +35 -35
  169. package/lib/component/elements/MolecularFormulaInput.d.ts +0 -6
  170. package/lib/component/elements/MolecularFormulaInput.js +0 -63
  171. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.d.ts +0 -2
  172. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +0 -80
  173. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +0 -2
  174. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +0 -10
  175. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +0 -7
  176. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +0 -31
  177. package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +0 -3
  178. package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +0 -32
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
- import { Dialog, DialogBody, DialogFooter, Classes } from '@blueprintjs/core';
3
+ import { Dialog, DialogBody, DialogFooter, Classes, Tabs, Tab, } from '@blueprintjs/core';
4
4
  import { css } from '@emotion/react';
5
5
  import { Formik } from 'formik';
6
6
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
@@ -13,28 +13,23 @@ import { useToaster } from '../../context/ToasterContext';
13
13
  import ActionButtons from '../../elements/ActionButtons';
14
14
  import Button from '../../elements/Button';
15
15
  import Label from '../../elements/Label';
16
- import Tab from '../../elements/Tab/Tab';
17
- import Tabs, { PositionsEnum } from '../../elements/Tab/Tabs';
18
16
  import DropDownButton from '../../elements/dropDownButton/DropDownButton';
19
17
  import { useSaveSettings } from '../../hooks/useSaveSettings';
18
+ import { useWorkspaceAction } from '../../hooks/useWorkspaceAction';
20
19
  import { getPreferencesByWorkspace } from '../../reducer/preferences/utilities/getPreferencesByWorkspace';
21
20
  import PredefinedWorkspaces from '../../workspaces';
22
21
  import WorkspaceItem from './WorkspaceItem';
23
22
  import DatabasesTabContent from './settings-tabs/DatabasesTabContent';
24
23
  import DisplayTabContent from './settings-tabs/DisplayTabContent';
25
- import FormattingTabContent from './settings-tabs/FormattingTabContent';
26
24
  import GeneralTabContent from './settings-tabs/GeneralTabContent';
27
25
  import ImportationFiltersTabContent from './settings-tabs/ImportationFiltersTabContent';
28
26
  import InfoBlockTabContent from './settings-tabs/InfoBlockTabContent';
27
+ import NucleiTabContent from './settings-tabs/NucleiTabContent';
29
28
  import OnLoadProcessingTabContent from './settings-tabs/OnLoadProcessingTabContent';
30
29
  import SpectraColorsTabContent from './settings-tabs/SpectraColorsTabContent';
31
30
  import ToolsTabContent from './settings-tabs/ToolsTabContent';
32
31
  import { validation } from './settingsValidation';
33
32
  const styles = css `
34
- .tab-content {
35
- width: 100%;
36
- }
37
-
38
33
  .section-header {
39
34
  font-size: 13px;
40
35
  color: #2ca8ff;
@@ -64,12 +59,6 @@ const styles = css `
64
59
  width: 260px;
65
60
  }
66
61
  }
67
-
68
- .inner-content {
69
- padding: 15px 30px;
70
- width: 100%;
71
- overflow: auto;
72
- }
73
62
  `;
74
63
  function isRestButtonDisable(currentWorkspaceSetting, workspaceName, customWorkspaces) {
75
64
  if (!PredefinedWorkspaces[workspaceName] &&
@@ -83,8 +72,8 @@ function isRestButtonDisable(currentWorkspaceSetting, workspaceName, customWorks
83
72
  }
84
73
  function GeneralSettingsModal({ height }) {
85
74
  const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
86
- const [activeTab, setActiveTab] = useState('general');
87
75
  const { dispatch, current: currentWorkspace, originalWorkspaces, ...preferences } = usePreferences();
76
+ const { addNewWorkspace, removeWorkspace, setActiveWorkspace } = useWorkspaceAction();
88
77
  const { saveSettings, SaveSettingsModal } = useSaveSettings();
89
78
  const toaster = useToaster();
90
79
  const refForm = useRef(null);
@@ -108,17 +97,8 @@ function GeneralSettingsModal({ height }) {
108
97
  saveSettings(values);
109
98
  closeDialog?.();
110
99
  }
111
- const tabChangeHandler = useCallback((tab) => {
112
- setActiveTab(tab.tabid);
113
- }, []);
114
100
  function addWorkSpaceHandler(name) {
115
- dispatch({
116
- type: 'ADD_WORKSPACE',
117
- payload: {
118
- workspaceKey: name,
119
- data: refForm.current?.values,
120
- },
121
- });
101
+ addNewWorkspace(name, refForm.current?.values);
122
102
  }
123
103
  async function applyPreferencesHandler() {
124
104
  const errors = await refForm.current?.validateForm();
@@ -136,20 +116,10 @@ function GeneralSettingsModal({ height }) {
136
116
  }
137
117
  }
138
118
  function deleteWorkSpaceHandler(key) {
139
- dispatch({
140
- type: 'REMOVE_WORKSPACE',
141
- payload: {
142
- workspace: key,
143
- },
144
- });
119
+ removeWorkspace(key);
145
120
  }
146
121
  function ChangeWorkspaceHandler(option) {
147
- dispatch({
148
- type: 'SET_ACTIVE_WORKSPACE',
149
- payload: {
150
- workspace: option.key,
151
- },
152
- });
122
+ setActiveWorkspace(option.key);
153
123
  }
154
124
  function renderItem(item) {
155
125
  return (_jsx(WorkspaceItem, { item: item, onSave: addWorkSpaceHandler, onDelete: deleteWorkSpaceHandler }));
@@ -204,7 +174,7 @@ function GeneralSettingsModal({ height }) {
204
174
  function handlePastWorkspaceAction() {
205
175
  void readText().then(handlePastWorkspace);
206
176
  }
207
- return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { id: "general-settings", onClick: openDialog, title: "General settings", icon: _jsx(FaWrench, {}) }), _jsxs(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, style: { maxWidth: 1000, width: '50vw', minWidth: 800 }, title: "General settings", icon: "cog", children: [_jsx("div", { children: _jsxs("div", { className: Classes.DIALOG_HEADER, style: {
177
+ return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { id: "general-settings", onClick: openDialog, tooltip: "General settings", icon: _jsx(FaWrench, {}) }), _jsxs(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, style: { maxWidth: 1000, width: '50vw', minWidth: 800 }, title: "General settings", icon: "cog", children: [_jsx("div", { children: _jsxs("div", { className: Classes.DIALOG_HEADER, style: {
208
178
  cursor: 'default',
209
179
  paddingTop: '10px',
210
180
  boxShadow: 'none',
@@ -218,7 +188,16 @@ function GeneralSettingsModal({ height }) {
218
188
  }, children: _jsx(FaPaste, {}) })] }) }), _jsx(DialogBody, { css: css `
219
189
  padding: 0;
220
190
  background-color: white;
221
- `, children: _jsx("div", { css: styles, style: { height }, children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: currentWorkspace, validationSchema: validation, onSubmit: submitHandler, validate: handleDisabledRestButton, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { title: "General", tabid: "general", children: _jsx("div", { className: "inner-content", children: _jsx(GeneralTabContent, {}) }) }), _jsx(Tab, { title: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { title: "Panels", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, {}) }) }), _jsx(Tab, { title: "Tools", tabid: "tools", children: _jsx("div", { className: "inner-content", children: _jsx(ToolsTabContent, {}) }) }), _jsx(Tab, { title: "Databases", tabid: "databases", children: _jsx("div", { className: "inner-content", children: _jsx(DatabasesTabContent, { currentWorkspace: workspaceName, originalWorkspaces: originalWorkspaces }) }) }), _jsx(Tab, { title: "Import filters", tabid: "importation-filters", children: _jsx("div", { className: "inner-content", children: _jsx(ImportationFiltersTabContent, {}) }) }), _jsx(Tab, { title: "Title block", tabid: "title-block", children: _jsx("div", { className: "inner-content", children: _jsx(InfoBlockTabContent, {}) }) }), _jsx(Tab, { title: "Auto processing", tabid: "on-load-processing", children: _jsx("div", { className: "inner-content", children: _jsx(OnLoadProcessingTabContent, {}) }) }), _jsx(Tab, { title: "Spectra colors", tabid: "spectra-colors", children: _jsx("div", { className: "inner-content", children: _jsx(SpectraColorsTabContent, {}) }) })] }) }) }) }), _jsx(DialogFooter, { children: _jsxs("div", { style: { display: 'flex', justifyContent: 'flex-end' }, children: [_jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current?.submitForm(), doneLabel: "Apply and Save", onCancel: () => {
191
+ `, children: _jsx("div", { css: styles, style: { height }, children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: currentWorkspace, validationSchema: validation, onSubmit: submitHandler, validate: handleDisabledRestButton, children: _jsxs(Tabs, { vertical: true, css: css `
192
+ height: 100%;
193
+
194
+ div[role='tabpanel'] {
195
+ width: 100%;
196
+ padding: 0.8rem;
197
+ overflow: auto;
198
+ max-height: 100%;
199
+ }
200
+ `, fill: true, children: [_jsx(Tab, { title: "General", id: "general", panel: _jsx(GeneralTabContent, {}) }), _jsx(Tab, { title: "Nuclei", id: "nuclei", panel: _jsx(NucleiTabContent, {}) }), _jsx(Tab, { title: "Panels", id: "display", panel: _jsx(DisplayTabContent, {}) }), _jsx(Tab, { title: "Tools", id: "tools", panel: _jsx(ToolsTabContent, {}) }), _jsx(Tab, { title: "Databases", id: "databases", panel: _jsx(DatabasesTabContent, { currentWorkspace: workspaceName, originalWorkspaces: originalWorkspaces }) }), _jsx(Tab, { title: "Import filters", id: "importation-filters", panel: _jsx(ImportationFiltersTabContent, {}) }), _jsx(Tab, { title: "Title block", id: "title-block", panel: _jsx(InfoBlockTabContent, {}) }), _jsx(Tab, { title: "Auto processing", id: "on-load-processing", panel: _jsx(OnLoadProcessingTabContent, {}) }), _jsx(Tab, { title: "Spectra colors", id: "spectra-colors", panel: _jsx(SpectraColorsTabContent, {}) })] }) }) }) }), _jsx(DialogFooter, { children: _jsxs("div", { style: { display: 'flex', justifyContent: 'flex-end' }, children: [_jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current?.submitForm(), doneLabel: "Apply and Save", onCancel: () => {
222
201
  closeDialog?.();
223
202
  } }), _jsx(Button.Secondary, { style: { margin: '0 10px' }, onClick: applyPreferencesHandler, children: "Apply" })] }) })] }), _jsx(SaveSettingsModal, {}), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePastWorkspace, text: text, label: "Workspace" })] }));
224
203
  }
@@ -54,7 +54,7 @@ function WorkspaceItem({ item, onSave, onDelete }) {
54
54
  function onTextChange(e) {
55
55
  setName(e.target.value);
56
56
  }
57
- return (_jsx("div", { children: item.key === 'new' ? (_jsxs("div", { style: styles.newContainer, children: [_jsx("input", { style: styles.input, value: name, placeholder: "Custom workspace", onClick: (e) => e.stopPropagation(), onChange: onTextChange }), _jsx(Button.Done, { onClick: addHandler, disabled: !name, style: { fontSize: '11px' }, children: "Save" })] })) : (_jsxs("div", { style: styles.container, children: [_jsx(WorkSpaceIndicator, { source: item.source }), _jsx("span", { style: styles.workspaceName, children: item.label }), item.source !== 'user' && (_jsx("span", { style: styles.readOnly, children: "Read Only" })), item.source === 'user' && onDelete && (_jsx(Button.Danger, { onClick: deleteHandler, size: "xSmall", fill: "clear", children: _jsx(FaTimes, {}) })), item.version && !item.isReadOnly && (_jsxs("span", { style: styles.workspaceVersion, children: ["V", item.version] }))] })) }));
57
+ return (_jsx("div", { children: item.key === 'new' ? (_jsxs("div", { style: styles.newContainer, children: [_jsx("input", { style: styles.input, value: name, placeholder: "Custom workspace", onClick: (e) => e.stopPropagation(), onChange: onTextChange }), _jsx(Button.Done, { onClick: addHandler, disabled: !name, style: { fontSize: '11px' }, children: "Save" })] })) : (_jsxs("div", { style: styles.container, children: [_jsx(WorkSpaceIndicator, { source: item.source }), _jsx("span", { style: styles.workspaceName, children: item.label }), item.source !== 'user' && (_jsx("span", { style: styles.readOnly, children: "Read Only" })), item.source === 'user' && onDelete && (_jsx(Button.Danger, { onClick: deleteHandler, size: "xSmall", fill: "clear", children: _jsx(FaTimes, {}) }))] })) }));
58
58
  }
59
59
  const style = {
60
60
  width: '20px',
@@ -0,0 +1,2 @@
1
+ declare function NucleiTabContent(): import("react/jsx-runtime").JSX.Element;
2
+ export default NucleiTabContent;
@@ -0,0 +1,99 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useFormikContext } from 'formik';
3
+ import { useCallback, useMemo } from 'react';
4
+ import { FaPlus, FaTimes } from 'react-icons/fa';
5
+ import Button from '../../../elements/Button';
6
+ import { GroupPane } from '../../../elements/GroupPane';
7
+ import ReactTable from '../../../elements/ReactTable/ReactTable';
8
+ import FormikInput from '../../../elements/formik/FormikInput';
9
+ const styles = {
10
+ input: {
11
+ width: '100%',
12
+ },
13
+ column: {
14
+ padding: '2px',
15
+ },
16
+ };
17
+ function NucleiTabContent() {
18
+ const { values, setFieldValue } = useFormikContext();
19
+ const fields = values?.nuclei || [];
20
+ const addHandler = useCallback((data, index) => {
21
+ let columns = [];
22
+ const emptyField = {
23
+ nucleus: '',
24
+ ppmFormat: '0.00',
25
+ hzFormat: '0.00',
26
+ };
27
+ if (data && Array.isArray(data)) {
28
+ columns = [...data.slice(0, index), emptyField, ...data.slice(index)];
29
+ }
30
+ else {
31
+ columns.push(emptyField);
32
+ }
33
+ void setFieldValue('nuclei', columns);
34
+ }, [setFieldValue]);
35
+ const deleteHandler = useCallback((data, index) => {
36
+ const _fields = data.filter((_, columnIndex) => columnIndex !== index);
37
+ void setFieldValue('nuclei', _fields);
38
+ }, [setFieldValue]);
39
+ const COLUMNS = useMemo(() => [
40
+ {
41
+ Header: '#',
42
+ style: { width: '25px', ...styles.column },
43
+ accessor: (_, index) => index + 1,
44
+ },
45
+ {
46
+ Header: 'Nucleus',
47
+ style: { padding: 0, ...styles.column },
48
+ Cell: ({ row }) => {
49
+ return (_jsx(FormikInput, { name: `nuclei.${row.index}.nucleus`, style: { input: styles.input } }));
50
+ },
51
+ },
52
+ {
53
+ Header: 'δ (ppm)',
54
+ style: { padding: 0, ...styles.column },
55
+ Cell: ({ row }) => {
56
+ return (_jsx(FormikInput, { name: `nuclei.${row.index}.ppmFormat`, style: { input: styles.input } }));
57
+ },
58
+ },
59
+ {
60
+ Header: 'Coupling (Hz)',
61
+ style: { padding: 0, ...styles.column },
62
+ Cell: ({ row }) => {
63
+ return (_jsx(FormikInput, { name: `nuclei.${row.index}.hzFormat`, style: { input: styles.input } }));
64
+ },
65
+ },
66
+ {
67
+ Header: 'Axis from',
68
+ style: { padding: 0, ...styles.column },
69
+ Cell: ({ row }) => {
70
+ return (_jsx(FormikInput, { name: `nuclei.${row.index}.axisFrom`, style: { input: styles.input }, type: "number" }));
71
+ },
72
+ },
73
+ {
74
+ Header: 'Axis to',
75
+ style: { padding: 0, ...styles.column },
76
+ Cell: ({ row }) => {
77
+ return (_jsx(FormikInput, { name: `nuclei.${row.index}.axisTo`, style: { input: styles.input }, type: "number" }));
78
+ },
79
+ },
80
+ {
81
+ Header: '',
82
+ style: { width: '70px', ...styles.column },
83
+ id: 'add-button',
84
+ Cell: ({ data, row }) => {
85
+ return (_jsxs("div", { style: { display: 'flex', justifyContent: 'space-around' }, children: [_jsx(Button.Done, { fill: "outline", onClick: () => addHandler(data, row.index + 1), children: _jsx(FaPlus, {}) }), _jsx(Button.Danger, { fill: "outline", onClick: () => deleteHandler(data, row.index), children: _jsx(FaTimes, {}) })] }));
86
+ },
87
+ },
88
+ ], [addHandler, deleteHandler]);
89
+ return (_jsx("div", { children: _jsx(GroupPane, { text: "Number formatting for crosshair and info line and axis domain", renderHeader: (text) => {
90
+ return (_jsx(FieldsBlockHeader, { text: text, onAdd: () => addHandler(fields, 0) }));
91
+ }, children: _jsx(ReactTable, { style: {
92
+ 'table, table td, table th': { border: 'none' },
93
+ 'table thead': { borderBottom: '1px solid #f9f9f9' },
94
+ }, data: fields, columns: COLUMNS, emptyDataRowText: "No Nucleus" }) }) }));
95
+ }
96
+ function FieldsBlockHeader({ onAdd, text }) {
97
+ return (_jsxs("div", { className: "section-header", style: { display: 'flex' }, children: [_jsx("p", { style: { flex: 1 }, children: text }), _jsx(Button.Done, { fill: "outline", size: "xSmall", onClick: onAdd, children: "Add nuclei preferences" })] }));
98
+ }
99
+ export default NucleiTabContent;
@@ -1,44 +1,40 @@
1
- import { array, lazy, object, string, ValidationError, number, } from 'yup';
2
- const formattingElementValidation = (obj) => {
3
- return Object.fromEntries(Object.keys(obj.formatting.nuclei).map((key) => [
4
- key,
5
- object().shape({
6
- name: string().trim().required('Nucleus is a required field'),
7
- ppm: string().trim().required('PPM format is a required field'),
8
- hz: string().trim().required('Hz format is a required field'),
9
- }),
10
- ]));
11
- };
12
- const formattingValidation = (obj) => object().shape({
13
- nuclei: object()
14
- .shape(formattingElementValidation(obj))
15
- .test('Unique', 'Nuclei need te be unique', function check(nuclei) {
16
- const nucleusFrequencies = {};
17
- for (const key of Object.keys(nuclei)) {
18
- const _key = nuclei[key].name?.toLowerCase() || '';
19
- if (_key) {
20
- if (nucleusFrequencies[_key]) {
21
- ++nucleusFrequencies[_key].value;
22
- nucleusFrequencies[_key].fields.push(key);
23
- }
24
- else {
25
- nucleusFrequencies[_key] = { value: 1, fields: [key] };
26
- }
1
+ import { array, object, string, ValidationError, number } from 'yup';
2
+ const nucleiValidation = array()
3
+ .of(object().shape({
4
+ nucleus: string().trim().required('Nucleus is a required field'),
5
+ ppmFormat: string().trim().required('PPM format is a required field'),
6
+ hzFormat: string().trim().required('Hz format is a required field'),
7
+ }))
8
+ .test('Unique', 'Nuclei need te be unique', function check(nuclei) {
9
+ if (!nuclei)
10
+ return true;
11
+ const nucleusFrequencies = {};
12
+ let index = 0;
13
+ for (const nucleiPreferences of nuclei) {
14
+ const key = nucleiPreferences.nucleus?.toLowerCase() || '';
15
+ if (key) {
16
+ if (nucleusFrequencies[key]) {
17
+ ++nucleusFrequencies[key].value;
18
+ nucleusFrequencies[key].fieldsIndexes.push(index);
19
+ }
20
+ else {
21
+ nucleusFrequencies[key] = { value: 1, fieldsIndexes: [index] };
27
22
  }
28
23
  }
29
- const errors = [];
30
- for (const key in nucleusFrequencies) {
31
- const { value, fields } = nucleusFrequencies[key];
32
- if (value > 1) {
33
- for (const field of fields) {
34
- errors.push(new ValidationError(`${key} nucleus must te be unique`, nuclei[key].name,
35
- // eslint-disable-next-line no-invalid-this
36
- `${this.path}.${field}.name`));
37
- }
24
+ index++;
25
+ }
26
+ const errors = [];
27
+ for (const key in nucleusFrequencies) {
28
+ const { value, fieldsIndexes } = nucleusFrequencies[key];
29
+ if (value > 1) {
30
+ for (const index of fieldsIndexes) {
31
+ errors.push(new ValidationError(`${key} nucleus must te be unique`, nuclei[index].nucleus,
32
+ // eslint-disable-next-line no-invalid-this
33
+ `${this.path}.${index}.name`));
38
34
  }
39
35
  }
40
- return new ValidationError(errors);
41
- }),
36
+ }
37
+ return new ValidationError(errors);
42
38
  });
43
39
  const databasesValidation = object().shape({
44
40
  data: array().of(object().shape({
@@ -65,10 +61,10 @@ const spectraColorsSchemaValidation = object({
65
61
  const generalValidation = object({
66
62
  dimmedSpectraOpacity: number().required(),
67
63
  });
68
- export const validation = lazy((obj) => object().shape({
69
- formatting: formattingValidation(obj),
64
+ export const validation = object().shape({
65
+ nuclei: nucleiValidation,
70
66
  databases: databasesValidation,
71
67
  infoBlock: infoBlockValidation,
72
68
  general: generalValidation,
73
69
  spectraColors: spectraColorsSchemaValidation,
74
- }));
70
+ });
@@ -27,13 +27,13 @@ function AutomaticAssignment() {
27
27
  },
28
28
  {
29
29
  icon: _jsx(SvgNmrAssignment2, {}),
30
- title: 'Automatic assignment',
30
+ tooltip: 'Automatic assignment',
31
31
  onClick: getAssignments,
32
32
  disabled: !enabled,
33
33
  },
34
34
  {
35
35
  icon: _jsx(FaBolt, {}),
36
- title: 'Reset assignment',
36
+ tooltip: 'Reset assignment',
37
37
  onClick: restAssignments,
38
38
  },
39
39
  ] }), _jsx("div", { className: "inner-container", children: _jsx(AutomaticAssignmentTable, { data: assignments }) })] }));
@@ -94,13 +94,13 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
94
94
  },
95
95
  {
96
96
  icon: _jsx(ImLink, {}),
97
- title: 'Fixed integration values',
97
+ tooltip: 'Fixed integration values',
98
98
  onClick: toggleConstantSumHandler,
99
99
  active: integrals?.options?.isSumConstant || false,
100
100
  },
101
101
  {
102
102
  icon: _jsx(SvgNmrIntegrate, {}),
103
- title: `${booleanToString(!showIntegralsValues)} integrals values`,
103
+ tooltip: `${booleanToString(!showIntegralsValues)} integrals values`,
104
104
  onClick: handleShowIntegralsValues,
105
105
  active: showIntegralsValues,
106
106
  },
@@ -85,13 +85,13 @@ function MatrixGenerationPanel() {
85
85
  return (_jsxs("div", { css: tablePanelStyle, children: [_jsx(DefaultPanelHeader, { leftButtons: [
86
86
  {
87
87
  icon: _jsx(SvgNmrExportAsMatrix, {}),
88
- title: 'Export spectra as a matrix',
88
+ tooltip: 'Export spectra as a matrix',
89
89
  onClick: handleExportAsMatrix,
90
90
  },
91
91
  ], rightButtons: [
92
92
  {
93
93
  onClick: () => formRef.current?.submitForm(),
94
- title: 'Signal processing',
94
+ tooltip: 'Signal processing',
95
95
  id: 'save-button',
96
96
  intent: 'success',
97
97
  icon: _jsx(FaCheck, {}),
@@ -160,5 +160,5 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
160
160
  });
161
161
  }
162
162
  const hasMolecules = molecules && molecules.length > 0;
163
- return (_jsxs(PanelHeader, { children: [_jsxs(Toolbar, { children: [renderSource === 'predictionPanel' && _jsx(AboutPredictionModal, {}), renderSource === 'moleculePanel' && (_jsxs(_Fragment, { children: [_jsx(ToolbarPopoverItem, { options: MOL_EXPORT_MENU, onClick: exportHandler, disabled: !hasMolecules, title: "Export As", icon: _jsx(FaFileExport, {}) }), _jsx(Toolbar.Item, { title: "Paste molfile", icon: _jsx(FaPaste, {}), onClick: handlePasteMolfileAction }), _jsx(Toolbar.Item, { title: "Add molecule", icon: _jsx(FaPlus, {}), onClick: onOpenMoleculeEditor })] })), renderSource === 'moleculePanel' && (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { title: "Delete molecule", icon: _jsx(FaRegTrashAlt, {}), onClick: handleDelete, disabled: !hasMolecules }), hasMolecules && (_jsx(PredictSpectraModal, { molecule: molecules[currentIndex] }))] })), _jsx(Toolbar.Item, { title: "Float molecule", icon: _jsx(IoOpenOutline, {}), onClick: floatMoleculeHandler, active: moleculesView?.[moleculeKey]?.floating.visible || false, disabled: !hasMolecules }), _jsx(Toolbar.Item, { title: "Show atom number", icon: _jsx("p", { style: styles.atomLabel, children: "#" }), onClick: showAtomNumbersHandler, active: moleculesView?.[moleculeKey]?.showAtomNumber || false, disabled: !hasMolecules })] }), _jsx("div", { style: { flex: 1 }, children: children }), molecules && molecules.length > 0 && (_jsx("p", { style: styles.counter, children: `${+(currentIndex + 1)} / ${molecules.length}` })), onClickPreferences && (_jsx(PreferencesButton, { title: "Preferences", onClick: onClickPreferences })), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePasteMolfile, text: text, label: "Molfile" })] }));
163
+ return (_jsxs(PanelHeader, { children: [_jsxs(Toolbar, { children: [renderSource === 'predictionPanel' && _jsx(AboutPredictionModal, {}), renderSource === 'moleculePanel' && (_jsxs(_Fragment, { children: [_jsx(ToolbarPopoverItem, { options: MOL_EXPORT_MENU, onClick: exportHandler, disabled: !hasMolecules, tooltip: "Export As", icon: _jsx(FaFileExport, {}) }), _jsx(Toolbar.Item, { tooltip: "Paste molfile", icon: _jsx(FaPaste, {}), onClick: handlePasteMolfileAction }), _jsx(Toolbar.Item, { tooltip: "Add molecule", icon: _jsx(FaPlus, {}), onClick: onOpenMoleculeEditor })] })), renderSource === 'moleculePanel' && (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { tooltip: "Delete molecule", icon: _jsx(FaRegTrashAlt, {}), onClick: handleDelete, disabled: !hasMolecules }), hasMolecules && (_jsx(PredictSpectraModal, { molecule: molecules[currentIndex] }))] })), _jsx(Toolbar.Item, { tooltip: "Float molecule", icon: _jsx(IoOpenOutline, {}), onClick: floatMoleculeHandler, active: moleculesView?.[moleculeKey]?.floating.visible || false, disabled: !hasMolecules }), _jsx(Toolbar.Item, { tooltip: "Show atom number", icon: _jsx("p", { style: styles.atomLabel, children: "#" }), onClick: showAtomNumbersHandler, active: moleculesView?.[moleculeKey]?.showAtomNumber || false, disabled: !hasMolecules })] }), _jsx("div", { style: { flex: 1 }, children: children }), molecules && molecules.length > 0 && (_jsx("p", { style: styles.counter, children: `${+(currentIndex + 1)} / ${molecules.length}` })), onClickPreferences && (_jsx(PreferencesButton, { tooltip: "Preferences", onClick: onClickPreferences })), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePasteMolfile, text: text, label: "Molfile" })] }));
164
164
  }
@@ -98,14 +98,14 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
98
98
  {
99
99
  disabled,
100
100
  icon: _jsx(SvgNmrPeaks, {}),
101
- title: `${booleanToString(!showPeaks)} peaks`,
101
+ tooltip: `${booleanToString(!showPeaks)} peaks`,
102
102
  onClick: () => toggleViewProperty('showPeaks'),
103
103
  active: showPeaks,
104
104
  },
105
105
  {
106
106
  disabled,
107
107
  icon: _jsx(SvgNmrPeaksTopLabels, {}),
108
- title: `${displayingMode === 'spread' ? 'Single' : 'Spread'} mode`,
108
+ tooltip: `${displayingMode === 'spread' ? 'Single' : 'Spread'} mode`,
109
109
  onClick: toggleDisplayingMode,
110
110
  active: displayingMode === 'spread',
111
111
  },
@@ -114,18 +114,18 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
114
114
  leftButtons.unshift({
115
115
  disabled,
116
116
  icon: _jsx(SvgPeaks, {}),
117
- title: `${booleanToString(!showPeaksShapes)} peaks shapes`,
117
+ tooltip: `${booleanToString(!showPeaksShapes)} peaks shapes`,
118
118
  onClick: () => toggleViewProperty('showPeaksShapes'),
119
119
  active: showPeaksShapes,
120
120
  }, {
121
121
  disabled,
122
122
  icon: _jsx(SvgNmrFt, {}),
123
- title: `${booleanToString(!showPeaksSum)} peaks sum`,
123
+ tooltip: `${booleanToString(!showPeaksSum)} peaks sum`,
124
124
  onClick: () => toggleViewProperty('showPeaksSum'),
125
125
  active: showPeaksSum,
126
126
  }, {
127
127
  icon: _jsx(FaThinkPeaks, {}),
128
- title: 'Optimize peaks',
128
+ tooltip: 'Optimize peaks',
129
129
  onClick: optimizePeaksHandler,
130
130
  });
131
131
  }
@@ -3,8 +3,8 @@ import { SvgNmrIntegrate, SvgNmrPeaks, SvgNmrPeaksTopLabels, } from 'cheminfo-fo
3
3
  import lodashGet from 'lodash/get';
4
4
  import { rangesToACS } from 'nmr-processing';
5
5
  import { FaFileExport, FaUnlink, FaSitemap, FaChartBar } from 'react-icons/fa';
6
- import { LuSubtitles } from 'react-icons/lu';
7
6
  import { ImLink } from 'react-icons/im';
7
+ import { LuSubtitles } from 'react-icons/lu';
8
8
  import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardComponents';
9
9
  import { useClipboard } from '../../../utils/clipboard/clipboardHooks';
10
10
  import { useAssignmentData } from '../../assignment/AssignmentsContext';
@@ -118,7 +118,7 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
118
118
  {
119
119
  disabled: !hasRanges,
120
120
  icon: _jsx(FaFileExport, {}),
121
- title: 'Preview publication string',
121
+ tooltip: 'Preview publication string',
122
122
  onClick: saveAsHTMLHandler,
123
123
  },
124
124
  {
@@ -126,41 +126,41 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
126
126
  },
127
127
  {
128
128
  icon: _jsx(ImLink, {}),
129
- title: 'Fixed integration sum',
129
+ tooltip: 'Fixed integration sum',
130
130
  onClick: changeSumConstantFlagHandler,
131
131
  active: ranges?.options?.isSumConstant,
132
132
  },
133
133
  {
134
134
  disabled: !hasRanges,
135
135
  icon: _jsx(FaUnlink, {}),
136
- title: 'Remove all assignments',
136
+ tooltip: 'Remove all assignments',
137
137
  onClick: handleOnRemoveAssignments,
138
138
  },
139
139
  {
140
140
  disabled: !hasRanges,
141
141
  icon: _jsx(FaSitemap, {}),
142
- title: `${booleanToString(!showMultiplicityTrees)} multiplicity trees in spectrum`,
142
+ tooltip: `${booleanToString(!showMultiplicityTrees)} multiplicity trees in spectrum`,
143
143
  onClick: handleSetShowMultiplicityTrees,
144
144
  active: showMultiplicityTrees,
145
145
  },
146
146
  {
147
147
  disabled: !hasRanges,
148
148
  icon: _jsx(FaChartBar, {}),
149
- title: `${booleanToString(!showJGraph)} J Graph`,
149
+ tooltip: `${booleanToString(!showJGraph)} J Graph`,
150
150
  onClick: handleShowJGraph,
151
151
  active: showJGraph,
152
152
  },
153
153
  {
154
154
  disabled: !hasRanges,
155
155
  icon: _jsx(SvgNmrIntegrate, {}),
156
- title: `${booleanToString(!showIntegrals)} integrals`,
156
+ tooltip: `${booleanToString(!showIntegrals)} integrals`,
157
157
  onClick: handleShowIntegrals,
158
158
  active: showIntegrals,
159
159
  },
160
160
  {
161
161
  disabled: !hasRanges,
162
162
  icon: _jsx(SvgNmrIntegrate, {}),
163
- title: `${booleanToString(!showIntegralsValues)} integrals values`,
163
+ tooltip: `${booleanToString(!showIntegralsValues)} integrals values`,
164
164
  onClick: handleShowIntegralsValues,
165
165
  active: showIntegralsValues,
166
166
  },
@@ -168,21 +168,21 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
168
168
  id: 'ranges-toggle-peaks',
169
169
  disabled: !hasRanges,
170
170
  icon: _jsx(SvgNmrPeaks, {}),
171
- title: `${booleanToString(!showPeaks)} peaks`,
171
+ tooltip: `${booleanToString(!showPeaks)} peaks`,
172
172
  onClick: () => toggleViewProperty('showPeaks'),
173
173
  active: showPeaks,
174
174
  },
175
175
  {
176
176
  disabled: !hasRanges,
177
177
  icon: _jsx(SvgNmrPeaksTopLabels, {}),
178
- title: `${displayingMode === 'spread' ? 'Single' : 'Spread'} mode`,
178
+ tooltip: `${displayingMode === 'spread' ? 'Single' : 'Spread'} mode`,
179
179
  onClick: toggleDisplayingMode,
180
180
  active: displayingMode === 'spread',
181
181
  },
182
182
  {
183
183
  disabled: !hasRanges,
184
184
  icon: _jsx(LuSubtitles, {}),
185
- title: `${booleanToString(!showAssignmentsLabels)} assignments labels`,
185
+ tooltip: `${booleanToString(!showAssignmentsLabels)} assignments labels`,
186
186
  onClick: handleShowAssignmentsLabel,
187
187
  active: showAssignmentsLabels,
188
188
  },
@@ -19,68 +19,68 @@ const formatFields = [
19
19
  },
20
20
  {
21
21
  id: 2,
22
+ label: 'Assignment label :',
23
+ checkControllerName: 'showAssignmentLabel',
24
+ hideFormatField: true,
25
+ },
26
+ {
27
+ id: 3,
22
28
  label: 'From (ppm) :',
23
29
  checkControllerName: 'from.show',
24
30
  formatControllerName: 'from.format',
25
31
  },
26
32
  {
27
- id: 3,
33
+ id: 4,
28
34
  label: 'To (ppm) :',
29
35
  checkControllerName: 'to.show',
30
36
  formatControllerName: 'to.format',
31
37
  },
32
38
  {
33
- id: 4,
39
+ id: 5,
34
40
  label: 'Absolute integration :',
35
41
  checkControllerName: 'absolute.show',
36
42
  formatControllerName: 'absolute.format',
37
43
  },
38
44
  {
39
- id: 5,
45
+ id: 6,
40
46
  label: 'Relative integration :',
41
47
  checkControllerName: 'relative.show',
42
48
  formatControllerName: 'relative.format',
43
49
  },
44
50
  {
45
- id: 6,
51
+ id: 7,
46
52
  label: 'δ (ppm) :',
47
53
  checkControllerName: 'deltaPPM.show',
48
54
  formatControllerName: 'deltaPPM.format',
49
55
  },
50
56
  {
51
- id: 7,
57
+ id: 8,
52
58
  label: 'δ (Hz) :',
53
59
  checkControllerName: 'deltaHz.show',
54
60
  formatControllerName: 'deltaHz.format',
55
61
  },
56
62
  {
57
- id: 8,
63
+ id: 9,
58
64
  label: 'Coupling (Hz) :',
59
65
  checkControllerName: 'coupling.show',
60
66
  formatControllerName: 'coupling.format',
61
67
  },
62
68
  {
63
- id: 9,
69
+ id: 10,
64
70
  label: 'Kind :',
65
71
  checkControllerName: 'showKind',
66
72
  hideFormatField: true,
67
73
  },
68
74
  {
69
- id: 10,
75
+ id: 11,
70
76
  label: 'Multiplicity :',
71
77
  checkControllerName: 'showMultiplicity',
72
78
  hideFormatField: true,
73
79
  },
74
- {
75
- id: 11,
76
- label: 'Assignment :',
77
- checkControllerName: 'showAssignment',
78
- hideFormatField: true,
79
- },
80
80
  {
81
81
  id: 12,
82
- label: 'Assignment label :',
83
- checkControllerName: 'showAssignmentLabel',
82
+ label: 'Assignment links :',
83
+ checkControllerName: 'showAssignment',
84
84
  hideFormatField: true,
85
85
  },
86
86
  {
@@ -64,7 +64,7 @@ function RangesTable({ tableData, onUnlink, contextMenu = [], onContextMenuSelec
64
64
  const showActions = preferences.showDeleteAction ||
65
65
  preferences.showEditAction ||
66
66
  preferences.showZoomAction;
67
- return (_jsxs("table", { css: tableStyle, children: [_jsx("thead", { children: _jsxs("tr", { children: [preferences.showSerialNumber && _jsx("th", { children: "#" }), preferences.from.show && (_jsxs("th", { id: "from", ...onSort, children: ["From", isSortedDesc('from').content] })), preferences.to.show && (_jsxs("th", { id: "to", ...onSort, children: ["To ", isSortedDesc('to').content] })), preferences.deltaPPM.show && (_jsxs("th", { id: "from", ...onSort, children: ["\u03B4 (ppm) ", isSortedDesc('from').content] })), preferences.deltaHz.show && _jsx("th", { children: "\u03B4 (Hz) " }), preferences.relative.show && (_jsxs("th", { id: "integration", ...onSort, children: ["Rel. ", element, " ", isSortedDesc('integration').content] })), preferences.absolute.show && _jsx("th", { children: "Absolute" }), preferences.showMultiplicity && _jsx("th", { children: "Mult." }), preferences.coupling.show && _jsx("th", { children: "J (Hz)" }), preferences.showAssignmentLabel && (_jsx("th", { title: "Assignment", children: "Assignment" })), preferences.showAssignment && (_jsxs(_Fragment, { children: [_jsx("th", { title: "Assign multiplets", children: _jsx(FaLink, { style: { fontSize: 10, margin: 'auto' } }) }), _jsx("th", { title: "Assign ranges", style: { minWidth: '50px' }, children: "\u03A3" })] })), preferences.showKind && _jsx("th", { children: "Kind" }), showActions && _jsx("th", { children: '' })] }) }), _jsx("tbody", { children: data?.map((range) => {
67
+ return (_jsxs("table", { css: tableStyle, children: [_jsx("thead", { children: _jsxs("tr", { children: [preferences.showSerialNumber && _jsx("th", { children: "#" }), preferences.showAssignmentLabel && (_jsx("th", { title: "Assignment", children: "Assignment" })), preferences.from.show && (_jsxs("th", { id: "from", ...onSort, children: ["From", isSortedDesc('from').content] })), preferences.to.show && (_jsxs("th", { id: "to", ...onSort, children: ["To ", isSortedDesc('to').content] })), preferences.deltaPPM.show && (_jsxs("th", { id: "from", ...onSort, children: ["\u03B4 (ppm) ", isSortedDesc('from').content] })), preferences.deltaHz.show && _jsx("th", { children: "\u03B4 (Hz) " }), preferences.relative.show && (_jsxs("th", { id: "integration", ...onSort, children: ["Rel. ", element, " ", isSortedDesc('integration').content] })), preferences.absolute.show && _jsx("th", { children: "Absolute" }), preferences.showMultiplicity && _jsx("th", { children: "Mult." }), preferences.coupling.show && _jsx("th", { children: "J (Hz)" }), preferences.showAssignment && (_jsxs(_Fragment, { children: [_jsx("th", { title: "Assign multiplets", children: _jsx(FaLink, { style: { fontSize: 10, margin: 'auto' } }) }), _jsx("th", { title: "Assign ranges", style: { minWidth: '50px' }, children: "\u03A3" })] })), preferences.showKind && _jsx("th", { children: "Kind" }), showActions && _jsx("th", { children: '' })] }) }), _jsx("tbody", { children: data?.map((range) => {
68
68
  return (_jsx(RangesTableRow, { rowData: range, onUnlink: onUnlink, preferences: preferences, info: info, contextMenu: contextMenu, onContextMenuSelect: onContextMenuSelect }, range.rowKey));
69
69
  }) })] }));
70
70
  }