chore(print/table): revert back to using the export module only

This commit is contained in:
Elian Doran 2025-11-21 22:35:29 +02:00
parent ab14bdbb18
commit 5c0cf09c42
No known key found for this signature in database

View File

@ -1,7 +1,7 @@
import { useEffect, useRef, useState } from "preact/hooks"; import { useEffect, useRef, useState } from "preact/hooks";
import { ViewModeProps } from "../interface"; import { ViewModeProps } from "../interface";
import useData, { TableConfig } from "./data"; import useData, { TableConfig } from "./data";
import { ExportModule, FormatModule, PrintModule, Tabulator as VanillaTabulator} from 'tabulator-tables'; import { ExportModule, FormatModule, Tabulator as VanillaTabulator} from 'tabulator-tables';
import Tabulator from "./tabulator"; import Tabulator from "./tabulator";
import { RawHtmlBlock } from "../../react/RawHtml"; import { RawHtmlBlock } from "../../react/RawHtml";
import "./TablePrintView.css"; import "./TablePrintView.css";
@ -26,7 +26,7 @@ export default function TablePrintView({ note, noteIds, viewConfig, onReady }: V
<Tabulator <Tabulator
tabulatorRef={tabulatorRef} tabulatorRef={tabulatorRef}
className="table-print-view-container" className="table-print-view-container"
modules={[ PrintModule, ExportModule, FormatModule ]} modules={[ ExportModule, FormatModule ]}
columns={columnDefs ?? []} columns={columnDefs ?? []}
data={rowData} data={rowData}
index="branchId" index="branchId"
@ -36,11 +36,7 @@ export default function TablePrintView({ note, noteIds, viewConfig, onReady }: V
onReady={() => { onReady={() => {
const tabulator = tabulatorRef.current; const tabulator = tabulatorRef.current;
if (!tabulator) return; if (!tabulator) return;
const generatedTable = tabulator.modules.export.generateTable(tabulator.options.printConfig, tabulator.options.printStyled, tabulator.options.printRowRange, "print"); setHtml(tabulator.getHtml());
if(tabulator.options.printFormatter){
tabulator.options.printFormatter(tabulator.element, generatedTable);
}
setHtml(generatedTable.outerHTML);
}} }}
/> />
) : ( ) : (