diff --git a/src/components/export.tsx b/src/components/export.tsx index 003b35e..8b18123 100644 --- a/src/components/export.tsx +++ b/src/components/export.tsx @@ -21,11 +21,11 @@ export function Export(): JSX.Element { const [anchor, setAnchor] = useState(null); const generate = (options?: CsvExportOptions) => { - const { activeColumns, activeItems } = table.getState(); + const { activeColumns, activeItems, items } = table.getState(); const data = [ activeColumns.map((column) => String(column.id)), - ...activeItems.map((item) => + ...(options?.all ? items : activeItems).map((item) => activeColumns.map((column) => column.exportCell(column.value(item.value), item.value)), ), ]; diff --git a/src/misc/csvExport.ts b/src/misc/csvExport.ts index 1934893..d370c48 100644 --- a/src/misc/csvExport.ts +++ b/src/misc/csvExport.ts @@ -3,6 +3,7 @@ export type CsvExportOptions = { separator?: string; quote?: string; eol?: string; + all?: boolean; }; export function csvExport(