infodocviewdoc 1.0.0 → 2.0.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.
@@ -1,14 +1,17 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Component, EventEmitter, Output, Input, signal } from '@angular/core';
3
- import * as i4 from '@angular/common';
2
+ import { Injectable, Component, EventEmitter, Output, Input, signal, ViewChild } from '@angular/core';
3
+ import * as i3 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
- import * as i3 from 'ngx-extended-pdf-viewer';
6
- import { NgxExtendedPdfViewerModule, NgxExtendedPdfViewerService } from 'ngx-extended-pdf-viewer';
5
+ import * as i4 from 'ngx-extended-pdf-viewer';
6
+ import { NgxExtendedPdfViewerModule } from 'ngx-extended-pdf-viewer';
7
+ import * as i5 from '@handsontable/angular';
8
+ import { HotTableModule } from '@handsontable/angular';
9
+ import 'handsontable/dist/handsontable.full.css';
7
10
  import * as i1$1 from '@angular/router';
8
11
  import * as i1 from '@angular/common/http';
9
12
  import { HttpHeaders } from '@angular/common/http';
10
13
  import { throwError } from 'rxjs';
11
- import { catchError } from 'rxjs/operators';
14
+ import { catchError, switchMap } from 'rxjs/operators';
12
15
 
13
16
  class UiComponentsService {
14
17
  constructor() { }
@@ -95,6 +98,39 @@ class DocumentViewerFileService {
95
98
  return throwError(() => new Error(message));
96
99
  }));
97
100
  }
101
+ convertDocumentToPdf(file, token, baseApiUrl) {
102
+ const url = `${baseApiUrl}/api/v1/file/${file.type === '.ppt' || file.type === '.pptx'
103
+ ? 'conversion-ppt-to-pdf'
104
+ : 'conversion-word-to-pdf'}`;
105
+ const headers = new HttpHeaders({
106
+ Authorization: `Bearer ${token}`,
107
+ });
108
+ const formData = new FormData();
109
+ formData.append('file', file, 'documento.docx');
110
+ return this.http
111
+ .post(url, formData, { headers })
112
+ .pipe(switchMap((response) => {
113
+ if (!response?.downloadUrl) {
114
+ throw new Error('No se recibió downloadUrl');
115
+ }
116
+ return this.http.get(`${baseApiUrl}${response.downloadUrl}`, {
117
+ headers,
118
+ responseType: 'blob',
119
+ });
120
+ }), catchError((error) => {
121
+ const errorMessages = {
122
+ 0: 'No hay conexión con el servidor',
123
+ 400: 'Solicitud inválida',
124
+ 401: 'No autorizado. Token inválido o expirado',
125
+ 403: 'Acceso denegado',
126
+ 404: 'Archivo no encontrado',
127
+ 500: 'Error interno del servidor',
128
+ };
129
+ const message = errorMessages[error.status] ??
130
+ 'Error inesperado al convertir el archivo a PDF';
131
+ return throwError(() => new Error(message));
132
+ }));
133
+ }
98
134
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: DocumentViewerFileService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
99
135
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: DocumentViewerFileService, providedIn: 'root' });
100
136
  }
