nmrium 0.32.0 → 0.33.0-pre.1667632695

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 (453) hide show
  1. package/lib/component/1d/Chart1D.js +1 -1
  2. package/lib/component/1d/LinesSeries.js +1 -1
  3. package/lib/component/1d/SpectraTracker.js +1 -1
  4. package/lib/component/1d/Viewer1D.js +1 -1
  5. package/lib/component/1d/XAxis.js +1 -1
  6. package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
  7. package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
  8. package/lib/component/1d/{Integral.d.ts → integral/Integral.d.ts} +0 -0
  9. package/lib/component/1d/{Integral.js → integral/Integral.js} +2 -2
  10. package/lib/component/1d/integral/IntegralIndicator.d.ts +9 -0
  11. package/lib/component/1d/integral/IntegralIndicator.js +27 -0
  12. package/lib/component/1d/{IntegralResizable.d.ts → integral/IntegralResizable.d.ts} +0 -0
  13. package/lib/component/1d/integral/IntegralResizable.js +69 -0
  14. package/lib/component/1d/{IntegralsSeries.d.ts → integral/IntegralsSeries.d.ts} +0 -0
  15. package/lib/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
  16. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  17. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
  18. package/lib/component/1d/multiplicityTree/buildTreeNode.js +3 -3
  19. package/lib/component/1d/peaks/PeakAnnotation.js +1 -1
  20. package/lib/component/1d/peaks/usePeakShapesPath.js +10 -6
  21. package/lib/component/1d/ranges/Range.js +27 -50
  22. package/lib/component/1d/tool/PeakPointer.js +1 -1
  23. package/lib/component/1d/utilities/scale.js +2 -2
  24. package/lib/component/2d/Contours.js +61 -42
  25. package/lib/component/2d/FooterBanner.js +2 -2
  26. package/lib/component/2d/Viewer2D.js +11 -14
  27. package/lib/component/2d/tools/XYLabelPointer.js +2 -2
  28. package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
  29. package/lib/component/2d/zones/IndicationLines.js +5 -8
  30. package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -15
  31. package/lib/component/NMRium.d.ts +1 -1
  32. package/lib/component/NMRium.js +6 -6
  33. package/lib/component/assignment/actions/initAssignment.js +17 -17
  34. package/lib/component/assignment/index.js +2 -2
  35. package/lib/component/context/PreferencesContext.js +3 -6
  36. package/lib/component/elements/Button.js +1 -1
  37. package/lib/component/elements/CheckBoxCell.js +1 -1
  38. package/lib/component/elements/ContextMenu.js +2 -2
  39. package/lib/component/elements/EditableColumn.js +3 -5
  40. package/lib/component/elements/GroupPane.d.ts +12 -0
  41. package/lib/component/elements/GroupPane.js +14 -0
  42. package/lib/component/elements/Input.js +7 -4
  43. package/lib/component/elements/IsotopesViewer.js +1 -1
  44. package/lib/component/elements/Label.js +1 -2
  45. package/lib/component/elements/MolecularFormulaInput.js +2 -0
  46. package/lib/component/elements/NumberInput.js +2 -2
  47. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
  48. package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -1
  49. package/lib/component/elements/ReactTable/ReactTable.js +72 -38
  50. package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +3 -2
  51. package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
  52. package/lib/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
  53. package/lib/component/elements/ReactTable/utility/useRowSpan.js +3 -7
  54. package/lib/component/elements/accordion/Accordion.js +2 -2
  55. package/lib/component/elements/draggble/useDraggable.js +1 -3
  56. package/lib/component/elements/dropDownButton/DropDownList.js +1 -2
  57. package/lib/component/elements/formik/FormikCheckBox.js +1 -1
  58. package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
  59. package/lib/component/elements/formik/FormikColorPicker.js +5 -8
  60. package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
  61. package/lib/component/elements/formik/FormikForm.js +2 -2
  62. package/lib/component/elements/formik/FormikInput.d.ts +0 -1
  63. package/lib/component/elements/formik/FormikInput.js +12 -20
  64. package/lib/component/elements/formik/FormikOnChange.d.ts +1 -1
  65. package/lib/component/elements/formik/FormikOnChange.js +13 -10
  66. package/lib/component/elements/formik/FormikSelect.js +1 -1
  67. package/lib/component/elements/formik/FormikSlider.d.ts +2 -4
  68. package/lib/component/elements/formik/FormikSlider.js +8 -11
  69. package/lib/component/elements/formik/FormikTextarea.js +1 -1
  70. package/lib/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
  71. package/lib/component/elements/popup/Alert/Provider.js +7 -7
  72. package/lib/component/elements/popup/Alert/index.d.ts +3 -4
  73. package/lib/component/elements/popup/Alert/index.js +3 -4
  74. package/lib/component/elements/popup/Modal/ModalContent.js +3 -1
  75. package/lib/component/elements/popup/Modal/Provider.js +16 -31
  76. package/lib/component/elements/popup/Modal/index.d.ts +4 -5
  77. package/lib/component/elements/popup/Modal/index.js +4 -5
  78. package/lib/component/header/Header.js +1 -1
  79. package/lib/component/hooks/useCombinedRefs.js +2 -2
  80. package/lib/component/hooks/useExport.d.ts +1 -1
  81. package/lib/component/hooks/useExport.js +9 -6
  82. package/lib/component/hooks/useFormatNumberByNucleus.js +1 -1
  83. package/lib/component/hooks/usePanelPreferences.js +9 -7
  84. package/lib/component/loader/DropZone.js +4 -4
  85. package/lib/component/modal/AlignSpectraModal.js +1 -1
  86. package/lib/component/modal/ExportAsMatrixModal.js +1 -1
  87. package/lib/component/modal/LoadJCAMPModal.js +2 -2
  88. package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
  89. package/lib/component/modal/MultipletAnalysisModal.js +3 -3
  90. package/lib/component/modal/PredictSpectraModal.js +5 -5
  91. package/lib/component/modal/editRange/EditRangeModal.js +4 -4
  92. package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
  93. package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
  94. package/lib/component/modal/setting/DatabasesTabContent.js +25 -20
  95. package/lib/component/modal/setting/DisplayTabContent.js +21 -27
  96. package/lib/component/modal/setting/FormattingTabContent.js +10 -10
  97. package/lib/component/modal/setting/GeneralSettings.js +11 -14
  98. package/lib/component/modal/setting/GeneralTabContent.js +3 -1
  99. package/lib/component/modal/setting/ToolsTabContent.js +18 -19
  100. package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -1
  101. package/lib/component/modal/setting/WorkspaceItem.js +36 -48
  102. package/lib/component/modal/setting/settingsValidation.d.ts +58 -57
  103. package/lib/component/modal/setting/settingsValidation.js +14 -12
  104. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
  105. package/lib/component/panels/InformationPanel.js +52 -56
  106. package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
  107. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
  108. package/lib/component/panels/MoleculesPanel/Utilities.js +6 -6
  109. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
  110. package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
  111. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
  112. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
  113. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
  114. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
  115. package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
  116. package/lib/component/panels/PeaksPanel/PeaksTable.js +2 -2
  117. package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
  118. package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
  119. package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
  120. package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -3
  121. package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
  122. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
  123. package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
  124. package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
  125. package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
  126. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +5 -5
  127. package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
  128. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -1
  129. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
  130. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.d.ts +1 -1
  131. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
  132. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
  133. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
  134. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
  135. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
  136. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
  137. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
  138. package/lib/component/panels/ZonesPanel/ZonesTable.js +8 -8
  139. package/lib/component/panels/databasePanel/DatabasePanel.js +5 -4
  140. package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
  141. package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
  142. package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -2
  143. package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -2
  144. package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
  145. package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
  146. package/lib/component/reducer/IgnoreActions.js +3 -3
  147. package/lib/component/reducer/Reducer.d.ts +40 -14
  148. package/lib/component/reducer/Reducer.js +12 -11
  149. package/lib/component/reducer/actions/CorrelationsActions.js +4 -4
  150. package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
  151. package/lib/component/reducer/actions/DomainActions.js +49 -67
  152. package/lib/component/reducer/actions/FiltersActions.js +3 -3
  153. package/lib/component/reducer/actions/HistoryActions.js +5 -5
  154. package/lib/component/reducer/actions/LoadActions.js +12 -0
  155. package/lib/component/reducer/actions/PreferencesActions.js +18 -37
  156. package/lib/component/reducer/actions/RangesActions.js +14 -12
  157. package/lib/component/reducer/actions/SpectrumsActions.js +10 -4
  158. package/lib/component/reducer/actions/ToolsActions.js +20 -35
  159. package/lib/component/reducer/actions/ZonesActions.js +2 -2
  160. package/lib/component/reducer/core/Constants.js +1 -1
  161. package/lib/component/reducer/helper/GetClosestNumber.js +2 -1
  162. package/lib/component/reducer/helper/Zoom1DManager.js +11 -10
  163. package/lib/component/reducer/helper/getSpectrum.js +3 -5
  164. package/lib/component/reducer/helper/getStrongestPeak.d.ts +1 -1
  165. package/lib/component/reducer/helper/getStrongestPeak.js +2 -3
  166. package/lib/component/reducer/preferences/actions/removeWorkspace.js +3 -10
  167. package/lib/component/reducer/preferences/actions/setPreferences.js +5 -6
  168. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -4
  169. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
  170. package/lib/component/tool/BrushX.js +3 -3
  171. package/lib/component/tool/BrushXY.js +5 -5
  172. package/lib/component/tool/CrossLinePointer.js +3 -3
  173. package/lib/component/toolbar/BasicToolBar.js +1 -1
  174. package/lib/component/utility/Evaluate.js +2 -2
  175. package/lib/component/utility/FileUtility.d.ts +2 -9
  176. package/lib/component/utility/FileUtility.js +11 -28
  177. package/lib/component/utility/GroupByInfoKey.d.ts +1 -1
  178. package/lib/component/utility/GroupByInfoKey.js +11 -13
  179. package/lib/component/utility/PathBuilder.js +1 -1
  180. package/lib/component/utility/PreferencesHelper.js +2 -3
  181. package/lib/component/utility/{Export.d.ts → export.d.ts} +0 -0
  182. package/lib/component/utility/{Export.js → export.js} +53 -78
  183. package/lib/component/utility/formatNumber.d.ts +6 -1
  184. package/lib/component/utility/formatNumber.js +5 -4
  185. package/lib/data/Filters.d.ts +16 -17
  186. package/lib/data/Filters.js +16 -17
  187. package/lib/data/FiltersManager.js +4 -3
  188. package/lib/data/PredictionManager.js +8 -10
  189. package/lib/data/SpectraManager.d.ts +1 -2
  190. package/lib/data/SpectraManager.js +25 -60
  191. package/lib/data/data1d/MultipleAnalysis.js +74 -70
  192. package/lib/data/data1d/Spectrum1D/SumManager.js +1 -1
  193. package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
  194. package/lib/data/data1d/Spectrum1D/index.d.ts +24 -25
  195. package/lib/data/data1d/Spectrum1D/index.js +24 -25
  196. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  197. package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
  198. package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
  199. package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
  200. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
  201. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
  202. package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
  203. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +35 -1
  204. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +35 -1
  205. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
  206. package/lib/data/data1d/database.js +45 -28
  207. package/lib/data/data1d/filter1d/apodization.js +2 -1
  208. package/lib/data/data1d/filter1d/fft.js +24 -7
  209. package/lib/data/data1d/filter1d/phaseCorrection.js +2 -2
  210. package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
  211. package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
  212. package/lib/data/data2d/Processing2D.d.ts +3 -3
  213. package/lib/data/data2d/Processing2D.js +7 -18
  214. package/lib/data/data2d/Spectrum2D/contours.d.ts +40 -0
  215. package/lib/data/data2d/Spectrum2D/contours.js +132 -0
  216. package/lib/data/data2d/Spectrum2D/index.d.ts +10 -11
  217. package/lib/data/data2d/Spectrum2D/index.js +10 -11
  218. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
  219. package/lib/data/data2d/Spectrum2D/shift/getShift.js +4 -5
  220. package/lib/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
  221. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
  222. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
  223. package/lib/data/molecules/MoleculeManager.js +1 -1
  224. package/lib/data/types/common/Source.d.ts +1 -0
  225. package/lib/data/types/data1d/index.d.ts +12 -13
  226. package/lib/data/types/data2d/Data2D.d.ts +2 -0
  227. package/lib/data/types/data2d/Datum2D.d.ts +0 -1
  228. package/lib/data/types/data2d/index.d.ts +8 -9
  229. package/lib/data/utilities/RangeUtilities.js +13 -9
  230. package/lib/data/utilities/ZoneUtilities.js +17 -13
  231. package/lib/data/utilities/checkModifierKeyActivated.js +1 -2
  232. package/lib/data/utilities/generateChar.js +8 -6
  233. package/lib/data/utilities/getAtom.js +1 -1
  234. package/lib/data/utilities/getAtomsFromMF.js +2 -2
  235. package/lib/data/utilities/getColor.js +3 -3
  236. package/lib/data/utilities/getSum.js +6 -3
  237. package/lib/versionInfo.js +1 -1
  238. package/lib-cjs/component/1d/Chart1D.js +1 -1
  239. package/lib-cjs/component/1d/LinesSeries.js +1 -1
  240. package/lib-cjs/component/1d/SpectraTracker.js +1 -1
  241. package/lib-cjs/component/1d/Viewer1D.js +1 -1
  242. package/lib-cjs/component/1d/XAxis.js +1 -1
  243. package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
  244. package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
  245. package/lib-cjs/component/1d/{Integral.js → integral/Integral.js} +2 -2
  246. package/lib-cjs/component/1d/integral/IntegralIndicator.js +31 -0
  247. package/lib-cjs/component/1d/integral/IntegralResizable.js +74 -0
  248. package/lib-cjs/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
  249. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  250. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
  251. package/lib-cjs/component/1d/multiplicityTree/buildTreeNode.js +3 -3
  252. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -1
  253. package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +10 -6
  254. package/lib-cjs/component/1d/ranges/Range.js +27 -50
  255. package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
  256. package/lib-cjs/component/1d/utilities/scale.js +2 -2
  257. package/lib-cjs/component/2d/Contours.js +60 -41
  258. package/lib-cjs/component/2d/FooterBanner.js +2 -2
  259. package/lib-cjs/component/2d/Viewer2D.js +11 -14
  260. package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
  261. package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
  262. package/lib-cjs/component/2d/zones/IndicationLines.js +5 -8
  263. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
  264. package/lib-cjs/component/NMRium.js +7 -7
  265. package/lib-cjs/component/assignment/actions/initAssignment.js +17 -17
  266. package/lib-cjs/component/assignment/index.js +2 -2
  267. package/lib-cjs/component/context/PreferencesContext.js +3 -6
  268. package/lib-cjs/component/elements/Button.js +1 -1
  269. package/lib-cjs/component/elements/CheckBoxCell.js +1 -1
  270. package/lib-cjs/component/elements/ContextMenu.js +2 -2
  271. package/lib-cjs/component/elements/EditableColumn.js +3 -5
  272. package/lib-cjs/component/elements/GroupPane.js +18 -0
  273. package/lib-cjs/component/elements/Input.js +7 -4
  274. package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
  275. package/lib-cjs/component/elements/Label.js +1 -2
  276. package/lib-cjs/component/elements/MolecularFormulaInput.js +2 -0
  277. package/lib-cjs/component/elements/NumberInput.js +2 -2
  278. package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
  279. package/lib-cjs/component/elements/ReactTable/ReactTable.js +71 -37
  280. package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
  281. package/lib-cjs/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
  282. package/lib-cjs/component/elements/ReactTable/utility/useRowSpan.js +3 -7
  283. package/lib-cjs/component/elements/accordion/Accordion.js +2 -2
  284. package/lib-cjs/component/elements/draggble/useDraggable.js +1 -3
  285. package/lib-cjs/component/elements/dropDownButton/DropDownList.js +1 -2
  286. package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
  287. package/lib-cjs/component/elements/formik/FormikColorPicker.js +4 -7
  288. package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
  289. package/lib-cjs/component/elements/formik/FormikForm.js +2 -2
  290. package/lib-cjs/component/elements/formik/FormikInput.js +12 -20
  291. package/lib-cjs/component/elements/formik/FormikOnChange.js +13 -10
  292. package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
  293. package/lib-cjs/component/elements/formik/FormikSlider.js +7 -10
  294. package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
  295. package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
  296. package/lib-cjs/component/elements/popup/Alert/Provider.js +8 -8
  297. package/lib-cjs/component/elements/popup/Alert/index.js +5 -5
  298. package/lib-cjs/component/elements/popup/Modal/ModalContent.js +3 -1
  299. package/lib-cjs/component/elements/popup/Modal/Provider.js +16 -31
  300. package/lib-cjs/component/elements/popup/Modal/index.js +7 -7
  301. package/lib-cjs/component/header/Header.js +1 -1
  302. package/lib-cjs/component/hooks/useCombinedRefs.js +2 -2
  303. package/lib-cjs/component/hooks/useExport.js +14 -11
  304. package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +1 -1
  305. package/lib-cjs/component/hooks/usePanelPreferences.js +9 -7
  306. package/lib-cjs/component/loader/DropZone.js +4 -4
  307. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
  308. package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -2
  309. package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -2
  310. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
  311. package/lib-cjs/component/modal/MultipletAnalysisModal.js +3 -3
  312. package/lib-cjs/component/modal/PredictSpectraModal.js +5 -5
  313. package/lib-cjs/component/modal/editRange/EditRangeModal.js +4 -4
  314. package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
  315. package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
  316. package/lib-cjs/component/modal/setting/DatabasesTabContent.js +25 -20
  317. package/lib-cjs/component/modal/setting/DisplayTabContent.js +21 -27
  318. package/lib-cjs/component/modal/setting/FormattingTabContent.js +10 -10
  319. package/lib-cjs/component/modal/setting/GeneralSettings.js +11 -14
  320. package/lib-cjs/component/modal/setting/GeneralTabContent.js +3 -1
  321. package/lib-cjs/component/modal/setting/ToolsTabContent.js +18 -19
  322. package/lib-cjs/component/modal/setting/WorkspaceItem.js +37 -49
  323. package/lib-cjs/component/modal/setting/settingsValidation.js +14 -12
  324. package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
  325. package/lib-cjs/component/panels/InformationPanel.js +51 -55
  326. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
  327. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -4
  328. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +6 -6
  329. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
  330. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
  331. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
  332. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -2
  333. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
  334. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
  335. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
  336. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +2 -2
  337. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +2 -2
  338. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
  339. package/lib-cjs/component/panels/RangesPanel/RangesTable.js +1 -1
  340. package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -3
  341. package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
  342. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
  343. package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
  344. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
  345. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
  346. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +6 -6
  347. package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
  348. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
  349. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
  350. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
  351. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
  352. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
  353. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
  354. package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
  355. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
  356. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -8
  357. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -4
  358. package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +20 -5
  359. package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -2
  360. package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
  361. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +1 -1
  362. package/lib-cjs/component/reducer/IgnoreActions.js +3 -3
  363. package/lib-cjs/component/reducer/Reducer.js +11 -10
  364. package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
  365. package/lib-cjs/component/reducer/actions/DomainActions.js +49 -67
  366. package/lib-cjs/component/reducer/actions/FiltersActions.js +3 -3
  367. package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
  368. package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
  369. package/lib-cjs/component/reducer/actions/PreferencesActions.js +18 -37
  370. package/lib-cjs/component/reducer/actions/RangesActions.js +14 -12
  371. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +9 -3
  372. package/lib-cjs/component/reducer/actions/ToolsActions.js +20 -35
  373. package/lib-cjs/component/reducer/actions/ZonesActions.js +2 -2
  374. package/lib-cjs/component/reducer/core/Constants.js +1 -1
  375. package/lib-cjs/component/reducer/helper/GetClosestNumber.js +2 -1
  376. package/lib-cjs/component/reducer/helper/Zoom1DManager.js +11 -10
  377. package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -5
  378. package/lib-cjs/component/reducer/helper/getStrongestPeak.js +2 -3
  379. package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +3 -10
  380. package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +5 -9
  381. package/lib-cjs/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
  382. package/lib-cjs/component/tool/BrushX.js +3 -3
  383. package/lib-cjs/component/tool/BrushXY.js +5 -5
  384. package/lib-cjs/component/tool/CrossLinePointer.js +3 -3
  385. package/lib-cjs/component/toolbar/BasicToolBar.js +1 -1
  386. package/lib-cjs/component/utility/Evaluate.js +2 -2
  387. package/lib-cjs/component/utility/FileUtility.js +11 -29
  388. package/lib-cjs/component/utility/GroupByInfoKey.js +11 -13
  389. package/lib-cjs/component/utility/PathBuilder.js +1 -1
  390. package/lib-cjs/component/utility/PreferencesHelper.js +2 -3
  391. package/lib-cjs/component/utility/{Export.js → export.js} +77 -79
  392. package/lib-cjs/component/utility/formatNumber.js +5 -4
  393. package/lib-cjs/data/Filters.js +17 -33
  394. package/lib-cjs/data/FiltersManager.js +4 -3
  395. package/lib-cjs/data/PredictionManager.js +8 -10
  396. package/lib-cjs/data/SpectraManager.js +26 -62
  397. package/lib-cjs/data/data1d/MultipleAnalysis.js +74 -70
  398. package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +1 -1
  399. package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
  400. package/lib-cjs/data/data1d/Spectrum1D/index.js +25 -25
  401. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  402. package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
  403. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
  404. package/lib-cjs/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
  405. package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
  406. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
  407. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
  408. package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
  409. package/lib-cjs/data/data1d/database.js +45 -28
  410. package/lib-cjs/data/data1d/filter1d/apodization.js +2 -1
  411. package/lib-cjs/data/data1d/filter1d/fft.js +23 -6
  412. package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +2 -2
  413. package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
  414. package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
  415. package/lib-cjs/data/data2d/Processing2D.js +7 -18
  416. package/lib-cjs/data/data2d/Spectrum2D/contours.js +138 -0
  417. package/lib-cjs/data/data2d/Spectrum2D/index.js +11 -11
  418. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
  419. package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +4 -5
  420. package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
  421. package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
  422. package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
  423. package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
  424. package/lib-cjs/data/utilities/RangeUtilities.js +13 -9
  425. package/lib-cjs/data/utilities/ZoneUtilities.js +17 -13
  426. package/lib-cjs/data/utilities/checkModifierKeyActivated.js +1 -2
  427. package/lib-cjs/data/utilities/generateChar.js +8 -6
  428. package/lib-cjs/data/utilities/getAtom.js +1 -1
  429. package/lib-cjs/data/utilities/getAtomsFromMF.js +2 -2
  430. package/lib-cjs/data/utilities/getColor.js +3 -3
  431. package/lib-cjs/data/utilities/getSum.js +6 -3
  432. package/lib-cjs/versionInfo.js +1 -1
  433. package/package.json +30 -26
  434. package/lib/component/1d/IntegralResizable.js +0 -72
  435. package/lib/component/elements/popup/helpers.d.ts +0 -1
  436. package/lib/component/elements/popup/helpers.js +0 -9
  437. package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +0 -1
  438. package/lib/component/panels/RangesPanel/TableColumns/format.js +0 -8
  439. package/lib/data/data1d/Data1DManager.d.ts +0 -3
  440. package/lib/data/data1d/Data1DManager.js +0 -98
  441. package/lib/data/data2d/Data2DManager.d.ts +0 -3
  442. package/lib/data/data2d/Data2DManager.js +0 -34
  443. package/lib/data/types/data2d/Contour.d.ts +0 -4
  444. package/lib/data/types/data2d/Contour.js +0 -1
  445. package/lib/data/types/data2d/Contours.d.ts +0 -2
  446. package/lib/data/types/data2d/Contours.js +0 -1
  447. package/lib-cjs/component/1d/IntegralResizable.js +0 -77
  448. package/lib-cjs/component/elements/popup/helpers.js +0 -13
  449. package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +0 -14
  450. package/lib-cjs/data/data1d/Data1DManager.js +0 -104
  451. package/lib-cjs/data/data2d/Data2DManager.js +0 -40
  452. package/lib-cjs/data/types/data2d/Contour.js +0 -2
  453. package/lib-cjs/data/types/data2d/Contours.js +0 -2
