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.
Files changed (167) hide show
  1. package/lib/component/1d/ExclusionZoneAnnotation.d.ts +0 -1
  2. package/lib/component/1d/database/DatabaseSpectrum.js +14 -19
  3. package/lib/component/1d/jCouplingGraph/JGraphContext.d.ts +0 -1
  4. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts +0 -1
  5. package/lib/component/1d/peaks/PeakEditionManager.js +16 -10
  6. package/lib/component/1d/utilities/getDecimalsCount.js +1 -1
  7. package/lib/component/1d/utilities/intersectionResolver.js +1 -1
  8. package/lib/component/1d-2d/FieldEdition.d.ts +3 -1
  9. package/lib/component/1d-2d/FieldEdition.js +26 -10
  10. package/lib/component/2d/1d-tracer/Left1DChart.d.ts +0 -1
  11. package/lib/component/2d/1d-tracer/Top1DChart.d.ts +0 -1
  12. package/lib/component/2d/XAxis.d.ts +0 -1
  13. package/lib/component/2d/YAxis.d.ts +0 -1
  14. package/lib/component/2d/ft/Contours.js +7 -7
  15. package/lib/component/assignment/AssignmentsContext.d.ts +0 -1
  16. package/lib/component/context/ChartContext.d.ts +0 -1
  17. package/lib/component/context/DispatchContext.d.ts +0 -1
  18. package/lib/component/context/GlobalContext.d.ts +0 -1
  19. package/lib/component/context/KeyModifierContext.js +1 -1
  20. package/lib/component/context/LoaderContext.d.ts +0 -1
  21. package/lib/component/context/PreferencesContext.d.ts +0 -1
  22. package/lib/component/context/ScaleContext.d.ts +0 -1
  23. package/lib/component/elements/ActionButtons.d.ts +1 -0
  24. package/lib/component/elements/ActionButtons.js +4 -4
  25. package/lib/component/elements/ColorInput.d.ts +0 -1
  26. package/lib/component/elements/ColorPickerDropdownController.d.ts +2 -0
  27. package/lib/component/elements/ColorPickerDropdownController.js +8 -0
  28. package/lib/component/elements/ColumnWrapper.d.ts +0 -1
  29. package/lib/component/elements/ContextMenu.d.ts +0 -1
  30. package/lib/component/elements/Input.d.ts +1 -0
  31. package/lib/component/elements/Input.js +2 -1
  32. package/lib/component/elements/Input2.d.ts +13 -0
  33. package/lib/component/elements/Input2.js +118 -0
  34. package/lib/component/elements/Input2Controller.d.ts +12 -0
  35. package/lib/component/elements/Input2Controller.js +22 -0
  36. package/lib/component/elements/MoleculeSelection.js +1 -1
  37. package/lib/component/elements/NumberInput.js +1 -1
  38. package/lib/component/elements/NumberInput2.d.ts +12 -0
  39. package/lib/component/elements/NumberInput2.js +65 -0
  40. package/lib/component/elements/NumberInput2Controller.d.ts +8 -0
  41. package/lib/component/elements/NumberInput2Controller.js +15 -0
  42. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +3 -3
  43. package/lib/component/elements/ReactTable/Style.d.ts +3 -1
  44. package/lib/component/elements/ReactTable/Style.js +11 -1
  45. package/lib/component/elements/ReactTable/utility/ReactTableContext.d.ts +0 -1
  46. package/lib/component/elements/Select2.d.ts +26 -0
  47. package/lib/component/elements/Select2.js +25 -0
  48. package/lib/component/elements/Select2Controller.d.ts +7 -0
  49. package/lib/component/elements/Select2Controller.js +12 -0
  50. package/lib/component/elements/draggable/useDraggable.d.ts +0 -1
  51. package/lib/component/elements/dropDownButton/DropDownButton.d.ts +2 -4
  52. package/lib/component/elements/dropDownButton/DropDownButton.js +11 -37
  53. package/lib/component/elements/dropDownButton/DropDownList.js +3 -32
  54. package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
  55. package/lib/component/elements/formik/FormikColumnFormatField.d.ts +0 -1
  56. package/lib/component/elements/formik/FormikInput.d.ts +0 -1
  57. package/lib/component/elements/formik/FormikInput2.d.ts +11 -0
  58. package/lib/component/elements/formik/FormikInput2.js +26 -0
  59. package/lib/component/elements/formik/FormikOnChange.d.ts +0 -1
  60. package/lib/component/elements/popup/Modal/Context.d.ts +0 -1
  61. package/lib/component/elements/popup/Modal/ModalContent.d.ts +0 -1
  62. package/lib/component/elements/resizer/SVGResizer.d.ts +0 -1
  63. package/lib/component/elements/useFormValidateField.d.ts +1 -0
  64. package/lib/component/elements/useFormValidateField.js +9 -0
  65. package/lib/component/header/ApodizationOptionsPanel.js +26 -11
  66. package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +1 -4
  67. package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -16
  68. package/lib/component/header/BaseLineCorrectionPanel.js +49 -27
  69. package/lib/component/header/Header.js +1 -1
  70. package/lib/component/header/PhaseCorrectionPanel.js +12 -24
  71. package/lib/component/header/RangesPickingOptionPanel.js +12 -12
  72. package/lib/component/header/ZeroFillingOptionsPanel.js +18 -7
  73. package/lib/component/header/Zones2DOptionPanel.js +19 -18
  74. package/lib/component/hooks/useWorkspaceAction.d.ts +1 -1
  75. package/lib/component/modal/editRange/forms/components/SignalTab.d.ts +0 -1
  76. package/lib/component/modal/editRange/forms/components/SignalsContent.d.ts +0 -1
  77. package/lib/component/modal/setting/GeneralSettings.d.ts +5 -1
  78. package/lib/component/modal/setting/GeneralSettings.js +107 -111
  79. package/lib/component/modal/setting/WorkspaceItem.js +4 -9
  80. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
  81. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +95 -59
  82. package/lib/component/modal/setting/settings-tabs/DisplayTabContent.js +33 -25
  83. package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +15 -4
  84. package/lib/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +56 -39
  85. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +36 -36
  86. package/lib/component/modal/setting/settings-tabs/NucleiTabContent.js +44 -36
  87. package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +16 -11
  88. package/lib/component/modal/setting/settings-tabs/SpectraColorsTabContent.js +47 -40
  89. package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +50 -40
  90. package/lib/component/modal/setting/settingsValidation.js +8 -34
  91. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +0 -1
  92. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +0 -1
  93. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.d.ts +0 -1
  94. package/lib/component/panels/Panels.js +31 -8
  95. package/lib/component/panels/PeaksPanel/PeaksPreferences.d.ts +0 -1
  96. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +0 -1
  97. package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +0 -1
  98. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +0 -1
  99. package/lib/component/panels/SpectraPanel/SpectraPreferences.d.ts +0 -1
  100. package/lib/component/panels/SpectraPanel/SpectraPreferences.js +32 -24
  101. package/lib/component/panels/SpectraPanel/SpectraTable.js +17 -2
  102. package/lib/component/panels/SpectraPanel/SpectrumListPanel.d.ts +0 -1
  103. package/lib/component/panels/SpectraPanel/base/ColorIndicator.d.ts +0 -1
  104. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.d.ts +3 -3
  105. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js +25 -16
  106. package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DHistogram.d.ts +0 -1
  107. package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.js +15 -5
  108. package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DHistogram.d.ts +0 -1
  109. package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.js +44 -6
  110. package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.d.ts +0 -1
  111. package/lib/component/panels/SummaryPanel/Overview.d.ts +0 -1
  112. package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts +0 -1
  113. package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +1 -1
  114. package/lib/component/panels/ZonesPanel/ZonesPreferences.d.ts +0 -1
  115. package/lib/component/panels/databasePanel/DatabasePanel.js +17 -3
  116. package/lib/component/panels/databasePanel/DatabasePreferences.d.ts +0 -1
  117. package/lib/component/panels/databasePanel/DatabaseTable.d.ts +11 -4
  118. package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
  119. package/lib/component/panels/informationPanel/InformationEditionModal.d.ts +6 -0
  120. package/lib/component/panels/informationPanel/InformationEditionModal.js +105 -0
  121. package/lib/component/panels/informationPanel/InformationPanel.d.ts +1 -0
  122. package/lib/component/panels/{InformationPanel.js → informationPanel/InformationPanel.js} +2 -2
  123. package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.d.ts +0 -1
  124. package/lib/component/panels/multipleAnalysisPanel/preferences/index.d.ts +0 -1
  125. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +0 -1
  126. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +1 -1
  127. package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +0 -1
  128. package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.d.ts +0 -1
  129. package/lib/component/reducer/Reducer.d.ts +1 -1
  130. package/lib/component/reducer/Reducer.js +2 -0
  131. package/lib/component/reducer/actions/DatabaseActions.js +22 -5
  132. package/lib/component/reducer/actions/SpectraActions.d.ts +8 -2
  133. package/lib/component/reducer/actions/SpectraActions.js +58 -21
  134. package/lib/component/reducer/actions/ToolsActions.js +3 -4
  135. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +7 -7
  136. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +2 -0
  137. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  138. package/lib/component/utility/checkUniqueByKey.d.ts +2 -0
  139. package/lib/component/utility/checkUniqueByKey.js +40 -0
  140. package/lib/component/utility/colorToHexWithAlpha.d.ts +9 -0
  141. package/lib/component/utility/colorToHexWithAlpha.js +4 -0
  142. package/lib/component/workspaces/exercise.js +2 -0
  143. package/lib/component/workspaces/process1D.js +0 -1
  144. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
  145. package/lib/data/PredictionManager.js +3 -5
  146. package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +13 -13
  147. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +9 -9
  148. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +13 -13
  149. package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +13 -13
  150. package/lib/data/data1d/database.d.ts +1 -0
  151. package/lib/data/data1d/database.js +4 -2
  152. package/lib/data/data2d/Spectrum2D/contours.d.ts +8 -22
  153. package/lib/data/data2d/Spectrum2D/contours.js +88 -67
  154. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +4 -2
  155. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +20 -20
  156. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +20 -20
  157. package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
  158. package/lib/data/initiateFilters.d.ts +1 -1
  159. package/lib/data/matrixGeneration.js +1 -2
  160. package/lib/data/types/common/Keys.d.ts +3 -0
  161. package/lib/data/types/common/Keys.js +1 -0
  162. package/lib/data/utilities/generateNumbersPowerOfX.d.ts +2 -2
  163. package/lib/versionInfo.js +1 -1
  164. package/package.json +32 -31
  165. package/lib/component/elements/formik/FormikSlider.d.ts +0 -6
  166. package/lib/component/elements/formik/FormikSlider.js +0 -15
  167. package/lib/component/panels/InformationPanel.d.ts +0 -1
