nexabase-report 0.1.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 ADDED
@@ -0,0 +1,106 @@
1
+ # NexaBase Report (Designer + Viewer)
2
+
3
+ Librería para diseñar y visualizar reportes tipo banded (inspirada en Stimulsoft) con exportación a PDF/Excel/Word.
4
+
5
+ ## Instalación
6
+
7
+ ```bash
8
+ npm install nexabase-report
9
+ ```
10
+
11
+ ## Uso rápido: Viewer (apps externas)
12
+
13
+ El Viewer se expone como Custom Element: `<nexa-viewer />`.
14
+
15
+ ### 1) Vue 3
16
+
17
+ ```ts
18
+ import { registerNexaReport } from 'nexabase-report';
19
+ import 'nexabase-report/style.css';
20
+
21
+ registerNexaReport();
22
+ ```
23
+
24
+ ```vue
25
+ <template>
26
+ <nexa-viewer
27
+ :definition="definition"
28
+ :data="data"
29
+ :parameters="{ fechaDesde: '2026-01-01' }"
30
+ minimal
31
+ skip-params-dialog
32
+ />
33
+ </template>
34
+ ```
35
+
36
+ ### 2) React
37
+
38
+ ```tsx
39
+ import { useEffect, useRef } from 'react';
40
+ import { registerNexaReport } from 'nexabase-report';
41
+ import 'nexabase-report/style.css';
42
+
43
+ registerNexaReport();
44
+
45
+ export function ReportViewer({ definition, data, parameters }: any) {
46
+ const ref = useRef<any>(null);
47
+ useEffect(() => {
48
+ if (!ref.current) return;
49
+ ref.current.definition = definition;
50
+ ref.current.data = data;
51
+ ref.current.parameters = parameters;
52
+ }, [definition, data, parameters]);
53
+
54
+ return <nexa-viewer ref={ref} minimal />;
55
+ }
56
+ ```
57
+
58
+ ### 3) HTML puro (CDN / UMD)
59
+
60
+ ```html
61
+ <link rel="stylesheet" href="https://unpkg.com/nexabase-report@0.1.0/dist/style.css">
62
+ <script src="https://unpkg.com/nexabase-report@0.1.0/dist/nexabase-report.umd.js"></script>
63
+ <script>
64
+ window.NexaReport.registerNexaReport();
65
+ </script>
66
+
67
+ <nexa-viewer id="viewer"></nexa-viewer>
68
+ <script>
69
+ const v = document.getElementById('viewer');
70
+ v.definition = {/* ... */};
71
+ v.data = [{/* ... */}];
72
+ </script>
73
+ ```
74
+
75
+ ## Probar sin publicar (recomendado)
76
+
77
+ Desde este repo:
78
+
79
+ ```bash
80
+ npm run build
81
+ npm pack
82
+ ```
83
+
84
+ En el proyecto externo:
85
+
86
+ ```bash
87
+ npm install /ruta/al/nexabase-report-0.1.0.tgz
88
+ ```
89
+
90
+ ## Publicar en npm
91
+
92
+ Guía paso a paso: [docs/PUBLISHING.md](docs/PUBLISHING.md)
93
+
94
+ Resumen:
95
+
96
+ ```bash
97
+ npm run build
98
+ npm pack --dry-run
99
+ npm version patch
100
+ npm publish --access public
101
+ ```
102
+
103
+ ## Documentación
104
+
105
+ - API del Viewer: [docs/VIEWER_API.md](docs/VIEWER_API.md)
106
+ - Integración externa: [docs/EXTERNAL_INTEGRATION.md](docs/EXTERNAL_INTEGRATION.md)