nmrium 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/BrushTracker1D.d.ts.map +1 -1
- package/lib/component/1d/BrushTracker1D.js +15 -14
- package/lib/component/1d/BrushTracker1D.js.map +1 -1
- package/lib/component/1d/Viewer1D.d.ts.map +1 -1
- package/lib/component/1d/Viewer1D.js +2 -1
- package/lib/component/1d/Viewer1D.js.map +1 -1
- package/lib/component/1d/plugin_chart_brush_tracker.d.ts +2 -0
- package/lib/component/1d/plugin_chart_brush_tracker.d.ts.map +1 -0
- package/lib/component/1d/plugin_chart_brush_tracker.js +41 -0
- package/lib/component/1d/plugin_chart_brush_tracker.js.map +1 -0
- package/lib/component/1d-2d/tools/BrushXY.d.ts +1 -1
- package/lib/component/1d-2d/tools/BrushXY.d.ts.map +1 -1
- package/lib/component/1d-2d/tools/BrushXY.js.map +1 -1
- package/lib/component/1d-2d/tools/CrossLinePointer.d.ts +1 -1
- package/lib/component/1d-2d/tools/CrossLinePointer.d.ts.map +1 -1
- package/lib/component/1d-2d/tools/CrossLinePointer.js.map +1 -1
- package/lib/component/2d/BrushTracker2D.js.map +1 -1
- package/lib/component/2d/utilities/DimensionLayout.d.ts +1 -1
- package/lib/component/2d/utilities/DimensionLayout.d.ts.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts +1 -84
- package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.js +70 -3
- package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
- package/lib/component/EventsTrackers/brush_tracker.types.d.ts +93 -0
- package/lib/component/EventsTrackers/brush_tracker.types.d.ts.map +1 -0
- package/lib/component/EventsTrackers/brush_tracker.types.js +2 -0
- package/lib/component/EventsTrackers/brush_tracker.types.js.map +1 -0
- package/lib/component/EventsTrackers/brush_tracker_events_listeners.d.ts +7 -0
- package/lib/component/EventsTrackers/brush_tracker_events_listeners.d.ts.map +1 -0
- package/lib/component/EventsTrackers/brush_tracker_events_listeners.js +15 -0
- package/lib/component/EventsTrackers/brush_tracker_events_listeners.js.map +1 -0
- package/lib/component/elements/tanstack_table/create_action_column.d.ts +11 -0
- package/lib/component/elements/tanstack_table/create_action_column.d.ts.map +1 -0
- package/lib/component/elements/tanstack_table/create_action_column.js +24 -0
- package/lib/component/elements/tanstack_table/create_action_column.js.map +1 -0
- package/lib/component/elements/tanstack_table/create_column_helper.d.ts +5 -0
- package/lib/component/elements/tanstack_table/create_column_helper.d.ts.map +1 -0
- package/lib/component/elements/tanstack_table/create_column_helper.js +5 -0
- package/lib/component/elements/tanstack_table/create_column_helper.js.map +1 -0
- package/lib/component/elements/{ReactTable/BaseReactTable.d.ts → tanstack_table/elements/base_react_table.d.ts} +1 -1
- package/lib/component/elements/tanstack_table/elements/base_react_table.d.ts.map +1 -0
- package/lib/component/elements/{ReactTable/BaseReactTable.js → tanstack_table/elements/base_react_table.js} +1 -1
- package/lib/component/elements/tanstack_table/elements/base_react_table.js.map +1 -0
- package/lib/component/elements/{ReactTable/Elements/EmptyDataRow.d.ts → tanstack_table/elements/empty_data_row.d.ts} +1 -1
- package/lib/component/elements/tanstack_table/elements/empty_data_row.d.ts.map +1 -0
- package/lib/component/elements/{ReactTable/Elements/EmptyDataRow.js → tanstack_table/elements/empty_data_row.js} +1 -1
- package/lib/component/elements/tanstack_table/elements/empty_data_row.js.map +1 -0
- package/lib/component/elements/tanstack_table/elements/table_context.d.ts +4 -0
- package/lib/component/elements/tanstack_table/elements/table_context.d.ts.map +1 -0
- package/lib/component/elements/tanstack_table/elements/table_context.js +11 -0
- package/lib/component/elements/tanstack_table/elements/table_context.js.map +1 -0
- package/lib/component/elements/tanstack_table/elements/table_header.d.ts +12 -0
- package/lib/component/elements/tanstack_table/elements/table_header.d.ts.map +1 -0
- package/lib/component/elements/tanstack_table/elements/table_header.js +42 -0
- package/lib/component/elements/tanstack_table/elements/table_header.js.map +1 -0
- package/lib/component/elements/tanstack_table/elements/table_row.d.ts +12 -0
- package/lib/component/elements/tanstack_table/elements/table_row.d.ts.map +1 -0
- package/lib/component/elements/{ReactTable/Elements/ReactTableRow.js → tanstack_table/elements/table_row.js} +18 -17
- package/lib/component/elements/tanstack_table/elements/table_row.js.map +1 -0
- package/lib/component/elements/tanstack_table/features.d.ts +21 -0
- package/lib/component/elements/tanstack_table/features.d.ts.map +1 -0
- package/lib/component/elements/tanstack_table/features.js +14 -0
- package/lib/component/elements/tanstack_table/features.js.map +1 -0
- package/lib/component/elements/tanstack_table/index.d.ts +6 -0
- package/lib/component/elements/tanstack_table/index.d.ts.map +1 -0
- package/lib/component/elements/tanstack_table/index.js +6 -0
- package/lib/component/elements/tanstack_table/index.js.map +1 -0
- package/lib/component/elements/tanstack_table/table.d.ts +26 -0
- package/lib/component/elements/tanstack_table/table.d.ts.map +1 -0
- package/lib/component/elements/{ReactTable/ReactTable.js → tanstack_table/table.js} +29 -37
- package/lib/component/elements/tanstack_table/table.js.map +1 -0
- package/lib/component/elements/tanstack_table/types.d.ts +47 -0
- package/lib/component/elements/tanstack_table/types.d.ts.map +1 -0
- package/lib/component/elements/tanstack_table/types.js +2 -0
- package/lib/component/elements/tanstack_table/types.js.map +1 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -1
- package/lib/component/header/AutoPeakPickingOptionPanel.js.map +1 -1
- package/lib/component/modal/ImportPublicationStringModal.d.ts.map +1 -1
- package/lib/component/modal/ImportPublicationStringModal.js +91 -73
- package/lib/component/modal/ImportPublicationStringModal.js.map +1 -1
- package/lib/component/modal/LogsHistoryModal.d.ts.map +1 -1
- package/lib/component/modal/LogsHistoryModal.js +44 -40
- package/lib/component/modal/LogsHistoryModal.js.map +1 -1
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.d.ts.map +1 -1
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +48 -44
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js.map +1 -1
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.d.ts.map +1 -1
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +36 -32
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js.map +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.d.ts.map +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -14
- package/lib/component/modal/metaImportation/MetaImportationModal.js.map +1 -1
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +1 -1
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts.map +1 -1
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +29 -26
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +70 -76
- package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
- package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.d.ts.map +1 -1
- package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +33 -29
- package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +8 -6
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +116 -126
- package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
- package/lib/component/panels/PeaksPanel/peaksToTSV.d.ts +2 -2
- package/lib/component/panels/PeaksPanel/peaksToTSV.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/peaksToTSV.js +9 -11
- package/lib/component/panels/PeaksPanel/peaksToTSV.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +3 -2
- package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.js +37 -26
- package/lib/component/panels/SpectraPanel/SpectraTable.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.d.ts +1 -1
- package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js +56 -52
- package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js.map +1 -1
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.d.ts.map +1 -1
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +23 -20
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts.map +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts.map +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +171 -153
- package/lib/component/panels/databasePanel/DatabaseTable.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.js +27 -24
- package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.js.map +1 -1
- package/lib/component/panels/informationPanel/InformationEditionModal.d.ts.map +1 -1
- package/lib/component/panels/informationPanel/InformationEditionModal.js +69 -64
- package/lib/component/panels/informationPanel/InformationEditionModal.js.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.d.ts.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.js +17 -20
- package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.js.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.d.ts.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.js +25 -20
- package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.js.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.d.ts.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.js +41 -36
- package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.js.map +1 -1
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.d.ts.map +1 -1
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +14 -15
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.js.map +1 -1
- package/lib/component/reducer/actions/DatabaseActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +3 -2
- package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
- package/lib/component/reducer/actions/InsetActions.d.ts +1 -1
- package/lib/component/reducer/actions/InsetActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
- package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
- package/lib/component/reducer/helper/Zoom1DManager.d.ts +1 -1
- package/lib/component/reducer/helper/Zoom1DManager.d.ts.map +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts.map +1 -1
- package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts +1 -1
- package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts.map +1 -1
- package/lib/component/utility/Events.d.ts +1 -1
- package/lib/component/utility/Events.d.ts.map +1 -1
- package/lib/component/utility/core_slots/core_operator_brush.commons.d.ts +9 -0
- package/lib/component/utility/core_slots/core_operator_brush.commons.d.ts.map +1 -0
- package/lib/component/utility/core_slots/core_operator_brush.commons.js +15 -0
- package/lib/component/utility/core_slots/core_operator_brush.commons.js.map +1 -0
- package/lib/component/utility/core_slots/core_operator_chart_brush.commons.d.ts +7 -0
- package/lib/component/utility/core_slots/core_operator_chart_brush.commons.d.ts.map +1 -0
- package/lib/component/utility/core_slots/core_operator_chart_brush.commons.js +82 -0
- package/lib/component/utility/core_slots/core_operator_chart_brush.commons.js.map +1 -0
- package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.d.ts +8 -0
- package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.d.ts.map +1 -0
- package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.js +11 -0
- package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.js.map +1 -0
- package/lib/component/utility/core_slots/core_operator_chart_svg.js +1 -13
- package/lib/component/utility/core_slots/core_operator_chart_svg.js.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +5 -6
- package/src/component/1d/BrushTracker1D.tsx +19 -21
- package/src/component/1d/Viewer1D.tsx +2 -0
- package/src/component/1d/plugin_chart_brush_tracker.tsx +63 -0
- package/src/component/1d-2d/tools/BrushXY.tsx +1 -1
- package/src/component/1d-2d/tools/CrossLinePointer.tsx +1 -1
- package/src/component/2d/BrushTracker2D.tsx +5 -5
- package/src/component/2d/utilities/DimensionLayout.ts +1 -1
- package/src/component/EventsTrackers/BrushTracker.tsx +118 -115
- package/src/component/EventsTrackers/brush_tracker.types.ts +111 -0
- package/src/component/EventsTrackers/brush_tracker_events_listeners.ts +32 -0
- package/src/component/elements/tanstack_table/create_action_column.tsx +43 -0
- package/src/component/elements/tanstack_table/create_column_helper.ts +11 -0
- package/src/component/elements/tanstack_table/elements/table_context.ts +15 -0
- package/src/component/elements/tanstack_table/elements/table_header.tsx +111 -0
- package/src/component/elements/{ReactTable/Elements/ReactTableRow.tsx → tanstack_table/elements/table_row.tsx} +51 -50
- package/src/component/elements/tanstack_table/features.ts +33 -0
- package/src/component/elements/tanstack_table/index.ts +5 -0
- package/src/component/elements/{ReactTable/ReactTable.tsx → tanstack_table/table.tsx} +78 -157
- package/src/component/elements/tanstack_table/types.ts +86 -0
- package/src/component/header/AutoPeakPickingOptionPanel.tsx +1 -1
- package/src/component/modal/ImportPublicationStringModal.tsx +160 -136
- package/src/component/modal/LogsHistoryModal.tsx +32 -25
- package/src/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.tsx +28 -24
- package/src/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.tsx +27 -25
- package/src/component/modal/metaImportation/MetaImportationModal.tsx +19 -15
- package/src/component/panels/AutomaticAssignment/AutomaticAssignmentTable.tsx +27 -25
- package/src/component/panels/IntegralsPanel/IntegralTable.tsx +75 -89
- package/src/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.tsx +68 -60
- package/src/component/panels/PeaksPanel/PeaksTable.tsx +126 -124
- package/src/component/panels/PeaksPanel/peaksToTSV.ts +14 -15
- package/src/component/panels/RangesPanel/RangesTable.tsx +3 -2
- package/src/component/panels/RangesPanel/RangesTableRow.tsx +2 -2
- package/src/component/panels/SpectraPanel/SpectraTable.tsx +58 -36
- package/src/component/panels/SpectraPanel/base/SpectraColumnsManager.tsx +31 -35
- package/src/component/panels/SummaryPanel/SetShiftTolerancesModal.tsx +25 -20
- package/src/component/panels/ZonesPanel/ZonesTableRow.tsx +2 -2
- package/src/component/panels/databasePanel/DatabasePanel.tsx +1 -1
- package/src/component/panels/databasePanel/DatabaseTable.tsx +189 -183
- package/src/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.tsx +20 -20
- package/src/component/panels/informationPanel/InformationEditionModal.tsx +40 -37
- package/src/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.tsx +23 -24
- package/src/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.tsx +33 -24
- package/src/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.tsx +34 -31
- package/src/component/panels/spectrumSimulation/SpinSystemTable.tsx +19 -18
- package/src/component/reducer/actions/DatabaseActions.ts +4 -3
- package/src/component/reducer/actions/InsetActions.ts +1 -1
- package/src/component/reducer/actions/ToolsActions.ts +1 -1
- package/src/component/reducer/helper/Zoom1DManager.ts +1 -1
- package/src/component/reducer/helper/ZoomHistoryManager.ts +1 -1
- package/src/component/reducer/preferences/actions/matrixGeneration.ts +1 -1
- package/src/component/utility/Events.tsx +1 -1
- package/src/component/utility/core_slots/core_operator_brush.commons.ts +18 -0
- package/src/component/utility/core_slots/core_operator_chart_brush.commons.ts +138 -0
- package/src/component/utility/core_slots/core_operator_chart_brush_tracker.tsx +27 -0
- package/src/component/utility/core_slots/core_operator_chart_svg.tsx +2 -17
- package/src/versionInfo.ts +1 -1
- package/lib/component/elements/ReactTable/BaseReactTable.d.ts.map +0 -1
- package/lib/component/elements/ReactTable/BaseReactTable.js.map +0 -1
- package/lib/component/elements/ReactTable/Elements/EmptyDataRow.d.ts.map +0 -1
- package/lib/component/elements/ReactTable/Elements/EmptyDataRow.js.map +0 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableHeader.d.ts +0 -10
- package/lib/component/elements/ReactTable/Elements/ReactTableHeader.d.ts.map +0 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableHeader.js +0 -27
- package/lib/component/elements/ReactTable/Elements/ReactTableHeader.js.map +0 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +0 -16
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts.map +0 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js.map +0 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +0 -64
- package/lib/component/elements/ReactTable/ReactTable.d.ts.map +0 -1
- package/lib/component/elements/ReactTable/ReactTable.js.map +0 -1
- package/lib/component/elements/ReactTable/utility/ReactTableContext.d.ts +0 -4
- package/lib/component/elements/ReactTable/utility/ReactTableContext.d.ts.map +0 -1
- package/lib/component/elements/ReactTable/utility/ReactTableContext.js +0 -11
- package/lib/component/elements/ReactTable/utility/ReactTableContext.js.map +0 -1
- package/lib/component/elements/ReactTable/utility/addCustomColumn.d.ts +0 -19
- package/lib/component/elements/ReactTable/utility/addCustomColumn.d.ts.map +0 -1
- package/lib/component/elements/ReactTable/utility/addCustomColumn.js +0 -36
- package/lib/component/elements/ReactTable/utility/addCustomColumn.js.map +0 -1
- package/lib/component/elements/ReactTable/utility/useRowSpan.d.ts +0 -9
- package/lib/component/elements/ReactTable/utility/useRowSpan.d.ts.map +0 -1
- package/lib/component/elements/ReactTable/utility/useRowSpan.js +0 -40
- package/lib/component/elements/ReactTable/utility/useRowSpan.js.map +0 -1
- package/src/component/elements/ReactTable/Elements/ReactTableHeader.tsx +0 -81
- package/src/component/elements/ReactTable/utility/ReactTableContext.ts +0 -14
- package/src/component/elements/ReactTable/utility/addCustomColumn.tsx +0 -75
- package/src/component/elements/ReactTable/utility/useRowSpan.ts +0 -61
- /package/src/component/elements/{ReactTable/BaseReactTable.tsx → tanstack_table/elements/base_react_table.tsx} +0 -0
- /package/src/component/elements/{ReactTable/Elements/EmptyDataRow.tsx → tanstack_table/elements/empty_data_row.tsx} +0 -0
package/src/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.tsx
CHANGED
|
@@ -7,14 +7,15 @@ import { useCallback, useMemo, useRef } from 'react';
|
|
|
7
7
|
import { useFormContext, useWatch } from 'react-hook-form';
|
|
8
8
|
import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
|
|
9
9
|
import { Toolbar } from 'react-science/ui';
|
|
10
|
-
import type { CellProps } from 'react-table';
|
|
11
10
|
|
|
12
11
|
import { multiplets } from '../../../../../../data/constants/Multiplets.js';
|
|
13
12
|
import { NumberInput2Controller } from '../../../../../elements/NumberInput2Controller.js';
|
|
14
|
-
import type { Column } from '../../../../../elements/ReactTable/ReactTable.js';
|
|
15
|
-
import ReactTable from '../../../../../elements/ReactTable/ReactTable.js';
|
|
16
13
|
import { Select2Controller } from '../../../../../elements/Select2Controller.js';
|
|
17
14
|
import { useTabsController } from '../../../../../elements/TabsProvider.js';
|
|
15
|
+
import {
|
|
16
|
+
TanStackTable,
|
|
17
|
+
createTanStackColumnHelper,
|
|
18
|
+
} from '../../../../../elements/tanstack_table/index.ts';
|
|
18
19
|
import useSpectrum from '../../../../../hooks/useSpectrum.js';
|
|
19
20
|
import { hasCouplingConstant } from '../../../../../panels/extra/utilities/MultiplicityUtilities.js';
|
|
20
21
|
import { useEvent } from '../../../../../utility/Events.js';
|
|
@@ -57,6 +58,7 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
|
|
|
57
58
|
setValue,
|
|
58
59
|
control,
|
|
59
60
|
setFocus,
|
|
61
|
+
getValues,
|
|
60
62
|
formState: { errors },
|
|
61
63
|
} = useFormContext();
|
|
62
64
|
const signals = useWatch({ name: 'signals' });
|
|
@@ -125,7 +127,8 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
|
|
|
125
127
|
);
|
|
126
128
|
|
|
127
129
|
const deleteHandler = useCallback(
|
|
128
|
-
(
|
|
130
|
+
(index: number) => {
|
|
131
|
+
const data = getValues(`signals.${signalIndex}.js`) || [];
|
|
129
132
|
const jCouplings = data.filter(
|
|
130
133
|
(_: any, columnIndex: number) => columnIndex !== index,
|
|
131
134
|
);
|
|
@@ -135,24 +138,26 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
|
|
|
135
138
|
lastSelectedCouplingIndexRef.current = null;
|
|
136
139
|
}
|
|
137
140
|
},
|
|
138
|
-
[setValue, signalIndex],
|
|
141
|
+
[getValues, setValue, signalIndex],
|
|
139
142
|
);
|
|
140
143
|
|
|
141
144
|
function deleteAllHandler() {
|
|
142
145
|
setValue(`signals[${signalIndex}].js`, []);
|
|
143
146
|
lastSelectedCouplingIndexRef.current = null;
|
|
144
147
|
}
|
|
145
|
-
|
|
146
|
-
|
|
148
|
+
|
|
149
|
+
const COLUMNS = useMemo(() => {
|
|
150
|
+
const columnHelper = createTanStackColumnHelper<Jcoupling>();
|
|
151
|
+
return columnHelper.columns([
|
|
147
152
|
{
|
|
148
|
-
|
|
149
|
-
style: { width: '25px', ...styles.column },
|
|
150
|
-
|
|
153
|
+
header: '#',
|
|
154
|
+
meta: { style: { width: '25px', ...styles.column } },
|
|
155
|
+
accessorFn: (_: any, index) => index + 1,
|
|
151
156
|
},
|
|
152
157
|
{
|
|
153
|
-
|
|
154
|
-
style: { padding: 0, ...styles.column },
|
|
155
|
-
|
|
158
|
+
header: 'Multiplicity',
|
|
159
|
+
meta: { style: { padding: 0, ...styles.column } },
|
|
160
|
+
cell: ({ row }) => {
|
|
156
161
|
return (
|
|
157
162
|
<Select2Controller
|
|
158
163
|
control={control}
|
|
@@ -184,9 +189,9 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
|
|
|
184
189
|
},
|
|
185
190
|
},
|
|
186
191
|
{
|
|
187
|
-
|
|
188
|
-
style: { padding: 0, ...styles.column },
|
|
189
|
-
|
|
192
|
+
header: 'J (Hz)',
|
|
193
|
+
meta: { style: { padding: 0, ...styles.column } },
|
|
194
|
+
cell: ({ row }) => {
|
|
190
195
|
return (
|
|
191
196
|
<NumberInput2Controller
|
|
192
197
|
control={control}
|
|
@@ -203,10 +208,10 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
|
|
|
203
208
|
},
|
|
204
209
|
},
|
|
205
210
|
{
|
|
206
|
-
|
|
207
|
-
style: { width: '70px', ...styles.column },
|
|
211
|
+
header: '',
|
|
212
|
+
meta: { style: { width: '70px', ...styles.column } },
|
|
208
213
|
id: 'action-button',
|
|
209
|
-
|
|
214
|
+
cell: ({ row }) => {
|
|
210
215
|
const record: any = row.original;
|
|
211
216
|
return (
|
|
212
217
|
<div style={{ display: 'flex', justifyContent: 'space-around' }}>
|
|
@@ -215,7 +220,7 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
|
|
|
215
220
|
size="small"
|
|
216
221
|
variant="outlined"
|
|
217
222
|
intent="danger"
|
|
218
|
-
onClick={() => deleteHandler(
|
|
223
|
+
onClick={() => deleteHandler(row.index)}
|
|
219
224
|
>
|
|
220
225
|
<FaRegTrashAlt className={Classes.ICON} />
|
|
221
226
|
</Button>
|
|
@@ -224,9 +229,8 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
|
|
|
224
229
|
);
|
|
225
230
|
},
|
|
226
231
|
},
|
|
227
|
-
]
|
|
228
|
-
|
|
229
|
-
);
|
|
232
|
+
]);
|
|
233
|
+
}, [control, deleteHandler, setFocus, setValue, signalIndex]);
|
|
230
234
|
|
|
231
235
|
function selectRowHandler(index: number) {
|
|
232
236
|
setFocusSource('coupling');
|
|
@@ -263,7 +267,7 @@ export function SignalJCouplingsTable(props: SignalJCouplingsTableProps) {
|
|
|
263
267
|
overflow: 'auto',
|
|
264
268
|
}}
|
|
265
269
|
>
|
|
266
|
-
<
|
|
270
|
+
<TanStackTable
|
|
267
271
|
data={signal?.js || []}
|
|
268
272
|
columns={COLUMNS}
|
|
269
273
|
onClick={(e, rowData: any) => selectRowHandler(rowData.index)}
|
|
@@ -8,12 +8,13 @@ import { useCallback, useMemo, useRef } from 'react';
|
|
|
8
8
|
import { useFormContext, useWatch } from 'react-hook-form';
|
|
9
9
|
import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
|
|
10
10
|
import { Toolbar } from 'react-science/ui';
|
|
11
|
-
import type { CellProps } from 'react-table';
|
|
12
11
|
|
|
13
12
|
import { NumberInput2Controller } from '../../../../../elements/NumberInput2Controller.js';
|
|
14
|
-
import type { Column } from '../../../../../elements/ReactTable/ReactTable.js';
|
|
15
|
-
import ReactTable from '../../../../../elements/ReactTable/ReactTable.js';
|
|
16
13
|
import { useTabsController } from '../../../../../elements/TabsProvider.js';
|
|
14
|
+
import {
|
|
15
|
+
TanStackTable,
|
|
16
|
+
createTanStackColumnHelper,
|
|
17
|
+
} from '../../../../../elements/tanstack_table/index.ts';
|
|
17
18
|
import useSpectrum from '../../../../../hooks/useSpectrum.js';
|
|
18
19
|
import { useEvent } from '../../../../../utility/Events.js';
|
|
19
20
|
import { useEventFocusInput } from '../SignalsContent.js';
|
|
@@ -49,7 +50,7 @@ function getPeakKey(
|
|
|
49
50
|
export function SignalPeaksTable(props: SignalPeaksTableProps) {
|
|
50
51
|
const { focusSource, setFocusSource } = useEventFocusInput();
|
|
51
52
|
|
|
52
|
-
const { setValue, control, setFocus } = useFormContext();
|
|
53
|
+
const { setValue, control, setFocus, getValues } = useFormContext();
|
|
53
54
|
const { signals } = useWatch();
|
|
54
55
|
const { selectedTabId: signalIndex = 0 } = useTabsController<number>();
|
|
55
56
|
|
|
@@ -123,7 +124,8 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
|
|
|
123
124
|
);
|
|
124
125
|
|
|
125
126
|
const deleteHandler = useCallback(
|
|
126
|
-
(
|
|
127
|
+
(index: number) => {
|
|
128
|
+
const data = getValues(`signals.${signalIndex}.peaks`) || [];
|
|
127
129
|
const peaks = data.filter(
|
|
128
130
|
(_: any, columnIndex: number) => columnIndex !== index,
|
|
129
131
|
);
|
|
@@ -133,7 +135,7 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
|
|
|
133
135
|
lastSelectedPeakIndexRef.current = null;
|
|
134
136
|
}
|
|
135
137
|
},
|
|
136
|
-
[setValue, signalIndex],
|
|
138
|
+
[getValues, setValue, signalIndex],
|
|
137
139
|
);
|
|
138
140
|
|
|
139
141
|
function deleteAllHandler() {
|
|
@@ -150,17 +152,18 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
|
|
|
150
152
|
[re, setValue, signalIndex, xArray],
|
|
151
153
|
);
|
|
152
154
|
|
|
153
|
-
const COLUMNS = useMemo
|
|
154
|
-
()
|
|
155
|
+
const COLUMNS = useMemo(() => {
|
|
156
|
+
const columnHelper = createTanStackColumnHelper<NMRPeak1D>();
|
|
157
|
+
return columnHelper.columns([
|
|
155
158
|
{
|
|
156
|
-
|
|
157
|
-
style: { width: '25px', ...styles.column },
|
|
158
|
-
|
|
159
|
+
header: '#',
|
|
160
|
+
meta: { style: { width: '25px', ...styles.column } },
|
|
161
|
+
accessorFn: (_: any, index) => index + 1,
|
|
159
162
|
},
|
|
160
163
|
{
|
|
161
|
-
|
|
162
|
-
style: { padding: 0, ...styles.column },
|
|
163
|
-
|
|
164
|
+
header: 'delta',
|
|
165
|
+
meta: { style: { padding: 0, ...styles.column } },
|
|
166
|
+
cell: ({ row }) => {
|
|
164
167
|
return (
|
|
165
168
|
<NumberInput2Controller
|
|
166
169
|
control={control}
|
|
@@ -178,9 +181,9 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
|
|
|
178
181
|
},
|
|
179
182
|
},
|
|
180
183
|
{
|
|
181
|
-
|
|
182
|
-
style: { padding: 0, ...styles.column },
|
|
183
|
-
|
|
184
|
+
header: 'Intensity',
|
|
185
|
+
meta: { style: { padding: 0, ...styles.column } },
|
|
186
|
+
cell: ({ row }) => {
|
|
184
187
|
return (
|
|
185
188
|
<NumberInput2Controller
|
|
186
189
|
control={control}
|
|
@@ -195,10 +198,10 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
|
|
|
195
198
|
},
|
|
196
199
|
},
|
|
197
200
|
{
|
|
198
|
-
|
|
199
|
-
style: { width: '70px', ...styles.column },
|
|
201
|
+
header: '',
|
|
202
|
+
meta: { style: { width: '70px', ...styles.column } },
|
|
200
203
|
id: 'action-button',
|
|
201
|
-
|
|
204
|
+
cell: ({ row }) => {
|
|
202
205
|
const record: any = row.original;
|
|
203
206
|
return (
|
|
204
207
|
<div style={{ display: 'flex', justifyContent: 'space-around' }}>
|
|
@@ -207,7 +210,7 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
|
|
|
207
210
|
size="small"
|
|
208
211
|
variant="outlined"
|
|
209
212
|
intent="danger"
|
|
210
|
-
onClick={() => deleteHandler(
|
|
213
|
+
onClick={() => deleteHandler(row.index)}
|
|
211
214
|
>
|
|
212
215
|
<FaRegTrashAlt className={Classes.ICON} />
|
|
213
216
|
</Button>
|
|
@@ -216,9 +219,8 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
|
|
|
216
219
|
);
|
|
217
220
|
},
|
|
218
221
|
},
|
|
219
|
-
]
|
|
220
|
-
|
|
221
|
-
);
|
|
222
|
+
]);
|
|
223
|
+
}, [changeDeltaHandler, control, deleteHandler, signalIndex]);
|
|
222
224
|
|
|
223
225
|
function selectRowHandler(index: number) {
|
|
224
226
|
setFocusSource('peak');
|
|
@@ -250,7 +252,7 @@ export function SignalPeaksTable(props: SignalPeaksTableProps) {
|
|
|
250
252
|
overflow: 'auto',
|
|
251
253
|
}}
|
|
252
254
|
>
|
|
253
|
-
<
|
|
255
|
+
<TanStackTable
|
|
254
256
|
data={signal?.peaks || []}
|
|
255
257
|
columns={COLUMNS}
|
|
256
258
|
onClick={(e, rowData: any) => selectRowHandler(rowData.index)}
|
|
@@ -21,10 +21,13 @@ import { useToaster } from '../../context/ToasterContext.js';
|
|
|
21
21
|
import Button from '../../elements/Button.js';
|
|
22
22
|
import { Input2Controller } from '../../elements/Input2Controller.js';
|
|
23
23
|
import Label from '../../elements/Label.js';
|
|
24
|
-
import type { Column } from '../../elements/ReactTable/ReactTable.js';
|
|
25
|
-
import ReactTable from '../../elements/ReactTable/ReactTable.js';
|
|
26
24
|
import { Select2Controller } from '../../elements/Select2Controller.js';
|
|
27
25
|
import { StandardDialog } from '../../elements/StandardDialog.tsx';
|
|
26
|
+
import type { TanStackTableRow } from '../../elements/tanstack_table/index.ts';
|
|
27
|
+
import {
|
|
28
|
+
TanStackTable,
|
|
29
|
+
createTanStackColumnHelper,
|
|
30
|
+
} from '../../elements/tanstack_table/index.ts';
|
|
28
31
|
import { convertPathArrayToString } from '../../utility/convertPathArrayToString.js';
|
|
29
32
|
import { getSpectraObjectPaths } from '../../utility/getSpectraObjectPaths.js';
|
|
30
33
|
|
|
@@ -164,9 +167,10 @@ function InnerMetaImportationModal({
|
|
|
164
167
|
|
|
165
168
|
const columns = useMemo(() => {
|
|
166
169
|
const fields = parseResult?.meta.fields || [];
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
+
const columnHelper = createTanStackColumnHelper<any>();
|
|
171
|
+
const columns = columnHelper.columns([
|
|
172
|
+
{ header: '#', accessorFn: (_: any, index) => index + 1 },
|
|
173
|
+
]);
|
|
170
174
|
|
|
171
175
|
function getRowValue(val: any) {
|
|
172
176
|
if (typeof val === 'string') return val;
|
|
@@ -177,9 +181,9 @@ function InnerMetaImportationModal({
|
|
|
177
181
|
for (const fieldName of fields) {
|
|
178
182
|
if (fieldName) {
|
|
179
183
|
columns.push({
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
style: styles.column,
|
|
184
|
+
header: fieldName,
|
|
185
|
+
accessorFn: (row: any) => getRowValue(row[fieldName]),
|
|
186
|
+
meta: { style: styles.column },
|
|
183
187
|
});
|
|
184
188
|
}
|
|
185
189
|
}
|
|
@@ -217,24 +221,24 @@ function InnerMetaImportationModal({
|
|
|
217
221
|
}
|
|
218
222
|
}
|
|
219
223
|
|
|
220
|
-
function handleActiveRow(
|
|
221
|
-
const record = compareResults[
|
|
224
|
+
function handleActiveRow(row: TanStackTableRow<any>) {
|
|
225
|
+
const record = compareResults[row.index] || null;
|
|
222
226
|
if (
|
|
223
227
|
record?.isDuplicated ||
|
|
224
228
|
record?.spectraIDs.length > 0 ||
|
|
225
|
-
errors?.[
|
|
229
|
+
errors?.[row.index]
|
|
226
230
|
) {
|
|
227
231
|
return true;
|
|
228
232
|
}
|
|
229
233
|
return false;
|
|
230
234
|
}
|
|
231
235
|
|
|
232
|
-
function handleRowStyle(
|
|
233
|
-
const record = compareResults[
|
|
236
|
+
function handleRowStyle(row: TanStackTableRow<any>) {
|
|
237
|
+
const record = compareResults[row.index] || null;
|
|
234
238
|
if (
|
|
235
239
|
record?.isDuplicated ||
|
|
236
240
|
record?.spectraIDs.length > 1 ||
|
|
237
|
-
errors?.[
|
|
241
|
+
errors?.[row.index]
|
|
238
242
|
) {
|
|
239
243
|
return rowColors.noMatch;
|
|
240
244
|
} else if (record) {
|
|
@@ -303,7 +307,7 @@ function InnerMetaImportationModal({
|
|
|
303
307
|
</Button.Done>
|
|
304
308
|
</div>
|
|
305
309
|
<div style={{ height: 'calc(100% - 160px)' }}>
|
|
306
|
-
<
|
|
310
|
+
<TanStackTable
|
|
307
311
|
columns={columns}
|
|
308
312
|
data={metadata}
|
|
309
313
|
approxItemHeight={25}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { SvgNmrAssignment } from 'cheminfo-font';
|
|
2
2
|
import type { MouseEvent } from 'react';
|
|
3
3
|
import { memo, useCallback, useMemo } from 'react';
|
|
4
|
-
import type { CellProps } from 'react-table';
|
|
5
4
|
|
|
6
5
|
import { useDispatch } from '../../context/DispatchContext.js';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import type { TanStackTableRow } from '../../elements/tanstack_table/index.ts';
|
|
7
|
+
import {
|
|
8
|
+
TanStackTable,
|
|
9
|
+
createTanStackColumnHelper,
|
|
10
|
+
} from '../../elements/tanstack_table/index.ts';
|
|
9
11
|
|
|
10
12
|
import type { AutoAssignmentsData } from './useAutoAssignments.js';
|
|
11
13
|
|
|
@@ -13,11 +15,12 @@ interface AutomaticAssignmentTableProps {
|
|
|
13
15
|
data: AutoAssignmentsData[];
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
function AutomaticAssignmentTable(
|
|
18
|
+
function AutomaticAssignmentTable(props: AutomaticAssignmentTableProps) {
|
|
19
|
+
const { data } = props;
|
|
17
20
|
const dispatch = useDispatch();
|
|
18
21
|
|
|
19
22
|
const assignHandler = useCallback(
|
|
20
|
-
(event: MouseEvent, row:
|
|
23
|
+
(event: MouseEvent, row: TanStackTableRow<AutoAssignmentsData>) => {
|
|
21
24
|
event.preventDefault();
|
|
22
25
|
event.stopPropagation();
|
|
23
26
|
|
|
@@ -29,29 +32,29 @@ function AutomaticAssignmentTable({ data }: AutomaticAssignmentTableProps) {
|
|
|
29
32
|
[dispatch],
|
|
30
33
|
);
|
|
31
34
|
|
|
32
|
-
const COLUMNS = useMemo
|
|
33
|
-
()
|
|
35
|
+
const COLUMNS = useMemo(() => {
|
|
36
|
+
const columnHelper = createTanStackColumnHelper<AutoAssignmentsData>();
|
|
37
|
+
return columnHelper.columns([
|
|
34
38
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
style: { width: '1%', maxWidth: '40px', minWidth: '40px' },
|
|
39
|
+
header: '#',
|
|
40
|
+
accessorFn: (_, index) => index + 1,
|
|
41
|
+
meta: { style: { width: '1%', maxWidth: '40px', minWidth: '40px' } },
|
|
39
42
|
},
|
|
40
43
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
accessor: 'score',
|
|
44
|
+
header: 'Score',
|
|
45
|
+
accessorKey: 'score',
|
|
44
46
|
},
|
|
45
47
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
header: '',
|
|
49
|
+
meta: {
|
|
50
|
+
style: {
|
|
51
|
+
width: '1%',
|
|
52
|
+
maxWidth: '24px',
|
|
53
|
+
minWidth: '24px',
|
|
54
|
+
},
|
|
52
55
|
},
|
|
53
56
|
id: 'assign-button',
|
|
54
|
-
|
|
57
|
+
cell: ({ row }) => (
|
|
55
58
|
<button
|
|
56
59
|
type="button"
|
|
57
60
|
className="assign-button"
|
|
@@ -61,12 +64,11 @@ function AutomaticAssignmentTable({ data }: AutomaticAssignmentTableProps) {
|
|
|
61
64
|
</button>
|
|
62
65
|
),
|
|
63
66
|
},
|
|
64
|
-
]
|
|
65
|
-
|
|
66
|
-
);
|
|
67
|
+
]);
|
|
68
|
+
}, [assignHandler]);
|
|
67
69
|
|
|
68
70
|
return (
|
|
69
|
-
<
|
|
71
|
+
<TanStackTable
|
|
70
72
|
data={data}
|
|
71
73
|
columns={COLUMNS}
|
|
72
74
|
onClick={assignHandler}
|
|
@@ -3,18 +3,17 @@ import dlv from 'dlv';
|
|
|
3
3
|
import { checkIntegralKind } from 'nmr-processing';
|
|
4
4
|
import { memo, useCallback, useMemo } from 'react';
|
|
5
5
|
import { FaRegTrashAlt } from 'react-icons/fa';
|
|
6
|
-
import type { CellProps, Row } from 'react-table';
|
|
7
6
|
|
|
8
7
|
import { SIGNAL_KINDS } from '../../../data/constants/signalsKinds.js';
|
|
9
8
|
import { useDispatch } from '../../context/DispatchContext.js';
|
|
10
9
|
import { EditableColumn } from '../../elements/EditableColumn.js';
|
|
11
10
|
import { EmptyText } from '../../elements/EmptyText.js';
|
|
12
|
-
import ReactTable from '../../elements/ReactTable/ReactTable.js';
|
|
13
|
-
import type { CustomColumn } from '../../elements/ReactTable/utility/addCustomColumn.js';
|
|
14
|
-
import addCustomColumn, {
|
|
15
|
-
createActionColumn,
|
|
16
|
-
} from '../../elements/ReactTable/utility/addCustomColumn.js';
|
|
17
11
|
import Select from '../../elements/Select.js';
|
|
12
|
+
import {
|
|
13
|
+
TanStackTable,
|
|
14
|
+
createActionColumn,
|
|
15
|
+
createTanStackColumnHelper,
|
|
16
|
+
} from '../../elements/tanstack_table/index.ts';
|
|
18
17
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences.js';
|
|
19
18
|
import { formatNumber } from '../../utility/formatNumber.js';
|
|
20
19
|
import { NoDataForFid } from '../extra/placeholder/NoDataForFid.js';
|
|
@@ -36,8 +35,8 @@ function IntegralTable(props: IntegralTableProps) {
|
|
|
36
35
|
const dispatch = useDispatch();
|
|
37
36
|
|
|
38
37
|
const deleteIntegralHandler = useCallback(
|
|
39
|
-
(
|
|
40
|
-
const { id } =
|
|
38
|
+
(integral: Integral) => {
|
|
39
|
+
const { id } = integral;
|
|
41
40
|
dispatch({
|
|
42
41
|
type: 'DELETE_INTEGRAL',
|
|
43
42
|
payload: {
|
|
@@ -69,55 +68,55 @@ function IntegralTable(props: IntegralTableProps) {
|
|
|
69
68
|
);
|
|
70
69
|
const integralsPreferences = usePanelPreferences('integrals', activeTab);
|
|
71
70
|
|
|
72
|
-
const COLUMNS = useMemo
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
formatNumber(
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
71
|
+
const COLUMNS = useMemo(() => {
|
|
72
|
+
const columnHelper = createTanStackColumnHelper<Integral>();
|
|
73
|
+
const columns = columnHelper.columns([]);
|
|
74
|
+
// TODO: Use column visibility feature instead.
|
|
75
|
+
if (dlv(integralsPreferences, 'showSerialNumber')) {
|
|
76
|
+
columns.push({
|
|
77
|
+
id: 'rowNumber',
|
|
78
|
+
header: '#',
|
|
79
|
+
accessorFn: (_, index) => index + 1,
|
|
80
|
+
meta: { style: { width: '30px', maxWidth: '30px' } },
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
if (dlv(integralsPreferences, 'from.show')) {
|
|
84
|
+
columns.push({
|
|
85
|
+
header: 'From',
|
|
86
|
+
sortFn: 'basic',
|
|
87
|
+
accessorKey: 'from',
|
|
88
|
+
cell: ({ getValue }) =>
|
|
89
|
+
formatNumber(getValue(), integralsPreferences.from.format),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if (dlv(integralsPreferences, 'to.show')) {
|
|
93
|
+
columns.push({
|
|
94
|
+
header: 'To',
|
|
95
|
+
sortFn: 'basic',
|
|
96
|
+
accessorKey: 'to',
|
|
97
|
+
cell: ({ getValue }) =>
|
|
98
|
+
formatNumber(getValue(), integralsPreferences.to.format),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if (dlv(integralsPreferences, 'absolute.show')) {
|
|
102
|
+
columns.push({
|
|
103
|
+
header: 'Absolute',
|
|
104
|
+
accessorKey: 'absolute',
|
|
105
|
+
cell: ({ getValue }) =>
|
|
106
|
+
formatNumber(getValue(), integralsPreferences.absolute.format),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if (dlv(integralsPreferences, 'relative.show')) {
|
|
110
|
+
columns.push({
|
|
112
111
|
id: 'relative',
|
|
113
|
-
|
|
112
|
+
header: () => {
|
|
114
113
|
const n = activeTab?.replaceAll(/\d/g, '');
|
|
115
114
|
return <span>{`Relative ${n}`}</span>;
|
|
116
115
|
},
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
accessorKey: 'integral',
|
|
117
|
+
cell: ({ getValue, row }) => {
|
|
119
118
|
const value = formatNumber(
|
|
120
|
-
|
|
119
|
+
getValue() || 0,
|
|
121
120
|
integralsPreferences.relative.format,
|
|
122
121
|
);
|
|
123
122
|
const flag = checkIntegralKind(row.original);
|
|
@@ -133,55 +132,42 @@ function IntegralTable(props: IntegralTableProps) {
|
|
|
133
132
|
/>
|
|
134
133
|
);
|
|
135
134
|
},
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
Cell: ({ row }: CellProps<Integral>) => (
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
if (dlv(integralsPreferences, 'showKind')) {
|
|
138
|
+
columns.push({
|
|
139
|
+
header: 'Kind',
|
|
140
|
+
sortFn: 'basic',
|
|
141
|
+
accessorKey: 'kind',
|
|
142
|
+
cell: ({ getValue, row }) => (
|
|
145
143
|
<Select
|
|
146
144
|
onChange={(value) =>
|
|
147
145
|
changeIntegralDataHandler(value as SignalKind, row.original)
|
|
148
146
|
}
|
|
149
147
|
items={SIGNAL_KINDS}
|
|
150
148
|
style={selectStyle}
|
|
151
|
-
defaultValue={
|
|
149
|
+
defaultValue={getValue()}
|
|
152
150
|
/>
|
|
153
151
|
),
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
if (dlv(integralsPreferences, 'showDeleteAction')) {
|
|
155
|
+
columns.push(
|
|
156
|
+
createActionColumn<Integral>({
|
|
157
|
+
id: 'delete-action',
|
|
159
158
|
icon: <FaRegTrashAlt />,
|
|
160
159
|
onClick: deleteIntegralHandler,
|
|
161
160
|
}),
|
|
162
|
-
|
|
163
|
-
],
|
|
164
|
-
[
|
|
165
|
-
activeTab,
|
|
166
|
-
changeIntegralDataHandler,
|
|
167
|
-
integralsPreferences,
|
|
168
|
-
saveRelativeHandler,
|
|
169
|
-
deleteIntegralHandler,
|
|
170
|
-
],
|
|
171
|
-
);
|
|
172
|
-
|
|
173
|
-
const tableColumns = useMemo(() => {
|
|
174
|
-
const columns: Array<CustomColumn<Integral>> = [];
|
|
175
|
-
for (const col of COLUMNS) {
|
|
176
|
-
const { showWhen, ...colParams } = col;
|
|
177
|
-
if (dlv(integralsPreferences, showWhen)) {
|
|
178
|
-
addCustomColumn(columns, colParams);
|
|
179
|
-
}
|
|
161
|
+
);
|
|
180
162
|
}
|
|
181
|
-
|
|
182
|
-
columns.sort((object1, object2) => object1.index - object2.index);
|
|
183
163
|
return columns;
|
|
184
|
-
}, [
|
|
164
|
+
}, [
|
|
165
|
+
activeTab,
|
|
166
|
+
changeIntegralDataHandler,
|
|
167
|
+
integralsPreferences,
|
|
168
|
+
saveRelativeHandler,
|
|
169
|
+
deleteIntegralHandler,
|
|
170
|
+
]);
|
|
185
171
|
|
|
186
172
|
if (info.isFid) {
|
|
187
173
|
return <NoDataForFid />;
|
|
@@ -191,7 +177,7 @@ function IntegralTable(props: IntegralTableProps) {
|
|
|
191
177
|
return <EmptyText text="No data" />;
|
|
192
178
|
}
|
|
193
179
|
|
|
194
|
-
return <
|
|
180
|
+
return <TanStackTable data={data} columns={COLUMNS} />;
|
|
195
181
|
}
|
|
196
182
|
|
|
197
183
|
export default memo(IntegralTable);
|