@@ -108,81 +144,398 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
108
144
  class PdfViewerComponent {
109
145
  route;
110
146
  fileService;
111
- pdfService;
147
+ // Entradas directas desde el host (opcionalmente se pueden pasar por @Input)
112
148
  nameFile;
113
149
  nameBucket;
114
150
  nameSpaceBucket;
115
151
  url;
116
152
  token = '';
117
153
  pdfSrc;
154
+ imageSrc;
155
+ textContent;
156
+ officeContent;
118
157
  loading = signal(false);
119
158
  errorMessage = signal(null);
120
- constructor(route, fileService, pdfService) {
159
+ fileType = signal('unknown');
160
+ fileName = signal('');
161
+ extensionToType = {
162
+ pdf: 'pdf',
163
+ docx: 'docx',
164
+ doc: 'doc',
165
+ xlsx: 'xlsx',
166
+ xls: 'xls',
167
+ pptx: 'pptx',
168
+ ppt: 'ppt',
169
+ txt: 'txt',
170
+ md: 'txt',
171
+ csv: 'txt',
172
+ log: 'txt',
173
+ json: 'txt',
174
+ xml: 'txt',
175
+ html: 'txt',
176
+ css: 'txt',
177
+ js: 'txt',
178
+ ts: 'txt',
179
+ java: 'txt',
180
+ py: 'txt',
181
+ cpp: 'txt',
182
+ c: 'txt',
183
+ h: 'txt',
184
+ php: 'txt',
185
+ rb: 'txt',
186
+ go: 'txt',
187
+ rs: 'txt',
188
+ swift: 'txt',
189
+ kt: 'txt',
190
+ sql: 'txt',
191
+ jpg: 'image',
192
+ jpeg: 'image',
193
+ png: 'image',
194
+ gif: 'image',
195
+ tiff: 'image',
196
+ bmp: 'image',
197
+ svg: 'image',
198
+ webp: 'image',
199
+ };
200
+ // Excel
201
+ excelData = [];
202
+ excelColumns = [];
203
+ excelColumnHeaders = [];
204
+ excelSettings = {};
205
+ excelSheetNames = [];
206
+ excelCurrentSheetIndex = signal(0);
207
+ showExcelViewer = false;
208
+ excelWorkbook = null;
209
+ xlsxModule = null;
210
+ // Imagen (zoom, rotación, arrastre)
211
+ zoomLevel = signal(100);
212
+ rotation = signal(0);
213
+ minZoom = 25;
214
+ maxZoom = 400;
215
+ zoomStep = 25;
216
+ isDragging = false;
217
+ dragStart = { x: 0, y: 0 };
218
+ imagePosition = { x: 0, y: 0 };
219
+ imageDimensions = { width: 0, height: 0 };
220
+ imageContainer;
221
+ mainImage;
222
+ librariesPreloaded = {
223
+ pdf: false,
224
+ excel: false,
225
+ xlsx: false,
226
+ jspdf: false,
227
+ };
228
+ constructor(route, fileService) {
121
229
  this.route = route;
122
230
  this.fileService = fileService;
123
- this.pdfService = pdfService;
124
231
  }
125
232
  ngOnInit() {
126
- // 1) Si el host ya pasó valores por @Input, usarlos directamente
233
+ // 1) Si el host pasó valores por @Input, usarlos directamente
127
234
  if (this.url ||
128
235
  this.nameFile ||
129
236
  this.nameBucket ||
130
237
  this.nameSpaceBucket ||
131
238
  this.token) {
132
- this.loadPdf();
239
+ if (this.nameFile)
240
+ this.fileName.set(this.nameFile);
241
+ this.detectFileType();
242
+ void this.loadWithPreload();
133
243
  return;
134
244
  }
135
- // 2) Si no hay @Input, intentar leer desde query params (modo microfront original)
245
+ // 2) Si no hay @Input, leer query params (modo microfront)
136
246
  this.route.queryParams.subscribe((params) => {
137
247
  this.nameFile = this.nameFile ?? params['nameFile'];
138
248
  this.nameBucket = this.nameBucket ?? params['nameBucket'];
139
249
  this.nameSpaceBucket = this.nameSpaceBucket ?? params['nameSpaceBucket'];
140
250
  this.token = this.token || params['token'];
141
251
  this.url = this.url ?? params['url'];
142
- if (this.url ||
143
- this.nameFile ||
144
- this.nameBucket ||
145
- this.nameSpaceBucket ||
146
- this.token) {
147
- this.loadPdf();
148
- }
149
- else {
150
- this.errorMessage.set(`No se han proporcionado los parámetros necesarios {url: ${this.url} nameFile: ${this.nameFile} nameBucket: ${this.nameBucket} nameSpaceBucket: ${this.nameSpaceBucket} token: ${this.token}}`);
151
- this.loading.set(false);
152
- this.errorMessage.set(null);
252
+ if (this.nameFile) {
253
+ this.fileName.set(this.nameFile);
153
254
  }
255
+ this.detectFileType();
256
+ void this.loadWithPreload();
154
257
  });
155
258
  }
156
- loadPdf() {
259
+ ngOnDestroy() {
260
+ if (this.pdfSrc)
261
+ URL.revokeObjectURL(this.pdfSrc);
262
+ if (this.imageSrc)
263
+ URL.revokeObjectURL(this.imageSrc);
264
+ }
265
+ detectFileType() {
266
+ let extension = '';
267
+ if (this.url) {
268
+ extension = this.url.split('.').pop()?.toLowerCase() || '';
269
+ }
270
+ else if (this.nameFile) {
271
+ extension = this.nameFile.split('.').pop()?.toLowerCase() || '';
272
+ }
273
+ this.fileType.set(this.extensionToType[extension] || 'unknown');
274
+ if (this.fileType() !== 'unknown') {
275
+ void this.preloadLibrariesForType(this.fileType());
276
+ }
277
+ }
278
+ async loadWithPreload() {
157
279
  this.loading.set(true);
158
280
  this.errorMessage.set(null);
159
- this.fileService
160
- .getFileByParams({
161
- nameFile: this.nameFile,
162
- nameBucket: this.nameBucket,
163
- nameSpaceBucket: this.nameSpaceBucket,
164
- url: this.url,
165
- token: this.token,
166
- })
167
- .subscribe({
168
- next: (blob) => {
169
- this.pdfSrc = URL.createObjectURL(blob);
281
+ try {
282
+ const preloadPromise = this.preloadLibrariesForType(this.fileType());
283
+ const documentPromise = this.fileService
284
+ .getFileByParams({
285
+ nameFile: this.nameFile,
286
+ nameBucket: this.nameBucket,
287
+ nameSpaceBucket: this.nameSpaceBucket,
288
+ url: this.url,
289
+ token: this.token,
290
+ })
291
+ .toPromise();
292
+ const [blob] = await Promise.all([documentPromise, preloadPromise]);
293
+ this.processFile(blob);
294
+ }
295
+ catch (error) {
296
+ this.errorMessage.set(error.message || 'Error al cargar el documento');
297
+ this.loading.set(false);
298
+ }
299
+ }
300
+ async preloadLibrariesForType(type) {
301
+ const preloadTasks = [];
302
+ if (!this.librariesPreloaded.pdf) {
303
+ preloadTasks.push(import('ngx-extended-pdf-viewer').then(() => (this.librariesPreloaded.pdf = true)));
304
+ }
305
+ if (type === 'txt' && !this.librariesPreloaded.jspdf) {
306
+ preloadTasks.push(import('jspdf').then(() => (this.librariesPreloaded.jspdf = true)));
307
+ }
308
+ if (type === 'xlsx' || type === 'xls') {
309
+ if (!this.librariesPreloaded.xlsx) {
310
+ preloadTasks.push(import('xlsx').then((module) => {
311
+ this.xlsxModule = module;
312
+ this.librariesPreloaded.xlsx = true;
313
+ }));
314
+ }
315
+ if (!this.librariesPreloaded.excel) {
316
+ preloadTasks.push(import('handsontable').then(() => (this.librariesPreloaded.excel = true)));
317
+ }
318
+ }
319
+ if (preloadTasks.length > 0) {
320
+ await Promise.allSettled(preloadTasks);
321
+ }
322
+ }
323
+ processFile(blob) {
324
+ const type = this.fileType();
325
+ switch (true) {
326
+ case type === 'pdf':
327
+ this.handlePdfFile(blob);
328
+ break;
329
+ case type === 'image':
330
+ this.handleImageFile(blob);
331
+ break;
332
+ case type === 'txt':
333
+ void this.convertTextToPdf(blob);
334
+ break;
335
+ case ['xlsx', 'xls'].includes(type):
336
+ void this.processExcelFile(blob);
337
+ break;
338
+ case ['docx', 'doc', 'pptx', 'ppt'].includes(type):
339
+ this.convertOfficeToPdf(blob);
340
+ break;
341
+ default:
342
+ this.errorMessage.set('Formato no soportado');
343
+ this.loading.set(false);
344
+ }
345
+ }
346
+ handlePdfFile(blob) {
347
+ this.pdfSrc = URL.createObjectURL(blob);
348
+ this.loading.set(false);
349
+ }
350
+ handleImageFile(blob) {
351
+ this.imageSrc = URL.createObjectURL(blob);
352
+ this.loading.set(false);
353
+ }
354
+ convertOfficeToPdf(blob) {
355
+ this.fileService.convertDocumentToPdf(blob, this.token, this.url).subscribe({
356
+ next: (pdfBlob) => {
357
+ this.pdfSrc = URL.createObjectURL(pdfBlob);
358
+ this.fileType.set('pdf');
170
359
  this.loading.set(false);
171
- this.errorMessage.set(null);
172
360
  },
173
- error: (err) => {
361
+ error: (error) => {
362
+ this.errorMessage.set(error.message || 'Error al convertir el archivo a PDF');
174
363
  this.loading.set(false);
175
- this.errorMessage.set(err.message || 'Error al cargar el documento');
176
364
  },
177
365
  });
178
366
  }
179
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: PdfViewerComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: DocumentViewerFileService }, { token: i3.NgxExtendedPdfViewerService }], target: i0.ɵɵFactoryTarget.Component });
180
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.4", type: PdfViewerComponent, isStandalone: true, selector: "sgdea-document-viewer", inputs: { nameFile: "nameFile", nameBucket: "nameBucket", nameSpaceBucket: "nameSpaceBucket", url: "url", token: "token" }, providers: [NgxExtendedPdfViewerService], ngImport: i0, template: "<div *ngIf=\"loading()\" class=\"loader\">\r\n Cargando documento...\r\n</div>\r\n\r\n<div *ngIf=\"errorMessage() && !loading()\" class=\"error-message\">\r\n {{ errorMessage() }}\r\n</div>\r\n\r\n<div class=\"pdf-viewer-container\">\r\n <ngx-extended-pdf-viewer\r\n *ngIf=\"pdfSrc && !loading()\"\r\n [src]=\"pdfSrc\"\r\n height=\"auto\"\r\n useBrowserLocale=\"false\"\r\n [showDownloadButton]=\"false\"\r\n [showPrintButton]=\"false\"\r\n [showOpenFileButton]=\"false\"\r\n [showSecondaryToolbarButton]=\"false\"\r\n [showFirstAndLastPageButtons]=\"false\"\r\n [showPagingButtons]=\"false\"\r\n [showZoomButtons]=\"false\"\r\n [showDrawEditor]=\"false\"\r\n [showTextEditor]=\"false\"\r\n [showStampEditor]=\"false\"\r\n [showHighlightEditor]=\"false\"\r\n >\r\n </ngx-extended-pdf-viewer>\r\n</div>\r\n\r\n", styles: [".loader,.error-message{padding:1rem;text-align:center}.error-message{color:#b71c1c;background-color:#ffebee;border:1px solid #ef5350;border-radius:4px;margin:1rem 0}.pdf-viewer-container{flex:1;min-height:0;width:100%;display:flex;flex-direction:column}.pdf-viewer-container ngx-extended-pdf-viewer{flex:1;min-height:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: NgxExtendedPdfViewerModule }, { kind: "component", type: i3.NgxExtendedPdfViewerComponent, selector: "ngx-extended-pdf-viewer", inputs: ["customFindbarInputArea", "customToolbar", "customFindbar", "customFindbarButtons", "customPdfViewer", "customSecondaryToolbar", "customSidebar", "customThumbnail", "customFreeFloatingBar", "showFreeFloatingBar", "enableDragAndDrop", "forceUsingLegacyES5", "formData", "disableForms", "pageViewMode", "scrollMode", "authorization", "httpHeaders", "contextMenuAllowed", "enablePrint", "enablePrintAutoRotate", "forceFullReloadOfJavaScriptCode", "showTextEditor", "showStampEditor", "showCommentEditor", "showDrawEditor", "showHighlightEditor", "showSignatureEditor", "logLevel", "minifiedJSLibraries", "printResolution", "rotation", "src", "base64Src", "minHeight", "height", "backgroundColor", "pdfBackgroundColor", "filenameForDownload", "ignoreKeyboard", "ignoreKeys", "acceptKeys", "imageResourcesPath", "localeFolderPath", "language", "listenToURL", "nameddest", "password", "replaceBrowserPrint", "useInlineScripts", "showUnverifiedSignatures", "startTabindex", "showSidebarButton", "sidebarVisible", "activeSidebarView", "findbarVisible", "propertiesDialogVisible", "showFindButton", "showFindHighlightAll", "showFindMatchCase", "showFindMultiple", "showFindRegexp", "showFindEntireWord", "showFindMatchDiacritics", "showFindResultsCount", "showFindMessages", "showMovePageButton", "showPagingButtons", "showFirstAndLastPageButtons", "showPreviousAndNextPageButtons", "showPageNumber", "showPageLabel", "showZoomButtons", "showZoomDropdown", "showPresentationModeButton", "showOpenFileButton", "showPrintButton", "showDownloadButton", "theme", "showToolbar", "showSecondaryToolbarButton", "showSinglePageModeButton", "showVerticalScrollButton", "showHorizontalScrollButton", "showWrappedScrollButton", "showInfiniteScrollButton", "showBookModeButton", "showRotateButton", "showRotateCwButton", "showRotateCcwButton", "handTool", "showHandToolButton", "showSpreadButton", "showPropertiesButton", "showBorders", "spread", "showScrollingButtons", "page", "pageLabel", "textLayer", "zoom", "zoomLevels", "maxZoom", "minZoom", "mobileFriendlyZoom"], outputs: ["annotationEditorEvent", "formDataChange", "pageViewModeChange", "progress", "srcChange", "scrollModeChange", "afterPrint", "beforePrint", "currentZoomFactor", "rotationChange", "annotationLayerRendered", "annotationEditorLayerRendered", "xfaLayerRendered", "outlineLoaded", "attachmentsloaded", "layersloaded", "sidebarVisibleChange", "activeSidebarViewChange", "findbarVisibleChange", "propertiesDialogVisibleChange", "handToolChange", "spreadChange", "thumbnailDrawn", "pageChange", "pageLabelChange", "pagesLoaded", "pageRender", "pageRendered", "pdfDownloaded", "pdfLoaded", "pdfLoadingStarts", "pdfLoadingFailed", "textLayerRendered", "annotationEditorModeChanged", "updateFindMatchesCount", "updateFindState", "zoomChange"] }] });
367
+ async convertTextToPdf(blob) {
368
+ try {
369
+ const text = await blob.text();
370
+ if (!this.librariesPreloaded.jspdf) {
371
+ await import('jspdf');
372
+ }
373
+ const { default: jsPDF } = await import('jspdf');
374
+ const pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'a4' });
375
+ const pageWidth = pdf.internal.pageSize.getWidth();
376
+ const pageHeight = pdf.internal.pageSize.getHeight();
377
+ const margin = 40;
378
+ const maxLineWidth = pageWidth - margin * 2;
379
+ pdf.setFontSize(11);
380
+ pdf.setFont('helvetica');
381
+ let yPosition = margin;
382
+ const lineHeight = 15;
383
+ const paragraphs = text.split('\n');
384
+ for (const paragraph of paragraphs) {
385
+ if (paragraph.trim() === '') {
386
+ yPosition += lineHeight;
387
+ continue;
388
+ }
389
+ const lines = pdf.splitTextToSize(paragraph, maxLineWidth);
390
+ for (const line of lines) {
391
+ if (yPosition > pageHeight - margin) {
392
+ pdf.addPage();
393
+ yPosition = margin;
394
+ }
395
+ pdf.text(line, margin, yPosition);
396
+ yPosition += lineHeight;
397
+ }
398
+ yPosition += lineHeight / 2;
399
+ }
400
+ const pdfBlob = pdf.output('blob');
401
+ this.pdfSrc = URL.createObjectURL(pdfBlob);
402
+ this.fileType.set('pdf');
403
+ this.loading.set(false);
404
+ }
405
+ catch {
406
+ const reader = new FileReader();
407
+ reader.onload = (e) => {
408
+ this.textContent = e.target?.result;
409
+ this.loading.set(false);
410
+ };
411
+ reader.readAsText(blob);
412
+ }
413
+ }
414
+ async processExcelFile(blob) {
415
+ try {
416
+ if (!this.xlsxModule) {
417
+ this.xlsxModule = await import('xlsx');
418
+ }
419
+ const buffer = await blob.arrayBuffer();
420
+ this.excelWorkbook = this.xlsxModule.read(buffer, { type: 'array' });
421
+ this.excelSheetNames = [...this.excelWorkbook.SheetNames];
422
+ await this.loadExcelSheetByIndex(0);
423
+ this.buildExcelSettings();
424
+ this.showExcelViewer = true;
425
+ this.loading.set(false);
426
+ }
427
+ catch {
428
+ this.errorMessage.set('Error procesando Excel');
429
+ this.loading.set(false);
430
+ }
431
+ }
432
+ async loadExcelSheetByIndex(index) {
433
+ if (!this.excelWorkbook || !this.xlsxModule)
434
+ return;
435
+ this.showExcelViewer = false;
436
+ const sheetName = this.excelSheetNames[index];
437
+ const worksheet = this.excelWorkbook.Sheets[sheetName];
438
+ if (!worksheet)
439
+ return;
440
+ let jsonData = this.xlsxModule.utils.sheet_to_json(worksheet, { header: 1, defval: '' });
441
+ if (!Array.isArray(jsonData) || jsonData.length === 0) {
442
+ jsonData = [['(Hoja vacía)']];
443
+ }
444
+ const headers = (jsonData[0] ?? []).map((h) => String(h ?? ''));
445
+ const data = jsonData.slice(1);
446
+ this.excelColumnHeaders = headers.length > 0 ? headers : [''];
447
+ const maxColumns = Math.max(this.excelColumnHeaders.length, ...data.map((row) => row.length));
448
+ this.excelColumnHeaders = Array.from({ length: maxColumns }, (_, i) => this.excelColumnHeaders[i] ?? `Col ${i + 1}`);
449
+ this.excelData = data.map((row) => Array.from({ length: maxColumns }, (_, i) => row[i] ?? ''));
450
+ this.excelColumns = Array.from({ length: maxColumns }, () => ({ type: 'text' }));
451
+ this.excelCurrentSheetIndex.set(index);
452
+ this.showExcelViewer = true;
453
+ }
454
+ selectExcelSheet(index) {
455
+ void this.loadExcelSheetByIndex(index);
456
+ }
457
+ buildExcelSettings() {
458
+ this.excelSettings = {
459
+ licenseKey: 'non-commercial-and-evaluation',
460
+ colHeaders: this.excelColumnHeaders,
461
+ rowHeaders: true,
462
+ stretchH: 'all',
463
+ contextMenu: true,
464
+ filters: true,
465
+ dropdownMenu: true,
466
+ readOnly: true,
467
+ manualColumnResize: true,
468
+ manualRowResize: true,
469
+ columnSorting: true,
470
+ height: '100%',
471
+ width: '100%',
472
+ };
473
+ }
474
+ // Helpers para template
475
+ isExcelType() {
476
+ return ['xlsx', 'xls'].includes(this.fileType());
477
+ }
478
+ isImageType() {
479
+ return this.fileType() === 'image';
480
+ }
481
+ // Imagen: zoom/rotación/arrastre
482
+ zoomIn() {
483
+ this.zoomLevel.set(Math.min(this.zoomLevel() + this.zoomStep, this.maxZoom));
484
+ }
485
+ zoomOut() {
486
+ this.zoomLevel.set(Math.max(this.zoomLevel() - this.zoomStep, this.minZoom));
487
+ }
488
+ rotateLeft() {
489
+ this.rotation.set((this.rotation() - 90) % 360);
490
+ }
491
+ rotateRight() {
492
+ this.rotation.set((this.rotation() + 90) % 360);
493
+ }
494
+ getImageTransform() {
495
+ const scale = this.zoomLevel() / 100;
496
+ const translate = `translate(${this.imagePosition.x}px, ${this.imagePosition.y}px)`;
497
+ const rotate = `rotate(${this.rotation()}deg)`;
498
+ const scaleStr = `scale(${scale})`;
499
+ return `${translate} ${rotate} ${scaleStr}`;
500
+ }
501
+ getCursorStyle() {
502
+ return this.zoomLevel() > 100 ? (this.isDragging ? 'grabbing' : 'grab') : 'default';
503
+ }
504
+ onImageLoad() {
505
+ try {
506
+ const imgEl = this.mainImage?.nativeElement;
507
+ this.imageDimensions = { width: imgEl.naturalWidth, height: imgEl.naturalHeight };
508
+ }
509
+ catch { /* noop */ }
510
+ }
511
+ onMouseWheel(event) {
512
+ event.preventDefault();
513
+ if (event.deltaY < 0)
514
+ this.zoomIn();
515
+ else
516
+ this.zoomOut();
517
+ }
518
+ startDrag(event) {
519
+ if (this.zoomLevel() <= 100)
520
+ return;
521
+ this.isDragging = true;
522
+ this.dragStart = { x: event.clientX - this.imagePosition.x, y: event.clientY - this.imagePosition.y };
523
+ }
524
+ onDrag(event) {
525
+ if (!this.isDragging)
526
+ return;
527
+ this.imagePosition = { x: event.clientX - this.dragStart.x, y: event.clientY - this.dragStart.y };
528
+ }
529
+ stopDrag() {
530
+ this.isDragging = false;
531
+ }
532
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: PdfViewerComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: DocumentViewerFileService }], target: i0.ɵɵFactoryTarget.Component });
533
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.4", type: PdfViewerComponent, isStandalone: true, selector: "sgdea-document-viewer", inputs: { nameFile: "nameFile", nameBucket: "nameBucket", nameSpaceBucket: "nameSpaceBucket", url: "url", token: "token" }, viewQueries: [{ propertyName: "imageContainer", first: true, predicate: ["imageContainer"], descendants: true }, { propertyName: "mainImage", first: true, predicate: ["mainImage"], descendants: true }], ngImport: i0, template: "<div *ngIf=\"loading()\" class=\"loader\">Cargando documento...</div>\n\n<div *ngIf=\"errorMessage() && !loading()\" class=\"error-message\">\n {{ errorMessage() }}\n</div>\n\n<div *ngIf=\"!loading() && !errorMessage()\" class=\"document-viewer-container\">\n\n <!-- PDF -->\n <ngx-extended-pdf-viewer\n *ngIf=\"fileType() === 'pdf' && pdfSrc\"\n [src]=\"pdfSrc\"\n height=\"auto\"\n useBrowserLocale=\"false\"\n [showDownloadButton]=\"false\"\n [showPrintButton]=\"false\"\n [showOpenFileButton]=\"false\"\n [showSecondaryToolbarButton]=\"false\"\n [showFirstAndLastPageButtons]=\"false\"\n [showPagingButtons]=\"false\"\n [showZoomButtons]=\"true\"\n [showDrawEditor]=\"false\"\n [showTextEditor]=\"false\"\n [showStampEditor]=\"false\"\n [showHighlightEditor]=\"false\"\n >\n </ngx-extended-pdf-viewer>\n\n <!-- Imagen -->\n <div *ngIf=\"isImageType() && imageSrc\" class=\"image-viewer\">\n <div class=\"image-toolbar\">\n <button (click)=\"zoomIn()\" title=\"Acercar (Ctrl +)\">\u2795</button>\n <button (click)=\"zoomOut()\" title=\"Alejar (Ctrl -)\">\u2796</button>\n <span class=\"separator\"></span>\n <button (click)=\"rotateLeft()\" title=\"Rotar izquierda (\u21BA)\">\u21BA</button>\n <button (click)=\"rotateRight()\" title=\"Rotar derecha (\u21BB)\">\u21BB</button>\n\n <span class=\"zoom-info\">{{ zoomLevel() }}%</span>\n <span class=\"rotation-info\" *ngIf=\"rotation() !== 0\">\n {{ rotation() }}\u00B0\n </span>\n\n <span class=\"image-dimensions\" *ngIf=\"imageDimensions.width\">\n {{ imageDimensions.width }} x {{ imageDimensions.height }}\n </span>\n </div>\n\n <div class=\"image-container\" #imageContainer (wheel)=\"onMouseWheel($event)\">\n <img\n #mainImage\n [src]=\"imageSrc\"\n [alt]=\"fileName()\"\n [style.transform]=\"getImageTransform()\"\n [style.cursor]=\"getCursorStyle()\"\n (load)=\"onImageLoad()\"\n (mousedown)=\"startDrag($event)\"\n (mousemove)=\"onDrag($event)\"\n (mouseup)=\"stopDrag()\"\n (mouseleave)=\"stopDrag()\"\n class=\"zoomable-image\"\n />\n </div>\n\n <div class=\"image-footer\" *ngIf=\"zoomLevel() > 100\">\n <small>Arrastra para mover la imagen</small>\n </div>\n </div>\n\n <!-- Excel -->\n <div *ngIf=\"isExcelType()\" class=\"excel-viewer-container\">\n <div *ngIf=\"excelSheetNames.length > 1\" class=\"excel-sheet-tabs\">\n <button\n *ngFor=\"let sheet of excelSheetNames; let i = index\"\n type=\"button\"\n class=\"excel-sheet-tab\"\n [class.active]=\"excelCurrentSheetIndex() === i\"\n (click)=\"selectExcelSheet(i)\"\n >\n {{ sheet }}\n </button>\n </div>\n\n <hot-table\n *ngIf=\"showExcelViewer\"\n #hotTable\n [settings]=\"excelSettings\"\n [data]=\"excelData\"\n [colHeaders]=\"excelColumnHeaders\"\n [rowHeaders]=\"true\"\n [width]=\"'100%'\"\n [height]=\"'100%'\"\n licenseKey=\"non-commercial-and-evaluation\"\n [columns]=\"excelColumns\"\n >\n </hot-table>\n\n <div *ngIf=\"!showExcelViewer\" class=\"loader\">\n Cargando hoja...\n </div>\n </div>\n</div>\n\n", styles: ["html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}.document-viewer-container{height:100vh;width:100%;display:flex;flex-direction:column;padding:20px;box-sizing:border-box;background-color:#f5f5f5;overflow:hidden}.loader,.error-message{text-align:center;padding:40px 20px;font-family:Arial,sans-serif;background-color:#fff;border-radius:4px;margin:20px;box-shadow:0 2px 4px #0000001a}.error-message{color:#d32f2f;background-color:#ffebee;border:1px solid #ffcdd2}::ng-deep ngx-extended-pdf-viewer{flex:1 1 auto;min-height:0;height:auto;width:calc(100% - 20px);margin:10px;border:1px solid #ddd;border-radius:4px;display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: NgxExtendedPdfViewerModule }, { kind: "component", type: i4.NgxExtendedPdfViewerComponent, selector: "ngx-extended-pdf-viewer", inputs: ["customFindbarInputArea", "customToolbar", "customFindbar", "customFindbarButtons", "customPdfViewer", "customSecondaryToolbar", "customSidebar", "customThumbnail", "customFreeFloatingBar", "showFreeFloatingBar", "enableDragAndDrop", "forceUsingLegacyES5", "formData", "disableForms", "pageViewMode", "scrollMode", "authorization", "httpHeaders", "contextMenuAllowed", "enablePrint", "enablePrintAutoRotate", "forceFullReloadOfJavaScriptCode", "showTextEditor", "showStampEditor", "showCommentEditor", "showDrawEditor", "showHighlightEditor", "showSignatureEditor", "logLevel", "minifiedJSLibraries", "printResolution", "rotation", "src", "base64Src", "minHeight", "height", "backgroundColor", "pdfBackgroundColor", "filenameForDownload", "ignoreKeyboard", "ignoreKeys", "acceptKeys", "imageResourcesPath", "localeFolderPath", "language", "listenToURL", "nameddest", "password", "replaceBrowserPrint", "useInlineScripts", "showUnverifiedSignatures", "startTabindex", "showSidebarButton", "sidebarVisible", "activeSidebarView", "findbarVisible", "propertiesDialogVisible", "showFindButton", "showFindHighlightAll", "showFindMatchCase", "showFindMultiple", "showFindRegexp", "showFindEntireWord", "showFindMatchDiacritics", "showFindResultsCount", "showFindMessages", "showMovePageButton", "showPagingButtons", "showFirstAndLastPageButtons", "showPreviousAndNextPageButtons", "showPageNumber", "showPageLabel", "showZoomButtons", "showZoomDropdown", "showPresentationModeButton", "showOpenFileButton", "showPrintButton", "showDownloadButton", "theme", "showToolbar", "showSecondaryToolbarButton", "showSinglePageModeButton", "showVerticalScrollButton", "showHorizontalScrollButton", "showWrappedScrollButton", "showInfiniteScrollButton", "showBookModeButton", "showRotateButton", "showRotateCwButton", "showRotateCcwButton", "handTool", "showHandToolButton", "showSpreadButton", "showPropertiesButton", "showBorders", "spread", "showScrollingButtons", "page", "pageLabel", "textLayer", "zoom", "zoomLevels", "maxZoom", "minZoom", "mobileFriendlyZoom"], outputs: ["annotationEditorEvent", "formDataChange", "pageViewModeChange", "progress", "srcChange", "scrollModeChange", "afterPrint", "beforePrint", "currentZoomFactor", "rotationChange", "annotationLayerRendered", "annotationEditorLayerRendered", "xfaLayerRendered", "outlineLoaded", "attachmentsloaded", "layersloaded", "sidebarVisibleChange", "activeSidebarViewChange", "findbarVisibleChange", "propertiesDialogVisibleChange", "handToolChange", "spreadChange", "thumbnailDrawn", "pageChange", "pageLabelChange", "pagesLoaded", "pageRender", "pageRendered", "pdfDownloaded", "pdfLoaded", "pdfLoadingStarts", "pdfLoadingFailed", "textLayerRendered", "annotationEditorModeChanged", "updateFindMatchesCount", "updateFindState", "zoomChange"] }, { kind: "ngmodule", type: HotTableModule }, { kind: "component", type: i5.HotTableComponent, selector: "hot-table", inputs: ["settings", "hotId", "activeHeaderClassName", "allowEmpty", "allowHtml", "allowInsertColumn", "allowInsertRow", "allowInvalid", "allowRemoveColumn", "allowRemoveRow", "ariaTags", "autoColumnSize", "autoRowSize", "autoWrapCol", "autoWrapRow", "bindRowsWithHeaders", "cell", "cells", "checkedTemplate", "className", "colHeaders", "collapsibleColumns", "columnHeaderHeight", "columns", "columnSorting", "columnSummary", "colWidths", "commentedCellClassName", "comments", "contextMenu", "copyable", "copyPaste", "correctFormat", "currentColClassName", "currentHeaderClassName", "currentRowClassName", "customBorders", "data", "dataDotNotation", "dataSchema", "dateFormat", "datePickerConfig", "defaultDate", "tabNavigation", "themeName", "disableVisualSelection", "dragToScroll", "dropdownMenu", "editor", "enterBeginsEditing", "enterMoves", "fillHandle", "filter", "filteringCaseSensitive", "filters", "fixedColumnsLeft", "fixedColumnsStart", "fixedRowsBottom", "fixedRowsTop", "formulas", "fragmentSelection", "headerClassName", "height", "hiddenColumns", "hiddenRows", "initialState", "invalidCellClassName", "imeFastEdit", "label", "language", "layoutDirection", "licenseKey", "locale", "manualColumnFreeze", "manualColumnMove", "manualColumnResize", "manualRowMove", "manualRowResize", "maxCols", "maxRows", "mergeCells", "minCols", "minRowHeights", "minRows", "minSpareCols", "minSpareRows", "multiColumnSorting", "navigableHeaders", "nestedHeaders", "nestedRows", "noWordWrapClassName", "numericFormat", "observeDOMVisibility", "outsideClickDeselects", "pagination", "persistentState", "placeholder", "placeholderCellClassName", "preventOverflow", "preventWheel", "readOnly", "readOnlyCellClassName", "renderAllColumns", "renderAllRows", "renderer", "rowHeaders", "rowHeaderWidth", "rowHeights", "search", "selectionMode", "selectOptions", "skipColumnOnPaste", "skipRowOnPaste", "sortByRelevance", "source", "startCols", "startRows", "stretchH", "strict", "tableClassName", "tabMoves", "title", "trimDropdown", "trimRows", "trimWhitespace", "type", "uncheckedTemplate", "undo", "validator", "valueGetter", "valueSetter", "viewportColumnRenderingOffset", "viewportRowRenderingOffset", "visibleRows", "width", "wordWrap", "afterAddChild", "afterAutofill", "afterBeginEditing", "afterCellMetaReset", "afterChange", "afterChangesObserved", "afterColumnCollapse", "afterColumnExpand", "afterColumnFreeze", "afterColumnMove", "afterColumnResize", "afterColumnSequenceCacheUpdate", "afterColumnSequenceChange", "afterColumnSort", "afterColumnUnfreeze", "afterContextMenuDefaultOptions", "afterContextMenuHide", "afterContextMenuShow", "afterCopy", "afterCopyLimit", "afterCreateCol", "afterCreateRow", "afterCut", "afterDeselect", "afterDestroy", "afterDetachChild", "afterDocumentKeyDown", "afterDrawSelection", "afterDropdownMenuDefaultOptions", "afterDropdownMenuHide", "afterDropdownMenuShow", "afterFilter", "afterFormulasValuesUpdate", "afterGetCellMeta", "afterGetColHeader", "afterGetColumnHeaderRenderers", "afterGetRowHeader", "afterGetRowHeaderRenderers", "afterHideColumns", "afterHideRows", "afterInit", "afterLanguageChange", "afterListen", "afterLoadData", "afterMergeCells", "afterModifyTransformEnd", "afterModifyTransformFocus", "afterModifyTransformStart", "afterMomentumScroll", "afterNamedExpressionAdded", "afterNamedExpressionRemoved", "afterOnCellContextMenu", "afterOnCellCornerDblClick", "afterOnCellCornerMouseDown", "afterOnCellMouseDown", "afterOnCellMouseOut", "afterOnCellMouseOver", "afterOnCellMouseUp", "afterPageChange", "afterPageSizeChange", "afterPageSizeVisibilityChange", "afterPageCounterVisibilityChange", "afterPageNavigationVisibilityChange", "afterPaste", "afterPluginsInitialized", "afterRedo", "afterRedoStackChange", "afterRefreshDimensions", "afterRemoveCellMeta", "afterRemoveCol", "afterRemoveRow", "afterRender", "afterRenderer", "afterRowMove", "afterRowResize", "afterRowSequenceCacheUpdate", "afterRowSequenceChange", "afterScrollHorizontally", "afterScrollVertically", "afterScroll", "afterSelectColumns", "afterSelection", "afterSelectionByProp", "afterSelectionEnd", "afterSelectionEndByProp", "afterSelectionFocusSet", "afterSelectRows", "afterSetCellMeta", "afterSetDataAtCell", "afterSetDataAtRowProp", "afterSetSourceDataAtCell", "afterSetTheme", "afterSheetAdded", "afterSheetRenamed", "afterSheetRemoved", "afterTrimRow", "afterUndo", "afterUndoStackChange", "afterUnhideColumns", "afterUnhideRows", "afterUnlisten", "afterUnmergeCells", "afterUntrimRow", "afterUpdateData", "afterUpdateSettings", "afterValidate", "afterViewportColumnCalculatorOverride", "afterViewportRowCalculatorOverride", "afterViewRender", "beforeAddChild", "beforeAutofill", "beforeBeginEditing", "beforeCellAlignment", "beforeChange", "beforeChangeRender", "beforeColumnCollapse", "beforeColumnExpand", "beforeColumnFreeze", "beforeColumnMove", "beforeColumnResize", "beforeColumnSort", "beforeColumnWrap", "beforeColumnUnfreeze", "beforeCompositionStart", "beforeContextMenuSetItems", "beforeContextMenuShow", "beforeCopy", "beforeCreateCol", "beforeCreateRow", "beforeCut", "beforeDetachChild", "beforeDrawBorders", "beforeDropdownMenuSetItems", "beforeDropdownMenuShow", "beforeFilter", "beforeGetCellMeta", "beforeHeightChange", "beforeHideColumns", "beforeHideRows", "beforeHighlightingColumnHeader", "beforeHighlightingRowHeader", "beforeInit", "beforeInitWalkontable", "beforeKeyDown", "beforeLanguageChange", "beforeLoadData", "beforeMergeCells", "beforeOnCellContextMenu", "beforeOnCellMouseDown", "beforeOnCellMouseOut", "beforeOnCellMouseOver", "beforeOnCellMouseUp", "beforePageChange", "beforePageSizeChange", "beforePaste", "beforeRedo", "beforeRedoStackChange", "beforeRefreshDimensions", "beforeRemoveCellClassNames", "beforeRemoveCellMeta", "beforeRemoveCol", "beforeRemoveRow", "beforeRender", "beforeRenderer", "beforeRowMove", "beforeRowResize", "beforeRowWrap", "beforeSelectColumns", "beforeSelectionFocusSet", "beforeSelectionHighlightSet", "beforeSelectRows", "beforeSetCellMeta", "beforeSetRangeEnd", "beforeSetRangeStart", "beforeSetRangeStartOnly", "beforeStretchingColumnWidth", "beforeTouchScroll", "beforeTrimRow", "beforeUndo", "beforeUndoStackChange", "beforeUnhideColumns", "beforeUnhideRows", "beforeUnmergeCells", "beforeUntrimRow", "beforeUpdateData", "beforeValidate", "beforeValueRender", "beforeViewportScroll", "beforeViewportScrollHorizontally", "beforeViewportScrollVertically", "beforeViewRender", "beforeWidthChange", "construct", "init", "modifyAutoColumnSizeSeed", "modifyAutofillRange", "modifyColHeader", "modifyColumnHeaderHeight", "modifyColumnHeaderValue", "modifyColWidth", "modifyCopyableRange", "modifyFiltersMultiSelectValue", "modifyFocusedElement", "modifyData", "modifyFocusOnTabNavigation", "modifyGetCellCoords", "modifyGetCoordsElement", "modifyRowData", "modifyRowHeader", "modifyRowHeaderWidth", "modifyRowHeight", "modifyRowHeightByOverlayName", "modifySourceData", "modifyTransformEnd", "modifyTransformFocus", "modifyTransformStart", "persistentStateLoad", "persistentStateReset", "persistentStateSave"] }] });
181
534
  }
