nexabase-report 0.4.21 → 0.5.0
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/README.md +181 -469
- package/dist/{html2pdf-23Ab3AOC.js → html2pdf-BM387Lw6.js} +2 -2
- package/dist/{index-BdWKxQHc.js → index-Dp2g4-Q2.js} +16431 -16234
- package/dist/{index.es-DlySepqf.js → index.es-CIgwm7xe.js} +2 -2
- package/dist/{jspdf.es.min-BoOLuS4X.js → jspdf.es.min-Hv7XZ2or.js} +1 -1
- package/dist/lib/styles/_designer.css +1 -1
- package/dist/nexabase-report.es.js +1 -1
- package/dist/nexabase-report.umd.js +153 -153
- package/examples/integration-vue.html +50 -0
- package/package.json +1 -1
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
26
|
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
|
|
27
|
+
<script src="https://unpkg.com/jszip@3.10.1/dist/jszip.min.js"></script>
|
|
27
28
|
<script src="../dist/nexabase-report.umd.js"></script>
|
|
28
29
|
<script>
|
|
29
30
|
const { createApp, ref } = Vue;
|
|
@@ -80,6 +81,55 @@
|
|
|
80
81
|
const viewer = document.getElementById('viewer');
|
|
81
82
|
viewer.definition = reportDef;
|
|
82
83
|
viewer.data = data;
|
|
84
|
+
|
|
85
|
+
// Batch export functions
|
|
86
|
+
async function testBlob() {
|
|
87
|
+
try {
|
|
88
|
+
console.log('Generando PDF...');
|
|
89
|
+
const blob = await viewer.exportPdfAsBlob();
|
|
90
|
+
const url = URL.createObjectURL(blob);
|
|
91
|
+
const a = document.createElement('a');
|
|
92
|
+
a.href = url;
|
|
93
|
+
a.download = 'test.pdf';
|
|
94
|
+
a.click();
|
|
95
|
+
URL.revokeObjectURL(url);
|
|
96
|
+
console.log('PDF generado:', (blob.size / 1024).toFixed(1), 'KB');
|
|
97
|
+
} catch (err) {
|
|
98
|
+
console.error('Error:', err);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
async function testBatchZip() {
|
|
103
|
+
try {
|
|
104
|
+
console.log('Generando 3 facturas...');
|
|
105
|
+
const zip = new JSZip();
|
|
106
|
+
const facturas = [
|
|
107
|
+
{ nombre: 'Factura_001', items: [{ producto: 'Laptop', cantidad: 2, total: 50000 }] },
|
|
108
|
+
{ nombre: 'Factura_002', items: [{ producto: 'Mouse', cantidad: 10, total: 8500 }] },
|
|
109
|
+
{ nombre: 'Factura_003', items: [{ producto: 'Teclado', cantidad: 5, total: 6000 }] },
|
|
110
|
+
];
|
|
111
|
+
for (const f of facturas) {
|
|
112
|
+
console.log('Generando', f.nombre, '...');
|
|
113
|
+
viewer.updateData(f.items);
|
|
114
|
+
await new Promise(r => setTimeout(r, 500));
|
|
115
|
+
const blob = await viewer.exportPdfAsBlob();
|
|
116
|
+
zip.file(f.nombre + '.pdf', blob);
|
|
117
|
+
}
|
|
118
|
+
const zipBlob = await zip.generateAsync({ type: 'blob' });
|
|
119
|
+
const url = URL.createObjectURL(zipBlob);
|
|
120
|
+
const a = document.createElement('a');
|
|
121
|
+
a.href = url;
|
|
122
|
+
a.download = 'facturas.zip';
|
|
123
|
+
a.click();
|
|
124
|
+
URL.revokeObjectURL(url);
|
|
125
|
+
console.log('ZIP generado:', (zipBlob.size / 1024).toFixed(1), 'KB');
|
|
126
|
+
} catch (err) {
|
|
127
|
+
console.error('Error:', err);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
window.testBlob = testBlob;
|
|
132
|
+
window.testBatchZip = testBatchZip;
|
|
83
133
|
</script>
|
|
84
134
|
</body>
|
|
85
135
|
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexabase-report",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Professional report designer and viewer for NexaBase — drag & drop designer, PDF/Excel export, charts, crosstabs, subreports.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "NexaBase Team",
|