nexabase-report 0.2.9 → 0.2.11

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.
Files changed (46) hide show
  1. package/dist/{html2canvas-C7YA4nkW.js → html2canvas-9Wez5E_d.js} +1 -1
  2. package/dist/{html2canvas-Ch6xQdU-.js → html2canvas-BljFROJ3.js} +2 -2
  3. package/dist/{html2pdf-BmsoJhgy.js → html2pdf-BnHxGKGb.js} +3 -3
  4. package/dist/{index-TKDtDVn8.js → index-TaXb6NxF.js} +23212 -23262
  5. package/dist/{index.es-DVVUHaBy.js → index.es-Cfi8g62z.js} +2 -2
  6. package/dist/{jspdf.es.min-C0JdIV8T.js → jspdf.es.min-BdLNvemB.js} +2 -2
  7. package/dist/nexabase-report.es.js +1 -1
  8. package/dist/nexabase-report.umd.js +159 -159
  9. package/examples/BlazorServer/Pages/FacturaReport.razor +52 -52
  10. package/examples/blazor-report/Components/App.razor +19 -19
  11. package/examples/blazor-report/Components/Layout/MainLayout.razor +4 -20
  12. package/examples/blazor-report/Components/Layout/NavMenu.razor +1 -1
  13. package/examples/blazor-report/Components/Layout/ReconnectModal.razor +1 -1
  14. package/examples/blazor-report/Components/Pages/Counter.razor +1 -1
  15. package/examples/blazor-report/Components/Pages/Error.razor +1 -1
  16. package/examples/blazor-report/Components/Pages/Factura.razor +36 -32
  17. package/examples/blazor-report/Components/Pages/Home.razor +16 -16
  18. package/examples/blazor-report/Components/Pages/NotFound.razor +2 -2
  19. package/examples/blazor-report/Components/Pages/Weather.razor +1 -1
  20. package/examples/blazor-report/Components/Routes.razor +1 -1
  21. package/examples/blazor-report/Components/_Imports.razor +1 -1
  22. package/examples/blazor-report/bin/Debug/net10.0/blazor-report.dll +0 -0
  23. package/examples/blazor-report/bin/Debug/net10.0/blazor-report.exe +0 -0
  24. package/examples/blazor-report/bin/Debug/net10.0/blazor-report.pdb +0 -0
  25. package/examples/blazor-report/obj/Debug/net10.0/apphost.exe +0 -0
  26. package/examples/blazor-report/obj/Debug/net10.0/blazor-report.AssemblyInfo.cs +5 -6
  27. package/examples/blazor-report/obj/Debug/net10.0/blazor-report.AssemblyInfoInputs.cache +1 -1
  28. package/examples/blazor-report/obj/Debug/net10.0/blazor-report.dll +0 -0
  29. package/examples/blazor-report/obj/Debug/net10.0/blazor-report.pdb +0 -0
  30. package/examples/blazor-report/obj/Debug/net10.0/blazor-report.sourcelink.json +1 -1
  31. package/examples/blazor-report/obj/Debug/net10.0/ref/blazor-report.dll +0 -0
  32. package/examples/blazor-report/obj/Debug/net10.0/refint/blazor-report.dll +0 -0
  33. package/examples/blazor-report/obj/Debug/net10.0/rjsmcshtml.dswa.cache.json +1 -1
  34. package/examples/blazor-report/obj/Debug/net10.0/rjsmrazor.dswa.cache.json +1 -1
  35. package/examples/blazor-report/obj/Debug/net10.0/rpswa.dswa.cache.json +1 -1
  36. package/examples/integration/BlazorRazor.razor +84 -84
  37. package/examples/integration/BlazorServer.razor +91 -91
  38. package/examples/integration/index.html +100 -100
  39. package/examples/integration/integration-jquery.html +142 -142
  40. package/examples/integration-angular.html +99 -99
  41. package/examples/integration-api.html +80 -80
  42. package/examples/integration-react.html +80 -80
  43. package/examples/integration-vanilla.html +66 -66
  44. package/examples/integration-vue.html +85 -85
  45. package/examples/viewer.html +58 -58
  46. package/package.json +1 -1
