nmrium 0.56.0 → 0.57.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.
- package/lib/component/1d/ExclusionZoneAnnotation.d.ts +0 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +14 -19
- package/lib/component/1d/jCouplingGraph/JGraphContext.d.ts +0 -1
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts +0 -1
- package/lib/component/1d/peaks/PeakEditionManager.js +16 -10
- package/lib/component/1d/utilities/getDecimalsCount.js +1 -1
- package/lib/component/1d/utilities/intersectionResolver.js +1 -1
- package/lib/component/1d-2d/FieldEdition.d.ts +3 -1
- package/lib/component/1d-2d/FieldEdition.js +26 -10
- package/lib/component/2d/1d-tracer/Left1DChart.d.ts +0 -1
- package/lib/component/2d/1d-tracer/Top1DChart.d.ts +0 -1
- package/lib/component/2d/XAxis.d.ts +0 -1
- package/lib/component/2d/YAxis.d.ts +0 -1
- package/lib/component/2d/ft/Contours.js +7 -7
- package/lib/component/assignment/AssignmentsContext.d.ts +0 -1
- package/lib/component/context/ChartContext.d.ts +0 -1
- package/lib/component/context/DispatchContext.d.ts +0 -1
- package/lib/component/context/GlobalContext.d.ts +0 -1
- package/lib/component/context/KeyModifierContext.js +1 -1
- package/lib/component/context/LoaderContext.d.ts +0 -1
- package/lib/component/context/PreferencesContext.d.ts +0 -1
- package/lib/component/context/ScaleContext.d.ts +0 -1
- package/lib/component/elements/ActionButtons.d.ts +1 -0
- package/lib/component/elements/ActionButtons.js +4 -4
- package/lib/component/elements/ColorInput.d.ts +0 -1
- package/lib/component/elements/ColorPickerDropdownController.d.ts +2 -0
- package/lib/component/elements/ColorPickerDropdownController.js +8 -0
- package/lib/component/elements/ColumnWrapper.d.ts +0 -1
- package/lib/component/elements/ContextMenu.d.ts +0 -1
- package/lib/component/elements/Input.d.ts +1 -0
- package/lib/component/elements/Input.js +2 -1
- package/lib/component/elements/Input2.d.ts +13 -0
- package/lib/component/elements/Input2.js +118 -0
- package/lib/component/elements/Input2Controller.d.ts +12 -0
- package/lib/component/elements/Input2Controller.js +22 -0
- package/lib/component/elements/MoleculeSelection.js +1 -1
- package/lib/component/elements/NumberInput.js +1 -1
- package/lib/component/elements/NumberInput2.d.ts +12 -0
- package/lib/component/elements/NumberInput2.js +65 -0
- package/lib/component/elements/NumberInput2Controller.d.ts +8 -0
- package/lib/component/elements/NumberInput2Controller.js +15 -0
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +3 -3
- package/lib/component/elements/ReactTable/Style.d.ts +3 -1
- package/lib/component/elements/ReactTable/Style.js +11 -1
- package/lib/component/elements/ReactTable/utility/ReactTableContext.d.ts +0 -1
- package/lib/component/elements/Select2.d.ts +26 -0
- package/lib/component/elements/Select2.js +25 -0
- package/lib/component/elements/Select2Controller.d.ts +7 -0
- package/lib/component/elements/Select2Controller.js +12 -0
- package/lib/component/elements/draggable/useDraggable.d.ts +0 -1
- package/lib/component/elements/dropDownButton/DropDownButton.d.ts +2 -4
- package/lib/component/elements/dropDownButton/DropDownButton.js +11 -37
- package/lib/component/elements/dropDownButton/DropDownList.js +3 -32
- package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput2.d.ts +11 -0
- package/lib/component/elements/formik/FormikInput2.js +26 -0
- package/lib/component/elements/formik/FormikOnChange.d.ts +0 -1
- package/lib/component/elements/popup/Modal/Context.d.ts +0 -1
- package/lib/component/elements/popup/Modal/ModalContent.d.ts +0 -1
- package/lib/component/elements/resizer/SVGResizer.d.ts +0 -1
- package/lib/component/elements/useFormValidateField.d.ts +1 -0
- package/lib/component/elements/useFormValidateField.js +9 -0
- package/lib/component/header/ApodizationOptionsPanel.js +26 -11
- package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +1 -4
- package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -16
- package/lib/component/header/BaseLineCorrectionPanel.js +49 -27
- package/lib/component/header/Header.js +1 -1
- package/lib/component/header/PhaseCorrectionPanel.js +12 -24
- package/lib/component/header/RangesPickingOptionPanel.js +12 -12
- package/lib/component/header/ZeroFillingOptionsPanel.js +18 -7
- package/lib/component/header/Zones2DOptionPanel.js +19 -18
- package/lib/component/hooks/useWorkspaceAction.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/SignalTab.d.ts +0 -1
- package/lib/component/modal/editRange/forms/components/SignalsContent.d.ts +0 -1
- package/lib/component/modal/setting/GeneralSettings.d.ts +5 -1
- package/lib/component/modal/setting/GeneralSettings.js +107 -111
- package/lib/component/modal/setting/WorkspaceItem.js +4 -9
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +95 -59
- package/lib/component/modal/setting/settings-tabs/DisplayTabContent.js +33 -25
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +15 -4
- package/lib/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +56 -39
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +36 -36
- package/lib/component/modal/setting/settings-tabs/NucleiTabContent.js +44 -36
- package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +16 -11
- package/lib/component/modal/setting/settings-tabs/SpectraColorsTabContent.js +47 -40
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +50 -40
- package/lib/component/modal/setting/settingsValidation.js +8 -34
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +0 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +0 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.d.ts +0 -1
- package/lib/component/panels/Panels.js +31 -8
- package/lib/component/panels/PeaksPanel/PeaksPreferences.d.ts +0 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +0 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +0 -1
- package/lib/component/panels/SpectraPanel/SpectraPreferences.d.ts +0 -1
- package/lib/component/panels/SpectraPanel/SpectraPreferences.js +32 -24
- package/lib/component/panels/SpectraPanel/SpectraTable.js +17 -2
- package/lib/component/panels/SpectraPanel/SpectrumListPanel.d.ts +0 -1
- package/lib/component/panels/SpectraPanel/base/ColorIndicator.d.ts +0 -1
- package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.d.ts +3 -3
- package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js +25 -16
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DHistogram.d.ts +0 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.js +15 -5
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DHistogram.d.ts +0 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.js +44 -6
- package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.d.ts +0 -1
- package/lib/component/panels/SummaryPanel/Overview.d.ts +0 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts +0 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPreferences.d.ts +0 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +17 -3
- package/lib/component/panels/databasePanel/DatabasePreferences.d.ts +0 -1
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +11 -4
- package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib/component/panels/informationPanel/InformationEditionModal.d.ts +6 -0
- package/lib/component/panels/informationPanel/InformationEditionModal.js +105 -0
- package/lib/component/panels/informationPanel/InformationPanel.d.ts +1 -0
- package/lib/component/panels/{InformationPanel.js → informationPanel/InformationPanel.js} +2 -2
- package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.d.ts +0 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/index.d.ts +0 -1
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +0 -1
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +1 -1
- package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +0 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.d.ts +0 -1
- package/lib/component/reducer/Reducer.d.ts +1 -1
- package/lib/component/reducer/Reducer.js +2 -0
- package/lib/component/reducer/actions/DatabaseActions.js +22 -5
- package/lib/component/reducer/actions/SpectraActions.d.ts +8 -2
- package/lib/component/reducer/actions/SpectraActions.js +58 -21
- package/lib/component/reducer/actions/ToolsActions.js +3 -4
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +7 -7
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +2 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/utility/checkUniqueByKey.d.ts +2 -0
- package/lib/component/utility/checkUniqueByKey.js +40 -0
- package/lib/component/utility/colorToHexWithAlpha.d.ts +9 -0
- package/lib/component/utility/colorToHexWithAlpha.js +4 -0
- package/lib/component/workspaces/exercise.js +2 -0
- package/lib/component/workspaces/process1D.js +0 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
- package/lib/data/PredictionManager.js +3 -5
- package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +13 -13
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +9 -9
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +13 -13
- package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +13 -13
- package/lib/data/data1d/database.d.ts +1 -0
- package/lib/data/data1d/database.js +4 -2
- package/lib/data/data2d/Spectrum2D/contours.d.ts +8 -22
- package/lib/data/data2d/Spectrum2D/contours.js +88 -67
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +4 -2
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +20 -20
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +20 -20
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/initiateFilters.d.ts +1 -1
- package/lib/data/matrixGeneration.js +1 -2
- package/lib/data/types/common/Keys.d.ts +3 -0
- package/lib/data/types/common/Keys.js +1 -0
- package/lib/data/utilities/generateNumbersPowerOfX.d.ts +2 -2
- package/lib/versionInfo.js +1 -1
- package/package.json +32 -31
- package/lib/component/elements/formik/FormikSlider.d.ts +0 -6
- package/lib/component/elements/formik/FormikSlider.js +0 -15
- package/lib/component/panels/InformationPanel.d.ts +0 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Checkbox } from '@blueprintjs/core';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { Controller, useFormContext } from 'react-hook-form';
|
|
3
5
|
import { GroupPane } from '../../../elements/GroupPane';
|
|
6
|
+
import { Input2Controller } from '../../../elements/Input2Controller';
|
|
4
7
|
import ReactTable from '../../../elements/ReactTable/ReactTable';
|
|
5
|
-
import
|
|
6
|
-
import FormikSelect from '../../../elements/formik/FormikSelect';
|
|
8
|
+
import { Select2 } from '../../../elements/Select2';
|
|
7
9
|
const DataSelectionOptions = [
|
|
8
10
|
{ label: 'FT', value: 'ft' },
|
|
9
11
|
{ label: 'FID', value: 'fid' },
|
|
@@ -14,22 +16,22 @@ const DataSelectionOptions = [
|
|
|
14
16
|
const GENERAL_LIST = [
|
|
15
17
|
{
|
|
16
18
|
label: 'Keep 1D',
|
|
17
|
-
name: 'general.keep1D',
|
|
19
|
+
name: 'nmrLoaders.general.keep1D',
|
|
18
20
|
fieldType: 'checkbox',
|
|
19
21
|
},
|
|
20
22
|
{
|
|
21
23
|
label: 'Keep 2D',
|
|
22
|
-
name: 'general.keep2D',
|
|
24
|
+
name: 'nmrLoaders.general.keep2D',
|
|
23
25
|
fieldType: 'checkbox',
|
|
24
26
|
},
|
|
25
27
|
{
|
|
26
28
|
label: 'Only Real',
|
|
27
|
-
name: 'general.onlyReal',
|
|
29
|
+
name: 'nmrLoaders.general.onlyReal',
|
|
28
30
|
fieldType: 'checkbox',
|
|
29
31
|
},
|
|
30
32
|
{
|
|
31
33
|
label: 'Data Selection',
|
|
32
|
-
name: 'general.dataSelection',
|
|
34
|
+
name: 'nmrLoaders.general.dataSelection',
|
|
33
35
|
fieldType: 'select',
|
|
34
36
|
options: DataSelectionOptions,
|
|
35
37
|
},
|
|
@@ -37,49 +39,64 @@ const GENERAL_LIST = [
|
|
|
37
39
|
const BRUKER_LIST = [
|
|
38
40
|
{
|
|
39
41
|
label: 'Processing Numbers',
|
|
40
|
-
name: 'bruker.processingNumbers',
|
|
42
|
+
name: 'nmrLoaders.bruker.processingNumbers',
|
|
41
43
|
fieldType: 'input',
|
|
42
44
|
},
|
|
43
45
|
{
|
|
44
46
|
label: 'Experiment Numbers',
|
|
45
|
-
name: 'bruker.experimentNumbers',
|
|
47
|
+
name: 'nmrLoaders.bruker.experimentNumbers',
|
|
46
48
|
fieldType: 'input',
|
|
47
49
|
},
|
|
48
50
|
{
|
|
49
51
|
label: 'Only First Processed Data',
|
|
50
|
-
name: 'bruker.onlyFirstProcessedData',
|
|
52
|
+
name: 'nmrLoaders.bruker.onlyFirstProcessedData',
|
|
51
53
|
fieldType: 'checkbox',
|
|
52
54
|
},
|
|
53
55
|
];
|
|
54
|
-
const COLUMNS = [
|
|
55
|
-
{
|
|
56
|
-
Header: '#',
|
|
57
|
-
style: { width: '10px' },
|
|
58
|
-
accessor: (_, index) => index + 1,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
Header: 'Feature',
|
|
62
|
-
accessor: 'label',
|
|
63
|
-
style: { width: '70%' },
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
Header: ' ',
|
|
67
|
-
Cell: ({ row }) => {
|
|
68
|
-
const fieldType = row.original.fieldType;
|
|
69
|
-
switch (fieldType) {
|
|
70
|
-
case 'checkbox':
|
|
71
|
-
return (_jsx(CheckBoxCell, { name: `nmrLoaders.${row.original.name}`, defaultValue: false }));
|
|
72
|
-
case 'input':
|
|
73
|
-
return (_jsx(FormikInput, { name: `nmrLoaders.${row.original.name}`, type: "string", style: { input: { width: '100%', padding: 0 } } }));
|
|
74
|
-
case 'select':
|
|
75
|
-
return (_jsx(FormikSelect, { name: `nmrLoaders.${row.original.name}`, style: { width: '100%' }, items: row.original.options }));
|
|
76
|
-
default:
|
|
77
|
-
return _jsx("span", {});
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
];
|
|
82
56
|
function ImportationFiltersTabContent() {
|
|
83
|
-
|
|
57
|
+
const { register, control } = useFormContext();
|
|
58
|
+
const COLUMNS = useMemo(() => [
|
|
59
|
+
{
|
|
60
|
+
Header: '#',
|
|
61
|
+
style: { width: '10px' },
|
|
62
|
+
accessor: (_, index) => index + 1,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
Header: 'Feature',
|
|
66
|
+
accessor: 'label',
|
|
67
|
+
style: { width: '70%' },
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
Header: ' ',
|
|
71
|
+
style: { textAlign: 'center' },
|
|
72
|
+
Cell: ({ row }) => {
|
|
73
|
+
const fieldType = row.original.fieldType;
|
|
74
|
+
const name = row.original.name;
|
|
75
|
+
switch (fieldType) {
|
|
76
|
+
case 'checkbox':
|
|
77
|
+
return _jsx(Checkbox, { style: { margin: 0 }, ...register(name) });
|
|
78
|
+
case 'input': {
|
|
79
|
+
return (_jsx(Input2Controller, { control: control, name: name, noShadowBox: true, style: { backgroundColor: 'transparent' } }));
|
|
80
|
+
}
|
|
81
|
+
case 'select': {
|
|
82
|
+
const data = row.original;
|
|
83
|
+
return (_jsx(Controller, { control: control, name: name, render: ({ field }) => {
|
|
84
|
+
const { onChange, value, ...otherProps } = field;
|
|
85
|
+
return (_jsx(Select2, { ...otherProps, items: data.options, itemTextKey: "label", itemValueKey: "value", selectedItemValue: field.value, onItemSelect: (item) => field.onChange(item.value), fill: true }));
|
|
86
|
+
} }));
|
|
87
|
+
}
|
|
88
|
+
default:
|
|
89
|
+
return _jsx("span", {});
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
], [control, register]);
|
|
94
|
+
return (_jsxs(_Fragment, { children: [_jsx(GroupPane, { text: "General", children: _jsx(ReactTable, { columns: COLUMNS, data: GENERAL_LIST, rowStyle: {
|
|
95
|
+
hover: { backgroundColor: '#f7f7f7' },
|
|
96
|
+
active: { backgroundColor: '#f5f5f5' },
|
|
97
|
+
} }) }), _jsx(GroupPane, { text: "Bruker", children: _jsx(ReactTable, { columns: COLUMNS, data: BRUKER_LIST, rowStyle: {
|
|
98
|
+
hover: { backgroundColor: '#f7f7f7' },
|
|
99
|
+
active: { backgroundColor: '#f5f5f5' },
|
|
100
|
+
} }) })] }));
|
|
84
101
|
}
|
|
85
102
|
export default ImportationFiltersTabContent;
|
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Checkbox, Classes } from '@blueprintjs/core';
|
|
3
3
|
import { useCallback, useMemo } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { useFormContext, useWatch } from 'react-hook-form';
|
|
5
|
+
import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
|
|
6
|
+
import { Button } from 'react-science/ui';
|
|
5
7
|
import { useChartData } from '../../../context/ChartContext';
|
|
6
|
-
import Button from '../../../elements/Button';
|
|
7
|
-
import { CheckBoxCell } from '../../../elements/CheckBoxCell';
|
|
8
8
|
import { GroupPane } from '../../../elements/GroupPane';
|
|
9
|
+
import { Input2Controller } from '../../../elements/Input2Controller';
|
|
9
10
|
import Label from '../../../elements/Label';
|
|
10
11
|
import ReactTable from '../../../elements/ReactTable/ReactTable';
|
|
11
|
-
import FormikCheckBox from '../../../elements/formik/FormikCheckBox';
|
|
12
|
-
import FormikInput from '../../../elements/formik/FormikInput';
|
|
13
12
|
import { convertPathArrayToString } from '../../../utility/convertPathArrayToString';
|
|
14
13
|
import { getSpectraObjectPaths } from '../../../utility/getSpectraObjectPaths';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
column: {
|
|
20
|
-
padding: '2px',
|
|
21
|
-
},
|
|
22
|
-
};
|
|
14
|
+
import { Section } from '../GeneralSettings';
|
|
15
|
+
function getKeyPath(index, key) {
|
|
16
|
+
return `infoBlock.fields.${index}.${key}`;
|
|
17
|
+
}
|
|
23
18
|
function InfoBlockTabContent() {
|
|
24
|
-
const {
|
|
19
|
+
const { control, setValue, register } = useFormContext();
|
|
25
20
|
const { data } = useChartData();
|
|
26
21
|
const { datalist, paths } = useMemo(() => getSpectraObjectPaths(data), [data]);
|
|
27
|
-
const fields =
|
|
22
|
+
const fields = useWatch({
|
|
23
|
+
name: 'infoBlock.fields',
|
|
24
|
+
}) || [];
|
|
28
25
|
const addHandler = useCallback((data, index) => {
|
|
29
26
|
let columns = [];
|
|
30
27
|
const emptyField = {
|
|
@@ -38,62 +35,65 @@ function InfoBlockTabContent() {
|
|
|
38
35
|
else {
|
|
39
36
|
columns.push(emptyField);
|
|
40
37
|
}
|
|
41
|
-
|
|
42
|
-
}, [
|
|
38
|
+
setValue('infoBlock.fields', columns);
|
|
39
|
+
}, [setValue]);
|
|
43
40
|
const deleteHandler = useCallback((data, index) => {
|
|
44
41
|
const _fields = data.filter((_, columnIndex) => columnIndex !== index);
|
|
45
|
-
|
|
46
|
-
}, [
|
|
42
|
+
setValue('infoBlock.fields', _fields);
|
|
43
|
+
}, [setValue]);
|
|
47
44
|
const COLUMNS = useMemo(() => [
|
|
48
45
|
{
|
|
49
46
|
Header: '#',
|
|
50
|
-
style: { width: '25px',
|
|
47
|
+
style: { width: '25px', textAlign: 'center' },
|
|
51
48
|
accessor: (_, index) => index + 1,
|
|
52
49
|
},
|
|
53
50
|
{
|
|
54
51
|
Header: 'Label',
|
|
55
|
-
style: { padding: 0, ...styles.column },
|
|
56
52
|
Cell: ({ row }) => {
|
|
57
|
-
|
|
53
|
+
const name = getKeyPath(row.index, 'label');
|
|
54
|
+
return (_jsx(Input2Controller, { control: control, name: name, noShadowBox: true, style: { backgroundColor: 'transparent' } }));
|
|
58
55
|
},
|
|
59
56
|
},
|
|
60
57
|
{
|
|
61
58
|
Header: 'Field',
|
|
62
|
-
style: { padding: 0, ...styles.column },
|
|
63
59
|
Cell: ({ row }) => {
|
|
64
|
-
|
|
60
|
+
const name = getKeyPath(row.index, 'jpath');
|
|
61
|
+
return (_jsx(Input2Controller, { control: control, name: name, noShadowBox: true, style: { backgroundColor: 'transparent' }, filterItems: datalist, mapOnChangeValue: (value) => paths?.[value.trim()] || value, mapValue: convertPathArrayToString }));
|
|
65
62
|
},
|
|
66
63
|
},
|
|
67
64
|
{
|
|
68
65
|
Header: 'Format',
|
|
69
|
-
style: { padding: 0, ...styles.column },
|
|
70
66
|
Cell: ({ row }) => {
|
|
71
|
-
|
|
67
|
+
const name = getKeyPath(row.index, 'format');
|
|
68
|
+
return (_jsx(Input2Controller, { control: control, name: name, noShadowBox: true, style: { backgroundColor: 'transparent' } }));
|
|
72
69
|
},
|
|
73
70
|
},
|
|
74
71
|
{
|
|
75
72
|
Header: 'Visible',
|
|
76
|
-
style: { width: '30px',
|
|
77
|
-
Cell: ({ row }) => (_jsx(
|
|
73
|
+
style: { width: '30px', textAlign: 'center' },
|
|
74
|
+
Cell: ({ row }) => (_jsx(Checkbox, { style: { margin: 0 }, ...register(getKeyPath(row.index, 'visible')) })),
|
|
78
75
|
},
|
|
79
76
|
{
|
|
80
77
|
Header: '',
|
|
81
|
-
style: { width: '
|
|
78
|
+
style: { width: '60px' },
|
|
82
79
|
id: 'add-button',
|
|
83
80
|
Cell: ({ data, row }) => {
|
|
84
81
|
const record = row.original;
|
|
85
|
-
return (_jsxs("div", { style: { display: 'flex', justifyContent: 'space-
|
|
82
|
+
return (_jsxs("div", { style: { display: 'flex', justifyContent: 'space-evenly' }, children: [_jsx(Button, { small: true, intent: "success", outlined: true, tooltipProps: { content: '', disabled: true }, onClick: () => addHandler(data, row.index + 1), children: _jsx(FaPlus, { className: Classes.ICON }) }), !record?.name && (_jsx(Button, { small: true, outlined: true, intent: "danger", tooltipProps: { content: '', disabled: true }, onClick: () => deleteHandler(data, row.index), children: _jsx(FaRegTrashAlt, { className: Classes.ICON }) }))] }));
|
|
86
83
|
},
|
|
87
84
|
},
|
|
88
|
-
], [addHandler, datalist, deleteHandler, paths]);
|
|
89
|
-
return (_jsxs("div", { children: [_jsx(Label, { title: "Display spectrum info block", style: { wrapper: { padding: '10px 0' } }, children: _jsx(
|
|
85
|
+
], [addHandler, control, datalist, deleteHandler, paths, register]);
|
|
86
|
+
return (_jsxs("div", { children: [_jsx(Label, { title: "Display spectrum info block", style: { wrapper: { padding: '10px 0' } }, children: _jsx(Checkbox, { style: { margin: 0 }, ...register('infoBlock.visible') }) }), _jsx(GroupPane, { text: "Fields", renderHeader: (text) => {
|
|
90
87
|
return (_jsx(FieldsBlockHeader, { text: text, onAdd: () => addHandler(fields, 0) }));
|
|
91
88
|
}, children: _jsx(ReactTable, { style: {
|
|
92
|
-
'
|
|
93
|
-
|
|
89
|
+
'thead tr th': { zIndex: 1 },
|
|
90
|
+
td: { padding: 0 },
|
|
91
|
+
}, rowStyle: {
|
|
92
|
+
hover: { backgroundColor: '#f7f7f7' },
|
|
93
|
+
active: { backgroundColor: '#f5f5f5' },
|
|
94
94
|
}, data: fields, columns: COLUMNS, emptyDataRowText: "No Fields" }) })] }));
|
|
95
95
|
}
|
|
96
96
|
function FieldsBlockHeader({ onAdd, text }) {
|
|
97
|
-
return (_jsxs(
|
|
97
|
+
return (_jsxs(Section, { children: [_jsx("p", { style: { flex: 1 }, children: text }), _jsx(Button, { outlined: true, small: true, intent: "success", tooltipProps: { content: '', disabled: true }, onClick: onAdd, children: "Add Field" })] }));
|
|
98
98
|
}
|
|
99
99
|
export default InfoBlockTabContent;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Classes } from '@blueprintjs/core';
|
|
3
3
|
import { useCallback, useMemo } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
4
|
+
import { useFormContext, useWatch } from 'react-hook-form';
|
|
5
|
+
import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
|
|
6
|
+
import { Button } from 'react-science/ui';
|
|
6
7
|
import { GroupPane } from '../../../elements/GroupPane';
|
|
8
|
+
import { Input2Controller } from '../../../elements/Input2Controller';
|
|
9
|
+
import { NumberInput2Controller } from '../../../elements/NumberInput2Controller';
|
|
7
10
|
import ReactTable from '../../../elements/ReactTable/ReactTable';
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
column: {
|
|
14
|
-
padding: '2px',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
11
|
+
import { Section } from '../GeneralSettings';
|
|
12
|
+
function getKeyPath(index, key) {
|
|
13
|
+
return `nuclei.${index}.${key}`;
|
|
14
|
+
}
|
|
17
15
|
function NucleiTabContent() {
|
|
18
|
-
const {
|
|
19
|
-
const fields =
|
|
16
|
+
const { control, setValue } = useFormContext();
|
|
17
|
+
const fields = useWatch({
|
|
18
|
+
name: 'nuclei',
|
|
19
|
+
}) || [];
|
|
20
20
|
const addHandler = useCallback((data, index) => {
|
|
21
21
|
let columns = [];
|
|
22
22
|
const emptyField = {
|
|
@@ -30,70 +30,78 @@ function NucleiTabContent() {
|
|
|
30
30
|
else {
|
|
31
31
|
columns.push(emptyField);
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
}, [
|
|
33
|
+
setValue('nuclei', columns);
|
|
34
|
+
}, [setValue]);
|
|
35
35
|
const deleteHandler = useCallback((data, index) => {
|
|
36
36
|
const _fields = data.filter((_, columnIndex) => columnIndex !== index);
|
|
37
|
-
|
|
38
|
-
}, [
|
|
37
|
+
setValue('nuclei', _fields);
|
|
38
|
+
}, [setValue]);
|
|
39
39
|
const COLUMNS = useMemo(() => [
|
|
40
40
|
{
|
|
41
41
|
Header: '#',
|
|
42
|
-
style: { width: '25px',
|
|
42
|
+
style: { width: '25px', textAlign: 'center' },
|
|
43
43
|
accessor: (_, index) => index + 1,
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
Header: 'Nucleus',
|
|
47
|
-
style: { padding: 0
|
|
47
|
+
style: { padding: 0 },
|
|
48
48
|
Cell: ({ row }) => {
|
|
49
|
-
|
|
49
|
+
const name = getKeyPath(row.index, 'nucleus');
|
|
50
|
+
return (_jsx(Input2Controller, { control: control, name: name, noShadowBox: true, style: { backgroundColor: 'transparent' } }));
|
|
50
51
|
},
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
Header: 'δ (ppm)',
|
|
54
|
-
style: { padding: 0
|
|
55
|
+
style: { padding: 0 },
|
|
55
56
|
Cell: ({ row }) => {
|
|
56
|
-
|
|
57
|
+
const name = getKeyPath(row.index, 'ppmFormat');
|
|
58
|
+
return (_jsx(Input2Controller, { control: control, name: name, noShadowBox: true, style: { backgroundColor: 'transparent' } }));
|
|
57
59
|
},
|
|
58
60
|
},
|
|
59
61
|
{
|
|
60
62
|
Header: 'Coupling (Hz)',
|
|
61
|
-
style: { padding: 0
|
|
63
|
+
style: { padding: 0 },
|
|
62
64
|
Cell: ({ row }) => {
|
|
63
|
-
|
|
65
|
+
const name = getKeyPath(row.index, 'hzFormat');
|
|
66
|
+
return (_jsx(Input2Controller, { control: control, name: name, noShadowBox: true, style: { backgroundColor: 'transparent' } }));
|
|
64
67
|
},
|
|
65
68
|
},
|
|
66
69
|
{
|
|
67
70
|
Header: 'Axis from',
|
|
68
|
-
style: { padding: 0
|
|
71
|
+
style: { padding: 0 },
|
|
69
72
|
Cell: ({ row }) => {
|
|
70
|
-
|
|
73
|
+
const name = getKeyPath(row.index, 'axisFrom');
|
|
74
|
+
return (_jsx(NumberInput2Controller, { control: control, name: name, noShadowBox: true, style: { backgroundColor: 'transparent' }, fill: true }));
|
|
71
75
|
},
|
|
72
76
|
},
|
|
73
77
|
{
|
|
74
78
|
Header: 'Axis to',
|
|
75
|
-
style: { padding: 0
|
|
79
|
+
style: { padding: 0 },
|
|
76
80
|
Cell: ({ row }) => {
|
|
77
|
-
|
|
81
|
+
const name = getKeyPath(row.index, 'axisTo');
|
|
82
|
+
return (_jsx(NumberInput2Controller, { control: control, name: name, noShadowBox: true, style: { backgroundColor: 'transparent' }, fill: true }));
|
|
78
83
|
},
|
|
79
84
|
},
|
|
80
85
|
{
|
|
81
86
|
Header: '',
|
|
82
|
-
style: { width: '
|
|
83
|
-
id: '
|
|
87
|
+
style: { width: '60px' },
|
|
88
|
+
id: 'op-buttons',
|
|
84
89
|
Cell: ({ data, row }) => {
|
|
85
|
-
return (_jsxs("div", { style: { display: 'flex', justifyContent: 'space-
|
|
90
|
+
return (_jsxs("div", { style: { display: 'flex', justifyContent: 'space-evenly' }, children: [_jsx(Button, { small: true, outlined: true, intent: "success", tooltipProps: { content: '', disabled: true }, onClick: () => addHandler(data, row.index + 1), children: _jsx(FaPlus, { className: Classes.ICON }) }), _jsx(Button, { small: true, outlined: true, intent: "danger", tooltipProps: { content: '', disabled: true }, onClick: () => deleteHandler(data, row.index), children: _jsx(FaRegTrashAlt, { className: Classes.ICON }) })] }));
|
|
86
91
|
},
|
|
87
92
|
},
|
|
88
|
-
], [addHandler, deleteHandler]);
|
|
93
|
+
], [addHandler, control, deleteHandler]);
|
|
89
94
|
return (_jsx("div", { children: _jsx(GroupPane, { text: "Number formatting for crosshair and info line and axis domain", renderHeader: (text) => {
|
|
90
95
|
return (_jsx(FieldsBlockHeader, { text: text, onAdd: () => addHandler(fields, 0) }));
|
|
91
96
|
}, children: _jsx(ReactTable, { style: {
|
|
92
|
-
'
|
|
93
|
-
|
|
97
|
+
'thead tr th': { zIndex: 1 },
|
|
98
|
+
td: { padding: 0 },
|
|
99
|
+
}, rowStyle: {
|
|
100
|
+
hover: { backgroundColor: '#f7f7f7' },
|
|
101
|
+
active: { backgroundColor: '#f5f5f5' },
|
|
94
102
|
}, data: fields, columns: COLUMNS, emptyDataRowText: "No Nucleus" }) }) }));
|
|
95
103
|
}
|
|
96
104
|
function FieldsBlockHeader({ onAdd, text }) {
|
|
97
|
-
return (_jsxs(
|
|
105
|
+
return (_jsxs(Section, { children: [_jsx("p", { style: { flex: 1 }, children: text }), _jsx(Button, { small: true, outlined: true, intent: "success", tooltipProps: { content: '', disabled: true }, onClick: onAdd, children: "Add nuclei preferences" })] }));
|
|
98
106
|
}
|
|
99
107
|
export default NucleiTabContent;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Tab, Tabs } from '@blueprintjs/core';
|
|
3
|
-
import {
|
|
4
|
-
import { CheckBoxCell } from '../../../elements/CheckBoxCell';
|
|
2
|
+
import { Checkbox, Tab, Tabs } from '@blueprintjs/core';
|
|
3
|
+
import { useFormContext, useWatch } from 'react-hook-form';
|
|
5
4
|
import IsotopesViewer from '../../../elements/IsotopesViewer';
|
|
6
5
|
import Label from '../../../elements/Label';
|
|
7
6
|
import ReactTable from '../../../elements/ReactTable/ReactTable';
|
|
8
|
-
import FormikCheckBox from '../../../elements/formik/FormikCheckBox';
|
|
9
7
|
function OnLoadProcessingTabContent() {
|
|
10
|
-
const {
|
|
11
|
-
const isExperimentalFeatures =
|
|
12
|
-
|
|
8
|
+
const { register, control } = useFormContext();
|
|
9
|
+
const isExperimentalFeatures = useWatch({
|
|
10
|
+
control,
|
|
11
|
+
name: 'display.general.experimentalFeatures.display',
|
|
12
|
+
}) || false;
|
|
13
|
+
return (_jsxs("div", { children: [_jsx(Label, { title: "Enable auto processing on load", style: { wrapper: { padding: '10px 0' } }, children: _jsx(Checkbox, { style: { margin: 0 }, ...register('onLoadProcessing.autoProcessing'), defaultChecked: false }) }), isExperimentalFeatures && _jsx(AutoProcessingFilters, {})] }));
|
|
13
14
|
}
|
|
14
15
|
function AutoProcessingFilters() {
|
|
15
|
-
const {
|
|
16
|
-
const autoProcessingFilters =
|
|
16
|
+
const { getValues } = useFormContext();
|
|
17
|
+
const autoProcessingFilters = getValues('onLoadProcessing.filters') || {};
|
|
17
18
|
const tabItems = Object.keys(autoProcessingFilters).map((nucleus) => ({
|
|
18
19
|
id: nucleus,
|
|
19
20
|
title: _jsx(IsotopesViewer, { value: nucleus }),
|
|
@@ -22,6 +23,7 @@ function AutoProcessingFilters() {
|
|
|
22
23
|
return (_jsx("div", { style: { width: '100%', overflow: 'hidden' }, children: _jsx(Tabs, { children: tabItems.map((item) => (_jsx(Tab, { id: item.id, title: item.title, panel: item.content }, item.id))) }) }));
|
|
23
24
|
}
|
|
24
25
|
function FiltersTable({ data, nucleus }) {
|
|
26
|
+
const { register } = useFormContext();
|
|
25
27
|
const COLUMNS = [
|
|
26
28
|
{
|
|
27
29
|
index: 1,
|
|
@@ -37,9 +39,12 @@ function FiltersTable({ data, nucleus }) {
|
|
|
37
39
|
{
|
|
38
40
|
index: 2,
|
|
39
41
|
Header: 'Enable',
|
|
40
|
-
Cell: ({ row }) => (_jsx(
|
|
42
|
+
Cell: ({ row }) => (_jsx(Checkbox, { style: { margin: 0 }, ...register(`onLoadProcessing.filters.${nucleus}.${row.index}.flag`), defaultChecked: false })),
|
|
41
43
|
},
|
|
42
44
|
];
|
|
43
|
-
return _jsx(ReactTable, { columns: COLUMNS, data: data
|
|
45
|
+
return (_jsx(ReactTable, { columns: COLUMNS, data: data, rowStyle: {
|
|
46
|
+
hover: { backgroundColor: '#f7f7f7' },
|
|
47
|
+
active: { backgroundColor: '#f5f5f5' },
|
|
48
|
+
} }));
|
|
44
49
|
}
|
|
45
50
|
export default OnLoadProcessingTabContent;
|
|
@@ -1,47 +1,44 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Classes } from '@blueprintjs/core';
|
|
3
3
|
import { useCallback, useMemo } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { useFormContext, useWatch } from 'react-hook-form';
|
|
5
|
+
import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
|
|
6
|
+
import { Button } from 'react-science/ui';
|
|
5
7
|
import { useChartData } from '../../../context/ChartContext';
|
|
6
|
-
import
|
|
8
|
+
import { ColorPickerDropdownController } from '../../../elements/ColorPickerDropdownController';
|
|
7
9
|
import { GroupPane } from '../../../elements/GroupPane';
|
|
10
|
+
import { Input2Controller } from '../../../elements/Input2Controller';
|
|
8
11
|
import ReactTable from '../../../elements/ReactTable/ReactTable';
|
|
9
|
-
import FormikColorPickerDropdown from '../../../elements/formik/FormikColorPickerDropdown';
|
|
10
|
-
import FormikInput from '../../../elements/formik/FormikInput';
|
|
11
12
|
import { convertPathArrayToString } from '../../../utility/convertPathArrayToString';
|
|
12
13
|
import { getSpectraObjectPaths } from '../../../utility/getSpectraObjectPaths';
|
|
13
|
-
|
|
14
|
-
input: {
|
|
15
|
-
width: '100%',
|
|
16
|
-
},
|
|
17
|
-
column: {
|
|
18
|
-
padding: '2px',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
14
|
+
import { Section } from '../GeneralSettings';
|
|
21
15
|
const colorInputStyle = {
|
|
22
|
-
padding: 0,
|
|
23
16
|
minWidth: '80px',
|
|
24
17
|
width: '80px',
|
|
25
|
-
...styles.column,
|
|
26
18
|
};
|
|
27
19
|
function getObjectKey(key) {
|
|
28
20
|
return `spectraColors.${key}`;
|
|
29
21
|
}
|
|
22
|
+
function getKeyPath(key, index, fieldKey) {
|
|
23
|
+
return `${getObjectKey(key)}.${index}.${fieldKey}`;
|
|
24
|
+
}
|
|
30
25
|
function SpectraColorsTabContent() {
|
|
31
|
-
const {
|
|
26
|
+
const { setValue } = useFormContext();
|
|
32
27
|
const { data } = useChartData();
|
|
33
28
|
const { datalist, paths } = useMemo(() => getSpectraObjectPaths(data), [data]);
|
|
34
|
-
const { oneDimension = [], twoDimensions = [] } =
|
|
29
|
+
const { oneDimension = [], twoDimensions = [] } = useWatch({
|
|
30
|
+
name: 'spectraColors',
|
|
31
|
+
}) || {};
|
|
35
32
|
const addHandler = useCallback((data, index, key) => {
|
|
36
33
|
let columns = [];
|
|
37
34
|
const emptyField = key === 'oneDimension'
|
|
38
35
|
? {
|
|
39
|
-
value:
|
|
36
|
+
value: '',
|
|
40
37
|
jpath: ['info', 'experiment'],
|
|
41
38
|
color: 'red',
|
|
42
39
|
}
|
|
43
40
|
: {
|
|
44
|
-
value:
|
|
41
|
+
value: '',
|
|
45
42
|
jpath: ['info', 'experiment'],
|
|
46
43
|
positiveColor: 'red',
|
|
47
44
|
negativeColor: 'blue',
|
|
@@ -52,55 +49,56 @@ function SpectraColorsTabContent() {
|
|
|
52
49
|
else {
|
|
53
50
|
columns.push(emptyField);
|
|
54
51
|
}
|
|
55
|
-
|
|
56
|
-
}, [
|
|
52
|
+
setValue(getObjectKey(key), columns);
|
|
53
|
+
}, [setValue]);
|
|
57
54
|
const deleteHandler = useCallback((data, index, key) => {
|
|
58
55
|
const _fields = data.filter((_, columnIndex) => columnIndex !== index);
|
|
59
|
-
|
|
60
|
-
}, [
|
|
56
|
+
setValue(getObjectKey(key), _fields);
|
|
57
|
+
}, [setValue]);
|
|
61
58
|
return (_jsxs("div", { children: [_jsx(SpectraColorsFields, { groupLabel: "One dimension", baseObjectPath: "oneDimension", data: oneDimension, datalist: datalist, paths: paths, onAdd: addHandler, onDelete: deleteHandler }), _jsx(SpectraColorsFields, { groupLabel: "Two dimensions", baseObjectPath: "twoDimensions", data: twoDimensions, datalist: datalist, paths: paths, onAdd: addHandler, onDelete: deleteHandler })] }));
|
|
62
59
|
}
|
|
63
60
|
function SpectraColorsFields(props) {
|
|
64
61
|
const { onAdd, onDelete, datalist, paths, data, baseObjectPath, groupLabel } = props;
|
|
62
|
+
const { control } = useFormContext();
|
|
65
63
|
const COLUMNS = useMemo(() => {
|
|
66
|
-
const objectPath = getObjectKey(baseObjectPath);
|
|
67
64
|
const baseColumns = [
|
|
68
65
|
{
|
|
69
66
|
Header: '#',
|
|
70
|
-
style: { width: '25px',
|
|
67
|
+
style: { width: '25px', textAlign: 'center' },
|
|
71
68
|
accessor: (_, index) => index + 1,
|
|
72
69
|
},
|
|
73
70
|
{
|
|
74
71
|
Header: 'Field',
|
|
75
|
-
style: { padding: 0, ...styles.column },
|
|
76
72
|
Cell: ({ row }) => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}, mapValue: (paths) => convertPathArrayToString(paths), datalist: datalist }));
|
|
73
|
+
const name = getKeyPath(baseObjectPath, row.index, 'jpath');
|
|
74
|
+
return (_jsx(Input2Controller, { control: control, name: name, noShadowBox: true, filterItems: datalist, mapOnChangeValue: (value) => paths?.[value.trim()] || value, mapValue: convertPathArrayToString, style: { backgroundColor: 'transparent' } }));
|
|
80
75
|
},
|
|
81
76
|
},
|
|
82
77
|
{
|
|
83
78
|
Header: 'Value',
|
|
84
|
-
style: { padding: 0, ...styles.column },
|
|
85
79
|
Cell: ({ row }) => {
|
|
86
|
-
|
|
80
|
+
const name = getKeyPath(baseObjectPath, row.index, 'value');
|
|
81
|
+
return (_jsx(Input2Controller, { control: control, name: name, noShadowBox: true, style: { backgroundColor: 'transparent' } }));
|
|
87
82
|
},
|
|
88
83
|
},
|
|
89
84
|
];
|
|
90
85
|
const operationsField = {
|
|
91
86
|
Header: '',
|
|
92
|
-
style: { width: '
|
|
87
|
+
style: { width: '60px' },
|
|
93
88
|
id: 'operation-button',
|
|
94
89
|
Cell: ({ data, row }) => {
|
|
95
90
|
const record = row.original;
|
|
96
|
-
return (_jsxs("div", { style: { display: 'flex', justifyContent: 'space-
|
|
91
|
+
return (_jsxs("div", { style: { display: 'flex', justifyContent: 'space-evenly' }, children: [_jsx(Button, { small: true, outlined: true, intent: "success", tooltipProps: { content: '', disabled: true }, onClick: () => onAdd(data, row.index + 1, baseObjectPath), children: _jsx(FaPlus, { className: Classes.ICON }) }), !record?.name && (_jsx(Button, { small: true, outlined: true, intent: "danger", tooltipProps: { content: '', disabled: true }, onClick: () => onDelete(data, row.index, baseObjectPath), children: _jsx(FaRegTrashAlt, { className: Classes.ICON }) }))] }));
|
|
97
92
|
},
|
|
98
93
|
};
|
|
99
94
|
if (baseObjectPath === 'oneDimension') {
|
|
100
95
|
const colorField = {
|
|
101
96
|
Header: 'Color',
|
|
102
97
|
style: colorInputStyle,
|
|
103
|
-
Cell: ({ row }) =>
|
|
98
|
+
Cell: ({ row }) => {
|
|
99
|
+
const name = getKeyPath(baseObjectPath, row.index, 'color');
|
|
100
|
+
return (_jsx(ColorPickerDropdownController, { control: control, name: name }));
|
|
101
|
+
},
|
|
104
102
|
};
|
|
105
103
|
return [...baseColumns, colorField, operationsField];
|
|
106
104
|
}
|
|
@@ -108,24 +106,33 @@ function SpectraColorsFields(props) {
|
|
|
108
106
|
{
|
|
109
107
|
Header: 'Positive color',
|
|
110
108
|
style: colorInputStyle,
|
|
111
|
-
Cell: ({ row }) =>
|
|
109
|
+
Cell: ({ row }) => {
|
|
110
|
+
const name = getKeyPath(baseObjectPath, row.index, 'positiveColor');
|
|
111
|
+
return (_jsx(ColorPickerDropdownController, { control: control, name: name }));
|
|
112
|
+
},
|
|
112
113
|
},
|
|
113
114
|
{
|
|
114
115
|
Header: 'Negative color',
|
|
115
116
|
style: colorInputStyle,
|
|
116
|
-
Cell: ({ row }) =>
|
|
117
|
+
Cell: ({ row }) => {
|
|
118
|
+
const name = getKeyPath(baseObjectPath, row.index, 'negativeColor');
|
|
119
|
+
return (_jsx(ColorPickerDropdownController, { control: control, name: name }));
|
|
120
|
+
},
|
|
117
121
|
},
|
|
118
122
|
];
|
|
119
123
|
return [...baseColumns, ...colorFields, operationsField];
|
|
120
|
-
}, [baseObjectPath, datalist, onAdd, onDelete, paths]);
|
|
124
|
+
}, [baseObjectPath, control, datalist, onAdd, onDelete, paths]);
|
|
121
125
|
return (_jsx(GroupPane, { text: groupLabel, renderHeader: (text) => {
|
|
122
126
|
return (_jsx(FieldsBlockHeader, { text: text, onAdd: () => onAdd(data, 0, baseObjectPath) }));
|
|
123
127
|
}, children: _jsx(ReactTable, { style: {
|
|
124
|
-
'
|
|
125
|
-
|
|
128
|
+
'thead tr th': { zIndex: 1 },
|
|
129
|
+
td: { padding: 0 },
|
|
130
|
+
}, rowStyle: {
|
|
131
|
+
hover: { backgroundColor: '#f7f7f7' },
|
|
132
|
+
active: { backgroundColor: '#f5f5f5' },
|
|
126
133
|
}, data: data, columns: COLUMNS, emptyDataRowText: "No Fields" }) }));
|
|
127
134
|
}
|
|
128
135
|
function FieldsBlockHeader({ onAdd, text }) {
|
|
129
|
-
return (_jsxs(
|
|
136
|
+
return (_jsxs(Section, { children: [_jsx("p", { style: { flex: 1 }, children: text }), _jsx(Button, { small: true, outlined: true, intent: "success", tooltipProps: { content: '', disabled: true }, onClick: onAdd, children: "Add custom color" })] }));
|
|
130
137
|
}
|
|
131
138
|
export default SpectraColorsTabContent;
|