@@ -5,10 +5,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const react_d3_utils_1 = require("react-d3-utils");
7
7
  const VerticalAxis = (0, react_1.forwardRef)((props, ref) => {
8
- const { x, y, height, showGrid, ticks } = props;
8
+ const { x, y, height, width, showGrid, ticks } = props;
9
9
  return ((0, jsx_runtime_1.jsxs)("g", { ref: ref, transform: `translate(${x}, ${y})`, children: [(0, jsx_runtime_1.jsx)("line", { y2: height, x1: 15, x2: 15, stroke: "black" }), ticks.map(({ label, position }, index) => (
10
10
  // eslint-disable-next-line react/no-array-index-key
11
- (0, jsx_runtime_1.jsxs)("g", { children: [showGrid && props.width && ((0, jsx_runtime_1.jsx)("line", { y1: position, y2: position, x1: 15, x2: props.width - x, stroke: "lightgray" })), (0, jsx_runtime_1.jsx)("line", { y1: position, y2: position, x1: 15, x2: 10, stroke: "black" }), (0, jsx_runtime_1.jsx)("text", { y: position, dominantBaseline: "middle", textAnchor: "end", children: label })] }, index + label + position)))] }));
11
+ (0, jsx_runtime_1.jsxs)("g", { children: [showGrid && width && ((0, jsx_runtime_1.jsx)("line", { y1: position, y2: position, x1: 15, x2: width - x, stroke: "lightgray" })), (0, jsx_runtime_1.jsx)("line", { y1: position, y2: position, x1: 15, x2: 10, stroke: "black" }), (0, jsx_runtime_1.jsx)("text", { y: position, dominantBaseline: "middle", textAnchor: "end", children: label })] }, index + label + position)))] }));
12
12
  });
