nmrium 0.50.0 → 0.50.1

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 (59) hide show
  1. package/README.md +7 -7
  2. package/lib/component/elements/CloseButton.d.ts +2 -2
  3. package/lib/component/elements/CloseButton.js +1 -1
  4. package/lib/component/elements/CounterLabel.d.ts +3 -3
  5. package/lib/component/elements/CounterLabel.js +3 -3
  6. package/lib/component/elements/PreferencesButton.d.ts +2 -2
  7. package/lib/component/elements/PreferencesButton.js +2 -4
  8. package/lib/component/elements/SaveButton.d.ts +2 -2
  9. package/lib/component/elements/SaveButton.js +1 -1
  10. package/lib/component/elements/ToolBarButton.d.ts +1 -8
  11. package/lib/component/elements/ToolBarButton.js +2 -11
  12. package/lib/component/elements/ToolbarPopoverItem.d.ts +11 -0
  13. package/lib/component/elements/ToolbarPopoverItem.js +10 -0
  14. package/lib/component/modal/CopyClipboardModal.js +1 -1
  15. package/lib/component/modal/EditPeakShapeModal.js +1 -1
  16. package/lib/component/modal/SaveAsModal.js +1 -1
  17. package/lib/component/modal/aboutUs/AboutUsModal.js +1 -1
  18. package/lib/component/modal/editRange/EditRangeModal.js +1 -1
  19. package/lib/component/modal/editZone/EditZoneModal.js +1 -1
  20. package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
  21. package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +16 -2
  22. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +20 -6
  23. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +16 -3
  24. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
  25. package/lib/component/panels/PeaksPanel/PeaksPanel.js +42 -11
  26. package/lib/component/panels/RangesPanel/RangesHeader.js +70 -10
  27. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +46 -5
  28. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +1 -1
  29. package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
  30. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -1
  31. package/lib/component/panels/SummaryPanel/SummaryPanel.js +28 -18
  32. package/lib/component/panels/ZonesPanel/ZonesPanel.js +28 -4
  33. package/lib/component/panels/databasePanel/DatabaseSearchOptions.d.ts +3 -3
  34. package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +4 -4
  35. package/lib/component/panels/filtersPanel/FilterPanel.js +1 -1
  36. package/lib/component/panels/header/DefaultPanelHeader.d.ts +10 -6
  37. package/lib/component/panels/header/DefaultPanelHeader.js +26 -10
  38. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +32 -3
  39. package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +5 -1
  40. package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
  41. package/lib/component/toolbar/ToolBar.js +237 -9
  42. package/lib/component/toolbar/toolbarMenu.d.ts +4 -0
  43. package/lib/component/toolbar/toolbarMenu.js +77 -0
  44. package/lib/component/utility/booleanToString.d.ts +6 -0
  45. package/lib/component/utility/booleanToString.js +4 -0
  46. package/lib/versionInfo.js +1 -1
  47. package/package.json +3 -3
  48. package/lib/component/elements/DeleteButton.d.ts +0 -6
  49. package/lib/component/elements/DeleteButton.js +0 -8
  50. package/lib/component/elements/DropdownMenu.d.ts +0 -9
  51. package/lib/component/elements/DropdownMenu.js +0 -7
  52. package/lib/component/elements/FilterButton.d.ts +0 -6
  53. package/lib/component/elements/FilterButton.js +0 -8
  54. package/lib/component/panels/PeaksPanel/PeaksToggleActions.d.ts +0 -12
  55. package/lib/component/panels/PeaksPanel/PeaksToggleActions.js +0 -7
  56. package/lib/component/toolbar/BasicToolBar.d.ts +0 -1
  57. package/lib/component/toolbar/BasicToolBar.js +0 -165
  58. package/lib/component/toolbar/FunctionToolBar.d.ts +0 -3
  59. package/lib/component/toolbar/FunctionToolBar.js +0 -148
@@ -1,10 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { SvgNmrIntegrate } from 'cheminfo-font';
2
+ import { SvgNmrIntegrate, SvgNmrPeaks, SvgNmrPeaksTopLabels, } from 'cheminfo-font';
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
6
  import { ImLink } from 'react-icons/im';
7
- import { Toolbar } from 'react-science/ui';
8
7
  import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardComponents';
9
8
  import { useClipboard } from '../../../utils/clipboard/clipboardHooks';
10
9
  import { useAssignmentData } from '../../assignment/AssignmentsContext';
@@ -15,8 +14,8 @@ import { useActiveSpectrumRangesViewState } from '../../hooks/useActiveSpectrumR
15
14
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
16
15
  import CopyClipboardModal from '../../modal/CopyClipboardModal';
17
16
  import ChangeSumModal from '../../modal/changeSum/ChangeSumModal';
18
- import { PeaksToggleActions } from '../PeaksPanel/PeaksToggleActions';
19
- import DefaultPanelHeader, { createFilterLabel, } from '../header/DefaultPanelHeader';
17
+ import { booleanToString } from '../../utility/booleanToString';
18
+ import DefaultPanelHeader from '../header/DefaultPanelHeader';
20
19
  function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClick, isFilterActive, filterCounter, activeTab, }) {
21
20
  const dispatch = useDispatch();
22
21
  const modal = useModal();
@@ -107,11 +106,72 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
107
106
  dispatch({ type: 'TOGGLE_RANGES_PEAKS_DISPLAYING_MODE' });
108
107
  }
109
108
  const hasRanges = Array.isArray(ranges?.values) && ranges.values.length > 0;