@@ -0,0 +1,65 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { Classes, NumericInput, } from '@blueprintjs/core';
4
+ import debounce from 'lodash/debounce';
5
+ import { useEffect, useMemo, useState, isValidElement, forwardRef, } from 'react';
6
+ function useNumberInput(props) {
7
+ const { value: externalValue, debounceTime, onValueChange, checkValue, } = props;
8
+ const [internalValue, setValue] = useState();
9
+ const value = debounceTime ? internalValue : externalValue;
10
+ const [isDebounced, setDebouncedStatus] = useState(false);
11
+ const debounceOnValueChange = useMemo(() => debounce((valueAsNumber, valueAsString, inputElement) => {
12
+ onValueChange?.(valueAsNumber, valueAsString, inputElement);
13
+ setDebouncedStatus(true);
14
+ }, debounceTime), [debounceTime, onValueChange]);
15
+ useEffect(() => {
16
+ if (debounceTime) {
17
+ setValue(externalValue);
18
+ }
19
+ }, [debounceTime, externalValue]);
20
+ function handleValueChange(valueAsNumber, valueAsString, inputElement) {
21
+ setDebouncedStatus(false);
22
+ if (!checkValue || checkValue?.(valueAsNumber)) {
23
+ if (debounceTime) {
24
+ setValue(valueAsString);
25
+ debounceOnValueChange(valueAsNumber, valueAsString, inputElement);
26
+ }
27
+ else {
28
+ onValueChange?.(valueAsNumber, valueAsString, inputElement);
29
+ }
30
+ }
31
+ }
32
+ return {
33
+ handleValueChange,
34
+ debounceOnValueChange,
35
+ isDebounced,
36
+ value,
37
+ };
38
+ }
39
+ function getIcon(leftIcon) {
40
+ if (isValidElement(leftIcon)) {
41
+ return _jsx("span", { className: Classes.ICON, children: leftIcon });
42
+ }
43
+ return leftIcon;
44
+ }
45
+ function getClasses(isDebounced) {
46
+ const classes = ['numeric-input'];
47
+ if (isDebounced) {
48
+ classes.push('debounce-end');
49
+ }
50
+ return classes.join(' ');
51
+ }
52
+ function InnerNumberInput(props, ref) {
53
+ const { debounceTime = 0, onValueChange, checkValue, value: externalValue, leftIcon, autoSelect = false, ...otherInputProps } = props;
54
+ const { handleValueChange, isDebounced, value } = useNumberInput({
55
+ value: externalValue,
56
+ debounceTime,
57
+ onValueChange,
58
+ checkValue,
59
+ });
60
+ const icon = getIcon(leftIcon);
61
+ const classes = getClasses(isDebounced);
62
+ return (_jsx(NumericInput, { leftIcon: icon, inputClassName: classes, inputRef: ref, onValueChange: handleValueChange, value: value, selectAllOnFocus: autoSelect, ...otherInputProps }));
63
+ }
64
+ const NumberInput2 = forwardRef(InnerNumberInput);
65
+ export { NumberInput2 };
@@ -0,0 +1,8 @@
1
+ import { ControllerProps, FieldValues } from 'react-hook-form';
2
+ import { NumberInput2Props } from './NumberInput2';
3
+ interface NumberInput2ControllerProps<TFieldValues extends FieldValues = FieldValues> extends Omit<NumberInput2Props, 'name'>, Pick<ControllerProps<TFieldValues>, 'control' | 'name'> {
4
+ controllerProps?: Omit<ControllerProps<TFieldValues>, 'render'>;
5
+ noShadowBox?: boolean;
6
+ }
7
+ export declare function NumberInput2Controller<TFieldValues extends FieldValues = FieldValues>(props: NumberInput2ControllerProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Controller } from 'react-hook-form';
3
+ import { NumberInput2 } from './NumberInput2';
4
+ export function NumberInput2Controller(props) {
5
+ const { controllerProps, onValueChange, name, control, intent = 'none', noShadowBox = false, style, ...otherInputProps } = props;
6
+ return (_jsx(Controller, { name: name, control: control, ...controllerProps, render: ({ field, fieldState: { invalid } }) => {
7
+ return (_jsx(NumberInput2, { ...field, onValueChange: (valueAsNumber, valueAsString, event) => {
8
+ field.onChange(valueAsString);
9
+ onValueChange?.(valueAsNumber, valueAsString, event);
10
+ }, ...otherInputProps, style: {
11
+ ...style,
12
+ ...(noShadowBox && !invalid && { boxShadow: 'none' }),
13
+ }, intent: invalid ? 'danger' : intent }));
14
+ } }));
15
+ }
@@ -53,8 +53,8 @@ function ReactTableRow(props) {
53
53
  }, [onClick, row]);
