Skip to content

Commit

Permalink
feat: allow exporting all items
Browse files Browse the repository at this point in the history
  • Loading branch information
schummar committed Mar 27, 2024
1 parent 5c30425 commit 914c05a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/export.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ export function Export<T>(): JSX.Element {
const [anchor, setAnchor] = useState<Element | null>(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)),
),
];
Expand Down
1 change: 1 addition & 0 deletions src/misc/csvExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export type CsvExportOptions = {
separator?: string;
quote?: string;
eol?: string;
all?: boolean;
};

export function csvExport(
Expand Down

0 comments on commit 914c05a

Please sign in to comment.