110
- const counter = ranges?.values?.length || 0;
111
- return (_jsxs("div", { children: [_jsx(DefaultPanelHeader, { counter: counter, counterLabel: 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: _jsxs(Toolbar, { children: [_jsx(Toolbar.Item, { disabled: !hasRanges, icon: _jsx(FaFileExport, {}), title: "Preview publication string", onClick: saveAsHTMLHandler }), _jsx(ChangeSumModal, { onSave: changeRangesSumHandler, sumType: "ranges", currentSum: currentSum, sumOptions: ranges?.options }), _jsx(Toolbar.Item, { disabled: !hasRanges, icon: _jsx(FaUnlink, {}), title: "Remove all assignments", onClick: handleOnRemoveAssignments }), _jsx(Toolbar.Item, { disabled: !hasRanges, icon: _jsx(FaSitemap, {}), title: showMultiplicityTrees
112
- ? 'Hide multiplicity trees in spectrum'
113
- : 'Show multiplicity trees in spectrum', onClick: handleSetShowMultiplicityTrees, active: showMultiplicityTrees }), _jsx(Toolbar.Item, { disabled: !hasRanges, icon: _jsx(FaChartBar, {}), title: showJGraph ? 'Hide J Graph' : 'Show J Graph', onClick: handleShowJGraph, active: showJGraph }), _jsx(Toolbar.Item, { disabled: !hasRanges, icon: _jsx(SvgNmrIntegrate, {}), title: showIntegrals ? 'Hide integrals' : 'Show integrals', onClick: handleShowIntegrals, active: showIntegrals }), _jsx(Toolbar.Item, { disabled: !hasRanges, icon: _jsx(SvgNmrIntegrate, {}), title: showIntegralsValues
114
- ? 'Hide integrals values'
115
- : 'Show integrals values', onClick: handleShowIntegralsValues, active: showIntegralsValues }), _jsx(Toolbar.Item, { icon: _jsx(ImLink, {}), title: "Fixed integration sum", onClick: changeSumConstantFlagHandler, active: ranges?.options?.isSumConstant }), _jsx(PeaksToggleActions, { disabled: !hasRanges, togglePeaksId: "ranges-toggle-peaks", togglePeaks: showPeaks, onShowToggle: () => toggleViewProperty('showPeaks'), toggleDisplayingMode: displayingMode, onDisplayingModeToggle: toggleDisplayingMode })] }) }), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Preview publication string" })] }));
109
+ const total = ranges?.values?.length || 0;
110
+ return (_jsxs("div", { children: [_jsx(DefaultPanelHeader, { total: total, counter: filterCounter, onDelete: handleDeleteAll, deleteToolTip: "Delete All Ranges", onFilter: onFilterActivated, filterToolTip: isFilterActive ? 'Show all ranges' : 'Hide ranges out of view', onSettingClick: onSettingClick, leftButtons: [
111
+ {
112
+ disabled: !hasRanges,
113
+ icon: _jsx(FaFileExport, {}),
114
+ title: 'Preview publication string',
115
+ onClick: saveAsHTMLHandler,
116
+ },
117
+ {
118
+ component: (_jsx(ChangeSumModal, { onSave: changeRangesSumHandler, sumType: "ranges", currentSum: currentSum, sumOptions: ranges?.options })),
119
+ },
120
+ {
121
+ disabled: !hasRanges,
122
+ icon: _jsx(FaUnlink, {}),
123
+ title: 'Remove all assignments',
124
+ onClick: handleOnRemoveAssignments,
125
+ },
126
+ {
127
+ disabled: !hasRanges,
128
+ icon: _jsx(FaSitemap, {}),
129
+ title: `${booleanToString(!showMultiplicityTrees)} multiplicity trees in spectrum`,
130
+ onClick: handleSetShowMultiplicityTrees,
131
+ active: showMultiplicityTrees,
132
+ },
133
+ {
134
+ disabled: !hasRanges,
135
+ icon: _jsx(FaChartBar, {}),
136
+ title: `${booleanToString(!showJGraph)} J Graph`,
137
+ onClick: handleShowJGraph,
138
+ active: showJGraph,
139
+ },
140
+ {
141
+ disabled: !hasRanges,
142
+ icon: _jsx(SvgNmrIntegrate, {}),
143
+ title: `${booleanToString(!showIntegrals)} integrals`,
144
+ onClick: handleShowIntegrals,
145
+ active: showIntegrals,
146
+ },
147
+ {
148
+ disabled: !hasRanges,
149
+ icon: _jsx(SvgNmrIntegrate, {}),
150
+ title: `${booleanToString(!showIntegralsValues)} integrals values`,
151
+ onClick: handleShowIntegralsValues,
152
+ active: showIntegralsValues,
153
+ },
154
+ {
155
+ icon: _jsx(ImLink, {}),
156
+ title: 'Fixed integration sum',
157
+ onClick: changeSumConstantFlagHandler,
158
+ active: ranges?.options?.isSumConstant,
159
+ },
160
+ {
161
+ id: 'ranges-toggle-peaks',
162
+ disabled: !hasRanges,
163
+ icon: _jsx(SvgNmrPeaks, {}),
164
+ title: `${booleanToString(!showPeaks)} peaks`,
165
+ onClick: () => toggleViewProperty('showPeaks'),
166
+ active: showPeaks,
167
+ },
168
+ {
169
+ disabled: !hasRanges,
170
+ icon: _jsx(SvgNmrPeaksTopLabels, {}),
171
+ title: `${displayingMode === 'spread' ? 'Single' : 'Spread'} mode`,
172
+ onClick: toggleDisplayingMode,
173
+ active: displayingMode === 'spread',
174
+ },
175
+ ] }), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Preview publication string" })] }));
116
176
  }
117
177
  export default RangesHeader;
@@ -1,9 +1,8 @@
1
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { SvgNmrSameTop, SvgNmrResetScale } from 'cheminfo-font';
3
3
  import { memo, useCallback } from 'react';
4
4
  import { FaCreativeCommonsSamplingPlus, FaEye, FaEyeSlash, } from 'react-icons/fa';
5
5
  import { IoColorPaletteOutline } from 'react-icons/io5';
6
- import { Toolbar } from 'react-science/ui';
7
6
  import { useChartData } from '../../context/ChartContext';
8
7
  import { useDispatch } from '../../context/DispatchContext';
9
8
  import { useAlert } from '../../elements/popup/Alert';
@@ -11,7 +10,7 @@ import { useModal } from '../../elements/popup/Modal';
11
10
  import { useActiveSpectra } from '../../hooks/useActiveSpectra';
12
11
  import useSpectrum from '../../hooks/useSpectrum';
13
12
  import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
14
- import DefaultPanelHeader, { createFilterLabel, } from '../header/DefaultPanelHeader';
13
+ import DefaultPanelHeader from '../header/DefaultPanelHeader';
15
14
  import { SpectraAutomaticPickingButton } from '../header/SpectraAutomaticPickingButton';
16
15
  function getMissingProjection(SpectrumsData, activeTab) {
17
16
  let nucleus = activeTab.split(',');
@@ -73,7 +72,7 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
73
72
  function resetScaleHandler() {
74
73
  dispatch({ type: 'RESET_SPECTRA_SCALE' });
75
74
  }
76
- function recolorSpectraHandler() {
75
+ function reColorSpectraHandler() {
77
76
  dispatch({
78
77
  type: 'RECOLOR_SPECTRA_COLOR',
79
78
  payload: {},
@@ -81,7 +80,49 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
81
80
  }
82
81
  const hasActiveSpectra = activeSpectra && activeSpectra?.length > 0;
83
82
  const spectraLengthPerTab = getSpectraByNucleus(activeTab, data)?.length;
84
- return (_jsx(DefaultPanelHeader, { onDelete: handleDelete, counter: data?.length, counterLabel: createFilterLabel(data?.length, spectraLengthPerTab), deleteToolTip: "Delete selected spectra", disableDelete: !hasActiveSpectra, showSettingButton: true, onSettingClick: onSettingClick, children: _jsxs(Toolbar, { children: [_jsx(Toolbar.Item, { disabled: !hasActiveSpectra, icon: _jsx(FaEyeSlash, {}), title: "Hide selected spectra", onClick: hideAllSpectrumsHandler }), _jsx(Toolbar.Item, { disabled: !hasActiveSpectra, icon: _jsx(FaEye, {}), title: "Show selected spectra", onClick: showAllSpectrumsHandler }), displayerMode === '2D' && activeSpectrum?.info.isFt && (_jsx(Toolbar.Item, { icon: _jsx(FaCreativeCommonsSamplingPlus, {}), title: "Add missing projection", onClick: addMissingProjectionHandler })), displayerMode === '1D' && spectraLengthPerTab > 1 && (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { icon: _jsx(SvgNmrResetScale, {}), title: "Reset scale", onClick: resetScaleHandler }), _jsx(Toolbar.Item, { icon: _jsx(SvgNmrSameTop, {}), title: "Same top", onClick: setSameTopHandler })] })), _jsx(SpectraAutomaticPickingButton, {}), _jsx(Toolbar.Item, { icon: _jsx(IoColorPaletteOutline, {}), title: "Recolor spectra", onClick: recolorSpectraHandler })] }) }));
83
+ let leftButtons = [
84
+ {
85
+ disabled: !hasActiveSpectra,
86
+ icon: _jsx(FaEyeSlash, {}),
87
+ title: 'Hide selected spectra',
88
+ onClick: hideAllSpectrumsHandler,
89
+ },
90
+ {
91
+ disabled: !hasActiveSpectra,
92
+ icon: _jsx(FaEye, {}),
93
+ title: 'Show selected spectra',
94
+ onClick: showAllSpectrumsHandler,
95
+ },
96
+ ];
97
+ if (displayerMode === '2D' && activeSpectrum?.info.isFt) {
98
+ leftButtons.push({
99
+ icon: _jsx(FaCreativeCommonsSamplingPlus, {}),
100
+ title: 'Add missing projection',
101
+ onClick: addMissingProjectionHandler,
102
+ });
103
+ }
104
+ if (displayerMode === '1D' && spectraLengthPerTab > 1) {
105
+ leftButtons.push({
106
+ icon: _jsx(SvgNmrResetScale, {}),
107
+ title: 'Reset scale',
108
+ onClick: resetScaleHandler,
109
+ }, {
110
+ icon: _jsx(SvgNmrSameTop, {}),
111
+ title: 'Same top',
112
+ onClick: setSameTopHandler,
113
+ });
114
+ }
115
+ leftButtons = leftButtons.concat([
116
+ {
117
+ component: _jsx(SpectraAutomaticPickingButton, {}),
118
+ },
119
+ {
120
+ icon: _jsx(IoColorPaletteOutline, {}),
121
+ title: 'Recolor spectra',
122
+ onClick: reColorSpectraHandler,
123
+ },
124
+ ]);
125
+ return (_jsx(DefaultPanelHeader, { onDelete: handleDelete, total: data?.length, counter: spectraLengthPerTab, deleteToolTip: "Delete selected spectra", disableDelete: !hasActiveSpectra, onSettingClick: onSettingClick, leftButtons: leftButtons }));
85
126
  }
86
127
  const MemoizedSpectraPanelHeader = memo(SpectraPanelHeaderInner);
87
128
  export default function SpectrumsTabs({ onSettingClick, }) {
@@ -103,5 +103,5 @@ export default function EditLinkModal({ correlationDim1, correlationDim2, link,
103
103
  handleOnEdit,
104
104
  link,
105
105
  ]);
106
- return (_jsxs("div", { css: modalContainer, children: [_jsxs("div", { className: "header handle", children: [_jsx(CloseButton, { onClick: onClose }), _jsx("p", { className: "header-info", children: `${link.experimentType.toUpperCase()} signal at ${getLinkLabel()}` })] }), tabsContainer] }));
106
+ return (_jsxs("div", { css: modalContainer, children: [_jsxs("div", { className: "header handle", children: [_jsx(CloseButton, { title: "Close", onClick: onClose }), _jsx("p", { className: "header-info", children: `${link.experimentType.toUpperCase()} signal at ${getLinkLabel()}` })] }), tabsContainer] }));
107
107
  }
@@ -90,5 +90,5 @@ export default function SetMolecularFormulaModal({ onClose, onSave, molecules, p
90
90
  const onChangeHandlerMoleculeSelection = useCallback((index) => {
91
91
  setCurrentIndex(index);
92
92
  }, []);
93
- return (_jsxs("div", { css: modalContainer, children: [_jsx("div", { className: "header handle", children: _jsx(CloseButton, { onClick: onClose }) }), _jsx("div", { children: _jsx("p", { className: "info", children: "Please type in a molecular formula!" }) }), _jsx(MolecularFormulaInput, { onSave: onSaveHandlerMolecularFormulaInput, previousMF: previousMF }), _jsxs("div", { children: [_jsx("p", { className: "optional", children: "OR" }), _jsx("p", { className: "optional2", children: "Select a molecule as reference!" })] }), _jsx(MoleculeSelection, { molecules: molecules, onChange: onChangeHandlerMoleculeSelection }), _jsx("button", { type: "button", onClick: onSaveHandlerMoleculeSelection, children: "Set" })] }));
93
+ return (_jsxs("div", { css: modalContainer, children: [_jsx("div", { className: "header handle", children: _jsx(CloseButton, { title: "Close", onClick: onClose }) }), _jsx("div", { children: _jsx("p", { className: "info", children: "Please type in a molecular formula!" }) }), _jsx(MolecularFormulaInput, { onSave: onSaveHandlerMolecularFormulaInput, previousMF: previousMF }), _jsxs("div", { children: [_jsx("p", { className: "optional", children: "OR" }), _jsx("p", { className: "optional2", children: "Select a molecule as reference!" })] }), _jsx(MoleculeSelection, { molecules: molecules, onChange: onChangeHandlerMoleculeSelection }), _jsx("button", { type: "button", onClick: onSaveHandlerMoleculeSelection, children: "Set" })] }));
94
94
  }
@@ -95,7 +95,7 @@ export default function SetShiftToleranceModal({ onClose, onSave, previousTolera
95
95
  setIsValid({ ...isValid, [atomType]: false });
96
96
  }
97
97
  }
98
- return (_jsxs("div", { css: modalContainer, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Set Shift Tolerances" }), _jsx(CloseButton, { onClick: onClose })] }), _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Atom" }), _jsx("th", { children: "Value" })] }) }), _jsx("tbody", { children: _jsx(Rows, { onChange: onChangeHandler, isValid: isValid, tolerance: tolerance }) })] }), _jsx("button", { type: "button", onClick: onSaveHandler, disabled: Object.keys(isValid).some((atomType) => !isValid[atomType]), children: "Set" })] }));
98
+ return (_jsxs("div", { css: modalContainer, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Set Shift Tolerances" }), _jsx(CloseButton, { title: "Close", onClick: onClose })] }), _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Atom" }), _jsx("th", { children: "Value" })] }) }), _jsx("tbody", { children: _jsx(Rows, { onChange: onChangeHandler, isValid: isValid, tolerance: tolerance }) })] }), _jsx("button", { type: "button", onClick: onSaveHandler, disabled: Object.keys(isValid).some((atomType) => !isValid[atomType]), children: "Set" })] }));
99
99
  }