13
13
  function LinearVerticalAxis(props) {
14
14
  const { scale, ...other } = props;
@@ -4,13 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const groupBy_1 = __importDefault(require("lodash/groupBy"));
7
8
  const react_1 = require("react");
8
9
  const react_dom_1 = require("react-dom");
9
10
  const fa_1 = require("react-icons/fa");
10
11
  const react_transition_group_1 = require("react-transition-group");
11
12
  const Transition_1 = __importDefault(require("../Transition"));
12
13
  const Wrapper_1 = __importDefault(require("../Wrapper"));
13
- const helpers_1 = require("../helpers");
14
14
  const options_1 = require("../options");
15
15
  const Context_1 = require("./Context");
16
16
  const ProgressIndicator_1 = __importDefault(require("./ProgressIndicator"));
@@ -23,14 +23,14 @@ function Provider({ children, wrapperRef = null, offset = '5px', position = opti
23
23
  const ref = root.current;
24
24
  const timersIdRef = timersId.current;
25
25
  if (wrapperRef) {
26
- wrapperRef.appendChild(ref);
26
+ wrapperRef.append(ref);
27
27
  }
28
28
  return () => {
29
- if (ref) {
30
- if (wrapperRef) {
31
- timersIdRef.forEach(clearTimeout);
32
- wrapperRef.removeChild(ref);
29
+ if (ref && wrapperRef) {
30
+ for (const id of timersIdRef) {
31
+ clearTimeout(id);
33
32
  }
33
+ ref.remove();
34
34
  }
35
35
  };
36
36
  }, [wrapperRef]);
@@ -45,7 +45,7 @@ function Provider({ children, wrapperRef = null, offset = '5px', position = opti
45
45
  });
46
46
  }, []);
47
47
  const show = (0, react_1.useCallback)((message = '', options = {}) => {
48
- const id = Math.random().toString(36).substring(2, 9);
48
+ const id = Math.random().toString(36).slice(2, 9);
49
49
  const alertOptions = {
50
50
  position: options.position || position,
51
51
  timeout,
@@ -101,7 +101,7 @@ function Provider({ children, wrapperRef = null, offset = '5px', position = opti
101
101
  const closeHandler = (0, react_1.useCallback)((alert) => {
102
102
  remove(alert);
103
103
  }, [remove]);
104
- const alertsByPosition = (0, helpers_1.groupBy)(alerts, (alert) => alert.options.position);
104
+ const alertsByPosition = (0, groupBy_1.default)(alerts, (alert) => alert.options.position);
105
105
  const parentStyle = (0, react_1.useMemo)(() => {
106
106
  return wrapperRef
107
107
  ? wrapperRef.getBoundingClientRect()
@@ -3,12 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.transitions = exports.types = exports.positions = exports.useAlert = exports.AlertProvider = void 0;
7
- const options_1 = require("../options");
6
+ exports.AlertProvider = exports.useAlert = exports.transitions = exports.types = exports.positions = void 0;
7
+ var options_1 = require("../options");
8
8
  Object.defineProperty(exports, "positions", { enumerable: true, get: function () { return options_1.positions; } });
9
9
  Object.defineProperty(exports, "types", { enumerable: true, get: function () { return options_1.types; } });
10
10
  Object.defineProperty(exports, "transitions", { enumerable: true, get: function () { return options_1.transitions; } });
11
- const Context_1 = require("./Context");
11
+ var Context_1 = require("./Context");
12
12
  Object.defineProperty(exports, "useAlert", { enumerable: true, get: function () { return Context_1.useAlert; } });
13
- const Provider_1 = __importDefault(require("./Provider"));
14
- exports.AlertProvider = Provider_1.default;
13
+ var Provider_1 = require("./Provider");
14
+ Object.defineProperty(exports, "AlertProvider", { enumerable: true, get: function () { return __importDefault(Provider_1).default; } });
@@ -17,7 +17,9 @@ const ModalContent = ({ modal, onClose, onLayout }) => {
17
17
  }) }));
18
18
  });
19
19
  (0, react_1.useEffect)(() => {
20
- if (isFinite(height) && isFinite(width) && !contentSize.current) {
20
+ if (Number.isFinite(height) &&
21
+ Number.isFinite(width) &&
22
+ !contentSize.current) {
21
23
  contentSize.current = { width, height };
22
24
  onLayout({ modal, layout: { width, height } });
23
25
  }
@@ -36,13 +36,11 @@ function Provider({ children, style, offset = '0px', position = options_1.positi
36
36
  root.current = document.createElement('div');
37
37
  const ref = root.current;
38
38
  if (wrapperRef) {
39
- wrapperRef.appendChild(ref);
39
+ wrapperRef.append(ref);
40
40
  }
41
41
  return () => {
42
- if (ref) {
43
- if (wrapperRef) {
44
- wrapperRef.removeChild(ref);
45
- }
42
+ if (ref && wrapperRef) {
43
+ ref.remove();
46
44
  }
47
45
  };
48
46
  }, [wrapperRef]);
@@ -82,10 +80,11 @@ function Provider({ children, style, offset = '0px', position = options_1.positi
82
80
  * @param {Array<{ handler: Function,text: string,style: object}>} dialogOptions.buttons
83
81
  * @param {object} dialogOptions.tyle
84
82
  */
85
- const showConfirmDialog = (0, react_2.useCallback)((dialogOptions, options = { enableResizing: false }) => {
83
+ const showConfirmDialog = (0, react_2.useCallback)((dialogOptions, options = {}) => {
84
+ const { enableResizing = false, ...otherOptions } = options;
86
85
  const _modal = {
87
86
  component: (0, jsx_runtime_1.jsx)(ConfirmDialog_1.default, { ...dialogOptions }),
88
- options: { isBackgroundBlur: true, ...options },
87
+ options: { isBackgroundBlur: true, enableResizing, ...otherOptions },
89
88
  };
90
89
  _modal.close = close;
91
90
  setModal(_modal);
@@ -126,28 +125,20 @@ function Provider({ children, style, offset = '0px', position = options_1.positi
126
125
  : { pointerEvents: 'none' };
127
126
  const modalContextValue = (0, react_2.useMemo)(() => ({ show, close, showConfirmDialog }), [show, close, showConfirmDialog]);
128
127
  const contentLayoutHandler = (0, react_2.useCallback)(({ modal, layout }) => {
129
- const width = modal.options.width
130
- ? modal.options.width
131
- : layout.width > parentStyle.width
132
- ? parentStyle.width
133
- : layout.width;
134
- const height = modal.options.height
135
- ? modal.options.height
136
- : layout.height > parentStyle.height
128
+ const width = modal.options.width ||
129
+ (layout.width > parentStyle.width ? parentStyle.width : layout.width);
130
+ const height = modal.options.height ||
131
+ (layout.height > parentStyle.height
137
132
  ? parentStyle.height
138
- : layout.height;
133
+ : layout.height);
139
134
  modalRef.current.updateSize({ width, height });
140
135
  }, [parentStyle.height, parentStyle.width]);
141
136
  return ((0, jsx_runtime_1.jsxs)(Context_1.ModalProvider, { value: modalContextValue, children: [children, root.current &&
142
137
  (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(react_2.Fragment, { children: modal ? ((0, jsx_runtime_1.jsx)("div", { css: styles, style: {
143
138
  ...outerStyle,
144
139
  }, children: (0, jsx_runtime_1.jsx)(react_transition_group_1.TransitionGroup, { appear: true, options: {
145
- position: modal.options.position
146
- ? modal.options.position
147
- : position,
148
- }, containerStyle: parentStyle, component: Wrapper_1.default, children: (0, jsx_runtime_1.jsx)(Transition_1.default, { type: modal.options.transition
149
- ? modal.options.transition
150
- : transition, transitionStyles: {
140
+ position: modal.options.position || position,
141
+ }, containerStyle: parentStyle, component: Wrapper_1.default, children: (0, jsx_runtime_1.jsx)(Transition_1.default, { type: modal.options.transition || transition, transitionStyles: {
151
142
  ...transitionStyles,
152
143
  default: {
153
144
  width: modal.options.width
@@ -158,12 +149,8 @@ function Provider({ children, style, offset = '0px', position = options_1.positi
158
149
  ? `${modal.options.height}px`
159
150
  : 'auto',
160
151
  }, children: (0, jsx_runtime_1.jsx)(react_rnd_1.Rnd, { maxWidth: parentStyle.width, maxHeight: parentStyle.height, ref: modalRef, default: {
161
- width: modal.options.width
162
- ? modal.options.width
163
- : 'auto',
164
- height: modal.options.height
165
- ? modal.options.height
166
- : 'auto',
152
+ width: modal.options.width || 'auto',
153
+ height: modal.options.height || 'auto',
167
154
  x: 0,
168
155
  y: 0,
169
156
  }, className: "rnd-container", style: {
@@ -172,8 +159,6 @@ function Provider({ children, style, offset = '0px', position = options_1.positi
172
159
  position: 'static',
173
160
  pointerEvents: 'all',
174
161
  userSelect: 'none',
175
- }, enableResizing: modal.options.enableResizing, dragHandleClassName: "handle", enableUserSelectHack: false, children: (0, jsx_runtime_1.jsx)(ModalContent_1.default, { modal: modal, onClose: close, onLayout: contentLayoutHandler }) }) }, modal.id) }, options_1.positions[modal.options.transition
176
- ? modal.options.transition
177
- : transition]) })) : null }), root.current)] }));
162
+ }, enableResizing: modal.options.enableResizing, dragHandleClassName: "handle", enableUserSelectHack: false, children: (0, jsx_runtime_1.jsx)(ModalContent_1.default, { modal: modal, onClose: close, onLayout: contentLayoutHandler }) }) }, modal.id) }, options_1.positions[modal.options.transition || transition]) })) : null }), root.current)] }));
178
163
  }
179
164
  exports.default = Provider;
@@ -3,13 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.transitions = exports.positions = exports.useModal = exports.ModalProvider = exports.Modal = void 0;
7
- const options_1 = require("../options");
6
+ exports.ModalProvider = exports.Modal = exports.useModal = exports.transitions = exports.positions = void 0;
7
+ var options_1 = require("../options");
8
8
  Object.defineProperty(exports, "positions", { enumerable: true, get: function () { return options_1.positions; } });
9
9
  Object.defineProperty(exports, "transitions", { enumerable: true, get: function () { return options_1.transitions; } });
10
- const Context_1 = require("./Context");
10
+ var Context_1 = require("./Context");
11
11
  Object.defineProperty(exports, "useModal", { enumerable: true, get: function () { return Context_1.useModal; } });
12
- const Modal_1 = __importDefault(require("./Modal"));
13
- exports.Modal = Modal_1.default;
14
- const Provider_1 = __importDefault(require("./Provider"));
15
- exports.ModalProvider = Provider_1.default;
12
+ var Modal_1 = require("./Modal");
13
+ Object.defineProperty(exports, "Modal", { enumerable: true, get: function () { return __importDefault(Modal_1).default; } });
14
+ var Provider_1 = require("./Provider");
15
+ Object.defineProperty(exports, "ModalProvider", { enumerable: true, get: function () { return __importDefault(Provider_1).default; } });
@@ -51,7 +51,7 @@ function HeaderInner(props) {
51
51
  }, [selectedOptionPanel]);
52
52
  const openGeneralSettingsHandler = (0, react_1.useCallback)(() => {
53
53
  modal.show((0, jsx_runtime_1.jsx)(GeneralSettings_1.default, {}), {
54
- position: Modal_1.positions.TOP_CENTER,
54
+ position: Modal_1.positions.MIDDLE,
55
55
  enableResizing: true,
56
56
  width: 600,
57
57
  height: 400,
@@ -4,7 +4,7 @@ const react_1 = require("react");
4
4
  function useCombinedRefs(refs) {
5
5
  const targetRef = (0, react_1.useRef)();
6
6
  (0, react_1.useEffect)(() => {
7
- refs.forEach((ref) => {
7
+ for (const ref of refs) {
8
8
  if (!ref)
9
9
  return;
10
10
  if (typeof ref === 'function') {
@@ -13,7 +13,7 @@ function useCombinedRefs(refs) {
13
13
  else {
14
14
  ref.current = targetRef.current;
15
15
  }
16
- });
16
+ }
17
17
  }, [refs]);
18
18
  return targetRef;
19
19
  }
@@ -11,7 +11,7 @@ const GlobalContext_1 = require("../context/GlobalContext");
11
11
  const Alert_1 = require("../elements/popup/Alert");
12
12
  const Modal_1 = require("../elements/popup/Modal");
13
13
  const SaveAsModal_1 = __importDefault(require("../modal/SaveAsModal"));
14
- const Export_1 = require("../utility/Export");
14
+ const export_1 = require("../utility/export");
15
15
  function useExport() {
16
16
  const { rootRef } = (0, GlobalContext_1.useGlobal)();
17
17
  const modal = (0, Modal_1.useModal)();
@@ -21,25 +21,28 @@ function useExport() {
21
21
  if (state.data.length > 0 && rootRef) {
22
22
  const hideLoading = await alert.showLoading('Exporting as NMRium process in progress');
23
23
  setTimeout(() => {
24
- (0, Export_1.copyPNGToClipboard)(rootRef, 'nmrSVG');
24
+ (0, export_1.copyPNGToClipboard)(rootRef, 'nmrSVG');
25
25
  hideLoading();
26
26
  alert.success('Image copied to clipboard');
27
27
  }, 0);
28
28
  }
29
29
  }, [rootRef, alert, state]);
30
- const saveAsJSONHandler = (0, react_1.useCallback)(async (spaceIndent = 0, isCompressed = true) => {
30
+ const saveAsJSONHandler = (0, react_1.useCallback)((spaceIndent = 0, isCompressed = true) => {
31
31
  if (state.data.length > 0) {
32
- const hideLoading = await alert.showLoading('Exporting as NMRium process in progress');
33
- setTimeout(() => {
32
+ alert
33
+ .showLoading('Exporting as NMRium process in progress')
34
+ .then((hideLoading) => {
34
35
  async function handle() {
35
36
  //exported file name by default will be the first spectrum name
36
37
  const fileName = state.data[0]?.display?.name;
37
38
  const exportedData = (0, SpectraManager_1.toJSON)(state, 'nmrium');
38
- await (0, Export_1.exportAsJSON)(exportedData, fileName, spaceIndent, isCompressed);
39
+ await (0, export_1.exportAsJSON)(exportedData, fileName, spaceIndent, isCompressed);
39
40
  hideLoading();
40
41
  }
41
- void handle();
42
- }, 0);
42
+ setTimeout(() => {
43
+ void handle();
44
+ }, 0);
45
+ });
43
46
  }
44
47
  }, [alert, state]);
45
48
  const saveAsSVGHandler = (0, react_1.useCallback)(async () => {
@@ -47,7 +50,7 @@ function useExport() {
47
50
  const hideLoading = await alert.showLoading('Exporting as SVG process in progress');
48
51
  setTimeout(() => {
49
52
  const fileName = state.data[0]?.display?.name;
50
- (0, Export_1.exportAsSVG)(rootRef, 'nmrSVG', fileName);
53
+ (0, export_1.exportAsSVG)(rootRef, 'nmrSVG', fileName);
51
54
  hideLoading();
52
55
  }, 0);
53
56
  }
@@ -57,7 +60,7 @@ function useExport() {
57
60
  const hideLoading = await alert.showLoading('Exporting as PNG process in progress');
58
61
  setTimeout(() => {
59
62
  const fileName = state.data[0]?.display?.name;
60
- (0, Export_1.exportAsPng)(rootRef, 'nmrSVG', fileName);
63
+ (0, export_1.exportAsPng)(rootRef, 'nmrSVG', fileName);
61
64
  hideLoading();
62
65
  }, 0);
63
66
  }
@@ -70,7 +73,7 @@ function useExport() {
70
73
  void (async () => {
71
74
  const exportedData = (0, SpectraManager_1.toJSON)(state, 'nmrium', dataExportOption);
72
75
  const spaceIndent = pretty ? 2 : 0;
73
- await (0, Export_1.exportAsJSON)(exportedData, name, spaceIndent, compressed);
76
+ await (0, export_1.exportAsJSON)(exportedData, name, spaceIndent, compressed);
74
77
  hideLoading();
75
78
  })();
76
79
  }, 0);
@@ -31,7 +31,7 @@ function useFormatNumberByNucleus(nucleus) {
31
31
  return nucleus.map((n) => formatFun(n));
32
32
  }
33
33
  else {
34
- throw Error('nuclus must be string or array of string');
34
+ throw new Error('nuclus must be string or array of string');
35
35
  }
36
36
  }, [nucleus, nucleusByKey]);
37
37
  }
@@ -51,12 +51,14 @@ function usePanelPreferencesByNuclei(panelKey, nuclei) {
51
51
  const { current } = (0, PreferencesContext_1.usePreferences)();
52
52
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
53
53
  const { nuclei: omitNuclei = null, ...restPreferences } = getPanelPreferences(current, panelKey);
54
- return (0, react_1.useMemo)(() => ({
55
- nuclei: nuclei.reduce((acc, nucleusLabel) => {
56
- acc[nucleusLabel] = getPanelPreferences(current, panelKey, nucleusLabel, true);
57
- return acc;
58
- }, {}),
59
- ...restPreferences,
60
- }), [current, nuclei, panelKey, restPreferences]);
54
+ return (0, react_1.useMemo)(() => {
55
+ return {
56
+ nuclei: Object.fromEntries(nuclei.map((nucleusLabel) => [
57
+ nucleusLabel,
58
+ getPanelPreferences(current, panelKey, nucleusLabel, true),
59
+ ])),
60
+ ...restPreferences,
61
+ };
62
+ }, [current, nuclei, panelKey, restPreferences]);
61
63
  }
62
64
  exports.usePanelPreferencesByNuclei = usePanelPreferencesByNuclei;
@@ -48,16 +48,16 @@ function DropZone(props) {
48
48
  const dispatch = (0, DispatchContext_1.useDispatch)();
49
49
  const isToolEnabled = (0, useCheckToolsVisibility_1.useCheckToolsVisibility)();
50
50
  const loadFilesHandler = (0, react_2.useCallback)((files) => {
51
- files.forEach((file) => {
51
+ for (const file of files) {
52
52
  Object.defineProperty(file, 'webkitRelativePath', { value: file.path });
53
- });
53
+ }
54
54
  (0, filelist_utils_1.fileCollectionFromFileList)(files)
55
55
  .then((fileCollection) => {
56
56
  dispatch({ type: Types_1.LOAD_DROP_FILES, fileCollection });
57
57
  })
58
- .catch((e) => {
58
+ .catch((error) => {
59
59
  dispatch({ type: Types_1.SET_LOADING_FLAG, isLoading: false });
60
- reportError(e);
60
+ reportError(error);
61
61
  });
62
62
  }, [dispatch]);
63
63
  const onDrop = (0, react_2.useCallback)((droppedFiles) => {
@@ -26,7 +26,7 @@ function AlignSpectraModal({ onClose = () => null, nucleus, }) {
26
26
  ? Object.entries(References_1.REFERENCES[nucleus]).map((item) => ({
27
27
  value: item[0],
28
28
  label: item[0],
29
- }), [])
29
+ }))
30
30
  : [];
31
31
  return baseList.concat(list);
32
32
  }, [nucleus]);
@@ -13,7 +13,7 @@ const Label_1 = __importDefault(require("../elements/Label"));
13
13
  const FormikForm_1 = __importDefault(require("../elements/formik/FormikForm"));
14
14
  const FormikInput_1 = __importDefault(require("../elements/formik/FormikInput"));
15
15
  const Events_1 = __importDefault(require("../utility/Events"));
16
- const Export_1 = require("../utility/Export");
16
+ const export_1 = require("../utility/export");
17
17
  const ModalStyle_1 = require("./ModalStyle");
18
18
  const INITIAL_VALUE = { from: -1, to: 1, nbPoints: 1024 };
19
19
  function ExportAsMatrixModal({ onClose = () => null, }) {
@@ -23,7 +23,7 @@ function ExportAsMatrixModal({ onClose = () => null, }) {
23
23
  refForm.current.submitForm();
24
24
  }, []);
25
25
  const submitHandler = (0, react_1.useCallback)((options) => {
26
- (0, Export_1.exportAsMatrix)(data, options, 'fileName');
26
+ (0, export_1.exportAsMatrix)(data, options, 'fileName');
27
27
  onClose();
28
28
  }, [data, onClose]);
29
29
  (0, react_1.useEffect)(() => {
@@ -57,13 +57,13 @@ const styles = (0, react_1.css) `
57
57
  }
58
58
  }
59
59
  `;
60
- const allowedExtensions = ['dx', 'jdx'];
60
+ const allowedExtensions = new Set(['dx', 'jdx']);
61
61
  function LoadJCAMPModal({ onLoadClick, onClose, startLoading, }) {
62
62
  const pathReft = (0, react_2.useRef)();
63
63
  const loadJCAMPHandler = (0, react_2.useCallback)(() => {
64
64
  const path = pathReft.current.value;
65
65
  const { name, extension } = (0, FileUtility_1.extractFileMetaFromPath)(path);
66
- if (allowedExtensions.includes(extension)) {
66
+ if (allowedExtensions.has(extension)) {
67
67
  startLoading?.();
68
68
  void (0, FileUtility_1.loadFile)(path, { asBuffer: true }).then((data) => {
69
69
  const file = {
@@ -97,7 +97,7 @@ function MultipleSpectraFiltersModal({ onClose = () => null, nucleus = '', }) {
97
97
  ? Object.entries(References_1.REFERENCES[nucleus]).map((item) => ({
98
98
  value: item[0],
99
99
  label: item[0],
100
- }), [])
100
+ }))
101
101
  : [];
102
102
  return baseList.concat(list);
103
103
  }, [nucleus]);
@@ -132,9 +132,9 @@ function MultipletAnalysisModal({ data, activeSpectrum, scaleX, startX, endX, on
132
132
  setCalcFinished(true);
133
133
  setAnalysisData(result);
134
134
  }
135
- catch (err) {
136
- // eslint-disable-next-line no-console
137
- console.log(err);
135
+ catch (error) {
136
+ // TODO: handle error
137
+ reportError(error);
138
138
  }
139
139
  }
140
140
  }, [startX, endX, data, scaleX, activeSpectrum, calcStart]);
@@ -165,13 +165,13 @@ function PredictSpectraModal({ onClose = () => null, molfile, }) {
165
165
  isLoading: true,
166
166
  });
167
167
  const predictedSpectra = Object.entries(values.spectra)
168
- .reduce((acc, [key, value]) => {
168
+ .map(([key, value]) => {
169
169
  if (value) {
170
- acc.push(key);
170
+ return key;
171
171
  }
172
- return acc;
173
- }, [])
174
- .join(' , ');
172
+ return undefined;
173
+ })
174
+ .join(',');
175
175
  const hideLoading = await alert.showLoading(`Predict ${predictedSpectra} in progress`);
176
176
  dispatch({
177
177
  type: Types_1.PREDICT_SPECTRA,
@@ -100,19 +100,19 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
100
100
  let counterJ = 0;
101
101
  const couplings = [];
102
102
  if (signal.multiplicity) {
103
- signal.multiplicity.split('').forEach((_multiplicity) => {
103
+ for (const multiplicity of signal.multiplicity.split('')) {
104
104
  let js = {
105
- multiplicity: _multiplicity,
105
+ multiplicity,
106
106
  coupling: '',
107
107
  };
108
- if ((0, MultiplicityUtilities_1.hasCouplingConstant)(_multiplicity) && signal?.js) {
108
+ if ((0, MultiplicityUtilities_1.hasCouplingConstant)(multiplicity) && signal?.js) {
109
109
  js = { ...signal.js[counterJ] };
110
110
  js.coupling = Number((0, formatNumber_1.formatNumber)(js.coupling, rangesPreferences.coupling.format));
111
111
  counterJ++;
112
112
  }
113
113
  js.multiplicity = (0, MultiplicityUtilities_1.translateMultiplet)(js.multiplicity || '');
114
114
  couplings.push(js);
115
- });
115
+ }
116
116
  }
117
117
  return { ...signal, js: couplings };
118
118
  });
@@ -21,7 +21,7 @@ const styles = {
21
21
  color: 'red',
22
22
  },
23
23
  };
24
- const EDIT_SIGNAL_INFO_TEXT = `Focus on an input field and press Shift + Drag &#38; Drop to draw a coupling constant in spectrum view.`;
24
+ const EDIT_SIGNAL_INFO_TEXT = `Focus on an input field and press Shift + Drag and Drop to draw a coupling constant in spectrum view.`;
25
25
  const ADD_SIGNAL_INFO_TEXT = `Focus on the input field and press Shift + Left mouse click to select new signal delta value in spectrum view.`;
26
26
  const InfoText = (props) => {
27
27
  const { value, type = 'info' } = props;
@@ -36,8 +36,8 @@ const useValidation = () => (0, react_1.useMemo)(() => {
36
36
  coupling: Yup.mixed().test('checkValue', '', function testCoupling(value) {
37
37
  const { path, createError } = this;
38
38
  const hasCoupling = (0, MultiplicityUtilities_1.hasCouplingConstant)(this.parent.multiplicity);
39
- if ((!hasCoupling && isNaN(value)) ||
40
- (hasCoupling && !isNaN(value))) {
39
+ if ((!hasCoupling && Number.isNaN(Number(value))) ||
40
+ (hasCoupling && !Number.isNaN(Number(value)))) {
41
41
  return true;
42
42
  }
43
43
  return createError({
@@ -7,9 +7,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const uuid_1 = require("@lukeed/uuid");
8
8
  const formik_1 = require("formik");
9
9
  const get_1 = __importDefault(require("lodash/get"));
10
- const react_1 = require("react");
11
10
  const fa_1 = require("react-icons/fa");
12
11
  const Button_1 = __importDefault(require("../../elements/Button"));
12
+ const GroupPane_1 = require("../../elements/GroupPane");
13
13
  const FormikCheckBox_1 = __importDefault(require("../../elements/formik/FormikCheckBox"));
14
14
  const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
15
15
  const getPreferencesByWorkspace_1 = require("../../reducer/preferences/utilities/getPreferencesByWorkspace");
@@ -38,13 +38,13 @@ const style = {
38
38
  };
39
39
  function DatabasesTabContent({ currentWorkspace }) {
40
40
  const { values, setFieldValue } = (0, formik_1.useFormikContext)();
41
- const databases = (0, react_1.useMemo)(() => (0, get_1.default)(values, 'databases', []), [values]);
42
- const deleteHandler = (0, react_1.useCallback)((index) => {
41
+ const databases = (0, get_1.default)(values, 'databases', []);
42
+ function deleteHandler(index) {
43
43
  const _database = databases.data.slice();
44
44
  _database.splice(index, 1);
45
45
  setFieldValue('databases.data', _database);
46
- }, [databases, setFieldValue]);
47
- const addNewDatabaseHandler = (0, react_1.useCallback)(() => {
46
+ }
47
+ function addHandler() {
48
48
  const newDatabase = {
49
49
  key: (0, uuid_1.v4)(),
50
50
  label: '',
@@ -52,27 +52,32 @@ function DatabasesTabContent({ currentWorkspace }) {
52
52
  enabled: true,
53
53
  };
54
54
  setFieldValue('databases.data', [...databases.data, newDatabase]);
55
- }, [databases, setFieldValue]);
56
- const resetDatabaseHandler = (0, react_1.useCallback)(() => {
55
+ }
56
+ function resetHandler() {
57
57
  const workSpaceDisplayPreferences = (0, getPreferencesByWorkspace_1.getPreferencesByWorkspace)(currentWorkspace);
58
58
  const database = workSpaceDisplayPreferences.databases.data;
59
59
  setFieldValue('databases.data', database);
60
- }, [currentWorkspace, setFieldValue]);
61
- return ((0, jsx_runtime_1.jsxs)("fieldset", { onClick: (e) => {
60
+ }
61
+ return ((0, jsx_runtime_1.jsx)("fieldset", { onClick: (e) => {
62
62
  if (e.target.checked) {
63
63
  e.target.checked = false;
64
64
  setFieldValue('databases.defaultDatabase', '');
65
65
  }
66
- }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "section-header", style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)("p", { style: { flex: 1 }, children: "Databases" }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Danger, { fill: "clear", size: "xSmall", onClick: resetDatabaseHandler, style: { margin: '0 5px' }, children: "Reset Databases" }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "outline", size: "xSmall", onClick: addNewDatabaseHandler, children: "Add Database" })] })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("table", { style: style.table, children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { style: style.th, children: "#" }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "Label " }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "URL" }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "Enabled" }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "Auto Load" }), (0, jsx_runtime_1.jsx)("th", {})] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: databases?.data.map((item, index) => {
67
- const num = index + 1;
68
- return (
69
- // eslint-disable-next-line react/no-array-index-key
70
- (0, jsx_runtime_1.jsxs)("tr", { style: { height: '33px' }, children: [(0, jsx_runtime_1.jsxs)("td", { style: style.serialCol, children: [(0, jsx_runtime_1.jsx)("span", { children: num }), ' '] }), (0, jsx_runtime_1.jsx)("td", { style: style.labelCol, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { style: { input: style.input }, name: `databases.data.${index}.label`, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { style: { input: style.input }, name: `databases.data.${index}.url`, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { style: {
71
- container: style.checkbox,
72
- }, className: "checkbox-element", name: `databases.data.${index}.enabled` }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(formik_1.Field, { style: style.checkbox, type: "radio", name: "databases.defaultDatabase", value: item.key }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsxs)("div", { style: {
73
- display: 'flex',
74
- height: '100%',
75
- }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: () => deleteHandler(index), children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }), databases.length === index + 1 && ((0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", style: { fontSize: '14px' }, onClick: addNewDatabaseHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) })), (0, isGoogleDocument_1.isGoogleDocument)(item.url) && ((0, jsx_runtime_1.jsx)(Button_1.default.Action, { style: { fontSize: '13px' }, fill: "clear", onClick: () => window.open(item.url, '_blank'), children: (0, jsx_runtime_1.jsx)(fa_1.FaLink, {}) }))] }) })] }, `${index}`));
76
- }) })] }) })] }));
66
+ }, children: (0, jsx_runtime_1.jsx)(GroupPane_1.GroupPane, { text: "Databases", renderHeader: (text) => {
67
+ return ((0, jsx_runtime_1.jsx)(DataBaseHeader, { text: text, onReset: resetHandler, onAdd: addHandler }));
68
+ }, children: (0, jsx_runtime_1.jsxs)("table", { style: style.table, children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { style: style.th, children: "#" }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "Label " }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "URL" }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "Enabled" }), (0, jsx_runtime_1.jsx)("th", { style: style.th, children: "Auto Load" }), (0, jsx_runtime_1.jsx)("th", {})] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: databases?.data.map((item, index) => {
69
+ const num = index + 1;
70
+ return (
71
+ // eslint-disable-next-line react/no-array-index-key
72
+ (0, jsx_runtime_1.jsxs)("tr", { style: { height: '33px' }, children: [(0, jsx_runtime_1.jsxs)("td", { style: style.serialCol, children: [(0, jsx_runtime_1.jsx)("span", { children: num }), ' '] }), (0, jsx_runtime_1.jsx)("td", { style: style.labelCol, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { style: { input: style.input }, name: `databases.data.${index}.label`, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { style: { input: style.input }, name: `databases.data.${index}.url`, checkErrorAfterInputTouched: false }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { style: {
73
+ container: style.checkbox,
74
+ }, className: "checkbox-element", name: `databases.data.${index}.enabled` }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(formik_1.Field, { style: style.checkbox, type: "radio", name: "databases.defaultDatabase", value: item.key }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsxs)("div", { style: {
75
+ display: 'flex',
76
+ height: '100%',
77
+ }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: () => deleteHandler(index), children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }), databases.length === index + 1 && ((0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", style: { fontSize: '14px' }, onClick: addHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) })), (0, isGoogleDocument_1.isGoogleDocument)(item.url) && ((0, jsx_runtime_1.jsx)(Button_1.default.Action, { style: { fontSize: '13px' }, fill: "clear", onClick: () => window.open(item.url, '_blank'), children: (0, jsx_runtime_1.jsx)(fa_1.FaLink, {}) }))] }) })] }, `${index}`));
78
+ }) })] }) }) }));
79
+ }
80
+ function DataBaseHeader({ onReset, onAdd, text }) {
81
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "section-header", style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)("p", { style: { flex: 1 }, children: text }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Danger, { fill: "clear", size: "xSmall", onClick: onReset, style: { margin: '0 5px' }, children: "Reset Databases" }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "outline", size: "xSmall", onClick: onAdd, children: "Add Database" })] })] }));
77
82
  }
78
83
  exports.default = DatabasesTabContent;