182
535
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: PdfViewerComponent, decorators: [{
183
536
  type: Component,
184
- args: [{ selector: 'sgdea-document-viewer', standalone: true, imports: [CommonModule, NgxExtendedPdfViewerModule], providers: [NgxExtendedPdfViewerService], template: "<div *ngIf=\"loading()\" class=\"loader\">\r\n Cargando documento...\r\n</div>\r\n\r\n<div *ngIf=\"errorMessage() && !loading()\" class=\"error-message\">\r\n {{ errorMessage() }}\r\n</div>\r\n\r\n<div class=\"pdf-viewer-container\">\r\n <ngx-extended-pdf-viewer\r\n *ngIf=\"pdfSrc && !loading()\"\r\n [src]=\"pdfSrc\"\r\n height=\"auto\"\r\n useBrowserLocale=\"false\"\r\n [showDownloadButton]=\"false\"\r\n [showPrintButton]=\"false\"\r\n [showOpenFileButton]=\"false\"\r\n [showSecondaryToolbarButton]=\"false\"\r\n [showFirstAndLastPageButtons]=\"false\"\r\n [showPagingButtons]=\"false\"\r\n [showZoomButtons]=\"false\"\r\n [showDrawEditor]=\"false\"\r\n [showTextEditor]=\"false\"\r\n [showStampEditor]=\"false\"\r\n [showHighlightEditor]=\"false\"\r\n >\r\n </ngx-extended-pdf-viewer>\r\n</div>\r\n\r\n", styles: [".loader,.error-message{padding:1rem;text-align:center}.error-message{color:#b71c1c;background-color:#ffebee;border:1px solid #ef5350;border-radius:4px;margin:1rem 0}.pdf-viewer-container{flex:1;min-height:0;width:100%;display:flex;flex-direction:column}.pdf-viewer-container ngx-extended-pdf-viewer{flex:1;min-height:0}\n"] }]
185
- }], ctorParameters: () => [{ type: i1$1.ActivatedRoute }, { type: DocumentViewerFileService }, { type: i3.NgxExtendedPdfViewerService }], propDecorators: { nameFile: [{
537
+ args: [{ selector: 'sgdea-document-viewer', standalone: true, imports: [CommonModule, NgxExtendedPdfViewerModule, HotTableModule], template: "<div *ngIf=\"loading()\" class=\"loader\">Cargando documento...</div>\n\n<div *ngIf=\"errorMessage() && !loading()\" class=\"error-message\">\n {{ errorMessage() }}\n</div>\n\n<div *ngIf=\"!loading() && !errorMessage()\" class=\"document-viewer-container\">\n\n <!-- PDF -->\n <ngx-extended-pdf-viewer\n *ngIf=\"fileType() === 'pdf' && pdfSrc\"\n [src]=\"pdfSrc\"\n height=\"auto\"\n useBrowserLocale=\"false\"\n [showDownloadButton]=\"false\"\n [showPrintButton]=\"false\"\n [showOpenFileButton]=\"false\"\n [showSecondaryToolbarButton]=\"false\"\n [showFirstAndLastPageButtons]=\"false\"\n [showPagingButtons]=\"false\"\n [showZoomButtons]=\"true\"\n [showDrawEditor]=\"false\"\n [showTextEditor]=\"false\"\n [showStampEditor]=\"false\"\n [showHighlightEditor]=\"false\"\n >\n </ngx-extended-pdf-viewer>\n\n <!-- Imagen -->\n <div *ngIf=\"isImageType() && imageSrc\" class=\"image-viewer\">\n <div class=\"image-toolbar\">\n <button (click)=\"zoomIn()\" title=\"Acercar (Ctrl +)\">\u2795</button>\n <button (click)=\"zoomOut()\" title=\"Alejar (Ctrl -)\">\u2796</button>\n <span class=\"separator\"></span>\n <button (click)=\"rotateLeft()\" title=\"Rotar izquierda (\u21BA)\">\u21BA</button>\n <button (click)=\"rotateRight()\" title=\"Rotar derecha (\u21BB)\">\u21BB</button>\n\n <span class=\"zoom-info\">{{ zoomLevel() }}%</span>\n <span class=\"rotation-info\" *ngIf=\"rotation() !== 0\">\n {{ rotation() }}\u00B0\n </span>\n\n <span class=\"image-dimensions\" *ngIf=\"imageDimensions.width\">\n {{ imageDimensions.width }} x {{ imageDimensions.height }}\n </span>\n </div>\n\n <div class=\"image-container\" #imageContainer (wheel)=\"onMouseWheel($event)\">\n <img\n #mainImage\n [src]=\"imageSrc\"\n [alt]=\"fileName()\"\n [style.transform]=\"getImageTransform()\"\n [style.cursor]=\"getCursorStyle()\"\n (load)=\"onImageLoad()\"\n (mousedown)=\"startDrag($event)\"\n (mousemove)=\"onDrag($event)\"\n (mouseup)=\"stopDrag()\"\n (mouseleave)=\"stopDrag()\"\n class=\"zoomable-image\"\n />\n </div>\n\n <div class=\"image-footer\" *ngIf=\"zoomLevel() > 100\">\n <small>Arrastra para mover la imagen</small>\n </div>\n </div>\n\n <!-- Excel -->\n <div *ngIf=\"isExcelType()\" class=\"excel-viewer-container\">\n <div *ngIf=\"excelSheetNames.length > 1\" class=\"excel-sheet-tabs\">\n <button\n *ngFor=\"let sheet of excelSheetNames; let i = index\"\n type=\"button\"\n class=\"excel-sheet-tab\"\n [class.active]=\"excelCurrentSheetIndex() === i\"\n (click)=\"selectExcelSheet(i)\"\n >\n {{ sheet }}\n </button>\n </div>\n\n <hot-table\n *ngIf=\"showExcelViewer\"\n #hotTable\n [settings]=\"excelSettings\"\n [data]=\"excelData\"\n [colHeaders]=\"excelColumnHeaders\"\n [rowHeaders]=\"true\"\n [width]=\"'100%'\"\n [height]=\"'100%'\"\n licenseKey=\"non-commercial-and-evaluation\"\n [columns]=\"excelColumns\"\n >\n </hot-table>\n\n <div *ngIf=\"!showExcelViewer\" class=\"loader\">\n Cargando hoja...\n </div>\n </div>\n</div>\n\n", styles: ["html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}.document-viewer-container{height:100vh;width:100%;display:flex;flex-direction:column;padding:20px;box-sizing:border-box;background-color:#f5f5f5;overflow:hidden}.loader,.error-message{text-align:center;padding:40px 20px;font-family:Arial,sans-serif;background-color:#fff;border-radius:4px;margin:20px;box-shadow:0 2px 4px #0000001a}.error-message{color:#d32f2f;background-color:#ffebee;border:1px solid #ffcdd2}::ng-deep ngx-extended-pdf-viewer{flex:1 1 auto;min-height:0;height:auto;width:calc(100% - 20px);margin:10px;border:1px solid #ddd;border-radius:4px;display:block}\n"] }]
538
+ }], ctorParameters: () => [{ type: i1$1.ActivatedRoute }, { type: DocumentViewerFileService }], propDecorators: { nameFile: [{
186
539
  type: Input
187
540
  }], nameBucket: [{
188
541
  type: Input
@@ -192,6 +545,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
192
545
  type: Input
193
546
  }], token: [{
194
547
  type: Input
548
+ }], imageContainer: [{
549
+ type: ViewChild,
550
+ args: ['imageContainer']
551
+ }], mainImage: [{
552
+ type: ViewChild,
553
+ args: ['mainImage']
195
554
  }] } });
196
555
 
197
556
  /*