100
100
  function Rows({ tolerance, onChange, isValid }) {
101
101
  return Object.keys(tolerance).map((atomType) => {
@@ -4,14 +4,13 @@ import { css } from '@emotion/react';
4
4
  import { getLinkDelta, getLinkDim, } from 'nmr-correlation';
5
5
  import { memo, useCallback, useEffect, useMemo, useState } from 'react';
6
6
  import { FaFlask, FaSlidersH } from 'react-icons/fa';
7
- import { Toolbar } from 'react-science/ui';
8
7
  import { findRange, findSignal1D, findSignal2D, findSpectrum, findZone, } from '../../../data/utilities/FindUtilities';
9
8
  import { useAssignmentData } from '../../assignment/AssignmentsContext';
10
9
  import { useChartData } from '../../context/ChartContext';
11
10
  import { useDispatch } from '../../context/DispatchContext';
12
11
  import Select from '../../elements/Select';
13
12
  import { useModal } from '../../elements/popup/Modal';
14
- import DefaultPanelHeader, { createFilterLabel, } from '../header/DefaultPanelHeader';
13
+ import DefaultPanelHeader from '../header/DefaultPanelHeader';
15
14
  import CorrelationTable from './CorrelationTable/CorrelationTable';
16
15
  import Overview from './Overview';
17
16
  import SetMolecularFormulaModal from './SetMolecularFormulaModal';
@@ -309,22 +308,33 @@ function SummaryPanel() {
309
308
  const handleOnFilter = useCallback(() => {
310
309
  setFilterIsActive(!filterIsActive);
311
310
  }, [filterIsActive]);
312
- const counter = correlationsData ? correlationsData.values.length : 0;
313
- return (_jsxs("div", { css: panelStyle, children: [_jsxs(DefaultPanelHeader, { canDelete: false, counter: counter, counterLabel: createFilterLabel(counter, filterIsActive && filteredCorrelationsData?.values.length), onFilter: handleOnFilter, filterToolTip: filterIsActive
311
+ const total = correlationsData ? correlationsData.values.length : 0;
312
+ return (_jsxs("div", { css: panelStyle, children: [_jsx(DefaultPanelHeader, { total: total, counter: filteredCorrelationsData?.values.length, onFilter: handleOnFilter, filterToolTip: filterIsActive
314
313
  ? 'Show all correlations'
315
- : 'Hide correlations out of view', children: [_jsxs(Toolbar, { children: [_jsx(Toolbar.Item, { icon: _jsx(FaFlask, {}), title: `Set molecular formula (${correlationsData.options.mf})`, onClick: showSetMolecularFormulaModal }), _jsx(Toolbar.Item, { icon: _jsx(FaSlidersH, {}), title: "Set shift tolerance", onClick: showSetShiftToleranceModal })] }), _jsxs("div", { className: "extra-header-content", children: [_jsx("div", { className: "overview-container", children: _jsx(Overview, { correlationsData: correlationsData }) }), _jsx("div", { className: "table-view-selection", children: _jsxs("span", { children: [_jsx("label", { children: "View:" }), _jsx(Select, { onChange: (selection) => {
316
- setSelectedAdditionalColumnsAtomType(selection);
317
- if (selection === 'H-H') {
318
- setShowProtonsAsRows(true);
319
- }
320
- else {
321
- setShowProtonsAsRows(false);
322
- }
323
- }, items: additionalColumnTypes, defaultValue: selectedAdditionalColumnsAtomType, style: {
324
- fontSize: '12px',
325
- width: '70px',
326
- height: '18px',
327
- border: '1px solid grey',
328
- } })] }) })] })] }), _jsx(CorrelationTable, { correlationsData: correlationsData, filteredCorrelationsData: filteredCorrelationsData, additionalColumnData: additionalColumnData, editEquivalencesSaveHandler: editEquivalencesSaveHandler, onSaveEditNumericValues: editNumericValuesSaveHandler, onEditCorrelationTableCellHandler: editCorrelationTableCellHandler, showProtonsAsRows: showProtonsAsRows, spectraData: spectraData })] }));
314
+ : 'Hide correlations out of view', leftButtons: [
315
+ {
316
+ icon: _jsx(FaFlask, {}),
317
+ title: `Set molecular formula (${correlationsData.options.mf})`,
318
+ onClick: showSetMolecularFormulaModal,
319
+ },
320
+ {
321
+ icon: _jsx(FaSlidersH, {}),
322
+ title: 'Set shift tolerance',
323
+ onClick: showSetShiftToleranceModal,
324
+ },
325
+ ], children: _jsxs("div", { className: "extra-header-content", children: [_jsx("div", { className: "overview-container", children: _jsx(Overview, { correlationsData: correlationsData }) }), _jsx("div", { className: "table-view-selection", children: _jsxs("span", { children: [_jsx("label", { children: "View:" }), _jsx(Select, { onChange: (selection) => {
326
+ setSelectedAdditionalColumnsAtomType(selection);
327
+ if (selection === 'H-H') {
328
+ setShowProtonsAsRows(true);
329
+ }
330
+ else {
331
+ setShowProtonsAsRows(false);
332
+ }
333
+ }, items: additionalColumnTypes, defaultValue: selectedAdditionalColumnsAtomType, style: {
334
+ fontSize: '12px',
335
+ width: '70px',
336
+ height: '18px',
337
+ border: '1px solid grey',
338
+ } })] }) })] }) }), _jsx(CorrelationTable, { correlationsData: correlationsData, filteredCorrelationsData: filteredCorrelationsData, additionalColumnData: additionalColumnData, editEquivalencesSaveHandler: editEquivalencesSaveHandler, onSaveEditNumericValues: editNumericValuesSaveHandler, onEditCorrelationTableCellHandler: editCorrelationTableCellHandler, showProtonsAsRows: showProtonsAsRows, spectraData: spectraData })] }));
329
339
  }
330
340
  export default memo(SummaryPanel);
@@ -3,7 +3,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
3
3
  import { css } from '@emotion/react';
4
4
  import { useState, useMemo, useCallback, useRef, memo } from 'react';
5
5
  import { FaUnlink } from 'react-icons/fa';
6
- import { Toolbar } from 'react-science/ui';
7
6
  import { useAssignmentData } from '../../assignment/AssignmentsContext';
8
7
  import { useChartData } from '../../context/ChartContext';
9
8
  import { useDispatch } from '../../context/DispatchContext';
@@ -11,7 +10,7 @@ import { useModal } from '../../elements/popup/Modal';
11
10
  import { useActiveSpectrumZonesViewState } from '../../hooks/useActiveSpectrumZonesViewState';
12
11
  import useSpectrum from '../../hooks/useSpectrum';
13
12
  import { tablePanelStyle } from '../extra/BasicPanelStyle';
14
- import DefaultPanelHeader, { createFilterLabel, } from '../header/DefaultPanelHeader';
13
+ import DefaultPanelHeader from '../header/DefaultPanelHeader';
15
14
  import PreferencesHeader from '../header/PreferencesHeader';
16
15
  import ZonesPreferences from './ZonesPreferences';
17
16
  import ZonesTable from './ZonesTable';
@@ -116,7 +115,7 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, info, showZones,
116
115
  payload: { key: 'showPeaks' },
117
116
  });
118
117
  };
