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
|
@@ -6,9 +6,8 @@ import { getPeakAbsoluteArea } from "../../../data/utilities/getPeakAbsoluteArea
|
|
|
6
6
|
import { useDispatch } from '../../context/DispatchContext.js';
|
|
7
7
|
import { EditableColumn } from '../../elements/EditableColumn.js';
|
|
8
8
|
import { EmptyText } from '../../elements/EmptyText.js';
|
|
9
|
-
import ReactTable from '../../elements/ReactTable/ReactTable.js';
|
|
10
|
-
import addCustomColumn, { createActionColumn, } from '../../elements/ReactTable/utility/addCustomColumn.js';
|
|
11
9
|
import { TableHeaderLabel } from "../../elements/TableHeaderLabel.js";
|
|
10
|
+
import { TanStackTable, createActionColumn, createTanStackColumnHelper, } from "../../elements/tanstack_table/index.js";
|
|
12
11
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences.js';
|
|
13
12
|
import { formatNumber } from '../../utility/formatNumber.js';
|
|
14
13
|
import { NoDataForFid } from '../extra/placeholder/NoDataForFid.js';
|
|
@@ -19,15 +18,14 @@ export function usePeaksTableColumns(activeTab) {
|
|
|
19
18
|
const dispatch = useDispatch();
|
|
20
19
|
const { tablePreferences } = usePanelPreferences('peaks', activeTab);
|
|
21
20
|
const [peak, setEditedPeak] = useState();
|
|
22
|
-
const deletePeakHandler = useCallback((
|
|
23
|
-
const params = row.original;
|
|
21
|
+
const deletePeakHandler = useCallback((params) => {
|
|
24
22
|
dispatch({
|
|
25
23
|
type: 'DELETE_PEAK',
|
|
26
24
|
payload: { id: params.id },
|
|
27
25
|
});
|
|
28
26
|
}, [dispatch]);
|
|
29
27
|
const editPeakHandler = useCallback((row) => {
|
|
30
|
-
setEditedPeak(row
|
|
28
|
+
setEditedPeak(row);
|
|
31
29
|
}, []);
|
|
32
30
|
const saveDeltaPPMRefsHandler = useCallback((value, peak) => {
|
|
33
31
|
const shift = Number(value) - peak.x;
|
|
@@ -39,139 +37,131 @@ export function usePeaksTableColumns(activeTab) {
|
|
|
39
37
|
payload: { value: Number(value), id },
|
|
40
38
|
});
|
|
41
39
|
}, [dispatch]);
|
|
42
|
-
const COLUMNS = useMemo(() =>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
: '',
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
40
|
+
const COLUMNS = useMemo(() => {
|
|
41
|
+
const columnHelper = createTanStackColumnHelper();
|
|
42
|
+
const columns = columnHelper.columns([]);
|
|
43
|
+
// TODO: Use column visibility feature instead.
|
|
44
|
+
if (dlv(tablePreferences, 'showSerialNumber')) {
|
|
45
|
+
columns.push({
|
|
46
|
+
id: 'rowNumber',
|
|
47
|
+
header: '#',
|
|
48
|
+
accessorFn: (_, index) => index + 1,
|
|
49
|
+
meta: { style: { width: '1%', maxWidth: '40px', minWidth: '40px' } },
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (dlv(tablePreferences, 'deltaPPM.show')) {
|
|
53
|
+
columns.push({
|
|
54
|
+
header: () => {
|
|
55
|
+
return (_jsx(TableHeaderLabel, { text: "\u03B4 (ppm)", shortText: "\u03B4", fontSize: 12, fontWeight: "bold" }));
|
|
56
|
+
},
|
|
57
|
+
accessorKey: 'x',
|
|
58
|
+
cell: ({ row }) => (_jsx(EditableColumn, { value: formatNumber(row.original.x, tablePreferences.deltaPPM.format), onSave: (value) => saveDeltaPPMRefsHandler(value, row.original), type: "number", validate: (val) => val !== '' })),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (dlv(tablePreferences, 'deltaHz.show')) {
|
|
62
|
+
columns.push({
|
|
63
|
+
header: 'δ (Hz)',
|
|
64
|
+
accessorKey: 'xHz',
|
|
65
|
+
cell: ({ row }) => formatNumber(row.original.xHz, tablePreferences.deltaHz.format),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (dlv(tablePreferences, 'intensity.show')) {
|
|
69
|
+
columns.push({
|
|
70
|
+
header: 'Intensity',
|
|
71
|
+
meta: { style: { maxWidth: '80px' } },
|
|
72
|
+
accessorKey: 'y',
|
|
73
|
+
cell: ({ row }) => formatNumber(row.original.y, tablePreferences.intensity.format),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (dlv(tablePreferences, 'peakWidth.show')) {
|
|
77
|
+
columns.push({
|
|
78
|
+
header: 'Width (Hz)',
|
|
79
|
+
accessorKey: 'width',
|
|
80
|
+
cell: ({ row }) => formatNumber(row.original.width, tablePreferences.peakWidth.format),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
if (dlv(tablePreferences, 'showKind')) {
|
|
84
|
+
columns.push({
|
|
85
|
+
header: 'Kind',
|
|
86
|
+
accessorFn: (row) => row.shape?.kind || '',
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
if (dlv(tablePreferences, 'fwhm.show')) {
|
|
90
|
+
columns.push({
|
|
91
|
+
header: 'fwhm',
|
|
92
|
+
accessorFn: (row) => row?.shape?.fwhm ?? '',
|
|
93
|
+
cell: ({ row }) => getFormattedNumber(row.original?.shape?.fwhm, tablePreferences.fwhm.format),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
if (dlv(tablePreferences, 'mu.show')) {
|
|
97
|
+
columns.push({
|
|
98
|
+
header: 'mu',
|
|
99
|
+
accessorFn: (row) => row?.shape?.kind === 'pseudoVoigt' ? (row.shape.mu ?? '') : '',
|
|
100
|
+
cell: ({ row }) => {
|
|
101
|
+
const shape = row.original?.shape;
|
|
102
|
+
const mu = shape?.kind === 'pseudoVoigt' ? shape.mu : undefined;
|
|
103
|
+
return getFormattedNumber(mu, tablePreferences.mu.format);
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (dlv(tablePreferences, 'gamma.show')) {
|
|
108
|
+
columns.push({
|
|
109
|
+
header: 'gamma',
|
|
110
|
+
accessorFn: (row) => row?.shape?.kind === 'generalizedLorentzian'
|
|
111
|
+
? (row.shape.gamma ?? '')
|
|
112
|
+
: '',
|
|
113
|
+
cell: ({ row }) => {
|
|
114
|
+
const shape = row.original?.shape;
|
|
115
|
+
const gamma = shape?.kind === 'generalizedLorentzian' ? shape.gamma : undefined;
|
|
116
|
+
return getFormattedNumber(gamma, tablePreferences.gamma.format);
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (dlv(tablePreferences, 'absoluteArea.show')) {
|
|
121
|
+
columns.push({
|
|
122
|
+
header: 'Absolute area',
|
|
123
|
+
accessorFn: (row) => getPeakAbsoluteArea(row) ?? '',
|
|
124
|
+
cell: ({ row }) => getFormattedNumber(getPeakAbsoluteArea(row.original), tablePreferences.absoluteArea.format),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (dlv(tablePreferences, 'relativeArea.show')) {
|
|
128
|
+
columns.push({
|
|
129
|
+
header: () => {
|
|
130
|
+
return (_jsx(TableHeaderLabel, { text: "Relative area", shortText: "Area", fontSize: 12, fontWeight: "bold" }));
|
|
131
|
+
},
|
|
132
|
+
accessorKey: 'relativeArea',
|
|
133
|
+
cell: ({ row }) => {
|
|
134
|
+
const value = formatNumber(row.original.relativeArea || 0, tablePreferences.relativeArea.format);
|
|
135
|
+
return (_jsx(EditableColumn, { value: value, onSave: (newValue) => saveRelativeAreaHandler(newValue, row.original.id), validate: (val) => val !== '', type: "number", style: { padding: '0.1rem 0.4rem' } }));
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
if (dlv(tablePreferences, 'showEditPeakShapeAction')) {
|
|
140
|
+
columns.push(createActionColumn({
|
|
141
|
+
id: 'edit-peak',
|
|
141
142
|
icon: _jsx(FaEdit, {}),
|
|
142
143
|
onClick: editPeakHandler,
|
|
143
144
|
style: {
|
|
144
145
|
borderRight: '0px',
|
|
145
146
|
},
|
|
146
|
-
})
|
|
147
|
-
}
|
|
148
|
-
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
index: 21,
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
if (dlv(tablePreferences, 'showDeleteAction')) {
|
|
150
|
+
columns.push(createActionColumn({
|
|
151
|
+
id: 'delete-peak',
|
|
152
152
|
icon: _jsx(FaRegTrashAlt, {}),
|
|
153
153
|
onClick: deletePeakHandler,
|
|
154
|
-
})
|
|
155
|
-
}
|
|
156
|
-
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
return columns;
|
|
157
|
+
}, [
|
|
157
158
|
editPeakHandler,
|
|
158
159
|
deletePeakHandler,
|
|
159
160
|
tablePreferences,
|
|
160
161
|
saveDeltaPPMRefsHandler,
|
|
161
162
|
saveRelativeAreaHandler,
|
|
162
163
|
]);
|
|
163
|
-
|
|
164
|
-
const columns = [];
|
|
165
|
-
for (const col of COLUMNS) {
|
|
166
|
-
const { showWhen, ...colParams } = col;
|
|
167
|
-
if (dlv(tablePreferences, showWhen)) {
|
|
168
|
-
addCustomColumn(columns, colParams);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
columns.sort((object1, object2) => object1.index - object2.index);
|
|
172
|
-
return columns;
|
|
173
|
-
}, [COLUMNS, tablePreferences]);
|
|
174
|
-
return { tableColumns, peak, setEditedPeak };
|
|
164
|
+
return { tableColumns: COLUMNS, peak, setEditedPeak };
|
|
175
165
|
}
|
|
176
166
|
function handleActiveRow(row) {
|
|
177
167
|
return row.original.isConstantlyHighlighted;
|
|
@@ -184,7 +174,7 @@ function PeaksTable(props) {
|
|
|
184
174
|
if (data.length === 0) {
|
|
185
175
|
return _jsx(EmptyText, { text: "No data" });
|
|
186
176
|
}
|
|
187
|
-
return (_jsx(
|
|
177
|
+
return (_jsx(TanStackTable, { activeRow: handleActiveRow, rowStyle: { activated: { backgroundColor: '#f5f5dc' } }, data: data, columns: tableColumns, approxItemHeight: 24, enableVirtualScroll: true }));
|
|
188
178
|
}
|
|
189
179
|
export default memo(PeaksTable);
|
|
190
180
|
//# sourceMappingURL=PeaksTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeaksTable.js","sourceRoot":"","sources":["../../../../src/component/panels/PeaksPanel/PeaksTable.tsx"],"names":[],"mappings":";AACA,OAAO,GAAG,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"PeaksTable.js","sourceRoot":"","sources":["../../../../src/component/panels/PeaksPanel/PeaksTable.tsx"],"names":[],"mappings":";AACA,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,gB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
|
-
import type {
|
|
1
|
+
import type { TanStackTableColumn } from '../../elements/tanstack_table/index.ts';
|
|
2
2
|
import type { PeakRecord } from './PeaksPanel.tsx';
|
|
3
|
-
export declare function exportPeaksToTSV(data: PeakRecord[], tableColumns: Array<
|
|
3
|
+
export declare function exportPeaksToTSV(data: PeakRecord[], tableColumns: Array<TanStackTableColumn<PeakRecord>>): string;
|
|
4
4
|
//# sourceMappingURL=peaksToTSV.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peaksToTSV.d.ts","sourceRoot":"","sources":["../../../../src/component/panels/PeaksPanel/peaksToTSV.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"peaksToTSV.d.ts","sourceRoot":"","sources":["../../../../src/component/panels/PeaksPanel/peaksToTSV.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAElF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQnD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,UAAU,EAAE,EAClB,YAAY,EAAE,KAAK,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,UA6BrD"}
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import dlv from 'dlv';
|
|
2
|
+
function formatCellValue(value) {
|
|
3
|
+
return value === null || value === undefined ? '' : String(value);
|
|
4
|
+
}
|
|
2
5
|
export function exportPeaksToTSV(data, tableColumns) {
|
|
3
|
-
const exportColumns = tableColumns.filter((col) => col.
|
|
6
|
+
const exportColumns = tableColumns.filter((col) => col.header && typeof col.header === 'string');
|
|
4
7
|
const headers = [];
|
|
5
8
|
for (const col of exportColumns) {
|
|
6
|
-
headers.push(col.
|
|
9
|
+
headers.push(col.header);
|
|
7
10
|
}
|
|
8
11
|
const rows = [];
|
|
9
12
|
for (let i = 0; i < data.length; i++) {
|
|
10
13
|
const record = data[i];
|
|
11
14
|
const cells = [];
|
|
12
15
|
for (const col of exportColumns) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
cells.push(String(dlv(record, accessor) ?? ''));
|
|
16
|
+
if ('accessorKey' in col) {
|
|
17
|
+
cells.push(formatCellValue(dlv(record, col.accessorKey)));
|
|
16
18
|
}
|
|
17
|
-
else if (
|
|
18
|
-
cells.push(
|
|
19
|
-
subRows: [],
|
|
20
|
-
depth: 0,
|
|
21
|
-
data: [],
|
|
22
|
-
}) ?? ''));
|
|
19
|
+
else if ('accessorFn' in col) {
|
|
20
|
+
cells.push(formatCellValue(col.accessorFn(record, i)));
|
|
23
21
|
}
|
|
24
22
|
else {
|
|
25
23
|
cells.push('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peaksToTSV.js","sourceRoot":"","sources":["../../../../src/component/panels/PeaksPanel/peaksToTSV.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"peaksToTSV.js","sourceRoot":"","sources":["../../../../src/component/panels/PeaksPanel/peaksToTSV.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAQtB,SAAS,eAAe,CAAC,KAAsB;IAC7C,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,IAAkB,EAClB,YAAoD;IAEpD,MAAM,aAAa,GAAG,YAAY,CAAC,MAAM,CACvC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,IAAI,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,CACtD,CAAC;IAEF,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;QAChC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAgB,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;YAChC,IAAI,aAAa,IAAI,GAAG,EAAE,CAAC;gBACzB,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAC5D,CAAC;iBAAM,IAAI,YAAY,IAAI,GAAG,EAAE,CAAC;gBAC/B,KAAK,CAAC,IAAI,CACR,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAoB,CAAC,CAC9D,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACjB,CAAC;QACH,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Info1D } from '@zakodium/nmr-types';
|
|
2
2
|
import type { WorkspacePanelPreferences } from '@zakodium/nmrium-core';
|
|
3
|
-
import type {
|
|
3
|
+
import type { TanStackTableContextMenuProps } from '../../elements/tanstack_table/index.ts';
|
|
4
4
|
import type { RangesTableDataRow } from './RangesPanel.js';
|
|
5
|
-
|
|
5
|
+
import type { RangeData } from './hooks/useMapRanges.js';
|
|
6
|
+
interface RangesTableProps extends TanStackTableContextMenuProps<RangeData> {
|
|
6
7
|
preferences: WorkspacePanelPreferences['ranges'];
|
|
7
8
|
tableData: RangesTableDataRow[];
|
|
8
9
|
activeTab: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangesTable.d.ts","sourceRoot":"","sources":["../../../../src/component/panels/RangesPanel/RangesTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAKvE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"RangesTable.d.ts","sourceRoot":"","sources":["../../../../src/component/panels/RangesPanel/RangesTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAKvE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAM5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAgDzD,UAAU,gBAAiB,SAAQ,6BAA6B,CAAC,SAAS,CAAC;IACzE,WAAW,EAAE,yBAAyB,CAAC,QAAQ,CAAC,CAAC;IACjD,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAID,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BA4F1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangesTable.js","sourceRoot":"","sources":["../../../../src/component/panels/RangesPanel/RangesTable.tsx"],"names":[],"mappings":";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,QAAQ,CAAC,IAAI,IAAI,CACjC,cAAI,EAAE,EAAC,MAAM,KAAK,MAAM,8BACb,YAAY,CAAC,MAAM,CAAC,CAAC,OAAO,IAClC,CACN,EACA,gBAAgB,CAAC,OAAO,CAAC,IAAI,IAAI,wCAAgB,EAEjD,gBAAgB,CAAC,QAAQ,CAAC,IAAI,IAAI,CACjC,cAAI,EAAE,EAAC,aAAa,KAAK,MAAM,sBACvB,OAAO,OAAG,YAAY,CAAC,aAAa,CAAC,CAAC,OAAO,IAChD,CACN,EACA,gBAAgB,CAAC,QAAQ,CAAC,IAAI,IAAI,oCAAiB,EACnD,gBAAgB,CAAC,gBAAgB,IAAI,iCAAc,EACnD,gBAAgB,CAAC,QAAQ,CAAC,IAAI,IAAI,kCAAe,EAEjD,gBAAgB,CAAC,cAAc,IAAI,CAClC,aAAI,KAAK,EAAC,mBAAmB,YAC3B,KAAC,MAAM,IAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAI,GAChD,CACN,EACA,gBAAgB,CAAC,QAAQ,IAAI,gCAAa,EAC1C,WAAW,IAAI,uBAAK,EAAE,GAAM,IAC1B,GACC,EACR,0BACG,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;4BAClB,OAAO,CACL,KAAC,cAAc,IAEb,OAAO,EAAE,KAAK,EACd,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,mBAAmB,EAAE,mBAAmB,IALnC,KAAK,CAAC,MAAM,CAMjB,CACH,CAAC;wBACJ,CAAC,CAAC,GACI,IACF,IACP,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Info1D } from '@zakodium/nmr-types';
|
|
2
2
|
import type { WorkspacePanelPreferences } from '@zakodium/nmrium-core';
|
|
3
3
|
import type { CSSProperties } from 'react';
|
|
4
|
-
import type {
|
|
4
|
+
import type { TanStackTableContextMenuProps } from '../../elements/tanstack_table/index.ts';
|
|
5
5
|
import type { RangeData } from './hooks/useMapRanges.js';
|
|
6
|
-
interface RangesTableRowProps extends
|
|
6
|
+
interface RangesTableRowProps extends TanStackTableContextMenuProps<RangeData> {
|
|
7
7
|
rowData: RangeData;
|
|
8
8
|
preferences: WorkspacePanelPreferences['ranges'];
|
|
9
9
|
info: Info1D;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangesTableRow.d.ts","sourceRoot":"","sources":["../../../../src/component/panels/RangesPanel/RangesTableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,OAAO,CAAC;AAWvD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"RangesTableRow.d.ts","sourceRoot":"","sources":["../../../../src/component/panels/RangesPanel/RangesTableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,OAAO,CAAC;AAWvD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAY5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAUzD,UAAU,mBAAoB,SAAQ,6BAA6B,CAAC,SAAS,CAAC;IAC5E,OAAO,EAAE,SAAS,CAAC;IACnB,WAAW,EAAE,yBAAyB,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,SAAS,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE;QACP,YAAY,EAAE,MAAM,IAAI,CAAC;QACzB,YAAY,EAAE,MAAM,IAAI,CAAC;KAC1B,CAAC;CACH;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE;QACX,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,aAAa,CAAC;KACvB,CAAC;CACH;AAED,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GACjD,YAAY,GACZ,WAAW,CAAC;AAEd,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,+BA6NhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpectraTable.d.ts","sourceRoot":"","sources":["../../../../src/component/panels/SpectraPanel/SpectraTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EAKd,QAAQ,EAET,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SpectraTable.d.ts","sourceRoot":"","sources":["../../../../src/component/panels/SpectraPanel/SpectraTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EAKd,QAAQ,EAET,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AA6BvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAuBhF,UAAU,iBAAkB,SAAQ,uBAAuB;IACzD,IAAI,EAAE,GAAG,CAAC;IACV,aAAa,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACvC,sBAAsB,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpE,OAAO,EAAE,MAAM,CAAC;CACjB;AAuFD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAiRpD"}
|
|
@@ -12,7 +12,7 @@ import { useDispatch } from '../../context/DispatchContext.js';
|
|
|
12
12
|
import { useSortSpectra } from '../../context/SortSpectraContext.js';
|
|
13
13
|
import { useToaster } from '../../context/ToasterContext.js';
|
|
14
14
|
import { ContextMenu } from '../../elements/ContextMenuBluePrint.js';
|
|
15
|
-
import
|
|
15
|
+
import { TanStackTable, createTanStackColumnHelper, } from "../../elements/tanstack_table/index.js";
|
|
16
16
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences.js';
|
|
17
17
|
import ExportAsJcampModal from '../../modal/ExportAsJcampModal.js';
|
|
18
18
|
import { getValueByPath } from "../../utility/getValueByPath.js";
|
|
@@ -106,6 +106,7 @@ function isValidExportForCT(spectrum, molecules) {
|
|
|
106
106
|
}
|
|
107
107
|
return true;
|
|
108
108
|
}
|
|
109
|
+
const columnHelper = createTanStackColumnHelper();
|
|
109
110
|
export function SpectraTable(props) {
|
|
110
111
|
const { data, activeSpectra, onChangeVisibility, onChangeActiveSpectrum, nucleus, } = props;
|
|
111
112
|
const toaster = useToaster();
|
|
@@ -119,24 +120,28 @@ export function SpectraTable(props) {
|
|
|
119
120
|
const COLUMNS = useMemo(() => ({
|
|
120
121
|
visible: {
|
|
121
122
|
id: 'hide-show-spectrum',
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
header: '',
|
|
124
|
+
meta: {
|
|
125
|
+
style: {
|
|
126
|
+
width: '35px',
|
|
127
|
+
maxWidth: '55px',
|
|
128
|
+
height: '24px',
|
|
129
|
+
},
|
|
127
130
|
},
|
|
128
|
-
|
|
131
|
+
cell: ({ row }) => {
|
|
129
132
|
return (_jsx(ShowHideSpectrumButton, { data: row.original, onChangeVisibility: onChangeVisibility }));
|
|
130
133
|
},
|
|
131
134
|
},
|
|
132
135
|
color: {
|
|
133
136
|
id: 'spectrum-actions',
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
meta: {
|
|
138
|
+
style: {
|
|
139
|
+
width: '30px',
|
|
140
|
+
maxWidth: '30px',
|
|
141
|
+
height: '24px',
|
|
142
|
+
},
|
|
138
143
|
},
|
|
139
|
-
|
|
144
|
+
cell: ({ row }) => {
|
|
140
145
|
const { display, info: { dimension, isFid }, } = row.original;
|
|
141
146
|
if (dimension === 2 && isFid) {
|
|
142
147
|
return _jsx("div", {});
|
|
@@ -205,11 +210,12 @@ export function SpectraTable(props) {
|
|
|
205
210
|
}
|
|
206
211
|
}, [dispatch, molecules, rawWriteWithType, toaster]);
|
|
207
212
|
function handleActiveRow(row) {
|
|
208
|
-
return activeSpectraSet.has(row
|
|
213
|
+
return activeSpectraSet.has(row.original.id);
|
|
209
214
|
}
|
|
210
215
|
const tableColumns = useMemo(() => {
|
|
211
|
-
const columns = [];
|
|
212
|
-
|
|
216
|
+
const columns = columnHelper.columns([]);
|
|
217
|
+
const columnIdCounts = new Map();
|
|
218
|
+
// TODO: use column visibility feature
|
|
213
219
|
const visibleColumns = spectraPreferences.columns.filter((col) => col.visible);
|
|
214
220
|
for (const col of visibleColumns) {
|
|
215
221
|
const name = col?.name;
|
|
@@ -217,7 +223,7 @@ export function SpectraTable(props) {
|
|
|
217
223
|
if (name && COLUMNS[name]) {
|
|
218
224
|
columns.push({
|
|
219
225
|
...COLUMNS[name],
|
|
220
|
-
|
|
226
|
+
header: () => _jsx(ColumnHeader, { label: col.label, col: col }),
|
|
221
227
|
id: name,
|
|
222
228
|
});
|
|
223
229
|
}
|
|
@@ -238,19 +244,24 @@ export function SpectraTable(props) {
|
|
|
238
244
|
return _jsx(RenderAsHTML, { data: row.original, jpath: pathString });
|
|
239
245
|
};
|
|
240
246
|
}
|
|
247
|
+
const baseColumnId = `jpath:${pathString}`;
|
|
248
|
+
const duplicateIndex = columnIdCounts.get(baseColumnId) ?? 0;
|
|
249
|
+
columnIdCounts.set(baseColumnId, duplicateIndex + 1);
|
|
241
250
|
const cell = {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
251
|
+
header: () => _jsx(ColumnHeader, { label: col.label, col: col }),
|
|
252
|
+
accessorFn: (value) => getValueByPath(value, jpath, format),
|
|
253
|
+
cell: ({ getValue }) => {
|
|
254
|
+
const val = getValue();
|
|
245
255
|
return (_jsx(Tooltip, { content: val, renderTarget: ({ isOpen, ...targetProps }) => (_jsx("div", { ...targetProps, children: val })) }));
|
|
246
256
|
},
|
|
247
|
-
...(cellRender && {
|
|
248
|
-
id:
|
|
249
|
-
|
|
257
|
+
...(cellRender && { cell: cellRender }),
|
|
258
|
+
id: duplicateIndex === 0
|
|
259
|
+
? baseColumnId
|
|
260
|
+
: `${baseColumnId}:${duplicateIndex}`,
|
|
261
|
+
meta: { style },
|
|
250
262
|
};
|
|
251
263
|
columns.push(cell);
|
|
252
264
|
}
|
|
253
|
-
index++;
|
|
254
265
|
}
|
|
255
266
|
return columns;
|
|
256
267
|
}, [COLUMNS, spectraPreferences.columns]);
|
|
@@ -262,9 +273,9 @@ export function SpectraTable(props) {
|
|
|
262
273
|
reset();
|
|
263
274
|
}
|
|
264
275
|
}
|
|
265
|
-
function handleRowStyle(
|
|
276
|
+
function handleRowStyle(row) {
|
|
266
277
|
return {
|
|
267
|
-
base: activeSpectraSet.has(
|
|
278
|
+
base: activeSpectraSet.has(row.original.id) ? { opacity: 0.2 } : {},
|
|
268
279
|
activated: { opacity: 1 },
|
|
269
280
|
};
|
|
270
281
|
}
|
|
@@ -273,7 +284,7 @@ export function SpectraTable(props) {
|
|
|
273
284
|
molecules,
|
|
274
285
|
})
|
|
275
286
|
: Spectra2DContextMenuOptions;
|
|
276
|
-
return (_jsxs(_Fragment, { children: [_jsx(
|
|
287
|
+
return (_jsxs(_Fragment, { children: [_jsx(TanStackTable, { rowStyle: handleRowStyle, activeRow: handleActiveRow, data: data, columns: tableColumns, onClick: (e, data) => onChangeActiveSpectrum(e, data.original), enableVirtualScroll: true, approxItemHeight: 24, contextMenu: contextMenu, onContextMenuSelect: selectContextMenuHandler, onSortEnd: handleSortEnd, style: { 'table td': { paddingTop: 0, paddingBottom: 0 } } }), exportedSpectrum && (_jsx(ExportAsJcampModal, { spectrum: exportedSpectrum, closeDialog: () => {
|
|
277
288
|
setExportedSpectrum(null);
|
|
278
289
|
} })), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Spectra" })] }));
|
|
279
290
|
}
|