@angular-bootstrap/ngbootstrap 2.0.1 → 2.0.2
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/CHANGELOG.md
CHANGED
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# @angular-bootstrap/ngbootstrap 2.0.
|
|
1
|
+
# @angular-bootstrap/ngbootstrap 2.0.2
|
|
2
2
|
|
|
3
|
-
This patch fixes PDF export
|
|
3
|
+
This patch fixes PDF export bundling for Angular browser apps.
|
|
4
4
|
|
|
5
5
|
## Fixed
|
|
6
6
|
|
|
7
|
-
- `JsPdfAdapter`
|
|
8
|
-
-
|
|
7
|
+
- `JsPdfAdapter` now loads jsPDF from its browser UMD bundle.
|
|
8
|
+
- This avoids forcing consuming apps to resolve jsPDF optional ESM dependencies such as HTML/canvas sanitization helpers when they only need table PDF export.
|
|
9
9
|
|
|
10
10
|
## Notes
|
|
11
11
|
|
|
12
|
-
Applications using PDF export should keep
|
|
12
|
+
Applications using PDF export should keep both maintained PDF integrations installed:
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
npm install jspdf jspdf-autotable
|
|
@@ -1251,7 +1251,7 @@ class NgbDatagridDefaultEditService {
|
|
|
1251
1251
|
|
|
1252
1252
|
class JsPdfAdapter {
|
|
1253
1253
|
async export({ fileName, columns, rows, options }) {
|
|
1254
|
-
const { jsPDF } = await import('jspdf');
|
|
1254
|
+
const { jsPDF } = await import('jspdf/dist/jspdf.umd.min.js');
|
|
1255
1255
|
const autoTable = (await import('jspdf-autotable')).default;
|
|
1256
1256
|
const doc = new jsPDF({ orientation: options?.landscape ? 'landscape' : 'portrait' });
|
|
1257
1257
|
autoTable(doc, { head: [columns], body: rows.map(r => columns.map(k => r[k])), margin: options?.margins });
|