119
- const counter = zones?.values?.length || 0;
118
+ const total = zones?.values?.length || 0;
120
119
  return (_jsxs("div", { css: [
121
120
  tablePanelStyle,
122
121
  isFlipped &&
@@ -125,7 +124,32 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, info, showZones,
125
124
  position: relative;
126
125
  }
127
126
  `,
128
- ], children: [!isFlipped && (_jsx(DefaultPanelHeader, { counter: counter, counterLabel: 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: _jsxs(Toolbar, { children: [_jsx(Toolbar.Item, { disabled: !zones.values || zones.values.length === 0, icon: _jsx(FaUnlink, {}), title: "Remove all assignments", onClick: handleOnRemoveAssignments }), _jsx(Toolbar.Item, { icon: _jsx("span", { children: "z" }), title: "Show/Hide zones", active: showZones, onClick: handleSetShowZones }), _jsx(Toolbar.Item, { icon: _jsx("span", { children: "s" }), title: "Show/Hide signals", active: showSignals, onClick: handleSetShowSignals }), _jsx(Toolbar.Item, { icon: _jsx("span", { children: "p" }), title: "Show/Hide peaks", active: showPeaks, onClick: handleSetShowPeaks })] }) })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx("div", { className: "table-container", children: _jsx(ZonesTable, { tableData: tableData, onUnlink: unlinkZoneHandler, nucleus: activeTab, info: info }) })) : (_jsx(ZonesPreferences, { ref: settingRef })) })] }));
127
+ ], children: [!isFlipped && (_jsx(DefaultPanelHeader, { total: total, counter: tableData?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Zones", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all zones' : 'Hide zones out of view', onSettingClick: settingsPanelHandler, leftButtons: [
128
+ {
129
+ disabled: !zones.values || zones.values.length === 0,
130
+ icon: _jsx(FaUnlink, {}),
131
+ title: 'Remove all assignments',
132
+ onClick: handleOnRemoveAssignments,
133
+ },
134
+ {
135
+ icon: _jsx("span", { children: "z" }),
136
+ title: 'Show/Hide zones',
137
+ active: showZones,
138
+ onClick: handleSetShowZones,
139
+ },
140
+ {
141
+ icon: _jsx("span", { children: "s" }),
142
+ title: 'Show/Hide signals',
143
+ active: showSignals,
144
+ onClick: handleSetShowSignals,
145
+ },
146
+ {
147
+ icon: _jsx("span", { children: "p" }),
148
+ title: 'Show/Hide peaks',
149
+ active: showPeaks,
150
+ onClick: handleSetShowPeaks,
151
+ },
152
+ ] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx("div", { className: "table-container", children: _jsx(ZonesTable, { tableData: tableData, onUnlink: unlinkZoneHandler, nucleus: activeTab, info: info }) })) : (_jsx(ZonesPreferences, { ref: settingRef })) })] }));
129
153
  }
130
154
  const MemoizedZonesPanel = memo(ZonesPanelInner);
131
155
  const emptyData = { zones: {}, info: {} };
@@ -1,4 +1,4 @@
1
- import { ToolBarButtonProps } from '../../elements/ToolBarButton';
1
+ import { ToolbarItemProps } from 'react-science/ui';
2
2
  import { DataBaseSearchResultEntry, DatabaseSearchKeywords, Databases } from './DatabasePanel';
3
3
  interface DatabaseSearchOptionsProps {
4
4
  databases: Databases;
@@ -8,8 +8,8 @@ interface DatabaseSearchOptionsProps {
8
8
  idCode?: string;
9
9
  total: number;
10
10
  onKeywordsChange: (k: Partial<DatabaseSearchKeywords>) => void;
11
- onSettingClick: ToolBarButtonProps['onClick'];
12
- onStructureClick: ToolBarButtonProps['onClick'];
11
+ onSettingClick: ToolbarItemProps['onClick'];
12
+ onStructureClick: ToolbarItemProps['onClick'];
13
13
  onDatabaseChange: (databaseKey: string) => void;
14
14
  }
15
15
  export declare function DatabaseSearchOptions({ databases, defaultDatabase, keywords, result, idCode, total, onKeywordsChange, onSettingClick, onStructureClick, onDatabaseChange, }: DatabaseSearchOptionsProps): import("react/jsx-runtime").JSX.Element;
@@ -9,10 +9,10 @@ import { CounterLabel } from '../../elements/CounterLabel';
9
9
  import Input from '../../elements/Input';
10
10
  import { PreferencesButton } from '../../elements/PreferencesButton';
11
11
  import Select from '../../elements/Select';
12
- import { ToolBarButton, } from '../../elements/ToolBarButton';
12
+ import { ToolBarButton } from '../../elements/ToolBarButton';
13
13
  import useToolsFunctions from '../../hooks/useToolsFunctions';
14
14
  import { options } from '../../toolbar/ToolTypes';
15
- import { createFilterLabel } from '../header/DefaultPanelHeader';
15
+ import { formatCounterLabel } from '../header/DefaultPanelHeader';
16
16
  import PanelHeader from '../header/PanelHeader';
17
17
  export function DatabaseSearchOptions({ databases, defaultDatabase, keywords, result, idCode, total, onKeywordsChange, onSettingClick, onStructureClick, onDatabaseChange, }) {
18
18
  const { handleChangeOption } = useToolsFunctions();
@@ -43,10 +43,10 @@ export function DatabaseSearchOptions({ databases, defaultDatabase, keywords, re
43
43
  display: 'flex',
44
44
  justifyContent: 'space-between',
45
45
  paddingBottom: '2px',
46
- }, children: [_jsx(ToolBarButton, { title: `${showSimilarityTree ? 'Hide' : 'Show'} similarity tree`, icon: _jsx(TbBinaryTree, {}), active: showSimilarityTree, onClick: handleShowSimilarityTree, style: { marginRight: '5px' } }), _jsx(Select, { style: { flex: 6 }, items: databases, itemTextField: "label", itemValueField: "key", onChange: onDatabaseChange, placeholder: "Select database", defaultValue: defaultDatabase }), _jsx(Select, { style: { flex: 4, margin: '0px 5px' }, items: result.solvents, placeholder: "Solvent", onChange: handleSearch, value: keywords.solvent }), _jsxs("div", { style: {
46
+ }, children: [_jsx(ToolBarButton, { title: `${showSimilarityTree ? 'Hide' : 'Show'} similarity tree`, icon: _jsx(TbBinaryTree, {}), active: showSimilarityTree, onClick: handleShowSimilarityTree }), _jsx(Select, { style: { flex: 6, marginLeft: '5px' }, items: databases, itemTextField: "label", itemValueField: "key", onChange: onDatabaseChange, placeholder: "Select database", defaultValue: defaultDatabase }), _jsx(Select, { style: { flex: 4, margin: '0px 5px' }, items: result.solvents, placeholder: "Solvent", onChange: handleSearch, value: keywords.solvent }), _jsxs("div", { style: {
47
47
  display: 'flex',
48
48
  alignItems: 'center',
49
49
  flex: 2,
50
50
  justifyContent: 'flex-end',
51
- }, children: [_jsx(CounterLabel, { children: createFilterLabel(total || 0, result.data.length) }), _jsx(PreferencesButton, { onClick: onSettingClick })] })] }), _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [_jsx(ToolBarButton, { title: "Filter by select ranges", icon: _jsx(FaICursor, {}), active: selectedTool === options.databaseRangesSelection.id, onClick: enableFilterHandler, style: { marginRight: '5px' } }), _jsx(Input, { value: keywords.searchKeywords, renderIcon: () => _jsx(IoSearchOutline, {}), style: { inputWrapper: { flex: 3 } }, className: "search-input", type: "text", debounceTime: 250, placeholder: "Search for parameter...", onChange: handleSearch, onClear: clearHandler, canClear: true }), _jsx(ToolBarButton, { title: "Search by stricture", icon: !idCode ? _jsx(BsHexagon, {}) : _jsx(BsHexagonFill, {}), intent: "success", active: !!idCode, onClick: onStructureClick, style: { marginLeft: '5px' } })] })] }));
51
+ }, children: [_jsx(CounterLabel, { value: formatCounterLabel(total || 0, result.data.length) }), _jsx(PreferencesButton, { title: "Preferences", onClick: onSettingClick })] })] }), _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [_jsx(ToolBarButton, { title: "Filter by select ranges", icon: _jsx(FaICursor, {}), active: selectedTool === options.databaseRangesSelection.id, onClick: enableFilterHandler }), _jsx(Input, { value: keywords.searchKeywords, renderIcon: () => _jsx(IoSearchOutline, {}), style: { inputWrapper: { flex: 3, margin: '0 5px' } }, className: "search-input", type: "text", debounceTime: 250, placeholder: "Search for parameter...", onChange: handleSearch, onClear: clearHandler, canClear: true }), _jsx(ToolBarButton, { title: "Search by stricture", icon: !idCode ? _jsx(BsHexagon, {}) : _jsx(BsHexagonFill, {}), intent: "success", active: !!idCode, onClick: onStructureClick })] })] }));
52
52
  }
@@ -26,5 +26,5 @@ export default function FiltersPanel() {
26
26
  buttons,
27
27
  });
28
28
  }
29
- return (_jsxs("div", { css: tablePanelStyle, children: [_jsx(DefaultPanelHeader, { showSettingButton: false, deleteToolTip: "Delete all filters", onDelete: handelDeleteFilter }), _jsx("div", { className: "inner-container", children: _jsx(FiltersTable, {}) })] }));
29
+ return (_jsxs("div", { css: tablePanelStyle, children: [_jsx(DefaultPanelHeader, { deleteToolTip: "Delete all filters", onDelete: handelDeleteFilter }), _jsx("div", { className: "inner-container", children: _jsx(FiltersTable, {}) })] }));
30
30
  }
@@ -1,20 +1,24 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
+ import { ToolbarItemProps as BaseToolbarItemProps } from 'react-science/ui';
3
+ interface CustomToolbarItemProps {
4
+ component: ReactNode;
5
+ }
6
+ export type ToolbarItemProps = BaseToolbarItemProps | CustomToolbarItemProps;
2
7
  interface DefaultPanelHeaderProps {
8
+ total?: number;
3
9
  counter?: number;
4
- counterLabel?: string;
5
10
  deleteToolTip?: string;
6
11
  filterToolTip?: string;
7
12
  onDelete?: () => void;
8
13
  onFilter?: () => void;
9
14
  onSettingClick?: () => void;
10
- canDelete?: boolean;
11
15
  disableDelete?: boolean;
12
- showSettingButton?: boolean;
13
16
  children?: ReactNode;
14
17
  style?: CSSProperties;
15
18
  className?: string;
16
- renderRightButtons?: () => ReactNode;
19
+ leftButtons?: ToolbarItemProps[];
20
+ rightButtons?: ToolbarItemProps[];
17
21
  }
18
- export declare function createFilterLabel(total: number, counter: number | false): string;
19
- declare function DefaultPanelHeader({ counter, counterLabel, onDelete, deleteToolTip, onFilter, filterToolTip, children, onSettingClick, showSettingButton, canDelete, disableDelete, style, className, renderRightButtons, }: DefaultPanelHeaderProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function formatCounterLabel(counter?: number, total?: number): string;
23
+ declare function DefaultPanelHeader(props: DefaultPanelHeaderProps): import("react/jsx-runtime").JSX.Element;
20
24
  export default DefaultPanelHeader;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
2
+ import { Fragment, useState } from 'react';
3
+ import { FaFilter, FaRegTrashAlt } from 'react-icons/fa';
4
+ import { Toolbar, } from 'react-science/ui';
3
5
  import { CounterLabel } from '../../elements/CounterLabel';
4
- import { DeleteButton } from '../../elements/DeleteButton';
5
- import { FilterButton } from '../../elements/FilterButton';
6
6
  import { PreferencesButton } from '../../elements/PreferencesButton';
7
7
  import PanelHeader from './PanelHeader';
8
8
  const styles = {
@@ -12,18 +12,34 @@ const styles = {
12
12
  flex: 1,
13
13
  },
14
14
  };
15
- export function createFilterLabel(total, counter) {
16
- if (typeof counter === 'boolean') {
17
- return `[ ${total || 0} ]`;
15
+ function isCustomToolbarItem(item) {
16
+ return 'component' in item;
17
+ }
18
+ export function formatCounterLabel(counter, total) {
19
+ if (counter !== undefined &&
20
+ total !== undefined &&
21
+ counter >= 0 &&
22
+ total >= 0 &&
23
+ counter !== total) {
24
+ return `[ ${counter}/${total} ]`;
25
+ }
26
+ if (total !== undefined) {
27
+ return `[ ${total} ]`;
18
28
  }
19
- return `[ ${counter}/${total} ]`;
29
+ return '';
20
30
  }
21
- function DefaultPanelHeader({ counter, counterLabel, onDelete = () => null, deleteToolTip = 'Delete', onFilter = () => null, filterToolTip = '', children, onSettingClick = () => null, showSettingButton = false, canDelete = true, disableDelete = false, style = {}, className = '', renderRightButtons, }) {
31
+ function DefaultPanelHeader(props) {
32
+ const { total, counter, onDelete, deleteToolTip = 'Delete', onFilter, filterToolTip = '', children, onSettingClick, disableDelete = false, style = {}, className = '', rightButtons = [], leftButtons = [], } = props;
22
33
  const [isFiltered, setFilterStatus] = useState(false);
23
34
  function handleFilter() {
24
35
  setFilterStatus((previousValue) => !previousValue);
25
- onFilter();
36
+ onFilter?.();
26
37
  }
27
- return (_jsxs(PanelHeader, { style, className, children: [_jsxs("div", { style: styles.leftContainer, children: [canDelete && (_jsx(DeleteButton, { disabled: counter === 0 || disableDelete, title: deleteToolTip, onClick: onDelete })), filterToolTip && (_jsx(FilterButton, { onClick: handleFilter, active: isFiltered, title: filterToolTip })), children] }), renderRightButtons?.(), counterLabel && _jsx(CounterLabel, { children: counterLabel }), showSettingButton && _jsx(PreferencesButton, { onClick: onSettingClick })] }));
38
+ return (_jsxs(PanelHeader, { style, className, children: [_jsxs("div", { style: styles.leftContainer, children: [_jsxs(Toolbar, { children: [onDelete && (_jsx(Toolbar.Item, { id: "delete-button", onClick: onDelete, title: deleteToolTip, icon: _jsx(FaRegTrashAlt, {}), intent: "danger", disabled: !total || disableDelete })), onFilter && (_jsx(Toolbar.Item, { id: "filter-button", onClick: handleFilter, title: filterToolTip, active: isFiltered, icon: _jsx(FaFilter, {}) })), mapToolbarButtons(leftButtons)] }), children] }), _jsx(Toolbar, { children: mapToolbarButtons(rightButtons) }), _jsx(CounterLabel, { value: formatCounterLabel(counter, total) }), onSettingClick && (_jsx(PreferencesButton, { title: "Preferences", onClick: onSettingClick }))] }));
39
+ }
40
+ function mapToolbarButtons(buttons) {
41
+ return buttons.map((props, index) => isCustomToolbarItem(props) ? (
42
+ // eslint-disable-next-line react/no-array-index-key
43
+ _jsx(Fragment, { children: props.component }, `${index}`)) : (_jsx(Toolbar.Item, { ...props }, props.title)));
28
44
  }
29
45
  export default DefaultPanelHeader;
@@ -1,11 +1,10 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
4
  import { SvgNmrOverlay } from 'cheminfo-font';
5
5
  import { useCallback, useState, useRef, memo } from 'react';
6
6
  import { FaChartBar, FaFileExport } from 'react-icons/fa';
7
7
  import { IoPulseOutline } from 'react-icons/io5';
8
- import { Toolbar } from 'react-science/ui';
9
8
  import { useToggle } from 'react-use';
10
9
  import { getDataAsString, generateAnalyzeSpectra, } from '../../../data/data1d/multipleSpectraAnalysis';
11
10
  import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardComponents';
@@ -15,6 +14,7 @@ import { useDispatch } from '../../context/DispatchContext';
15
14
  import { useAlert } from '../../elements/popup/Alert';
16
15
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
17
16
  import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
17
+ import { booleanToString } from '../../utility/booleanToString';
18
18
  import { tablePanelStyle } from '../extra/BasicPanelStyle';
19
19
  import DefaultPanelHeader from '../header/DefaultPanelHeader';
20
20
  import PreferencesHeader from '../header/PreferencesHeader';
@@ -58,6 +58,35 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, dis
58
58
  return !value;
59
59
  });
60
60
  }
61
+ let lefButtons = [
62
+ {
63
+ icon: _jsx(FaFileExport, {}),
64
+ title: 'Copy To Clipboard',
65
+ onClick: copyToClipboardHandler,
66
+ },
67
+ ];
68
+ if (displayerMode === '1D') {
69
+ lefButtons = lefButtons.concat([
70
+ {
71
+ icon: _jsx(SvgNmrOverlay, {}),
72
+ title: 'Spectra calibration',
73
+ onClick: handleSpectraCalibration,
74
+ active: calibration,
75
+ },
76
+ {
77
+ icon: _jsx(IoPulseOutline, {}),
78
+ title: 'Y spectra tracker',
79
+ onClick: showTrackerHandler,
80
+ active: showLegend,
81
+ },
82
+ {
83
+ icon: _jsx(FaChartBar, {}),
84
+ title: `${booleanToString(!showAnalysisChart)} analysis chart`,
85
+ onClick: toggleAnalysisChart,
86
+ active: showAnalysisChart,
87
+ },
88
+ ]);
89
+ }
61
90
  return (_jsxs("div", { css: [
62
91
  tablePanelStyle,
63
92
  isFlipped &&
@@ -66,7 +95,7 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, dis
66
95
  position: relative;
67
96
  }
68
97
  `,
69
- ], children: [!isFlipped && (_jsx(DefaultPanelHeader, { deleteToolTip: "Delete All Peaks", showSettingButton: true, canDelete: false, onSettingClick: settingsPanelHandler, children: _jsxs(Toolbar, { children: [_jsx(Toolbar.Item, { icon: _jsx(FaFileExport, {}), title: "Copy To Clipboard", onClick: copyToClipboardHandler }), displayerMode === '1D' && (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { icon: _jsx(SvgNmrOverlay, {}), title: "Spectra calibration", onClick: handleSpectraCalibration, active: calibration }), _jsx(Toolbar.Item, { icon: _jsx(IoPulseOutline, {}), title: "Y spectra tracker", onClick: showTrackerHandler, active: showLegend }), _jsx(Toolbar.Item, { icon: _jsx(FaChartBar, {}), title: `${!showAnalysisChart ? 'Show' : 'Hide'} analysis chart`, onClick: toggleAnalysisChart, active: showAnalysisChart })] }))] }) })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: isFlipped ? (_jsx(MultipleSpectraAnalysisPreferences, { data: spectraAnalysis, activeTab: activeTab, onAfterSave: afterSaveHandler, ref: settingRef })) : calibration ? (_jsx(AlignSpectra, { nucleus: activeTab, onClose: () => setCalibration(false) })) : (_jsxs("div", { style: { overflow: 'auto', maxHeight: '100%' }, children: [showAnalysisChart && (_jsx(AnalysisChart, { spectraAnalysisData: spectraAnalysis })), _jsx(MultipleSpectraAnalysisTable, { data: spectraAnalysis, resortSpectra: preferences.analysisOptions.resortSpectra, activeTab: activeTab })] })) }), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Spectra Analysis" })] }));
98
+ ], children: [!isFlipped && (_jsx(DefaultPanelHeader, { deleteToolTip: "Delete All Peaks", onSettingClick: settingsPanelHandler, leftButtons: lefButtons })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: isFlipped ? (_jsx(MultipleSpectraAnalysisPreferences, { data: spectraAnalysis, activeTab: activeTab, onAfterSave: afterSaveHandler, ref: settingRef })) : calibration ? (_jsx(AlignSpectra, { nucleus: activeTab, onClose: () => setCalibration(false) })) : (_jsxs("div", { style: { overflow: 'auto', maxHeight: '100%' }, children: [showAnalysisChart && (_jsx(AnalysisChart, { spectraAnalysisData: spectraAnalysis })), _jsx(MultipleSpectraAnalysisTable, { data: spectraAnalysis, resortSpectra: preferences.analysisOptions.resortSpectra, activeTab: activeTab })] })) }), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Spectra Analysis" })] }));
70
99
  }
