Skip to content

Commit 27bd1ca

Browse files
fix: bundle pdf export dependencies
1 parent da785c9 commit 27bd1ca

4 files changed

Lines changed: 20 additions & 27 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 2.0.1 - 2026-07-05
4+
5+
### Fixed
6+
7+
- Fixed `JsPdfAdapter` runtime loading in browser apps by allowing the bundler to resolve `jspdf` and `jspdf-autotable` from the consuming application.
8+
39
## 2.0.0 - 2026-07-05
410

511
### Breaking Changes

RELEASE_NOTES.md

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
1-
# @angular-bootstrap/ngbootstrap 2.0.0
1+
# @angular-bootstrap/ngbootstrap 2.0.1
22

3-
This release removes the DataGrid Excel export dependency on an unmaintained spreadsheet writer package and replaces it with a dependency-free browser adapter.
3+
This patch fixes PDF export in browser apps.
44

5-
## Highlights
5+
## Fixed
66

7-
- DataGrid Excel export now uses `BrowserExcelExportAdapter` by default.
8-
- The adapter implements the existing `ExcelExportAdapter` contract, so applications can still provide a custom exporter through Angular DI.
9-
- The package no longer references or requires the removed spreadsheet dependency.
10-
- Documentation now explains the implementation choice, security rationale, migration path, and default adapter limitations.
7+
- `JsPdfAdapter` no longer leaves `jspdf` and `jspdf-autotable` as bare browser runtime imports.
8+
- Angular/Webpack can now resolve and bundle those maintained optional PDF integrations from the consuming application.
119

12-
## Breaking Change
10+
## Notes
1311

14-
The previous spreadsheet adapter has been removed from the public API. Use `BrowserExcelExportAdapter` or provide your own `ExcelExportAdapter`.
12+
Applications using PDF export should keep `jspdf` and `jspdf-autotable` installed:
1513

16-
## Limitations
17-
18-
The built-in browser adapter exports visible column values and basic scalar cell types. It does not generate formulas, charts, pivot tables, merged cells, multiple sheets, workbook styling, or macro-enabled files.
19-
20-
## Upgrade
21-
22-
```ts
23-
import {
24-
BrowserExcelExportAdapter,
25-
ExcelExportAdapter,
26-
} from '@angular-bootstrap/ngbootstrap';
27-
28-
providers: [
29-
{ provide: ExcelExportAdapter, useClass: BrowserExcelExportAdapter },
30-
];
14+
```bash
15+
npm install jspdf jspdf-autotable
3116
```
17+
18+
Excel export remains dependency-free through `BrowserExcelExportAdapter`.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular-bootstrap/ngbootstrap",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Bootstrap-friendly standalone Angular UI components, including DataGrid, pagination, typeahead, tree, splitter, stepper, chips, and drag-and-drop.",
55
"author": {
66
"name": "Harmeet Singh"

src/datagrid/src/adapters/jsdf.adapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { PdfExportAdapter, PdfExportPayload } from '../services/export.services'
22

33
export class JsPdfAdapter implements PdfExportAdapter {
44
async export({ fileName, columns, rows, options }: PdfExportPayload) {
5-
const { jsPDF } = await import(/* webpackIgnore: true */ 'jspdf');
6-
const autoTable = (await import(/* webpackIgnore: true */ 'jspdf-autotable')).default;
5+
const { jsPDF } = await import('jspdf');
6+
const autoTable = (await import('jspdf-autotable')).default;
77
const doc = new jsPDF({ orientation: options?.landscape ? 'landscape' : 'portrait' });
88
autoTable(doc, { head: [columns], body: rows.map(r => columns.map(k => r[k])), margin: options?.margins });
99
doc.save(`${fileName}.pdf`);

0 commit comments

Comments
 (0)