54
54
  const { key: rowKey, ...otherKeyProps } = row.getRowProps();
55
55
  return (_jsx(ContextMenu, { options: contextMenu, onSelect: (selected) => onContextMenuSelect?.(selected, row.original), as: "tr", style: { position: 'static' }, css: getRowStyle(highlight.isActive || isRowActive, rowStyle, disableDefaultRowStyle), ...otherKeyProps, ...highlight.onHover, children: row.cells.map((cell) => {
56
- const { style, padding } = cell;
57
- if (cell.isRowSpanned) {
56
+ const { column: { style }, isRowSpanned, } = cell;
57
+ if (isRowSpanned) {
58
58
  return null;
59
59
  }
60
60
  else {
@@ -62,7 +62,7 @@ function ReactTableRow(props) {
62
62
  return (_jsx("td", { rowSpan: cell.rowSpan, ...otherColumnProps, onContextMenu: (e) => {
63
63
  e.preventDefault();
64
64
  return false;
65
- }, style: { padding, ...style }, onClick: clickHandler, children: cell.render('Cell') }, columnKey));
65
+ }, style: style, onClick: clickHandler, children: cell.render('Cell') }, columnKey));
66
66
  }
67
67
  }) }, rowKey));
68
68
  }
@@ -1,2 +1,4 @@
1
+ import { InputStyle } from '../Input';
1
2
  declare const ReactTableStyle: import("@emotion/react").SerializedStyles;
