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
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export default function useRowSpan(hooks) {
|
|
2
|
-
hooks.useInstance.push(reducer);
|
|
3
|
-
}
|
|
4
|
-
function reducer(instance) {
|
|
5
|
-
const { allColumns } = instance;
|
|
6
|
-
const rowSpanHeaders = allColumns
|
|
7
|
-
.filter(({ enableRowSpan }) => enableRowSpan !== undefined && enableRowSpan !== false)
|
|
8
|
-
.map(({ id }) => ({ id, cellValue: null, cellIndex: 0 }));
|
|
9
|
-
Object.assign(instance, {
|
|
10
|
-
rowSpanHeaders,
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
export function prepareRowSpan(rows, index, rowSpanHeaders, groupKey) {
|
|
14
|
-
const row = rows[index];
|
|
15
|
-
for (let j = 0; j < row.allCells.length; j++) {
|
|
16
|
-
const cell = row.allCells[j];
|
|
17
|
-
const rowSpanHeader = rowSpanHeaders.find((x) => x.id === cell.column.id);
|
|
18
|
-
if (rowSpanHeader !== undefined) {
|
|
19
|
-
const cellValue = groupKey
|
|
20
|
-
? `${cell.value}-${String(row.original[groupKey])}`
|
|
21
|
-
: cell.value;
|
|
22
|
-
if (rowSpanHeader.cellValue === null ||
|
|
23
|
-
rowSpanHeader.cellValue !== cellValue) {
|
|
24
|
-
// @ts-expect-error Modifying a property that doesn't exist on the type
|
|
25
|
-
cell.isRowSpanned = false;
|
|
26
|
-
rowSpanHeader.cellValue = cellValue;
|
|
27
|
-
rowSpanHeader.cellIndex = index;
|
|
28
|
-
// @ts-expect-error Modifying a property that doesn't exist on the type
|
|
29
|
-
cell.rowSpan = 1;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
// @ts-expect-error Modifying a property that doesn't exist on the type
|
|
33
|
-
rows[rowSpanHeader.cellIndex].allCells[j].rowSpan++;
|
|
34
|
-
// @ts-expect-error Modifying a property that doesn't exist on the type
|
|
35
|
-
cell.isRowSpanned = true;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=useRowSpan.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRowSpan.js","sourceRoot":"","sources":["../../../../../src/component/elements/ReactTable/utility/useRowSpan.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAU;IAC3C,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,OAAO,CAAC,QAAa;IAC5B,MAAM,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;IAEhC,MAAM,cAAc,GAAG,UAAU;SAC9B,MAAM,CACL,CAAC,EAAE,aAAa,EAAO,EAAE,EAAE,CACzB,aAAa,KAAK,SAAS,IAAI,aAAa,KAAK,KAAK,CACzD;SACA,GAAG,CAAC,CAAC,EAAE,EAAE,EAAO,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEjE,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;QACtB,cAAc;KACf,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,IAAmB,EACnB,KAAa,EACb,cAA8B,EAC9B,QAAkB;IAElB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7C,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC7B,MAAM,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC1E,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAChC,MAAM,SAAS,GAAG,QAAQ;gBACxB,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE;gBACnD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YAEf,IACE,aAAa,CAAC,SAAS,KAAK,IAAI;gBAChC,aAAa,CAAC,SAAS,KAAK,SAAS,EACrC,CAAC;gBACD,uEAAuE;gBACvE,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;gBAC1B,aAAa,CAAC,SAAS,GAAG,SAAS,CAAC;gBACpC,aAAa,CAAC,SAAS,GAAG,KAAK,CAAC;gBAChC,uEAAuE;gBACvE,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;YACnB,CAAC;iBAAM,CAAC;gBACN,uEAAuE;gBACvE,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;gBACpD,uEAAuE;gBACvE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, MouseEvent } from 'react';
|
|
2
|
-
import { FaSortAmountDown, FaSortAmountUp } from 'react-icons/fa';
|
|
3
|
-
|
|
4
|
-
interface TableCellEvent {
|
|
5
|
-
onClick: (e: MouseEvent<HTMLTableCellElement>) => void;
|
|
6
|
-
}
|
|
7
|
-
interface ReactTableHeaderProps extends TableCellEvent {
|
|
8
|
-
headerGroups: any;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const sortIconStyle: CSSProperties = {
|
|
12
|
-
position: 'absolute',
|
|
13
|
-
top: '50%',
|
|
14
|
-
transform: 'translateY(-50%)',
|
|
15
|
-
left: '2px',
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
function ReactTableHeader({ headerGroups, onClick }: ReactTableHeaderProps) {
|
|
19
|
-
return (
|
|
20
|
-
<thead>
|
|
21
|
-
{headerGroups.map((headerGroup: any) => {
|
|
22
|
-
const { key: headerGroupKey, ...restHeaderGroupProps } =
|
|
23
|
-
headerGroup.getHeaderGroupProps();
|
|
24
|
-
return (
|
|
25
|
-
<tr key={headerGroupKey} {...restHeaderGroupProps}>
|
|
26
|
-
{headerGroup.headers.map((column: any) => (
|
|
27
|
-
<HeaderCell
|
|
28
|
-
key={column.getHeaderProps(column.getSortByToggleProps()).key}
|
|
29
|
-
column={column}
|
|
30
|
-
onClick={onClick}
|
|
31
|
-
/>
|
|
32
|
-
))}
|
|
33
|
-
</tr>
|
|
34
|
-
);
|
|
35
|
-
})}
|
|
36
|
-
</thead>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
interface HeaderCellProps extends TableCellEvent {
|
|
41
|
-
column: any;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const HeaderCell = (props: HeaderCellProps) => {
|
|
45
|
-
const { column } = props;
|
|
46
|
-
const {
|
|
47
|
-
key: headerKey,
|
|
48
|
-
style: headerStyle,
|
|
49
|
-
onClick,
|
|
50
|
-
...restHeaderProps
|
|
51
|
-
} = column.getHeaderProps(column.getSortByToggleProps());
|
|
52
|
-
function clickHandler(e: MouseEvent<HTMLTableCellElement>) {
|
|
53
|
-
if (onClick) {
|
|
54
|
-
onClick(e);
|
|
55
|
-
props.onClick(e);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return (
|
|
59
|
-
<th
|
|
60
|
-
key={headerKey}
|
|
61
|
-
{...restHeaderProps}
|
|
62
|
-
style={{ ...headerStyle, ...column.style, height: '1px' }}
|
|
63
|
-
onClick={clickHandler}
|
|
64
|
-
>
|
|
65
|
-
<span style={sortIconStyle}>
|
|
66
|
-
{column.isSorted ? (
|
|
67
|
-
column.isSortedDesc ? (
|
|
68
|
-
<FaSortAmountDown />
|
|
69
|
-
) : (
|
|
70
|
-
<FaSortAmountUp />
|
|
71
|
-
)
|
|
72
|
-
) : (
|
|
73
|
-
''
|
|
74
|
-
)}
|
|
75
|
-
</span>
|
|
76
|
-
{column?.render('Header')}
|
|
77
|
-
</th>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export default ReactTableHeader;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
2
|
-
|
|
3
|
-
import type { TableVirtualBoundary } from '../ReactTable.js';
|
|
4
|
-
|
|
5
|
-
const reactContext = createContext<TableVirtualBoundary | null>(null);
|
|
6
|
-
export const ReactTableProvider = reactContext.Provider;
|
|
7
|
-
|
|
8
|
-
export function useReactTableContext() {
|
|
9
|
-
const context = useContext(reactContext);
|
|
10
|
-
if (!context) {
|
|
11
|
-
throw new Error('react table context was not found ');
|
|
12
|
-
}
|
|
13
|
-
return context;
|
|
14
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import type { CellProps, Row } from 'react-table';
|
|
3
|
-
|
|
4
|
-
import type { Column } from '../ReactTable.js';
|
|
5
|
-
|
|
6
|
-
export type CustomColumn<T extends object> = Column<T> & { index: number };
|
|
7
|
-
export type ControlCustomColumn<T extends object> = CustomColumn<T> & {
|
|
8
|
-
showWhen: string;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default function addCustomColumn<T extends object>(
|
|
12
|
-
array: any,
|
|
13
|
-
options: CustomColumn<T>,
|
|
14
|
-
) {
|
|
15
|
-
const {
|
|
16
|
-
index,
|
|
17
|
-
Header = () => null,
|
|
18
|
-
accessor = null,
|
|
19
|
-
Cell = null,
|
|
20
|
-
sortType = 'basic',
|
|
21
|
-
enableRowSpan = false,
|
|
22
|
-
style = {},
|
|
23
|
-
id,
|
|
24
|
-
} = options || {};
|
|
25
|
-
|
|
26
|
-
array.push({
|
|
27
|
-
index,
|
|
28
|
-
...(id && { id }),
|
|
29
|
-
...(accessor && { accessor }),
|
|
30
|
-
...(Cell && { Cell }),
|
|
31
|
-
Header,
|
|
32
|
-
sortType,
|
|
33
|
-
enableRowSpan,
|
|
34
|
-
style,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
interface CreateActionColumnOptions<T extends object> {
|
|
39
|
-
onClick: (row: Row<T>, even?: MouseEvent<HTMLButtonElement>) => void;
|
|
40
|
-
icon: ReactNode;
|
|
41
|
-
style?: CSSProperties;
|
|
42
|
-
index: number;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function createActionColumn<T extends object>(
|
|
46
|
-
options: CreateActionColumnOptions<T>,
|
|
47
|
-
): CustomColumn<T> {
|
|
48
|
-
const { onClick, icon, index, style = {} } = options;
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
index,
|
|
52
|
-
Header: '',
|
|
53
|
-
style: {
|
|
54
|
-
width: '1%',
|
|
55
|
-
maxWidth: '20px',
|
|
56
|
-
minWidth: '20px',
|
|
57
|
-
padding: '0px',
|
|
58
|
-
textAlign: 'center',
|
|
59
|
-
...style,
|
|
60
|
-
},
|
|
61
|
-
id: crypto.randomUUID(),
|
|
62
|
-
Cell: (cell: CellProps<T>) => (
|
|
63
|
-
<button
|
|
64
|
-
type="button"
|
|
65
|
-
onClick={(e) => {
|
|
66
|
-
e.preventDefault();
|
|
67
|
-
e.stopPropagation();
|
|
68
|
-
onClick(cell.row, e);
|
|
69
|
-
}}
|
|
70
|
-
>
|
|
71
|
-
{icon}
|
|
72
|
-
</button>
|
|
73
|
-
),
|
|
74
|
-
};
|
|
75
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { Row } from 'react-table';
|
|
2
|
-
|
|
3
|
-
export type RowSpanHeaders = Array<{
|
|
4
|
-
cellIndex: number;
|
|
5
|
-
cellValue: string;
|
|
6
|
-
id: string;
|
|
7
|
-
}>;
|
|
8
|
-
|
|
9
|
-
export default function useRowSpan(hooks: any) {
|
|
10
|
-
hooks.useInstance.push(reducer);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function reducer(instance: any) {
|
|
14
|
-
const { allColumns } = instance;
|
|
15
|
-
|
|
16
|
-
const rowSpanHeaders = allColumns
|
|
17
|
-
.filter(
|
|
18
|
-
({ enableRowSpan }: any) =>
|
|
19
|
-
enableRowSpan !== undefined && enableRowSpan !== false,
|
|
20
|
-
)
|
|
21
|
-
.map(({ id }: any) => ({ id, cellValue: null, cellIndex: 0 }));
|
|
22
|
-
|
|
23
|
-
Object.assign(instance, {
|
|
24
|
-
rowSpanHeaders,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function prepareRowSpan<T extends object>(
|
|
29
|
-
rows: Array<Row<T>>,
|
|
30
|
-
index: number,
|
|
31
|
-
rowSpanHeaders: RowSpanHeaders,
|
|
32
|
-
groupKey?: keyof T,
|
|
33
|
-
) {
|
|
34
|
-
const row = rows[index];
|
|
35
|
-
for (let j = 0; j < row.allCells.length; j++) {
|
|
36
|
-
const cell = row.allCells[j];
|
|
37
|
-
const rowSpanHeader = rowSpanHeaders.find((x) => x.id === cell.column.id);
|
|
38
|
-
if (rowSpanHeader !== undefined) {
|
|
39
|
-
const cellValue = groupKey
|
|
40
|
-
? `${cell.value}-${String(row.original[groupKey])}`
|
|
41
|
-
: cell.value;
|
|
42
|
-
|
|
43
|
-
if (
|
|
44
|
-
rowSpanHeader.cellValue === null ||
|
|
45
|
-
rowSpanHeader.cellValue !== cellValue
|
|
46
|
-
) {
|
|
47
|
-
// @ts-expect-error Modifying a property that doesn't exist on the type
|
|
48
|
-
cell.isRowSpanned = false;
|
|
49
|
-
rowSpanHeader.cellValue = cellValue;
|
|
50
|
-
rowSpanHeader.cellIndex = index;
|
|
51
|
-
// @ts-expect-error Modifying a property that doesn't exist on the type
|
|
52
|
-
cell.rowSpan = 1;
|
|
53
|
-
} else {
|
|
54
|
-
// @ts-expect-error Modifying a property that doesn't exist on the type
|
|
55
|
-
rows[rowSpanHeader.cellIndex].allCells[j].rowSpan++;
|
|
56
|
-
// @ts-expect-error Modifying a property that doesn't exist on the type
|
|
57
|
-
cell.isRowSpanned = true;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
File without changes
|
|
File without changes
|