71
100
  const MemoizedMultipleSpectraAnalysisPanel = memo(MultipleSpectraAnalysisPanelInner);
72
101
  export default function MultipleSpectraAnalysisPanel() {
@@ -90,7 +90,11 @@ export default function SpectrumSimulation() {
90
90
  }
91
91
  }
92
92
  `,
93
- ], children: [!isFlipped && (_jsxs(DefaultPanelHeader, { showSettingButton: true, onSettingClick: settingsPanelHandler, canDelete: false, children: [_jsx(AboutSpectrumSimulationModal, {}), _jsx(SpectrumSimulationSimpleOptions, { onSpinSystemChange: spinSystemChangeHandler, spinSystem: spinSystem })] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsxs("div", { style: {
93
+ ], children: [!isFlipped && (_jsx(DefaultPanelHeader, { onSettingClick: settingsPanelHandler, leftButtons: [
94
+ {
95
+ component: _jsx(AboutSpectrumSimulationModal, {}),
96
+ },
97
+ ], children: _jsx(SpectrumSimulationSimpleOptions, { onSpinSystemChange: spinSystemChangeHandler, spinSystem: spinSystem }) })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsxs("div", { style: {
94
98
  display: 'flex',
95
99
  flexDirection: 'column',
96
100
  height: '100%',
@@ -2,9 +2,9 @@ import { Draft } from 'immer';
2
2
  import { IntegralsViewState } from 'nmr-load-save';
3
3
  import { Integral } from 'nmr-processing';
4
4
  import { SetSumOptions } from '../../../data/data1d/Spectrum1D/SumManager';
5
+ import { FilterType } from '../../utility/filterType';
5
6
  import { State } from '../Reducer';
6
7
  import { ActionType } from '../types/ActionType';
7
- import { FilterType } from '../../utility/filterType';
8
8
  type ChangeIntegralSumAction = ActionType<'CHANGE_INTEGRAL_SUM', {
9
9
  options: SetSumOptions;
10
10
  }>;