nexabase-report 0.2.0 → 0.2.3
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 +12 -0
- package/dist/{html2canvas-DeDxn_1B.js → html2canvas-lgGzgSKy.js} +2 -2
- package/dist/{html2canvas-JyIFSCoX.js → html2canvas-xaUg0sZY.js} +1 -1
- package/dist/{html2pdf-Ns6I-qbl.js → html2pdf-BaxxmOjO.js} +3 -3
- package/dist/{index-DGgZte1M.js → index-BjDXUsdw.js} +68671 -68520
- package/dist/{index.es-m--eTKUr.js → index.es-D4FSgTc5.js} +2 -2
- package/dist/{jspdf.es.min-BDbMkhon.js → jspdf.es.min-h5IBy_7w.js} +2 -2
- package/dist/nexabase-report.es.js +1 -1
- package/dist/nexabase-report.umd.js +212 -212
- package/dist/style.css +62 -1
- package/examples/AnexoFactura.pdf +0 -0
- package/examples/factura_de_recolecci/303/263n_de_residuos.json +528 -0
- package/examples/integration-angular.html +99 -0
- package/examples/integration-api.html +80 -0
- package/examples/integration-react.html +80 -0
- package/examples/integration-vanilla.html +66 -0
- package/examples/integration-vue.html +85 -0
- package/examples/report-factura-residuos.json +354 -0
- package/package.json +13 -3
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"name": "Factura de Recolección de Residuos",
|
|
5
|
+
"description": "Ejemplo de factura ambiental con datos del cliente, detalle de residuos recolectados y tarifas aplicadas. Usa tres DataSources manuales relacionados por nofactura.",
|
|
6
|
+
"author": "NexaBase",
|
|
7
|
+
"createdAt": "2025-05-01T00:00:00.000Z"
|
|
8
|
+
},
|
|
9
|
+
"layout": {
|
|
10
|
+
"page": {
|
|
11
|
+
"format": "A4",
|
|
12
|
+
"orientation": "portrait",
|
|
13
|
+
"margins": { "top": 1.5, "right": 1.5, "bottom": 1.5, "left": 1.5 }
|
|
14
|
+
},
|
|
15
|
+
"bands": [
|
|
16
|
+
{
|
|
17
|
+
"id": "rh_factura",
|
|
18
|
+
"type": "ReportHeader",
|
|
19
|
+
"height": 230,
|
|
20
|
+
"elements": [
|
|
21
|
+
{
|
|
22
|
+
"id": "rect_header",
|
|
23
|
+
"type": "Rectangle",
|
|
24
|
+
"x": 0,
|
|
25
|
+
"y": 0,
|
|
26
|
+
"width": 720,
|
|
27
|
+
"height": 120,
|
|
28
|
+
"shapeType": "Rectangle",
|
|
29
|
+
"options": { "lineColor": "#1e40af", "strokeWidth": 2, "fillColor": "#f8fafc" }
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "t_titulo",
|
|
33
|
+
"type": "Text",
|
|
34
|
+
"x": 20,
|
|
35
|
+
"y": 15,
|
|
36
|
+
"width": 400,
|
|
37
|
+
"height": 28,
|
|
38
|
+
"content": "FACTURA DE RECOLECCIÓN",
|
|
39
|
+
"style": { "fontSize": "18px", "fontWeight": "bold", "color": "#1e3a8a" }
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "t_nofactura",
|
|
43
|
+
"type": "Text",
|
|
44
|
+
"x": 500,
|
|
45
|
+
"y": 15,
|
|
46
|
+
"width": 200,
|
|
47
|
+
"height": 24,
|
|
48
|
+
"content": "N° {{nofactura}}",
|
|
49
|
+
"style": { "fontSize": "16px", "fontWeight": "bold", "color": "#1e40af", "textAlign": "right" }
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "t_razon",
|
|
53
|
+
"type": "Text",
|
|
54
|
+
"x": 20,
|
|
55
|
+
"y": 50,
|
|
56
|
+
"width": 350,
|
|
57
|
+
"height": 18,
|
|
58
|
+
"content": "{{nombre}}",
|
|
59
|
+
"style": { "fontSize": "14px", "fontWeight": "bold", "color": "#0f172a" }
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": "t_nit",
|
|
63
|
+
"type": "Text",
|
|
64
|
+
"x": 20,
|
|
65
|
+
"y": 70,
|
|
66
|
+
"width": 250,
|
|
67
|
+
"height": 16,
|
|
68
|
+
"content": "NIT: {{nit}}",
|
|
69
|
+
"style": { "fontSize": "11px", "color": "#475569" }
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": "t_direccion",
|
|
73
|
+
"type": "Text",
|
|
74
|
+
"x": 20,
|
|
75
|
+
"y": 88,
|
|
76
|
+
"width": 350,
|
|
77
|
+
"height": 16,
|
|
78
|
+
"content": "{{direccion}}",
|
|
79
|
+
"style": { "fontSize": "11px", "color": "#64748b" }
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "t_ciudad",
|
|
83
|
+
"type": "Text",
|
|
84
|
+
"x": 20,
|
|
85
|
+
"y": 104,
|
|
86
|
+
"width": 250,
|
|
87
|
+
"height": 16,
|
|
88
|
+
"content": "{{ciudad}}",
|
|
89
|
+
"style": { "fontSize": "11px", "color": "#64748b" }
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "line_div",
|
|
93
|
+
"type": "Line",
|
|
94
|
+
"x": 0,
|
|
95
|
+
"y": 125,
|
|
96
|
+
"width": 720,
|
|
97
|
+
"height": 2,
|
|
98
|
+
"shapeType": "Line",
|
|
99
|
+
"options": { "lineColor": "#1e40af", "strokeWidth": 2 }
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": "t_fecha",
|
|
103
|
+
"type": "Text",
|
|
104
|
+
"x": 500,
|
|
105
|
+
"y": 130,
|
|
106
|
+
"width": 200,
|
|
107
|
+
"height": 16,
|
|
108
|
+
"content": "Fecha: {{fechaRecoleccion}}",
|
|
109
|
+
"style": { "fontSize": "11px", "color": "#64748b", "textAlign": "right" }
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "db_residuos",
|
|
115
|
+
"type": "DataBand",
|
|
116
|
+
"height": 180,
|
|
117
|
+
"dataSource": "residuos",
|
|
118
|
+
"elements": [
|
|
119
|
+
{
|
|
120
|
+
"id": "t_items_title",
|
|
121
|
+
"type": "Text",
|
|
122
|
+
"x": 0,
|
|
123
|
+
"y": 5,
|
|
124
|
+
"width": 300,
|
|
125
|
+
"height": 20,
|
|
126
|
+
"content": "Detalle de Residuos Recolectados",
|
|
127
|
+
"style": { "fontSize": "13px", "fontWeight": "bold", "color": "#1e3a8a" }
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"id": "table_residuos",
|
|
131
|
+
"type": "Table",
|
|
132
|
+
"x": 0,
|
|
133
|
+
"y": 30,
|
|
134
|
+
"width": 720,
|
|
135
|
+
"height": 140,
|
|
136
|
+
"tableColumns": [
|
|
137
|
+
{ "id": "col1", "title": "Fecha Recolección", "width": 140, "binding": "fechaRecoleccion" },
|
|
138
|
+
{ "id": "col2", "title": "Nombre del Residuo", "width": 280, "binding": "nombreResiduo" },
|
|
139
|
+
{ "id": "col3", "title": "Cantidad (kg)", "width": 120, "binding": "cantidad", "footerText": "{[sum(cantidad)]}" },
|
|
140
|
+
{ "id": "col4", "title": "Doc. Relacionado", "width": 160, "binding": "documentoRelacionado" }
|
|
141
|
+
],
|
|
142
|
+
"tableShowFooter": true,
|
|
143
|
+
"style": { "fontSize": "11px" }
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"id": "db_tarifas",
|
|
149
|
+
"type": "DataBand",
|
|
150
|
+
"height": 160,
|
|
151
|
+
"dataSource": "tarifas",
|
|
152
|
+
"elements": [
|
|
153
|
+
{
|
|
154
|
+
"id": "t_tarifas_title",
|
|
155
|
+
"type": "Text",
|
|
156
|
+
"x": 0,
|
|
157
|
+
"y": 5,
|
|
158
|
+
"width": 300,
|
|
159
|
+
"height": 20,
|
|
160
|
+
"content": "Tarifas Aplicadas",
|
|
161
|
+
"style": { "fontSize": "13px", "fontWeight": "bold", "color": "#1e3a8a" }
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "table_tarifas",
|
|
165
|
+
"type": "Table",
|
|
166
|
+
"x": 0,
|
|
167
|
+
"y": 30,
|
|
168
|
+
"width": 720,
|
|
169
|
+
"height": 110,
|
|
170
|
+
"tableColumns": [
|
|
171
|
+
{ "id": "col1", "title": "Residuo", "width": 240, "binding": "residuo" },
|
|
172
|
+
{ "id": "col2", "title": "Tipo Tarifa", "width": 140, "binding": "tipoTarifa" },
|
|
173
|
+
{ "id": "col3", "title": "Precio Unit.", "width": 120, "binding": "precio" },
|
|
174
|
+
{ "id": "col4", "title": "Kilos Mínimos", "width": 100, "binding": "kilosMinimos" },
|
|
175
|
+
{ "id": "col5", "title": "Fact. Mínima", "width": 100, "binding": "facturacionMinima" }
|
|
176
|
+
],
|
|
177
|
+
"style": { "fontSize": "11px" }
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"id": "rf_totales",
|
|
183
|
+
"type": "ReportFooter",
|
|
184
|
+
"height": 100,
|
|
185
|
+
"elements": [
|
|
186
|
+
{
|
|
187
|
+
"id": "line_footer",
|
|
188
|
+
"type": "Line",
|
|
189
|
+
"x": 300,
|
|
190
|
+
"y": 0,
|
|
191
|
+
"width": 400,
|
|
192
|
+
"height": 1,
|
|
193
|
+
"shapeType": "Line",
|
|
194
|
+
"options": { "lineColor": "#94a3b8", "strokeWidth": 1 }
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"id": "t_resumen",
|
|
198
|
+
"type": "Text",
|
|
199
|
+
"x": 350,
|
|
200
|
+
"y": 10,
|
|
201
|
+
"width": 150,
|
|
202
|
+
"height": 20,
|
|
203
|
+
"content": "Subtotal:",
|
|
204
|
+
"style": { "fontSize": "12px", "fontWeight": "bold", "color": "#374151", "textAlign": "right" }
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"id": "t_subtotal_val",
|
|
208
|
+
"type": "Text",
|
|
209
|
+
"x": 510,
|
|
210
|
+
"y": 10,
|
|
211
|
+
"width": 180,
|
|
212
|
+
"height": 20,
|
|
213
|
+
"content": "${[sum(precio) * cantidad]}",
|
|
214
|
+
"style": { "fontSize": "12px", "color": "#1e40af", "textAlign": "right" }
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"id": "t_iva_label",
|
|
218
|
+
"type": "Text",
|
|
219
|
+
"x": 350,
|
|
220
|
+
"y": 32,
|
|
221
|
+
"width": 150,
|
|
222
|
+
"height": 18,
|
|
223
|
+
"content": "Total Items:",
|
|
224
|
+
"style": { "fontSize": "11px", "color": "#64748b", "textAlign": "right" }
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"id": "t_total_items",
|
|
228
|
+
"type": "Text",
|
|
229
|
+
"x": 510,
|
|
230
|
+
"y": 32,
|
|
231
|
+
"width": 180,
|
|
232
|
+
"height": 18,
|
|
233
|
+
"content": "${[count(nofactura)]}",
|
|
234
|
+
"style": { "fontSize": "11px", "color": "#475569", "textAlign": "right" }
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"id": "line_total",
|
|
238
|
+
"type": "Line",
|
|
239
|
+
"x": 350,
|
|
240
|
+
"y": 55,
|
|
241
|
+
"width": 340,
|
|
242
|
+
"height": 2,
|
|
243
|
+
"shapeType": "Line",
|
|
244
|
+
"options": { "lineColor": "#1e40af", "strokeWidth": 2 }
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"id": "t_total_label",
|
|
248
|
+
"type": "Text",
|
|
249
|
+
"x": 350,
|
|
250
|
+
"y": 60,
|
|
251
|
+
"width": 150,
|
|
252
|
+
"height": 24,
|
|
253
|
+
"content": "TOTAL A PAGAR:",
|
|
254
|
+
"style": { "fontSize": "14px", "fontWeight": "bold", "color": "#1e3a8a", "textAlign": "right" }
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"id": "t_total_val",
|
|
258
|
+
"type": "Text",
|
|
259
|
+
"x": 510,
|
|
260
|
+
"y": 60,
|
|
261
|
+
"width": 180,
|
|
262
|
+
"height": 24,
|
|
263
|
+
"content": "${[sum(precio) * cantidad]}",
|
|
264
|
+
"style": { "fontSize": "16px", "fontWeight": "bold", "color": "#1e40af", "textAlign": "right" }
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"id": "pf_factura",
|
|
270
|
+
"type": "PageFooter",
|
|
271
|
+
"height": 30,
|
|
272
|
+
"elements": [
|
|
273
|
+
{
|
|
274
|
+
"id": "t_pagina",
|
|
275
|
+
"type": "Text",
|
|
276
|
+
"x": 0,
|
|
277
|
+
"y": 8,
|
|
278
|
+
"width": 720,
|
|
279
|
+
"height": 16,
|
|
280
|
+
"content": "Página {{Page}} de {{TotalPages}} — Generado: {{Now}}",
|
|
281
|
+
"style": { "fontSize": "9px", "color": "#94a3b8", "textAlign": "center" }
|
|
282
|
+
}
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
},
|
|
287
|
+
"dataSources": [
|
|
288
|
+
{
|
|
289
|
+
"id": "ds_cliente",
|
|
290
|
+
"collection": "",
|
|
291
|
+
"alias": "cliente",
|
|
292
|
+
"enabled": true,
|
|
293
|
+
"isManual": true,
|
|
294
|
+
"manualData": [
|
|
295
|
+
{
|
|
296
|
+
"nofactura": "34",
|
|
297
|
+
"nombre": "CLIENTE EJEMPLO S.A.S.",
|
|
298
|
+
"nit": "900.123.456-7",
|
|
299
|
+
"direccion": "Calle 100 # 15-20",
|
|
300
|
+
"ciudad": "Bogotá D.C.",
|
|
301
|
+
"fechaRecoleccion": "2025-05-01"
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"id": "ds_residuos",
|
|
307
|
+
"collection": "",
|
|
308
|
+
"alias": "residuos",
|
|
309
|
+
"enabled": true,
|
|
310
|
+
"isManual": true,
|
|
311
|
+
"manualData": [
|
|
312
|
+
{
|
|
313
|
+
"nofactura": "34",
|
|
314
|
+
"fechaRecoleccion": "2025-05-01",
|
|
315
|
+
"nombreResiduo": "ÁCIDO CLORHÍDRICO",
|
|
316
|
+
"cantidad": 5,
|
|
317
|
+
"documentoRelacionado": "25"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"nofactura": "34",
|
|
321
|
+
"fechaRecoleccion": "2025-05-01",
|
|
322
|
+
"nombreResiduo": "BIO SANITARIOS",
|
|
323
|
+
"cantidad": 5,
|
|
324
|
+
"documentoRelacionado": "28"
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"id": "ds_tarifas",
|
|
330
|
+
"collection": "",
|
|
331
|
+
"alias": "tarifas",
|
|
332
|
+
"enabled": true,
|
|
333
|
+
"isManual": true,
|
|
334
|
+
"manualData": [
|
|
335
|
+
{
|
|
336
|
+
"nofactura": "34",
|
|
337
|
+
"facturacionMinima": 0,
|
|
338
|
+
"kilosMinimos": 0,
|
|
339
|
+
"precio": 52200,
|
|
340
|
+
"residuo": "ÁCIDO CLORHÍDRICO",
|
|
341
|
+
"tipoTarifa": "Tarifa x Kilo"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"nofactura": "34",
|
|
345
|
+
"facturacionMinima": 0,
|
|
346
|
+
"kilosMinimos": 0,
|
|
347
|
+
"precio": 52200,
|
|
348
|
+
"residuo": "BIO SANITARIOS",
|
|
349
|
+
"tipoTarifa": "Tarifa x Kilo"
|
|
350
|
+
}
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
]
|
|
354
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexabase-report",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
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",
|
|
@@ -57,7 +57,14 @@
|
|
|
57
57
|
"scripts": {
|
|
58
58
|
"dev": "vite",
|
|
59
59
|
"build": "vue-tsc -b && vite build",
|
|
60
|
-
"preview": "vite preview"
|
|
60
|
+
"preview": "vite preview",
|
|
61
|
+
"test": "vitest run",
|
|
62
|
+
"test:watch": "vitest",
|
|
63
|
+
"test:coverage": "vitest run --coverage",
|
|
64
|
+
"release:patch": "npm test && npm run build && npm version patch && npm publish",
|
|
65
|
+
"release:minor": "npm test && npm run build && npm version minor && npm publish",
|
|
66
|
+
"release:major": "npm test && npm run build && npm version major && npm publish",
|
|
67
|
+
"prepack": "npm run build"
|
|
61
68
|
},
|
|
62
69
|
"dependencies": {
|
|
63
70
|
"@nexabase/sdk": "^2.17.6",
|
|
@@ -79,10 +86,13 @@
|
|
|
79
86
|
"devDependencies": {
|
|
80
87
|
"@types/node": "^22.13.0",
|
|
81
88
|
"@vitejs/plugin-vue": "^5.2.0",
|
|
89
|
+
"@vitest/coverage-v8": "^4.1.5",
|
|
82
90
|
"@vue/tsconfig": "^0.9.1",
|
|
91
|
+
"jsdom": "^29.1.1",
|
|
83
92
|
"typescript": "~6.0.2",
|
|
84
93
|
"vite": "^5.4.14",
|
|
85
94
|
"vite-plugin-dts": "^4.5.4",
|
|
95
|
+
"vitest": "^4.1.5",
|
|
86
96
|
"vue-tsc": "^3.2.6"
|
|
87
97
|
}
|
|
88
|
-
}
|
|
98
|
+
}
|