2
- export { ReactTableStyle };
3
+ declare const tableInputStyle: InputStyle;
4
+ export { ReactTableStyle, tableInputStyle };
@@ -32,4 +32,14 @@ const ReactTableStyle = css `
32
32
  border-right: 1px solid #dedede;
33
33
  }
34
34
  `;
35
- export { ReactTableStyle };
35
+ const tableInputStyle = {
36
+ input: {
37
+ width: '100%',
38
+ backgroundColor: 'transparent',
39
+ },
40
+ inputWrapper: {
41
+ borderRadius: 0,
42
+ borderWidth: 0,
43
+ },
44
+ };
45
+ export { ReactTableStyle, tableInputStyle };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { TableVirtualBoundary } from '../ReactTable';
3
2
  export declare const ReactTableProvider: import("react").Provider<TableVirtualBoundary | null>;
4
3
  export declare function useReactTableContext(): TableVirtualBoundary;
@@ -0,0 +1,26 @@
1
+ import { ButtonProps } from '@blueprintjs/core';
2
+ import { SelectProps } from '@blueprintjs/select';
3
+ import { ReactNode } from 'react';
4
+ import { useSelect } from 'react-science/ui';
5
+ import { FilterType } from '../utility/filterType';
6
+ interface ItemOptions<T> {
7
+ renderItem?: (item: T) => ReactNode;
8
+ defaultSelectedItem?: T;
9
+ }
10
+ interface ItemSelectOptions<T extends SelectDefaultItem = SelectDefaultItem> {
11
+ itemTextKey?: keyof FilterType<T, string>;
12
+ itemValueKey?: keyof T;
13
+ selectedItemValue?: T[keyof T];
14
+ }
15
+ type SelectOptions<T extends SelectDefaultItem = SelectDefaultItem> = ItemOptions<T> & ItemSelectOptions;
16
+ type ReturnedUseSelectOptions = ReturnType<typeof useSelect>;
17
+ export type Select2Props<T extends SelectDefaultItem = SelectDefaultItem> = Omit<SelectProps<T>, keyof Omit<ReturnedUseSelectOptions, 'onItemSelect' | 'value'>> & SelectOptions<T> & {
18
+ selectedButtonProps?: Omit<ButtonProps, 'text'>;
19
+ };
20
+ export declare function getDefaultSelectedItem<T extends SelectDefaultItem = SelectDefaultItem>(items: T[], itemValueKey?: keyof T, value?: any): T | undefined;
21
+ export interface SelectDefaultItem {
22
+ label: string;
23
+ value: any;
24
+ }
25
+ export declare function Select2<T extends SelectDefaultItem = SelectDefaultItem>(props: Select2Props<T>): import("react/jsx-runtime").JSX.Element;
26
+ export {};
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Button } from '@blueprintjs/core';
3
+ import { Select } from '@blueprintjs/select';
4
+ import { useEffect } from 'react';
5
+ import { useSelect } from 'react-science/ui';
6
+ export function getDefaultSelectedItem(items, itemValueKey, value) {
7
+ return items.find((item) => itemValueKey && item[itemValueKey] === value);
8
+ }
9
+ export function Select2(props) {
10
+ const { items, defaultSelectedItem, itemTextKey = 'label', itemValueKey = 'value', selectedItemValue, onItemSelect, selectedButtonProps, fill, ...otherProps } = props;
11
+ const { value: item, onItemSelect: innerOnItemSelect, setValue, ...defaultSelectProps } = useSelect({
12
+ defaultSelectedItem: defaultSelectedItem ??
13
+ getDefaultSelectedItem(items, itemValueKey, selectedItemValue),
14
+ itemTextKey: itemTextKey,
15
+ });
16
+ useEffect(() => {
17
+ const value = defaultSelectedItem ??
18
+ getDefaultSelectedItem(items, itemValueKey, selectedItemValue);
19
+ setValue(value || null);
20
+ }, [defaultSelectedItem, itemValueKey, items, selectedItemValue, setValue]);
21
+ return (_jsx(Select, { items: items, filterable: false, onItemSelect: (item, event) => {
22
+ innerOnItemSelect(item);
23
+ onItemSelect(item, event);
24
+ }, ...defaultSelectProps, ...otherProps, fill: fill, children: _jsx(Button, { fill: fill, text: item?.[itemTextKey] ? String(item[itemTextKey]) : '', ...selectedButtonProps, rightIcon: "double-caret-vertical" }) }));
25
+ }
@@ -0,0 +1,7 @@
1
+ import { ControllerProps, FieldValues } from 'react-hook-form';
2
+ import { Select2Props, SelectDefaultItem } from './Select2';
3
+ type Select2ControllerProps<T extends SelectDefaultItem = SelectDefaultItem, TFieldValues extends FieldValues = FieldValues> = {
4
+ controllerProps?: Omit<ControllerProps<TFieldValues>, 'render'>;
5
+ } & Pick<ControllerProps<TFieldValues>, 'control' | 'name'> & Omit<Select2Props<T>, 'onItemSelect' | 'selectedItemValue'> & Partial<Pick<Select2Props<T>, 'onItemSelect'>>;
6
+ export declare function Select2Controller<T extends SelectDefaultItem = SelectDefaultItem, TFieldValues extends FieldValues = FieldValues>(props: Select2ControllerProps<T, TFieldValues>): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Controller } from 'react-hook-form';
3
+ import { Select2 } from './Select2';
4
+ export function Select2Controller(props) {
5
+ const { name, control, controllerProps = {}, onItemSelect, ...otherSelectProps } = props;
6
+ return (_jsx(Controller, { name: name, control: control, ...controllerProps, render: ({ field }) => {
7
+ return (_jsx(Select2, { selectedItemValue: field.value, onItemSelect: (item, event) => {
8
+ field.onChange(item.value);
9
+ onItemSelect?.(item, event);
10
+ }, ...otherSelectProps }));
11
+ } }));
12
+ }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface Position {
3
2
  x: number;
4
3
  y: number;
@@ -1,6 +1,4 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { CSSObject } from '@emotion/react';
3
- import { ReactNode } from 'react';
1
+ import { CSSProperties, ReactNode } from 'react';
4
2
  export interface DropDownListItem {
5
3
  key: string;
6
4
  label: string;
@@ -18,7 +16,7 @@ interface DropDownButtonProps<T> extends DropDownListProps<T>, ItemProps {
18
16
  selectedKey?: string;
19
17
  onSelect?: (item: DropDownListItem) => void;
20
18
  formatSelectedValue?: (Item: DropDownListItem) => string;
21
- style?: CSSObject;
19
+ style?: CSSProperties;
22
20
  className?: string;
23
21
  }
24
22
  declare function DropDownButton<T extends DropDownListItem>(props: DropDownButtonProps<T>): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,54 +1,28 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
+ import { Popover, Button } from '@blueprintjs/core';
3
4
  import { css } from '@emotion/react';
4
- import { useCallback, useEffect, useRef, useState } from 'react';
5
+ import { useEffect, useState } from 'react';
5
6
  import { FaEllipsisH } from 'react-icons/fa';
6
7
  import DropDownList from './DropDownList';
7
- const arrowDownIcon = `url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="960px" height="560px" viewBox="0 0 960 560" enable-background="new 0 0 960 560" xml:space="preserve"><g id="Rounded_Rectangle_33_copy_4_1_"><path d="M480,344.181L268.869,131.889c-15.756-15.859-41.3-15.859-57.054,0c-15.754,15.857-15.754,41.57,0,57.431l237.632,238.937c8.395,8.451,19.562,12.254,30.553,11.698c10.993,0.556,22.159-3.247,30.555-11.698l237.631-238.937c15.756-15.86,15.756-41.571,0-57.431s-41.299-15.859-57.051,0L480,344.181z"/></g></svg>')`;
8
- const styles = {
9
- container: css `
10
- position: relative;
11
- border-radius: 10px;
12
- width: max-content;
13
- display: inline-block;
14
- border: 0.55px solid lightgray;
15
- font-size: 0.9em;
16
- background: ${arrowDownIcon} no-repeat right white;
17
- appearance: none;
18
- background-position-x: calc(100% - 0.5em);
19
- background-size: 1em 1em;
20
- `,
21
- button: css `
22
- width: 100%;
23
- padding: 0.3em 2em 0.3em 1em;
24
- `,
25
- };
26
8
  function DropDownButton(props) {
27
- const { data, selectedKey, onSelect, formatSelectedValue = (item) => item.label, renderItem = null, style, itemKey = 'key', labelKey = 'label', visibleKey = 'visible', className = '', } = props;
9
+ const { data, selectedKey, onSelect, formatSelectedValue = (item) => item.label, renderItem = null, style = {}, itemKey = 'key', labelKey = 'label', visibleKey = 'visible', className = '', } = props;
28
10
  const [open, setOpen] = useState(false);
29
11
  const [item, setItem] = useState();
30
- const drop = useRef(null);
31
12
  useEffect(() => {
32
13
  if (selectedKey) {
33
14
  const item = data.find((i) => i[itemKey] === selectedKey) || null;
34
15
  setItem(item);
35
16
  }
36
17
  }, [selectedKey, data, itemKey]);
37
- useEffect(() => {
38
- function handleClick() {
39
- setOpen(false);
40
- }
41
- window.addEventListener('click', handleClick);
42
- return () => window.removeEventListener('click', handleClick);
43
- }, []);
44
- const selectHandler = useCallback((index) => {
18
+ function selectHandler(index) {
19
+ setOpen(false);
45
20
  setItem(data[index]);
46
21
  onSelect?.(data[index]);
47
- setOpen(false);
48
- }, [data, onSelect]);
49
- return (_jsxs("div", { className: `dropdown ${className}`, ref: drop, css: [styles.container, style], children: [_jsx("button", { css: styles.button, type: "button", onClick: (event) => {
50
- setOpen((open) => !open);
51
- event.stopPropagation();
52
- }, children: !item ? _jsx(FaEllipsisH, {}) : formatSelectedValue(item) }), open && (_jsx(DropDownList, { data: data, onSelect: selectHandler, renderItem: renderItem, itemKey: itemKey, labelKey: labelKey, visibleKey: visibleKey }))] }));
22
+ }
23
+ return (_jsx(Popover, { isOpen: open, onClose: () => setOpen(false), className: className, minimal: true, position: "bottom", content: _jsx(DropDownList, { data: data, onSelect: selectHandler, renderItem: renderItem, itemKey: itemKey, labelKey: labelKey, visibleKey: visibleKey }), children: _jsx(Button, { style: { boxShadow: 'none', ...style }, css: css `
24
+ border: 0.55px solid lightgray;
25
+ border-radius: 5px;
26
+ `, rightIcon: "chevron-down", onClick: () => setOpen((flag) => !flag), children: !item ? _jsx(FaEllipsisH, {}) : formatSelectedValue(item) }) }));
53
27
  }
54
28
  export default DropDownButton;
@@ -1,20 +1,7 @@
1
1
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
- import { useLayoutEffect, useRef } from 'react';
5
4
  const styles = {
6
- container: css `
7
- background-color: white;
8
- position: absolute;
9
- height: auto;
10
- z-index: 99999999999999;
11
- box-shadow:
12
- 0 19px 38px rgb(0 0 0 / 30%),
13
- 0 15px 12px rgb(0 0 0 / 22%);
14
- border-radius: 10px;
15
- margin-bottom: 20px;
16
- overflow: hidden;
17
- `,
18
5
  ul: css `
19
6
  list-style-type: none;
20
7
  padding: 0;
@@ -31,8 +18,7 @@ const styles = {
31
18
  }
32
19
 
33
20
  &:hover {
34
- background-color: gray;
35
- color: white;
21
+ background-color: #f6f6f6;
36
22
  }
37
23
  `,
38
24
  label: css `
@@ -41,27 +27,12 @@ const styles = {
41
27
  `,
42
28
  };
43
29
  function DropDownList({ data = [], onSelect, renderItem = null, itemKey, labelKey, visibleKey, }) {
44
- const ref = useRef(null);
45
- useLayoutEffect(() => {
46
- const container = ref.current;
47
- if (container) {
48
- const { right } = container.getBoundingClientRect();
49
- const innerWidth = window.innerWidth - 30;
50
- if (right > innerWidth) {
51
- container.style.left = `-${right - innerWidth}px`;
52
- }
53
- }
54
- return () => {
55
- if (container) {
56
- container.style.left = '0px';
57
- }
58
- };
59
- }, []);
60
- return (_jsx("div", { css: styles.container, ref: ref, children: _jsx("ul", { css: styles.ul, children: data.map((item, index) => (_jsx("li", { css: styles.li, onClick: (e) => {
30
+ return (_jsx("div", { children: _jsx("ul", { css: styles.ul, children: data.map((item, index) => (_jsx("li", { css: styles.li, onClick: (e) => {
61
31
  e.stopPropagation();
62
32
  onSelect(index);
63
33
  }, style: {
64
34
  display: !(visibleKey in item) || item[visibleKey] ? 'block' : 'none',
35
+ cursor: 'pointer',
65
36
  }, children: renderItem?.(item) || (_jsx("span", { css: styles.label, children: item[labelKey] })) }, item[itemKey]))) }) }));
66
37
  }
67
38
  export default DropDownList;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface FormikColorPickerProps {
3
2
  name: string;
4
3
  onColorChange?: (element: any) => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InputStyle } from '../Input';
3
2
  import { LabelStyle } from '../Label';
4
3
  export declare const formatFieldInputStyle: InputStyle;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InputProps } from '../Input';
3
2
  export interface InputMapValueFunctions {
4
3
  mapOnChangeValue?: (value: string | number) => any;
@@ -0,0 +1,11 @@
1
+ import { Input2Props } from '../Input2';
2
+ export interface InputMapValueFunctions {
3
+ mapOnChangeValue?: (value: string | number) => any;
4
+ mapValue?: (value: any) => string | number;
5
+ }
6
+ interface FormikInputProps extends Input2Props, InputMapValueFunctions {
7
+ name: string;
8
+ checkErrorAfterInputTouched?: boolean;
9
+ }
10
+ declare const FormikInput2: import("react").ForwardRefExoticComponent<FormikInputProps & import("react").RefAttributes<HTMLInputElement>>;
11
+ export default FormikInput2;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useFormikContext } from 'formik';
3
+ import lodashGet from 'lodash/get';
4
+ import { forwardRef } from 'react';
5
+ import { Input2 } from '../Input2';
6
+ const FormikInput2 = forwardRef(function FormikInput2(props, ref) {
7
+ const { name, onChange, type = 'text', value = null, checkErrorAfterInputTouched = true, mapOnChangeValue, mapValue, ...resProps } = props;
8
+ const { values, handleChange, errors, touched, setFieldValue, handleBlur } = useFormikContext();
9
+ function changeHandler(value, e) {
10
+ onChange?.(value, e);
11
+ if (mapOnChangeValue) {
12
+ void setFieldValue(name, mapOnChangeValue(value));
13
+ }
14
+ else {
15
+ handleChange(e);
16
+ }
17
+ }
18
+ let isInvalid = lodashGet(errors, name);
19
+ if (checkErrorAfterInputTouched) {
20
+ isInvalid = lodashGet(errors, name) && lodashGet(touched, name);
21
+ }
22
+ let val = value || lodashGet(values, name);
23
+ val = mapValue ? mapValue(val) : val;
24
+ return (_jsx(Input2, { ref: ref, name: name, value: val, onChange: changeHandler, onBlur: handleBlur, type: type, intent: isInvalid ? 'danger' : 'none', ...resProps }));
25
+ });
26
+ export default FormikInput2;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface FormikOnChangeProps {
3
2
  onChange?: (value: any) => void;
4
3
  enableValidation?: boolean;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  export declare const ModalProvider: import("react").Provider<any>;
3
2
  export declare function useModal(): any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const ModalContent: ({ modal, onClose, onLayout }: {
3
2
  modal: any;
4
3
  onClose: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface Position {
3
2
  x1: number;
4
3
  x2: number;
@@ -0,0 +1 @@
1
+ export declare function useFormValidateField(): (name: string) => boolean;
@@ -0,0 +1,9 @@
1
+ import has from 'lodash/has';
2
+ import { useCallback } from 'react';
3
+ import { useFormContext } from 'react-hook-form';
4
+ export function useFormValidateField() {
5
+ const { formState: { errors }, } = useFormContext();
6
+ return useCallback((name) => {
7
+ return !has(errors, name);
8
+ }, [errors]);
9
+ }
@@ -1,26 +1,23 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Formik } from 'formik';
3
- import { Filters } from 'nmr-processing';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Checkbox } from '@blueprintjs/core';
3
+ import { yupResolver } from '@hookform/resolvers/yup';
4
+ import { Filters, } from 'nmr-processing';
4
5
  import { useRef, memo } from 'react';
6
+ import { useForm } from 'react-hook-form';
5
7
  import * as Yup from 'yup';
6
8
  import { defaultApodizationOptions } from '../../data/constants/DefaultApodizationOptions';
7
9
  import { useDispatch } from '../context/DispatchContext';
8
10
  import ActionButtons from '../elements/ActionButtons';
9
11
  import Label from '../elements/Label';
10
- import FormikCheckBox from '../elements/formik/FormikCheckBox';
11
- import FormikInput from '../elements/formik/FormikInput';
12
- import FormikOnChange from '../elements/formik/FormikOnChange';
12
+ import { NumberInput2Controller } from '../elements/NumberInput2Controller';
13
13
  import { useFilter } from '../hooks/useFilter';
14
14
  import { headerLabelStyle } from './Header';
15
15
  import { HeaderContainer } from './HeaderContainer';
16
- const inputStyle = {
17
- input: { width: '60px', textAlign: 'center' },
18
- inputWrapper: { height: '100%' },
19
- };
20
16
  const validationSchema = Yup.object().shape({
21
17
  lineBroadening: Yup.number().required(),
22
18
  gaussBroadening: Yup.number().required(),
23
19
  lineBroadeningCenter: Yup.number().required().min(0).max(1),
20
+ livePreview: Yup.boolean().required(),
24
21
  });
25
22
  const initialValues = {
26
23
  ...defaultApodizationOptions,
@@ -62,7 +59,25 @@ function ApodizationOptionsInnerPanel(props) {
62
59
  if (props.filter) {
63
60
  formData = { ...initialValues, ...props.filter.value, livePreview: true };
64
61
  }
65
- return (_jsx(HeaderContainer, { children: _jsx(Formik, { onSubmit: (values) => handleApplyFilter(values), initialValues: formData, validationSchema: validationSchema, children: ({ submitForm }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Line broadening:", shortTitle: "LB:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "lineBroadening", min: 0, max: 1, step: 0.1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "Gauss broadening:", shortTitle: "GB:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "gaussBroadening", min: 0, max: 1, step: 0.1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "Line broadening center [0 - 1]:", shortTitle: "LB center:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "lineBroadeningCenter", min: 0, max: 1, step: 0.1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "Live preview", style: { label: { padding: '0 5px' } }, children: _jsx(FormikCheckBox, { name: "livePreview" }) }), _jsx(FormikOnChange, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true }), _jsx(ActionButtons, { onDone: submitForm, onCancel: handleCancelFilter })] })) }) }));
62
+ const { handleSubmit, register, control, formState: { isValid }, } = useForm({
63
+ defaultValues: formData,
64
+ resolver: yupResolver(validationSchema),
65
+ mode: 'onChange',
66
+ });
67
+ function submitHandler() {
68
+ void handleSubmit((values) => handleApplyFilter(values, 'onChange'))();
69
+ }
70
+ const { onChange: onLivePreviewChange, ...otherLivePreviewOptions } = register('livePreview');
71
+ return (_jsxs(HeaderContainer, { children: [_jsx(Label, { title: "Line broadening:", shortTitle: "LB:", style: headerLabelStyle, children: _jsx(NumberInput2Controller, { control: control, name: "lineBroadening", debounceTime: 250, min: 0, max: 1, stepSize: 0.1, style: { width: '60px' }, onValueChange: () => {
72
+ submitHandler();
73
+ } }) }), _jsx(Label, { title: "Gauss broadening:", shortTitle: "GB:", style: headerLabelStyle, children: _jsx(NumberInput2Controller, { control: control, name: "gaussBroadening", debounceTime: 250, min: 0, max: 1, stepSize: 0.1, style: { width: '60px' }, onValueChange: () => {
74
+ submitHandler();
75
+ } }) }), _jsx(Label, { title: "Line broadening center [0 - 1]:", shortTitle: "LB center:", style: headerLabelStyle, children: _jsx(NumberInput2Controller, { control: control, name: "lineBroadeningCenter", debounceTime: 250, min: 0, max: 1, stepSize: 0.1, style: { width: '60px' }, onValueChange: () => {
76
+ submitHandler();
77
+ } }) }), _jsx(Label, { title: "Live preview", style: { label: { padding: '0 5px' } }, children: _jsx(Checkbox, { ...otherLivePreviewOptions, onChange: (event) => {
78
+ void onLivePreviewChange(event);
79
+ submitHandler();
80
+ }, style: { margin: 0 } }) }), _jsx(ActionButtons, { disabledDone: !isValid, onDone: () => handleSubmit((values) => handleApplyFilter(values))(), onCancel: handleCancelFilter })] }));
66
81
  }
67
82
  const MemoizedApodizationPanel = memo(ApodizationOptionsInnerPanel);
68
83
  export default function ApodizationOptionsPanel() {
@@ -1,4 +1 @@
1
- /// <reference types="react" />
2
- declare function AutoPeakPickingOptionPanel(): import("react/jsx-runtime").JSX.Element;
3
- declare const _default: import("react").MemoExoticComponent<typeof AutoPeakPickingOptionPanel>;
4
- export default _default;
1
+ export declare function AutoPeakPickingOptionPanel(): import("react/jsx-runtime").JSX.Element;
@@ -1,23 +1,16 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Formik } from 'formik';
3
- import { memo } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from '@blueprintjs/core';
3
+ import { yupResolver } from '@hookform/resolvers/yup';
4
+ import { useForm } from 'react-hook-form';
4
5
  import * as Yup from 'yup';
5
6
  import { useDispatch } from '../context/DispatchContext';
6
7
  import { useToaster } from '../context/ToasterContext';
7
- import Button from '../elements/Button';
8
8
  import Label from '../elements/Label';
9
- import FormikInput from '../elements/formik/FormikInput';
10
- import FormikSelect from '../elements/formik/FormikSelect';
9
+ import { NumberInput2Controller } from '../elements/NumberInput2Controller';
10
+ import { Select2Controller } from '../elements/Select2Controller';
11
11
  import { MIN_AREA_POINTS, useCheckPointsNumberInWindowArea, } from '../hooks/useCheckPointsNumberInWindowArea';
12
12
  import { headerLabelStyle } from './Header';
13
13
  import { HeaderContainer } from './HeaderContainer';
14
- const inputStyle = {
15
- input: {
16
- width: '60px',
17
- textAlign: 'center',
18
- },
19
- inputWrapper: { height: '100%' },
20
- };
21
14
  const LookFor = [
22
15
  {
23
16
  label: 'Positive',
@@ -36,6 +29,9 @@ const validationSchema = Yup.object().shape({
36
29
  maxNumberOfPeaks: Yup.number().min(0).required(),
37
30
  minMaxRatio: Yup.number().min(0).required(),
38
31
  noiseFactor: Yup.number().min(0).required(),
32
+ direction: Yup.mixed()
33
+ .oneOf(['both', 'negative', 'positive'])
34
+ .required(),
39
35
  });
40
36
  const INIT_VALUES = {
41
37
  maxNumberOfPeaks: 50,
@@ -43,10 +39,15 @@ const INIT_VALUES = {
43
39
  noiseFactor: 3,
44
40
  direction: 'positive',
45
41
  };
46
- function AutoPeakPickingOptionPanel() {
42
+ export function AutoPeakPickingOptionPanel() {
47
43
  const dispatch = useDispatch();
48
44
  const pointsNumber = useCheckPointsNumberInWindowArea();
49
45
  const toaster = useToaster();
46
+ const { handleSubmit, formState: { isValid }, control, } = useForm({
47
+ defaultValues: INIT_VALUES,
48
+ resolver: yupResolver(validationSchema),
49
+ mode: 'onChange',
50
+ });
50
51
  function handlePeakPicking(values) {
51
52
  if (pointsNumber > MIN_AREA_POINTS) {
52
53
  dispatch({
@@ -61,6 +62,5 @@ function AutoPeakPickingOptionPanel() {
61
62
  });
62
63
  }
63
64
  }
64
- return (_jsx(HeaderContainer, { children: _jsx(Formik, { initialValues: INIT_VALUES, onSubmit: handlePeakPicking, validationSchema: validationSchema, children: ({ handleSubmit, isValid }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Direction:", shortTitle: "", style: headerLabelStyle, children: _jsx(FormikSelect, { name: "direction", items: LookFor, style: { width: '85px' } }) }), _jsx(Label, { title: "Max number of peaks:", shortTitle: "Max peaks:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "maxNumberOfPeaks", style: inputStyle, min: 0, step: 1 }) }), _jsx(Label, { title: "Noise factor:", shortTitle: "Noise:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "noiseFactor", style: inputStyle, min: 0 }) }), _jsx(Label, { title: "Min/max Ratio:", shortTitle: "Ratio:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "minMaxRatio", style: inputStyle, step: 0.01, min: 0 }) }), _jsx(Button.Done, { onClick: () => handleSubmit(), style: { margin: '0 10px' }, disabled: !isValid, children: "Apply" })] })) }) }));
65
+ return (_jsxs(HeaderContainer, { children: [_jsx(Label, { title: "Direction:", shortTitle: "", style: headerLabelStyle, children: _jsx(Select2Controller, { control: control, name: "direction", items: LookFor }) }), _jsx(Label, { title: "Max number of peaks:", shortTitle: "Max peaks:", style: headerLabelStyle, children: _jsx(NumberInput2Controller, { control: control, name: "maxNumberOfPeaks", min: 0, stepSize: 1, style: { width: '60px' } }) }), _jsx(Label, { title: "Noise factor:", shortTitle: "Noise:", style: headerLabelStyle, children: _jsx(NumberInput2Controller, { control: control, name: "noiseFactor", min: 0, stepSize: 1, style: { width: '60px' } }) }), _jsx(Label, { title: "Min/max Ratio:", shortTitle: "Ratio:", style: headerLabelStyle, children: _jsx(NumberInput2Controller, { control: control, name: "minMaxRatio", min: 0, stepSize: 0.01, majorStepSize: 0.01, minorStepSize: 0.01, style: { width: '60px' } }) }), _jsx(Button, { intent: "success", onClick: () => handleSubmit(handlePeakPicking)(), style: { margin: '0 10px' }, disabled: !isValid, children: "Apply" })] }));
65
66
  }
66
- export default memo(AutoPeakPickingOptionPanel);