@@ -1,91 +1,91 @@
1
- @page "/report/{ReportId:int}"
2
- @inject IHttpClientFactory HttpFactory
3
- @inject IJSRuntime JS
4
-
5
- <PageTitle>Reporte #@ReportId</PageTitle>
6
-
7
- <div class="report-wrapper" style="height: @Height; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden;">
8
- <nexa-viewer ref="viewerElement" id="@($"r-{ReportId}")"></nexa-viewer>
9
- </div>
10
-
11
- <div class="report-actions mt-4 flex gap-2">
12
- <button class="btn btn-primary" @onclick="ExportPdf">
13
- <i class="pi pi-file-pdf"></i> Exportar PDF
14
- </button>
15
- <button class="btn btn-success" @onclick="ExportExcel">
16
- <i class="pi pi-file-excel"></i> Exportar Excel
17
- </button>
18
- <button class="btn btn-outline" @onclick="Refresh">
19
- <i class="pi pi-refresh"></i> Recargar
20
- </button>
21
- </div>
22
-
23
- @code {
24
- [Parameter] public int ReportId { get; set; }
25
- [Parameter] public string Height { get; set; } = "800px";
26
-
27
- private ElementReference viewerElement;
28
- private HttpClient? _http;
29
-
30
- protected override void OnInitialized()
31
- {
32
- _http = HttpFactory.CreateClient("NexaBaseApi");
33
- }
34
-
35
- protected override async Task OnAfterRenderAsync(bool firstRender)
36
- {
37
- if (firstRender)
38
- {
39
- await LoadReport();
40
- }
41
- }
42
-
43
- private async Task LoadReport()
44
- {
45
- try
46
- {
47
- var definition = await _http!.GetFromJsonAsync<dynamic>($"/api/reports/{ReportId}");
48
- var data = await _http!.GetFromJsonAsync<dynamic>($"/api/reports/{ReportId}/data");
49
-
50
- await JS.InvokeVoidAsync("blazorInterop.renderReport", viewerElement, definition, data);
51
- }
52
- catch (Exception ex)
53
- {
54
- Console.WriteLine($"Error: {ex.Message}");
55
- }
56
- }
57
-
58
- private async Task ExportPdf()
59
- {
60
- await JS.InvokeVoidAsync("blazorInterop.exportPdf", viewerElement);
61
- }
62
-
63
- private async Task ExportExcel()
64
- {
65
- await JS.InvokeVoidAsync("blazorInterop.exportExcel", viewerElement);
66
- }
67
-
68
- private async Task Refresh()
69
- {
70
- await LoadReport();
71
- }
72
- }
73
-
74
- <style>
75
- .report-wrapper {
76
- background: white;
77
- }
78
- .btn {
79
- padding: 8px 16px;
80
- border-radius: 6px;
81
- border: none;
82
- cursor: pointer;
83
- display: inline-flex;
84
- align-items: center;
85
- gap: 6px;
86
- font-size: 14px;
87
- }
88
- .btn-primary { background: #1e40af; color: white; }
89
- .btn-success { background: #16a34a; color: white; }
90
- .btn-outline { background: white; color: #374151; border: 1px solid #d1d5db; }
91
- </style>
1
+ @page "/report/{ReportId:int}"
2
+ @inject IHttpClientFactory HttpFactory
3
+ @inject IJSRuntime JS
4
+
5
+ <PageTitle>Reporte #@ReportId</PageTitle>
6
+
7
+ <div class="report-wrapper" style="height: @Height; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden;">
8
+ <nexa-viewer ref="viewerElement" id="@($"r-{ReportId}")"></nexa-viewer>
9
+ </div>
10
+
11
+ <div class="report-actions mt-4 flex gap-2">
12
+ <button class="btn btn-primary" @onclick="ExportPdf">
13
+ <i class="pi pi-file-pdf"></i> Exportar PDF
14
+ </button>
15
+ <button class="btn btn-success" @onclick="ExportExcel">
16
+ <i class="pi pi-file-excel"></i> Exportar Excel
17
+ </button>
18
+ <button class="btn btn-outline" @onclick="Refresh">
19
+ <i class="pi pi-refresh"></i> Recargar
20
+ </button>
21
+ </div>
22
+
23
+ @code {
24
+ [Parameter] public int ReportId { get; set; }
25
+ [Parameter] public string Height { get; set; } = "800px";
26
+
27
+ private ElementReference viewerElement;
28
+ private HttpClient? _http;
29
+
30
+ protected override void OnInitialized()
31
+ {
32
+ _http = HttpFactory.CreateClient("NexaBaseApi");
33
+ }
34
+
35
+ protected override async Task OnAfterRenderAsync(bool firstRender)
36
+ {
37
+ if (firstRender)
38
+ {
39
+ await LoadReport();
40
+ }
41
+ }
42
+
43
+ private async Task LoadReport()
44
+ {
45
+ try
46
+ {
47
+ var definition = await _http!.GetFromJsonAsync<dynamic>($"/api/reports/{ReportId}");
48
+ var data = await _http!.GetFromJsonAsync<dynamic>($"/api/reports/{ReportId}/data");
49
+
50
+ await JS.InvokeVoidAsync("blazorInterop.renderReport", viewerElement, definition, data);
51
+ }
52
+ catch (Exception ex)
53
+ {
54
+ Console.WriteLine($"Error: {ex.Message}");
55
+ }
56
+ }
57
+
58
+ private async Task ExportPdf()
59
+ {
60
+ await JS.InvokeVoidAsync("blazorInterop.exportPdf", viewerElement);
61
+ }
62
+
63
+ private async Task ExportExcel()
64
+ {
65
+ await JS.InvokeVoidAsync("blazorInterop.exportExcel", viewerElement);
66
+ }
67
+
68
+ private async Task Refresh()
69
+ {
70
+ await LoadReport();
71
+ }
72
+ }
73
+
74
+ <style>
75
+ .report-wrapper {
76
+ background: white;
77
+ }
78
+ .btn {
79
+ padding: 8px 16px;
80
+ border-radius: 6px;
81
+ border: none;
82
+ cursor: pointer;
83
+ display: inline-flex;
84
+ align-items: center;
85
+ gap: 6px;
86
+ font-size: 14px;
87
+ }
88
+ .btn-primary { background: #1e40af; color: white; }
89
+ .btn-success { background: #16a34a; color: white; }
90
+ .btn-outline { background: white; color: #374151; border: 1px solid #d1d5db; }
91
+ </style>
@@ -1,100 +1,100 @@
1
- <!DOCTYPE html>
2
- <html lang="es">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>nexabase-report - Ejemplos de Integración</title>
7
- <style>
8
- body { font-family: system-ui, sans-serif; max-width: 900px; margin: 40px auto; padding: 20px; background: #f9fafb; }
9
- h1 { color: #1e3a8a; }
10
- h2 { color: #374151; margin-top: 32px; border-bottom: 2px solid #e5e7eb; padding-bottom: 8px; }
11
- .card { background: white; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px; margin-bottom: 16px; }
12
- .card h3 { margin: 0 0 8px 0; color: #1e40af; }
13
- .card p { margin: 0 0 12px 0; color: #64748b; font-size: 14px; }
14
- .badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
15
- .badge-razor { background: #eff6ff; color: #1e40af; }
16
- .badge-blazor { background: #f0fdf4; color: #16a34a; }
17
- .badge-html { background: #fef3c7; color: #92400e; }
18
- .badge-jquery { background: #ede9fe; color: #6d28d9; }
19
- code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
20
- pre { background: #1f2937; color: #f9fafb; padding: 16px; border-radius: 8px; overflow-x: auto; }
21
- pre code { background: none; color: inherit; }
22
- .file-link { color: #1e40af; text-decoration: none; font-size: 13px; }
23
- .file-link:hover { text-decoration: underline; }
24
- </style>
25
- </head>
26
- <body>
27
- <h1>📊 nexabase-report — Ejemplos de Integración</h1>
28
- <p>Ejemplos funcionales de cómo integrar el visor de reportes en diferentes tecnologías.</p>
29
-
30
- <h2>🟦 Blazor Server / Razor</h2>
31
-
32
- <div class="card">
33
- <h3>Blazor Razor Page</h3>
34
- <p>Componente para Blazor Server (.NET 8) con IJSRuntime para interactuar con el custom element.</p>
35
- <span class="badge badge-razor">Razor</span>
36
- <a class="file-link" href="BlazorRazor.razor">Ver archivo →</a>
37
- </div>
38
-
39
- <div class="card">
40
- <h3>Blazor Server Page (code-behind)</h3>
41
- <p>Page completa con Injected HttpClient, manejo de parámetros y botones de exportación.</p>
42
- <span class="badge badge-blazor">Blazor Server</span>
43
- <a class="file-link" href="BlazorServer.razor">Ver archivo →</a>
44
- </div>
45
-
46
- <h2>🟩 ASP.NET Core Razor Pages</h2>
47
-
48
- <div class="card">
49
- <h3>Razor Pages (.cshtml)</h3>
50
- <p>Ejemplo clásico de Razor Pages con section Scripts y HTML helpers para serializar datos.</p>
51
- <span class="badge badge-razor">Razor Pages</span>
52
- <a class="file-link" href="AspNetCoreRazorPages.cshtml">Ver archivo →</a>
53
- </div>
54
-
55
- <h2>🟨 Vanilla HTML + JS</h2>
56
-
57
- <div class="card">
58
- <h3>jQuery + HTML</h3>
59
- <p>Ejemplo puro con jQuery que genera datos simulados (como haría un backend .NET) y los pasa al visor.</p>
60
- <span class="badge badge-jquery">jQuery</span>
61
- <a class="file-link" href="integration-jquery.html">Ver archivo →</a>
62
- </div>
63
-
64
- <h2>📁 Archivos de Definición de Reportes</h2>
65
-
66
- <div class="card">
67
- <h3>invoice-report.json</h3>
68
- <p>Reporte de factura de venta listo para cargar. Compatible con todos los ejemplos de arriba.</p>
69
- <a class="file-link" href="../blazor-razor-invoice/invoice-report.json">Ver archivo →</a>
70
- </div>
71
-
72
- <h2>🔧 Cómo usar</h2>
73
-
74
- <pre><code># 1. Build del proyecto
75
- npm run build
76
-
77
- # 2. Copiar dist/ a tu proyecto ASP.NET
78
- # o usar un CDN (jsDelivr, unpkg)
79
-
80
- # 3. En tu .cshtml o .razor:
81
- &lt;link rel="stylesheet" href="~/lib/nexabase-report/style.css" />
82
- &lt;script src="~/lib/nexabase-report/nexabase-report.umd.js">&lt;/script>
83
-
84
- # 4. Registrar y usar
85
- NexaReport.registerNexaReport();
86
- const viewer = document.getElementById('viewer');
87
- viewer.definition = definitionJson;
88
- viewer.data = dataArray;</code></pre>
89
-
90
- <h2>⚡ Tips para .NET</h2>
91
-
92
- <ul>
93
- <li>Usa <code>JsonSerializer.Serialize()</code> para convertir tus modelos a JSON</li>
94
- <li>Pasa los datos como <code>List&lt;Dictionary&lt;string, object&gt;&gt;</code> o tu modelo directamente</li>
95
- <li>Para datos de múltiples fuentes, usa el formato <code>{ "alias": [...] }</code></li>
96
- <li>El viewer funciona tanto en Blazor Server (con IJSRuntime) como en Blazor WebAssembly</li>
97
- </ul>
98
-
99
- </body>
100
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="es">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>nexabase-report - Ejemplos de Integración</title>
7
+ <style>
8
+ body { font-family: system-ui, sans-serif; max-width: 900px; margin: 40px auto; padding: 20px; background: #f9fafb; }
9
+ h1 { color: #1e3a8a; }
10
+ h2 { color: #374151; margin-top: 32px; border-bottom: 2px solid #e5e7eb; padding-bottom: 8px; }
11
+ .card { background: white; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px; margin-bottom: 16px; }
12
+ .card h3 { margin: 0 0 8px 0; color: #1e40af; }
13
+ .card p { margin: 0 0 12px 0; color: #64748b; font-size: 14px; }
14
+ .badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
15
+ .badge-razor { background: #eff6ff; color: #1e40af; }
16
+ .badge-blazor { background: #f0fdf4; color: #16a34a; }
17
+ .badge-html { background: #fef3c7; color: #92400e; }
18
+ .badge-jquery { background: #ede9fe; color: #6d28d9; }
19
+ code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
20
+ pre { background: #1f2937; color: #f9fafb; padding: 16px; border-radius: 8px; overflow-x: auto; }
21
+ pre code { background: none; color: inherit; }
22
+ .file-link { color: #1e40af; text-decoration: none; font-size: 13px; }
23
+ .file-link:hover { text-decoration: underline; }
24
+ </style>
25
+ </head>
26
+ <body>
27
+ <h1>📊 nexabase-report — Ejemplos de Integración</h1>
28
+ <p>Ejemplos funcionales de cómo integrar el visor de reportes en diferentes tecnologías.</p>
29
+
30
+ <h2>🟦 Blazor Server / Razor</h2>
31
+
32
+ <div class="card">
33
+ <h3>Blazor Razor Page</h3>
34
+ <p>Componente para Blazor Server (.NET 8) con IJSRuntime para interactuar con el custom element.</p>
35
+ <span class="badge badge-razor">Razor</span>
36
+ <a class="file-link" href="BlazorRazor.razor">Ver archivo →</a>
37
+ </div>
38
+
39
+ <div class="card">
40
+ <h3>Blazor Server Page (code-behind)</h3>
41
+ <p>Page completa con Injected HttpClient, manejo de parámetros y botones de exportación.</p>
42
+ <span class="badge badge-blazor">Blazor Server</span>
43
+ <a class="file-link" href="BlazorServer.razor">Ver archivo →</a>
44
+ </div>
45
+
46
+ <h2>🟩 ASP.NET Core Razor Pages</h2>
47
+
48
+ <div class="card">
49
+ <h3>Razor Pages (.cshtml)</h3>
50
+ <p>Ejemplo clásico de Razor Pages con section Scripts y HTML helpers para serializar datos.</p>
51
+ <span class="badge badge-razor">Razor Pages</span>
52
+ <a class="file-link" href="AspNetCoreRazorPages.cshtml">Ver archivo →</a>
53
+ </div>
54
+
55
+ <h2>🟨 Vanilla HTML + JS</h2>
56
+
57
+ <div class="card">
58
+ <h3>jQuery + HTML</h3>
59
+ <p>Ejemplo puro con jQuery que genera datos simulados (como haría un backend .NET) y los pasa al visor.</p>
60
+ <span class="badge badge-jquery">jQuery</span>
61
+ <a class="file-link" href="integration-jquery.html">Ver archivo →</a>
62
+ </div>
63
+
64
+ <h2>📁 Archivos de Definición de Reportes</h2>
65
+
66
+ <div class="card">
67
+ <h3>invoice-report.json</h3>
68
+ <p>Reporte de factura de venta listo para cargar. Compatible con todos los ejemplos de arriba.</p>
69
+ <a class="file-link" href="../blazor-razor-invoice/invoice-report.json">Ver archivo →</a>
70
+ </div>
71
+
72
+ <h2>🔧 Cómo usar</h2>
73
+
74
+ <pre><code># 1. Build del proyecto
75
+ npm run build
76
+
77
+ # 2. Copiar dist/ a tu proyecto ASP.NET
78
+ # o usar un CDN (jsDelivr, unpkg)
79
+
80
+ # 3. En tu .cshtml o .razor:
81
+ &lt;link rel="stylesheet" href="~/lib/nexabase-report/style.css" />
82
+ &lt;script src="~/lib/nexabase-report/nexabase-report.umd.js">&lt;/script>
83
+
84
+ # 4. Registrar y usar
85
+ NexaReport.registerNexaReport();
86
+ const viewer = document.getElementById('viewer');
87
+ viewer.definition = definitionJson;
88
+ viewer.data = dataArray;</code></pre>
89
+
90
+ <h2>⚡ Tips para .NET</h2>
91
+
92
+ <ul>
93
+ <li>Usa <code>JsonSerializer.Serialize()</code> para convertir tus modelos a JSON</li>
94
+ <li>Pasa los datos como <code>List&lt;Dictionary&lt;string, object&gt;&gt;</code> o tu modelo directamente</li>
95
+ <li>Para datos de múltiples fuentes, usa el formato <code>{ "alias": [...] }</code></li>
96
+ <li>El viewer funciona tanto en Blazor Server (con IJSRuntime) como en Blazor WebAssembly</li>
97
+ </ul>
98
+
99
+ </body>
100
+ </html>